diff options
author | dannye <corrnondacqb@yahoo.com> | 2016-02-21 17:27:41 -0600 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2016-02-21 17:32:42 -0600 |
commit | 0a642f8f1442397c75e06b14ae0da3f7f0af3241 (patch) | |
tree | d18edbd3479aa4075156bfb8998127ffde944328 /src | |
parent | 1d291602536740893e66d1adab49c22321ad4706 (diff) |
Replace hardcoded constants and clean up
Diffstat (limited to 'src')
-rw-r--r-- | src/constants/duel_constants.asm | 4 | ||||
-rw-r--r-- | src/constants/hardware_constants.asm | 1 | ||||
-rw-r--r-- | src/data/effect_commands.asm | 2 | ||||
-rwxr-xr-x | src/engine/bank1.asm | 31 | ||||
-rwxr-xr-x | src/engine/home.asm | 42 | ||||
-rw-r--r-- | src/hram.asm | 1 | ||||
-rwxr-xr-x | src/wram.asm | 8 |
7 files changed, 38 insertions, 51 deletions
diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index 84749fc..95bbe8d 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -17,6 +17,7 @@ DUELVARS_BENCH2_CARD_HP EQUS "wPlayerBench2CardHP & $ff" DUELVARS_BENCH3_CARD_HP EQUS "wPlayerBench3CardHP & $ff" ; cb DUELVARS_BENCH4_CARD_HP EQUS "wPlayerBench4CardHP & $ff" ; cc DUELVARS_BENCH5_CARD_HP EQUS "wPlayerBench5CardHP & $ff" ; cd +DUELVARS_CANT_ATTACK_STATUS EQUS "wPlayerCantAttackStatus & $ff" ; e8 DUELVARS_PRIZES EQUS "wPlayerPrizes & $ff" ; ec DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQUS "wPlayerNumberOfCardsInDiscardPile & $ff" ; ed DUELVARS_NUMBER_OF_CARDS_IN_HAND EQUS "wPlayerNumberOfCardsInHand & $ff" ; ee @@ -24,10 +25,9 @@ DUELVARS_NUMBER_OF_POKEMON_IN_PLAY EQUS "wPlayerNumberOfPokemonInPlay & $f DUELVARS_ARENA_CARD_STATUS EQUS "wPlayerArenaCardStatus & $ff" ; f0 DUELVARS_DUELIST_TYPE EQUS "wPlayerDuelistType & $ff" ; f1 - ; status condition constants CARD_NOSTATUS EQU $00 ;TODO - ??? EQU $01 CARD_ASLEEP EQU $02 CARD_PARALYZED EQU $03 -;TODO - beyond
\ No newline at end of file +;TODO - beyond diff --git a/src/constants/hardware_constants.asm b/src/constants/hardware_constants.asm index 8e926a1..0471e74 100644 --- a/src/constants/hardware_constants.asm +++ b/src/constants/hardware_constants.asm @@ -40,7 +40,6 @@ OAM_X_FLIP EQU 5 OAM_Y_FLIP EQU 6 OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3) - ; Hardware registers rJOYP EQU $ff00 ; Joypad (R/W) rSB EQU $ff01 ; Serial transfer data (R/W) diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm index 39bc603..3946ee8 100644 --- a/src/data/effect_commands.asm +++ b/src/data/effect_commands.asm @@ -11,7 +11,7 @@ EffectCommands: ; 186f7 (6:46f7) ; with an argument identifying the command Id. If said command Id is found in the ; current move effect's array, its assigned function is immediately executed. -; Similar move effects of different Pokemon cards all point to a different command list, +; Similar move effects of different Pokemon cards all point to a different command list, ; even though in some cases their commands and function pointers match. ; xxx use <TrainerCardName>EffectCommands or <EnergyCardName>EffectCommands for these types of cards. diff --git a/src/engine/bank1.asm b/src/engine/bank1.asm index af60090..57905c3 100755 --- a/src/engine/bank1.asm +++ b/src/engine/bank1.asm @@ -476,26 +476,25 @@ OpenBattleCheckMenu: ; 4585 (1:4585) INCBIN "baserom.gbc",$458e, $46fc - $458e - OpenBattleAttackMenu: ; 46fc (1:46fc) call CheckIfCantAttackDueToAttackEffect jr c, .alertCantAttackAndCancelMenu call CheckIfActiveCardParalyzedOrAsleep jr nc, .clearSubMenuSelection - + .alertCantAttackAndCancelMenu call DrawWideTextBox_WaitForInput jp Func_4295 - + .clearSubMenuSelection xor a ld [wSelectedDuelSubMenuItem], a - + .tryOpenAttackMenu - call $4823 + call $4823 or a jr nz, .asm_471f - ld hl, $003c + ld hl, $003c call DrawWideTextBox_WaitForInput jp Func_4295 @@ -551,12 +550,11 @@ OpenBattleAttackMenu: ; 46fc (1:46fc) .asm_477d ; 477d (1:477d) call DrawWideTextBox_WaitForInput jr .tryOpenAttackMenu - + .asm_4782 ; 4782 (1:4782) call $478b call $4f9d jp .tryOpenAttackMenu - INCBIN "baserom.gbc",$478b, $4823 - $478b @@ -588,7 +586,7 @@ Func_4823: ; 4823 (1:4823) pop hl inc b inc b - + .asm_4856 ld de, $cc47 call $4872 @@ -605,18 +603,15 @@ Func_4823: ; 4823 (1:4823) call $5c33 pop bc pop hl - + .asm_4870 ld a, c ret INCBIN "baserom.gbc",$4872, $4918 - $4872 - - - CheckIfActiveCardParalyzedOrAsleep: ; 4918 (1:4918) - ld a, $f0 + ld a, DUELVARS_ARENA_CARD_STATUS call GetTurnDuelistVariable and $0f cp CARD_PARALYZED @@ -629,20 +624,16 @@ CheckIfActiveCardParalyzedOrAsleep: ; 4918 (1:4918) .paralyzed: ld hl, $0025 jr .returnWithStatusCondition - + .asleep: ld hl, $0024 - + .returnWithStatusCondition: scf ret - - - INCBIN "baserom.gbc",$4933, $5aeb - $4933 - Func_5aeb: ; 5aeb (1:5aeb) INCBIN "baserom.gbc",$5aeb,$6785 - $5aeb diff --git a/src/engine/home.asm b/src/engine/home.asm index f864282..148da07 100755 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -2520,14 +2520,14 @@ Func_16c0: ; 16c0 (0:16c0) ret Func_16f6: ; 16f6 (0:16f6) - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable ld [$ff9f], a call Func_1324 ld a, e ld [wccc3], a call GetOpposingTurnDuelistVariable_SwapTurn - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_1324 ld a, e @@ -2761,7 +2761,7 @@ Func_189d: ; 189d (0:189d) Func_18d7: ; 18d7 (0:18d7) xor a ld [wccc9], a - ld a, $f0 + ld a, DUELVARS_ARENA_CARD_STATUS call GetTurnDuelistVariable and $f cp $1 @@ -2800,7 +2800,7 @@ Func_195c: ; 195c (0:195c) ld a, [wccc1] ld c, a ld b, $0 - ld a, $c8 + ld a, DUELVARS_ARENA_CARD_HP call GetTurnDuelistVariable bank1call $7469 call Func_1ad0 @@ -2986,14 +2986,14 @@ Func_1a96: ; 1a96 (0:1a96) Func_1aac: ; 1aac (0:1aac) ld e, a - add $c8 + add DUELVARS_ARENA_CARD_HP call GetTurnDuelistVariable or a ret nz ld a, [wccc4] push af ld a, e - add $bb + add DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_1376 ld a, [wCardBuffer1 + $7] @@ -3032,7 +3032,7 @@ INCBIN "baserom.gbc",$1af3,$1b8d - $1af3 Func_1b8d: ; 1b8d (0:1b8d) bank1call $4f9d - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_1376 ld a, $12 @@ -3068,7 +3068,7 @@ Func_1bca: ; 1bca (0:1bca) cp $1 jr z, .asm_1bfd ld a, [$ff9d] - add $bb + add DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_1376 ld a, $12 @@ -5736,7 +5736,7 @@ Func_321d: ; 321d (0:321d) call GetTurnDuelistVariable or a call nz, Func_323a - ld a, $e8 + ld a, DUELVARS_CANT_ATTACK_STATUS call GetTurnDuelistVariable or a call nz, Func_3243 @@ -5873,7 +5873,7 @@ Func_3269: ; 3269 (0:3269) INCBIN "baserom.gbc",$32f7,$33c1 - $32f7 CheckIfCantAttackDueToAttackEffect:: ; 33c1 (0:33c1) - ld a, $e8 + ld a, DUELVARS_CANT_ATTACK_STATUS call GetTurnDuelistVariable or a ret z @@ -5893,7 +5893,7 @@ CheckIfCantAttackDueToAttackEffect:: ; 33c1 (0:33c1) ret Func_33e1: ; 33e1 (0:33e1) - ld a, $e8 + ld a, DUELVARS_CANT_ATTACK_STATUS call GetTurnDuelistVariable or a jr nz, .asm_33ea @@ -5927,7 +5927,7 @@ Func_3400: ; 3400 (0:3400) ret Func_3414: ; 3414 (0:3414) - ld a, $e8 + ld a, DUELVARS_CANT_ATTACK_STATUS call GetTurnDuelistVariable or a ret z @@ -6037,7 +6037,7 @@ Func_34ef: ; 34ef (0:34ef) Func_34f0: ; 34f0 (0:34f0) or a jr nz, .asm_3500 - ld a, $f0 + ld a, DUELVARS_ARENA_CARD_STATUS call GetTurnDuelistVariable and $f ld hl, $00cb @@ -6074,7 +6074,7 @@ Func_3525: ; 3525 (0:3525) push bc ld [wce7c], a ld c, $0 - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable cp $ff jr z, .asm_3549 @@ -6082,13 +6082,13 @@ Func_3525: ; 3525 (0:3525) ld a, [wce7c] cp e jr nz, .asm_3549 - ld a, $f0 + ld a, DUELVARS_ARENA_CARD_STATUS call GetTurnDuelistVariable and $f jr nz, .asm_3549 inc c .asm_3549 - ld a, $bc + ld a, DUELVARS_BENCH call GetTurnDuelistVariable .asm_354e ld a, [hli] @@ -6135,7 +6135,7 @@ Func_35fa: ; 35fa (0:35fa) call GetTurnDuelistVariable res 1, [hl] push hl - ld a, $e8 + ld a, DUELVARS_CANT_ATTACK_STATUS call GetTurnDuelistVariable xor a ld [hl], a @@ -6183,7 +6183,7 @@ Func_36a2: ; 36a2 (0:36a2) ld h, [hl] ld l, a call Func_2ebb - ld a, $c8 + ld a, DUELVARS_ARENA_CARD_HP call GetTurnDuelistVariable pop de push af @@ -6218,7 +6218,7 @@ Func_36f7: ; 36f7 (0:36f7) jr nz, .asm_3718 .asm_3703 ld a, e - add $bb + add DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_1324 call Func_2f32 @@ -6249,7 +6249,7 @@ Func_3730: ; 3730 (0:3730) call GetTurnDuelistVariable or a ret nz - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_138c ld a, [wCardBuffer2 + $33] @@ -6263,7 +6263,7 @@ Func_374a: ; 374a (0:374a) call GetTurnDuelistVariable or a ret nz - ld a, $bb + ld a, DUELVARS_ARENA_CARD call GetTurnDuelistVariable call Func_138c ld a, [wCardBuffer2 + $34] diff --git a/src/hram.asm b/src/hram.asm index 38347fc..68e7e21 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -57,6 +57,5 @@ hCurrentMenuItem:: ds 3 - hffb5:: ; ffb5 ds 1 diff --git a/src/wram.asm b/src/wram.asm index 5ec4410..db424fe 100755 --- a/src/wram.asm +++ b/src/wram.asm @@ -63,7 +63,7 @@ wPlayerBench4CardHP:: ; c2cc wPlayerBench5CardHP:: ; c2cd ds $1 ds $1a - + ;The only known use of this is to store ;when an attack causes a pokemon ;to not be able to attack the following turn @@ -131,7 +131,7 @@ wOpponentBench4CardHP:: ; c3cc wOpponentBench5CardHP:: ; c3cd ds $1 ds $1a - + ;The only known use of this is to store ;when an attack causes a pokemon ;to not be able to attack the following turn @@ -334,8 +334,6 @@ wSerialRecvBuf:: ; $cba5 - $cbc4 ds $20 ds $1 - - ;--- Duels 2 ---------------------------------------------- ; In a duel, the main menu current or last selected menu item @@ -785,4 +783,4 @@ wMusicE4:: ; ddea ds $9 wMusicReturnAddress:: ; ddf3 - ds $8
\ No newline at end of file + ds $8 |