comment slot machine

This commit is contained in:
YamaArashi 2015-07-13 13:35:35 -07:00
parent 95b1660e59
commit f66a74b9fc
13 changed files with 447 additions and 327 deletions

View file

@ -72,6 +72,19 @@ PARTY_TO_BOX EQU 1
DAYCARE_TO_PARTY EQU 2 DAYCARE_TO_PARTY EQU 2
PARTY_TO_DAYCARE EQU 3 PARTY_TO_DAYCARE EQU 3
; emotion bubbles
EXCLAMATION_BUBBLE EQU 0
QUESTION_BUBBLE EQU 1
SMILE_BUBBLE EQU 2
; slot symbols
SLOTS7 EQU $0200
SLOTSBAR EQU $0604
SLOTSCHERRY EQU $0A08
SLOTSFISH EQU $0E0C
SLOTSBIRD EQU $1210
SLOTSMOUSE EQU $1614
; serial ; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01

View file

@ -77,7 +77,7 @@ DisplayCreditsMon: ; 740cb (1d:40cb)
call Func_74164 call Func_74164
call FillMiddleOfScreenWithWhite call FillMiddleOfScreenWithWhite
ld a,$FC ld a,$FC
ld [$FF47],a ld [rBGP],a
ld bc,7 ld bc,7
.next .next
call Func_74140 call Func_74140
@ -94,7 +94,7 @@ DisplayCreditsMon: ; 740cb (1d:40cb)
xor a xor a
ld [hWY],a ld [hWY],a
ld a,$C0 ld a,$C0
ld [$FF47],a ld [rBGP],a
ret ret
INCLUDE "data/credit_mons.asm" INCLUDE "data/credit_mons.asm"

View file

@ -2645,16 +2645,16 @@ Unknown_79c50: ; 79c50 (1e:5c50)
AnimationLeavesFalling: ; 79c74 (1e:5c74) AnimationLeavesFalling: ; 79c74 (1e:5c74)
; Makes leaves float down from the top of the screen. This is used ; Makes leaves float down from the top of the screen. This is used
; in Razor Leaf's animation. ; in Razor Leaf's animation.
ld a, [$ff48] ld a, [rOBP0]
push af push af
ld a, [wcc79] ld a, [wcc79]
ld [$ff48], a ld [rOBP0], a
ld d, $37 ld d, $37
ld a, $3 ld a, $3
ld [W_SUBANIMTRANSFORM], a ld [W_SUBANIMTRANSFORM], a
call Func_79c97 call Func_79c97
pop af pop af
ld [$ff48], a ld [rOBP0], a
ret ret
AnimationPetalsFalling: ; 79c8a (1e:5c8a) AnimationPetalsFalling: ; 79c8a (1e:5c8a)

View file

@ -1,5 +1,5 @@
StartSlotMachine: ; 37e2d (d:7e2d) StartSlotMachine: ; 37e2d (d:7e2d)
ld a, [wTrainerSpriteOffset] ld a, [wHiddenObjectFunctionArgument]
cp $fd cp $fd
jr z, .printOutOfOrder jr z, .printOutOfOrder
cp $fe cp $fe
@ -7,23 +7,23 @@ StartSlotMachine: ; 37e2d (d:7e2d)
cp $ff cp $ff
jr z, .printSomeonesKeys jr z, .printSomeonesKeys
callba AbleToPlaySlotsCheck callba AbleToPlaySlotsCheck
ld a, [wTrainerSpriteOffset] ld a, [wHiddenObjectFunctionArgument]
and a and a
ret z ret z
ld a, [wUnknownSlotVar] ld a, [wLuckySlotHiddenObjectIndex]
ld b, a ld b, a
ld a, [wTrainerFacingDirection] ld a, [wHiddenObjectIndex]
inc a inc a
cp b cp b
jr z, .asm_37e58 jr z, .match
ld a, $fd ld a, 253
jr .asm_37e5a jr .next
.asm_37e58 .match
ld a, $fa ld a, 250
.asm_37e5a .next
ld [wcc5b], a ld [wSlotMachineSevenAndBarModeChance], a
ld a, [H_LOADEDROMBANK] ld a, [H_LOADEDROMBANK]
ld [wcc5e], a ld [wSlotMachineSavedROMBank], a
call PromptUserToPlaySlots call PromptUserToPlaySlots
ret ret
.printOutOfOrder .printOutOfOrder

View file

@ -56,7 +56,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
call Delay3 call Delay3
call GBPalNormal call GBPalNormal
ld a, $90 ld a, $90
ld [$ff48], a ld [rOBP0], a
call WaitForTextScrollButtonPress call WaitForTextScrollButtonPress
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]

View file

@ -114,7 +114,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
ld hl, wHPBarMaxHP + 1 ld hl, wHPBarMaxHP + 1
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [wPartyMonAnimCounter], a ld [wAnimCounter], a
.asm_65ed .asm_65ed
call PrintAlphabet call PrintAlphabet
call GBPalNormal call GBPalNormal

View file

@ -27,7 +27,7 @@ GetAnimationSpeed: ; 7170a (1c:570a)
ld c, a ld c, a
add a add a
ld b, a ld b, a
ld a, [wPartyMonAnimCounter] ld a, [wAnimCounter]
and a and a
jr z, .resetSprites jr z, .resetSprites
cp c cp c
@ -38,7 +38,7 @@ GetAnimationSpeed: ; 7170a (1c:570a)
jr nz, .skipResetTimer jr nz, .skipResetTimer
xor a ; reset timer xor a ; reset timer
.skipResetTimer .skipResetTimer
ld [wPartyMonAnimCounter], a ld [wAnimCounter], a
jp DelayFrame jp DelayFrame
.resetSprites .resetSprites
push bc push bc

View file

