summaryrefslogtreecommitdiff
path: root/main.asm
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-07-02 13:52:39 -0500
committerMarcus Huderle <huderlem@gmail.com>2017-07-02 13:52:39 -0500
commit6f1c899fb4df1d87aa1af573776935422fad9449 (patch)
tree0b807c4ec39d1553128724ece8ba6b1404514c4b /main.asm
parentf5173da100e8a80fec98b175e2a2b51901b649f5 (diff)
Move 'end of ball bonus' logic to separate file
Diffstat (limited to 'main.asm')
-rwxr-xr-xmain.asm782
1 files changed, 3 insertions, 779 deletions
diff --git a/main.asm b/main.asm
index 95ffcca..88f1f80 100755
--- a/main.asm
+++ b/main.asm
@@ -180,783 +180,7 @@ INCLUDE "engine/pinball_game/flippers.asm"
INCLUDE "engine/pinball_game/stage_collision_attributes.asm"
INCLUDE "engine/pinball_game/vertical_screen_transition.asm"
INCLUDE "engine/pinball_game/slot.asm"
-
-Func_f533: ; 0xf533
- call FillBottomMessageBufferWithBlackTile
- call Func_f55c
- call Func_f57f
- ld a, $60
- ld [hWY], a
- dec a
- ld [hLYC], a
- ld a, $fd
- ld [hLCDCMask], a
- call Func_f5a0
- ld a, $90
- ld [hWY], a
- ld a, $83
- ld [hLYC], a
- ld [hLastLYC], a
- ld a, $ff
- ld [hLCDCMask], a
- call FillBottomMessageBufferWithBlackTile
- ret
-
-Func_f55c: ; 0xf55c
- ld a, [hGameBoyColorFlag]
- and a
- jr nz, .gameboyColor
- ld a, BANK(GFX_d61c0)
- ld hl, GFX_d61c0
- ld de, vTilesSH tile $03
- ld bc, $0010
- call LoadVRAMData
- ret
-
-.gameboyColor
- ld a, BANK(GFX_d63c0)
- ld hl, GFX_d63c0
- ld de, vTilesSH tile $03
- ld bc, $0010
- call LoadVRAMData
- ret
-
-Func_f57f: ; 0xf57f
- xor a
- ld [wd4aa], a
- ld hl, wBottomMessageText
- ld a, $81
- ld b, $40
-.clearLoop
- ld [hli], a
- ld [hli], a
- ld [hli], a
- ld [hli], a
- dec b
- jr nz, .clearLoop
- ld a, $0
- ld hl, wBottomMessageText
- ld de, vBGWin
- ld bc, $00c0
- call LoadVRAMData
- ret
-
-Func_f5a0: ; 0xf5a0
- ld de, wBottomMessageText + $40
- ld hl, BonusPointsText
- call PrintTextNoHeader
- ld de, wBottomMessageText + $80
- ld hl, SubtotalPointsText
- call PrintTextNoHeader
- ld hl, wd489
- call Func_f8b5
- ld hl, wd48f
- call Func_f8b5
- ld a, $1
- ld [wd4ab], a
- call ValidateSignature6
- call Func_f64e
- call Func_f60a
- call Func_f676
- ld a, $1
- ld [wd4ab], a
- call Func_f70d
- ld a, [wGameOver]
- and a
- ret z
- ld a, $10
- call SetSongBank
- ld de, $0005
- call PlaySong
- ld hl, wBottomMessageText
- ld bc, $0040
- call Func_f81b
- ld de, wBottomMessageText + $20
- ld hl, GameOverText
- call PrintTextNoHeader
- ld bc, $0040
- ld de, $0000
- call Func_f80d
-.asm_f602
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f602
- ret
-
-Func_f60a: ; 0xf60a
- ld a, [wCurrentStage]
- rst JumpTable ; calls JumpToFuncInTable
-CallTable_f60d: ; 0xf60d
- ; STAGE_RED_FIELD_TOP
- dw Func_f945
- ; STAGE_RED_FIELD_BOTTOM
- dw Func_f945
- dw Func_f9f2
- dw Func_f9f2
- ; STAGE_BLUE_FIELD_TOP
- dw Func_f9f3
- ; STAGE_BLUE_FIELD_BOTTOM
- dw Func_f9f3
- ; STAGE_GENGAR_BONUS
- dw Func_faf6
- ; STAGE_GENGAR_BONUS
- dw Func_faf6
- ; STAGE_MEWTWO_BONUS
- dw Func_faf7
- ; STAGE_MEWTWO_BONUS
- dw Func_faf7
- ; STAGE_MEOWTH_BONUS
- dw Func_faf8
- ; STAGE_MEOWTH_BONUS
- dw Func_faf8
-
-ValidateSignature6: ; 0xf626
- ld de, wBottomMessageText + $01
- ld hl, NumPokemonCaughtText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $01
- ld a, [wd628]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd628
- ld de, PointsData_f921
- call Func_f853
- call Func_f824
- ret
-
-Func_f64e: ; 0xf64e
- ld de, wBottomMessageText
- ld hl, NumPokemonEvolvedText
- call PrintTextNoHeader
- ld hl, wBottomMessageText
- ld a, [wd629]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd629
- ld de, PointsData_f927
- call Func_f853
- call Func_f824
- ret
-
-Func_f676: ; 0xf676
- ld b, $4
-.asm_f678
- push bc
- ld hl, wBottomMessageText + $20
- ld de, wBottomMessageText
- ld bc, $00e0
- call LocalCopyData
- ld bc, $00c0
- ld de, $0000
- call Func_f80d
- ld a, [wd4ab]
- and a
- jr z, .asm_f69f
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f69f
- xor a
- ld [wd4ab], a
-.asm_f69f
- pop bc
- dec b
- jr nz, .asm_f678
- ld de, wBottomMessageText + $40
- ld hl, MultiplierPointsText
- call PrintTextNoHeader
- ld de, wBottomMessageText + $80
- ld hl, TotalPointsText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $50
- ld a, [wd482]
- call Func_f78e
- ld bc, $0040
- ld de, $0040
- call Func_f80d
-.asm_f6c7
- push de
- push hl
- ld hl, wd494
- ld de, wBottomMessageText + $86
- call Func_f8bd
- ld bc, $0040
- ld de, $0080
- call Func_f80d
- lb de, $00, $3e
- call PlaySoundEffect
- ld a, [wd4ab]
- and a
- jr z, .asm_f6f2
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f6f2
- xor a
- ld [wd4ab], a
-.asm_f6f2
- pop hl
- pop de
- ld a, [wd482]
- and a
- jr z, .asm_f709
- dec a
- ld [wd482], a
- ld hl, wd48f
- ld de, wd489
- call AddBigBCD6
- jr .asm_f6c7
-
-.asm_f709
- call Func_f83a
- ret
-
-Func_f70d: ; 0xf70d
- ld b, $4
-.asm_f70f
- push bc
- ld hl, wBottomMessageText + $20
- ld de, wBottomMessageText
- ld bc, $00e0
- call LocalCopyData
- ld bc, $00c0
- ld de, $0000
- call Func_f80d
- ld a, [wd4ab]
- and a
- jr z, .asm_f736
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f736
- xor a
- ld [wd4ab], a
-.asm_f736
- pop bc
- dec b
- jr nz, .asm_f70f
- ld de, wBottomMessageText + $60
- ld hl, ScoreText
- call PrintTextNoHeader
- ld hl, wScore + $5
- ld de, wBottomMessageText + $66
- call Func_f8bd
- ld bc, $0040
- ld de, $0060
- call Func_f80d
- lb de, $00, $3e
- call PlaySoundEffect
- ld a, [wd4ab]
- and a
- jr z, .asm_f76c
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f76c
- xor a
- ld [wd4ab], a
-.asm_f76c
- ld hl, wScore
- ld de, wd48f
- call AddBigBCD6
- ld hl, wScore + $5
- ld de, wBottomMessageText + $66
- call Func_f8bd
- ld bc, $0040
- ld de, $0060
- call Func_f80d
- call Func_f83a
- call Func_f83a
- ret
-
-Func_f78e: ; 0xf78e
- push hl
- call ConvertHexByteToDecWord
- pop hl
- ld c, $1
- ld a, d
- call .asm_f7a4
- inc hl
- ld a, e
- swap a
- call .asm_f7a4
- inc hl
- ld c, $0
- ld a, e
- ; fall through
-.asm_f7a4
- and $f
- jr nz, .asm_f7ab
- ld a, c
- and a
- ret nz
-.asm_f7ab
- add $86
- ld [hl], a
- ld c, $0
- ret
-
-PrintTextNoHeader: ; 0xf7b1
- ld a, [wd805]
- and a
- jr nz, .asm_f7e0
-.loop
- ld a, [hli]
- and a
- ret z
- cp "0"
- jr c, .asm_f7c6
- cp "9" + 1
- jr nc, .asm_f7c6
- add $56
- jr .asm_f7dc
-
-.asm_f7c6
- cp "A"
- jr c, .asm_f7d2
- cp "Z" + 1
- jr nc, .asm_f7d2
- add $bf
- jr .asm_f7dc
-
-.asm_f7d2
- cp "e"
- jr nz, .asm_f7da
- ld a, $83
- jr .asm_f7dc
-
-.asm_f7da
- ld a, $81
-.asm_f7dc
- ld [de], a
- inc de
- jr .loop
-
-.asm_f7e0
- ld a, [hli]
- and a
- ret z
- cp "0"
- jr c, .asm_f7ef
- cp "9" + 1
- jr nc, .asm_f7ef
- add $56
- jr .asm_f809
-
-.asm_f7ef
- cp $a0
- jr c, .asm_f7fb
- cp $e0
- jr nc, .asm_f7fb
- sub $80
- jr .asm_f809
-
-.asm_f7fb
- cp $e0
- jr c, .asm_f807
- cp $f4
- jr nc, .asm_f807
- sub $50
- jr .asm_f809
-
-.asm_f807
- ld a, $81
-.asm_f809
- ld [de], a
- inc de
- jr .asm_f7e0
-
-Func_f80d: ; 0xf80d
- hlCoord 0, 0, vBGWin
- add hl, de
- push hl
- ld hl, wBottomMessageText
- add hl, de
- pop de
- call LoadVRAMData
- ret
-
-Func_f81b: ; 0xf81b
- ld a, $81
- ld [hli], a
- dec bc
- ld a, b
- or c
- jr nz, Func_f81b
- ret
-
-Func_f824: ; 0xf824
- call Func_f83a
- ld hl, wBottomMessageText
- ld bc, $0040
- call Func_f81b
- ld hl, wBottomMessageText + $48
- ld bc, $0038
- call Func_f81b
- ret
-
-Func_f83a: ; 0xf83a
- ld a, [wd4ab]
- and a
- ret z
- ld b, $46
-.asm_f841
- push bc
- rst AdvanceFrame
- pop bc
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr nz, .asm_f84e
- dec b
- jr nz, .asm_f841
- ret
-
-.asm_f84e
- xor a
- ld [wd4ab], a
- ret
-
-Func_f853: ; 0xf853
- push hl
- ld hl, wd483
- call Func_f8b5
- pop hl
-.asm_f85b
- push de
- push hl
- ld hl, wd488
- ld de, wBottomMessageText + $46
- call Func_f8bd
- ld bc, $0040
- ld de, $0040
- call Func_f80d
- lb de, $00, $3e
- call PlaySoundEffect
- ld a, [wd4ab]
- and a
- jr z, .asm_f886
- rst AdvanceFrame
- ld a, [hNewlyPressedButtons]
- bit BIT_A_BUTTON, a
- jr z, .asm_f886
- xor a
- ld [wd4ab], a
-.asm_f886
- pop hl
- pop de
- ld a, [hl]
- and a
- jr z, .asm_f899
- dec [hl]
- push de
- push hl
- ld hl, wd483
- call AddBigBCD6
- pop hl
- pop de
- jr .asm_f85b
-
-.asm_f899
- ld hl, wd489
- ld de, wd483
- call AddBigBCD6
- ld hl, wd48e
- ld de, wBottomMessageText + $86
- call Func_f8bd
- ld bc, $0040
- ld de, $0080
- call Func_f80d
- ret
-
-Func_f8b5: ; 0xf8b5
- xor a
- ld b, $6
-.asm_f8b8
- ld [hli], a
- dec b
- jr nz, .asm_f8b8
- ret
-
-Func_f8bd: ; 0xf8bd
- ld bc, $0c01
-.asm_f8c0
- ld a, [hl]
- swap a
- call Func_f8d5
- inc de
- dec b
- ld a, [hld]
- call Func_f8d5
- inc de
- dec b
- jr nz, .asm_f8c0
- ld a, $86
- ld [de], a
- inc de
- ret
-
-Func_f8d5: ; 0xf8d5
- and $f
- jr nz, .asm_f8e0
- ld a, b
- dec a
- jr z, .asm_f8e0
- ld a, c
- and a
- ret nz
-.asm_f8e0
- add $86
- ld [de], a
- ld c, $0
- ld a, b
- cp $c
- jr z, .asm_f8f5
- cp $9
- jr z, .asm_f8f5
- cp $6
- jr z, .asm_f8f5
- cp $3
- ret nz
-.asm_f8f5
- push de
- ld a, e
- add $20
- ld e, a
- jr nc, .asm_f8fd
- inc d
-.asm_f8fd
- ld a, $82
- ld [de], a
- pop de
- ret
-
-AddBigBCD6: ; 0xf902
-x = 0
-rept 6
- ld a, [de]
-if x == 0
- add [hl]
-else
- adc [hl]
-endc
-x = x + 1
- daa
- ld [hli], a
- inc de
-endr
- ret
-
-PointsData_f921: ; 0xf921
- bigBCD6 50000
-PointsData_f927: ; 0xf927
- bigBCD6 75000
-PointsData_f92d: ; 0xf92d
- bigBCD6 7500
-PointsData_f933: ; 0xf933
- bigBCD6 5000
-PointsData_f939: ; 0xf939
- bigBCD6 2500
-PointsData_f93f: ; 0xf93f
- bigBCD6 1000
-
-Func_f945: ; 0xf945
- call Func_f952
- call Func_f97a
- call Func_f9a2
- call Func_f9ca
- ret
-
-Func_f952: ; 0xf952
- ld de, wBottomMessageText + $03
- ld hl, BellsproutCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $03
- ld a, [wd62a]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62a
- ld de, PointsData_f92d
- call Func_f853
- call Func_f824
- ret
-
-Func_f97a: ; 0xf97a
- ld de, wBottomMessageText + $04
- ld hl, DugtrioCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $04
- ld a, [wd62b]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62b
- ld de, PointsData_f933
- call Func_f853
- call Func_f824
- ret
-
-Func_f9a2: ; 0xf9a2
- ld de, wBottomMessageText + $03
- ld hl, CaveShotCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $03
- ld a, [wd62c]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62c
- ld de, PointsData_f939
- call Func_f853
- call Func_f824
- ret
-
-Func_f9ca: ; 0xf9ca
- ld de, wBottomMessageText + $01
- ld hl, SpinnerTurnsCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $01
- ld a, [wd62d]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62d
- ld de, PointsData_f93f
- call Func_f853
- call Func_f824
- ret
-
-Func_f9f2: ; 0xf9f2
- ret
-
-Func_f9f3: ; 0xf9f3
- call Func_fa06
- call Func_fa2e
- call Func_fa56
- call Func_fa7e
- call Func_faa6
- call Func_face
- ret
-
-Func_fa06: ; 0xfa06
- ld de, wBottomMessageText + $04
- ld hl, CloysterCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $04
- ld a, [wd63b]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd63b
- ld de, PointsData_f92d
- call Func_f853
- call Func_f824
- ret
-
-Func_fa2e: ; 0xfa2e
- ld de, wBottomMessageText + $04
- ld hl, SlowpokeCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $04
- ld a, [wd63a]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd63a
- ld de, PointsData_f92d
- call Func_f853
- call Func_f824
- ret
-
-Func_fa56: ; 0xfa56
- ld de, wBottomMessageText + $04
- ld hl, PoliwagCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $04
- ld a, [wd63d]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd63d
- ld de, PointsData_f933
- call Func_f853
- call Func_f824
- ret
-
-Func_fa7e: ; 0xfa7e
- ld de, wBottomMessageText + $04
- ld hl, PsyduckCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $04
- ld a, [wd63c]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd63c
- ld de, PointsData_f933
- call Func_f853
- call Func_f824
- ret
-
-Func_faa6: ; 0xfaa6
- ld de, wBottomMessageText + $03
- ld hl, CaveShotCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $03
- ld a, [wd62c]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62c
- ld de, PointsData_f939
- call Func_f853
- call Func_f824
- ret
-
-Func_face: ; 0xface :)
- ld de, wBottomMessageText + $01
- ld hl, SpinnerTurnsCounterText
- call PrintTextNoHeader
- ld hl, wBottomMessageText + $01
- ld a, [wd62d]
- call Func_f78e
- ld bc, $0040
- ld de, $0000
- call Func_f80d
- ld hl, wd62d
- ld de, PointsData_f93f
- call Func_f853
- call Func_f824
- ret
-
-Func_faf6: ; 0xfaf6
- ret
-
-Func_faf7: ; 0xfaf7
- ret
-
-Func_faf8: ; 0xfaf8
- ret
-
-; XXX
- ret
-
-; XXX
- ret
+INCLUDE "engine/pinball_game/end_of_ball_bonus.asm"
SECTION "bank4", ROMX, BANK[$4]
@@ -39364,7 +38588,7 @@ Alphabet1Gfx: ; 0xd6000
GFX_d61a0: INCBIN "gfx/unknown/d61a0.2bpp"
GFX_d61b0: INCBIN "gfx/unknown/d61b0.2bpp"
-GFX_d61c0: INCBIN "gfx/stage/e_acute_mono.2bpp"
+E_Acute_CharacterGfx: INCBIN "gfx/stage/e_acute_mono.2bpp"
GFX_d61d0: INCBIN "gfx/unknown/d61d0.2bpp"
GFX_d61e0: INCBIN "gfx/unknown/d61e0.2bpp"
@@ -39375,7 +38599,7 @@ Alphabet2Gfx: ; 0xd6200
GFX_d63a0: INCBIN "gfx/unknown/d63a0.2bpp"
GFX_d63b0: INCBIN "gfx/unknown/d63b0.2bpp"
-GFX_d63c0: INCBIN "gfx/stage/e_acute_color.2bpp"
+E_Acute_CharacterGfx_GameboyColor: INCBIN "gfx/stage/e_acute_color.2bpp"
GFX_d63d0: INCBIN "gfx/unknown/d63d0.2bpp"
GFX_d63e0: INCBIN "gfx/unknown/d63e0.2bpp"