gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit b62ae081850a11a3cb89ad6f96ef5eb06a5e0c08 parent 5e2daa6bf113141c4dd5d0f2437953e3925699c7 Author: Toxa <56631470+untoxa@users.noreply.github.com> Date: Sat, 1 Jul 2023 11:27:59 +0300 Merge pull request #530 from michel-iwaniec/nes_fix_vertical_stripes NES: Fix bug with vertical stripes not working in direct mode Diffstat:
| M | gbdk-lib/libc/targets/mos6502/nes/vram_transfer_buffer.s | 30 | ++++++++++++++++-------------- |
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/gbdk-lib/libc/targets/mos6502/nes/vram_transfer_buffer.s b/gbdk-lib/libc/targets/mos6502/nes/vram_transfer_buffer.s @@ -56,33 +56,35 @@ __vram_transfer_buffer_temp:: .ds 1 ; .ppu_stripe_begin_horizontal:: clc - jmp .ppu_stripe_begin + bit *.crt0_forced_blanking + bpl .ppu_stripe_begin_indirect + ; Direct write + stx PPUADDR + sta PPUADDR + ; Clear inc-by-32 bit in both PPUCTRL and _shadow_PPUCTRL, as NMI may re-write PPUCTRL + lda *_shadow_PPUCTRL + and #0xFB + sta *_shadow_PPUCTRL + sta PPUCTRL + rts ; ; Begin a vertical stripe ; .ppu_stripe_begin_vertical:: sec - jmp .ppu_stripe_begin - -; -; Begin a stripe (carry indicates vertical stripe) -; -.ppu_stripe_begin:: bit *.crt0_forced_blanking - bpl 1$ + bpl .ppu_stripe_begin_indirect ; Direct write stx PPUADDR sta PPUADDR - ; Set inc-by-32 bit in PPUCTRL as well - lda #0 - rol - asl - asl + ; Set inc-by-32 bit in both PPUCTRL and _shadow_PPUCTRL, as NMI may re-write PPUCTRL lda *_shadow_PPUCTRL + ora #0x04 + sta *_shadow_PPUCTRL sta PPUCTRL rts -1$: + .ppu_stripe_begin_indirect: ; Indirect write via transfer buffer sty *__vram_transfer_buffer_temp
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.