From 023bacc23fa0e400ca7ae5b7c9e507f6a6b87c8b Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 7 Sep 2017 19:59:58 -0700 Subject: Move data and code out of main.asm --- engine/pinball_game/catchem_mode.asm | 26 ++++++++++++++++++++++++ engine/pokedex/variable_width_font_character.asm | 25 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) (limited to 'engine') 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 -- cgit v1.2.3