| @@ -30,7 +30,7 @@ PFLAGS += -g | |||||
| #PFLAGS += -DDEBUG_APU | #PFLAGS += -DDEBUG_APU | ||||
| #PFLAGS += -DDEBUG_INPUT | #PFLAGS += -DDEBUG_INPUT | ||||
| #PFLAGS += -DE6502_DEBUG | #PFLAGS += -DE6502_DEBUG | ||||
| PFLAGS += -DE6502_ILLEGAL | |||||
| #PFLAGS += -DE6502_ILLEGAL | |||||
| CFLAGS += $(PFLAGS) -Wall -Werror -Wshadow -Wunused -I../ -Isrc/ | CFLAGS += $(PFLAGS) -Wall -Werror -Wshadow -Wunused -I../ -Isrc/ | ||||
| CFLAGS += -Iinc/$(PLATFORM)/SDL2 | CFLAGS += -Iinc/$(PLATFORM)/SDL2 | ||||
| LDFLAGS += $(PFLAGS) | LDFLAGS += $(PFLAGS) | ||||
| @@ -277,8 +277,8 @@ nes_ppu_Result nes_ppu_run(nes_ppu* ppu, int cycles) { | |||||
| if ( ppu->scanline > nes_ppu_prerender && | if ( ppu->scanline > nes_ppu_prerender && | ||||
| ppu->scanline < nes_ppu_render) { | ppu->scanline < nes_ppu_render) { | ||||
| ppu->scroll_y++; | ppu->scroll_y++; | ||||
| if (ppu->scroll_y >= nes_ppu_render_h) { | |||||
| ppu->scroll_y -= nes_ppu_render_h; | |||||
| if (ppu->scroll_y == nes_ppu_render_h) { | |||||
| ppu->scroll_y = 0; | |||||
| ppu->control ^= 0b10; | ppu->control ^= 0b10; | ||||
| } | } | ||||
| } | } | ||||
| @@ -362,6 +362,7 @@ static void render_bg_scanline(const nes_ppu* ppu,/* int scanline,*/ | |||||
| int page = (ppu->control & ppu_Control_Nametable_Mask); | int page = (ppu->control & ppu_Control_Nametable_Mask); | ||||
| int x = ppu->scroll_x; | int x = ppu->scroll_x; | ||||
| int y = ppu->scroll_y; | int y = ppu->scroll_y; | ||||
| if (y >= nes_ppu_render_h) y -= nes_ppu_render_h; | |||||
| int w = (nes_ppu_render_w - x); | int w = (nes_ppu_render_w - x); | ||||
| if (!(ppu->mask & ppu_Mask_Left_Back)) { | if (!(ppu->mask & ppu_Mask_Left_Back)) { | ||||
| // Handle column 0 flag - need to fill with transparency | // Handle column 0 flag - need to fill with transparency | ||||