Dooskington / GameLad

:tv: An (almost) fully featured Game Boy emulator.
MIT License
470 stars 33 forks source link

bank 0 and 1 overlap? #108

Closed Bashinerox closed 4 years ago

Bashinerox commented 6 years ago

It looks like bank1 is starting at the wrong address. the else prevents it from being an actual bug, unless you ever remove the else clause...

if (address >= 0xC000 && address <= 0xCFFF)
    {
        return m_bank0[address - 0xC000];
    }
    else if (address >= 0xC000 && address <= 0xDFFF) // <== bank 1 is starting at 0xC000 instead of 0xD000
    {
        return m_bank1[address - 0xD000];
    }
Dooskington commented 6 years ago

Ooh. Nice catch.

As you pointed out this doesn't cause any issues, but I'll probably get in there and fix this next time I get a chance.