Update of /cvsroot/lapetus/lapetus
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5936
Modified Files:
vdpinit.c
Log Message:
-Now when VDP's are initialized, VDP1 is put in a useable state.
Index: vdpinit.c
===================================================================
RCS file: /cvsroot/lapetus/lapetus/vdpinit.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vdpinit.c 3 Mar 2007 02:59:05 -0000 1.3
+++ vdpinit.c 4 Jul 2007 02:29:36 -0000 1.4
@@ -42,6 +42,7 @@
void VdpInit(int res)
{
int i;
+ u16 EWRR;
// Make sure VDP2 is in a sane state
VDP2_REG_TVMD = res;
@@ -99,6 +100,34 @@
for (i = 0; i < 0x80000; i+=2)
*((volatile u16 *)(VDP1_RAM+i)) = 0x0000;
+ // Set end code in first entry
+ *((volatile u16 *)(VDP1_RAM)) = 0x8000;
+
+ // Set Sprite priorities
+ VDP2_REG_PRISA = 0x0707;
+ VDP2_REG_PRISB = 0x0707;
+ VDP2_REG_PRISC = 0x0707;
+ VDP2_REG_PRISD = 0x0707;
+
+ // Enable VDP1
+ VDP1_REG_FBCR = 0x0000;
+ VDP1_REG_TVMR = 0x0000;
+ VDP1_REG_EWDR = 0x0000;
+ VDP1_REG_EWLR = (0 << 9) | 0;
+
+ if (vdp2settings.screenwidth <= 512)
+ EWRR = (vdp2settings.screenwidth << 9);
+ else
+ EWRR = (512 << 9);
+
+ if (vdp2settings.screenheight <= 256)
+ EWRR |= vdp2settings.screenheight;
+ else
+ EWRR |= 256;
+
+ VDP1_REG_EWRR = EWRR;
+ VDP1_REG_PTMR = 0x0002;
+
// Clear VDP2 Ram
for (i = 0; i < 0x80000; i+=2)
*((volatile u16 *)(VDP2_RAM+i)) = 0x0000;
|