git.y1.nz

gbdk-2020

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

commit ac2326e1b82afb2d2e1d967f2fddbe311730a02c
parent 1f6f10b6fda3b2079e18a01b61ec7042231bfe46
Author: Toxa <untoxa@mail.ru>
Date:   Fri, 19 Aug 2022 23:49:06 +0300

GB: switch off display closer to start

Diffstat:
Mgbdk-lib/libc/targets/sm83/ap/crt0.s11+++++------
Mgbdk-lib/libc/targets/sm83/duck/crt0.s10+++++-----
Mgbdk-lib/libc/targets/sm83/gb/crt0.s10+++++-----
3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/gbdk-lib/libc/targets/sm83/ap/crt0.s b/gbdk-lib/libc/targets/sm83/ap/crt0.s @@ -107,7 +107,6 @@ _refresh_OAM:: JP .refresh_OAM + (.refresh_OAM_DMA - .start_refresh_OAM) .clear_WRAM: - PUSH DE XOR A LD BC, #l__DATA LD HL, #s__DATA @@ -120,7 +119,6 @@ _refresh_OAM:: LD L, A LD C, #(40 << 2) ; 40 entries 4 bytes each RST 0x28 - POP DE RET ;; GameBoy Header @@ -192,7 +190,12 @@ _reset:: ;; Initialize the stack LD SP, #.STACK + PUSH DE + ;; Turn the screen off + CALL .display_off + ;; Clear the static storage CALL .clear_WRAM + POP DE ; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM @@ -206,10 +209,6 @@ _reset:: RLA LD (__is_GBA), A 1$: - - ;; Turn the screen off - CALL .display_off - XOR A ;; Initialize the display LDH (.SCY),A diff --git a/gbdk-lib/libc/targets/sm83/duck/crt0.s b/gbdk-lib/libc/targets/sm83/duck/crt0.s @@ -108,7 +108,6 @@ _refresh_OAM:: JP .refresh_OAM + (.refresh_OAM_DMA - .start_refresh_OAM) .clear_WRAM: - PUSH DE XOR A LD BC, #l__DATA LD HL, #s__DATA @@ -121,7 +120,6 @@ _refresh_OAM:: LD L, A LD C, #(40 << 2) ; 40 entries 4 bytes each RST 0x28 - POP DE RET .org 0x150 @@ -136,7 +134,12 @@ _reset:: ;; Initialize the stack LD SP, #.STACK + PUSH DE + ;; Turn the screen off + CALL .display_off + ;; Clear the static storage CALL .clear_WRAM + POP DE ; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM @@ -146,9 +149,6 @@ _reset:: XOR A LD (__is_GBA), A ; and it is never GBA - ;; Turn the screen off - CALL .display_off - XOR A ;; Initialize the display LDH (.SCY),A diff --git a/gbdk-lib/libc/targets/sm83/gb/crt0.s b/gbdk-lib/libc/targets/sm83/gb/crt0.s @@ -107,7 +107,6 @@ _refresh_OAM:: JP .refresh_OAM + (.refresh_OAM_DMA - .start_refresh_OAM) .clear_WRAM: - PUSH DE XOR A LD BC, #l__DATA LD HL, #s__DATA @@ -120,7 +119,6 @@ _refresh_OAM:: LD L, A LD C, #(40 << 2) ; 40 entries 4 bytes each RST 0x28 - POP DE RET ;; GameBoy Header @@ -198,7 +196,12 @@ _reset:: ;; Initialize the stack LD SP, #.STACK + PUSH DE + ;; Turn the screen off + CALL .display_off + ;; Clear the static storage CALL .clear_WRAM + POP DE ; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM @@ -212,9 +215,6 @@ _reset:: RLA LD (__is_GBA), A 1$: - ;; Turn the screen off - CALL .display_off - XOR A ;; Initialize the display LDH (.SCY),A

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