From 8d474b3638d8284d411a9d64be9f7d1946fc200b Mon Sep 17 00:00:00 2001 From: Randy Thiemann Date: Sat, 21 Oct 2023 21:03:50 +0200 Subject: [PATCH] JRify --- src/constants.asm | 18 +++++++++++++++++ src/field.asm | 2 +- src/main.asm | 2 +- src/state_gameplay.asm | 45 ++++-------------------------------------- src/state_title.asm | 8 ++++---- 5 files changed, 28 insertions(+), 47 deletions(-) diff --git a/src/constants.asm b/src/constants.asm index 497aff1..8124812 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -71,6 +71,24 @@ sGo:: db " GO " sPause:: db "P A U S E " db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" + db "P A U S E " + db " P A U S E" sPieceXOffsets:: ; How to draw each piece. X-offsets of the sprites. db 0, 8, 16, 24 ; I db 0, 8, 8, 16 ; Z diff --git a/src/field.asm b/src/field.asm index d08be9f..dfbd284 100644 --- a/src/field.asm +++ b/src/field.asm @@ -1226,7 +1226,7 @@ GetTileShade: cp a, 2 jp c, .s6 cp a, 3 - jp c, .s5 + jr c, .s5 cp a, 5 jr c, .s4 cp a, 6 diff --git a/src/main.asm b/src/main.asm index eb6be10..47abd62 100644 --- a/src/main.asm +++ b/src/main.asm @@ -100,7 +100,7 @@ EventLoopPostHandler:: ; This will chain jump into the vblank handler. jp hOAMDMA - ; The VBlank Handler is expected to end with jp EventLoop. + ; The VBlank Handler is expected to end with jr EventLoop. ENDC diff --git a/src/state_gameplay.asm b/src/state_gameplay.asm index 82cbcd0..602f1bc 100644 --- a/src/state_gameplay.asm +++ b/src/state_gameplay.asm @@ -457,12 +457,12 @@ gameOverMode: ldh [hMode], a ld a, LEADY_GO_TIME ldh [hModeCounter], a - jp drawStaticInfo + jr drawStaticInfo ; Quit : ldh a, [hBState] cp a, 1 - jp nz, drawStaticInfo + jr nz, drawStaticInfo call SwitchToTitle jp EventLoopPostHandler @@ -473,7 +473,7 @@ pauseMode: jr nz, :+ ldh a, [hPrePause] ldh [hMode], a - jp drawStaticInfo + jr drawStaticInfo ; Draw PAUSE all over the field, but not if we came from delay mode. : ldh a, [hPrePause] @@ -481,44 +481,7 @@ pauseMode: jr z, drawStaticInfo ld de, sPause ld hl, wField+(4*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(6*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(8*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(10*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(12*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(14*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(16*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(18*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(20*10) - ld bc, 20 - call UnsafeMemCopy - ld de, sPause - ld hl, wField+(22*10) - ld bc, 20 - call UnsafeMemCopy + ld bc, 200 jr drawStaticInfo diff --git a/src/state_title.asm b/src/state_title.asm index 755dfb2..2aa8486 100644 --- a/src/state_title.asm +++ b/src/state_title.asm @@ -92,14 +92,14 @@ TitleEventLoopHandler:: : ldh a, [hUpState] cp a, 1 jr nz, :+ - jp IncrementLevel + jr IncrementLevel jp EventLoopPostHandler ; Start level down? : ldh a, [hDownState] cp a, 1 jr nz, :+ - jp DecrementLevel + jr DecrementLevel : jp EventLoopPostHandler @@ -115,7 +115,7 @@ DecrementLevel: ldh [hStartSpeed], a ld a, h ldh [hStartSpeed+1], a - jp CheckLevelRange + jr CheckLevelRange IncrementLevel: ; Increment @@ -129,7 +129,7 @@ IncrementLevel: ldh [hStartSpeed], a ld a, h ldh [hStartSpeed+1], a - jp CheckLevelRange + jr CheckLevelRange CheckLevelRange: