diff options
| author | Peter Fors <peter.fors@mindkiller.com> | 2025-05-02 23:15:47 +0200 |
|---|---|---|
| committer | Peter Fors <peter.fors@mindkiller.com> | 2025-05-02 23:15:47 +0200 |
| commit | 5808f00555c48e1cc1cc110af6a5cd73ddf13010 (patch) | |
| tree | dff942b61441bafe297e7a99f0e799f32ae978b1 /mapper_0042.c | |
| parent | 9463faa436e1b981ef72000568445a83682f2658 (diff) | |
cleanup and rewrite of ppu_registers.c
Diffstat (limited to 'mapper_0042.c')
| -rw-r--r-- | mapper_0042.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/mapper_0042.c b/mapper_0042.c deleted file mode 100644 index 4cf4c86..0000000 --- a/mapper_0042.c +++ /dev/null @@ -1,30 +0,0 @@ - -static void mapper_0042_init(struct nes_state *state) { - state->map.m0042.prg_offset = 0; - state->map.m0042.chr_offset = 0; -} - -static uint8_t mapper_0042_prg_read(struct nes_state *state, uint32_t addr) { - if(addr >= 0x8000) { - uint32_t base = state->map.m0042.prg_offset; - return state->prg_rom[base + (addr - 0x8000)]; - } - return 0; -} - -static void mapper_0042_prg_write(struct nes_state *state, uint32_t addr, uint8_t value) { - if(addr >= 0x8000) { - uint32_t prg_bank = (value >> 4) & 3; - uint32_t chr_bank = (value >> 0) & 3; - - state->map.m0042.prg_offset = prg_bank * 0x8000; - state->map.m0042.chr_offset = chr_bank * 0x2000; - } -} - -static uint8_t mapper_0042_chr_read(struct nes_state *state, uint32_t addr) { - return state->chr_rom[state->map.m0042.chr_offset + addr]; -} - -static void mapper_0042_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) { -} |