@ -10,13 +10,13 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr nz, .skip jr nz, .done ; if player chose No
dec a dec a
ld [wUpdateSpritesEnabled], a ld [wUpdateSpritesEnabled], a
ld hl, wcd4f ld hl, wSlotMachineRerollCounter
xor a xor a
ld [hli], a ld [hli], a
ld [hl], $2 ld [hl], SMILE_BUBBLE
predef EmotionBubble predef EmotionBubble
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call LoadSlotMachineTiles call LoadSlotMachineTiles
@ -25,30 +25,30 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
call GoPAL_SET call GoPAL_SET
call GBPalNormal call GBPalNormal
ld a, $e4 ld a, $e4
ld [$ff48], a ld [rOBP0], a
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
xor a xor a
ld [W_SUBANIMSUBENTRYADDR], a ld [wSlotMachineAllowMatchesCounter], a
ld hl, wTrainerSpriteOffset ld hl, wStoppingWhichSlotMachineWheel
ld bc, $0014 ld bc, $0014
call FillMemory call FillMemory
call MainSlotMachineLoop call MainSlotMachineLoop
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
xor a xor a
ld [W_SUBANIMSUBENTRYADDR], a ld [wSlotMachineAllowMatchesCounter], a
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
ld a, $1 ld a, $1
ld [wUpdateSpritesEnabled], a ld [wUpdateSpritesEnabled], a
call GoPAL_SET_CF1C call GoPAL_SET_CF1C
call ReloadMapSpriteTilePatterns call ReloadMapSpriteTilePatterns
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
.skip .done
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call Delay3 call Delay3
call GBPalNormal call GBPalNormal
ld a, [wcc5e] ld a, [wSlotMachineSavedROMBank]
push af push af
jp CloseTextDisplay jp CloseTextDisplay
@ -57,43 +57,43 @@ PlaySlotMachineText: ; 37390 (d:7390)
db "@" db "@"
MainSlotMachineLoop: ; 37395 (d:7395) MainSlotMachineLoop: ; 37395 (d:7395)
call SlotMachine_37754 call SlotMachine_PrintCreditCoins
xor a xor a
ld hl, wcd4a ld hl, wPayoutCoins
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
call SlotMachine_3775f call SlotMachine_PrintPayoutCoins
ld hl, BetHowManySlotMachineText ld hl, BetHowManySlotMachineText
call PrintText call PrintText
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
.loop .loop
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, $2 ld a, 2
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, $c ld a, 12
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
ld a, $f ld a, 15
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wLastMenuItem], a ld [wLastMenuItem], a
ld [wMenuWatchMovingOutOfBounds], a ld [wMenuWatchMovingOutOfBounds], a
ld hl, wTileMap + $ea hlCoord 14, 11
ld b, $5 ld b, 5
ld c, $4 ld c, 4
call TextBoxBorder call TextBoxBorder
ld hl, wTileMap + $100 hlCoord 16, 12
ld de, CoinMultiplierSlotMachineText ld de, CoinMultiplierSlotMachineText
call PlaceString call PlaceString
call HandleMenuInput call HandleMenuInput
and $2 and B_BUTTON
jp nz, LoadScreenTilesFromBuffer1 jp nz, LoadScreenTilesFromBuffer1
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld b, a ld b, a
ld a, $3 ld a, 3
sub b sub b
ld [wcd50], a ld [wSlotMachineBet], a
ld hl, wPlayerCoins ld hl, wPlayerCoins
ld c, a ld c, a
ld a, [hli] ld a, [hli]
@ -107,11 +107,11 @@ MainSlotMachineLoop: ; 37395 (d:7395)
jr .loop jr .loop
.skip1 .skip1
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
call SlotMachine_37741 call SlotMachine_SubtractBetFromPlayerCoins
call SlotMachine_377d5 call SlotMachine_LightBalls
call SlotMachine_37480 call SlotMachine_SetFlags
ld a, $4 ld a, 4
ld hl, wcd4d ld hl, wSlotMachineWheel1SlipCounter
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
@ -120,8 +120,8 @@ MainSlotMachineLoop: ; 37395 (d:7395)
call PlaySound call PlaySound
ld hl, StartSlotMachineText ld hl, StartSlotMachineText
call PrintText call PrintText
call SlotMachine_374ad call SlotMachine_SpinWheels
call SlotMachine_37588 call SlotMachine_CheckForMatches
ld hl, wPlayerCoins ld hl, wPlayerCoins
ld a, [hli] ld a, [hli]
or [hl] or [hl]
@ -143,7 +143,7 @@ MainSlotMachineLoop: ; 37395 (d:7395)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
ret nz ret nz
call SlotMachine_377ce call SlotMachine_PutOutLitBalls
jp MainSlotMachineLoop jp MainSlotMachineLoop
CoinMultiplierSlotMachineText: ; 3745e (d:745e) CoinMultiplierSlotMachineText: ; 3745e (d:745e)
@ -171,55 +171,55 @@ OneMoreGoSlotMachineText: ; 3747b (d:747b)
TX_FAR _OneMoreGoSlotMachineText TX_FAR _OneMoreGoSlotMachineText
db "@" db "@"
SlotMachine_37480: ; 37480 (d:7480) SlotMachine_SetFlags: ; 37480 (d:7480)
ld hl, wcd4c ld hl, wSlotMachineFlags
bit 7, [hl] bit 7, [hl]
ret nz ret nz
ld a, [W_SUBANIMSUBENTRYADDR] ld a, [wSlotMachineAllowMatchesCounter]
and a and a
jr nz, .skip1 jr nz, .allowMatches
call Random call Random
and a and a
jr z, .skip2 jr z, .setAllowMatchesCounter ; 1/256 (~0.4%) chance
ld b, a ld b, a
ld a, [wcc5b] ld a, [wSlotMachineSevenAndBarModeChance]
cp b cp b
jr c, .skip3 jr c, .allowSevenAndBarMatches
ld a, $d2 ld a, 210
cp b cp b
jr c, .skip1 jr c, .allowMatches ; 55/256 (~21.5%) chance
ld [hl], $0 ld [hl], 0
ret ret
.skip1 .allowMatches
set 6, [hl] set 6, [hl]
ret ret
.skip2 .setAllowMatchesCounter
ld a, $3c ld a, 60
ld [W_SUBANIMSUBENTRYADDR], a ld [wSlotMachineAllowMatchesCounter], a
ret ret
.skip3 .allowSevenAndBarMatches
set 7, [hl] set 7, [hl]
ret ret
SlotMachine_374ad: ; 374ad (d:74ad) SlotMachine_SpinWheels: ; 374ad (d:74ad)
ld c, 20 ld c, 20
.loop1 .loop1
push bc push bc
call SlotMachine_37813 call SlotMachine_AnimWheel1
call SlotMachine_37823 call SlotMachine_AnimWheel2
call SlotMachine_37833 call SlotMachine_AnimWheel3
ld c, 2 ld c, 2
call DelayFrames call DelayFrames
pop bc pop bc
dec c dec c
jr nz, .loop1 jr nz, .loop1
xor a xor a
ld [wTrainerSpriteOffset], a ld [wStoppingWhichSlotMachineWheel], a
.loop2 .loop2
call SlotMachine_37882 call SlotMachine_HandleInputWhileWheelsSpin
call SlotMachine_374df call SlotMachine_StopOrAnimWheel1
call SlotMachine_374fb call SlotMachine_StopOrAnimWheel2
call SlotMachine_37517 call SlotMachine_StopOrAnimWheel3
ret c ret c
ld a, [wOnSGB] ld a, [wOnSGB]
xor $1 xor $1
@ -228,194 +228,214 @@ SlotMachine_374ad: ; 374ad (d:74ad)
call DelayFrames call DelayFrames
jr .loop2 jr .loop2
SlotMachine_374df: ; 374df (d:74df) ; Note that the wheels can only stop when a symbol is centred in the wheel
ld a, [wTrainerSpriteOffset] ; and thus 3 full symbols rather than 2 full symbols and 2 half symbols are
cp $1 ; visible. The 3 functions below ensure this by checking if the wheel offset
jr c, .skip ; is even before stopping the wheel.
ld de, wTrainerEngageDistance
SlotMachine_StopOrAnimWheel1: ; 374df (d:74df)
ld a, [wStoppingWhichSlotMachineWheel]
cp 1
jr c, .animWheel
ld de, wSlotMachineWheel1Offset
ld a, [de] ld a, [de]
rra rra
jr nc, .skip jr nc, .animWheel ; check that a symbol is centred in the wheel
ld hl, wcd4d ld hl, wSlotMachineWheel1SlipCounter
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
dec [hl] dec [hl]
call SlotMachine_3752c call SlotMachine_StopWheel1Early
ret nz ret nz
.skip .animWheel
jp SlotMachine_37813 jp SlotMachine_AnimWheel1
SlotMachine_374fb: ; 374fb (d:74fb) SlotMachine_StopOrAnimWheel2: ; 374fb (d:74fb)
ld a, [wTrainerSpriteOffset] ld a, [wStoppingWhichSlotMachineWheel]
cp $2 cp 2
jr c, .skip jr c, .animWheel
ld de, wTrainerFacingDirection ld de, wSlotMachineWheel2Offset
ld a, [de] ld a, [de]
rra rra
jr nc, .skip jr nc, .animWheel ; check that a symbol is centred in the wheel
ld hl, wcd4e ld hl, wSlotMachineWheel2SlipCounter
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
dec [hl] dec [hl]
call SlotMachine_37552 call SlotMachine_StopWheel2Early
ret z ret z
.skip .animWheel
jp SlotMachine_37823 jp SlotMachine_AnimWheel2
SlotMachine_37517: ; 37517 (d:7517) SlotMachine_StopOrAnimWheel3: ; 37517 (d:7517)
ld a, [wTrainerSpriteOffset] ld a, [wStoppingWhichSlotMachineWheel]
cp $3 cp 3
jr c, .skip jr c, .animWheel
ld de, wTrainerScreenY ld de, wSlotMachineWheel3Offset
ld a, [de] ld a, [de]
rra rra
jr nc, .skip jr nc, .animWheel ; check that a symbol is centred in the wheel
; wheel 3 stops as soon as possible
scf scf
ret ret
.skip .animWheel
call SlotMachine_37833 call SlotMachine_AnimWheel3
and a and a
ret ret
SlotMachine_3752c: ; 3752c (d:752c) SlotMachine_StopWheel1Early: ; 3752c (d:752c)
call SlotMachine_GetWheelOneTile call SlotMachine_GetWheel1Tiles
ld hl, wTrainerScreenX ld hl, wSlotMachineWheel1BottomTile
ld a, [wcd4c] ld a, [wSlotMachineFlags]
and $80 and $80
jr nz, .skip1 jr nz, .sevenAndBarMode
; Stop early if the middle symbol is not a cherry.
inc hl inc hl
ld a, [hl] ld a, [hl]
cp $a cp SLOTSCHERRY >> 8
jr nz, .skip2 jr nz, .stopWheel
ret ret
.skip1 ; It looks like this was intended to make the wheel stop when a 7 symbol was
; visible, but it has a bug and so the wheel stops randomly.
.sevenAndBarMode
ld c, $3 ld c, $3
.loop .loop
ld a, [hli] ld a, [hli]
cp $2 cp SLOTS7 >> 8
jr c, .skip2 jr c, .stopWheel ; condition never true
dec c dec c
jr nz, .loop jr nz, .loop
ret ret
.skip2 .stopWheel
inc a inc a
ld hl, wcd4d ld hl, wSlotMachineWheel1SlipCounter
ld [hl], $0 ld [hl], 0
ret ret
SlotMachine_37552: ; 37552 (d:7552) SlotMachine_StopWheel2Early: ; 37552 (d:7552)
call SlotMachine_GetWheelTwoTile call SlotMachine_GetWheel2Tiles
ld a, [wcd4c] ld a, [wSlotMachineFlags]
and $80 and $80
jr nz, .skip1 jr nz, .sevenAndBarMode
call SlotMachine_3756e ; Stop early if any symbols are lined up in the first two wheels.
call SlotMachine_FindWheel1Wheel2Matches
ret nz ret nz
jr .skip2 jr .stopWheel
.skip1 ; Stop early if two 7 symbols or two bar symbols are lined up in the first two
call SlotMachine_3756e ; wheels OR if no symbols are lined up and the bottom symbol in wheel 2 is a
; 7 symbol or bar symbol. The second part could be a bug or a way to reduce the
; player's odds.
.sevenAndBarMode
call SlotMachine_FindWheel1Wheel2Matches
ld a, [de] ld a, [de]
cp $7 cp (SLOTSBAR >> 8) + 1
ret nc ret nc
.skip2 .stopWheel
xor a xor a
ld [wcd4e], a ld [wSlotMachineWheel2SlipCounter], a
ret ret
SlotMachine_3756e: ; 3756e (d:756e) SlotMachine_FindWheel1Wheel2Matches: ; 3756e (d:756e)
ld hl, wTrainerScreenX ; return whether wheel 1 and wheel 2's current positions allow a match (given
ld de, wcd44 ; that wheel 3 stops in a good position) in Z
ld hl, wSlotMachineWheel1BottomTile
ld de, wSlotMachineWheel2BottomTile
ld a, [de] ld a, [de]
cp [hl] cp [hl] ; wheel 1 bottom, wheel 2 bottom
ret z ret z
inc de inc de
ld a, [de] ld a, [de]
cp [hl] cp [hl] ; wheel 1 bottom, wheel 2 middle
ret z ret z
inc hl inc hl
cp [hl] cp [hl] ; wheel 1 middle, wheel 2 middle
ret z ret z
inc hl inc hl
cp [hl] cp [hl] ; wheel 1 top, wheel 2 middle
ret z ret z
inc de inc de
ld a, [de] ld a, [de]
cp [hl] cp [hl] ; wheel 1 top, wheel 2 top
ret z ret z
dec de dec de
dec de dec de
ret ret
SlotMachine_37588: ; 37588 (d:7588) SlotMachine_CheckForMatches: ; 37588 (d:7588)
call SlotMachine_GetWheelThreeTile call SlotMachine_GetWheel3Tiles
ld a, [wcd50] ld a, [wSlotMachineBet]
cp $2 cp 2
jr z, .skip1 jr z, .checkMatchesFor2CoinBet
cp $1 cp 1
jr z, .skip2 jr z, .checkMatchFor1CoinBet
ld hl, wTrainerScreenX ; 3 coin bet allows diagonal matches (plus the matches for 1/2 coin bets)
ld de, wcd45 ld hl, wSlotMachineWheel1BottomTile
ld bc, wcd49 ld de, wSlotMachineWheel2MiddleTile
ld bc, wSlotMachineWheel3TopTile
call SlotMachine_CheckForMatch call SlotMachine_CheckForMatch
jp z, .skip5 jp z, .foundMatch
ld hl, wcd43 ld hl, wSlotMachineWheel1TopTile
ld de, wcd45 ld de, wSlotMachineWheel2MiddleTile
ld bc, wcd47 ld bc, wSlotMachineWheel3BottomTile
call SlotMachine_CheckForMatch call SlotMachine_CheckForMatch
jr z, .skip5 jr z, .foundMatch
.skip1 ; 2 coin bet allows top/bottom horizontal matches (plus the match for a 1 coin bet)
ld hl, wcd43 .checkMatchesFor2CoinBet
ld de, wcd46 ld hl, wSlotMachineWheel1TopTile
ld bc, wcd49 ld de, wSlotMachineWheel2TopTile
ld bc, wSlotMachineWheel3TopTile
call SlotMachine_CheckForMatch call SlotMachine_CheckForMatch
jr z, .skip5 jr z, .foundMatch
ld hl, wTrainerScreenX ld hl, wSlotMachineWheel1BottomTile
ld de, wcd44 ld de, wSlotMachineWheel2BottomTile
ld bc, wcd47 ld bc, wSlotMachineWheel3BottomTile
call SlotMachine_CheckForMatch call SlotMachine_CheckForMatch
jr z, .skip5 jr z, .foundMatch
.skip2 ; 1 coin bet only allows a middle horizontal match
ld hl, wcd42 .checkMatchFor1CoinBet
ld de, wcd45 ld hl, wSlotMachineWheel1MiddleTile
ld bc, wcd48 ld de, wSlotMachineWheel2MiddleTile
ld bc, wSlotMachineWheel3MiddleTile
call SlotMachine_CheckForMatch call SlotMachine_CheckForMatch
jr z, .skip5 jr z, .foundMatch
ld a, [wcd4c] ld a, [wSlotMachineFlags]
and $c0 and $c0
jr z, .skip3 jr z, .noMatch
ld hl, wcd4f ld hl, wSlotMachineRerollCounter
dec [hl] dec [hl]
jr nz, .skip4 jr nz, .rollWheel3DownByOneSymbol
.skip3 .noMatch
ld hl, NotThisTimeText ld hl, NotThisTimeText
call PrintText call PrintText
.loop .done
xor a xor a
ld [wc002], a ld [wc002], a
ret ret
.skip4 .rollWheel3DownByOneSymbol
call SlotMachine_37833 call SlotMachine_AnimWheel3
call DelayFrame call DelayFrame
call SlotMachine_37833 call SlotMachine_AnimWheel3
call DelayFrame call DelayFrame
jp SlotMachine_37588 jp SlotMachine_CheckForMatches
.skip5 .foundMatch
ld a, [wcd4c] ld a, [wSlotMachineFlags]
and $c0 and $c0
jr z, .skip4 jr z, .rollWheel3DownByOneSymbol ; roll wheel if player isn't allowed to win
and $80 and $80
jr nz, .skip6 jr nz, .acceptMatch
; if 7/bar matches aren't enabled and the match was a 7/bar symbol, roll wheel
ld a, [hl] ld a, [hl]
cp $7 cp (SLOTSBAR >> 8) + 1
jr c, .skip4 jr c, .rollWheel3DownByOneSymbol
.skip6 .acceptMatch
ld a, [hl] ld a, [hl]
sub $2 sub $2
ld [wTrainerScreenX], a ld [wSlotMachineWinningSymbol], a
ld hl, SlotRewardPointers ld hl, SlotRewardPointers
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld e, a ld e, a
@ -426,39 +446,39 @@ SlotMachine_37588: ; 37588 (d:7588)
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, wcf4b ld de, wcf4b
ld bc, $0004 ld bc, 4
call CopyData call CopyData
pop hl pop hl
ld de, .asm_37638 ld de, .flashScreenLoop
push de push de
jp [hl] jp [hl]
.asm_37638 .flashScreenLoop
ld a, [$ff47] ld a, [rBGP]
xor $40 xor $40
ld [$ff47], a ld [rBGP], a
ld c, 5 ld c, 5
call DelayFrames call DelayFrames
dec b dec b
jr nz, .asm_37638 jr nz, .flashScreenLoop
ld hl, wcd4a ld hl, wPayoutCoins
ld [hl], d ld [hl], d
inc hl inc hl
ld [hl], e ld [hl], e
call SlotMachine_3775f call SlotMachine_PrintPayoutCoins
ld hl, SlotsMachineText_37665 ld hl, SymbolLinedUpSlotMachineText
call PrintText call PrintText
call WaitForTextScrollButtonPress call WaitForTextScrollButtonPress
call SlotMachine_3776b call SlotMachine_PayCoinsToPlayer
call SlotMachine_3775f call SlotMachine_PrintPayoutCoins
ld a, $e4 ld a, $e4
ld [$ff48], a ld [rOBP0], a
jp .loop jp .done
SlotsMachineText_37665: ; 37665 (d:7665) SymbolLinedUpSlotMachineText: ; 37665 (d:7665)
TX_ASM TX_ASM
push bc push bc
call SlotMachine_37728 call SlotMachine_PrintWinningSymbol
ld hl, LinedUpText ld hl, LinedUpText
pop bc pop bc
inc bc inc bc
@ -510,28 +530,28 @@ SlotMachine_CheckForMatch: ; 376a2 (d:76a2)
cp [hl] cp [hl]
ret ret
SlotMachine_GetWheelThreeTile: ; 376a8 (d:76a8) SlotMachine_GetWheel3Tiles: ; 376a8 (d:76a8)
ld de, wcd47 ld de, wSlotMachineWheel3BottomTile
ld hl, SlotMachineWheel3 ld hl, SlotMachineWheel3
ld a, [wTrainerScreenY] ld a, [wSlotMachineWheel3Offset]
call SlotMachine_GetWheelTile call SlotMachine_GetWheelTiles
SlotMachine_GetWheelTwoTile: ; 376b4 (d:76b4) SlotMachine_GetWheel2Tiles: ; 376b4 (d:76b4)
ld de, wcd44 ld de, wSlotMachineWheel2BottomTile
ld hl, SlotMachineWheel2 ld hl, SlotMachineWheel2
ld a, [wTrainerFacingDirection] ld a, [wSlotMachineWheel2Offset]
call SlotMachine_GetWheelTile call SlotMachine_GetWheelTiles
SlotMachine_GetWheelOneTile: ; 376c0 (d:76c0) SlotMachine_GetWheel1Tiles: ; 376c0 (d:76c0)
ld de, wTrainerScreenX ld de, wSlotMachineWheel1BottomTile
ld hl, SlotMachineWheel1 ld hl, SlotMachineWheel1
ld a, [wTrainerEngageDistance] ld a, [wSlotMachineWheel1Offset]
SlotMachine_GetWheelTile: ; 376c9 (d:76c9) SlotMachine_GetWheelTiles: ; 376c9 (d:76c9)
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld c, $3 ld c, 3
.loop .loop
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -542,7 +562,7 @@ SlotMachine_GetWheelTile: ; 376c9 (d:76c9)
ret ret
SlotReward8Func: ; 376d7 (d:76d7) SlotReward8Func: ; 376d7 (d:76d7)
ld hl, W_SUBANIMSUBENTRYADDR ld hl, wSlotMachineAllowMatchesCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .skip jr z, .skip
@ -553,7 +573,7 @@ SlotReward8Func: ; 376d7 (d:76d7)
ret ret
SlotReward15Func: ; 376e5 (d:76e5) SlotReward15Func: ; 376e5 (d:76e5)
ld hl, W_SUBANIMSUBENTRYADDR ld hl, wSlotMachineAllowMatchesCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .skip jr z, .skip
@ -567,7 +587,7 @@ SlotReward100Func: ; 376f3 (d:76f3)
ld a, (SFX_1f_42 - SFX_Headers_1f) / 3 ld a, (SFX_1f_42 - SFX_Headers_1f) / 3
call PlaySound call PlaySound
xor a xor a
ld [wcd4c], a ld [wSlotMachineFlags], a
ld b, $8 ld b, $8
ld de, 100 ld de, 100
ret ret
@ -581,9 +601,9 @@ SlotReward300Func: ; 37702 (d:7702)
cp $80 cp $80
ld a, $0 ld a, $0
jr c, .skip jr c, .skip
ld [wcd4c], a ld [wSlotMachineFlags], a
.skip .skip
ld [W_SUBANIMSUBENTRYADDR], a ld [wSlotMachineAllowMatchesCounter], a
ld b, $14 ld b, $14
ld de, 300 ld de, 300
ret ret
@ -592,26 +612,27 @@ YeahText: ; 37722 (d:7722)
TX_FAR _YeahText TX_FAR _YeahText
db $0a, "@" db $0a, "@"
SlotMachine_37728: ; 37728 (d:7728) SlotMachine_PrintWinningSymbol: ; 37728 (d:7728)
ld hl, wTileMap + $11a ; prints winning symbol and down arrow in text box
ld a, [wTrainerScreenX] hlCoord 2, 14
ld a, [wSlotMachineWinningSymbol]
add $25 add $25
ld [hli], a ld [hli], a
inc a inc a
ld [hld], a ld [hld], a
inc a inc a
ld de, $ffec ld de, -SCREEN_WIDTH
add hl, de add hl, de
ld [hli], a ld [hli], a
inc a inc a
ld [hl], a ld [hl], a
ld hl, wTileMap + $152 hlCoord 18, 16
ld [hl], $ee ld [hl], $ee ; down arrow
ret ret
SlotMachine_37741: ; 37741 (d:7741) SlotMachine_SubtractBetFromPlayerCoins: ; 37741 (d:7741)
ld hl, wcd4b ld hl, wTempCoins2 + 1
ld a, [wcd50] ld a, [wSlotMachineBet]
ld [hld], a ld [hld], a
xor a xor a
ld [hli], a ld [hli], a
@ -619,136 +640,143 @@ SlotMachine_37741: ; 37741 (d:7741)
ld c, $2 ld c, $2
predef SubBCDPredef predef SubBCDPredef
SlotMachine_37754: ; 37754 (d:7754) SlotMachine_PrintCreditCoins: ; 37754 (d:7754)
ld hl, wTileMap + $19 hlCoord 5, 1
ld de, wPlayerCoins ld de, wPlayerCoins
ld c, $2 ld c, $2
jp PrintBCDNumber jp PrintBCDNumber
SlotMachine_3775f: ; 3775f (d:775f) SlotMachine_PrintPayoutCoins: ; 3775f (d:775f)
ld hl, wTileMap + $1f hlCoord 11, 1
ld de, wcd4a ld de, wPayoutCoins
ld bc, $8204 ld bc, $8204 ; 2 bytes, 4 digits, leading zeroes
jp PrintNumber jp PrintNumber
SlotMachine_3776b: ; 3776b (d:776b) SlotMachine_PayCoinsToPlayer: ; 3776b (d:776b)
ld a, $1 ld a, $1
ld [wc002], a ld [wc002], a
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, wcd46
; Put 1 in the temp coins variable. This value is added to the player's coins
; repeatedly so the player can watch the value go up 1 coin at a time.
ld hl, wTempCoins1
xor a xor a
ld [hli], a ld [hli], a
inc a inc a
ld [hl], a ld [hl], a
ld a, $5
ld [W_SUBANIMTRANSFORM], a ld a, 5
ld [wAnimCounter], a
; Subtract 1 from the payout amount and add 1 to the player's coins each
; iteration until the payout amount reaches 0.
.loop .loop
ld a, [wcd4b] ld a, [wPayoutCoins + 1]
ld l, a ld l, a
ld a, [wcd4a] ld a, [wPayoutCoins]
ld h, a ld h, a
or l or l
ret z ret z
ld de, $ffff ld de, -1
add hl, de add hl, de
ld a, l ld a, l
ld [wcd4b], a ld [wPayoutCoins + 1], a
ld a, h ld a, h
ld [wcd4a], a ld [wPayoutCoins], a
ld hl, wcd47 ld hl, wTempCoins1 + 1
ld de, wPlayerCoins + 1 ld de, wPlayerCoins + 1
ld c, $2 ld c, $2
predef AddBCDPredef predef AddBCDPredef
call SlotMachine_37754 call SlotMachine_PrintCreditCoins
call SlotMachine_3775f call SlotMachine_PrintPayoutCoins
ld a, (SFX_1f_65 - SFX_Headers_1f) / 3 ld a, (SFX_1f_65 - SFX_Headers_1f) / 3
call PlaySound call PlaySound
ld a, [W_SUBANIMTRANSFORM] ld a, [wAnimCounter]
dec a dec a
jr nz, .skip1 jr nz, .skip1
ld a, [$ff48] ld a, [rOBP0]
xor $40 xor $40 ; make the slot wheel symbols flash
ld [$ff48], a ld [rOBP0], a
ld a, $5 ld a, 5
.skip1 .skip1
ld [W_SUBANIMTRANSFORM], a ld [wAnimCounter], a
ld a, [wTrainerScreenX] ld a, [wSlotMachineWinningSymbol]
cp $7 cp (SLOTSBAR >> 8) + 1
ld c, 8 ld c, 8
jr nc, .skip2 jr nc, .skip2
srl c srl c ; c = 4 (make the the coins transfer faster if the symbol was 7 or bar)
.skip2 .skip2
call DelayFrames call DelayFrames
jr .loop jr .loop
SlotMachine_377ce: ; 377ce (d:77ce) SlotMachine_PutOutLitBalls: ; 377ce (d:77ce)
ld a, $23 ld a, $23
ld [wd08a], a ld [wd08a], a
jr SlotMachine_377e3 jr SlotMachine_UpdateThreeCoinBallTiles
SlotMachine_377d5: ; 377d5 (d:77d5) SlotMachine_LightBalls: ; 377d5 (d:77d5)
ld a, $14 ld a, $14
ld [wd08a], a ld [wd08a], a
ld a, [wcd50] ld a, [wSlotMachineBet]
dec a dec a
jr z, SlotMachine_377fb jr z, SlotMachine_UpdateOneCoinBallTiles
dec a dec a
jr z, SlotMachine_377ef jr z, SlotMachine_UpdateTwoCoinBallTiles
SlotMachine_377e3: ; 377e3 (d:77e3) SlotMachine_UpdateThreeCoinBallTiles: ; 377e3 (d:77e3)
ld hl, wTileMap + $2b hlCoord 3, 2
call SlotMachine_377fe call SlotMachine_UpdateBallTiles
ld hl, wTileMap + $cb hlCoord 3, 10
call SlotMachine_377fe call SlotMachine_UpdateBallTiles
SlotMachine_377ef: ; 377ef (d:77ef) SlotMachine_UpdateTwoCoinBallTiles: ; 377ef (d:77ef)
ld hl, wTileMap + $53 hlCoord 3, 4
call SlotMachine_377fe call SlotMachine_UpdateBallTiles
ld hl, wTileMap + $a3 hlCoord 3, 8
call SlotMachine_377fe call SlotMachine_UpdateBallTiles
SlotMachine_377fb: ; 377fb (d:77fb) SlotMachine_UpdateOneCoinBallTiles: ; 377fb (d:77fb)
ld hl, wTileMap + $7b hlCoord 3, 6
SlotMachine_377fe: ; 377fe (d:77fe) SlotMachine_UpdateBallTiles: ; 377fe (d:77fe)
ld a, [wd08a] ld a, [wd08a]
ld [hl], a ld [hl], a
ld bc, $000d ld bc, 13
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld bc, $0007 ld bc, 7
add hl, bc add hl, bc
inc a inc a
ld [hl], a ld [hl], a
ld bc, $000d ld bc, 13
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ret ret
SlotMachine_37813: ; 37813 (d:7813) SlotMachine_AnimWheel1: ; 37813 (d:7813)
ld bc, SlotMachineWheel1 ld bc, SlotMachineWheel1
ld de, wTrainerEngageDistance ld de, wSlotMachineWheel1Offset
ld hl, wOAMBuffer ld hl, wOAMBuffer
ld a, $30 ld a, $30
ld [W_BASECOORDX], a ld [W_BASECOORDX], a
jr SlotMachine_37841 jr SlotMachine_AnimWheel
SlotMachine_37823: ; 37823 (d:7823) SlotMachine_AnimWheel2: ; 37823 (d:7823)
ld bc, SlotMachineWheel2 ld bc, SlotMachineWheel2
ld de, wTrainerFacingDirection ld de, wSlotMachineWheel2Offset
ld hl, wOAMBuffer + $30 ld hl, wOAMBuffer + $30
ld a, $50 ld a, $50
ld [W_BASECOORDX], a ld [W_BASECOORDX], a
jr SlotMachine_37841 jr SlotMachine_AnimWheel
SlotMachine_37833: ; 37833 (d:7833) SlotMachine_AnimWheel3: ; 37833 (d:7833)
ld bc, SlotMachineWheel3 ld bc, SlotMachineWheel3
ld de, wTrainerScreenY ld de, wSlotMachineWheel3Offset
ld hl, wOAMBuffer + $60 ld hl, wOAMBuffer + $60
ld a, $70 ld a, $70
ld [W_BASECOORDX], a ld [W_BASECOORDX], a
SlotMachine_37841: ; 37841 (d:7841) SlotMachine_AnimWheel: ; 37841 (d:7841)
ld a, $58 ld a, $58
ld [W_BASECOORDY], a ld [W_BASECOORDY], a
push de push de
@ -756,10 +784,9 @@ SlotMachine_37841: ; 37841 (d:7841)
ld d, b ld d, b
add c add c
ld e, a ld e, a
jr nc, SlotMachine_3784e jr nc, .loop
inc d inc d
.loop
SlotMachine_3784e: ; 3784e (d:784e)
ld a, [W_BASECOORDY] ld a, [W_BASECOORDY]
ld [hli], a ld [hli], a
ld a, [W_BASECOORDX] ld a, [W_BASECOORDX]
@ -783,30 +810,30 @@ SlotMachine_3784e: ; 3784e (d:784e)
sub $8 sub $8
ld [W_BASECOORDY], a ld [W_BASECOORDY], a
cp $28 cp $28
jr nz, SlotMachine_3784e jr nz, .loop
pop de pop de
ld a, [de] ld a, [de]
inc a inc a ; advance the offset so that the wheel animates
cp $1e cp 30
jr nz, .skip jr nz, .skip
xor a xor a ; wrap around to 0 when the offset reaches 30
.skip .skip
ld [de], a ld [de], a
ret ret
SlotMachine_37882: ; 37882 (d:7882) SlotMachine_HandleInputWhileWheelsSpin: ; 37882 (d:7882)
call DelayFrame call DelayFrame
call JoypadLowSensitivity call JoypadLowSensitivity
ld a, [hJoy5] ld a, [hJoy5]
and $1 and A_BUTTON
ret z ret z
ld hl, wTrainerSpriteOffset ld hl, wStoppingWhichSlotMachineWheel
ld a, [hl] ld a, [hl]
dec a dec a
ld de, wcd4d ld de, wSlotMachineWheel1SlipCounter
jr z, .skip jr z, .skip
dec a dec a
ld de, wcd4e ld de, wSlotMachineWheel2SlipCounter
jr z, .skip jr z, .skip
.loop .loop
inc [hl] inc [hl]
@ -845,20 +872,13 @@ LoadSlotMachineTiles: ; 378a8 (d:78a8)
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
call SlotMachine_37813 call SlotMachine_AnimWheel1
call SlotMachine_37823 call SlotMachine_AnimWheel2
jp SlotMachine_37833 jp SlotMachine_AnimWheel3
SlotMachineMap: ; 378f5 (d:78f5) SlotMachineMap: ; 378f5 (d:78f5)
INCBIN "gfx/tilemaps/slotmachine.map" INCBIN "gfx/tilemaps/slotmachine.map"
SLOTS7 EQU $0200
SLOTSBAR EQU $0604
SLOTSCHERRY EQU $0A08
SLOTSFISH EQU $0E0C
SLOTSBIRD EQU $1210
SLOTSMOUSE EQU $1614
INCLUDE "data/slot_machine_wheels.asm" INCLUDE "data/slot_machine_wheels.asm"
SlotMachineTiles1: ; 37a51 (d:7a51) SlotMachineTiles1: ; 37a51 (d:7a51)

