diff options
-rwxr-xr-x | data/tm_prices.asm | 2 | ||||
-rw-r--r-- | engine/bank3d/bank3d_battle.asm | 125 | ||||
-rw-r--r-- | engine/bank3d/main.asm | 25 | ||||
-rw-r--r-- | engine/bank3d/random.asm | 4 | ||||
-rwxr-xr-x | engine/battle/core.asm | 114 | ||||
-rw-r--r-- | engine/battle/init_battle_variables.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/focus_energy_effect.asm | 4 | ||||
-rw-r--r-- | engine/battle/moveEffects/heal_effect.asm | 14 | ||||
-rw-r--r-- | engine/battle/moveEffects/mist_effect.asm | 4 | ||||
-rw-r--r-- | engine/battle/moveEffects/one_hit_ko_effect.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/paralyze_effect.asm | 2 | ||||
-rw-r--r-- | engine/battle/moveEffects/pay_day_effect.asm | 4 | ||||
-rw-r--r-- | engine/battle/moveEffects/reflect_light_screen_effect.asm | 12 | ||||
-rw-r--r-- | engine/battle/moveEffects/transform_effect.asm | 6 | ||||
-rwxr-xr-x | engine/give_pokemon.asm | 3 | ||||
-rwxr-xr-x | engine/items/tm_prices.asm | 2 | ||||
-rwxr-xr-x | main.asm | 24 |
17 files changed, 175 insertions, 174 deletions
diff --git a/data/tm_prices.asm b/data/tm_prices.asm index 89fdb8e9..2aa72f28 100755 --- a/data/tm_prices.asm +++ b/data/tm_prices.asm @@ -1,4 +1,4 @@ -TechnicalMachinePrices: ; 7bfa7 (1e:7fa7) +TechnicalMachinePrices: ; f65f5 (3d:65f5) ; In thousands (nybbles). dn 3, 2 ; TM_01, TM_02 dn 2, 1 ; TM_03, TM_04 diff --git a/engine/bank3d/bank3d_battle.asm b/engine/bank3d/bank3d_battle.asm index aef04d9d..2c71a565 100644 --- a/engine/bank3d/bank3d_battle.asm +++ b/engine/bank3d/bank3d_battle.asm @@ -166,4 +166,127 @@ _LoadTrainerPic: ; f615a (3d:615a) ld de, vFrontPic ld a, $77 ld c, a - jp LoadUncompressedSpriteData
\ No newline at end of file + jp LoadUncompressedSpriteData + +LoadMonBackPic: ; f6178 (3d:6178) +; Assumes the monster's attributes have +; been loaded with GetMonHeader. + ld a, [wBattleMonSpecies2] + ld [wcf91], a + hlCoord 1, 5 + ld bc,$708 + call ClearScreenArea + ld hl, W_MONHBACKSPRITE - W_MONHEADER + call UncompressMonSprite + predef ScaleSpriteByTwo + ld de, vBackPic + call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite + ld hl, vSprites + ld de, vBackPic + ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied + ld a, [H_LOADEDROMBANK] + ld b, a + jp CopyVideoData + +Func_f61a6: ; f61a6 (3d:f61a6) + ld a, [wPredefRegisters] + ld h, a + ld a, [wPredefRegisters + 1] + ld l, a + ld a, [$ffe1] + ld [H_DOWNARROWBLINKCNT1], a + ld b, $4c + ld a, [W_ISINBATTLE] + and a + jr z, .asm_f61ef + add b + ld [hl], a + call Delay3 + ld bc, -41 + add hl, bc + ld a, $1 + ld [wcd6c], a + ld bc, $303 + predef Func_79aba + ld c, $4 + call DelayFrames + ld bc, -41 + add hl, bc + xor a + ld [wcd6c], a + ld bc, $505 + predef Func_79aba + ld c, $5 + call DelayFrames + ld bc, -41 + jr .asm_f61f2 +.asm_f61ef + ld bc, -123 +.asm_f61f2 + add hl, bc + ld a, [H_DOWNARROWBLINKCNT1] + add $31 + jr asm_f6203 + +Func_f61f9: ; 3f0c6 (f:70c6) + ld a, [wPredefRegisters] + ld h, a + ld a, [wPredefRegisters + 1] + ld l, a + ld a, [$ffe1] +asm_f6203: ; f6203 (3d:6203) + ld bc, $707 + ld de, $14 + push af + ld a, [W_SPRITEFLIPPED] + and a + jr nz, .asm_f6220 + pop af +.asm_f6211 + push bc + push hl +.asm_f6213 + ld [hl], a + add hl, de + inc a + dec c + jr nz, .asm_f6213 + pop hl + inc hl + pop bc + dec b + jr nz, .asm_f6211 + ret + +.asm_f6220 + push bc + ld b, $0 + dec c + add hl, bc + pop bc + pop af +.asm_f6227 + push bc + push hl +.asm_f6229 + ld [hl], a + add hl, de + inc a + dec c + jr nz, .asm_f6229 + pop hl + dec hl + pop bc + dec b + jr nz, .asm_f6227 + ret + +INCLUDE "engine/battle/init_battle_variables.asm" +INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm" +INCLUDE "engine/battle/moveEffects/heal_effect.asm" +INCLUDE "engine/battle/moveEffects/transform_effect.asm" +INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm" +INCLUDE "engine/battle/moveEffects/mist_effect.asm" +INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm" +INCLUDE "engine/battle/moveEffects/pay_day_effect.asm" +INCLUDE "engine/battle/moveEffects/paralyze_effect.asm"
\ No newline at end of file diff --git a/engine/bank3d/main.asm b/engine/bank3d/main.asm index d5ce0c5e..56aa260e 100644 --- a/engine/bank3d/main.asm +++ b/engine/bank3d/main.asm @@ -624,7 +624,7 @@ Func_f5ea4:: ; f5ea4 (3d:f5ea4) ld de,$0 ret -Func_f5ec1:: ; f5ec1 +Func_f5ec1:: ; f5ec1 (3d:5ec1) call Random cp $66 jr c,.asm_f5ed6 @@ -651,20 +651,11 @@ Pointer_f5eda:: ; f5eda (3d:f5eda) ; ... rest of data TBA SECTION "temp_f5ff2" ROMX[$5ff2],BANK[$3c] -INCLUDE "engine/bank3d/bank3d_battle.asm" -InitBattle:: ; f5ff2 (3d:5ff2) - ld a,[W_CUROPPONENT] - and a - jr z,.asm_f6003 - ld a,[W_CUROPPONENT] - ld [wcf91],a - ld [wEnemyMonSpecies2],a - jr .asm_f601d - ld a,[wd732] - bit 1,a ; debug mode? - jr z,.notdebugmode - ld a,[hJoyHeld] - bit 1,a ; holding b button? - ret nz -
\ No newline at end of file +INCLUDE "engine/bank3d/bank3d_battle.asm" +INCLUDE "engine/items/tm_prices.asm" +INCLUDE "engine/multiply_divide.asm" +INCLUDE "engine/give_pokemon.asm" +INCLUDE "engine/battle/get_trainer_name.asm" +INCLUDE "engine/bank3d/random.asm" +INCLUDE "engine/predefs.asm"
\ No newline at end of file diff --git a/engine/bank3d/random.asm b/engine/bank3d/random.asm index 8c8ead4e..ddf042df 100644 --- a/engine/bank3d/random.asm +++ b/engine/bank3d/random.asm @@ -1,6 +1,4 @@ -SECTION "bank3d Random",ROMX[$67DC],BANK[$3D] - -Random_:: +Random_:: ; f67dc (3d:67dc) ; Generate a random 16-bit value. ld a, [rDIV] ld b, a diff --git a/engine/battle/core.asm b/engine/battle/core.asm index c335eeb3..8775604e 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6822,120 +6822,6 @@ Func_3f069: ; 3f069 (f:7069) ld [wc0f2], a jp PlaySound -Func_3f073: ; 3f073 (f:7073) - ld a, [wPredefRegisters] - ld h, a - ld a, [wPredefRegisters + 1] - ld l, a - ld a, [$ffe1] - ld [H_DOWNARROWBLINKCNT1], a - ld b, $4c - ld a, [W_ISINBATTLE] - and a - jr z, .asm_3f0bc - add b - ld [hl], a - call Delay3 - ld bc, -41 - add hl, bc - ld a, $1 - ld [wcd6c], a - ld bc, $303 - predef Func_79aba - ld c, $4 - call DelayFrames - ld bc, -41 - add hl, bc - xor a - ld [wcd6c], a - ld bc, $505 - predef Func_79aba - ld c, $5 - call DelayFrames - ld bc, -41 - jr .asm_3f0bf -.asm_3f0bc - ld bc, -123 -.asm_3f0bf - add hl, bc - ld a, [H_DOWNARROWBLINKCNT1] - add $31 - jr asm_3f0d0 - -Func_3f0c6: ; 3f0c6 (f:70c6) - ld a, [wPredefRegisters] - ld h, a - ld a, [wPredefRegisters + 1] - ld l, a - ld a, [$ffe1] -asm_3f0d0: ; 3f0d0 (f:70d0) - ld bc, $707 - ld de, $14 - push af - ld a, [W_SPRITEFLIPPED] - and a - jr nz, .asm_3f0ed - pop af -.asm_3f0de - push bc - push hl -.asm_3f0e0 - ld [hl], a - add hl, de - inc a - dec c - jr nz, .asm_3f0e0 - pop hl - inc hl - pop bc - dec b - jr nz, .asm_3f0de - ret - -.asm_3f0ed - push bc - ld b, $0 - dec c - add hl, bc - pop bc - pop af -.asm_3f0f4 - push bc - push hl -.asm_3f0f6 - ld [hl], a - add hl, de - inc a - dec c - jr nz, .asm_3f0f6 - pop hl - dec hl - pop bc - dec b - jr nz, .asm_3f0f4 - ret - -LoadMonBackPic: ; 3f103 (f:7103) -; Assumes the monster's attributes have -; been loaded with GetMonHeader. - ld a, [wBattleMonSpecies2] - ld [wcf91], a - hlCoord 1, 5 - ld b, $7 - ld c, $8 - call ClearScreenArea - ld hl, W_MONHBACKSPRITE - W_MONHEADER - call UncompressMonSprite - predef ScaleSpriteByTwo - ld de, vBackPic - call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite - ld hl, vSprites - ld de, vBackPic - ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied - ld a, [H_LOADEDROMBANK] - ld b, a - jp CopyVideoData - JumpMoveEffect: ; 3f132 (f:7132) call _JumpMoveEffect ld b, $1 diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 457cc4e1..94d964e8 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,4 +1,4 @@ -InitBattleVariables: ; 525af (14:65af) +InitBattleVariables: ; f6236 (3d:6236) ld a, [hTilesetType] ld [wd0d4], a xor a diff --git a/engine/battle/moveEffects/focus_energy_effect.asm b/engine/battle/moveEffects/focus_energy_effect.asm index f01e61cc..0089c8b1 100644 --- a/engine/battle/moveEffects/focus_energy_effect.asm +++ b/engine/battle/moveEffects/focus_energy_effect.asm @@ -1,4 +1,4 @@ -FocusEnergyEffect_: ; 27f86 (9:7f86) +FocusEnergyEffect_: ; f628b (3d:628b) ld hl, W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] and a @@ -18,7 +18,7 @@ FocusEnergyEffect_: ; 27f86 (9:7f86) ld b, BANK(PrintButItFailedText_) jp Bankswitch -GettingPumpedText: ; 27fb3 (9:7fb3) +GettingPumpedText: ; f62b5 (3d:62b5) db $0a TX_FAR _GettingPumpedText db "@" diff --git a/engine/battle/moveEffects/heal_effect.asm b/engine/battle/moveEffects/heal_effect.asm index 862917f7..d6d4e183 100644 --- a/engine/battle/moveEffects/heal_effect.asm +++ b/engine/battle/moveEffects/heal_effect.asm @@ -1,4 +1,4 @@ -HealEffect_: ; 3b9ec (e:79ec) +HealEffect_: ; f62ba (3d:62ba) ld a, [H_WHOSETURN] and a ld de, wBattleMonHP @@ -86,7 +86,7 @@ HealEffect_: ; 3b9ec (e:79ec) ld [wHPBarNewHP], a .playAnim ld hl, PlayCurrentMoveAnimation - call BankswitchEtoF + call Bankswitch3DtoF ld a, [H_WHOSETURN] and a hlCoord 10, 9 @@ -98,23 +98,23 @@ HealEffect_: ; 3b9ec (e:79ec) ld [wHPBarType], a predef UpdateHPBar2 ld hl, DrawHUDsAndHPBars - call BankswitchEtoF + call Bankswitch3DtoF ld hl, RegainedHealthText jp PrintText .failed ld c, 50 call DelayFrames ld hl, PrintButItFailedText_ - jp BankswitchEtoF + jp Bankswitch3DtoF -StartedSleepingEffect: ; 3baa2 (e:7aa2) +StartedSleepingEffect: ; f6370 (3d:6370) TX_FAR _StartedSleepingEffect db "@" -FellAsleepBecameHealthyText: ; 3baa7 (e:7aa7) +FellAsleepBecameHealthyText: ; f6375 (3d:6375) TX_FAR _FellAsleepBecameHealthyText db "@" -RegainedHealthText: ; 3baac (e:7aac) +RegainedHealthText: ; f637a (3d:637a) TX_FAR _RegainedHealthText db "@" diff --git a/engine/battle/moveEffects/mist_effect.asm b/engine/battle/moveEffects/mist_effect.asm index 8394eec1..ed06d16c 100644 --- a/engine/battle/moveEffects/mist_effect.asm +++ b/engine/battle/moveEffects/mist_effect.asm @@ -1,4 +1,4 @@ -MistEffect_: ; 33f2b (c:7f2b) +MistEffect_: ; f64ac (3d:64ac) ld hl, W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] and a @@ -16,6 +16,6 @@ MistEffect_: ; 33f2b (c:7f2b) ld b, BANK(PrintButItFailedText_) jp Bankswitch -ShroudedInMistText: ; 33f52 (c:7f52) +ShroudedInMistText: ; f64d3 (3d:64d3) TX_FAR _ShroudedInMistText db "@" diff --git a/engine/battle/moveEffects/one_hit_ko_effect.asm b/engine/battle/moveEffects/one_hit_ko_effect.asm index cc0eca7b..f859f9c4 100644 --- a/engine/battle/moveEffects/one_hit_ko_effect.asm +++ b/engine/battle/moveEffects/one_hit_ko_effect.asm @@ -1,4 +1,4 @@ -OneHitKOEffect_: ; 33f57 (c:7f57) +OneHitKOEffect_: ; f64db (3d:64db) ld hl, W_DAMAGE xor a ld [hli], a diff --git a/engine/battle/moveEffects/paralyze_effect.asm b/engine/battle/moveEffects/paralyze_effect.asm index 69acbb01..74a7319d 100644 --- a/engine/battle/moveEffects/paralyze_effect.asm +++ b/engine/battle/moveEffects/paralyze_effect.asm @@ -1,4 +1,4 @@ -ParalyzeEffect_: ; 52601 (14:6601) +ParalyzeEffect_: ; f6562 (3d:6562) ld hl, wEnemyMonStatus ld de, W_PLAYERMOVETYPE ld a, [H_WHOSETURN] diff --git a/engine/battle/moveEffects/pay_day_effect.asm b/engine/battle/moveEffects/pay_day_effect.asm index fc937d1b..1fab9771 100644 --- a/engine/battle/moveEffects/pay_day_effect.asm +++ b/engine/battle/moveEffects/pay_day_effect.asm @@ -1,4 +1,4 @@ -PayDayEffect_ ; 2feb8 (b:7eb8) +PayDayEffect_ ; f6511 (3d:6511) xor a ld hl, wcd6d ld [hli], a @@ -40,6 +40,6 @@ PayDayEffect_ ; 2feb8 (b:7eb8) ld hl, CoinsScatteredText jp PrintText -CoinsScatteredText: ; 2ff04 (b:7f04) +CoinsScatteredText: ; f655d (3d:655d) TX_FAR _CoinsScatteredText db "@" diff --git a/engine/battle/moveEffects/reflect_light_screen_effect.asm b/engine/battle/moveEffects/reflect_light_screen_effect.asm index 7da98699..c12c6018 100644 --- a/engine/battle/moveEffects/reflect_light_screen_effect.asm +++ b/engine/battle/moveEffects/reflect_light_screen_effect.asm @@ -1,4 +1,4 @@ -ReflectLightScreenEffect_: ; 3bb97 (e:7b97) +ReflectLightScreenEffect_: ; f645d (3d:645d) ld hl, W_PLAYERBATTSTATUS3 ld de, W_PLAYERMOVEEFFECT ld a, [H_WHOSETURN] @@ -23,23 +23,23 @@ ReflectLightScreenEffect_: ; 3bb97 (e:7b97) .playAnim push hl ld hl, PlayCurrentMoveAnimation - call BankswitchEtoF + call Bankswitch3DtoF pop hl jp PrintText .moveFailed ld c, $32 call DelayFrames ld hl, PrintButItFailedText_ - jp BankswitchEtoF + jp Bankswitch3DtoF -LightScreenProtectedText: ; 3bbd7 (e:7bd7) +LightScreenProtectedText: ; f649d (3d:649d) TX_FAR _LightScreenProtectedText db "@" -ReflectGainedArmorText: ; 3bbdc (e:7bdc) +ReflectGainedArmorText: ; f64a2 (3d:64a2) TX_FAR _ReflectGainedArmorText db "@" -BankswitchEtoF: ; 3bbe1 (e:7be1) +Bankswitch3DtoF: ; f64a7 (3d:64a7) ld b, BANK(BattleCore) jp Bankswitch diff --git a/engine/battle/moveEffects/transform_effect.asm b/engine/battle/moveEffects/transform_effect.asm index 6504bf03..5e0e6b07 100644 --- a/engine/battle/moveEffects/transform_effect.asm +++ b/engine/battle/moveEffects/transform_effect.asm @@ -1,4 +1,4 @@ -TransformEffect_: ; 3bab1 (e:7ab1) +TransformEffect_: ; f637f (3d:637f) ld hl, wBattleMonSpecies ld de, wEnemyMonSpecies ld bc, W_ENEMYBATTSTATUS3 @@ -141,8 +141,8 @@ TransformEffect_: ; 3bab1 (e:7ab1) .failed ld hl, PrintButItFailedText_ - jp BankswitchEtoF + jp Bankswitch3DtoF -TransformedText: ; 3bb92 (e:7b92) +TransformedText: ; f6458 (3d:6458) TX_FAR _TransformedText db "@" diff --git a/engine/give_pokemon.asm b/engine/give_pokemon.asm index 64876d22..8610d06a 100755 --- a/engine/give_pokemon.asm +++ b/engine/give_pokemon.asm @@ -65,6 +65,9 @@ SetPokedexOwnedFlag: ; 4fe11 (13:7e11) ld hl, GotMonText jp PrintText +UnknownTerminator_f6794: ; f6794 (3d:6794) + db "@" + GotMonText: ; 4fe39 (13:7e39) TX_FAR _GotMonText db $0b diff --git a/engine/items/tm_prices.asm b/engine/items/tm_prices.asm index 7c5c56fa..ccc5fc5a 100755 --- a/engine/items/tm_prices.asm +++ b/engine/items/tm_prices.asm @@ -1,4 +1,4 @@ -GetMachinePrice: ; 7bf86 (1e:7f86) +GetMachinePrice: ; f65d4 (3d:65d4) ; Input: [wcf91] = Item Id of a TM ; Output: Stores the 2-byte TM price in [H_DOWNARROWBLINKCNT1] and [H_DOWNARROWBLINKCNT2] ; as a BCD @@ -4955,7 +4955,7 @@ TangelaPicBack:: INCBIN "pic/monback/tangelab.pic" SECTION "Battle (bank 9)", ROMX, BANK[$9] INCLUDE "engine/battle/print_type.asm" INCLUDE "engine/battle/save_trainer_name.asm" -INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm" +;INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm" SECTION "Pics 2", ROMX, BANK[PICS_2] @@ -5185,8 +5185,8 @@ OldManPic:: INCBIN "pic/trainer/oldman.pic" SECTION "Battle (bank C)", ROMX, BANK[$C] -INCLUDE "engine/battle/moveEffects/mist_effect.asm" -INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm" +;INCLUDE "engine/battle/moveEffects/mist_effect.asm" +;INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm" SECTION "Pics 5", ROMX, BANK[PICS_5] @@ -5253,7 +5253,7 @@ INCLUDE "engine/titlescreen2.asm" ;INCLUDE "engine/battle/link_battle_versus_text.asm" INCLUDE "engine/slot_machine.asm" INCLUDE "engine/overworld/pewter_guys.asm" -INCLUDE "engine/multiply_divide.asm" +;INCLUDE "engine/multiply_divide.asm" INCLUDE "engine/game_corner_slots.asm" @@ -5276,9 +5276,9 @@ TradingAnimationGraphics2: INCBIN "gfx/trade2.2bpp" INCLUDE "engine/evos_moves.asm" -INCLUDE "engine/battle/moveEffects/heal_effect.asm" -INCLUDE "engine/battle/moveEffects/transform_effect.asm" -INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm" +;INCLUDE "engine/battle/moveEffects/heal_effect.asm" +;INCLUDE "engine/battle/moveEffects/transform_effect.asm" +;INCLUDE "engine/battle/moveEffects/reflect_light_screen_effect.asm" SECTION "bankF",ROMX,BANK[$F] @@ -5679,9 +5679,9 @@ INCLUDE "scripts/tradecenterm.asm" INCLUDE "data/mapObjects/tradecenterm.asm" TradeCenterMBlocks: INCBIN "maps/tradecenterm.blk" -INCLUDE "engine/give_pokemon.asm" +;INCLUDE "engine/give_pokemon.asm" -INCLUDE "engine/predefs.asm" +;INCLUDE "engine/predefs.asm" SECTION "bank14",ROMX,BANK[$14] @@ -5752,8 +5752,8 @@ INCLUDE "scripts/mansion4.asm" INCLUDE "data/mapObjects/mansion4.asm" Mansion4Blocks: INCBIN "maps/mansion4.blk" -INCLUDE "engine/battle/init_battle_variables.asm" -INCLUDE "engine/battle/moveEffects/paralyze_effect.asm" +;INCLUDE "engine/battle/init_battle_variables.asm" +;INCLUDE "engine/battle/moveEffects/paralyze_effect.asm" INCLUDE "engine/overworld/card_key.asm" @@ -6468,7 +6468,7 @@ INCLUDE "engine/evolution.asm" INCLUDE "engine/overworld/elevator.asm" -INCLUDE "engine/items/tm_prices.asm" +;INCLUDE "engine/items/tm_prices.asm" SECTION "bank3c",ROMX,BANK[$3C] |