sameboi: fix lag flag and input callback on non-sgb mode

This commit is contained in:
nattthebear 2017-07-20 18:39:51 -04:00
parent fd63acd644
commit d640c16cff
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -135,13 +135,15 @@ static uint8_t read_high_memory(GB_gameboy_t *gb, uint16_t addr)
} }
if (addr < 0xFF80) { if (addr < 0xFF80) {
if (addr == 0xff00 && gb->is_sgb) if (addr == 0xff00)
{ {
if (gb->input_callback) if (gb->input_callback)
gb->input_callback(gb); gb->input_callback(gb);
gb->lagged = false; gb->lagged = false;
if (gb->is_sgb) {
return sgb_read_ff00(gb->cycles_since_epoch); return sgb_read_ff00(gb->cycles_since_epoch);
} }
}
switch (addr & 0xFF) { switch (addr & 0xFF) {
case GB_IO_IF: case GB_IO_IF: