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_0007.c | |
| parent | 9463faa436e1b981ef72000568445a83682f2658 (diff) | |
cleanup and rewrite of ppu_registers.c
Diffstat (limited to 'mapper_0007.c')
| -rw-r--r-- | mapper_0007.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/mapper_0007.c b/mapper_0007.c deleted file mode 100644 index 235f5bb..0000000 --- a/mapper_0007.c +++ /dev/null @@ -1,39 +0,0 @@ - - - -static void mapper_0007_init(struct nes_state *state) { - state->map.m0007.prg_ptr = state->prg_rom; - state->map.m0007.ciram_base = 0x000; -} - -static uint8_t mapper_0007_prg_read(struct nes_state *state, uint32_t addr) { - if(addr >= 0x8000) { - return state->map.m0007.prg_ptr[addr & 0x7fff]; - } - return 0; // openbus -} - -static void mapper_0007_prg_write(struct nes_state *state, uint32_t addr, uint8_t value) { - if(addr >= 0x8000) { - state->map.m0007.prg_ptr = state->prg_rom + ((value & 0x0f) * 0x8000); - state->map.m0007.ciram_base = (value & 0x10) ? 0x400 : 0x000; - } -} - -static uint8_t mapper_0007_chr_read(struct nes_state *state, uint32_t addr) { - return state->chr_ram[addr]; -} - -static void mapper_0007_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) { - state->chr_ram[addr] = value; -} - -static uint8_t mapper_0007_ciram_read(struct nes_state *state, uint32_t addr) { - addr = state->map.m0007.ciram_base | (addr & 0x3ff); - return state->ciram[addr]; -} - -static void mapper_0007_ciram_write(struct nes_state *state, uint32_t addr, uint8_t value) { - addr = state->map.m0007.ciram_base | (addr & 0x3ff); - state->ciram[addr] = value; -} |
