diff options
author | dannye <corrnondacqb@yahoo.com> | 2015-08-09 23:56:20 -0500 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2015-08-09 23:56:20 -0500 |
commit | 8a6d46f3d9ba4fb6939eb9ea9949f47aa8608d4a (patch) | |
tree | c369228491bdaca750da4a24baa3190836320710 | |
parent | f8a9c37a0019eb085c22c6e3ae53b16ff0cd4f6a (diff) |
Replace some hardcoded data sizes
34 files changed, 120 insertions, 82 deletions
diff --git a/data/evos_moves.asm b/data/evos_moves.asm index cdbec0d8..a2ef5478 100755 --- a/data/evos_moves.asm +++ b/data/evos_moves.asm @@ -1262,6 +1262,7 @@ Mon133_EvosMoves: ; 3b644 (e:7644) db EV_ITEM,THUNDER_STONE ,1,JOLTEON db EV_ITEM,WATER_STONE ,1,VAPOREON db 0 +Mon133_EvosEnd: ;Learnset db 27,QUICK_ATTACK db 31,TAIL_WHIP diff --git a/data/moves.asm b/data/moves.asm index 22165b7d..44859681 100755 --- a/data/moves.asm +++ b/data/moves.asm @@ -11,6 +11,7 @@ move: macro endm move POUND, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35 +MoveEnd: move KARATE_CHOP, NO_ADDITIONAL_EFFECT, 50, NORMAL, 100, 25 move DOUBLESLAP, TWO_TO_FIVE_ATTACKS_EFFECT, 15, NORMAL, 85, 10 move COMET_PUNCH, TWO_TO_FIVE_ATTACKS_EFFECT, 18, NORMAL, 85, 15 diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm index 704fea16..e00fc57d 100755 --- a/engine/HoF_room_pc.asm +++ b/engine/HoF_room_pc.asm @@ -246,7 +246,7 @@ Credits: ; 7418e (1d:418e) pop de ld de, TheEndGfx ld hl, vChars2 + $600 - lb bc, BANK(TheEndGfx), $0a + lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 call CopyVideoData coord hl, 4, 8 ld de, TheEndTextString @@ -267,3 +267,4 @@ INCLUDE "text/credits_text.asm" TheEndGfx: ; 7473e (1d:473e) (7473f on blue) INCBIN "gfx/theend.interleave.2bpp" +TheEndGfxEnd: diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index e9e247f9..8f57777c 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -184,11 +184,12 @@ DungeonMaps2: ; 70a44 (1c:4a44) LoadBattleTransitionTile: ; 70a4d (1c:4a4d) ld hl, vChars1 + $7f0 ld de, BattleTransitionTile - lb bc, BANK(BattleTransitionTile), $01 + lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10 jp CopyVideoData BattleTransitionTile: ; 70a59 (1c:4a59) INCBIN "gfx/battle_transition.2bpp" +BattleTransitionTileEnd: BattleTransition_BlackScreen: ; 70a69 (1c:4a69) ld a, $ff diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 65549f7b..ee93023f 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2394,7 +2394,7 @@ PartyMenuOrRockOrRun: jp DisplayBattleMenu .partyMonDeselected coord hl, 11, 11 - ld bc, $81 + ld bc, 6 * SCREEN_WIDTH + 9 ld a, " " call FillMemory xor a ; NORMAL_PARTY_MENU @@ -5194,7 +5194,7 @@ ReloadMoveData: ; 3e329 (f:6329) ld [wd11e],a dec a ld hl,Moves - ld bc,$0006 + ld bc,MoveEnd - Moves call AddNTimes ld a,BANK(Moves) call FarCopyData ; copy the move's stats @@ -6170,7 +6170,7 @@ GetCurrentMove: ; 3eabe (f:6abe) ld [wd0b5], a dec a ld hl, Moves - ld bc, $6 + ld bc, MoveEnd - Moves call AddNTimes ld a, BANK(Moves) call FarCopyData @@ -6707,22 +6707,22 @@ LoadHudTilePatterns: ; 3ee5b (f:6e5b) .lcdDisabled ld hl, BattleHudTiles1 ld de, vChars2 + $6d0 - ld bc, $18 + ld bc, BattleHudTiles1End - BattleHudTiles1 ld a, BANK(BattleHudTiles1) call FarCopyDataDouble ld hl, BattleHudTiles2 ld de, vChars2 + $730 - ld bc, $30 + ld bc, BattleHudTiles3End - BattleHudTiles2 ld a, BANK(BattleHudTiles2) jp FarCopyDataDouble .lcdEnabled ld de, BattleHudTiles1 ld hl, vChars2 + $6d0 - lb bc, BANK(BattleHudTiles1), $03 + lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 call CopyVideoDataDouble ld de, BattleHudTiles2 ld hl, vChars2 + $730 - lb bc, BANK(BattleHudTiles2), $06 + lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 jp CopyVideoDataDouble PrintEmptyString: ; 3ee94 (f:6e94) diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 7198d984..c1387b7b 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -13,7 +13,7 @@ DrawEnemyPokeballs: ; 3a857 (e:6857) LoadPartyPokeballGfx: ; 3a85d (e:685d) ld de, PokeballTileGraphics ld hl, vSprites + $310 - lb bc, BANK(PokeballTileGraphics), $04 + lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 jp CopyVideoData SetupOwnPartyPokeballs: ; 3a869 (e:6869) @@ -189,3 +189,4 @@ SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948) ; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon) PokeballTileGraphics:: ; 3a97e (e:697e) INCBIN "gfx/pokeball.2bpp" +PokeballTileGraphicsEnd: diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 9102b2d8..08205048 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -264,7 +264,7 @@ ReadMove: ; 39884 (e:5884) push bc dec a ld hl,Moves - ld bc,6 + ld bc,MoveEnd - Moves call AddNTimes ld de,W_ENEMYMOVENUM call CopyData diff --git a/engine/cable_club.asm b/engine/cable_club.asm index 07284d13..88e85e8b 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -598,7 +598,7 @@ ReturnToCableClubRoom: ; 577d (1:577d) TradeCenter_DrawCancelBox: coord hl, 11, 15 ld a, $7e - ld bc, 2 * 20 + 9 + ld bc, 2 * SCREEN_WIDTH + 9 call FillMemory coord hl, 0, 15 ld b, 1 @@ -614,7 +614,7 @@ CancelTextString: TradeCenter_PlaceSelectedEnemyMonMenuCursor: ld a, [wSerialSyncAndExchangeNybbleReceiveData] coord hl, 1, 9 - ld bc, 20 + ld bc, SCREEN_WIDTH call AddNTimes ld [hl], $ec ; cursor ret diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 16e893e5..4e55cdea 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -479,7 +479,7 @@ WriteMonMoves: ; 3afb8 (e:6fb8) push hl dec a ld hl, Moves - ld bc, 6 + ld bc, MoveEnd - Moves call AddNTimes ld de, wBuffer ld a, BANK(Moves) diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index 73e4f074..fa8faebc 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -13,15 +13,15 @@ LoadShootingStarGraphics: ; 70000 (1c:4000) call CopyVideoData ld de, FallingStar ld hl, vChars1 + $220 - lb bc, BANK(FallingStar), $01 + lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 call CopyVideoData ld hl, GameFreakLogoOAMData ld de, wOAMBuffer + $60 - ld bc, $40 + ld bc, GameFreakLogoOAMDataEnd - GameFreakLogoOAMData call CopyData ld hl, GameFreakShootingStarOAMData ld de, wOAMBuffer - ld bc, $10 + ld bc, GameFreakShootingStarOAMDataEnd - GameFreakShootingStarOAMData jp CopyData AnimateShootingStar: ; 70044 (1c:4044) @@ -88,7 +88,7 @@ AnimateShootingStar: ; 70044 (1c:4044) .initSmallStarsOAMLoop push af ld hl, SmallStarsOAM - ld bc, 4 + ld bc, SmallStarsOAMEnd - SmallStarsOAM call CopyData pop af dec a @@ -147,6 +147,7 @@ AnimateShootingStar: ; 70044 (1c:4044) SmallStarsOAM: ; 700ee (1c:40ee) db $00,$00,$A2,$90 +SmallStarsOAMEnd: SmallStarsWaveCoordsPointerTable: ; 700f2 (1c:40f2) dw SmallStarsWave1Coords @@ -229,12 +230,15 @@ GameFreakLogoOAMData: ; 70140 (1c:4140) db $60,$68,$83,$00 db $60,$70,$81,$00 db $60,$78,$86,$00 +GameFreakLogoOAMDataEnd: GameFreakShootingStarOAMData: ; 70180 (1c:4180) db $00,$A0,$A0,$10 db $00,$A8,$A0,$30 db $08,$A0,$A1,$10 db $08,$A8,$A1,$30 +GameFreakShootingStarOAMDataEnd: FallingStar: ; 70190 (1c:4190) INCBIN "gfx/falling_star.2bpp" +FallingStarEnd: diff --git a/engine/intro.asm b/engine/intro.asm index 154c41fd..636b4af5 100755 --- a/engine/intro.asm +++ b/engine/intro.asm @@ -278,22 +278,22 @@ PlayMoveSoundB: ; 41849 (10:5849) LoadIntroGraphics: ; 41852 (10:5852) ld hl, FightIntroBackMon ld de, vChars2 - ld bc, $600 + ld bc, FightIntroBackMonEnd - FightIntroBackMon ld a, BANK(FightIntroBackMon) call FarCopyData2 ld hl, GameFreakIntro ld de, vChars2 + $600 - ld bc, $140 + ld bc, GameFreakIntroEnd - GameFreakIntro ld a, BANK(GameFreakIntro) call FarCopyData2 ld hl, GameFreakIntro ld de, vChars1 - ld bc, $140 + ld bc, GameFreakIntroEnd - GameFreakIntro ld a, BANK(GameFreakIntro) call FarCopyData2 ld hl, FightIntroFrontMon ld de, vChars0 - ld bc, $6c0 + ld bc, FightIntroFrontMonEnd - FightIntroFrontMon ld a, BANK(FightIntroFrontMon) jp FarCopyData2 @@ -430,9 +430,11 @@ GameFreakIntro: ; 41959 (10:5959) INCBIN "gfx/gamefreak_intro.2bpp" INCBIN "gfx/gamefreak_logo.2bpp" ds $10 ; blank tile +GameFreakIntroEnd: FightIntroBackMon: ; 41a99 (10:5a99) INCBIN "gfx/intro_fight.2bpp" +FightIntroBackMonEnd: FightIntroFrontMon: ; 42099 (10:6099) @@ -440,11 +442,13 @@ IF DEF(_RED) INCBIN "gfx/red/intro_nido_1.6x6.2bpp" INCBIN "gfx/red/intro_nido_2.6x6.2bpp" INCBIN "gfx/red/intro_nido_3.6x6.2bpp" - ds $10 ; blank tile ENDC IF DEF(_BLUE) INCBIN "gfx/blue/intro_purin_1.6x6.2bpp" INCBIN "gfx/blue/intro_purin_2.6x6.2bpp" INCBIN "gfx/blue/intro_purin_3.6x6.2bpp" - ds $10 ; blank tile ENDC + +FightIntroFrontMonEnd: + + ds $10 ; blank tile diff --git a/engine/items/items.asm b/engine/items/items.asm index 364570da..bae86ddb 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -912,7 +912,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld [wHPBarNewHP+1],a coord hl, 4, 1 ld a,[wWhichPokemon] - ld bc,2 * 20 + ld bc,2 * SCREEN_WIDTH call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled ld a,SFX_HEAL_HP call PlaySoundWaitForCurrent @@ -1937,7 +1937,7 @@ ItemUsePPRestore: ; e31e (3:631e) cp b ; is the pokemon whose PP was restored active in battle? jr nz,.skipUpdatingInBattleData ld hl,wPartyMon1PP - ld bc,44 + ld bc,wPartyMon2 - wPartyMon1 call AddNTimes ld de,wBattleMonPP ld bc,4 @@ -2289,7 +2289,7 @@ GotOffBicycleText: ; e5fc (3:65fc) ; [wCurrentMenuItem] = index of move (when using a PP Up) RestoreBonusPP: ; e606 (3:6606) ld hl,wPartyMon1Moves - ld bc,44 + ld bc,wPartyMon2 - wPartyMon1 ld a,[wWhichPokemon] call AddNTimes push hl @@ -2407,7 +2407,7 @@ GetMaxPP: ; e677 (3:6677) dec a push hl ld hl,Moves - ld bc,6 + ld bc,MoveEnd - Moves call AddNTimes ld de,wcd6d ld a,BANK(Moves) diff --git a/engine/learn_move.asm b/engine/learn_move.asm index 88dedd3d..02459b20 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -44,7 +44,7 @@ DontAbandonLearning: ; 6e5b (1:6e5b) push de dec a ld hl, Moves - ld bc, $6 + ld bc, MoveEnd - Moves call AddNTimes ld de, wBuffer ld a, BANK(Moves) diff --git a/engine/load_pokedex_tiles.asm b/engine/load_pokedex_tiles.asm index f4e45247..1189d2f0 100755 --- a/engine/load_pokedex_tiles.asm +++ b/engine/load_pokedex_tiles.asm @@ -3,7 +3,7 @@ LoadPokedexTilePatterns: ; 17840 (5:7840) call LoadHpBarAndStatusTilePatterns ld de,PokedexTileGraphics ld hl,vChars2 + $600 - lb bc, BANK(PokedexTileGraphics), $12 + lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 call CopyVideoData ld de,PokeballTileGraphics ld hl,vChars2 + $720 diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index 967f11e8..e64a4bee 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -326,11 +326,14 @@ DisplayNamingScreen: ; 6596 (1:6596) LoadEDTile: ; 675b (1:675b) ld de, ED_Tile ld hl, vFont + $700 - ld bc, $1 + ld bc, (ED_TileEnd - ED_Tile) / $8 + ; to fix the graphical bug on poor emulators + ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 jp CopyVideoDataDouble ED_Tile: ; 6767 (1:6767) INCBIN "gfx/ED_tile.1bpp" +ED_TileEnd: PrintAlphabet: ; 676f (1:676f) xor a diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index 42ab553a..d83c4fbe 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -150,7 +150,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld l,a ld de,wcd6d ld a,BANK(EvosMovesPointerTable) - ld bc,13 + ld bc,Mon133_EvosEnd - Mon133_EvosMoves call FarCopyData ld hl,wcd6d ld de,.notAbleToEvolveText diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index f061fbf6..110da50d 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -611,7 +611,7 @@ DrawTrainerInfo: ; 1349a (4:749a) jp PrintNumber TrainerInfo_FarCopyData: ; 1357f (4:757f) - ld a,$0b + ld a,BANK(TrainerInfoTextBoxTileGraphics) jp FarCopyData2 TrainerInfo_NameMoneyTimeText: ; 13584 (4:7584) diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index d8a504bb..c959400a 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -99,7 +99,7 @@ StatusScreen: ; 12953 (4:6953) call CopyVideoDataDouble ; ─┘ ld de, PTile ld hl, vChars2 + $720 - lb bc, BANK(PTile), $01 + lb bc, BANK(PTile), (PTileEnd - PTile) / $8 call CopyVideoDataDouble ; P (for PP), inline ld a, [hTilesetType] push af @@ -242,6 +242,7 @@ DrawLineBox: ; 0x12ac7 PTile: ; 12adc (4:6adc) ; This is a single 1bpp "P" tile INCBIN "gfx/p_tile.1bpp" +PTileEnd: PrintStatsBox: ; 12ae4 (4:6ae4) ld a, d diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index ebd441aa..f8665dd6 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -9,7 +9,7 @@ EmotionBubble: ; 17c47 (5:7c47) inc hl ld d, [hl] ld hl, vChars1 + $780 - lb bc, BANK(EmotionBubblesPointerTable), $04 + lb bc, BANK(EmotionBubbles), $04 call CopyVideoData ld a, [wUpdateSpritesEnabled] push af diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index d3513b0d..3ab41d5f 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,7 +1,7 @@ AnimateHealingMachine: ; 70433 (1c:4433) ld de, PokeCenterFlashingMonitorAndHealBall ld hl, vChars0 + $7c0 - lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 + lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles call CopyVideoData ld hl, wUpdateSpritesEnabled ld a, [hl] diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 5a3bfbe0..df4273fd 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -69,7 +69,7 @@ LedgeTiles: ; 1a6cf (6:66cf) LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) ld hl, vChars1 + $7f0 ld de, LedgeHoppingShadow - lb bc, BANK(LedgeHoppingShadow), $01 + lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble ld a, $9 lb bc, $54, $48 ; b, c = y, x coordinates of shadow @@ -79,6 +79,7 @@ LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) LedgeHoppingShadow: ; 1a708 (6:6708) INCBIN "gfx/ledge_hopping_shadow.1bpp" +LedgeHoppingShadowEnd: LedgeHoppingShadowOAM: ; 1a710 (6:6710) db $FF,$10,$FF,$20 diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index 1dccd026..e631bbfa 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -85,8 +85,9 @@ LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0) LoadSmokeTile: ; 79fd4 (1e:5fd4) ld de, SSAnneSmokePuffTile - lb bc, BANK(SSAnneSmokePuffTile), $01 + lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10 jp CopyVideoData SSAnneSmokePuffTile: ; 79fdd (1e:5fdd) INCBIN "gfx/ss_anne_smoke_puff.2bpp" +SSAnneSmokePuffTileEnd: diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index df47275b..fea179d6 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -56,15 +56,8 @@ DisplayTitleScreen: ; 42dd (1:42dd) ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; second chunk ld hl, Version_GFX -IF DEF(_RED) - ld de,vChars2 + $600 - ld bc,$50 -ENDC -IF DEF(_BLUE) - ld de,vChars2 + $600 + $10 - ld bc,$50 - $10 -ENDC - + ld de,vChars2 + $600 - (Version_GFXEnd - Version_GFX - $50) + ld bc, Version_GFXEnd - Version_GFX ld a, BANK(Version_GFX) call FarCopyDataDouble call ClearBothBGMaps @@ -317,7 +310,7 @@ ScrollTitleScreenGameVersion: ; 44cf (1:44cf) DrawPlayerCharacter: ; 44dd (1:44dd) ld hl, PlayerCharacterTitleGraphics ld de, vSprites - ld bc, $230 + ld bc, PlayerCharacterTitleGraphicsEnd - PlayerCharacterTitleGraphics ld a, BANK(PlayerCharacterTitleGraphics) call FarCopyData2 call ClearSprites @@ -377,7 +370,7 @@ LoadCopyrightAndTextBoxTiles: ; 4538 (1:4538) LoadCopyrightTiles: ; 4541 (1:4541) ld de, NintendoCopyrightLogoGraphics ld hl, vChars2 + $600 - lb bc, BANK(NintendoCopyrightLogoGraphics), $1c + lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 call CopyVideoData coord hl, 2, 7 ld de, CopyrightTextString diff --git a/engine/town_map.asm b/engine/town_map.asm index 037a59fa..414b6509 100755 --- a/engine/town_map.asm +++ b/engine/town_map.asm @@ -20,7 +20,7 @@ DisplayTownMap: ; 70e3e (1c:4e3e) call CopyData ld hl, vSprites + $40 ld de, TownMapCursor - lb bc, BANK(TownMapCursor), $04 + lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 call CopyVideoDataDouble xor a ld [wWhichTownMapLocation], a @@ -107,6 +107,7 @@ INCLUDE "data/town_map_order.asm" TownMapCursor: ; 70f40 (1c:4f40) INCBIN "gfx/town_map_cursor.1bpp" +TownMapCursorEnd: LoadTownMap_Nest: ; 70f60 (1c:4f60) call LoadTownMap @@ -144,7 +145,7 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) call CopyVideoData ld de, TownMapUpArrow ld hl, vChars1 + $6d0 - lb bc, BANK(TownMapUpArrow), $01 + lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 call CopyVideoDataDouble call BuildFlyLocationsList ld hl, wUpdateSpritesEnabled @@ -271,6 +272,7 @@ BuildFlyLocationsList: ; 71070 (1c:5070) TownMapUpArrow: ; 71093 (1c:5093) INCBIN "gfx/up_arrow.1bpp" +TownMapUpArrowEnd: LoadTownMap: ; 7109b (1c:509b) call GBPalWhiteOutWithDelay3 @@ -283,12 +285,12 @@ LoadTownMap: ; 7109b (1c:509b) call DisableLCD ld hl, WorldMapTileGraphics ld de, vChars2 + $600 - ld bc, $100 + ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics ld a, BANK(WorldMapTileGraphics) call FarCopyData2 ld hl, MonNestIcon ld de, vSprites + $40 - ld bc, $8 + ld bc, MonNestIconEnd - MonNestIcon ld a, BANK(MonNestIcon) call FarCopyDataDouble coord hl, 0, 0 @@ -582,6 +584,7 @@ INCLUDE "text/map_names.asm" MonNestIcon: ; 716be (1c:56be) INCBIN "gfx/mon_nest_icon.1bpp" +MonNestIconEnd: TownMapSpriteBlinkingAnimation: ; 716c6 (1c:56c6) ld a, [wAnimCounter] diff --git a/engine/trade.asm b/engine/trade.asm index 1a0e5f61..6e825fe5 100755 --- a/engine/trade.asm +++ b/engine/trade.asm @@ -149,7 +149,7 @@ Trade_Delay80: ; 41191 (10:5191) Trade_ClearTileMap: ; 41196 (10:5196) coord hl, 0, 0 - ld bc, 20 * 18 + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, " " jp FillMemory @@ -158,12 +158,12 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1) call DisableLCD ld hl, TradingAnimationGraphics ld de, vChars2 + $310 - ld bc, $310 + ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics ld a, BANK(TradingAnimationGraphics) call FarCopyData2 ld hl, TradingAnimationGraphics2 ld de, vSprites + $7c0 - ld bc, $40 + ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2 ld a, BANK(TradingAnimationGraphics2) call FarCopyData2 ld hl, vBGMap0 @@ -190,7 +190,7 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1) call GetMonName ld hl, wcd6d ld de, wcf4b - ld bc, $b + ld bc, 11 call CopyData ld a, [wTradedEnemyMonSpecies] ld [wd11e], a @@ -3092,13 +3092,13 @@ LoadFontTilePatterns:: .off ld hl, FontGraphics ld de, vFont - ld bc, $400 + ld bc, FontGraphicsEnd - FontGraphics ld a, BANK(FontGraphics) jp FarCopyDataDouble ; if LCD is off, transfer all at once .on ld de, FontGraphics ld hl, vFont - lb bc, BANK(FontGraphics), $80 + lb bc, BANK(FontGraphics), (FontGraphicsEnd - FontGraphics) / $8 jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank LoadTextBoxTilePatterns:: @@ -3108,13 +3108,13 @@ LoadTextBoxTilePatterns:: .off ld hl, TextBoxGraphics ld de, vChars2 + $600 - ld bc, $200 + ld bc, TextBoxGraphicsEnd - TextBoxGraphics ld a, BANK(TextBoxGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, TextBoxGraphics ld hl, vChars2 + $600 - lb bc, BANK(TextBoxGraphics), $20 + lb bc, BANK(TextBoxGraphics), (TextBoxGraphicsEnd - TextBoxGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank LoadHpBarAndStatusTilePatterns:: @@ -3124,13 +3124,13 @@ LoadHpBarAndStatusTilePatterns:: .off ld hl, HpBarAndStatusGraphics ld de, vChars2 + $620 - ld bc, $1e0 + ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics ld a, BANK(HpBarAndStatusGraphics) jp FarCopyData2 ; if LCD is off, transfer all at once .on ld de, HpBarAndStatusGraphics ld hl, vChars2 + $620 - lb bc, BANK(HpBarAndStatusGraphics), $1e + lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 jp CopyVideoData ; if LCD is on, transfer during V-blank @@ -590,7 +590,7 @@ INCLUDE "engine/cable_club.asm" LoadTrainerInfoTextBoxTiles: ; 5ae6 (1:5ae6) ld de, TrainerInfoTextBoxTileGraphics ld hl, vChars2 + $760 - lb bc, BANK(TrainerInfoTextBoxTileGraphics), $09 + lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 jp CopyVideoData INCLUDE "engine/menu/main_menu.asm" @@ -2068,7 +2068,7 @@ ClearVariablesAfterLoadingMapData: ; c335 (3:4335) ld [hli], a ld [hl], a ld hl, wWhichTrade - ld bc, $1e + ld bc, wStandingOnWarpPadOrHole - wWhichTrade call FillMemory ret @@ -3296,7 +3296,7 @@ LoadMissableObjects: ; f132 (3:7132) InitializeMissableObjectsFlags: ; f175 (3:7175) ld hl, W_MISSABLEOBJECTFLAGS - ld bc, $20 + ld bc, wMissableObjectFlagsEnd - W_MISSABLEOBJECTFLAGS xor a call FillMemory ; clear missable objects flags ld hl, MapHS00 @@ -3808,7 +3808,7 @@ AddPartyMon_WriteMovePP: ; f476 (3:7476) push de push bc ld hl, Moves - ld bc, $6 + ld bc, MoveEnd - Moves call AddNTimes ld de, wcd6d ld a, BANK(Moves) @@ -4173,7 +4173,7 @@ HealParty: push bc ld hl, Moves - ld bc, 6 + ld bc, MoveEnd - Moves call AddNTimes ld de, wcd6d ld a, BANK(Moves) @@ -4495,7 +4495,7 @@ START_MONEY EQU $3000 ld [hl], a ld hl, W_GAMEPROGRESSFLAGS - ld bc, $c8 + ld bc, wGameProgressFlagsEnd - W_GAMEPROGRESSFLAGS call FillMemory ; clear all game progress flags jp InitializeMissableObjectsFlags @@ -4767,17 +4767,26 @@ SECTION "Graphics", ROMX, BANK[GFX] PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp" FontGraphics: INCBIN "gfx/font.1bpp" +FontGraphicsEnd: ABTiles: INCBIN "gfx/AB.2bpp" HpBarAndStatusGraphics: INCBIN "gfx/hp_bar_and_status.2bpp" +HpBarAndStatusGraphicsEnd: BattleHudTiles1: INCBIN "gfx/battle_hud1.1bpp" +BattleHudTiles1End: BattleHudTiles2: INCBIN "gfx/battle_hud2.1bpp" BattleHudTiles3: INCBIN "gfx/battle_hud3.1bpp" +BattleHudTiles3End: NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.2bpp" GamefreakLogoGraphics: INCBIN "gfx/gamefreak.2bpp" +GamefreakLogoGraphicsEnd: TextBoxGraphics: INCBIN "gfx/text_box.2bpp" +TextBoxGraphicsEnd: PokedexTileGraphics: INCBIN "gfx/pokedex.2bpp" +PokedexTileGraphicsEnd: WorldMapTileGraphics: INCBIN "gfx/town_map.2bpp" +WorldMapTileGraphicsEnd: PlayerCharacterTitleGraphics: INCBIN "gfx/player_title.2bpp" +PlayerCharacterTitleGraphicsEnd: SECTION "Battle (bank 4)", ROMX, BANK[$4] @@ -5337,6 +5346,7 @@ SECTION "Battle (bank B)", ROMX, BANK[$B] INCLUDE "engine/battle/display_effectiveness.asm" TrainerInfoTextBoxTileGraphics: INCBIN "gfx/trainer_info.2bpp" +TrainerInfoTextBoxTileGraphicsEnd: BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp" CircleTile: INCBIN "gfx/circle_tile.2bpp" BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp" @@ -5498,10 +5508,12 @@ INCLUDE "engine/battle/draw_hud_pokeball_gfx.asm" TradingAnimationGraphics: INCBIN "gfx/game_boy.norepeat.2bpp" INCBIN "gfx/link_cable.2bpp" +TradingAnimationGraphicsEnd: TradingAnimationGraphics2: ; Pokeball traveling through the link cable. INCBIN "gfx/trade2.2bpp" +TradingAnimationGraphics2End: INCLUDE "engine/evos_moves.asm" INCLUDE "engine/battle/moveEffects/heal_effect.asm" @@ -6487,6 +6499,7 @@ ENDC IF DEF(_BLUE) INCBIN "gfx/blue/blueversion.1bpp" ; 8 tiles ENDC +Version_GFXEnd: Dojo_GFX: Gym_GFX: INCBIN "gfx/tilesets/gym.2bpp" diff --git a/scripts/celadonmartelevator.asm b/scripts/celadonmartelevator.asm index 53f1f434..ea4792c0 100755 --- a/scripts/celadonmartelevator.asm +++ b/scripts/celadonmartelevator.asm @@ -36,7 +36,7 @@ CeladonMartElevatorScript_48631: ; 48631 (12:4631) call LoadItemList ld hl, CeldaonMartElevatorWarpMaps ld de, wcc5b - ld bc, $000a + ld bc, CeldaonMartElevatorWarpMapsEnd - CeldaonMartElevatorWarpMaps jp CopyData CeladonMartElavatorFloors: ; 48643 (12:4643) @@ -53,6 +53,7 @@ CeldaonMartElevatorWarpMaps: ; 4864a (12:464a) db $02, CELADON_MART_3 db $02, CELADON_MART_4 db $02, CELADON_MART_5 +CeldaonMartElevatorWarpMapsEnd: CeladonMartElevatorScript_48654: ; 48654 (12:4654) jpba ShakeElevator diff --git a/scripts/namerater.asm b/scripts/namerater.asm index c2d028ef..0222d596 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -10,15 +10,15 @@ NameRaterScript_1da15: ; 1da15 (7:5a15) NameRaterScript_1da20: ; 1da20 (7:5a20) ld hl, wPartyMonOT - ld bc, $000b + ld bc, 11 ld a, [wWhichPokemon] call AddNTimes ld de, wPlayerName - ld c, $b + ld c, 11 call .asm_1da47 jr c, .asm_1da52 ld hl, wPartyMon1OTID - ld bc, $002c + ld bc, wPartyMon2 - wPartyMon1 ld a, [wWhichPokemon] call AddNTimes ld de, wPlayerID diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 584878eb..1e64032b 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -27,7 +27,7 @@ PewterPokecenterText3: ; 5c59b (17:459b) call DelayFrames ld hl, JigglypuffFacingDirections ld de, wJigglypuffFacingDirections - ld bc, 4 + ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections call CopyData ld a, [wSpriteStateData1 + 3 * $10 + $2] @@ -50,7 +50,7 @@ PewterPokecenterText3: ; 5c59b (17:459b) push hl ld hl, wJigglypuffFacingDirections ld de, wJigglypuffFacingDirections - 1 - ld bc, 4 + ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections call CopyData ld a, [wJigglypuffFacingDirections - 1] ld [wJigglypuffFacingDirections + 3], a @@ -79,6 +79,7 @@ JigglypuffFacingDirections: ; 5c608 (17:4608) db $30 | SPRITE_FACING_LEFT db $30 | SPRITE_FACING_UP db $30 | SPRITE_FACING_RIGHT +JigglypuffFacingDirectionsEnd: PewterPokecenterText4: ; 5c60c (17:460c) db $f6 diff --git a/scripts/rockethideoutelevator.asm b/scripts/rockethideoutelevator.asm index 52c7fad3..ac936b46 100755 --- a/scripts/rockethideoutelevator.asm +++ b/scripts/rockethideoutelevator.asm @@ -36,7 +36,7 @@ RocketHideoutElevatorScript_45741: ; 45741 (11:5741) call LoadItemList ld hl, RocketHideoutElevatorWarpMaps ld de, wcc5b - ld bc, $0006 + ld bc, RocketHideoutElevatorWarpMapsEnd - RocketHideoutElevatorWarpMaps call CopyData ret @@ -52,6 +52,7 @@ RocketHideoutElevatorWarpMaps: ; 45759 (11:5759) db $04, ROCKET_HIDEOUT_1 db $04, ROCKET_HIDEOUT_2 db $02, ROCKET_HIDEOUT_4 +RocketHideoutElevatorWarpMapsEnd: RocketHideoutElevatorScript_4575f: ; 4575f (11:575f) call Delay3 diff --git a/scripts/silphcoelevator.asm b/scripts/silphcoelevator.asm index 36dbb6d2..5bd189ae 100755 --- a/scripts/silphcoelevator.asm +++ b/scripts/silphcoelevator.asm @@ -36,7 +36,7 @@ SilphCoElevatorScript_457f1: ; 457f1 (11:57f1) call LoadItemList ld hl, SilphCoElevatorWarpMaps ld de, wcc5b - ld bc, $16 + ld bc, SilphCoElevatorWarpMapsEnd - SilphCoElevatorWarpMaps call CopyData ret @@ -60,6 +60,7 @@ SilphCoElevatorWarpMaps: ; 45811 (11:45811) db $02, SILPH_CO_9F db $02, SILPH_CO_10F db $01, SILPH_CO_11F +SilphCoElevatorWarpMapsEnd: SilphCoElevatorScript_45827: ; 45827 (11:5827) call Delay3 diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index a65b3603..6157ba8d 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -53,8 +53,8 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) ld b, $9c call CopyScreenTileBufferToVRAM coord hl, 0, 10 - ld bc, $0078 - ld a, $14 + ld bc, SCREEN_WIDTH * 6 + ld a, $14 ; water tile call FillMemory ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a @@ -180,7 +180,7 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c) VermilionDock_1dc94: ; 1dc94 (7:5c94) ld hl, wcc5b - ld bc, $00b4 + ld bc, SCREEN_WIDTH * 9 ld a, $14 call FillMemory ld hl, vBGMap0 + 10 * 32 @@ -2397,7 +2397,10 @@ wPlayerCoins:: ; d5a4 W_MISSABLEOBJECTFLAGS:: ; d5a6 ; bit array of missable objects. set = removed - ds 39 + ds 32 +wMissableObjectFlagsEnd:: + + ds 7 wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim) @@ -2622,7 +2625,10 @@ W_SEAFOAMISLANDS5CURSCRIPT:: ; d668 W_ROUTE18GATECURSCRIPT:: ; d669 ds 1 - ds 134 + ds 78 +wGameProgressFlagsEnd:: + + ds 56 wObtainedHiddenItemsFlags:: ds 14 |