git.y1.nz

gbdk-2020

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

commit d5968cce3043da406221dd5a8e75f80b9b02fb12
parent 6def65abde949d1c72c45dd1d7274c078e697e2a
Author: Toxa <untoxa@mail.ru>
Date:   Mon,  8 Jun 2026 15:14:59 +0300

GB/AP: more clear code for the GBA detection (same size and cycles)

Diffstat:
Mgbdk-lib/libc/targets/sm83/ap/crt0.s10+++++-----
Mgbdk-lib/libc/targets/sm83/gb/crt0.s10+++++-----
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gbdk-lib/libc/targets/sm83/ap/crt0.s b/gbdk-lib/libc/targets/sm83/ap/crt0.s @@ -222,19 +222,19 @@ _reset:: CALL .clear_WRAM POP DE -; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM - ;; Store CPU type LD A, D LD (__cpu), A CP #.CGB_TYPE JR NZ, 1$ - XOR A - SRL E - RLA + LD A, E + AND #0x01 LD (__is_GBA), A 1$: XOR A + +; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM + ;; Initialize the display LDH (.SCY),A LDH (.SCX),A diff --git a/gbdk-lib/libc/targets/sm83/gb/crt0.s b/gbdk-lib/libc/targets/sm83/gb/crt0.s @@ -228,19 +228,19 @@ _reset:: CALL .clear_WRAM POP DE -; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM - ;; Store CPU type LD A, D LD (__cpu), A CP #.CGB_TYPE JR NZ, 1$ - XOR A - SRL E - RLA + LD A, E + AND #0x01 LD (__is_GBA), A 1$: XOR A + +; LD (.mode),A ; Clearing (.mode) is performed when clearing RAM + ;; Initialize the display LDH (.SCY),A LDH (.SCX),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.