From 6474d431a4b8413288a7450d8aa82a065396bdab Mon Sep 17 00:00:00 2001 From: Randy Thiemann Date: Mon, 23 Oct 2023 06:17:34 +0200 Subject: [PATCH] Clear up a byte of memory. --- src/main.asm | 26 +++++++++++++++++++++++--- src/state_title.asm | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main.asm b/src/main.asm index 1576648..5ba2eee 100644 --- a/src/main.asm +++ b/src/main.asm @@ -28,9 +28,17 @@ INCLUDE "res/title_map.inc" SECTION "High Globals", HRAM hGameState:: ds 1 hSwapAB:: ds 1 -hInitialA:: ds 1 hSimulationMode:: ds 1 +SECTION "Globals", WRAM0 +wInitialA:: ds 1 +wInitialB:: ds 1 +wInitialC:: ds 1 +wInitialD:: ds 1 +wInitialE:: ds 1 +wInitialH:: ds 1 +wInitialL:: ds 1 + SECTION "Stack", WRAM0 wStack:: @@ -40,8 +48,20 @@ wStackEnd:: SECTION "Code Entry Point", ROM0 Main:: - ; Load the initial A register. For reasons. - ldh [hInitialA], a + ; Load the initial registers. For reasons. + ld [wInitialA], a + ld a, b + ld [wInitialB], a + ld a, c + ld [wInitialC], a + ld a, d + ld [wInitialD], a + ld a, e + ld [wInitialE], a + ld a, h + ld [wInitialH], a + ld a, l + ld [wInitialL], a ; Turn off LCD during initialization. wait_vram diff --git a/src/state_title.asm b/src/state_title.asm index 0aee39a..709e9a2 100644 --- a/src/state_title.asm +++ b/src/state_title.asm @@ -39,7 +39,7 @@ SwitchToTitle:: call UnsafeMemCopy ; Little easter egg. - ldh a, [hInitialA] + ld a, [wInitialA] cp a, $FF jr nz, :+ ld de, sEaster0