All functions in main.asm have non-generic names

This commit is contained in:
pikalaxalt 2016-05-08 14:11:24 -04:00
parent bb58230ca7
commit e95d42e0af
34 changed files with 537 additions and 551 deletions

View File

@ -183,7 +183,7 @@ BattleTurn: ; 3c12f
call IsMobileBattle
jr nz, .not_disconnected
callba Function100da5
callba Function100641
callba StartMobileInactivityTimer
callba Function100dd8
jp c, .quit
.not_disconnected
@ -2503,8 +2503,8 @@ WinTrainerBattle: ; 3cfa4
call BattleWinSlideInEnemyTrainerFrontpic
ld c, 40
call DelayFrames
ld c, $4
callba Function4ea0a
ld c, $4 ; win
callba Mobile_PrintOpponentBattleMessage
ret
.battle_tower
@ -3176,8 +3176,8 @@ LostBattle: ; 3d38e
ld c, 40
call DelayFrames
ld c, $3
callba Function4ea0a
ld c, $3 ; lost
callba Mobile_PrintOpponentBattleMessage
scf
ret
; 3d432
@ -9621,8 +9621,8 @@ BattleStartMessage: ; 3fc8b
call IsMobileBattle2
ret nz
ld c, $2
callba Function4ea0a
ld c, $2 ; start
callba Mobile_PrintOpponentBattleMessage
ret
; 3fd26

View File

@ -518,39 +518,39 @@ const_value SET 1
; object struct
const_def
const OBJECT_SPRITE
const OBJECT_MAP_OBJECT_INDEX
const OBJECT_SPRITE_TILE
const OBJECT_MOVEMENTTYPE
const OBJECT_FLAGS1
const OBJECT_FLAGS2
const OBJECT_PALETTE
const OBJECT_DIRECTION_WALKING
const OBJECT_FACING
const OBJECT_STEP_TYPE
const OBJECT_STEP_DURATION
const OBJECT_ACTION
const OBJECT_STEP_FRAME
const OBJECT_FACING_STEP
const OBJECT_NEXT_TILE
const OBJECT_STANDING_TILE
const OBJECT_NEXT_MAP_X
const OBJECT_NEXT_MAP_Y
const OBJECT_MAP_X
const OBJECT_MAP_Y
const OBJECT_INIT_X
const OBJECT_INIT_Y
const OBJECT_RADIUS
const OBJECT_SPRITE_X
const OBJECT_SPRITE_Y
const OBJECT_SPRITE_X_OFFSET
const OBJECT_SPRITE_Y_OFFSET
const OBJECT_MOVEMENT_BYTE_INDEX
const OBJECT_28
const OBJECT_29
const OBJECT_30
const OBJECT_31
const OBJECT_RANGE
const OBJECT_SPRITE ; 00
const OBJECT_MAP_OBJECT_INDEX ; 01
const OBJECT_SPRITE_TILE ; 02
const OBJECT_MOVEMENTTYPE ; 03
const OBJECT_FLAGS1 ; 04
const OBJECT_FLAGS2 ; 05
const OBJECT_PALETTE ; 06
const OBJECT_DIRECTION_WALKING ; 07
const OBJECT_FACING ; 08
const OBJECT_STEP_TYPE ; 09
const OBJECT_STEP_DURATION ; 0a
const OBJECT_ACTION ; 0b
const OBJECT_STEP_FRAME ; 0c
const OBJECT_FACING_STEP ; 0d
const OBJECT_NEXT_TILE ; 0e
const OBJECT_STANDING_TILE ; 0f
const OBJECT_NEXT_MAP_X ; 10
const OBJECT_NEXT_MAP_Y ; 11
const OBJECT_MAP_X ; 12
const OBJECT_MAP_Y ; 13
const OBJECT_INIT_X ; 14
const OBJECT_INIT_Y ; 15
const OBJECT_RADIUS ; 16
const OBJECT_SPRITE_X ; 17
const OBJECT_SPRITE_Y ; 18
const OBJECT_SPRITE_X_OFFSET ; 19
const OBJECT_SPRITE_Y_OFFSET ; 1a
const OBJECT_MOVEMENT_BYTE_INDEX ; 1b
const OBJECT_28 ; 1c
const OBJECT_29 ; 1d
const OBJECT_30 ; 1e
const OBJECT_31 ; 1f
const OBJECT_RANGE ; 20
; 33-39 are not used
; map object struct

View File

@ -1159,10 +1159,10 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
add [hl]
ld e, a
ld d, $0
ld hl, wBillsPCPokemonList + 1
rept 3
ld hl, wBillsPCPokemonList + 1 ; box number
add hl, de
add hl, de
add hl, de
endr
ld a, [hl]
and a
jr z, .party
@ -1274,9 +1274,9 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c)
ld e, a
ld d, 0
ld hl, wBillsPCPokemonList
rept 3
add hl, de
endr
add hl, de
add hl, de
ld e, l
ld d, h
hlcoord 9, 4
@ -1290,9 +1290,9 @@ endr
ld de, 2 * SCREEN_WIDTH
add hl, de
pop de
rept 3
inc de
endr
inc de
inc de
pop af
dec a
jr nz, .loop
@ -1493,9 +1493,9 @@ BillsPC_GetSelectedPokemonSpecies: ; e2def (38:6def)
ld e, a
ld d, $0
ld hl, wBillsPCPokemonList
rept 3
add hl, de
endr
add hl, de
add hl, de
ld a, [hl]
ret
@ -2055,10 +2055,10 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
.PartyToBox: ; e3267
call .CopyFromParty
ld a, $1
ld [wc2cd], a
ld [wGameLogicPaused], a
callba SaveGameData
xor a
ld [wc2cd], a
ld [wGameLogicPaused], a
call .CopyToBox
ret
; e327d
@ -2211,9 +2211,9 @@ GetBoxPointer: ; e3396 (38:7396)
ld c, b
ld b, 0
ld hl, .boxes
rept 3
add hl, bc
endr
add hl, bc
add hl, bc
ld a, [hli]
ld b, a
ld a, [hli]
@ -2429,9 +2429,9 @@ GetBoxCount: ; e366c (38:766c)
ld c, a
ld b, 0
ld hl, .boxbanks
rept 3
add hl, bc
endr
add hl, bc
add hl, bc
ld a, [hli]
ld b, a
call GetSRAMBank

View File

@ -495,7 +495,7 @@ LinkTimeout: ; 283b2
pop de
pop hl
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
call RotateThreePalettesRight
call ClearScreen
ld b, SCGB_08
@ -1255,7 +1255,7 @@ LinkTradeOTPartymonMenuLoop: ; 28835
jr z, .not_a_button
ld a, $1
ld [wd263], a
callab Function50db9
callab LoadAddrsForLinkMonStatsScreen
ld hl, OTPartyMon1Species
callba LinkMonStatsScreen
jp LinkTradePartiesMenuMasterLoop
@ -1448,7 +1448,7 @@ Function28926: ; 28926
ld [wMenuCursorY], a
ld a, $4
ld [wd263], a
callab Function50db9
callab LoadAddrsForLinkMonStatsScreen
callba LinkMonStatsScreen
call Call_LoadTempTileMapToTileMap
hlcoord 6, 1
@ -1490,7 +1490,7 @@ Function28926: ; 28926
callba Link_WaitBGMap
ld hl, .Text_CantTradeLastMon
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
jr .cancel_trade
.abnormal
@ -1512,7 +1512,7 @@ Function28926: ; 28926
callba Link_WaitBGMap
ld hl, .Text_Abnormal
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
.cancel_trade
hlcoord 0, 12
@ -1688,7 +1688,7 @@ LinkTrade: ; 28b87
call GetPokemonName
ld hl, UnknownText_0x28eb8
bccoord 1, 14
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
call LoadStandardMenuDataHeader
hlcoord 10, 7
ld b, 3
@ -2030,7 +2030,7 @@ LoadTradeScreenBorder: ; 28ef8
; 28eff
Function28eff: ; 28eff
callba Function16d6a7
callba Function16d6a7 ; just a nested farcall; so wasteful
call SetPalettes
ret
; 28f09

