deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
283 stars 40 forks source link

selected_rom_bank should be uint16_t? #48

Closed Ryzee119 closed 3 years ago

Ryzee119 commented 3 years ago

Defined here: https://github.com/deltabeard/Peanut-GB/blob/bf98d5b1297196962be9117d56689aae829e2732/peanut_gb.h#L394

MBC5 uses a 9th bit for ROM banking.

Currently code like this wont work as expected: https://github.com/deltabeard/Peanut-GB/blob/bf98d5b1297196962be9117d56689aae829e2732/peanut_gb.h#L761

deltabeard commented 3 years ago

Thank you!