diff options
author | mid-kid <esteve.varela@gmail.com> | 2018-06-24 16:09:41 +0200 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2018-06-24 16:13:22 +0200 |
commit | 1d9a68dbdd0132035f1fc7b7ea8f7fdc24741507 (patch) | |
tree | 3af0a92f5f7dc10f32eed04d9daae52749fc33c2 /engine/games | |
parent | 131875d3e37044ec995287af7c93decd86a0d659 (diff) |
Remove all address comments
Diffstat (limited to 'engine/games')
-rw-r--r-- | engine/games/card_flip.asm | 281 | ||||
-rw-r--r-- | engine/games/dummy_game.asm | 32 | ||||
-rw-r--r-- | engine/games/slot_machine.asm | 337 | ||||
-rw-r--r-- | engine/games/unown_puzzle.asm | 111 |
4 files changed, 299 insertions, 462 deletions
diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index 8f5131983..6fb3502af 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -4,13 +4,13 @@ CARDFLIP_LIGHT_ON EQU $f5 CARDFLIP_DECK_SIZE EQU 4 * 6 ; two labels below called from inside ./dummy_game.asm -Unknown_e00ed: ; e00ed (38:40ed) +Unknown_e00ed: ; Graphics for an unused Game Corner ; game were meant to be here. -ret_e00ed: ; e00ed (38:40ed) +ret_e00ed: ret -_CardFlip: ; e00ee (38:40ee) +_CardFlip: ld hl, wOptions set NO_TEXT_SCROLL, [hl] call ClearBGPalettes @@ -74,7 +74,7 @@ _CardFlip: ; e00ee (38:40ee) res 4, [hl] ret -.CardFlip: ; e0191 (38:4191) +.CardFlip: ld a, [wJumptableIndex] ld e, a ld d, 0 @@ -85,9 +85,8 @@ _CardFlip: ; e00ee (38:40ee) ld h, [hl] ld l, a jp hl -; e01a0 (38:41a0) -.Jumptable: ; e01a0 +.Jumptable: dw .AskPlayWithThree dw .DeductCoins dw .ChooseACard @@ -96,15 +95,13 @@ _CardFlip: ; e00ee (38:40ee) dw .TabulateTheResult dw .PlayAgain dw .Quit -; e01b0 -.Increment: ; e01b0 +.Increment: ld hl, wJumptableIndex inc [hl] ret -; e01b5 -.AskPlayWithThree: ; e01b5 +.AskPlayWithThree: ld hl, .PlayWithThreeCoinsText call CardFlip_UpdateCoinBalanceDisplay call YesNoBox @@ -117,7 +114,6 @@ _CardFlip: ; e00ee (38:40ee) ld a, 7 ld [wJumptableIndex], a ret -; e01cd .PlayWithThreeCoinsText: ; 0xe01cd ; Play with three coins? @@ -125,7 +121,7 @@ _CardFlip: ; e00ee (38:40ee) db "@" ; 0xe01d2 -.DeductCoins: ; e01d2 +.DeductCoins: ld a, [wCoins] ld h, a ld a, [wCoins + 1] @@ -159,7 +155,6 @@ _CardFlip: ; e00ee (38:40ee) call WaitSFX call .Increment ret -; e0212 .NotEnoughCoinsText: ; 0xe0212 ; Not enough coins… @@ -167,7 +162,7 @@ _CardFlip: ; e00ee (38:40ee) db "@" ; 0xe0217 -.ChooseACard: ; e0217 +.ChooseACard: xor a ld [hBGMapMode], a hlcoord 0, 0 @@ -238,7 +233,6 @@ _CardFlip: ; e00ee (38:40ee) ld [wCardFlipWhichCard], a call .Increment ret -; e02b2 .ChooseACardText: ; 0xe02b2 ; Choose a card. @@ -246,7 +240,7 @@ _CardFlip: ; e00ee (38:40ee) db "@" ; 0xe02b7 -.PlaceYourBet: ; e02b7 +.PlaceYourBet: ld hl, .PlaceYourBetText call CardFlip_UpdateCoinBalanceDisplay .betloop @@ -262,7 +256,6 @@ _CardFlip: ; e00ee (38:40ee) .betdone call .Increment ret -; e02d5 .PlaceYourBetText: ; 0xe02d5 ; Place your bet. @@ -270,7 +263,7 @@ _CardFlip: ; e00ee (38:40ee) db "@" ; 0xe02da -.CheckTheCard: ; e02da +.CheckTheCard: xor a ld [hVBlankCounter], a call CardFlip_UpdateCursorOAM @@ -298,16 +291,14 @@ _CardFlip: ; e00ee (38:40ee) call WaitBGMap2 call .Increment ret -; e0314 -.TabulateTheResult: ; e0314 +.TabulateTheResult: call CardFlip_CheckWinCondition call WaitPressAorB_BlinkCursor call .Increment ret -; e031e -.PlayAgain: ; e031e +.PlayAgain: call ClearSprites ld hl, .PlayAgainText call CardFlip_UpdateCoinBalanceDisplay @@ -337,7 +328,6 @@ _CardFlip: ; e00ee (38:40ee) ld a, 1 ld [wJumptableIndex], a ret -; e0356 .PlayAgainText: ; 0xe0356 ; Want to play again? @@ -351,13 +341,12 @@ _CardFlip: ; e00ee (38:40ee) db "@" ; 0xe0360 -.Quit: ; e0360 +.Quit: ld hl, wJumptableIndex set 7, [hl] ret -; e0366 -CardFlip_ShuffleDeck: ; e0366 +CardFlip_ShuffleDeck: ld hl, wDeck ld bc, CARDFLIP_DECK_SIZE xor a @@ -384,9 +373,8 @@ CardFlip_ShuffleDeck: ; e0366 ld bc, CARDFLIP_DECK_SIZE call ByteFill ret -; e0398 -CollapseCursorPosition: ; e0398 +CollapseCursorPosition: ld hl, 0 ld bc, 6 ld a, [wCardFlipCursorY] @@ -396,9 +384,8 @@ CollapseCursorPosition: ; e0398 ld c, a add hl, bc ret -; e03ac -GetCoordsOfChosenCard: ; e03ac +GetCoordsOfChosenCard: ld a, [wCardFlipWhichCard] and a jr nz, .BottomCard @@ -412,27 +399,24 @@ GetCoordsOfChosenCard: ; e03ac .done ret -; e03c1 -PlaceCardFaceDown: ; e03c1 +PlaceCardFaceDown: xor a ld [hBGMapMode], a ld de, .FaceDownCardTilemap lb bc, 6, 5 call CardFlip_CopyToBox ret -; e03ce -.FaceDownCardTilemap: ; e03ce +.FaceDownCardTilemap: db $08, $09, $09, $09, $0a db $0b, $28, $2b, $28, $0c db $0b, $2c, $2d, $2e, $0c db $0b, $2f, $30, $31, $0c db $0b, $32, $33, $34, $0c db $0d, $0e, $0e, $0e, $0f -; e03ec -CardFlip_DisplayCardFaceUp: ; e03ec +CardFlip_DisplayCardFaceUp: xor a ld [hBGMapMode], a push hl @@ -493,18 +477,16 @@ CardFlip_DisplayCardFaceUp: ; e03ec lb bc, 6, 5 call CardFlip_FillBox ret -; e043b -.FaceUpCardTilemap: ; e043b +.FaceUpCardTilemap: db $18, $19, $19, $19, $1a db $1b, $35, $7f, $7f, $1c db $0b, $28, $28, $28, $0c db $0b, $28, $28, $28, $0c db $0b, $28, $28, $28, $0c db $1d, $1e, $1e, $1e, $1f -; e0459 -.Deck: ; e0459 +.Deck: ; level, pic anchor (3x3) db "1", $4e, "1", $57, "1", $69, "1", $60 db "2", $4e, "2", $57, "2", $69, "2", $60 @@ -512,9 +494,8 @@ CardFlip_DisplayCardFaceUp: ; e03ec db "4", $4e, "4", $57, "4", $69, "4", $60 db "5", $4e, "5", $57, "5", $69, "5", $60 db "6", $4e, "6", $57, "6", $69, "6", $60 -; e0489 -CardFlip_UpdateCoinBalanceDisplay: ; e0489 +CardFlip_UpdateCoinBalanceDisplay: push hl hlcoord 0, 12 ld b, 4 @@ -524,9 +505,8 @@ CardFlip_UpdateCoinBalanceDisplay: ; e0489 call PrintTextBoxText call CardFlip_PrintCoinBalance ret -; e049c -CardFlip_PrintCoinBalance: ; e049c +CardFlip_PrintCoinBalance: hlcoord 9, 15 ld b, 1 ld c, 9 @@ -539,13 +519,11 @@ CardFlip_PrintCoinBalance: ; e049c lb bc, PRINTNUM_LEADINGZEROS | 2, 4 call PrintNum ret -; e04bc .CoinStr: db "COIN@" -; e04c1 -CardFlip_InitTilemap: ; e04c1 (38:44c1) +CardFlip_InitTilemap: xor a ld [hBGMapMode], a hlcoord 0, 0 @@ -560,12 +538,11 @@ CardFlip_InitTilemap: ; e04c1 (38:44c1) lb bc, 4, 18 call TextBox ret -; e04e5 (38:44e5) -CardFlip_FillGreenBox: ; e04e5 +CardFlip_FillGreenBox: ld a, $29 -CardFlip_FillBox: ; e04e7 (38:44e7) +CardFlip_FillBox: .row push bc push hl @@ -581,7 +558,7 @@ CardFlip_FillBox: ; e04e7 (38:44e7) jr nz, .row ret -CardFlip_CopyToBox: ; e04f7 (38:44f7) +CardFlip_CopyToBox: .row push bc push hl @@ -598,9 +575,8 @@ CardFlip_CopyToBox: ; e04f7 (38:44f7) dec b jr nz, .row ret -; e0509 (38:4509) -CardFlip_CopyOAM: ; e0509 +CardFlip_CopyOAM: ld de, wVirtualOAMSprite00 ld a, [hli] .loop @@ -623,9 +599,8 @@ CardFlip_CopyOAM: ; e0509 dec a jr nz, .loop ret -; e0521 -CardFlip_ShiftDigitsLeftTwoPixels: ; e0521 (38:4521) +CardFlip_ShiftDigitsLeftTwoPixels: ld de, vTiles0 tile "0" ld hl, vTiles0 tile "0" + 2 ld bc, 10 tiles - 2 @@ -635,9 +610,8 @@ CardFlip_ShiftDigitsLeftTwoPixels: ; e0521 (38:4521) ld [hli], a ld [hl], a ret -; e0534 (38:4534) -CardFlip_BlankDiscardedCardSlot: ; e0534 +CardFlip_BlankDiscardedCardSlot: xor a ld [hBGMapMode], a ld a, [wCardFlipFaceUpCard] @@ -660,18 +634,16 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 ld h, [hl] ld l, a jp hl -; e0553 -.Jumptable: ; e0553 +.Jumptable: dw .Level1 dw .Level2 dw .Level3 dw .Level4 dw .Level5 dw .Level6 -; e055f -.Level1: ; e055f +.Level1: ld hl, wDiscardPile + 4 add hl, de ld a, [hl] @@ -695,9 +667,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3d ret -; e0583 -.Level2: ; e0583 +.Level2: ld hl, wDiscardPile - 4 add hl, de ld a, [hl] @@ -721,9 +692,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3a ret -; e05a7 -.Level3: ; e05a7 +.Level3: ld hl, wDiscardPile + 4 add hl, de ld a, [hl] @@ -747,9 +717,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3d ret -; e05cb -.Level4: ; e05cb +.Level4: ld hl, wDiscardPile - 4 add hl, de ld a, [hl] @@ -773,9 +742,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3a ret -; e05ef -.Level5: ; e05ef +.Level5: ld hl, wDiscardPile + 4 add hl, de ld a, [hl] @@ -799,9 +767,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3d ret -; e0613 -.Level6: ; e0613 +.Level6: ld hl, wDiscardPile - 4 add hl, de ld a, [hl] @@ -825,9 +792,8 @@ CardFlip_BlankDiscardedCardSlot: ; e0534 add hl, bc ld [hl], $3a ret -; e0637 -CardFlip_CheckWinCondition: ; e0637 +CardFlip_CheckWinCondition: call CollapseCursorPosition add hl, hl ld de, .Jumptable @@ -836,9 +802,8 @@ CardFlip_CheckWinCondition: ; e0637 ld h, [hl] ld l, a jp hl -; e0643 -.Jumptable: ; e0643 +.Jumptable: dw .Impossible dw .Impossible dw .PikaJiggly @@ -894,233 +859,227 @@ CardFlip_CheckWinCondition: ; e0637 dw .JigglySix dw .PoliSix dw .OddSix -; e06a3 -.Impossible: ; e06a3 +.Impossible: jp .Lose -; e06a6 -.PikaJiggly: ; e06a6 +.PikaJiggly: ld a, [wCardFlipFaceUpCard] and $2 jp nz, .Lose jr .WinSix -.PoliOddish: ; e06b0 +.PoliOddish: ld a, [wCardFlipFaceUpCard] and $2 jr nz, .WinSix jp .Lose -.WinSix: ; e06ba +.WinSix: ld c, $6 ld de, SFX_2ND_PLACE jp .Payout -; e06c2 -.OneTwo: ; e06c2 +.OneTwo: ld a, [wCardFlipFaceUpCard] and $18 jr z, .WinNine jp .Lose -.ThreeFour: ; e06cc +.ThreeFour: ld a, [wCardFlipFaceUpCard] and $18 cp $8 jr z, .WinNine jp .Lose -.FiveSix: ; e06d8 +.FiveSix: ld a, [wCardFlipFaceUpCard] and $18 cp $10 jr z, .WinNine jp .Lose -.WinNine: ; e06e4 +.WinNine: ld c, $9 ld de, SFX_2ND_PLACE jp .Payout -; e06ec -.Pikachu: ; e06ec +.Pikachu: ld a, [wCardFlipFaceUpCard] and $3 jr z, .WinTwelve jp .Lose -.Jigglypuff: ; e06f6 +.Jigglypuff: ld a, [wCardFlipFaceUpCard] and $3 cp $1 jr z, .WinTwelve jp .Lose -.Poliwag: ; e0702 +.Poliwag: ld a, [wCardFlipFaceUpCard] and $3 cp $2 jr z, .WinTwelve jp .Lose -.Oddish: ; e070e +.Oddish: ld a, [wCardFlipFaceUpCard] and $3 cp $3 jr z, .WinTwelve jp .Lose -.WinTwelve: ; e071a +.WinTwelve: ld c, $c ld de, SFX_2ND_PLACE jp .Payout -; e0722 -.One: ; e0722 +.One: ld a, [wCardFlipFaceUpCard] and $1c jr z, .WinEighteen jp .Lose -.Two: ; e072c +.Two: ld a, [wCardFlipFaceUpCard] and $1c cp $4 jr z, .WinEighteen jp .Lose -.Three: ; e0738 +.Three: ld a, [wCardFlipFaceUpCard] and $1c cp $8 jr z, .WinEighteen jp .Lose -.Four: ; e0744 +.Four: ld a, [wCardFlipFaceUpCard] and $1c cp $c jr z, .WinEighteen jp .Lose -.Five: ; e0750 +.Five: ld a, [wCardFlipFaceUpCard] and $1c cp $10 jr z, .WinEighteen jp .Lose -.Six: ; e075c +.Six: ld a, [wCardFlipFaceUpCard] and $1c cp $14 jr z, .WinEighteen jp .Lose -.WinEighteen: ; e0768 +.WinEighteen: ld c, $12 ld de, SFX_2ND_PLACE jp .Payout -; e0770 -.PikaOne: ; e0770 +.PikaOne: ld e, $0 jr .CheckWin72 -.JigglyOne: ; e0774 +.JigglyOne: ld e, $1 jr .CheckWin72 -.PoliOne: ; e0778 +.PoliOne: ld e, $2 jr .CheckWin72 -.OddOne: ; e077c +.OddOne: ld e, $3 jr .CheckWin72 -.PikaTwo: ; e0780 +.PikaTwo: ld e, $4 jr .CheckWin72 -.JigglyTwo: ; e0784 +.JigglyTwo: ld e, $5 jr .CheckWin72 -.PoliTwo: ; e0788 +.PoliTwo: ld e, $6 jr .CheckWin72 -.OddTwo: ; e078c +.OddTwo: ld e, $7 jr .CheckWin72 -.PikaThree: ; e0790 +.PikaThree: ld e, $8 jr .CheckWin72 -.JigglyThree: ; e0794 +.JigglyThree: ld e, $9 jr .CheckWin72 -.PoliThree: ; e0798 +.PoliThree: ld e, $a jr .CheckWin72 -.OddThree: ; e079c +.OddThree: ld e, $b jr .CheckWin72 -.PikaFour: ; e07a0 +.PikaFour: ld e, $c jr .CheckWin72 -.JigglyFour: ; e07a4 +.JigglyFour: ld e, $d jr .CheckWin72 -.PoliFour: ; e07a8 +.PoliFour: ld e, $e jr .CheckWin72 -.OddFour: ; e07ac +.OddFour: ld e, $f jr .CheckWin72 -.PikaFive: ; e07b0 +.PikaFive: ld e, $10 jr .CheckWin72 -.JigglyFive: ; e07b4 +.JigglyFive: ld e, $11 jr .CheckWin72 -.PoliFive: ; e07b8 +.PoliFive: ld e, $12 jr .CheckWin72 -.OddFive: ; e07bc +.OddFive: ld e, $13 jr .CheckWin72 -.PikaSix: ; e07c0 +.PikaSix: ld e, $14 jr .CheckWin72 -.JigglySix: ; e07c4 +.JigglySix: ld e, $15 jr .CheckWin72 -.PoliSix: ; e07c8 +.PoliSix: ld e, $16 jr .CheckWin72 -.OddSix: ; e07cc +.OddSix: ld e, $17 -.CheckWin72: ; e07ce +.CheckWin72: ld a, [wCardFlipFaceUpCard] cp e jr nz, .Lose @@ -1128,7 +1087,7 @@ CardFlip_CheckWinCondition: ; e0637 ld de, SFX_2ND_PLACE jr .Payout -.Lose: ; e07db +.Lose: ld de, SFX_WRONG call PlaySFX ld hl, .Text_Darn @@ -1136,7 +1095,7 @@ CardFlip_CheckWinCondition: ; e0637 call WaitSFX ret -.Payout: ; e07eb +.Payout: push bc push de ld hl, .Text_Yeah @@ -1159,7 +1118,6 @@ CardFlip_CheckWinCondition: ; e0637 dec c jr nz, .loop ret -; e0811 .Text_Yeah: ; 0xe0811 ; Yeah! @@ -1173,7 +1131,7 @@ CardFlip_CheckWinCondition: ; e0637 db "@" ; 0xe081b -.AddCoinPlaySFX: ; e081b +.AddCoinPlaySFX: ld a, [wCoins] ld h, a ld a, [wCoins + 1] @@ -1186,9 +1144,8 @@ CardFlip_CheckWinCondition: ; e0637 ld de, SFX_PAY_DAY call PlaySFX ret -; e0833 -.IsCoinCaseFull: ; e0833 +.IsCoinCaseFull: ld a, [wCoins] cp HIGH(MAX_COINS) jr c, .less @@ -1207,16 +1164,14 @@ CardFlip_CheckWinCondition: ; e0637 .less and a ret -; e0849 -PlaceOAMCardBorder: ; e0849 +PlaceOAMCardBorder: call GetCoordsOfChosenCard ld hl, .SpriteData call CardFlip_CopyOAM ret -; e0853 -.SpriteData: ; e0853 +.SpriteData: db 18 dsprite 0, 0, 0, 0, $04, 0 dsprite 0, 0, 1, 0, $06, 0 @@ -1241,9 +1196,8 @@ PlaceOAMCardBorder: ; e0849 dsprite 5, 0, 2, 0, $06, 0 | Y_FLIP dsprite 5, 0, 3, 0, $06, 0 | Y_FLIP dsprite 5, 0, 4, 0, $04, 0 | X_FLIP | Y_FLIP -; e089c -ChooseCard_HandleJoypad: ; e089c +ChooseCard_HandleJoypad: ld hl, hJoyLast ld a, [hl] and D_LEFT @@ -1258,9 +1212,8 @@ ChooseCard_HandleJoypad: ; e089c and D_DOWN jp nz, .d_down ret -; e08b8 -.d_left ; e08b8 +.d_left ld hl, wCardFlipCursorX ld a, [wCardFlipCursorY] and a @@ -1296,9 +1249,8 @@ ChooseCard_HandleJoypad: ; e089c ld a, $1 ld [wCardFlipCursorX], a jp .play_sound -; e08ef -.d_right ; e08ef +.d_right ld hl, wCardFlipCursorX ld a, [wCardFlipCursorY] and a @@ -1319,7 +1271,7 @@ ChooseCard_HandleJoypad: ; e089c inc [hl] jr .play_sound -.d_up ; e090a +.d_up ld hl, wCardFlipCursorY ld a, [wCardFlipCursorX] and a @@ -1356,7 +1308,7 @@ ChooseCard_HandleJoypad: ; e089c ld [wCardFlipCursorX], a jr .play_sound -.d_down ; e093d +.d_down ld hl, wCardFlipCursorY ld a, [wCardFlipCursorX] and a @@ -1377,13 +1329,12 @@ ChooseCard_HandleJoypad: ; e089c inc [hl] inc [hl] -.play_sound ; e0959 +.play_sound ld de, SFX_POKEBALLS_PLACED_ON_TABLE call PlaySFX ret -; e0960 -CardFlip_UpdateCursorOAM: ; e0960 +CardFlip_UpdateCursorOAM: call ClearSprites ld a, [hCGB] and a @@ -1407,9 +1358,8 @@ CardFlip_UpdateCursorOAM: ; e0960 ld l, a call CardFlip_CopyOAM ret -; e0981 -.OAMData: ; e0981 +.OAMData: cardflip_cursor: MACRO if _NARG >= 5 dbpixel \1, \2, \3, \4 @@ -1475,9 +1425,8 @@ ENDM cardflip_cursor 15, 12, 0, 4, .SingleTile cardflip_cursor 17, 12, 0, 4, .SingleTile cardflip_cursor 19, 12, 0, 4, .SingleTile -; e0a41 -.SingleTile: ; e0a41 +.SingleTile: db 6 dsprite 0, 0, -1, 7, $00, 0 | PRIORITY dsprite 0, 0, 0, 0, $02, 0 | PRIORITY @@ -1486,7 +1435,7 @@ ENDM dsprite 0, 5, 0, 0, $02, 0 | Y_FLIP | PRIORITY dsprite 0, 5, 1, 0, $03, 0 | PRIORITY -.PokeGroup: ; e0a5a +.PokeGroup: db 26 dsprite 0, 0, -1, 7, $00, 0 | PRIORITY dsprite 0, 0, 0, 0, $02, 0 | PRIORITY @@ -1515,7 +1464,7 @@ ENDM dsprite 10, 1, 0, 0, $02, 0 | Y_FLIP | PRIORITY dsprite 10, 1, 1, 0, $03, 0 | PRIORITY -.NumGroup: ; e0ac3 +.NumGroup: db 20 dsprite 0, 0, -1, 7, $00, 0 | PRIORITY dsprite 0, 0, 0, 0, $02, 0 | PRIORITY @@ -1538,7 +1487,7 @@ ENDM dsprite 0, 5, 7, 0, $02, 0 | Y_FLIP | PRIORITY dsprite 0, 5, 8, 0, $03, 0 | PRIORITY -.NumGroupPair: ; e0b14 +.NumGroupPair: db 30 dsprite 0, 0, 0, 0, $00, 0 | PRIORITY dsprite 0, 0, 1, 0, $02, 0 | PRIORITY @@ -1571,7 +1520,7 @@ ENDM dsprite 2, 1, 8, 0, $03, 0 | PRIORITY dsprite 2, 1, 9, 0, $03, 0 | PRIORITY -.PokeGroupPair: ; e0b8d +.PokeGroupPair: db 38 dsprite 0, 0, -1, 7, $00, 0 | PRIORITY dsprite 0, 0, 3, 0, $00, 0 | X_FLIP | PRIORITY @@ -1612,15 +1561,14 @@ ENDM dsprite 11, 1, 2, 0, $02, 0 | Y_FLIP | PRIORITY dsprite 11, 1, 3, 0, $03, 0 | X_FLIP | Y_FLIP | PRIORITY -.Impossible: ; e0c26 +.Impossible: db 4 dsprite 0, 0, 0, 0, $00, 0 | PRIORITY dsprite 0, 0, 1, 0, $00, 0 | X_FLIP | PRIORITY dsprite 1, 0, 0, 0, $00, 0 | Y_FLIP | PRIORITY dsprite 1, 0, 1, 0, $00, 0 | X_FLIP | Y_FLIP | PRIORITY -; e0c37 -CardFlip_InitAttrPals: ; e0c37 (38:4c37) +CardFlip_InitAttrPals: ld a, [hCGB] and a ret z @@ -1666,27 +1614,24 @@ CardFlip_InitAttrPals: ; e0c37 (38:4c37) pop af ld [rSVBK], a ret -; e0c93 (38:4c93) -.palettes ; e0c93 +.palettes INCLUDE "gfx/card_flip/card_flip.pal" -; e0cdb -CardFlipLZ03: ; e0cdb +CardFlipLZ03: INCBIN "gfx/card_flip/card_flip_3.2bpp.lz" -CardFlipOffButtonGFX: ; e0cf6 +CardFlipOffButtonGFX: INCBIN "gfx/card_flip/off.2bpp" -CardFlipOnButtonGFX: ; e0d06 +CardFlipOnButtonGFX: INCBIN "gfx/card_flip/on.2bpp" -CardFlipLZ01: ; e0d16 +CardFlipLZ01: INCBIN "gfx/card_flip/card_flip_1.2bpp.lz" -CardFlipLZ02: ; e0ea8 +CardFlipLZ02: INCBIN "gfx/card_flip/card_flip_2.2bpp.lz" -CardFlipTilemap: ; e110c +CardFlipTilemap: INCBIN "gfx/card_flip/card_flip.tilemap" -; e1190 diff --git a/engine/games/dummy_game.asm b/engine/games/dummy_game.asm index 6d7e12196..02407eb98 100644 --- a/engine/games/dummy_game.asm +++ b/engine/games/dummy_game.asm @@ -1,4 +1,4 @@ -_DummyGame: ; e1e5b (38:5e5b) +_DummyGame: call .LoadGFXAndPals call DelayFrame .loop @@ -243,9 +243,8 @@ endr ld [wJumptableIndex], a ret -; e2010 -DummyGame_CheckMatch: ; e2010 +DummyGame_CheckMatch: ld hl, wDummyGameCard1 ld a, [hli] cp [hl] @@ -322,7 +321,6 @@ DummyGame_CheckMatch: ; e2010 inc bc ret -; e2093 DummyGameText_Yeah: ; 0xe2093 ; , yeah! @@ -336,7 +334,7 @@ DummyGameText_Darn: ; 0xe2098 db "@" ; 0xe209d -DummyGame_InitBoard: ; e209d +DummyGame_InitBoard: ld hl, wDummyGameCards ld bc, wDummyGameCardsEnd - wDummyGameCards xor a @@ -385,9 +383,8 @@ DummyGame_InitBoard: ; e209d jr nz, .loop ret -; e20e5 -DummyGame_SampleTilePlacement: ; e20e5 +DummyGame_SampleTilePlacement: push hl ld de, wDummyGameCards .loop @@ -408,9 +405,8 @@ DummyGame_SampleTilePlacement: ; e20e5 inc hl ret -; e2101 -DummyGame_GetDistributionOfTiles: ; e2101 +DummyGame_GetDistributionOfTiles: ld a, [wMenuCursorY] dec a ld l, a @@ -426,9 +422,8 @@ DummyGame_GetDistributionOfTiles: ; e2101 db $02, $03, $06, $06, $06, $08, $08, $06 db $02, $02, $04, $06, $06, $08, $08, $09 db $02, $02, $02, $04, $07, $08, $08, $0c -; e2128 -DummyGame_PlaceCard: ; e2128 +DummyGame_PlaceCard: ld a, [wDummyGameLastCardPicked] sla a sla a @@ -446,9 +441,8 @@ DummyGame_PlaceCard: ; e2128 call DelayFrames ret -; e2142 -DummyGame_DeleteCard: ; e2142 +DummyGame_DeleteCard: ld a, $1 ld [hli], a ld [hld], a @@ -460,9 +454,8 @@ DummyGame_DeleteCard: ; e2142 call DelayFrames ret -; e2152 -DummyGame_InitStrings: ; e2152 +DummyGame_InitStrings: hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, $1 @@ -483,9 +476,8 @@ DummyGame_InitStrings: ; e2152 db "とったもの@" .japstr2 db "あと かい@" -; e2183 -DummyGame_Card2Coord: ; e2183 +DummyGame_Card2Coord: ld d, 0 .find_row sub 9 @@ -511,9 +503,8 @@ DummyGame_Card2Coord: ; e2183 add hl, de ret -; e21a1 -DummyGame_InterpretJoypad_AnimateCursor: ; e21a1 (38:61a1) +DummyGame_InterpretJoypad_AnimateCursor: ld a, [wJumptableIndex] cp $7 jr nc, .quit @@ -606,7 +597,6 @@ DummyGame_InterpretJoypad_AnimateCursor: ; e21a1 (38:61a1) ld [hl], a ret -; e2221 (38:6221) -LZ_e2221: ; e2221 +LZ_e2221: INCBIN "gfx/dummy_game/dummy_game.2bpp.lz" diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm index 924c78924..edde84d51 100644 --- a/engine/games/slot_machine.asm +++ b/engine/games/slot_machine.asm @@ -94,7 +94,7 @@ _SlotMachine: res rLCDC_SPRITE_SIZE, [hl] ; 8x8 ret -.InitGFX: ; 926f7 (24:66f7) +.InitGFX: call ClearBGPalettes call ClearTileMap call ClearSprites @@ -163,7 +163,7 @@ _SlotMachine: ld [wKeepSevenBiasChance], a ; 12.5% chance ret -Slots_GetPals: ; 9279b (24:679b) +Slots_GetPals: ld a, %11100100 call DmgToCgbBGPals lb de, %11100100, %11100100 @@ -175,7 +175,7 @@ Slots_GetPals: ; 9279b (24:679b) call DmgToCgbObjPals ret -SlotsLoop: ; 927af (24:67af) +SlotsLoop: ld a, [wJumptableIndex] bit SLOTS_END_LOOP_F, a jr nz, .stop @@ -194,7 +194,7 @@ SlotsLoop: ; 927af (24:67af) scf ret -.Stubbed_Function927d3: ; 927d3 (24:67d3) +.Stubbed_Function927d3: ; dummied out ret ld a, [wReel1ReelAction] @@ -219,9 +219,8 @@ SlotsLoop: ; 927af (24:67af) call DmgToCgbBGPals ret -; 927f8 -.PrintCoinsAndPayout: ; 927f8 (24:67f8) +.PrintCoinsAndPayout: hlcoord 5, 1 ld de, wCoins lb bc, PRINTNUM_LEADINGZEROS | 2, 4 @@ -232,9 +231,8 @@ SlotsLoop: ; 927af (24:67af) call PrintNum ret -; 92811 (24:6811) -Unreferenced_Function92811: ; 92811 +Unreferenced_Function92811: ; debug function? ld a, [wSlotBias] add 0 @@ -252,9 +250,8 @@ Unreferenced_Function92811: ; 92811 ld [hl], a ret -; 9282c -Unreferenced_Function9282c: ; 9282c +Unreferenced_Function9282c: ; animate OAM tiles? ld hl, wcf66 ld a, [hl] @@ -274,9 +271,8 @@ endr jr nz, .loop ret -; 92844 -SlotsJumptable: ; 92844 (24:6844) +SlotsJumptable: jumptable .Jumptable, wJumptableIndex .Jumptable: @@ -300,12 +296,12 @@ SlotsJumptable: ; 92844 (24:6844) dw SlotsAction_RestartOrQuit ; 11 dw SlotsAction_Quit ; 12 -SlotsAction_Next: ; 92879 (24:6879) +SlotsAction_Next: ld hl, wJumptableIndex inc [hl] ret -SlotsAction_Init: ; 9287e (24:687e) +SlotsAction_Init: call SlotsAction_Next xor a ld [wFirstTwoReelsMatching], a @@ -314,7 +310,7 @@ SlotsAction_Init: ; 9287e (24:687e) ld [wSlotMatched], a ret -SlotsAction_BetAndStart: ; 9288e (24:688e) +SlotsAction_BetAndStart: call Slots_AskBet jr nc, .proceed ld a, SLOTS_QUIT @@ -340,7 +336,7 @@ SlotsAction_BetAndStart: ; 9288e (24:688e) call Slots_PlaySFX ret -SlotsAction_WaitStart: ; 928c6 (24:68c6) +SlotsAction_WaitStart: ld hl, wSlotsDelay ld a, [hl] and a @@ -354,7 +350,7 @@ SlotsAction_WaitStart: ; 928c6 (24:68c6) ld [hJoypadSum], a ret -SlotsAction_WaitReel1: ; 928d6 (24:68d6) +SlotsAction_WaitReel1: ld hl, hJoypadSum ld a, [hl] and A_BUTTON @@ -362,7 +358,7 @@ SlotsAction_WaitReel1: ; 928d6 (24:68d6) call SlotsAction_Next call Slots_StopReel1 ld [wReel1ReelAction], a -SlotsAction_WaitStopReel1: ; 928e6 (24:68e6) +SlotsAction_WaitStopReel1: ld a, [wReel1ReelAction] cp REEL_ACTION_DO_NOTHING ret nz @@ -374,7 +370,7 @@ SlotsAction_WaitStopReel1: ; 928e6 (24:68e6) call SlotsAction_Next xor a ld [hJoypadSum], a -SlotsAction_WaitReel2: ; 92900 (24:6900) +SlotsAction_WaitReel2: ld hl, hJoypadSum ld a, [hl] and A_BUTTON @@ -382,7 +378,7 @@ SlotsAction_WaitReel2: ; 92900 (24:6900) call SlotsAction_Next call Slots_StopReel2 ld [wReel2ReelAction], a -SlotsAction_WaitStopReel2: ; 92910 (24:6910) +SlotsAction_WaitStopReel2: ld a, [wReel2ReelAction] cp REEL_ACTION_DO_NOTHING ret nz @@ -394,7 +390,7 @@ SlotsAction_WaitStopReel2: ; 92910 (24:6910) call SlotsAction_Next xor a ld [hJoypadSum], a -SlotsAction_WaitReel3: ; 9292a (24:692a) +SlotsAction_WaitReel3: ld hl, hJoypadSum ld a, [hl] and A_BUTTON @@ -402,7 +398,7 @@ SlotsAction_WaitReel3: ; 9292a (24:692a) call SlotsAction_Next call Slots_StopReel3 ld [wReel3ReelAction], a -SlotsAction_WaitStopReel3: ; 9293a (24:693a) +SlotsAction_WaitStopReel3: ld a, [wReel3ReelAction] cp REEL_ACTION_DO_NOTHING ret nz @@ -416,7 +412,7 @@ SlotsAction_WaitStopReel3: ; 9293a (24:693a) ld [hJoypadSum], a ret -SlotsAction_FlashIfWin: ; 92955 (24:6955) +SlotsAction_FlashIfWin: ld a, [wSlotMatched] cp SLOTS_NO_MATCH jr nz, .GotIt @@ -428,7 +424,7 @@ SlotsAction_FlashIfWin: ; 92955 (24:6955) call SlotsAction_Next ld a, 16 ld [wSlotsDelay], a -SlotsAction_FlashScreen: ; 9296b (24:696b) +SlotsAction_FlashScreen: ld hl, wSlotsDelay ld a, [hl] and a @@ -449,7 +445,7 @@ SlotsAction_FlashScreen: ; 9296b (24:696b) call SlotsAction_Next ret -SlotsAction_GiveEarnedCoins: ; 92987 (24:6987) +SlotsAction_GiveEarnedCoins: xor a ld [wFirstTwoReelsMatching], a ld [wFirstTwoReelsMatchingSevens], a @@ -461,10 +457,10 @@ SlotsAction_GiveEarnedCoins: ; 92987 (24:6987) call SlotsAction_Next ret -SlotsAction_PayoutTextAndAnim: ; 9299e (24:699e) +SlotsAction_PayoutTextAndAnim: call Slots_PayoutText call SlotsAction_Next -SlotsAction_PayoutAnim: ; 929a4 (24:69a4) +SlotsAction_PayoutAnim: ld hl, wSlotsDelay ld a, [hl] inc [hl] @@ -502,7 +498,7 @@ SlotsAction_PayoutAnim: ; 929a4 (24:69a4) call SlotsAction_Next ret -SlotsAction_RestartOrQuit: ; 929d9 (24:69d9) +SlotsAction_RestartOrQuit: call Slots_DeilluminateBetLights call WaitPressAorB_BlinkCursor call Slots_AskPlayAgain @@ -516,12 +512,12 @@ SlotsAction_RestartOrQuit: ; 929d9 (24:69d9) ld [wJumptableIndex], a ret -SlotsAction_Quit: ; 929f0 (24:69f0) +SlotsAction_Quit: ld hl, wJumptableIndex set SLOTS_END_LOOP_F, [hl] ret -Slots_LoadReelState: ; 929f6 (24:69f6) +Slots_LoadReelState: push de call Slots_GetCurrentReelState pop de @@ -535,7 +531,7 @@ Slots_LoadReelState: ; 929f6 (24:69f6) ld [de], a ret -Slots_CheckCoinCaseFull: ; 92a04 (24:6a04) +Slots_CheckCoinCaseFull: ld a, d cp HIGH(MAX_COINS) jr c, .not_full @@ -549,7 +545,7 @@ Slots_CheckCoinCaseFull: ; 92a04 (24:6a04) and a ret -Slots_GetCurrentReelState: ; 92a12 (24:6a12) +Slots_GetCurrentReelState: ld hl, REEL_POSITION add hl, bc ld a, [hl] @@ -569,12 +565,12 @@ Slots_GetCurrentReelState: ; 92a12 (24:6a12) add hl, de ret -Slots_StopReel1: ; 92a2b (24:6a2b) +Slots_StopReel1: ; Always set the REEL_ACTION_STOP_REEL1 action. ld a, REEL_ACTION_STOP_REEL1 ret -Slots_StopReel2: ; 92a2e (24:6a2e) +Slots_StopReel2: ; As long as, the following three meet, there's a 31.25% chance ; to set action REEL_ACTION_SET_UP_REEL2_SKIP_TO_7: ; - Bet is >= 2 coins @@ -603,7 +599,7 @@ Slots_StopReel2: ; 92a2e (24:6a2e) ld a, REEL_ACTION_STOP_REEL2 ret -.CheckReel1ForASeven: ; 92a51 (24:6a51) +.CheckReel1ForASeven: ld a, [wReel1Stopped] and a ret z @@ -614,7 +610,7 @@ Slots_StopReel2: ; 92a2e (24:6a2e) and a ret -Slots_StopReel3: ; 92a60 (24:6a60) +Slots_StopReel3: ; If no matching SEVEN symbols in reels #1 and #2: ; - REEL_ACTION_STOP_REEL3, 100% @@ -667,7 +663,7 @@ Slots_StopReel3: ; 92a60 (24:6a60) ld a, REEL_ACTION_STOP_REEL3 ret -Slots_InitReelTiles: ; 92a98 (24:6a98) +Slots_InitReelTiles: ld bc, wReel1 ld hl, REEL_OAM_ADDR add hl, bc @@ -723,7 +719,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) call .OAM ret -.OAM: ; 92af9 (24:6af9) +.OAM: ld hl, REEL_ACTION add hl, bc ld [hl], REEL_ACTION_DO_NOTHING @@ -736,7 +732,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) call Slots_UpdateReelPositionAndOAM ret -Slots_SpinReels: ; 92b0f (24:6b0f) +Slots_SpinReels: ld bc, wReel1 call .SpinReel ld bc, wReel2 @@ -745,7 +741,7 @@ Slots_SpinReels: ; 92b0f (24:6b0f) call .SpinReel ret -.SpinReel: ; 92b22 (24:6b22) +.SpinReel: ld hl, REEL_SPIN_DISTANCE add hl, bc ld a, [hl] @@ -782,7 +778,7 @@ Slots_SpinReels: ; 92b0f (24:6b0f) jr nz, .loop ret -Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53) +Slots_UpdateReelPositionAndOAM: ld hl, REEL_X_COORD add hl, bc ld a, [hl] @@ -814,7 +810,7 @@ Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53) ld [hl], a ret -.LoadOAM: ; 92b83 (24:6b83) +.LoadOAM: ld hl, REEL_OAM_ADDR add hl, bc ld a, [hli] @@ -853,9 +849,8 @@ Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53) jr nz, .loop ret -; 92bbe (24:6bbe) -Unreferenced_Function92bbe: ; 92bbe +Unreferenced_Function92bbe: push hl srl a srl a @@ -868,13 +863,11 @@ Unreferenced_Function92bbe: ; 92bbe pop hl ret -; 92bce -.Unknown_92bce: ; 92bce +.Unknown_92bce: db 0, 1, 2, 3, 4, 5 -; 92bd4 -ReelActionJumptable: ; 92bd4 (24:6bd4) +ReelActionJumptable: ld hl, REEL_ACTION add hl, bc ld e, [hl] @@ -887,9 +880,8 @@ ReelActionJumptable: ; 92bd4 (24:6bd4) ld l, a jp hl -; 92be4 (24:6be4) -.Jumptable: ; 92be4 +.Jumptable: dw ReelAction_DoNothing ; 00 dw ReelAction_StopReelIgnoreJoypad ; 01 dw ReelAction_QuadrupleRate ; 02 @@ -915,54 +907,47 @@ ReelActionJumptable: ; 92bd4 (24:6bd4) dw ReelAction_WaitChansey ; 16 dw ReelAction_WaitEgg ; 17 dw ReelAction_DropReel ; 18 -; 92c16 -ReelAction_DoNothing: ; 92c16 +ReelAction_DoNothing: ret -; 92c17 -ReelAction_QuadrupleRate: ; 92c17 +ReelAction_QuadrupleRate: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 16 ret -; 92c1e -ReelAction_DoubleRate: ; 92c1e +ReelAction_DoubleRate: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 8 ret -; 92c25 -ReelAction_NormalRate: ; 92c25 +ReelAction_NormalRate: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 4 ret -; 92c2c -ReelAction_HalfRate: ; 92c2c +ReelAction_HalfRate: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 2 ret -; 92c33 -ReelAction_QuarterRate: ; 92c33 +ReelAction_QuarterRate: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 1 ret -; 92c3a -Slots_StopReel: ; 92c3a +Slots_StopReel: ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 0 @@ -972,7 +957,7 @@ Slots_StopReel: ; 92c3a ld hl, REEL_STOP_DELAY add hl, bc ld [hl], 3 -ReelAction_StopReelIgnoreJoypad: ; 92c4c +ReelAction_StopReelIgnoreJoypad: ld hl, REEL_STOP_DELAY add hl, bc ld a, [hl] @@ -988,9 +973,8 @@ ReelAction_StopReelIgnoreJoypad: ; 92c4c ld [hl], a ret -; 92c5e -ReelAction_StopReel1: ; 92c5e +ReelAction_StopReel1: ; If no bias: don't manipulate reel. ; If bias: manipulate reel up to wReel1ManipCounter (i.e. 4) slots, ; stoping early if the biased symbol shows up anywhere in reel #1, @@ -1011,9 +995,8 @@ ReelAction_StopReel1: ; 92c5e call Slots_StopReel ret -; 92c76 -.CheckForBias: ; 92c76 +.CheckForBias: call Slots_GetCurrentReelState ld a, [wSlotBias] ld e, a @@ -1027,9 +1010,8 @@ ReelAction_StopReel1: ; 92c5e cp e ret -; 92c86 -ReelAction_StopReel2: ; 92c86 +ReelAction_StopReel2: ; If no bias: don't manipulate reel. ; If bias: manipulate reel up to wReel2ManipCounter (i.e. 4) slots, ; stoping early if the biased symbol is lined up in the first two @@ -1057,9 +1039,8 @@ ReelAction_StopReel2: ; 92c86 call Slots_StopReel ret -; 92ca9 -ReelAction_StopReel3: ; 92ca9 +ReelAction_StopReel3: ; Manipulate the reel up to wReel3ManipCounter (i.e. 4) slots, ; stopping early if the bias symbol is lined up for a win. ; If not biased to any symbols, stop as soon as nothing is lined up. @@ -1093,9 +1074,8 @@ ReelAction_StopReel3: ; 92ca9 call Slots_StopReel ret -; 92cd2 -ReelAction_SetUpReel2SkipTo7: ; 92cd2 +ReelAction_SetUpReel2SkipTo7: ; Unique reel 2 action (see Slots_StopReel2) ; Ensures that 7 symbols become lined up in the first two reels, ; but more often than not, this is only a way to get our hopes up, as @@ -1123,9 +1103,8 @@ ReelAction_SetUpReel2SkipTo7: ; 92cd2 ld [hl], 0 ret -; 92cf8 -ReelAction_WaitReel2SkipTo7: ; 92cf8 +ReelAction_WaitReel2SkipTo7: ld hl, REEL_MANIP_DELAY add hl, bc ld a, [hl] @@ -1145,9 +1124,8 @@ ReelAction_WaitReel2SkipTo7: ; 92cf8 ld [hl], 8 ret -; 92d13 -ReelAction_FastSpinReel2UntilLinedUp7s: ; 92d13 +ReelAction_FastSpinReel2UntilLinedUp7s: call Slots_CheckMatchedFirstTwoReels ret nc ld a, [wFirstTwoReelsMatchingSevens] @@ -1156,9 +1134,8 @@ ReelAction_FastSpinReel2UntilLinedUp7s: ; 92d13 call Slots_StopReel ret -; 92d20 -ReelAction_InitGolem: ; 92d20 +ReelAction_InitGolem: ; Ensures SEVENs are lined up if there's bias to SEVEN. ; Ensures nothing is lined up if there's no bias symbols. ; No other bias symbols are compatible with this mode. @@ -1191,7 +1168,7 @@ ReelAction_InitGolem: ; 92d20 pop bc xor a ld [wSlotsDelay], a -ReelAction_WaitGolem: ; 92d4f +ReelAction_WaitGolem: ld a, [wSlotsDelay] cp 2 jr z, .two @@ -1213,9 +1190,8 @@ ReelAction_WaitGolem: ; 92d4f ld [hl], 8 ret -; 92d6e -ReelAction_EndGolem: ; 92d6e +ReelAction_EndGolem: xor a ld [wSlotsDelay], a ld hl, REEL_ACTION @@ -1226,9 +1202,8 @@ ReelAction_EndGolem: ; 92d6e ld [hl], 0 ret -; 92d7e -ReelAction_InitChansey: ; 92d7e +ReelAction_InitChansey: ; Ensures the lining up of SEVEN symbols, but this mode is only possible ; when there is bias to SEVEN symbols (and even then, it's still rare). ; Chansey releases and egg and reel #3 is made to advance 17 slots very @@ -1254,9 +1229,8 @@ ReelAction_InitChansey: ; 92d7e ld [wSlotsDelay], a ret -; 92da4 -ReelAction_WaitChansey: ; 92da4 +ReelAction_WaitChansey: ld a, [wSlotsDelay] and a ret z @@ -1265,7 +1239,7 @@ ReelAction_WaitChansey: ; 92da4 inc [hl] ; REEL_ACTION_WAIT_EGG ld a, 2 ld [wSlotsDelay], a -ReelAction_WaitEgg: ; 92db3 +ReelAction_WaitEgg: ld a, [wSlotsDelay] cp $4 ret c @@ -1278,7 +1252,7 @@ ReelAction_WaitEgg: ; 92db3 ld hl, REEL_MANIP_DELAY add hl, bc ld [hl], 17 -ReelAction_DropReel: ; 92dca +ReelAction_DropReel: ld hl, REEL_MANIP_DELAY add hl, bc ld a, [hl] @@ -1309,9 +1283,8 @@ ReelAction_DropReel: ; 92dca ld [wSlotsDelay], a ret -; 92df7 -ReelAction_Unused: ; 92df7 +ReelAction_Unused: call Slots_CheckMatchedAllThreeReels ret c ld a, SFX_STOP_SLOT @@ -1324,7 +1297,7 @@ ReelAction_Unused: ; 92df7 ld hl, REEL_MANIP_DELAY add hl, bc ld [hl], a -ReelAction_CheckDropReel: ; 92e10 +ReelAction_CheckDropReel: ld hl, REEL_MANIP_DELAY add hl, bc ld a, [hl] @@ -1345,7 +1318,7 @@ ReelAction_CheckDropReel: ; 92e10 ld hl, REEL_SPIN_RATE add hl, bc ld [hl], 0 -ReelAction_WaitDropReel: ; 92e31 +ReelAction_WaitDropReel: ld hl, REEL_FIELD_0B add hl, bc ld a, [hl] @@ -1363,9 +1336,8 @@ ReelAction_WaitDropReel: ; 92e31 ld [hl], 8 ret -; 92e47 -ReelAction_StartSlowAdvanceReel3: ; 92e47 +ReelAction_StartSlowAdvanceReel3: ; Ensures SEVENs are lined up if there's bias to SEVEN. ; Ensures nothing is lined up if there's no bias symbols. ; No other bias symbols are compatible with this mode. @@ -1387,7 +1359,7 @@ ReelAction_StartSlowAdvanceReel3: ; 92e47 ld hl, REEL_MANIP_DELAY add hl, bc ld [hl], 16 -ReelAction_WaitSlowAdvanceReel3: ; 92e64 +ReelAction_WaitSlowAdvanceReel3: ld hl, REEL_MANIP_DELAY add hl, bc ld a, [hl] @@ -1418,9 +1390,8 @@ ReelAction_WaitSlowAdvanceReel3: ; 92e64 call WaitSFX ret -; 92e94 -Slots_CheckMatchedFirstTwoReels: ; 92e94 +Slots_CheckMatchedFirstTwoReels: xor a ld [wFirstTwoReelsMatching], a ld [wFirstTwoReelsMatchingSevens], a @@ -1447,77 +1418,69 @@ Slots_CheckMatchedFirstTwoReels: ; 92e94 scf ret -; 92ebd -.Jumptable: ; 92ebd +.Jumptable: dw .zero dw .one dw .two dw .three -; 92ec5 -.three ; 92ec5 +.three call .CheckUpwardsDiag call .CheckDownwardsDiag -.two ; 92ecb +.two call .CheckBottomRow call .CheckTopRow -.one ; 92ed1 +.one call .CheckMiddleRow -.zero ; 92ed4 +.zero ret -; 92ed5 -.CheckBottomRow: ; 92ed5 +.CheckBottomRow: ld hl, wCurrReelStopped ld a, [wReel1Stopped] cp [hl] call z, .StoreResult ret -; 92ee0 -.CheckUpwardsDiag: ; 92ee0 +.CheckUpwardsDiag: ld hl, wCurrReelStopped + 1 ld a, [wReel1Stopped] cp [hl] call z, .StoreResult ret -; 92eeb -.CheckMiddleRow: ; 92eeb +.CheckMiddleRow: ld hl, wCurrReelStopped + 1 ld a, [wReel1Stopped + 1] cp [hl] call z, .StoreResult ret -; 92ef6 -.CheckDownwardsDiag: ; 92ef6 +.CheckDownwardsDiag: ld hl, wCurrReelStopped + 1 ld a, [wReel1Stopped + 2] cp [hl] call z, .StoreResult ret -; 92f01 -.CheckTopRow: ; 92f01 +.CheckTopRow: ld hl, wCurrReelStopped + 2 ld a, [wReel1Stopped + 2] cp [hl] call z, .StoreResult ret -; 92f0c -.StoreResult: ; 92f0c +.StoreResult: ld [wSlotBuildingMatch], a and a jr nz, .matching_sevens @@ -1529,9 +1492,8 @@ Slots_CheckMatchedFirstTwoReels: ; 92e94 ld [wFirstTwoReelsMatching], a ret -; 92f1d -Slots_CheckMatchedAllThreeReels: ; 92f1d +Slots_CheckMatchedAllThreeReels: ld a, SLOTS_NO_MATCH ld [wSlotMatched], a call Slots_GetCurrentReelState @@ -1561,32 +1523,29 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d scf ret -; 92f48 -.Jumptable: ; 92f48 +.Jumptable: dw .zero dw .one dw .two dw .three -; 92f50 -.three ; 92f50 +.three call .CheckUpwardsDiag call .CheckDownwardsDiag -.two ; 92f56 +.two call .CheckBottomRow call .CheckTopRow -.one ; 92f5c +.one call .CheckMiddleRow -.zero ; 92f5f +.zero ret -; 92f60 -.CheckBottomRow: ; 92f60 +.CheckBottomRow: ld hl, wCurrReelStopped ld a, [wReel1Stopped] cp [hl] @@ -1596,9 +1555,8 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d call z, .StoreResult ret -; 92f70 -.CheckUpwardsDiag: ; 92f70 +.CheckUpwardsDiag: ld hl, wCurrReelStopped + 2 ld a, [wReel1Stopped] cp [hl] @@ -1608,9 +1566,8 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d call z, .StoreResult ret -; 92f80 -.CheckMiddleRow: ; 92f80 +.CheckMiddleRow: ld hl, wCurrReelStopped + 1 ld a, [wReel1Stopped + 1] cp [hl] @@ -1620,9 +1577,8 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d call z, .StoreResult ret -; 92f90 -.CheckDownwardsDiag: ; 92f90 +.CheckDownwardsDiag: ld hl, wCurrReelStopped ld a, [wReel1Stopped + 2] cp [hl] @@ -1632,9 +1588,8 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d call z, .StoreResult ret -; 92fa0 -.CheckTopRow: ; 92fa0 +.CheckTopRow: ld hl, wCurrReelStopped + 2 ld a, [wReel1Stopped + 2] cp [hl] @@ -1644,15 +1599,13 @@ Slots_CheckMatchedAllThreeReels: ; 92f1d call z, .StoreResult ret -; 92fb0 -.StoreResult: ; 92fb0 +.StoreResult: ld [wSlotMatched], a ret -; 92fb4 -Slots_CopyReelState: ; 92fb4 +Slots_CopyReelState: ld de, wCurrReelStopped ld a, [hli] ld [de], a @@ -1664,9 +1617,8 @@ Slots_CopyReelState: ; 92fb4 ld [de], a ret -; 92fc0 -Slots_GetNumberOfGolems: ; 92fc0 +Slots_GetNumberOfGolems: ld hl, REEL_POSITION add hl, bc ld a, [hl] @@ -1679,9 +1631,8 @@ Slots_GetNumberOfGolems: ; 92fc0 ld a, e ret -; 92fcf -.Check7Bias: ; 92fcf +.Check7Bias: ld a, [wSlotBias] and a jr nz, .not_biased_to_seven @@ -1718,9 +1669,8 @@ Slots_GetNumberOfGolems: ; 92fc0 jr c, .loop2 ret -; 93002 -Slots_InitBias: ; 93002 (24:7002) +Slots_InitBias: ld a, [wSlotBias] and a ret z @@ -1744,9 +1694,8 @@ Slots_InitBias: ; 93002 (24:7002) ld [wSlotBias], a ret -; 93023 (24:7023) -.Normal: ; 93023 +.Normal: db $01, SLOTS_SEVEN ; 1/256 db $03, SLOTS_POKEBALL ; 1/128 db $0a, SLOTS_STARYU ; 7/256 @@ -1754,9 +1703,8 @@ Slots_InitBias: ; 93002 (24:7002) db $28, SLOTS_PIKACHU ; 5/64 db $30, SLOTS_CHERRY ; 1/32 db $ff, SLOTS_NO_BIAS ; everything else -; 93031 -.Lucky: ; 93031 +.Lucky: db $02, SLOTS_SEVEN ; 1/128 db $03, SLOTS_POKEBALL ; 1/256 db $08, SLOTS_STARYU ; 5/256 @@ -1764,9 +1712,8 @@ Slots_InitBias: ; 93002 (24:7002) db $1e, SLOTS_PIKACHU ; 7/128 db $50, SLOTS_CHERRY ; 25/128 db $ff, SLOTS_NO_BIAS ; everything else -; 9303f -Slots_IlluminateBetLights: ; 9303f (24:703f) +Slots_IlluminateBetLights: ld b, $14 ; turned on ld a, [wSlotBet] dec a @@ -1775,22 +1722,22 @@ Slots_IlluminateBetLights: ; 9303f (24:703f) jr z, Slots_Lights2OnOff jr Slots_Lights3OnOff -Slots_DeilluminateBetLights: ; 9304c (24:704c) +Slots_DeilluminateBetLights: ld b, $23 ; turned off -Slots_Lights3OnOff: ; 9304e (24:704e) +Slots_Lights3OnOff: hlcoord 3, 2 call Slots_TurnLightsOnOrOff hlcoord 3, 10 call Slots_TurnLightsOnOrOff -Slots_Lights2OnOff: ; 9305a (24:705a) +Slots_Lights2OnOff: hlcoord 3, 4 call Slots_TurnLightsOnOrOff hlcoord 3, 8 call Slots_TurnLightsOnOrOff -Slots_Lights1OnOff: ; 93066 (24:7066) +Slots_Lights1OnOff: hlcoord 3, 6 -Slots_TurnLightsOnOrOff: ; 93069 (24:7069) +Slots_TurnLightsOnOrOff: ld a, b ld [hl], a ld de, SCREEN_WIDTH / 2 + 3 @@ -1805,7 +1752,7 @@ Slots_TurnLightsOnOrOff: ; 93069 (24:7069) ld [hl], a ret -Slots_AskBet: ; 9307c (24:707c) +Slots_AskBet: .loop ld hl, .Text_BetHowManyCoins call PrintText @@ -1847,7 +1794,6 @@ Slots_AskBet: ; 9307c (24:707c) and a ret -; 930c7 (24:70c7) .Text_BetHowManyCoins: ; 0x930c7 ; Bet how many coins? @@ -1882,7 +1828,7 @@ Slots_AskBet: ; 9307c (24:707c) db " 1@" ; 0x930e9 -Slots_AskPlayAgain: ; 930e9 (24:70e9) +Slots_AskPlayAgain: ld hl, wCoins ld a, [hli] or [hl] @@ -1911,17 +1857,16 @@ Slots_AskPlayAgain: ; 930e9 (24:70e9) scf ret -; 9311a (24:711a) -.Text_OutOfCoins: ; 9311a +.Text_OutOfCoins: text_jump UnknownText_0x1c5079 db "@" -.Text_PlayAgain: ; 9311f +.Text_PlayAgain: text_jump UnknownText_0x1c5092 db "@" -Slots_GetPayout: ; 93124 (24:7124) +Slots_GetPayout: ld a, [wSlotMatched] cp SLOTS_NO_MATCH jr z, .no_win @@ -1954,7 +1899,7 @@ Slots_GetPayout: ; 93124 (24:7124) ld [hl], a ret -Slots_PayoutText: ; 93158 (24:7158) +Slots_PayoutText: ld a, [wSlotMatched] cp SLOTS_NO_MATCH jr nz, .MatchedSomething @@ -1987,16 +1932,14 @@ Slots_PayoutText: ; 93158 (24:7158) farcall StubbedTrainerRankings_AddToSlotsWinStreak ret -; 93195 (24:7195) -.PayoutStrings: ; 93195 +.PayoutStrings: dbw "300@", .LinedUpSevens dbw "50@@", .LinedUpPokeballs dbw "6@@@", .LinedUpMonOrCherry dbw "8@@@", .LinedUpMonOrCherry dbw "10@@", .LinedUpMonOrCherry dbw "15@@", .LinedUpMonOrCherry -; 931b9 .Text_PrintPayout: ; 0x931b9 start_asm @@ -2017,7 +1960,6 @@ rept 4 endr ret -; 931db .Text_LinedUpWonCoins: ; 0x931db ; lined up! Won @ coins! @@ -2031,7 +1973,7 @@ endr db "@" ; 0x931e5 -.LinedUpSevens: ; 931e5 +.LinedUpSevens: ld a, SFX_2ND_PLACE call Slots_PlaySFX call WaitSFX @@ -2058,25 +2000,22 @@ endr ld [wSlotBias], a ret -; 9320b -.LinedUpPokeballs: ; 9320b +.LinedUpPokeballs: ld a, SFX_3RD_PLACE call Slots_PlaySFX call WaitSFX ret -; 93214 -.LinedUpMonOrCherry: ; 93214 +.LinedUpMonOrCherry: ld a, SFX_PRESENT call Slots_PlaySFX call WaitSFX ret -; 9321d -Slots_AnimateGolem: ; 9321d (24:721d) +Slots_AnimateGolem: ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX add hl, bc ld e, [hl] @@ -2089,12 +2028,12 @@ Slots_AnimateGolem: ; 9321d (24:721d) ld l, a jp hl -.Jumptable: ; 9322d (24:722d) +.Jumptable: dw .init dw .fall dw .roll -.init ; 93233 (24:7233) +.init ld hl, SPRITEANIMSTRUCT_0E add hl, bc ld a, [hl] @@ -2119,7 +2058,7 @@ Slots_AnimateGolem: ; 9321d (24:721d) add hl, bc ld [hl], $0 -.fall ; 93259 (24:7259) +.fall ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld a, [hl] @@ -2148,7 +2087,7 @@ Slots_AnimateGolem: ; 9321d (24:721d) call Slots_PlaySFX ret -.roll ; 93289 (24:7289) +.roll ld hl, SPRITEANIMSTRUCT_XOFFSET add hl, bc ld a, [hl] @@ -2175,7 +2114,7 @@ Slots_AnimateGolem: ; 9321d (24:721d) ld [hSCY], a ret -Slots_AnimateChansey: ; 932ac (24:72ac) +Slots_AnimateChansey: ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX add hl, bc ld e, [hl] @@ -2188,12 +2127,12 @@ Slots_AnimateChansey: ; 932ac (24:72ac) ld l, a jp hl -.Jumptable: ; 932bc (24:72bc) +.Jumptable: dw .walk dw .one dw .two -.walk ; 932c2 (24:72c2) +.walk ld hl, SPRITEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2213,7 +2152,7 @@ Slots_AnimateChansey: ; 932ac (24:72ac) ld a, 1 ld [wSlotsDelay], a -.one ; 932e0 (24:72e0) +.one ld a, [wSlotsDelay] cp $2 jr z, .retain @@ -2231,7 +2170,7 @@ Slots_AnimateChansey: ; 932ac (24:72ac) ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld [hl], $8 -.two ; 932fc (24:72fc) +.two ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld a, [hl] @@ -2251,18 +2190,16 @@ Slots_AnimateChansey: ; 932ac (24:72ac) pop bc ret -; 93316 (24:7316) -Slots_WaitSFX: ; 93316 +Slots_WaitSFX: push bc ld c, 16 call DelayFrames pop bc ret -; 9331e -Slots_PlaySFX: ; 9331e (24:731e) +Slots_PlaySFX: push de ld e, a ld d, 0 @@ -2270,11 +2207,10 @@ Slots_PlaySFX: ; 9331e (24:731e) pop de ret -; 93327 (24:7327) ; The first three positions are repeated to ; avoid needing to check indices when copying. -Reel1Tilemap: ; 93327 +Reel1Tilemap: db SLOTS_SEVEN ; 0 db SLOTS_CHERRY ; 1 db SLOTS_STARYU ; 2 @@ -2294,7 +2230,7 @@ Reel1Tilemap: ; 93327 db SLOTS_CHERRY ; 1 db SLOTS_STARYU ; 2 -Reel2Tilemap: ; 93339 +Reel2Tilemap: db SLOTS_SEVEN ; 0 db SLOTS_PIKACHU ; 1 db SLOTS_CHERRY ; 2 @@ -2314,7 +2250,7 @@ Reel2Tilemap: ; 93339 db SLOTS_PIKACHU ; 1 db SLOTS_CHERRY ; 2 -Reel3Tilemap: ; 9334b +Reel3Tilemap: db SLOTS_SEVEN ; 0 db SLOTS_PIKACHU ; 1 db SLOTS_CHERRY ; 2 @@ -2333,20 +2269,15 @@ Reel3Tilemap: ; 9334b db SLOTS_SEVEN ; 0 db SLOTS_PIKACHU ; 1 db SLOTS_CHERRY ; 2 -; 9335d -SlotsTilemap: ; 9335d +SlotsTilemap: INCBIN "gfx/slots/slots.tilemap" -; 9344d -Slots1LZ: ; 9344d +Slots1LZ: INCBIN "gfx/slots/slots_1.2bpp.lz" -; 935cd -Slots2LZ: ; 935cd +Slots2LZ: INCBIN "gfx/slots/slots_2.2bpp.lz" -; 9382d -Slots3LZ: ; 9382d +Slots3LZ: INCBIN "gfx/slots/slots_3.2bpp.lz" -; 93a3d diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm index 300f07de4..9e4f69441 100644 --- a/engine/games/unown_puzzle.asm +++ b/engine/games/unown_puzzle.asm @@ -3,7 +3,7 @@ PUZZLE_VOID EQU $ef puzcoord EQUS "* 6 +" -_UnownPuzzle: ; e1190 +_UnownPuzzle: ld a, [hInMenu] push af ld a, $1 @@ -88,9 +88,8 @@ _UnownPuzzle: ; e1190 ld a, LCDC_DEFAULT ld [rLCDC], a ret -; e124e -InitUnownPuzzlePiecePositions: ; e124e +InitUnownPuzzlePiecePositions: ld c, 1 ld b, 16 .load_loop @@ -111,9 +110,8 @@ InitUnownPuzzlePiecePositions: ; e124e dec b jr nz, .load_loop ret -; e126d -.PuzzlePieceInitialPositions: ; e126d +.PuzzlePieceInitialPositions: initpuzcoord: MACRO rept _NARG / 2 db \1 puzcoord \2 @@ -128,9 +126,8 @@ ENDM initpuzcoord 4,0, 4,5 initpuzcoord 5,0, 5,5 ; START > CANCEL -; e127d -PlaceStartCancelBox: ; e127d +PlaceStartCancelBox: call PlaceStartCancelBoxBorder hlcoord 5, 16 ld a, $f6 @@ -141,9 +138,8 @@ PlaceStartCancelBox: ; e127d dec c jr nz, .loop ret -; e128d -PlaceStartCancelBoxBorder: ; e128d +PlaceStartCancelBoxBorder: hlcoord 4, 15 ld a, $f0 ld [hli], a @@ -172,9 +168,8 @@ PlaceStartCancelBoxBorder: ; e128d ld a, $f5 ld [hl], a ret -; e12ca -UnownPuzzleJumptable: ; e12ca +UnownPuzzleJumptable: ld a, [wJumptableIndex] ld e, a ld d, 0 @@ -185,13 +180,11 @@ UnownPuzzleJumptable: ; e12ca ld h, [hl] ld l, a jp hl -; e12d9 -.Jumptable: ; e12d9 +.Jumptable: dw .Function -; e12db -.Function: ; e12db +.Function: ld a, [hJoyPressed] and START jp nz, UnownPuzzle_Quit @@ -299,9 +292,8 @@ UnownPuzzleJumptable: ; e12ca .play_sfx call PlaySFX ret -; e1376 -UnownPuzzle_A: ; e1376 +UnownPuzzle_A: ld a, [wHoldingUnownPuzzlePiece] and a jr nz, .TryPlacePiece @@ -348,19 +340,18 @@ UnownPuzzle_A: ; e1376 call SimpleWaitPressAorB ld a, TRUE ld [wSolvedUnownPuzzle], a -UnownPuzzle_Quit: ; e13de +UnownPuzzle_Quit: ld hl, wJumptableIndex set 7, [hl] ret -UnownPuzzle_InvalidAction: ; e13e4 +UnownPuzzle_InvalidAction: ld de, SFX_WRONG call PlaySFX call WaitSFX ret -; e13ee -UnownPuzzle_FillBox: ; e13ee +UnownPuzzle_FillBox: ld de, SCREEN_WIDTH .row push bc @@ -375,9 +366,8 @@ UnownPuzzle_FillBox: ; e13ee dec b jr nz, .row ret -; e13fe -UnownPuzzle_UpdateTilemap: ; e13fe +UnownPuzzle_UpdateTilemap: xor a ld [wUnownPuzzleCursorPosition], a ld c, 6 * 6 @@ -400,9 +390,8 @@ UnownPuzzle_UpdateTilemap: ; e13fe dec c jr nz, .loop ret -; e141f -PlaceUnownPuzzlePieceGFX: ; e141f +PlaceUnownPuzzlePieceGFX: ld a, $2 ; tilemap coords call GetUnownPuzzleCoordData ld a, [hli] @@ -427,9 +416,8 @@ PlaceUnownPuzzlePieceGFX: ; e141f dec b jr nz, .row ret -; e1441 -FillUnoccupiedPuzzleSpace: ; e1441 +FillUnoccupiedPuzzleSpace: ld a, 2 ; tilemap coords call GetUnownPuzzleCoordData ld a, [hli] @@ -454,9 +442,8 @@ FillUnoccupiedPuzzleSpace: ; e1441 dec b jr nz, .row ret -; e1463 -GetUnownPuzzleCoordData: ; e1463 +GetUnownPuzzleCoordData: ld e, a ld d, 0 ld hl, UnownPuzzleCoordData @@ -467,9 +454,8 @@ rept 6 add hl, de endr ret -; e1475 -UnownPuzzle_CheckCurrentTileOccupancy: ; e1475 +UnownPuzzle_CheckCurrentTileOccupancy: ld hl, wPuzzlePieces ld a, [wUnownPuzzleCursorPosition] ld e, a @@ -477,9 +463,8 @@ UnownPuzzle_CheckCurrentTileOccupancy: ; e1475 add hl, de ld a, [hl] ret -; e1481 -GetCurrentPuzzlePieceVTileCorner: ; e1481 +GetCurrentPuzzlePieceVTileCorner: ld a, [wUnownPuzzleHeldPiece] ld hl, .Corners add l @@ -489,9 +474,8 @@ GetCurrentPuzzlePieceVTileCorner: ; e1481 ld h, a ld a, [hl] ret -; e148f -.Corners: ; e148f +.Corners: ; 00, 01, 02 ; 0c, 0d, 0e ; 18, 19, 1a @@ -500,9 +484,8 @@ GetCurrentPuzzlePieceVTileCorner: ; e1481 db $24, $27, $2a, $2d db $48, $4b, $4e, $51 db $6c, $6f, $72, $75 -; e14a0 -CheckSolvedUnownPuzzle: ; e14a0 +CheckSolvedUnownPuzzle: ld hl, .SolvedPuzzleConfiguration ld de, wPuzzlePieces ld c, 6 * 6 @@ -520,18 +503,16 @@ CheckSolvedUnownPuzzle: ; e14a0 .not_solved and a ret -; e14b5 -.SolvedPuzzleConfiguration: ; e14b5 +.SolvedPuzzleConfiguration: db $00, $00, $00, $00, $00, $00 db $00, $01, $02, $03, $04, $00 db $00, $05, $06, $07, $08, $00 db $00, $09, $0a, $0b, $0c, $00 db $00, $0d, $0e, $0f, $10, $00 db $00, $00, $00, $00, $00, $00 -; e14d9 -RedrawUnownPuzzlePieces: ; e14d9 +RedrawUnownPuzzlePieces: call GetCurrentPuzzlePieceVTileCorner ld [wd002], a xor a @@ -570,9 +551,8 @@ RedrawUnownPuzzlePieces: ; e14d9 ld [de], a ; attributes inc de jr .loop -; e150f -.OAM_HoldingPiece: ; e150f +.OAM_HoldingPiece: dsprite -1, -4, -1, -4, $00, 0 dsprite -1, -4, 0, -4, $01, 0 dsprite -1, -4, 0, 4, $02, 0 @@ -584,7 +564,7 @@ RedrawUnownPuzzlePieces: ; e14d9 dsprite 0, 4, 0, 4, $1a, 0 db -1 -.OAM_NotHoldingPiece: ; e1534 +.OAM_NotHoldingPiece: dsprite -1, -4, -1, -4, $00, 0 dsprite -1, -4, 0, -4, $01, 0 dsprite -1, -4, 0, 4, $00, 0 | X_FLIP @@ -596,7 +576,7 @@ RedrawUnownPuzzlePieces: ; e14d9 dsprite 0, 4, 0, 4, $00, 0 | X_FLIP | Y_FLIP db -1 -UnownPuzzleCoordData: ; e1559 +UnownPuzzleCoordData: puzzle_coords: MACRO dbpixel \1, \2, \3, \4 @@ -646,7 +626,7 @@ ENDM puzzle_coords 15, 18, 4, 4, 13, 15, PUZZLE_BORDER, 0 puzzle_coords 18, 18, 4, 4, 16, 15, PUZZLE_BORDER, 0 -ConvertLoadedPuzzlePieces: ; e1631 +ConvertLoadedPuzzlePieces: ld hl, vTiles2 ld de, vTiles0 ld b, 6 @@ -667,9 +647,8 @@ ConvertLoadedPuzzlePieces: ; e1631 jr nz, .loop call UnownPuzzle_AddPuzzlePieceBorders ret -; e1654 -.EnlargePuzzlePieceTiles: ; e1654 +.EnlargePuzzlePieceTiles: ; double size ld c, 6 .loop1 @@ -738,9 +717,8 @@ ConvertLoadedPuzzlePieces: ; e1631 dec c jr nz, .loop1 ret -; e16aa -.GetEnlargedTile: ; e16aa +.GetEnlargedTile: push hl ld hl, .EnlargedTiles add l @@ -751,18 +729,16 @@ ConvertLoadedPuzzlePieces: ; e1631 ld a, [hl] pop hl ret -; e16b7 -.EnlargedTiles: ; e16b7 +.EnlargedTiles: x = 0 rept 16 db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11) x = x + 1 endr -; e16c7 -UnownPuzzle_AddPuzzlePieceBorders: ; e16c7 +UnownPuzzle_AddPuzzlePieceBorders: ld hl, PuzzlePieceBorderData ld a, 8 .loop @@ -784,9 +760,8 @@ endr dec a jr nz, .loop ret -; e16e2 -.LoadGFX: ; e16e2 +.LoadGFX: lb bc, 4, 4 .loop1 push bc @@ -817,9 +792,8 @@ endr dec b jr nz, .loop1 ret -; e1703 -PuzzlePieceBorderData: ; e1703 +PuzzlePieceBorderData: dw .TileBordersGFX + 0 tiles, vTiles0 tile $00 dw .TileBordersGFX + 1 tiles, vTiles0 tile $01 dw .TileBordersGFX + 2 tiles, vTiles0 tile $02 @@ -828,12 +802,11 @@ PuzzlePieceBorderData: ; e1703 dw .TileBordersGFX + 5 tiles, vTiles0 tile $18 dw .TileBordersGFX + 6 tiles, vTiles0 tile $19 dw .TileBordersGFX + 7 tiles, vTiles0 tile $1a -; e1723 -.TileBordersGFX: ; e1723 +.TileBordersGFX: INCBIN "gfx/unown_puzzle/tile_borders.2bpp" -LoadUnownPuzzlePiecesGFX: ; e17a3 +LoadUnownPuzzlePiecesGFX: ld a, [wScriptVar] maskbits NUM_UNOWN_PUZZLES ld e, a @@ -848,30 +821,28 @@ LoadUnownPuzzlePiecesGFX: ; e17a3 call Decompress call ConvertLoadedPuzzlePieces ret -; e17bd -.LZPointers: ; e17bd +.LZPointers: ; entries correspond to UNOWNPUZZLE_* constants dw KabutoPuzzleLZ dw OmanytePuzzleLZ dw AerodactylPuzzleLZ dw HoOhPuzzleLZ -; e17c5 -UnownPuzzleCursorGFX: ; e17c5 +UnownPuzzleCursorGFX: INCBIN "gfx/unown_puzzle/cursor.2bpp" -UnownPuzzleStartCancelLZ: ; e1805 +UnownPuzzleStartCancelLZ: INCBIN "gfx/unown_puzzle/start_cancel.2bpp.lz" -HoOhPuzzleLZ: ; e18ab +HoOhPuzzleLZ: INCBIN "gfx/unown_puzzle/hooh.2bpp.lz" -AerodactylPuzzleLZ: ; e19fb +AerodactylPuzzleLZ: INCBIN "gfx/unown_puzzle/aerodactyl.2bpp.lz" -KabutoPuzzleLZ: ; e1bab +KabutoPuzzleLZ: INCBIN "gfx/unown_puzzle/kabuto.2bpp.lz" -OmanytePuzzleLZ: ; e1c9b +OmanytePuzzleLZ: INCBIN "gfx/unown_puzzle/omanyte.2bpp.lz" |