Pico.video.addr=(unsigned short)(Pico.video.addr+Pico.video.reg[0xf]);\r
}\r
\r
+static NOINLINE void VideoWrite128(u32 a, u16 d)\r
+{\r
+ // nasty\r
+ a = ((a & 2) >> 1) | ((a & 0x400) >> 9) | (a & 0x3FC) | ((a & 0x1F800) >> 1);\r
+ ((u8 *)Pico.vram)[a] = d;\r
+}\r
+\r
static void VideoWrite(u16 d)\r
{\r
unsigned int a=Pico.video.addr;\r
case 3: Pico.m.dirtyPal = 1;\r
Pico.cram [(a>>1)&0x003f]=d; break; // wraps (Desert Strike)\r
case 5: Pico.vsram[(a>>1)&0x003f]=d; break;\r
+ case 0x81:\r
+ a |= Pico.video.addr_u << 16;\r
+ VideoWrite128(a, d);\r
+ break;\r
//default:elprintf(EL_ANOMALY, "VDP write %04x with bad type %i", d, Pico.video.type); break;\r
}\r
\r
}\r
break;\r
\r
+ case 0x81: // vram 128k\r
+ a |= Pico.video.addr_u << 16;\r
+ for(; len; len--)\r
+ {\r
+ VideoWrite128(a, base[source++ & mask]);\r
+ // AutoIncrement\r
+ a = (a + inc) & 0x1ffff;\r
+ }\r
+ Pico.video.addr_u = a >> 16;\r
+ break;\r
+\r
default:\r
if (Pico.video.type != 0 || (EL_LOGMASK & EL_VDPDMA))\r
elprintf(EL_VDPDMA|EL_ANOMALY, "DMA with bad type %i", Pico.video.type);\r
Pico.video.reg[0x16] = source >> 8;\r
}\r
\r
-static void CommandChange(void)\r
+static NOINLINE void CommandChange(void)\r
{\r
- struct PicoVideo *pvid=&Pico.video;\r
- unsigned int cmd=0,addr=0;\r
+ struct PicoVideo *pvid = &Pico.video;\r
+ unsigned int cmd, addr;\r
\r
- cmd=pvid->command;\r
+ cmd = pvid->command;\r
\r
// Get type of transfer 0xc0000030 (v/c/vsram read/write)\r
- pvid->type=(unsigned char)(((cmd>>2)&0xc)|(cmd>>30));\r
+ pvid->type = (u8)(((cmd >> 2) & 0xc) | (cmd >> 30));\r
+ if (pvid->type == 1) // vram\r
+ pvid->type |= pvid->reg[1] & 0x80; // 128k\r
\r
// Get address 0x3fff0003\r
- addr =(cmd>>16)&0x3fff;\r
- addr|=(cmd<<14)&0xc000;\r
- pvid->addr=(unsigned short)addr;\r
+ addr = (cmd >> 16) & 0x3fff;\r
+ addr |= (cmd << 14) & 0xc000;\r
+ pvid->addr = (u16)addr;\r
+ pvid->addr_u = (u8)((cmd >> 2) & 1);\r
}\r
\r
static void DrawSync(int blank_on)\r