View file

@ -79,7 +79,7 @@ Func_70e92: ; 70e92 (1c:4e92)
xor a xor a
ld [wTownMapSpriteBlinkingEnabled], a ld [wTownMapSpriteBlinkingEnabled], a
ld [hJoy7], a ld [hJoy7], a
ld [wTownMapSpriteBlinkingCounter], a ld [wAnimCounter], a
call Func_711ab call Func_711ab
pop hl pop hl
pop af pop af
@ -319,7 +319,7 @@ LoadTownMap: ; 7109b (1c:509b)
call Delay3 call Delay3
call GBPalNormal call GBPalNormal
xor a xor a
ld [wTownMapSpriteBlinkingCounter], a ld [wAnimCounter], a
inc a inc a
ld [wTownMapSpriteBlinkingEnabled], a ld [wTownMapSpriteBlinkingEnabled], a
ret ret
@ -577,7 +577,7 @@ MonNestIcon: ; 716be (1c:56be)
INCBIN "gfx/mon_nest_icon.1bpp" INCBIN "gfx/mon_nest_icon.1bpp"
TownMapSpriteBlinkingAnimation: ; 716c6 (1c:56c6) TownMapSpriteBlinkingAnimation: ; 716c6 (1c:56c6)
ld a, [wTownMapSpriteBlinkingCounter] ld a, [wAnimCounter]
inc a inc a
cp 25 cp 25
jr z, .hideSprites jr z, .hideSprites
@ -601,5 +601,5 @@ TownMapSpriteBlinkingAnimation: ; 716c6 (1c:56c6)
jr nz, .hideSpritesLoop jr nz, .hideSpritesLoop
ld a, 25 ld a, 25
.done .done
ld [wTownMapSpriteBlinkingCounter], a ld [wAnimCounter], a
jp DelayFrame jp DelayFrame

