diff options
Diffstat (limited to 'ppu.c')
| -rw-r--r-- | ppu.c | 27 |
1 files changed, 4 insertions, 23 deletions
@@ -69,7 +69,7 @@ static inline void ppu_write(struct nes_state *state, uint32_t offset, uint8_t v case 7: { // 2007 uint32_t addr = ppu->vram_addr & 0x3fff; if(addr < 0x2000) { - // CHR-RAM, skip + state->mapper.chr_write(state, addr, value); } else if(addr < 0x3f00) { state->mapper.ciram_write(state, addr, value); } else if(addr < 0x4000) { @@ -297,29 +297,11 @@ static void ppu_tick(struct nes_state *state) { } ppu->vram_addr = (ppu->vram_addr & ~0x03e0) | (y << 5); } - goto render_and_shift; - } break; + } + __attribute__((fallthrough)); case 1 ... 255: // fallthrough: this is 1->256 -render_and_shift: ppu_render_pixel(state); - - // if(UNLIKELY(dot == 256)) { - // if((ppu->vram_addr & 0x7000) != 0x7000) { - // ppu->vram_addr += 0x1000; - // } else { - // ppu->vram_addr &= ~0x7000; - // uint32_t y = (ppu->vram_addr & 0x03e0) >> 5; - // if(y == 29) { - // y = 0; - // ppu->vram_addr ^= 0x0800; - // } else if(y == 31) { - // y = 0; - // } else { - // y++; - // } - // ppu->vram_addr = (ppu->vram_addr & ~0x03e0) | (y << 5); - // } - // } + ppu_render_pixel(state); __attribute__((fallthrough)); case 321 ... 336: { // fallthrough: the code below has to run 1->256 + 321->336 @@ -404,7 +386,6 @@ render_and_shift: ppu_render_pixel(state); case 261: { switch(dot) { case 256: { - if((ppu->vram_addr & 0x7000) != 0x7000) { ppu->vram_addr += 0x1000; } else { |
