From e59cc2b3292f3da336e89ef23b15b234bf469368 Mon Sep 17 00:00:00 2001 From: Zeta_Null Date: Sat, 28 Dec 2024 18:24:03 -0500 Subject: [PATCH] Move type_matchups.asm out of Effect Commands bank to fix size issue --- engine/battle/effect_commands.asm | 26 ++++++++++++++++++++------ gfx/tilesets.asm | 9 --------- main.asm | 5 +++++ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index cba500f..570d664 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -1284,6 +1284,11 @@ INCLUDE "data/battle/critical_hit_chances.asm" INCLUDE "engine/battle/move_effects/triple_kick.asm" +GetNextTypeMatchupsByte: + ld a, BANK(TypeMatchups) + call GetFarByte + ret + BattleCommand_Stab: ; STAB = Same Type Attack Bonus ld a, BATTLE_VARS_MOVE_ANIM @@ -1368,7 +1373,9 @@ BattleCommand_Stab: ld hl, TypeMatchups .TypesLoop: - ld a, [hli] +; ld a, [hli] + call GetNextTypeMatchupsByte + inc hl cp -1 jr z, .end @@ -1386,7 +1393,8 @@ BattleCommand_Stab: .SkipForesightCheck: cp b jr nz, .SkipType - ld a, [hl] +; ld a, [hl] + call GetNextTypeMatchupsByte cp d jr z, .GotMatchup cp e @@ -1491,7 +1499,9 @@ CheckTypeMatchup: ld [wTypeMatchup], a ld hl, TypeMatchups .TypesLoop: - ld a, [hli] +; ld a, [hli] + call GetNextTypeMatchupsByte + inc hl cp -1 jr z, .End cp -2 @@ -1505,7 +1515,9 @@ CheckTypeMatchup: .Next: cp d jr nz, .Nope - ld a, [hli] +; ld a, [hli] + call GetNextTypeMatchupsByte + inc hl cp b jr z, .Yup cp c @@ -1523,7 +1535,9 @@ CheckTypeMatchup: ldh [hDividend + 0], a ldh [hMultiplicand + 0], a ldh [hMultiplicand + 1], a - ld a, [hli] +; ld a, [hli] + call GetNextTypeMatchupsByte + inc hl ldh [hMultiplicand + 2], a ld a, [wTypeMatchup] ldh [hMultiplier], a @@ -1565,7 +1579,7 @@ BattleCommand_ResetTypeMatchup: INCLUDE "engine/battle/ai/switch.asm" -INCLUDE "data/types/type_matchups.asm" +;INCLUDE "data/types/type_matchups.asm" BattleCommand_DamageVariation: ; Modify the damage spread between 85% and 100%. diff --git a/gfx/tilesets.asm b/gfx/tilesets.asm index 9750cc5..9723a37 100644 --- a/gfx/tilesets.asm +++ b/gfx/tilesets.asm @@ -630,15 +630,6 @@ INCLUDE "data/tilesets/lushcave_collision.asm" TilesetLushCaveAttr:: INCBIN "data/tilesets/lushcave_attributes.bin" -TilesetPlayersRoomGFX:: -INCBIN "gfx/tilesets/players_room.2bpp.lz" - -TilesetPlayersRoomMeta:: -INCBIN "data/tilesets/players_room_metatiles.bin" - -TilesetPlayersRoomColl:: -INCLUDE "data/tilesets/players_room_collision.asm" - ; there should be space here, lavender crypt's set is just big SECTION "Tileset Data 16", ROMX diff --git a/main.asm b/main.asm index 7714b23..8291bca 100644 --- a/main.asm +++ b/main.asm @@ -149,6 +149,11 @@ SECTION "Effect Commands", ROMX INCLUDE "engine/battle/effect_commands.asm" +SECTION "Type Matchups", ROMX + +INCLUDE "data/types/type_matchups.asm" + + SECTION "Enemy Trainers", ROMX INCLUDE "engine/battle/ai/items.asm"