View file

@ -3928,7 +3928,7 @@ HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2)
ld [H_DOWNARROWBLINKCNT2],a ; blinking down arrow timing value 2 ld [H_DOWNARROWBLINKCNT2],a ; blinking down arrow timing value 2
.loop1 .loop1
xor a xor a
ld [wPartyMonAnimCounter],a ; counter for pokemon shaking animation ld [wAnimCounter],a ; counter for pokemon shaking animation
call PlaceMenuCursor call PlaceMenuCursor
call Delay3 call Delay3
.loop2 .loop2

View file

@ -31,8 +31,8 @@ rLCDC_DEFAULT EQU %11100011
ld [$ff4a], a ld [$ff4a], a
ld [$ff06], a ld [$ff06], a
ld [$ff07], a ld [$ff07], a
ld [$ff47], a ld [rBGP], a
ld [$ff48], a ld [rOBP0], a
ld [$ff49], a ld [$ff49], a
ld a, rLCDC_ENABLE_MASK ld a, rLCDC_ENABLE_MASK

View file

@ -12,7 +12,7 @@ CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf)
res 6, [hl] res 6, [hl]
ret z ret z
call Random call Random
ld a, [$ffd3] ld a, [hRandomAdd]
cp $7 cp $7
jr nc, .asm_48be2 jr nc, .asm_48be2
ld a, $8 ld a, $8
@ -20,7 +20,7 @@ CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf)
srl a srl a
srl a srl a
srl a srl a
ld [wUnknownSlotVar], a ld [wLuckySlotHiddenObjectIndex], a
ret ret
CeladonGameCornerScript_48bec: ; 48bec (12:4bec) CeladonGameCornerScript_48bec: ; 48bec (12:4bec)

