Separate maps.asm, pics.asm, sprites.asm, and tilesets.asm from main.asm (#251)

Each new file builds its own .o, along with separate main.o and home.o, which necessitates many more "exported::" labels.
This commit is contained in:
Rangi 2020-06-27 15:32:24 -04:00 committed by GitHub
parent ff927ba730
commit 4b853ad676
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
317 changed files with 2290 additions and 2240 deletions

View file

@ -1,4 +1,4 @@
CableClubNPC:
CableClubNPC::
ld hl, CableClubNPCWelcomeText
call PrintText
CheckEvent EVENT_GOT_POKEDEX

View file

@ -71,13 +71,13 @@ SilphCoMapList:
db SILPH_CO_11F
db $FF
CardKeySuccessText:
CardKeySuccessText::
TX_FAR _CardKeySuccessText1
TX_SFX_ITEM_1
TX_FAR _CardKeySuccessText2
db "@"
CardKeyFailText:
CardKeyFailText::
TX_FAR _CardKeyFailText
db "@"

View file

@ -1,4 +1,4 @@
GiveFossilToCinnabarLab:
GiveFossilToCinnabarLab::
ld hl, wd730
set 6, [hl]
xor a
@ -112,7 +112,7 @@ PrintFossilsInBag:
jr .loop
; loads the names of the fossil item and the resulting mon
LoadFossilItemAndMonName:
LoadFossilItemAndMonName::
ld a, [wFossilMon]
ld [wd11e], a
call GetMonName

View file

@ -1,4 +1,4 @@
ClearVariablesOnEnterMap:
ClearVariablesOnEnterMap::
ld a, SCREEN_HEIGHT_PIXELS
ld [hWY], a
ld [rWY], a

View file

@ -1,4 +1,4 @@
ShakeElevator:
ShakeElevator::
ld de, -$20
call ShakeElevatorRedrawRow
ld de, SCREEN_HEIGHT * $20

View file

@ -20,7 +20,7 @@ HiddenItems:
INCLUDE "data/hidden_item_coords.asm"
FoundHiddenItemText:
FoundHiddenItemText::
TX_FAR _FoundHiddenItemText
TX_ASM
ld a, [wHiddenObjectFunctionArgument] ; item ID
@ -45,7 +45,7 @@ FoundHiddenItemText:
call PrintText
jp TextScriptEnd
HiddenItemBagFullText:
HiddenItemBagFullText::
TX_FAR _HiddenItemBagFullText
db "@"
@ -120,12 +120,12 @@ HiddenCoins:
INCLUDE "data/hidden_coins.asm"
FoundHiddenCoinsText:
FoundHiddenCoinsText::
TX_FAR _FoundHiddenCoinsText
TX_SFX_ITEM_2
db "@"
DroppedHiddenCoinsText:
DroppedHiddenCoinsText::
TX_FAR _FoundHiddenCoins2Text
TX_SFX_ITEM_2
TX_FAR _DroppedHiddenCoinsText

View file

@ -1,4 +1,4 @@
IsPlayerOnDungeonWarp:
IsPlayerOnDungeonWarp::
xor a
ld [wWhichDungeonWarp], a
ld a, [wd72d]
@ -15,7 +15,7 @@ IsPlayerOnDungeonWarp:
ret
; if a hidden object was found, stores $00 in [$ffee], else stores $ff
CheckForHiddenObject:
CheckForHiddenObject::
ld hl, $ffeb
xor a
ld [hli], a

View file

@ -1,4 +1,4 @@
HandleLedges:
HandleLedges::
ld a, [wd736]
bit 6, a ; already jumping down ledge
ret nz

View file

@ -1,4 +1,4 @@
_UpdateSprites:
_UpdateSprites::
ld h, $c1
inc h
ld a, $e ; wSpriteStateData2 + $0e

View file

@ -8,7 +8,7 @@
; fields, respectively, within loops. The X is the loop index.
; If there is an inner loop, Y is the inner loop index, i.e. $C1Y* and $C2Y*
; denote fields of the sprite slots iterated over in the inner loop.
InitMapSprites:
InitMapSprites::
call InitOutsideMapSprites
ret c ; return if the map is an outside map (already handled by above call)
; if the map is an inside map (i.e. mapID >= $25)

View file

@ -1,4 +1,4 @@
MarkTownVisitedAndLoadMissableObjects:
MarkTownVisitedAndLoadMissableObjects::
ld a, [wCurMap]
cp ROUTE_1
jr nc, .notInTown

View file

@ -1,4 +1,4 @@
PlayerStepOutFromDoor:
PlayerStepOutFromDoor::
ld hl, wd730
res 1, [hl]
call IsPlayerStandingOnDoorTile
@ -27,7 +27,7 @@ PlayerStepOutFromDoor:
res 7, [hl]
ret
_EndNPCMovementScript:
_EndNPCMovementScript::
ld hl, wd730
res 7, [hl]
ld hl, wd72e
@ -44,7 +44,7 @@ _EndNPCMovementScript:
ld [wSimulatedJoypadStatesEnd], a
ret
PalletMovementScriptPointerTable:
PalletMovementScriptPointerTable::
dw PalletMovementScript_OakMoveLeft
dw PalletMovementScript_PlayerMoveLeft
dw PalletMovementScript_WaitAndWalkToLab
@ -157,7 +157,7 @@ PalletMovementScript_Done:
res 7, [hl]
jp EndNPCMovementScript
PewterMuseumGuyMovementScriptPointerTable:
PewterMuseumGuyMovementScriptPointerTable::
dw PewterMovementScript_WalkToMuseum
dw PewterMovementScript_Done
@ -213,7 +213,7 @@ PewterMovementScript_Done:
res 7, [hl]
jp EndNPCMovementScript
PewterGymGuyMovementScriptPointerTable:
PewterGymGuyMovementScriptPointerTable::
dw PewterMovementScript_WalkToGym
dw PewterMovementScript_Done
@ -266,7 +266,7 @@ RLEList_PewterGymGuy:
db NPC_MOVEMENT_RIGHT, $03
db $FF
FreezeEnemyTrainerSprite:
FreezeEnemyTrainerSprite::
ld a, [wCurMap]
cp POKEMON_TOWER_7F
ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them

View file

@ -1,4 +1,4 @@
PrepareOAMData:
PrepareOAMData::
; Determine OAM data for currently visible
; sprites and write it to wOAMBuffer.

View file

@ -1,4 +1,4 @@
EnterMapAnim:
EnterMapAnim::
call InitFacingDirectionList
ld a, $ec
ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
@ -90,7 +90,7 @@ PlayerSpinWhileMovingDown:
ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
jp PlayerSpinWhileMovingUpOrDown
_LeaveMapAnim:
_LeaveMapAnim::
call InitFacingDirectionList
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@ -347,7 +347,7 @@ GetPlayerTeleportAnimFrameDelay:
inc a
ret
IsPlayerStandingOnWarpPadOrHole:
IsPlayerStandingOnWarpPadOrHole::
ld b, 0
ld hl, WarpPadAndHoleData
ld a, [wCurMapTileset]
@ -496,7 +496,7 @@ RedFishingTiles:
db 3, BANK(RedFishingRodTiles)
dw vNPCSprites2 + $7d0
_HandleMidJump:
_HandleMidJump::
ld a, [wPlayerJumpingYScreenCoordsIndex]
ld c, a
inc a

View file

@ -1,5 +1,5 @@
; only used for setting bit 2 of wd736 upon entering a new map
IsPlayerStandingOnWarp:
IsPlayerStandingOnWarp::
ld a, [wNumberOfWarps]
and a
ret z
@ -31,7 +31,7 @@ IsPlayerStandingOnWarp:
jr nz, .loop
ret
CheckForceBikeOrSurf:
CheckForceBikeOrSurf::
ld hl, wd732
bit 5, [hl]
ret nz
@ -84,7 +84,7 @@ CheckForceBikeOrSurf:
INCLUDE "data/force_bike_surf.asm"
IsPlayerFacingEdgeOfMap:
IsPlayerFacingEdgeOfMap::
push hl
push de
push bc
@ -150,7 +150,7 @@ IsPlayerFacingEdgeOfMap:
scf
ret
IsWarpTileInFrontOfPlayer:
IsWarpTileInFrontOfPlayer::
push hl
push de
push bc
@ -188,7 +188,7 @@ IsSSAnneBowWarpTileInFrontOfPlayer:
and a
jr IsWarpTileInFrontOfPlayer.done
IsPlayerStandingOnDoorTileOrWarpTile:
IsPlayerStandingOnDoorTileOrWarpTile::
push hl
push de
push bc
@ -217,7 +217,7 @@ IsPlayerStandingOnDoorTileOrWarpTile:
INCLUDE "data/warp_tile_ids.asm"
PrintSafariZoneSteps:
PrintSafariZoneSteps::
ld a, [wCurMap]
cp SAFARI_ZONE_EAST
ret c

View file

@ -1,4 +1,4 @@
DisplayPokemonCenterDialogue_:
DisplayPokemonCenterDialogue_::
call SaveScreenTilesToBuffer1 ; save screen
ld hl, PokemonCenterWelcomeText
call PrintText

View file

@ -1,4 +1,4 @@
DisplayPokemartDialogue_:
DisplayPokemartDialogue_::
ld a, [wListScrollOffset]
ld [wSavedListScrollOffset], a
call UpdateSprites

View file

@ -1,4 +1,4 @@
TryPushingBoulder:
TryPushingBoulder::
ld a, [wd728]
bit 0, a ; using Strength?
ret z
@ -82,7 +82,7 @@ PushBoulderLeftMovementData:
PushBoulderRightMovementData:
db NPC_MOVEMENT_RIGHT,$FF
DoBoulderDustAnimation:
DoBoulderDustAnimation::
ld a, [wd730]
bit 0, a
ret nz

View file

@ -1,4 +1,4 @@
RemoveGuardDrink:
RemoveGuardDrink::
ld hl, GuardDrinksList
.drinkLoop
ld a, [hli]

View file

@ -68,7 +68,7 @@ MoveBoulderDustFunctionPointerTable:
db $FF,$01
dw AdjustOAMBlockXPos
LoadSmokeTileFourTimes:
LoadSmokeTileFourTimes::
ld hl, vChars1 + $7c0
ld c, $4
.loop

View file

@ -1,4 +1,4 @@
_GetSpritePosition1:
_GetSpritePosition1::
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@ -17,7 +17,7 @@ _GetSpritePosition1:
ld [$ffee], a
ret
_GetSpritePosition2:
_GetSpritePosition2::
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@ -36,7 +36,7 @@ _GetSpritePosition2:
ld [wSavedSpriteMapX], a
ret
_SetSpritePosition1:
_SetSpritePosition1::
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@ -55,7 +55,7 @@ _SetSpritePosition1:
ld [hl], a
ret
_SetSpritePosition2:
_SetSpritePosition2::
ld hl, wSpriteStateData1
ld de, 4
ld a, [wSpriteIndex]
@ -74,7 +74,7 @@ _SetSpritePosition2:
ld [hl], a ; c2x5 (map X pos)
ret
TrainerWalkUpToPlayer:
TrainerWalkUpToPlayer::
ld a, [wSpriteIndex]
swap a
ld [wTrainerSpriteOffset], a

View file

@ -1,4 +1,4 @@
LoadWildData:
LoadWildData::
ld hl, WildDataPointers
ld a, [wCurMap]