diff options
| author | Peter Fors <peter.fors@mindkiller.com> | 2025-11-02 09:16:03 +0100 |
|---|---|---|
| committer | Peter Fors <peter.fors@mindkiller.com> | 2025-11-02 09:16:03 +0100 |
| commit | ed41715142f419021ed8fef5522ea1f363f16441 (patch) | |
| tree | 9cf0049db6ac5b0da5552bba9e0376b82eaeb2b4 /mknes_ppu.c | |
| parent | e137c881d835703d1030746cd7262899de7169c6 (diff) | |
fix multiple mappers
Diffstat (limited to 'mknes_ppu.c')
| -rw-r--r-- | mknes_ppu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mknes_ppu.c b/mknes_ppu.c index 1a40de0..8006ff6 100644 --- a/mknes_ppu.c +++ b/mknes_ppu.c @@ -277,13 +277,14 @@ shift_and_fetch: switch(dot % 8) { case 1: { - uint32_t nt_addr = 0x2000 | (ppu->vram_addr & 0x0fff); - ppu->bg_next_tile_id = state->mapper_function.ciram_read(state, nt_addr); + // uint32_t nt_addr = 0x2000 | (ppu->vram_addr & 0xfff); + // ppu->bg_next_tile_id = state->mapper_function.ciram_read(state, nt_addr); + ppu->bg_next_tile_id = state->mapper_function.ciram_read(state, ppu->vram_addr); } break; case 3: { uint32_t attr_addr = 0x23c0 | (ppu->vram_addr & 0x0c00) | ((ppu->vram_addr >> 4) & 0x38) | ((ppu->vram_addr >> 2) & 0x07); - uint8_t attr = state->mapper_function.ciram_read(state, attr_addr & 0x0fff); + uint8_t attr = state->mapper_function.ciram_read(state, attr_addr); uint8_t shift = ((ppu->vram_addr >> 4) & 4) | (ppu->vram_addr & 2); ppu->bg_next_tile_attrib = (attr >> shift) & 3; } break; |
