Browse Source

Fix MMC3 bank mirroring

master
Nathaniel Walizer 11 months ago
parent
commit
a694a23736
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/map/mmc3.c

+ 2
- 2
src/map/mmc3.c View File

@@ -38,7 +38,7 @@ typedef struct {
} mmc3_mapper;

static inline uint8_t* mmc3_prg_bank(mmc3_mapper* map, int bank) {
return &map->prg_rom[bank << 13];
return &map->prg_rom[(bank % map->prg_rom_banks) << 13];
}

static inline void mmc3_map_prg(mmc3_mapper* map,
@@ -61,7 +61,7 @@ static inline void mmc3_update_prg(mmc3_mapper* map,
}

static inline uint8_t* mmc3_chr_bank(mmc3_mapper* map, int bank) {
return &map->chr_rom[bank << 10];
return &map->chr_rom[(bank % map->chr_rom_banks) << 10];
}

static inline void mmc3_map_2k_chr(mmc3_mapper* map,


Loading…
Cancel
Save