Consistent function name prefixes in slot machine code

This commit is contained in:
xCrystal 2017-12-28 20:23:17 +01:00
parent 83ef3b9a36
commit bd783370f8
2 changed files with 71 additions and 71 deletions

View File

@ -19,9 +19,9 @@ REEL_SIZE EQU 15
const SLOTS_WAIT_STOP_REEL2 const SLOTS_WAIT_STOP_REEL2
const SLOTS_WAIT_REEL3 const SLOTS_WAIT_REEL3
const SLOTS_WAIT_STOP_REEL3 const SLOTS_WAIT_STOP_REEL3
const SLOTS_NEXT_09 const SlotsAction_Next_09
const SLOTS_NEXT_0a const SlotsAction_Next_0a
const SLOTS_NEXT_0b const SlotsAction_Next_0b
const SLOTS_FLASH_IF_WIN const SLOTS_FLASH_IF_WIN
const SLOTS_FLASH_SCREEN const SLOTS_FLASH_SCREEN
const SLOTS_GIVE_EARNED_COINS const SLOTS_GIVE_EARNED_COINS
@ -127,7 +127,7 @@ _SlotMachine:
ld bc, wSlotsEnd - wSlots ld bc, wSlotsEnd - wSlots
xor a xor a
call ByteFill call ByteFill
call InitReelTiles call Slots_InitReelTiles
call Slots_GetPals call Slots_GetPals
ld a, $7 ld a, $7
ld hl, wSpriteAnimDict ld hl, wSpriteAnimDict
@ -266,33 +266,33 @@ SlotsJumptable: ; 92844 (24:6844)
jumptable .Jumptable, wJumptableIndex jumptable .Jumptable, wJumptableIndex
.Jumptable: .Jumptable:
dw Slots_Init ; 00 dw SlotsAction_Init ; 00
dw Slots_BetAndStart ; 01 dw SlotsAction_BetAndStart ; 01
dw Slots_WaitStart ; 02 dw SlotsAction_WaitStart ; 02
dw Slots_WaitReel1 ; 03 dw SlotsAction_WaitReel1 ; 03
dw Slots_WaitStopReel1 ; 04 dw SlotsAction_WaitStopReel1 ; 04
dw Slots_WaitReel2 ; 05 dw SlotsAction_WaitReel2 ; 05
dw Slots_WaitStopReel2 ; 06 dw SlotsAction_WaitStopReel2 ; 06
dw Slots_WaitReel3 ; 07 dw SlotsAction_WaitReel3 ; 07
dw Slots_WaitStopReel3 ; 08 dw SlotsAction_WaitStopReel3 ; 08
dw Slots_Next ; 09 dw SlotsAction_Next ; 09
dw Slots_Next ; 0a dw SlotsAction_Next ; 0a
dw Slots_Next ; 0b dw SlotsAction_Next ; 0b
dw Slots_FlashIfWin ; 0c dw SlotsAction_FlashIfWin ; 0c
dw Slots_FlashScreen ; 0d dw SlotsAction_FlashScreen ; 0d
dw Slots_GiveEarnedCoins ; 0e dw SlotsAction_GiveEarnedCoins ; 0e
dw Slots_PayoutTextAndAnim ; 0f dw SlotsAction_PayoutTextAndAnim ; 0f
dw Slots_PayoutAnim ; 10 dw SlotsAction_PayoutAnim ; 10
dw Slots_RestartOrQuit ; 11 dw SlotsAction_RestartOrQuit ; 11
dw Slots_Quit ; 12 dw SlotsAction_Quit ; 12
Slots_Next: ; 92879 (24:6879) SlotsAction_Next: ; 92879 (24:6879)
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
ret ret
Slots_Init: ; 9287e (24:687e) SlotsAction_Init: ; 9287e (24:687e)
call Slots_Next call SlotsAction_Next
xor a xor a
ld [wFirstTwoReelsMatching], a ld [wFirstTwoReelsMatching], a
ld [wFirstTwoReelsMatchingSevens], a ld [wFirstTwoReelsMatchingSevens], a
@ -300,7 +300,7 @@ Slots_Init: ; 9287e (24:687e)
ld [wSlotMatched], a ld [wSlotMatched], a
ret ret
Slots_BetAndStart: ; 9288e (24:688e) SlotsAction_BetAndStart: ; 9288e (24:688e)
call Slots_AskBet call Slots_AskBet
jr nc, .proceed jr nc, .proceed
ld a, SLOTS_QUIT ld a, SLOTS_QUIT
@ -308,7 +308,7 @@ Slots_BetAndStart: ; 9288e (24:688e)
ret ret
.proceed .proceed
call Slots_Next call SlotsAction_Next
call Slots_IlluminateBetLights call Slots_IlluminateBetLights
call Slots_InitBias call Slots_InitBias
ld a, 32 ld a, 32
@ -326,7 +326,7 @@ Slots_BetAndStart: ; 9288e (24:688e)
call Slots_PlaySFX call Slots_PlaySFX
ret ret
Slots_WaitStart: ; 928c6 (24:68c6) SlotsAction_WaitStart: ; 928c6 (24:68c6)
ld hl, wSlotsDelay ld hl, wSlotsDelay
ld a, [hl] ld a, [hl]
and a and a
@ -335,20 +335,20 @@ Slots_WaitStart: ; 928c6 (24:68c6)
ret ret
.proceed .proceed
call Slots_Next call SlotsAction_Next
xor a xor a
ld [hJoypadSum], a ld [hJoypadSum], a
ret ret
Slots_WaitReel1: ; 928d6 (24:68d6) SlotsAction_WaitReel1: ; 928d6 (24:68d6)
ld hl, hJoypadSum ld hl, hJoypadSum
ld a, [hl] ld a, [hl]
and A_BUTTON and A_BUTTON
ret z ret z
call Slots_Next call SlotsAction_Next
call Slots_StopReel1 call Slots_StopReel1
ld [wReel1ReelAction], a ld [wReel1ReelAction], a
Slots_WaitStopReel1: ; 928e6 (24:68e6) SlotsAction_WaitStopReel1: ; 928e6 (24:68e6)
ld a, [wReel1ReelAction] ld a, [wReel1ReelAction]
cp REEL_ACTION_DO_NOTHING cp REEL_ACTION_DO_NOTHING
ret nz ret nz
@ -357,18 +357,18 @@ Slots_WaitStopReel1: ; 928e6 (24:68e6)
ld bc, wReel1 ld bc, wReel1
ld de, wReel1Stopped ld de, wReel1Stopped
call Slots_LoadReelState call Slots_LoadReelState
call Slots_Next call SlotsAction_Next
xor a xor a
ld [hJoypadSum], a ld [hJoypadSum], a
Slots_WaitReel2: ; 92900 (24:6900) SlotsAction_WaitReel2: ; 92900 (24:6900)
ld hl, hJoypadSum ld hl, hJoypadSum
ld a, [hl] ld a, [hl]
and A_BUTTON and A_BUTTON
ret z ret z
call Slots_Next call SlotsAction_Next
call Slots_StopReel2 call Slots_StopReel2
ld [wReel2ReelAction], a ld [wReel2ReelAction], a
Slots_WaitStopReel2: ; 92910 (24:6910) SlotsAction_WaitStopReel2: ; 92910 (24:6910)
ld a, [wReel2ReelAction] ld a, [wReel2ReelAction]
cp REEL_ACTION_DO_NOTHING cp REEL_ACTION_DO_NOTHING
ret nz ret nz
@ -377,18 +377,18 @@ Slots_WaitStopReel2: ; 92910 (24:6910)
ld bc, wReel2 ld bc, wReel2
ld de, wReel2Stopped ld de, wReel2Stopped
call Slots_LoadReelState call Slots_LoadReelState
call Slots_Next call SlotsAction_Next
xor a xor a
ld [hJoypadSum], a ld [hJoypadSum], a
Slots_WaitReel3: ; 9292a (24:692a) SlotsAction_WaitReel3: ; 9292a (24:692a)
ld hl, hJoypadSum ld hl, hJoypadSum
ld a, [hl] ld a, [hl]
and A_BUTTON and A_BUTTON
ret z ret z
call Slots_Next call SlotsAction_Next
call Slots_StopReel3 call Slots_StopReel3
ld [wReel3ReelAction], a ld [wReel3ReelAction], a
Slots_WaitStopReel3: ; 9293a (24:693a) SlotsAction_WaitStopReel3: ; 9293a (24:693a)
ld a, [wReel3ReelAction] ld a, [wReel3ReelAction]
cp REEL_ACTION_DO_NOTHING cp REEL_ACTION_DO_NOTHING
ret nz ret nz
@ -397,24 +397,24 @@ Slots_WaitStopReel3: ; 9293a (24:693a)
ld bc, wReel3 ld bc, wReel3
ld de, wReel3Stopped ld de, wReel3Stopped
call Slots_LoadReelState call Slots_LoadReelState
call Slots_Next call SlotsAction_Next
xor a xor a
ld [hJoypadSum], a ld [hJoypadSum], a
ret ret
Slots_FlashIfWin: ; 92955 (24:6955) SlotsAction_FlashIfWin: ; 92955 (24:6955)
ld a, [wSlotMatched] ld a, [wSlotMatched]
cp SLOTS_NOMATCH cp SLOTS_NOMATCH
jr nz, .GotIt jr nz, .GotIt
call Slots_Next call SlotsAction_Next
call Slots_Next call SlotsAction_Next
ret ret
.GotIt: .GotIt:
call Slots_Next call SlotsAction_Next
ld a, 16 ld a, 16
ld [wSlotsDelay], a ld [wSlotsDelay], a
Slots_FlashScreen: ; 9296b (24:696b) SlotsAction_FlashScreen: ; 9296b (24:696b)
ld hl, wSlotsDelay ld hl, wSlotsDelay
ld a, [hl] ld a, [hl]
and a and a
@ -432,25 +432,25 @@ Slots_FlashScreen: ; 9296b (24:696b)
.done .done
call Slots_GetPals call Slots_GetPals
call Slots_Next call SlotsAction_Next
ret ret
Slots_GiveEarnedCoins: ; 92987 (24:6987) SlotsAction_GiveEarnedCoins: ; 92987 (24:6987)
xor a xor a
ld [wFirstTwoReelsMatching], a ld [wFirstTwoReelsMatching], a
ld [wFirstTwoReelsMatchingSevens], a ld [wFirstTwoReelsMatchingSevens], a
ld a, %11100100 ld a, %11100100
call DmgToCgbBGPals call DmgToCgbBGPals
call SlotGetPayout call Slots_GetPayout
xor a xor a
ld [wSlotsDelay], a ld [wSlotsDelay], a
call Slots_Next call SlotsAction_Next
ret ret
Slots_PayoutTextAndAnim: ; 9299e (24:699e) SlotsAction_PayoutTextAndAnim: ; 9299e (24:699e)
call SlotPayoutText call Slots_PayoutText
call Slots_Next call SlotsAction_Next
Slots_PayoutAnim: ; 929a4 (24:69a4) SlotsAction_PayoutAnim: ; 929a4 (24:69a4)
ld hl, wSlotsDelay ld hl, wSlotsDelay
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
@ -470,7 +470,7 @@ Slots_PayoutAnim: ; 929a4 (24:69a4)
ld d, [hl] ld d, [hl]
inc hl inc hl
ld e, [hl] ld e, [hl]
call Slot_CheckCoinCaseFull call Slots_CheckCoinCaseFull
jr c, .okay jr c, .okay
inc de inc de
.okay .okay
@ -485,10 +485,10 @@ Slots_PayoutAnim: ; 929a4 (24:69a4)
ret ret
.done .done
call Slots_Next call SlotsAction_Next
ret ret
Slots_RestartOrQuit: ; 929d9 (24:69d9) SlotsAction_RestartOrQuit: ; 929d9 (24:69d9)
call Slots_DeilluminateBetLights call Slots_DeilluminateBetLights
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
call Slots_AskPlayAgain call Slots_AskPlayAgain
@ -502,7 +502,7 @@ Slots_RestartOrQuit: ; 929d9 (24:69d9)
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
Slots_Quit: ; 929f0 (24:69f0) SlotsAction_Quit: ; 929f0 (24:69f0)
ld hl, wJumptableIndex ld hl, wJumptableIndex
set SLOTS_END_LOOP_F, [hl] set SLOTS_END_LOOP_F, [hl]
ret ret
@ -521,7 +521,7 @@ Slots_LoadReelState: ; 929f6 (24:69f6)
ld [de], a ld [de], a
ret ret
Slot_CheckCoinCaseFull: ; 92a04 (24:6a04) Slots_CheckCoinCaseFull: ; 92a04 (24:6a04)
ld a, d ld a, d
cp HIGH(MAX_COINS) cp HIGH(MAX_COINS)
jr c, .not_full jr c, .not_full
@ -653,7 +653,7 @@ Slots_StopReel3: ; 92a60 (24:6a60)
ld a, REEL_ACTION_STOP_REEL3 ld a, REEL_ACTION_STOP_REEL3
ret ret
InitReelTiles: ; 92a98 (24:6a98) Slots_InitReelTiles: ; 92a98 (24:6a98)
ld bc, wReel1 ld bc, wReel1
ld hl, wReel1OAMAddr - wReel1 ld hl, wReel1OAMAddr - wReel1
add hl, bc add hl, bc
@ -719,7 +719,7 @@ InitReelTiles: ; 92a98 (24:6a98)
ld hl, wReel1SpinDistance - wReel1 ld hl, wReel1SpinDistance - wReel1
add hl, bc add hl, bc
ld [hl], REEL_ACTION_DO_NOTHING ld [hl], REEL_ACTION_DO_NOTHING
call UpdateReelPositionAndOAM call Slots_UpdateReelPositionAndOAM
ret ret
Slots_SpinReels: ; 92b0f (24:6b0f) Slots_SpinReels: ; 92b0f (24:6b0f)
@ -750,7 +750,7 @@ Slots_SpinReels: ; 92b0f (24:6b0f)
add [hl] add [hl]
ld [hl], a ld [hl], a
and $f and $f
jr z, UpdateReelPositionAndOAM jr z, Slots_UpdateReelPositionAndOAM
ld hl, wReel1OAMAddr - wReel1 ld hl, wReel1OAMAddr - wReel1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
@ -768,7 +768,7 @@ Slots_SpinReels: ; 92b0f (24:6b0f)
jr nz, .loop jr nz, .loop
ret ret
UpdateReelPositionAndOAM: ; 92b53 (24:6b53) Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
ld hl, wReel1XCoord - wReel1 ld hl, wReel1XCoord - wReel1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -1165,7 +1165,7 @@ ReelAction_InitGolem: ; 92d20
ld hl, wReel1SpinRate - wReel1 ld hl, wReel1SpinRate - wReel1
add hl, bc add hl, bc
ld [hl], 0 ld [hl], 0
call Function92fc0 call Slots_GetNumberOfGolems
push bc push bc
push af push af
depixel 12, 13 depixel 12, 13
@ -1307,7 +1307,7 @@ ReelAction_Unused: ; 92df7
ld hl, wReel1ReelAction - wReel1 ld hl, wReel1ReelAction - wReel1
add hl, bc add hl, bc
inc [hl] ; REEL_ACTION_CHECK_DROP_REEL inc [hl] ; REEL_ACTION_CHECK_DROP_REEL
call Function92fc0 call Slots_GetNumberOfGolems
ld hl, wReel1ManipDelay - wReel1 ld hl, wReel1ManipDelay - wReel1
add hl, bc add hl, bc
ld [hl], a ld [hl], a
@ -1655,7 +1655,7 @@ Slots_CopyReelState: ; 92fb4
; 92fc0 ; 92fc0
Function92fc0: ; 92fc0 Slots_GetNumberOfGolems: ; 92fc0
ld hl, wReel1Position - wReel1 ld hl, wReel1Position - wReel1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -1911,7 +1911,7 @@ Slots_AskPlayAgain: ; 930e9 (24:70e9)
text_jump UnknownText_0x1c5092 text_jump UnknownText_0x1c5092
db "@" db "@"
SlotGetPayout: ; 93124 (24:7124) Slots_GetPayout: ; 93124 (24:7124)
ld a, [wSlotMatched] ld a, [wSlotMatched]
cp SLOTS_NOMATCH cp SLOTS_NOMATCH
jr z, .no_win jr z, .no_win
@ -1944,7 +1944,7 @@ SlotGetPayout: ; 93124 (24:7124)
ld [hl], a ld [hl], a
ret ret
SlotPayoutText: ; 93158 (24:7158) Slots_PayoutText: ; 93158 (24:7158)
ld a, [wSlotMatched] ld a, [wSlotMatched]
cp SLOTS_NOMATCH cp SLOTS_NOMATCH
jr nz, .MatchedSomething jr nz, .MatchedSomething
@ -2066,7 +2066,7 @@ endr
; 9321d ; 9321d
SlotMachine_AnimateGolem: ; 9321d (24:721d) Slots_AnimateGolem: ; 9321d (24:721d)
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]

View File

@ -357,7 +357,7 @@ DoAnimFrame: ; 8d24b
ret ret
.SlotsGolem: ; 8d422 (23:5422) .SlotsGolem: ; 8d422 (23:5422)
callfar SlotMachine_AnimateGolem callfar Slots_AnimateGolem
ret ret
.SlotsChansey: ; 8d429 (23:5429) .SlotsChansey: ; 8d429 (23:5429)