View File

@ -137,7 +137,7 @@ Function437b: ; 437b
cp STEP_TYPE_SLEEP
ret z
.ok3
ld hl, Pointers4b45
ld hl, StepTypesJumptable
rst JumpTable
ret
@ -1084,7 +1084,7 @@ SetRandomStepDuration: ; 4b2d
ret
; 4b45
Pointers4b45: ; 4b45
StepTypesJumptable: ; 4b45
; These pointers use OBJECT_STEP_TYPE. See constants/sprite_constants.asm
dw ObjectMovementReset ; 00
dw MapObjectMovementPattern ; unused

View File

@ -319,7 +319,7 @@ Function241d5: ; 241d5
ret c
ld c, 1
ld b, 3
call Function10062d ; BUG: This function is in another bank.
call AdvanceMobileInactivityTimerAndCheckExpired ; BUG: This function is in another bank.
; Pointer in current bank (9) is bogus.
ret c
callba Function100337

View File

@ -823,7 +823,7 @@ Pokedex_UpdateUnownMode: ; 405df (10:45df)
call DelayFrame
call Pokedex_CheckSGB
jr nz, .decompress
callba Function1ddf26
callba LoadSGBPokedexGFX2
jr .done
.decompress

View File

@ -516,7 +516,7 @@ Pokegear_UpdateClock: ; 90f86 (24:4f86)
callba PrintHoursMins
ld hl, .DayText
bccoord 6, 6
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
; 90fa8 (24:4fa8)
@ -711,7 +711,7 @@ PokegearMap_UpdateLandmarkName: ; 910b4
push de
callba GetLandmarkName
pop de
callba Function1de2c5
callba TownMap_ConvertLineBreakCharacters
hlcoord 8, 0
ld [hl], $34
ret

View File

@ -139,7 +139,7 @@ PrintRadioLine:
cp 2
jr nz, .print
bccoord 1, 16
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
jr .skip
.print
call PrintTextBoxText

View File

@ -9,9 +9,9 @@ SaveMenu: ; 14a1a
jr nz, .refused
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call PauseGameLogic
call _SavingDontTurnOffThePower
call ClearWRAMStateAfterSave
call ResumeGameLogic
call ExitMenu
and a
ret
@ -24,7 +24,7 @@ SaveMenu: ; 14a1a
ret
Function14a58: ; 14a58
call SetWRAMStateForSave
call PauseGameLogic
callba StageRTCTimeForSave
callba BackupMysteryGift
call SavePokemonData
@ -33,7 +33,7 @@ Function14a58: ; 14a58
call SaveBackupChecksum
callba BackupPartyMonMail
callba SaveRTC
call ClearWRAMStateAfterSave
call ResumeGameLogic
ret
; 14a83
@ -47,7 +47,7 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
jr c, .refused
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call PauseGameLogic
call SavingDontTurnOffThePower
call SaveBox
pop de
@ -55,7 +55,7 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
ld [wCurBox], a
call LoadBox
call SavedTheGame
call ClearWRAMStateAfterSave
call ResumeGameLogic
and a
ret
.refused
@ -65,9 +65,9 @@ ChangeBoxSaveGame: ; 14a83 (5:4a83)
Link_SaveGame: ; 14ab2
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call PauseGameLogic
call _SavingDontTurnOffThePower
call ClearWRAMStateAfterSave
call ResumeGameLogic
and a
.refused
@ -75,19 +75,19 @@ Link_SaveGame: ; 14ab2
; 14ac2
MovePkmnWOMail_SaveGame: ; 14ac2
call SetWRAMStateForSave
call PauseGameLogic
push de
call SaveBox
pop de
ld a, e
ld [wCurBox], a
call LoadBox
call ClearWRAMStateAfterSave
call ResumeGameLogic
ret
; 14ad5
Function14ad5: ; 14ad5
call SetWRAMStateForSave
call PauseGameLogic
push de
call SaveBox
pop de
@ -111,7 +111,7 @@ Function14ad5: ; 14ad5
callba BackupMobileEventIndex
callba SaveRTC
call LoadBox
call ClearWRAMStateAfterSave
call ResumeGameLogic
ld de, SFX_SAVE
call PlaySFX
ld c, 24
@ -127,9 +127,9 @@ StartMovePkmnWOMail_SaveGame: ; 14b34
jr c, .refused
call AskOverwriteSaveFile
jr c, .refused
call SetWRAMStateForSave
call PauseGameLogic
call _SavingDontTurnOffThePower
call ClearWRAMStateAfterSave
call ResumeGameLogic
and a
ret
@ -138,15 +138,15 @@ StartMovePkmnWOMail_SaveGame: ; 14b34
ret
; 14b54
SetWRAMStateForSave: ; 14b54
PauseGameLogic: ; 14b54
ld a, $1
ld [wc2cd], a
ld [wGameLogicPaused], a
ret
; 14b5a
ClearWRAMStateAfterSave: ; 14b5a
ResumeGameLogic: ; 14b5a
xor a
ld [wc2cd], a
ld [wGameLogicPaused], a
ret
; 14b5f

