- if(num==00) dprintf("hint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[0]&0x10)>>4, (d&0x10)>>4, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x10)>>4, SekPc);\r
- if(num==01) dprintf("vint_onoff: %i->%i [%i|%i] pend=%i @ %06x", (pvid->reg[1]&0x20)>>5, (d&0x20)>>5, Pico.m.scanline, SekCyclesDone(), (pvid->pending_ints&0x20)>>5, SekPc);\r
- //if(num==01) dprintf("set_blank: %i @ %06x [%i|%i]", !((d&0x40)>>6), SekPc, Pico.m.scanline, SekCyclesDone());\r
- //if(num==05) dprintf("spr_set: %i @ %06x [%i|%i]", (unsigned char)d, SekPc, Pico.m.scanline, SekCyclesDone());\r
- //if(num==10) dprintf("hint_set: %i @ %06x [%i|%i]", (unsigned char)d, SekPc, Pico.m.scanline, SekCyclesDone());\r
+ int dold=pvid->reg[num];\r
+ int update_irq = 0, blank_on = 0;\r
+ pvid->type=0; // register writes clear command (else no Sega logo in Golden Axe II)\r
+ if (num > 0x0a && !(pvid->reg[1]&4)) {\r
+ elprintf(EL_ANOMALY, "%02x written to reg %02x in SMS mode @ %06x", d, num, SekPc);\r
+ return;\r
+ }\r
+\r
+ switch (num)\r
+ {\r
+ case 0x00:\r
+ elprintf(EL_INTSW, "hint_onoff: %i->%i [%i] pend=%i @ %06x", (dold&0x10)>>4,\r
+ (d&0x10)>>4, SekCyclesDone(), (pvid->pending_ints&0x10)>>4, SekPc);\r
+ update_irq = 1;\r
+ break;\r
+ case 0x01:\r
+ elprintf(EL_INTSW, "vint_onoff: %i->%i [%i] pend=%i @ %06x", (dold&0x20)>>5,\r
+ (d&0x20)>>5, SekCyclesDone(), (pvid->pending_ints&0x20)>>5, SekPc);\r
+ if (!(d&0x40) && SekCyclesLeft > 390) blank_on = 1;\r
+ update_irq = 1;\r
+ break;\r
+ case 0x05:\r
+ if (d^dold) rendstatus |= PDRAW_SPRITES_MOVED;\r
+ break;\r
+ case 0x0c:\r
+ // renderers should update their palettes if sh/hi mode is changed\r
+ if ((d^dold)&8) Pico.m.dirtyPal = 2;\r
+ break;\r
+ }\r
+ DrawSync(blank_on);\r