Seems like I forgot to finish implementing the stop instruction!

This commit is contained in:
Lior Halphon 2016-06-14 14:12:13 +03:00
parent 52afba21d1
commit e6c4b4d1b2
2 changed files with 2 additions and 2 deletions

View File

@ -198,7 +198,7 @@ void display_vblank(GB_gameboy_t *gb)
frames++;
*/
if (!(gb->io_registers[GB_IO_LCDC] & 0x80)) {
if (!(gb->io_registers[GB_IO_LCDC] & 0x80) || gb->stopped) {
/* LCD is off, memset screen to white */
memset(gb->screen, 0xFF, 160 * 144 * 4);
}

View File

@ -1333,7 +1333,7 @@ void cpu_run(GB_gameboy_t *gb)
/* Run pseudo instructions rst 40-60*/
rst(gb, 0x87 + interrupt_bit * 8);
}
else if(!gb->halted) {
else if(!gb->halted && !gb->stopped) {
unsigned char opcode = read_memory(gb, gb->pc);
opcodes[opcode](gb, opcode);
}