diff options
author | David McMackins II <contact@mcmackins.org> | 2016-12-02 10:46:47 -0600 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2016-12-02 10:46:47 -0600 |
commit | 31c7fd560f4046901733144141eb1bf0eddbd649 (patch) | |
tree | 5adb3851ac0b25e4066d1a2009ec6250f4cf6e70 | |
parent | 8199ee2a5a7c91e9fd2c1739110a4342872f3e5c (diff) |
Fix bug where switching ROM banks on MBC5 on DMG would fail
-rw-r--r-- | stdgb.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -24,7 +24,11 @@ static uint8_t * const BTN_STATE = (void *) 0xDFA1; void gb_mbc5_select_rombank (uint16_t bank) { - *((uint16_t *) 0x2FFF) = bank; + uint8_t upper = (bank & 0xFF00) >> 8; + uint8_t lower = bank & 0x00FF; + + *((uint8_t *) 0x3000) = upper; + *((uint8_t *) 0x2000) = lower; } static void |