diff options
| author | Peter Fors <peter.fors@mindkiller.com> | 2025-04-05 08:58:12 +0200 |
|---|---|---|
| committer | Peter Fors <peter.fors@mindkiller.com> | 2025-04-05 08:58:12 +0200 |
| commit | f1bd6a7d2f4ffe3e5263e0254bcf7522ab381264 (patch) | |
| tree | e75bde292329f337d619f9a997aab9b17c37e38b /mapper_0000.c | |
| parent | 8c82be43720d9e221a9e2541c9ff6151015838bb (diff) | |
transform to switch case for ppu_tick()
Diffstat (limited to 'mapper_0000.c')
| -rw-r--r-- | mapper_0000.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mapper_0000.c b/mapper_0000.c new file mode 100644 index 0000000..e075de5 --- /dev/null +++ b/mapper_0000.c @@ -0,0 +1,24 @@ + + +static void mapper_0000_init(struct nes_state *state) { + // Nothing to initialize for 001 +} + +__attribute__((hot)) +static uint8_t mapper_0000_prg_read(struct nes_state *state, uint32_t addr) { + uint32_t prg_size = state->ines.prg_size; + + uint32_t mask = (state->ines.prg_size == 16384) ? 0x3fff : 0x7fff; + return state->prg_rom[addr & mask]; +} + +static void mapper_0000_prg_write(struct nes_state *state, uint32_t addr, uint8_t value) { +} + +__attribute__((hot)) +static uint8_t mapper_0000_chr_read(struct nes_state *state, uint32_t addr) { + return state->chr_rom[addr]; +} + +static void mapper_0000_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) { +} |
