git.y1.nz

gbdk-2020

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

commit 8fb4565ce5837b672f848a288f4f8f9f12d63c79
parent 3bc301b803ed95fad1d24019fcba7e7a632175be
Author: Toxa <56631470+untoxa@users.noreply.github.com>
Date:   Fri, 14 Jul 2023 17:02:06 +0300

Merge pull request #540 from michel-iwaniec/nes_init_areas

NES: Fix recent regression caused by improper initialization of jmp_to_VBL_isr / jmp_to_LCD_isr
Diffstat:
Mgbdk-lib/libc/targets/mos6502/color.s5++---
Mgbdk-lib/libc/targets/mos6502/font.s6+++---
Mgbdk-lib/libc/targets/mos6502/nes/crt0.s14++------------
Mgbdk-lib/libc/targets/mos6502/nes/lcd.s4++--
Mgbdk-lib/libc/targets/mos6502/nes/metasprites_hide_spr.s4++--
5 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/gbdk-lib/libc/targets/mos6502/color.s b/gbdk-lib/libc/targets/mos6502/color.s @@ -3,7 +3,7 @@ .title "Colors" .module colors - .area _INITIALIZED + .area _DATA __current_1bpp_colors:: .fg_colour:: @@ -11,7 +11,6 @@ __current_1bpp_colors:: .bg_colour:: .ds 1 - .area _INITIALIZER - + .area _XINIT .db 0x03 ; .fg_colour .db 0x00 ; .bg_color diff --git a/gbdk-lib/libc/targets/mos6502/font.s b/gbdk-lib/libc/targets/mos6502/font.s @@ -43,17 +43,17 @@ .globl _set_bkg_1bpp_data, _set_bkg_data - .area _INITIALIZED + .area _DATA .curx:: ; Cursor position .ds 0x01 .cury:: .ds 0x01 - .area _INITIALIZER + .area _XINIT .db 0x00 ; .curx .db 0x00 ; .cury - .area _DATA + .area _BSS ; The current font font_handle_base: font_current:: diff --git a/gbdk-lib/libc/targets/mos6502/nes/crt0.s b/gbdk-lib/libc/targets/mos6502/nes/crt0.s @@ -414,6 +414,7 @@ __crt0_RESET_bankSwitchValue: stx OAMADDR lda #>_shadow_OAM sta OAMDMA + ; Perform initialization of DATA area lda #<s__XINIT sta ___memcpy_PARM_2 @@ -426,18 +427,7 @@ __crt0_RESET_bankSwitchValue: lda #<s__DATA ldx #>s__DATA jsr ___memcpy - ; Perform initialization of INITIALIZED area - lda #<s__INITIALIZER - sta ___memcpy_PARM_2 - lda #>s__INITIALIZER - sta ___memcpy_PARM_2+1 - lda #<l__INITIALIZER - sta ___memcpy_PARM_3 - lda #>l__INITIALIZER - sta ___memcpy_PARM_3+1 - lda #<s__INITIALIZED - ldx #>s__INITIALIZED - jsr ___memcpy + ; Set bank to first lda #0x00 sta *__current_bank diff --git a/gbdk-lib/libc/targets/mos6502/nes/lcd.s b/gbdk-lib/libc/targets/mos6502/nes/lcd.s @@ -5,11 +5,11 @@ .area _ZP (PAG) __lcd_scanline:: .ds 1 -.area _INITIALIZED +.area _DATA .jmp_to_VBL_isr:: .ds 3 .jmp_to_LCD_isr:: .ds 3 -.area _INITIALIZER +.area _XINIT ; .jmp_to_VBL_isr rts nop diff --git a/gbdk-lib/libc/targets/mos6502/nes/metasprites_hide_spr.s b/gbdk-lib/libc/targets/mos6502/nes/metasprites_hide_spr.s @@ -5,10 +5,10 @@ .globl ___render_shadow_OAM - .area _INITIALIZED + .area _DATA ___render_shadow_OAM:: .ds 0x01 - .area _INITIALIZER + .area _XINIT .db #>_shadow_OAM .area _HOME

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