Closed NasenSpray closed 8 years ago
The effect of HALT in this case is actually a bit more complicated than simply continuing as normal (well, on anything that's not a GBC). True, the CPU is not suspended, but the following instruction after HALT is "skipped", or rather its opcode gets executed twice. It's unusual behavior, but only for DMG, MBP, and SGB units. It's not a one-line fix, so I'll get to this later (long work day today...)
Thanks for looking into this edge case though! The DMG core was written quite a while ago and is based on some of my oldest efforts when I got into emulation. So it's not exactly complete in every regard.
yeah, I've read about that. In my fork, I only fixed the not HALTing part:
//HALT
case 0x76:
halt = interrupt;
cycles += 4;
break;
Forgot to close this, but it should be fixed as of 37318afadc95de83d506c9e2f56ca72c698b2c8a