From 3049d086926f3118cc63f2413c07f09d07ec6fdd Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Thu, 31 Dec 2020 03:12:55 -0500 Subject: More disassembling on engine/bank01 --- src/engine/bank01.asm | 130 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index a7184a6..d719d12 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5661,7 +5661,135 @@ PrintPlayAreaCardAttachedEnergies: ; 63e6 (1:63e6) ret ; 0x6423 - INCROM $6423, $6510 +Func_6423: ; 6423 (1:6423) + ld hl, wDefaultText + ld e, $08 +.asm_6428 + ld a, [hli] + call JPWriteByteToBGMap0 + inc b + dec e + jr nz, .asm_6428 + ret +; 0x6431 + +Func_6431: ; 6431 (1:6431) + xor a + ld [wSelectedDuelSubMenuItem], a + +Func_6435: + call Func_64b0 + ld hl, PlayAreaScreenMenuParameters_ActivePokemonIncluded + ld a, [wSelectedDuelSubMenuItem] + call InitializeMenuParameters + ld a, [wNumPlayAreaItems] + ld [wNumMenuItems], a +.asm_6447 + call DoFrame + call HandleMenuInput + ldh [hTempPlayAreaLocation_ff9d], a + ld [wHUDEnergyAndHPBarsX], a + jr nc, .asm_6447 + cp $ff + jr z, .asm_649b + ld [wSelectedDuelSubMenuItem], a + ldh a, [hKeysPressed] + and $08 + jr nz, .asm_649d + ldh a, [hCurMenuItem] + add a + ld e, a + ld d, $00 + ld hl, $c511 + add hl, de + ld a, [hld] + cp $04 + jr nz, .asm_6447 + ld a, [hl] + ldh [hTempCardIndex_ff98], a + ld d, a + ld e, $00 + call CopyMoveDataAndDamage_FromDeckIndex + call DisplayUsePokemonPowerScreen + ld a, $01 + call TryExecuteEffectCommandFunction + jr nc, .asm_648c + ld hl, $40 + call DrawWideTextBox_WaitForInput + jp Func_6435 +.asm_648c + ld hl, $3f + call YesOrNoMenuWithText + jp c, Func_6435 + ldh a, [hTempCardIndex_ff98] + ldh [hTemp_ffa0], a + or a + ret +.asm_649b + scf + ret +.asm_649d + ldh a, [hCurMenuItem] + add $bb + call GetTurnDuelistVariable + call GetCardIDFromDeckIndex + call LoadCardDataToBuffer1_FromCardID + call OpenCardPage_FromCheckPlayArea + jp Func_6435 +; 0x64b0 + +Func_64b0: ; 64b0 (1:64b0) + call ZeroObjectPositionsAndToggleOAMCopy + call EmptyScreen + call LoadDuelCardSymbolTiles + call LoadDuelCheckPokemonScreenTiles + ld de, wDuelTempList + call SetListPointer + ld a, $ef + call GetTurnDuelistVariable + ld c, a + ld b, $00 +.asm_64ca + push hl + push bc + ld a, b + ld [wHUDEnergyAndHPBarsX], a + ld a, b + add a + add b + ld [wCurPlayAreaY], a + ld a, b + add $bb + call GetTurnDuelistVariable + call SetNextElementOfList + call PrintPlayAreaCardHeader + call PrintPlayAreaCardLocation + call Func_64fc + ld a, [wLoadedCard1Move1Category] + call SetNextElementOfList + pop bc + pop hl + inc b + dec c + jr nz, .asm_64ca + ld a, b + ld [wNumPlayAreaItems], a + call EnableLCD + ret +; 0x64fc + +Func_64fc: ; 64fc (1:64fc) + ld a, [wLoadedCard1Move1Category] + cp $04 + ret nz + ld a, [wCurPlayAreaY] + inc a + ld e, a + ld d, $04 + ld hl, wLoadedCard1Move1Name + call InitTextPrinting_ProcessTextFromPointerToID + ret +; 0x6510 ; display the screen that prompts the player to use the selected card's ; Pokemon Power. Includes the card's information above, and the Pokemon Power's -- cgit v1.2.3 From 69371a26b626705fa38dad21d80476e72a90fdfd Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Mon, 4 Jan 2021 14:14:19 -0500 Subject: Fixed some things --- src/engine/bank01.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index d719d12..bfce1b4 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5694,13 +5694,13 @@ Func_6435: jr z, .asm_649b ld [wSelectedDuelSubMenuItem], a ldh a, [hKeysPressed] - and $08 + and START jr nz, .asm_649d ldh a, [hCurMenuItem] add a ld e, a ld d, $00 - ld hl, $c511 + ld hl, wDuelTempList + 1 add hl, de ld a, [hld] cp $04 @@ -5711,14 +5711,14 @@ Func_6435: ld e, $00 call CopyMoveDataAndDamage_FromDeckIndex call DisplayUsePokemonPowerScreen - ld a, $01 + ld a, EFFECTCMDTYPE_INITIAL_EFFECT_1 call TryExecuteEffectCommandFunction jr nc, .asm_648c - ld hl, $40 + ldtx hl, PokemonPowerSelectNotRequiredText call DrawWideTextBox_WaitForInput jp Func_6435 .asm_648c - ld hl, $3f + ldtx hl, UseThisPokemonPowerText call YesOrNoMenuWithText jp c, Func_6435 ldh a, [hTempCardIndex_ff98] @@ -5730,7 +5730,7 @@ Func_6435: ret .asm_649d ldh a, [hCurMenuItem] - add $bb + add DUELVARS_ARENA_CARD call GetTurnDuelistVariable call GetCardIDFromDeckIndex call LoadCardDataToBuffer1_FromCardID @@ -5780,7 +5780,7 @@ Func_64b0: ; 64b0 (1:64b0) Func_64fc: ; 64fc (1:64fc) ld a, [wLoadedCard1Move1Category] - cp $04 + cp POKEMON_POWER ret nz ld a, [wCurPlayAreaY] inc a -- cgit v1.2.3 From 5443e0b94a6de191bd2b097d922e3f4bccdfaef1 Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Mon, 4 Jan 2021 14:16:19 -0500 Subject: Replaced hexadecimal byte with constant --- src/engine/bank01.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index bfce1b4..773a9a6 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5759,7 +5759,7 @@ Func_64b0: ; 64b0 (1:64b0) add b ld [wCurPlayAreaY], a ld a, b - add $bb + add DUELVARS_ARENA_CARD call GetTurnDuelistVariable call SetNextElementOfList call PrintPlayAreaCardHeader -- cgit v1.2.3 From d895eb0d2e508ecf777698f1c6bd77f088836801 Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Mon, 4 Jan 2021 14:20:36 -0500 Subject: Replaced another hexadecimal byte --- src/engine/bank01.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 773a9a6..6f548e3 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5703,7 +5703,7 @@ Func_6435: ld hl, wDuelTempList + 1 add hl, de ld a, [hld] - cp $04 + cp POKEMON_POWER jr nz, .asm_6447 ld a, [hl] ldh [hTempCardIndex_ff98], a @@ -5785,7 +5785,7 @@ Func_64fc: ; 64fc (1:64fc) ld a, [wCurPlayAreaY] inc a ld e, a - ld d, $04 + ld d, POKEMON_POWER ld hl, wLoadedCard1Move1Name call InitTextPrinting_ProcessTextFromPointerToID ret -- cgit v1.2.3 From 43a2f7484c864b710e9a9b97b760c04ecf909c5e Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Mon, 4 Jan 2021 14:32:53 -0500 Subject: Replaced with LOW constant --- src/engine/bank01.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 6f548e3..53e2ffa 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5745,7 +5745,7 @@ Func_64b0: ; 64b0 (1:64b0) call LoadDuelCheckPokemonScreenTiles ld de, wDuelTempList call SetListPointer - ld a, $ef + ld a, LOW(wPlayerNumberOfPokemonInPlayArea) call GetTurnDuelistVariable ld c, a ld b, $00 -- cgit v1.2.3 From ae562657482209c6a1bc03713270ce51a4982382 Mon Sep 17 00:00:00 2001 From: pinksylveon Date: Thu, 7 Jan 2021 19:17:49 -0500 Subject: Fixed some things --- src/engine/bank01.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 53e2ffa..e92a83a 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -5703,7 +5703,7 @@ Func_6435: ld hl, wDuelTempList + 1 add hl, de ld a, [hld] - cp POKEMON_POWER + cp $04 jr nz, .asm_6447 ld a, [hl] ldh [hTempCardIndex_ff98], a @@ -5745,7 +5745,7 @@ Func_64b0: ; 64b0 (1:64b0) call LoadDuelCheckPokemonScreenTiles ld de, wDuelTempList call SetListPointer - ld a, LOW(wPlayerNumberOfPokemonInPlayArea) + ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA call GetTurnDuelistVariable ld c, a ld b, $00 @@ -5785,7 +5785,7 @@ Func_64fc: ; 64fc (1:64fc) ld a, [wCurPlayAreaY] inc a ld e, a - ld d, POKEMON_POWER + ld d, $04 ld hl, wLoadedCard1Move1Name call InitTextPrinting_ProcessTextFromPointerToID ret -- cgit v1.2.3