View File

@ -1762,7 +1762,7 @@ SetUpMoveScreenBG: ; 13172
call ClearSprites
xor a
ld [hBGMapMode], a
callba Functionfb571
callba LoadStatsScreenPageTilesGFX
callba ClearSpriteAnims2
ld a, [CurPartyMon]
ld e, a

View File

@ -6,14 +6,14 @@ BattleStatsScreenInit: ; 4dc7b (13:5c7b)
ld a, [wBattleMode] ; wd22d (aliases: EnemyMonEnd)
and a
jr z, StatsScreenInit
jr _BattleStatsScreenInit
jr _MobileStatsScreenInit
StatsScreenInit: ; 4dc8a
ld hl, StatsScreenMain
jr StatsScreenInit_gotaddress
_BattleStatsScreenInit: ; 4dc8f
ld hl, StatsScreenBattle
_MobileStatsScreenInit: ; 4dc8f
ld hl, StatsScreenMobile
jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress: ; 4dc94
@ -33,7 +33,7 @@ StatsScreenInit_gotaddress: ; 4dc94
call ClearBGPalettes
call ClearTileMap
call UpdateSprites
callba Functionfb53e
callba StatsScreen_LoadFont
pop hl
call _hl_
call ClearBGPalettes
@ -73,7 +73,7 @@ StatsScreenMain: ; 0x4dcd2
ret
; 0x4dcf7
StatsScreenBattle: ; 4dcf7
StatsScreenMobile: ; 4dcf7
xor a
ld [wJumptableIndex], a
; stupid interns
@ -89,7 +89,7 @@ StatsScreenBattle: ; 4dcf7
ld hl, StatsScreenPointerTable
rst JumpTable
call StatsScreen_WaitAnim
callba Function100dfd
callba MobileComms_CheckInactivityTimer
jr c, .exit
ld a, [wJumptableIndex]
bit 7, a
@ -100,7 +100,6 @@ StatsScreenBattle: ; 4dcf7
; 4dd2a
StatsScreenPointerTable: ; 4dd2a
dw MonStatsInit ; regular pokémon
dw EggStatsInit ; egg
dw StatsScreenWaitCry

View File