109
wram.asm
View file

@ -357,6 +357,13 @@ wNPCMovementScriptBank:: ; cc58
ds 2 ds 2
wSlotMachineSevenAndBarModeChance:: ; cc5b
; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up.
; So, this value is actually the chance of NOT entering that mode.
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
wHallOfFame:: ; cc5b wHallOfFame:: ; cc5b
wBoostExpByExpAll:: ; cc5b wBoostExpByExpAll:: ; cc5b
wAnimationType:: ; cc5b wAnimationType:: ; cc5b
@ -365,7 +372,12 @@ wAnimationType:: ; cc5b
wcc5b:: ds 1 ; these upcoming values below are miscellaneous storage values wcc5b:: ds 1 ; these upcoming values below are miscellaneous storage values
wcc5c:: ds 1 ; used in pokedex evaluation as well wcc5c:: ds 1 ; used in pokedex evaluation as well
wcc5d:: ds 1 ; used in pokedex evaluation wcc5d:: ds 1 ; used in pokedex evaluation
wcc5e:: ds 13 ; as well as used as miscellaneous storage value, this is also used for the game corner slots
wSlotMachineSavedROMBank:: ; cc5e
; ROM back to return to when the player is done with the slot machine
ds 1
ds 12
wcc6b:: ds 14 ; doesn't seem to be used for anything, probably just more storage wcc6b:: ds 14 ; doesn't seem to be used for anything, probably just more storage
wcc79:: ds 30 ; used in battle animations wcc79:: ds 30 ; used in battle animations
@ -463,7 +475,7 @@ wPlayerMonMinimized:: ds 1 ; ccf7
ds 13 ds 13
wUnknownSlotVar:: ; cd05 wLuckySlotHiddenObjectIndex:: ; cd05
wEnemyNumHits:: ; cd05 wEnemyNumHits:: ; cd05
; number of hits by enemy in attacks like Double Slap, etc. ; number of hits by enemy in attacks like Double Slap, etc.
@ -588,6 +600,10 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b
ds 1 ds 1
wStoppingWhichSlotMachineWheel:: ; cd3d
; which wheel the player is trying to stop
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
wTradedPlayerMonSpecies:: ; cd3d wTradedPlayerMonSpecies:: ; cd3d
wTradingWhichPlayerMon:: ; cd3d wTradingWhichPlayerMon:: ; cd3d
@ -611,6 +627,8 @@ wWhichTrade:: ; cd3d
wTrainerSpriteOffset:: ; cd3d wTrainerSpriteOffset:: ; cd3d
ds 1 ds 1
wSlotMachineWheel1Offset:: ; cd3e
wTradedEnemyMonSpecies:: ; cd3e wTradedEnemyMonSpecies:: ; cd3e
wTradingWhichEnemyMon:: ; cd3e wTradingWhichEnemyMon:: ; cd3e
@ -626,6 +644,8 @@ wHiddenObjectFunctionRomBank:: ; cd3e
wTrainerEngageDistance:: ; cd3e wTrainerEngageDistance:: ; cd3e
ds 1 ds 1
wSlotMachineWheel2Offset:: ; cd3f
wNameOfPlayerMonToBeTraded:: ; cd3f wNameOfPlayerMonToBeTraded:: ; cd3f
wFlyAnimBirdSpriteImageIndex:: ; cd3f wFlyAnimBirdSpriteImageIndex:: ; cd3f
@ -640,6 +660,8 @@ wTrainerFacingDirection:: ; cd3f
wcd3f:: ; used with daycare text for money amount wcd3f:: ; used with daycare text for money amount
ds 1 ds 1
wSlotMachineWheel3Offset:: ; cd40
wPlayerSpinInPlaceAnimSoundID:: ; cd40 wPlayerSpinInPlaceAnimSoundID:: ; cd40
wHiddenObjectY:: ; cd40 wHiddenObjectY:: ; cd40
@ -651,30 +673,89 @@ wTradedPlayerMonOT:: ; cd41
wHiddenObjectX:: ; cd41 wHiddenObjectX:: ; cd41
wSlotMachineWinningSymbol:: ; cd42
; the OAM tile number of the upper left corner of the winning symbol minus 2
wSlotMachineWheel1BottomTile:: ; cd41
wTrainerScreenX:: ; cd41 wTrainerScreenX:: ; cd41
ds 1 ds 1
; a lot of the uses for these values use more than the said address ; a lot of the uses for these values use more than the said address
wSlotMachineWheel1MiddleTile:: ; cd42
wcd42:: ds 1 ; used in pewter center script, printing field mon moves, slot machines and HoF PC wcd42:: ds 1 ; used in pewter center script, printing field mon moves, slot machines and HoF PC
wSlotMachineWheel1TopTile:: ; cd43
wcd43:: ds 1 ; slot machine stuff and GetMonFieldMoves wcd43:: ds 1 ; slot machine stuff and GetMonFieldMoves
wcd44:: ds 1 ; just slot machine
wcd45:: ds 1 ; slot machine... wSlotMachineWheel2BottomTile:: ; cd44
wcd46:: ds 1 ; slot machine... ds 1
wSlotMachineWheel2MiddleTile:: ; cd45
ds 1
wTempCoins1:: ; cd46
; 2 bytes
; temporary variable used to add payout amount to the player's coins
wSlotMachineWheel2TopTile:: ; cd46
ds 1
wSlotMachineWheel3BottomTile:: ; cd47
wcd47:: ds 1 ; used in slot machine and spinning player sprite wcd47:: ds 1 ; used in slot machine and spinning player sprite
wSlotMachineWheel3MiddleTile:: ; cd48
wcd48:: ds 1 ; same as above wcd48:: ds 1 ; same as above
wSlotMachineWheel3TopTile:: ; cd49
wcd49:: ds 1 ; used in slot machine, displaying the gym leaders/badges on the trainer card, and displaying the town map wcd49:: ds 1 ; used in slot machine, displaying the gym leaders/badges on the trainer card, and displaying the town map
wcd4a:: ds 1 ; probably used in one of the above mentioned functions
wcd4b:: ds 1 ; same as above wTempCoins2:: ; cd4a
; 2 bytes
; temporary variable used to subtract the bet amount from the player's coins
wPayoutCoins:: ; cd4a
; 2 bytes
ds 1
wcd4b:: ; cd4b
; used in player animations
ds 1
wTradedPlayerMonOTID:: ; cd4c wTradedPlayerMonOTID:: ; cd4c
wcd4c:: ds 1 ; slot machine and probably other above stuff wSlotMachineFlags:: ; cd4c
; These flags are set randomly and control when the wheels stop.
; bit 6: allow the player to win in general
; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
ds 1
wSlotMachineWheel1SlipCounter:: ; cd4d
; wheel 1 can "slip" while this is non-zero
wcd4d:: ds 1 ; used with cut and slot machine wcd4d:: ds 1 ; used with cut and slot machine
wSlotMachineWheel2SlipCounter:: ; cd4e
; wheel 2 can "slip" while this is non-zero
wTradedEnemyMonOT:: ; cd4e wTradedEnemyMonOT:: ; cd4e
wcd4e:: ds 1 ; used with in-game trades and slot machine wcd4e:: ds 1 ; used with in-game trades and slot machine
wSlotMachineRerollCounter:: ; cd4f
; The remaining number of times wheel 3 will roll down a symbol until a match is
; found, when winning is enabled. It's initialized to 4 each bet.
wcd4f:: ds 1 ; used with in-game trades, emotion bubbles, and player animations wcd4f:: ds 1 ; used with in-game trades, emotion bubbles, and player animations
wSlotMachineBet:: ; cd50
; how many coins the player bet on the slot machine (1 to 3)
wcd50:: ds 9 ; used with in-game trades, emotion bubbles, and player and miscellaneous sprite animations wcd50:: ds 9 ; used with in-game trades, emotion bubbles, and player and miscellaneous sprite animations
wTradedEnemyMonOTID:: ; cd59 wTradedEnemyMonOTID:: ; cd59
@ -1194,9 +1275,8 @@ wTradedMonMovingRight:: ; d08a
wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen? wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen?
wTownMapSpriteBlinkingCounter:: ; d08b wAnimCounter:: ; d08b
; generic counter variable for various animations
wPartyMonAnimCounter:: ; d08b
W_SUBANIMTRANSFORM:: ; d08b W_SUBANIMTRANSFORM:: ; d08b
; controls what transformations are applied to the subanimation ; controls what transformations are applied to the subanimation
@ -1222,6 +1302,13 @@ wEndBattleTextRomBank:: ; d092
W_SUBANIMADDRPTR:: ; d094 W_SUBANIMADDRPTR:: ; d094
; the address _of the address_ of the current subanimation entry ; the address _of the address_ of the current subanimation entry
ds 2 ds 2
wSlotMachineAllowMatchesCounter:: ; d096
; If non-zero, the allow matches flag is always set.
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it.
W_SUBANIMSUBENTRYADDR:: ; d096 W_SUBANIMSUBENTRYADDR:: ; d096
; the address of the current subentry of the current subanimation ; the address of the current subentry of the current subanimation
ds 2 ds 2