diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/constants/duel_constants.asm | 1 | ||||
-rwxr-xr-x | src/engine/bank1.asm | 2 | ||||
-rwxr-xr-x | src/engine/home.asm | 11 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index 104799d..dc34f9a 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -41,6 +41,7 @@ CARD_LOCATION_BENCH_2 EQU $12 CARD_LOCATION_BENCH_3 EQU $13 CARD_LOCATION_BENCH_4 EQU $14 CARD_LOCATION_BENCH_5 EQU $15 +CARD_LOCATION_JUST_DRAWN EQU $40 ;;; duelist types DUELIST_TYPE_PLAYER EQU $00 diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm index 1008822..3a3c6d6 100755 --- a/src/engine/bank1.asm +++ b/src/engine/bank1.asm @@ -245,7 +245,7 @@ HandleTurn: ; 4225 (1:4225) .asm_4237 call $70e6 call $4933 - call _DrawCardFromDeck + call DrawCardFromDeck jr nc, .deckNotEmpty ld a, DUEL_LOST ld [wDuelFinished], a diff --git a/src/engine/home.asm b/src/engine/home.asm index c47a7a2..e293c96 100755 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -2323,15 +2323,14 @@ ShuffleDeck: ; 10bc (0:10bc) ld b, a ld a, DUELVARS_DECK_CARDS add [hl] - ld l, a ; hl = position in the wPlayerDeckCards or wOpponentDeckCards array - ; of the first (top) card in the deck + ld l, a ; hl = position of the first (top) deck card in the wPlayerDeckCards or wOpponentDeckCards array ld a, b ; a = number of cards in the deck call ShuffleCards ret ; draw a card from the deck, saving its location as $40 ; returns c if deck is empty, nc if a card was succesfully drawn -_DrawCardFromDeck: ; 10cf (0:10cf) +DrawCardFromDeck: ; 10cf (0:10cf) push hl ld a, DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK call GetTurnDuelistVariable @@ -2343,7 +2342,7 @@ _DrawCardFromDeck: ; 10cf (0:10cf) ld l, a ld a, [hl] ; grab card number (0-59) from wPlayerDeckCards or wOpponentDeckCards array ld l, a - ld [hl], $40 ; temporarily write $40 to corresponding card location variable + ld [hl], CARD_LOCATION_JUST_DRAWN ; temporarily write $40 to corresponding card location variable pop hl or a ret @@ -2366,8 +2365,8 @@ AddCardToHand: ; 1123 (0:1123) ld l, a ldh a, [hWhoseTurn] ld h, a - ; write $1 (hand) into the location of this card - ld [hl], $1 + ; write $1 (CARD_LOCATION_HAND) into the location of this card + ld [hl], CARD_LOCATION_HAND ; increment number of cards in hand ld l, DUELVARS_NUMBER_OF_CARDS_IN_HAND inc [hl] |