@ -577,7 +577,7 @@ Special_InitialSetDSTFlag: ; 90a54
lb bc, 3, 18
call ClearBox
ld hl, .Text
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
; 90a6c
@ -608,7 +608,7 @@ Special_InitialClearDSTFlag: ; 90a88
lb bc, 3, 18
call ClearBox
ld hl, .Text
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
; 90aa0
@ -636,7 +636,7 @@ DebugDisplayTime: ; 90abc
lb bc, 3, SCREEN_WIDTH - 2
call ClearBox
ld hl, .Text
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
; 90acc

View File

@ -3,7 +3,7 @@ HallOfFame:: ; 0x8640e
ld a, [StatusFlags]
push af
ld a, 1
ld [wc2cd], a
ld [wGameLogicPaused], a
call DisableSpriteUpdates
ld a, SPAWN_LANCE
ld [wSpawnAfterChampion], a
@ -25,7 +25,7 @@ HallOfFame:: ; 0x8640e
callba AddHallOfFameEntry
xor a
ld [wc2cd], a
ld [wGameLogicPaused], a
call AnimateHallOfFame
pop af
ld b, a
@ -44,7 +44,7 @@ RedCredits:: ; 86455
xor a
ld [VramState], a
ld [hMapAnims], a
callba Function4e8c2
callba InitDisplayForRedCredits
ld c, 8
call DelayFrames
call DisableSpriteUpdates
@ -67,7 +67,7 @@ HallOfFame_FadeOutMusic: ; 8648e
xor a
ld [VramState], a
ld [hMapAnims], a
callba Function4e881
callba InitDisplayForHallOfFame
ld c, 100
jp DelayFrames
; 864b4
@ -230,7 +230,7 @@ GetHallOfFameParty: ; 8653f
AnimateHOFMonEntrance: ; 865b5
push hl
call ClearBGPalettes
callba Function4e906
callba ResetDisplayBetweenHallOfFameMons
pop hl
ld a, [hli]
ld [TempMonSpecies], a

View File

@ -321,13 +321,13 @@ DSTChecks: ; 16439
call .ClearBox
bccoord 1, 14
ld hl, .Text_AdjustClock
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
call YesNoBox
ret c
call .ClearBox
bccoord 1, 14
ld hl, .Text_LostInstructionBooklet
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
.loop
@ -337,7 +337,7 @@ DSTChecks: ; 16439
bit 7, a
jr z, .SetDST
ld hl, .Text_IsDSTOver
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
call YesNoBox
ret c
ld a, [wDST]
@ -347,12 +347,12 @@ DSTChecks: ; 16439
call .ClearBox
bccoord 1, 14
ld hl, .Text_SetClockBack
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
.SetDST:
ld hl, .Text_SwitchToDST
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
call YesNoBox
ret c
ld a, [wDST]
@ -362,7 +362,7 @@ DSTChecks: ; 16439
call .ClearBox
bccoord 1, 14
ld hl, .Text_SetClockForward
call PlaceWholeStringInBoxAtOnce
call PlaceHLTextAtBC
ret
; 164b9

View File

@ -132,7 +132,7 @@ UnownPrinter: ; 16be4
.UpdateUnownFrontpic: ; 16cc8
ld a, [wJumptableIndex]
cp 26
jr z, Function16d20
jr z, .vacant
inc a
ld [UnownLetter], a
ld a, UNOWN
@ -141,18 +141,17 @@ UnownPrinter: ; 16be4
ld [wBoxAlignment], a
ld de, VTiles2
predef GetFrontpic
call Function16cff
call .Load2bppToSRAM
hlcoord 1, 6
xor a
ld [hGraphicStartTile], a
lb bc, 7, 7
predef PlaceGraphic
ld de, VTiles2 tile $31
callba Functione0000
callba RotateUnownFrontpic
ret
; 16cff
Function16cff: ; 16cff
.Load2bppToSRAM: ; 16cff
ld a, [rSVBK]
push af
ld a, $6
@ -171,9 +170,8 @@ Function16cff: ; 16cff
pop af
ld [rSVBK], a
ret
; 16d20
Function16d20: ; 16d20
.vacant
hlcoord 1, 6
lb bc, 7, 7
call ClearBox

View File

@ -21,14 +21,16 @@ INCBIN "gfx/frames/9.1bpp"
; TODO: Various misc graphics here.
GFX_f89b0: ; f89b0
StatsScreenPageTilesGFX: ; f89b0
INCBIN "gfx/unknown/0f89b0.2bpp"
; f8a90
ShinyIcon: ; f8a90
; also part of StatsScreenPageTilesGFX
INCBIN "gfx/stats/shiny.2bpp"
GFX_f8aa0: ; f8aa0
StatsScreenPageTilesGFX_Part2: ; f8aa0
; not referenced on its own, but part of StatsScreenPageTilesGFX
INCBIN "gfx/unknown/0f8aa0.2bpp"
; f8ac0
@ -48,7 +50,7 @@ TownMapGFX: ; f8ba0
INCBIN "gfx/misc/town_map.2bpp.lz"
; f8ea4
GFX_f8ea4: ; unused
GFX_f8ea4: ; unused kanji
INCBIN "gfx/unknown/0f8ea4.2bpp"
; f8f24
@ -56,8 +58,8 @@ OverworldPhoneIconGFX: ; f8f24
INCBIN "gfx/mobile/overworld_phone_icon.2bpp"
; f8f34
GFX_f8f34: ; unused
INCBIN "gfx/unknown/0f8f34.2bpp"
GFX_f8f34: ; unused bold letters + unown chars
INCBIN "gfx/unknown/0f8f34.w64.1bpp"
; f9204
TextBoxSpaceGFX: ; f9204
@ -72,7 +74,7 @@ MapEntryFrameGFX: ; f9344
INCBIN "gfx/frames/map_entry_sign.2bpp"
; f9424
GFX_f9424: ; f9424
FontsExtra2_UpArrowGFX: ; f9424
INCBIN "gfx/unknown/0f9424.2bpp"
; f9434
@ -81,6 +83,7 @@ INCBIN "gfx/misc/footprints.1bpp"
; fb434
; This and the following two functions are unreferenced.
; Debug, perhaps?
Unknown_fb434:
db 0
@ -143,9 +146,9 @@ _LoadFontsExtra1:: ; fb48a
; fb4b0
_LoadFontsExtra2:: ; fb4b0
ld de, GFX_f9424
ld de, FontsExtra2_UpArrowGFX
ld hl, VTiles2 tile $61
ld b, BANK(GFX_f9424)
ld b, BANK(FontsExtra2_UpArrowGFX)
ld c, 1
call Get2bpp_2
ret
@ -208,7 +211,7 @@ LoadHPBar: ; fb50d
ret
; fb53e
Functionfb53e: ; fb53e
StatsScreen_LoadFont: ; fb53e
call _LoadFontsBattleExtra
ld de, EnemyHPBarBorderGFX
ld hl, VTiles2 tile $6c
@ -226,11 +229,10 @@ Functionfb53e: ; fb53e
ld hl, VTiles2 tile $55
lb bc, BANK(ExpBarGFX), 8
call Get2bpp_2
Functionfb571: ; fb571
ld de, GFX_f89b0
LoadStatsScreenPageTilesGFX: ; fb571
ld de, StatsScreenPageTilesGFX
ld hl, VTiles2 tile $31
lb bc, BANK(GFX_f89b0), $11
lb bc, BANK(StatsScreenPageTilesGFX), $11
call Get2bpp_2
ret
; fb57e

View File

@ -33,7 +33,7 @@ UpdateGameTimer:: ; 20ad
; Don't update if game logic is paused.
ld a, [wc2cd]
ld a, [wGameLogicPaused]
and a
ret nz

View File

@ -33,7 +33,7 @@ Joypad:: ; 935
ret nz
; If we're saving, input is disabled.
ld a, [wc2cd]
ld a, [wGameLogicPaused]
and a
ret nz

Some files were not shown because too many files have changed in this diff Show More