aboutsummaryrefslogtreecommitdiffstats
path: root/engine/slots
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
committerdannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
commita02a98ee7ada1a658e28698484058be2796dc0df (patch)
tree945986054565bd8b5212fc755415096050d1d3a8 /engine/slots
parentUse long option flags for rgbgfx, same as tools/gfx (diff)
parentUse `const_skip` (diff)
downloadpokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/slots')
-rw-r--r--engine/slots/slot_machine.asm35
1 files changed, 18 insertions, 17 deletions
diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm
index 3918e879..fd7a7466 100644
--- a/engine/slots/slot_machine.asm
+++ b/engine/slots/slot_machine.asm
@@ -1,8 +1,9 @@
PromptUserToPlaySlots:
call SaveScreenTilesToBuffer2
- ld a, BANK(DisplayTextIDInit) ; TRUE
- ld [wAutoTextBoxDrawingControl], a
- ld b, a
+ ld a, BANK(DisplayTextIDInit)
+ assert BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
+ ld [wAutoTextBoxDrawingControl], a ; 1 << BIT_NO_AUTO_TEXT_BOX
+ ld b, a ; BANK(DisplayTextIDInit)
ld hl, DisplayTextIDInit
call Bankswitch
ld hl, PlaySlotMachineText
@@ -28,16 +29,16 @@ PromptUserToPlaySlots:
ld a, $e4
ldh [rOBP0], a
call UpdateGBCPal_OBP0
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wSlotMachineAllowMatchesCounter], a
ld hl, wStoppingWhichSlotMachineWheel
ld bc, $14
call FillMemory
call MainSlotMachineLoop
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wSlotMachineAllowMatchesCounter], a
call GBPalWhiteOutWithDelay3
@@ -174,7 +175,7 @@ OneMoreGoSlotMachineText:
SlotMachine_SetFlags:
ld hl, wSlotMachineFlags
- bit 7, [hl]
+ bit BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR, [hl]
ret nz
ld a, [wSlotMachineAllowMatchesCounter]
and a
@@ -192,14 +193,14 @@ SlotMachine_SetFlags:
ld [hl], 0
ret
.allowMatches
- set 6, [hl]
+ set BIT_SLOTS_CAN_WIN, [hl]
ret
.setAllowMatchesCounter
ld a, 60
ld [wSlotMachineAllowMatchesCounter], a
ret
.allowSevenAndBarMatches
- set 7, [hl]
+ set BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR, [hl]
ret
SlotMachine_SpinWheels:
@@ -290,7 +291,7 @@ SlotMachine_StopWheel1Early:
call SlotMachine_GetWheel1Tiles
ld hl, wSlotMachineWheel1BottomTile
ld a, [wSlotMachineFlags]
- and $80
+ and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
jr nz, .sevenAndBarMode
; Stop early if the middle symbol is not a cherry.
inc hl
@@ -318,7 +319,7 @@ SlotMachine_StopWheel1Early:
SlotMachine_StopWheel2Early:
call SlotMachine_GetWheel2Tiles
ld a, [wSlotMachineFlags]
- and $80
+ and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
jr nz, .sevenAndBarMode
; Stop early if any symbols are lined up in the first two wheels.
call SlotMachine_FindWheel1Wheel2Matches
@@ -402,7 +403,7 @@ SlotMachine_CheckForMatches:
call SlotMachine_CheckForMatch
jr z, .foundMatch
ld a, [wSlotMachineFlags]
- and $c0
+ and (1 << BIT_SLOTS_CAN_WIN) | (1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR)
jr z, .noMatch
ld hl, wSlotMachineRerollCounter
dec [hl]
@@ -422,9 +423,9 @@ SlotMachine_CheckForMatches:
jp SlotMachine_CheckForMatches
.foundMatch
ld a, [wSlotMachineFlags]
- and $c0
+ and (1 << BIT_SLOTS_CAN_WIN) | (1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR)
jr z, .rollWheel3DownByOneSymbol ; roll wheel if player isn't allowed to win
- and $80
+ and 1 << BIT_SLOTS_CAN_WIN_WITH_7_OR_BAR
jr nz, .acceptMatch
; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel
ld a, [hl]
@@ -602,7 +603,7 @@ SlotReward300Func:
call PlaySound
call Random
cp $80
- ld a, $0
+ ld a, 0
jr c, .skip
ld [wSlotMachineFlags], a
.skip
@@ -657,7 +658,7 @@ SlotMachine_PrintPayoutCoins:
jp PrintNumber
SlotMachine_PayCoinsToPlayer:
- ld a, $1
+ ld a, TRUE
ld [wMuteAudioAndPauseMusic], a
call WaitForSoundToFinish