aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-08-24 19:12:43 +0200
committerAstatin <[email protected]>2025-08-24 19:12:43 +0200
commit75732632a373d8ac21f8f4ecf813b447f02ba8e4 (patch)
tree5cc142e11b2bc175b67983cfd9151aa6c24fcdae
parent0904f9d55e4ca41d40a4e79f8cad33bb4ffcc77e (diff)
Reset game with A+B+Start+Select
-rw-r--r--buttons.gbasm2
-rw-r--r--init.gbasm10
2 files changed, 8 insertions, 4 deletions
diff --git a/buttons.gbasm b/buttons.gbasm
index 79b0852..1c067d1 100644
--- a/buttons.gbasm
+++ b/buttons.gbasm
@@ -57,6 +57,8 @@ Pad_Button_Check:
XOR $0f
AND $0f
LD $mem_button_action, A
+ CP $0f
+ JP Z, =Start
POP BC
POP AF
diff --git a/init.gbasm b/init.gbasm
index 075eed6..9495df7 100644
--- a/init.gbasm
+++ b/init.gbasm
@@ -41,6 +41,12 @@ Header:
.Global_checksum: .DB $00, $00 ; Will be set after assembly by build scripts
Initialize_RAM:
+LD SP, $fffe
+
+; LCDC
+XOR A
+LD $reg_lcd_controller, A
+
; Disable Interrupts
LD A, $00
LD $reg_interrupt_enable, A
@@ -55,10 +61,6 @@ Empty_WRAM:
CALL =VBlank_Wait
- ; LCDC
- XOR A
- LD $reg_lcd_controller, A
-
Empty_VRAM: ; (Clear screen)
LD HL, $VRAM_start ; We set the HL register to the start of VRAM
Empty_VRAM.loop: