summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-09-07 19:59:58 -0700
committerMarcus Huderle <huderlem@gmail.com>2017-09-07 20:49:20 -0700
commit023bacc23fa0e400ca7ae5b7c9e507f6a6b87c8b (patch)
tree493162a4bdadd9e47a35cbf84a13f846d8aee188 /engine
parent6e9c8b1e7c0e938d4c477e0c5237a2ac0b009924 (diff)
Move data and code out of main.asm
Diffstat (limited to 'engine')
-rw-r--r--engine/pinball_game/catchem_mode.asm26
-rw-r--r--engine/pokedex/variable_width_font_character.asm25
2 files changed, 51 insertions, 0 deletions
diff --git a/engine/pinball_game/catchem_mode.asm b/engine/pinball_game/catchem_mode.asm
index 09192f6..fc5194b 100644
--- a/engine/pinball_game/catchem_mode.asm
+++ b/engine/pinball_game/catchem_mode.asm
@@ -1,3 +1,29 @@
+CheckSpecialModeColision: ; 0x10000
+ ld c, a
+ ld a, [wInSpecialMode] ;special mode in c
+ and a
+ ret z ;if mot in special mode, ret
+ ld a, c
+ ld [wSpecialModeCollisionID], a
+ ld a, [wSpecialMode]
+ cp SPECIAL_MODE_EVOLUTION ;branch based on mode
+ jp z, HandleEvoModeCollision ;call evo mode logic
+ cp SPECIAL_MODE_MAP_MOVE
+ jr nz, .CatchMode ;call catch mode logic
+ callba HandleMapModeCollision ;call map move logic
+ ret
+
+.CatchMode
+ ld a, [wCurrentStage]
+ call CallInFollowingTable
+HandleCatchEmCollisionCallTable: ; 0x10027
+ padded_dab HandleRedCatchEmCollision ; STAGE_RED_FIELD_TOP
+ padded_dab HandleRedCatchEmCollision ; STAGE_RED_FIELD_BOTTOM
+ padded_dab HandleRedCatchEmCollision
+ padded_dab HandleRedCatchEmCollision
+ padded_dab HandleBlueCatchEmCollision ; STAGE_BLUE_FIELD_TOP
+ padded_dab HandleBlueCatchEmCollision ; STAGE_BLUE_FIELD_BOTTOM
+
StartCatchEmMode: ; 0x1003f
ld a, [wInSpecialMode] ; current game mode?
and a
diff --git a/engine/pokedex/variable_width_font_character.asm b/engine/pokedex/variable_width_font_character.asm
index 9dba2d8..e85b234 100644
--- a/engine/pokedex/variable_width_font_character.asm
+++ b/engine/pokedex/variable_width_font_character.asm
@@ -319,3 +319,28 @@ Func_8ed6: ; 0x8ed6
Data_8ed8: ; 0x8ed8
db $FF, $7F, $3F, $1F, $0F, $07, $03, $01
+
+Func_8ee0: ; 0x8ee0
+ ld a, [$ff8d]
+ ld [$ff90], a
+ ld a, [$ff8e]
+ ld [$ff91], a
+ ld a, [$ff8d]
+ ld c, a
+ ld a, [$ff8e]
+ ld b, a
+ ld a, [$ff8c]
+ ld l, a
+ ld h, $0
+ add hl, bc
+ ld a, l
+ ld [$ff8d], a
+ ld a, h
+ ld [$ff8e], a
+ srl h
+ rr l
+ srl h
+ rr l
+ ld a, [$ff8f]
+ cp l
+ ret