diff options
author | xCrystal <rgr.crystal@gmail.com> | 2018-02-20 19:28:43 +0100 |
---|---|---|
committer | xCrystal <rgr.crystal@gmail.com> | 2018-02-20 19:28:43 +0100 |
commit | 377e0af97780092df6baa0bd0183e1d3ee622c39 (patch) | |
tree | f3ef99062093d44e34b1bfd83aeae57bb5b763dc /src | |
parent | 29b895f01c2438b8e5cc3bba408cd9dcddce502f (diff) |
A few corrections and more disasm
Diffstat (limited to 'src')
-rw-r--r-- | src/constants/card_data_constants.asm | 1 | ||||
-rw-r--r-- | src/engine/bank1.asm | 2 | ||||
-rw-r--r-- | src/engine/booster_packs.asm | 2 | ||||
-rw-r--r-- | src/engine/home.asm | 42 |
4 files changed, 37 insertions, 10 deletions
diff --git a/src/constants/card_data_constants.asm b/src/constants/card_data_constants.asm index 5a5898e..6a07ce9 100644 --- a/src/constants/card_data_constants.asm +++ b/src/constants/card_data_constants.asm @@ -13,6 +13,7 @@ ENERGY_CARD_DATA_LENGTH EQU $0e const WATER ; $3 const FIGHTING ; $4 const PSYCHIC ; $5 +NUM_COLORED_TYPES EQU const_value const COLORLESS ; $6 const UNUSED_TYPE ; $7 NUM_TYPES EQU const_value diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm index 8e54d12..f6acaf2 100644 --- a/src/engine/bank1.asm +++ b/src/engine/bank1.asm @@ -893,7 +893,7 @@ _CheckIfEnoughEnergies: ; 48ac (1:48ac) xor a ld [wAttachedEnergiesAccum], a ld hl, wAttachedEnergies - ld c, (COLORLESS - FIRE) / 2 + ld c, (NUM_COLORED_TYPES) / 2 .next_energy_type_pair ld a, [de] swap a diff --git a/src/engine/booster_packs.asm b/src/engine/booster_packs.asm index 967a0ee..23c3494 100644 --- a/src/engine/booster_packs.asm +++ b/src/engine/booster_packs.asm @@ -320,7 +320,7 @@ AddBoosterEnergyToDrawnEnergies: ; 1e380 (7:6380) ; generates a random energy card GenerateEndingEnergy: ; 1e387 (7:6387) - ld a, COLORLESS - FIRE + ld a, NUM_COLORED_TYPES call Random add $01 jr AddBoosterEnergyToDrawnEnergies diff --git a/src/engine/home.asm b/src/engine/home.asm index b6ff03a..23842a0 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -2844,7 +2844,7 @@ AddCardToHand: ; 1123 (0:1123) ret ; 0x1139 -; removes a card to the turn holder's hand and decrements the number of cards in the hand +; removes a card from the turn holder's hand and decrements the number of cards in the hand ; the card is identified by register a, which contains the card number within the deck (0-59) RemoveCardFromHand: ; 1139 (0:1139) push af @@ -3178,11 +3178,37 @@ ShuffleCards: ; 127f (0:127f) ret ; 0x12a3 - INCROM $12a3, $1312 + INCROM $12a3, $12fa -; given a position in wDuelCardOrAttackList (c510), return: -; the id of the card in that position in register de -; its index within the deck (0 - 59) in hTempCardNumber and in register a +; returns, in register bc, the id of the card in the deck position specified in register a +; preserves hl +GetCardInDeckPosition_bc: ; 12fa (0:12fa) + push hl + call _GetCardInDeckPosition + ld c, a + ld b, $0 + pop hl + ret +; 0x1303 + +; return [wDuelCardOrAttackList + a] in a and in hTempCardNumber +Func_1303: ; 1303 (0:1303) + push hl + push de + ld e, a + ld d, $0 + ld hl, wDuelCardOrAttackList + add hl, de + ld a, [hl] + ldh [hTempCardNumber], a + pop de + pop hl + ret +; 0x1312 + +; given the deck position (0-59) of a card in [wDuelCardOrAttackList + a], return: +; - the id of the card located in that deck position in register de +; - [wDuelCardOrAttackList + a] in hTempCardNumber and in register a GetCardInList: ; 1312 (0:1312) push hl ld e, a @@ -3197,8 +3223,8 @@ GetCardInList: ; 1312 (0:1312) ret ; 0x1324 -; returns, in register de, the id of the card in the deck position specified in register a, -; preserving af and hl +; returns, in register de, the id of the card in the deck position specified by register a +; preserves af and hl GetCardInDeckPosition: ; 1324 (0:1324) push af push hl @@ -7783,7 +7809,7 @@ HandleEnergyBurn: ; 375d (0:375d) call CheckIfUnderAnyCannotUseStatus2 ret c ld hl, wAttachedEnergies - ld c, COLORLESS - FIRE + ld c, NUM_COLORED_TYPES xor a .zero_next_energy ld [hli], a |