git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit d009bfeeda801a44bea741c794be463782b81956
parent 0c243451c582c0420d674673d05091327327168d
Author: Michel Iwaniec <46843052+michel-iwaniec@users.noreply.github.com>
Date:   Sun, 20 Oct 2024 00:10:49 +0100

NES: Fix bug with multiple column attribute updates (#721)

* Make sure that each column re-adds PPU lo offset instead of storing it
* Wrap functionality in a macro WRITEVERT
Diffstat:
Mgbdk-lib/libc/targets/mos6502/nes/flush_attributes.s29+++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/gbdk-lib/libc/targets/mos6502/nes/flush_attributes.s b/gbdk-lib/libc/targets/mos6502/nes/flush_attributes.s @@ -82,29 +82,30 @@ _flush_shadow_attributes_columns_next_column: _flush_shadow_attributes_columns_end: rts -; -; Flushes all dirty rows of _attribute_shadow by writing them to PPU memory -; -_flush_shadow_attributes_update_column: - ; Update all 8 bytes of column for now, as each column in _attribute_column_dirty only stores 1 bit - ; As PPU has no increment-by-8 feature, split writes into 4 separate stripes 2 bytes each - ; TODO: Could make a dedicated unrolled transfer routine in nmi handler that writes all 8 bytes as one stripe. - i = 0 - .rept 4 +.macro WRITEVERT lda *.tmp+1 tax lda *.tmp + clc + adc #(8*i) jsr .ppu_stripe_begin_vertical lda _attribute_shadow+8*i,y jsr .ppu_stripe_write_byte lda _attribute_shadow+8*i+32,y jsr .ppu_stripe_write_byte jsr .ppu_stripe_end - ; - lda *.tmp - clc - adc #8 - sta *.tmp +.endm + +; +; Flushes all dirty rows of _attribute_shadow by writing them to PPU memory +; +_flush_shadow_attributes_update_column: + ; Update all 8 bytes of column for now, as each column in _attribute_column_dirty only stores 1 bit + ; As PPU has no increment-by-8 feature, split writes into 4 separate stripes 2 bytes each + ; TODO: Could make a dedicated unrolled transfer routine in nmi handler that writes all 8 bytes as one stripe. + i = 0 + .rept 4 + WRITEVERT i = i + 1 .endm jmp _flush_shadow_attributes_columns_next_column

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.