git.y1.nz

gbdk-2020

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

commit 371c705f862c49bde17fbae0ad441f216915d52f
parent 9a559a426a209ae93ed786ea021bb517caf0987f
Author: Toxa <56631470+untoxa@users.noreply.github.com>
Date:   Wed, 31 Aug 2022 23:10:09 +0300

Merge pull request #403 from michel-iwaniec/nes_relocate_attribute_shadow

NES: Fix bug with global initialized data being initialized to zero
Diffstat:
Mgbdk-lib/libc/targets/mos6502/nes/crt0.s5++---
Mgbdk-lib/libc/targets/mos6502/nes/set_bk_attributes.s4+++-
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gbdk-lib/libc/targets/mos6502/nes/crt0.s b/gbdk-lib/libc/targets/mos6502/nes/crt0.s @@ -10,6 +10,8 @@ ; OAM CPU page _shadow_OAM = 0x200 +; Attribute shadow (64 bytes, leaving 56 bytes available for CPU stack) +_attribute_shadow = 0x188 ; Transfer buffer (lower half of hardware stack) _vram_transfer_buffer = 0x100 @@ -98,9 +100,6 @@ _attribute_row_dirty:: .ds 1 .area _HEAP .area _HEAP_END -.area DATA -_attribute_shadow:: .ds 64 - .area CODE .bndry 0x100 diff --git a/gbdk-lib/libc/targets/mos6502/nes/set_bk_attributes.s b/gbdk-lib/libc/targets/mos6502/nes/set_bk_attributes.s @@ -89,9 +89,11 @@ _set_bkg_attributes:: asl asl ora *.xpos - ora #<_attribute_shadow + clc + adc #<_attribute_shadow sta *.dst lda #>_attribute_shadow + adc #0 sta *.dst+1 jsr .attribute_set_dirty ; Branch into distinct routines based on whether x / y are aligned

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