diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/fade.asm | 2 | ||||
-rw-r--r-- | home/init.asm | 2 | ||||
-rw-r--r-- | home/inventory.asm | 21 | ||||
-rw-r--r-- | home/math.asm | 10 | ||||
-rw-r--r-- | home/move_mon.asm | 22 | ||||
-rw-r--r-- | home/overworld.asm | 14 | ||||
-rw-r--r-- | home/pokemon.asm | 11 | ||||
-rw-r--r-- | home/start.asm | 2 | ||||
-rw-r--r-- | home/text_script.asm | 20 | ||||
-rw-r--r-- | home/textbox.asm | 11 | ||||
-rw-r--r-- | home/update_sprites.asm | 10 |
11 files changed, 20 insertions, 105 deletions
diff --git a/home/fade.asm b/home/fade.asm index 32175e16..f5ddf964 100644 --- a/home/fade.asm +++ b/home/fade.asm @@ -1,7 +1,7 @@ ; These routines manage gradual fading ; (e.g., entering a doorway) LoadGBPal:: - ld a, [wMapPalOffset] ;tells if wCurMap is dark (requires HM5_FLASH?) + ld a, [wMapPalOffset] ; tells if wCurMap is dark (requires HM5_FLASH?) ld b, a ld hl, FadePal4 ld a, l diff --git a/home/init.asm b/home/init.asm index e3f5fdd4..fe7dc9a9 100644 --- a/home/init.asm +++ b/home/init.asm @@ -126,7 +126,7 @@ ClearVram:: StopAllSounds:: - ld a, BANK(Audio1_UpdateMusic) + ld a, BANK("Audio Engine 1") ld [wAudioROMBank], a ld [wAudioSavedROMBank], a xor a diff --git a/home/inventory.asm b/home/inventory.asm index ebaa4047..1100666f 100644 --- a/home/inventory.asm +++ b/home/inventory.asm @@ -22,15 +22,7 @@ AddAmountSoldToMoney:: ; [wWhichPokemon] = index (within the inventory) of the item to remove ; [wItemQuantity] = quantity to remove RemoveItemFromInventory:: - ldh a, [hLoadedROMBank] - push af - ld a, BANK(RemoveItemFromInventory_) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call RemoveItemFromInventory_ - pop af - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall RemoveItemFromInventory_ ret ; function to add an item (in varying quantities) to the player's bag or PC box @@ -41,15 +33,6 @@ RemoveItemFromInventory:: ; sets carry flag if successful, unsets carry flag if unsuccessful AddItemToInventory:: push bc - ldh a, [hLoadedROMBank] - push af - ld a, BANK(AddItemToInventory_) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call AddItemToInventory_ - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall_sf AddItemToInventory_ pop bc ret diff --git a/home/math.asm b/home/math.asm index b081b540..59eda606 100644 --- a/home/math.asm +++ b/home/math.asm @@ -26,15 +26,7 @@ Divide:: push hl push de push bc - ldh a, [hLoadedROMBank] - push af - ld a, BANK(_Divide) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call _Divide - pop af - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall _Divide pop bc pop de pop hl diff --git a/home/move_mon.asm b/home/move_mon.asm index 3e69e6d0..c766fbd5 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -231,27 +231,9 @@ CalcStat:: ret AddEnemyMonToPlayerParty:: - ldh a, [hLoadedROMBank] - push af - ld a, BANK(_AddEnemyMonToPlayerParty) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call _AddEnemyMonToPlayerParty - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall_sf _AddEnemyMonToPlayerParty ret MoveMon:: - ldh a, [hLoadedROMBank] - push af - ld a, BANK(_MoveMon) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call _MoveMon - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall_sf _MoveMon ret diff --git a/home/overworld.asm b/home/overworld.asm index 9d5e42ef..a9cfba24 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -2321,16 +2321,16 @@ LoadMapData:: ; copy current map view to VRAM hlcoord 0, 0 ld de, vBGMap0 - ld b, 18 + ld b, SCREEN_HEIGHT .vramCopyLoop - ld c, 20 + ld c, SCREEN_WIDTH .vramCopyInnerLoop ld a, [hli] ld [de], a inc e dec c jr nz, .vramCopyInnerLoop - ld a, 32 - 20 + ld a, BG_MAP_WIDTH - SCREEN_WIDTH add e ld e, a jr nc, .noCarry @@ -2366,15 +2366,15 @@ SwitchToMapRomBank:: ld c, a ld b, $00 ld a, BANK(MapHeaderBanks) - call BankswitchHome ; switch to ROM bank 3 + call BankswitchHome ld hl, MapHeaderBanks add hl, bc ld a, [hl] - ldh [hMapROMBank], a ; save map ROM bank + ldh [hMapROMBank], a call BankswitchBack ldh a, [hMapROMBank] ldh [hLoadedROMBank], a - ld [MBC1RomBank], a ; switch to map ROM bank + ld [MBC1RomBank], a pop bc pop hl ret @@ -2395,7 +2395,7 @@ ResetUsingStrengthOutOfBattleBit: ForceBikeOrSurf:: ld b, BANK(RedSprite) - ld hl, LoadPlayerSpriteGraphics + ld hl, LoadPlayerSpriteGraphics ; in bank 0 call Bankswitch jp PlayDefaultMusic ; update map/player state? diff --git a/home/pokemon.asm b/home/pokemon.asm index d018843e..5406c0ad 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -325,16 +325,7 @@ PrintStatusCondition:: ret PrintStatusConditionNotFainted:: - ldh a, [hLoadedROMBank] - push af - ld a, BANK(PrintStatusAilment) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call PrintStatusAilment ; print status condition - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall_sf PrintStatusAilment ret ; function to print pokemon level, leaving off the ":L" if the level is at least 100 diff --git a/home/start.asm b/home/start.asm index 448b6362..764f9468 100644 --- a/home/start.asm +++ b/home/start.asm @@ -4,7 +4,7 @@ _Start:: xor a jr .ok .gbc - ld a, 0 + ld a, FALSE .ok ld [wGBC], a jp Init diff --git a/home/text_script.asm b/home/text_script.asm index b9c3c8e4..a6881dc5 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -146,15 +146,7 @@ DisplayPokemartDialogue:: call LoadItemList ld a, PRICEDITEMLISTMENU ld [wListMenuID], a - ldh a, [hLoadedROMBank] - push af - ld a, BANK(DisplayPokemartDialogue_) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call DisplayPokemartDialogue_ - pop af - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall DisplayPokemartDialogue_ jp AfterDisplayingTextID PokemartGreetingText:: @@ -185,15 +177,7 @@ DisplayPokemonCenterDialogue:: ldh [hItemPrice + 2], a inc hl - ldh a, [hLoadedROMBank] - push af - ld a, BANK(DisplayPokemonCenterDialogue_) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call DisplayPokemonCenterDialogue_ - pop af - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall DisplayPokemonCenterDialogue_ jp AfterDisplayingTextID DisplaySafariGameOverText:: diff --git a/home/textbox.asm b/home/textbox.asm index 5067b044..f95c72c7 100644 --- a/home/textbox.asm +++ b/home/textbox.asm @@ -3,14 +3,5 @@ ; [wTextBoxID] = text box ID ; b, c = y, x cursor position (TWO_OPTION_MENU only) DisplayTextBoxID:: - ldh a, [hLoadedROMBank] - push af - ld a, BANK(DisplayTextBoxID_) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call DisplayTextBoxID_ - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall_sf DisplayTextBoxID_ ret diff --git a/home/update_sprites.asm b/home/update_sprites.asm index 80ea14d3..5530c2a4 100644 --- a/home/update_sprites.asm +++ b/home/update_sprites.asm @@ -2,13 +2,5 @@ UpdateSprites:: ld a, [wUpdateSpritesEnabled] dec a ret nz - ldh a, [hLoadedROMBank] - push af - ld a, BANK(_UpdateSprites) - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call _UpdateSprites - pop af - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + homecall _UpdateSprites ret |