Labeled every function in ROM0 that's referenced in the source

This commit is contained in:
pikalaxalt 2016-05-10 12:31:49 -04:00
parent e95d42e0af
commit ae36ef2c7f
86 changed files with 554 additions and 512 deletions

View File

@ -2489,9 +2489,9 @@ _PlayCryHeader:: ; e8b79
; 3-byte pointers (bank, address) ; 3-byte pointers (bank, address)
ld hl, Cries ld hl, Cries
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, [hli] ld a, [hli]
ld [MusicBank], a ld [MusicBank], a
@ -2708,9 +2708,9 @@ PlayStereoSFX:: ; e8ca6
; get sfx ptr ; get sfx ptr
ld hl, SFX ld hl, SFX
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
; bank ; bank
ld a, [hli] ld a, [hli]

View File

@ -196,9 +196,9 @@ AI_TryItem: ; 38105
jr z, .has_item jr z, .has_item
dec de dec de
rept 3
inc hl inc hl
endr inc hl
inc hl
jr .loop jr .loop
.has_item .has_item

View File

@ -19,9 +19,9 @@ AIChooseMove: ; 440ce
; The default score is 20. Unusable moves are given a score of 80. ; The default score is 20. Unusable moves are given a score of 80.
ld a, 20 ld a, 20
ld hl, Buffer1 ld hl, Buffer1
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
; Don't pick disabled moves. ; Don't pick disabled moves.

View File

@ -596,9 +596,9 @@ AI_Smart_Explosion: ; 388a6
ret c ret c
.asm_388c6 .asm_388c6
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
ret ret
; 388ca ; 388ca
@ -610,9 +610,9 @@ AI_Smart_DreamEater: ; 388ca
call Random call Random
cp 25 cp 25
ret c ret c
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
; 388d4 ; 388d4
@ -1208,9 +1208,9 @@ AI_Smart_Fly: ; 38b12
call AICompareSpeed call AICompareSpeed
ret nc ret nc
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
; 38b20 ; 38b20
@ -1515,9 +1515,9 @@ AI_Smart_Encore: ; 38c3b
ret ret
.asm_38c81 .asm_38c81
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
ret ret
.EncoreMoves: .EncoreMoves:
@ -1587,15 +1587,15 @@ AI_Smart_SleepTalk: ; 38cba
cp $1 cp $1
jr z, .asm_38cc7 jr z, .asm_38cc7
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
.asm_38cc7 .asm_38cc7
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
ret ret
; 38ccb ; 38ccb
@ -1607,9 +1607,9 @@ AI_Smart_DefrostOpponent: ; 38ccb
ld a, [EnemyMonStatus] ld a, [EnemyMonStatus]
and $20 and $20
ret z ret z
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
; 38cd5 ; 38cd5
@ -1708,9 +1708,9 @@ AI_Smart_HealBell: ; 38d1f
jr z, .next jr z, .next
; status ; status
rept 3
dec hl dec hl
endr dec hl
dec hl
ld a, [hl] ld a, [hl]
or c or c
ld c, a ld c, a
@ -1774,9 +1774,9 @@ AI_Smart_PriorityHit: ; 38d5a
ld a, [BattleMonHP] ld a, [BattleMonHP]
sbc b sbc b
ret nc ret nc
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
; 38d93 ; 38d93
@ -1900,9 +1900,9 @@ AI_Smart_MeanLook: ; 38dfb
.asm_38e26 .asm_38e26
call AI_80_20 call AI_80_20
ret c ret c
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
; 38e2e ; 38e2e
@ -2233,9 +2233,9 @@ AI_Smart_Endure: ; 38fac
call AI_80_20 call AI_80_20
ret c ret c
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
ret ret
.asm_38fcb .asm_38fcb
@ -2274,9 +2274,9 @@ AI_Smart_FuryCutter: ; 38fdb
cp 3 cp 3
jr c, .end jr c, .end
rept 3
dec [hl] dec [hl]
endr dec [hl]
dec [hl]
.end .end
@ -2579,9 +2579,9 @@ AI_Smart_WeatherMove: ; 3910d
; 3911e ; 3911e
AIBadWeatherType: ; 3911e AIBadWeatherType: ; 3911e
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
ret ret
; 39122 ; 39122

View File

@ -108,7 +108,7 @@ RunBattleAnimScript: ; cc163
call RunBattleAnimCommand call RunBattleAnimCommand
call _ExecuteBGEffects call _ExecuteBGEffects
call BattleAnim_UpdateOAM_All call BattleAnim_UpdateOAM_All
call Function3b0c call PushLYOverrides
call BattleAnimRequestPals call BattleAnimRequestPals
; Speed up Rollout's animation. ; Speed up Rollout's animation.
@ -265,9 +265,9 @@ BattleAnim_ClearCGB_OAMFlags: ; cc23d
ld a, [hl] ld a, [hl]
and $f0 and $f0
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec c dec c
jr nz, .loop jr nz, .loop
ret ret

View File

@ -738,9 +738,9 @@ BattleBGEffect_RunPicResizeScript: ; c83ed (32:43ed)
ld l, a ld l, a
ld a, [wBattleAnimTemp2] ld a, [wBattleAnimTemp2]
ld h, a ld h, a
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, [hl] ld a, [hl]
cp -1 cp -1
jr z, .end jr z, .end
@ -805,9 +805,9 @@ endr
ld e, [hl] ld e, [hl]
ld d, 0 ld d, 0
ld hl, .BGSquares ld hl, .BGSquares
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, [hli] ld a, [hli]
ld b, a ld b, a
and $f and $f

View File

@ -4080,9 +4080,9 @@ InitBattleMon: ; 3da0d
ld de, BattleMonDVs ld de, BattleMonDVs
ld bc, MON_PKRUS - MON_DVS ld bc, MON_PKRUS - MON_DVS
call CopyBytes call CopyBytes
rept 3
inc hl inc hl
endr inc hl
inc hl
ld de, BattleMonLevel ld de, BattleMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes call CopyBytes
@ -4172,9 +4172,9 @@ InitEnemyMon: ; 3dabd
ld de, EnemyMonDVs ld de, EnemyMonDVs
ld bc, MON_PKRUS - MON_DVS ld bc, MON_PKRUS - MON_DVS
call CopyBytes call CopyBytes
rept 3
inc hl inc hl
endr inc hl
inc hl
ld de, EnemyMonLevel ld de, EnemyMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes call CopyBytes
@ -4302,9 +4302,9 @@ rept 4
endr endr
ld [hl], a ld [hl], a
ld hl, PlayerUsedMoves ld hl, PlayerUsedMoves
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld [PlayerDisableCount], a ld [PlayerDisableCount], a
ld [PlayerFuryCutterCount], a ld [PlayerFuryCutterCount], a
@ -6637,9 +6637,9 @@ LoadEnemyMon: ; 3e8eb
xor a xor a
ld h, d ld h, d
ld l, e ld l, e
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
; Make sure the predef knows this isn't a partymon ; Make sure the predef knows this isn't a partymon
ld [MagikarpLength], a ld [MagikarpLength], a

View File

@ -3402,9 +3402,9 @@ HitSelfInConfusion: ; 355dd
sla c sla c
rl b rl b
.mimic_screen .mimic_screen
rept 3
dec hl dec hl
endr dec hl
dec hl
ld a, [hli] ld a, [hli]
ld l, [hl] ld l, [hl]
ld h, a ld h, a
@ -3948,9 +3948,9 @@ BattleCommand_Encore: ; 35864
set SUBSTATUS_ENCORED, [hl] set SUBSTATUS_ENCORED, [hl]
call BattleRandom call BattleRandom
and $3 and $3
rept 3
inc a inc a
endr inc a
inc a
ld [de], a ld [de], a
call CheckOpponentWentFirst call CheckOpponentWentFirst
jr nz, .finish_move jr nz, .finish_move
@ -4089,12 +4089,12 @@ BattleCommand_PainSplit: ; 35926
ld a, [CurDamage + 1] ld a, [CurDamage + 1]
rr a rr a
ld [CurDamage + 1], a ld [CurDamage + 1], a
rept 3
inc hl inc hl
endr inc hl
rept 3 inc hl
inc de
inc de
inc de inc de
endr
.EnemyShareHP: ; 359ac .EnemyShareHP: ; 359ac
ld c, [hl] ld c, [hl]
@ -7442,9 +7442,9 @@ BattleCommand_TrapTarget: ; 36c2d
ret nz ret nz
call BattleRandom call BattleRandom
and 3 and 3
rept 3
inc a inc a
endr inc a
inc a
ld [hl], a ld [hl], a
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar call GetBattleVar

View File

@ -81,9 +81,9 @@ StageBallTilesData: ; 2c059
jr z, .fainted jr z, .fainted
.got_hp .got_hp
rept 3
dec hl dec hl
endr dec hl
dec hl
ld a, [hl] ld a, [hl]
and a and a
ld b, $32 ; statused ld b, $32 ; statused
@ -92,9 +92,9 @@ endr
jr .load jr .load
.fainted .fainted
rept 3
dec hl dec hl
endr dec hl
dec hl
.load .load
ld a, b ld a, b

View File

@ -18,10 +18,12 @@ LV_CHAR EQU $6e
; GetName types ; GetName types
PKMN_NAME EQU 1 PKMN_NAME EQU 1
MOVE_NAME EQU 2 MOVE_NAME EQU 2
; dummied out EQU 3
ITEM_NAME EQU 4 ITEM_NAME EQU 4
PARTY_OT_NAME EQU 5 PARTY_OT_NAME EQU 5
ENEMY_OT_NAME EQU 6 ENEMY_OT_NAME EQU 6
TRAINER_NAME EQU 7 TRAINER_NAME EQU 7
; broken ptr EQU 8
; hp ; hp
HP_GREEN EQU 0 HP_GREEN EQU 0

View File

@ -48,7 +48,7 @@ Toss_Sell_Loop: ; 24ff9
; 2500e ; 2500e
BuySellToss_InterpretJoypad: ; 2500e BuySellToss_InterpretJoypad: ; 2500e
call Function354b ; get joypad call JoyTextDelay_ForcehJoyDown ; get joypad
bit B_BUTTON_F, c bit B_BUTTON_F, c
jr nz, .b jr nz, .b
bit A_BUTTON_F, c bit A_BUTTON_F, c

View File

@ -121,7 +121,7 @@ RestartClock: ; 20021 (8:4021)
; 0x200ba ; 0x200ba
.joy_loop .joy_loop
call Function354b call JoyTextDelay_ForcehJoyDown
ld c, a ld c, a
push af push af
call .PrintTime call .PrintTime

View File

@ -405,9 +405,9 @@ LoadStatsScreenPals:
Function8cb4: Function8cb4:
ld l, e ld l, e
ld h, 0 ld h, 0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld de, Palettes_8d05 ld de, Palettes_8d05
add hl, de add hl, de
call CheckCGB call CheckCGB
@ -855,9 +855,9 @@ Function97e5:
GetMonPalettePointer: GetMonPalettePointer:
ld l, a ld l, a
ld h, $0 ld h, $0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld bc, PokemonPalettes ld bc, PokemonPalettes
add hl, bc add hl, bc
ret ret
@ -1101,9 +1101,9 @@ endr
call SGBDelayCycles call SGBDelayCycles
ld a, $30 ld a, $30
ld [rJOYP], a ld [rJOYP], a
rept 3
ld a, [rJOYP] ld a, [rJOYP]
endr ld a, [rJOYP]
ld a, [rJOYP]
call SGBDelayCycles call SGBDelayCycles
call SGBDelayCycles call SGBDelayCycles
ld a, [rJOYP] ld a, [rJOYP]
@ -1946,9 +1946,9 @@ LoadMapPals:
ld a, [MapGroup] ld a, [MapGroup]
ld l, a ld l, a
ld h, 0 ld h, 0
rept 3
add hl,hl add hl,hl
endr add hl,hl
add hl,hl
ld de, RoofPals ld de, RoofPals
add hl, de add hl, de
ld a, [TimeOfDayPal] ld a, [TimeOfDayPal]

View File

@ -1655,9 +1655,9 @@ CrystalIntro_InitUnownAnim: ; e51dc (39:51dc)
ret ret
CrystalIntro_UnownFade: ; e5223 (39:5223) CrystalIntro_UnownFade: ; e5223 (39:5223)
rept 3
add a add a
endr add a
add a
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, BGPals ld hl, BGPals
@ -1777,9 +1777,9 @@ Intro_Scene20_AppearUnown: ; e5348 (39:5348)
.got_pointer .got_pointer
ld a, [wcf65] ld a, [wcf65]
and $7 and $7
rept 3
add a add a
endr add a
add a
ld c, a ld c, a
ld a, [rSVBK] ld a, [rSVBK]
push af push af
@ -1835,9 +1835,9 @@ endr
; e539d ; e539d
Intro_FadeUnownWordPals: ; e539d (39:539d) Intro_FadeUnownWordPals: ; e539d (39:539d)
rept 3
add a add a
endr add a
add a
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, BGPals ld hl, BGPals

View File

@ -573,9 +573,9 @@ Function81c33: ; 81c33
; 81ca7 ; 81ca7
Function81ca7: ; 81ca7 Function81ca7: ; 81ca7
rept 3
inc hl inc hl
endr inc hl
inc hl
ld a, [de] ld a, [de]
call Function81cbc call Function81cbc
ld a, [de] ld a, [de]
@ -1233,9 +1233,9 @@ Function8220f: ; 8220f
ld a, [wcf64] ld a, [wcf64]
ld l, a ld l, a
ld h, $0 ld h, $0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld de, UnknBGPals ld de, UnknBGPals
add hl, de add hl, de
ld de, wc608 ld de, wc608

View File

@ -1030,9 +1030,9 @@ DoPlayerEvent: ; 96beb
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, PlayerEventScriptPointers ld hl, PlayerEventScriptPointers
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld a, [hli] ld a, [hli]
ld [ScriptBank], a ld [ScriptBank], a
ld a, [hli] ld a, [hli]

View File

@ -459,9 +459,9 @@ HandleQueuedCommand: ; 97e79
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .Jumptable_ba ld hl, .Jumptable_ba
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, [hli] ld a, [hli]
push af push af
ld a, [hli] ld a, [hli]

View File

@ -704,9 +704,9 @@ SelectTreeMon: ; b841f
.loop .loop
sub [hl] sub [hl]
jr c, .ok jr c, .ok
rept 3
inc hl inc hl
endr inc hl
inc hl
jr .loop jr .loop
.ok .ok

View File

@ -353,9 +353,9 @@ EvolutionAnimation: ; 4e5e1
ld a, [hl] ld a, [hl]
or b or b
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec c dec c
jr nz, .loop6 jr nz, .loop6
pop bc pop bc

View File

@ -50,9 +50,9 @@ endr
cp [hl] cp [hl]
jr z, .ok jr z, .ok
jr c, .ok jr c, .ok
rept 3
inc hl inc hl
endr inc hl
inc hl
jr .loop jr .loop
.ok .ok
inc hl inc hl

View File

@ -66,9 +66,9 @@ PickedFruitTree: ; 4405f
ResetFruitTrees: ; 4406a ResetFruitTrees: ; 4406a
xor a xor a
ld hl, FruitTreeFlags ld hl, FruitTreeFlags
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld hl, DailyFlags ld hl, DailyFlags
set 4, [hl] set 4, [hl]

View File

@ -218,9 +218,9 @@ INCBIN "gfx/unknown/0123fc.2bpp"
ld [hld], a ld [hld], a
ld a, e ld a, e
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec c dec c
jr nz, .palette_loop_2 jr nz, .palette_loop_2
pop de pop de

View File

@ -579,9 +579,9 @@ FixDataForLinkTransfer: ; 28434
jr nz, .loop2 jr nz, .loop2
ld hl, wMisc ld hl, wMisc
ld a, $fd ld a, $fd
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld b, $c8 ld b, $c8
xor a xor a
.loop3 .loop3
@ -1213,9 +1213,9 @@ InitTradeMenuDisplay: ; 287e3
callba InitTradeSpeciesList callba InitTradeSpeciesList
xor a xor a
ld hl, wOtherPlayerLinkMode ld hl, wOtherPlayerLinkMode
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld a, 1 ld a, 1
ld [wMenuCursorY], a ld [wMenuCursorY], a

View File

@ -268,9 +268,9 @@ EndSpriteMovement: ; 467b
ld [hl], a ld [hl], a
ld hl, OBJECT_MOVEMENT_BYTE_INDEX ld hl, OBJECT_MOVEMENT_BYTE_INDEX
add hl, bc add hl, bc
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ; OBJECT_30 ld [hl], a ; OBJECT_30
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc

View File

@ -204,9 +204,9 @@ ReadMapSetupScript: ; 1541d
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, MapSetupCommands ld hl, MapSetupCommands
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
; bank ; bank
ld b, [hl] ld b, [hl]

View File

@ -418,9 +418,9 @@ GetMartDialogGroup: ; 15ca3
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .MartTextFunctionPointers ld hl, .MartTextFunctionPointers
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ret ret
; 15cb0 ; 15cb0
@ -576,9 +576,9 @@ BargainShopAskPurchaseQuantity:
ld h, [hl] ld h, [hl]
ld l, a ld l, a
inc hl inc hl
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
inc hl inc hl
ld a, [hli] ld a, [hli]
ld [hMoneyTemp + 2], a ld [hMoneyTemp + 2], a
@ -617,9 +617,9 @@ RooftopSaleAskPurchaseQuantity:
ld h, [hl] ld h, [hl]
ld l, a ld l, a
inc hl inc hl
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
inc hl inc hl
ld e, [hl] ld e, [hl]
inc hl inc hl
@ -663,9 +663,9 @@ MenuDataHeader_Buy: ; 0x15e18
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wMartItem1BCD ld hl, wMartItem1BCD
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
push de push de
ld d, h ld d, h
ld e, l ld e, l

View File

@ -836,8 +836,8 @@ _InitVerticalMenuCursor:: ; 2446d
ld [hli], a ld [hli], a
; wCursorOffCharacter, wCursorCurrentTile ; wCursorOffCharacter, wCursorCurrentTile
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ret ret
; 244c3 ; 244c3

View File

@ -169,9 +169,10 @@ InitPartyMenuIcon: ; 8e908 (23:6908)
call GetMemIconGFX call GetMemIconGFX
ld a, [hObjectStructIndexBuffer] ld a, [hObjectStructIndexBuffer]
; y coord ; y coord
rept 4
add a add a
endr add a
add a
add a
add $1c add $1c
ld d, a ld d, a
; x coord ; x coord

View File

@ -1459,9 +1459,9 @@ CalcPkmnStatC: ; e17b
ld a, [hl] ld a, [hl]
swap a swap a
and $1 and $1
rept 3
add a add a
endr add a
add a
ld b, a ld b, a
ld a, [hli] ld a, [hli]
and $1 and $1

View File

@ -12,9 +12,9 @@ GetPredefPointer:: ; 854b
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, PredefPointers ld hl, PredefPointers
rept 3 add hl, de
add hl,de add hl, de
endr add hl, de
pop de pop de
ld a, [hli] ld a, [hli]
@ -64,7 +64,7 @@ PredefPointers:: ; 856b
add_predef CopyPkmnToTempMon add_predef CopyPkmnToTempMon
add_predef ListMoves ; $20 add_predef ListMoves ; $20
add_predef PlaceNonFaintStatus add_predef PlaceNonFaintStatus
add_predef Function50cdb add_predef Predef22
add_predef ListMovePP add_predef ListMovePP
add_predef GetGender add_predef GetGender
add_predef StatsScreenInit add_predef StatsScreenInit
@ -102,7 +102,7 @@ PredefPointers:: ; 856b
add_predef PlaceStatusString add_predef PlaceStatusString
add_predef LoadMonAnimation add_predef LoadMonAnimation
add_predef AnimateFrontpic add_predef AnimateFrontpic
add_predef Functiond0669 ; $48 add_predef Predef48 ; $48
add_predef HOF_AnimateFrontpic add_predef HOF_AnimateFrontpic
dbw $ff, Function2d43 ; ???? dwb $43ff, $2d
; 864c ; 864c

View File

@ -293,9 +293,9 @@ Function841e2: ; 841e2 (21:41e2)
Function841fb: ; 841fb (21:41fb) Function841fb: ; 841fb (21:41fb)
xor a xor a
ld hl, wca82 ld hl, wca82
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld hl, wca86 ld hl, wca86
ld [hli], a ld [hli], a
@ -1362,7 +1362,7 @@ Function848ed: ; 848ed (21:48ed)
call AddNTimes call AddNTimes
ld a, [hl] ld a, [hl]
pop hl pop hl
call Function383d call PrintLevel_Force3Digits
.ok2 .ok2
ld hl, wd002 ld hl, wd002
inc [hl] inc [hl]

View File

@ -1652,9 +1652,9 @@ ScriptCall: ; 974cb
inc [hl] inc [hl]
ld d, $0 ld d, $0
ld hl, wScriptStack ld hl, wScriptStack
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
pop de pop de
ld a, [ScriptBank] ld a, [ScriptBank]
ld [hli], a ld [hli], a
@ -1825,9 +1825,9 @@ StdScript: ; 9757b
call GetScriptByte call GetScriptByte
ld d, a ld d, a
ld hl, StdScripts ld hl, StdScripts
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, BANK(StdScripts) ld a, BANK(StdScripts)
call GetFarByte call GetFarByte
ld b, a ld b, a
@ -3160,9 +3160,9 @@ ExitScriptSubroutine: ; 97b9a
ld e, [hl] ld e, [hl]
ld d, $0 ld d, $0
ld hl, wScriptStack ld hl, wScriptStack
rept 3
add hl,de add hl,de
endr add hl,de
add hl,de
ld a, [hli] ld a, [hli]
ld b, a ld b, a
and " " and " "

View File

@ -117,9 +117,9 @@ CheckOwnMonAnywhere: ; 0x4a721
; Load the box. ; Load the box.
ld hl, BoxAddressTable1 ld hl, BoxAddressTable1
ld b, 0 ld b, 0
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld a, [hli] ld a, [hli]
call GetSRAMBank call GetSRAMBank
ld a, [hli] ld a, [hli]

View File

@ -201,9 +201,9 @@ Function9282c: ; 9282c
ld a, [hl] ld a, [hl]
xor $20 xor $20
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec c dec c
jr nz, .loop jr nz, .loop
ret ret
@ -686,9 +686,9 @@ Slots_SpinReels: ; 92b0f (24:6b0f)
ld a, [hl] ld a, [hl]
add d add d
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec e dec e
jr nz, .loop jr nz, .loop
ret ret
@ -1844,9 +1844,9 @@ SlotPayoutText: ; 93158 (24:7158)
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .PayoutStrings ld hl, .PayoutStrings
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld de, StringBuffer2 ld de, StringBuffer2
ld bc, 4 ld bc, 4
call CopyBytes call CopyBytes

View File

@ -2,9 +2,9 @@
Special:: ; c01b Special:: ; c01b
; Run script special de. ; Run script special de.
ld hl, SpecialsPointers ld hl, SpecialsPointers
rept 3
add hl,de add hl,de
endr add hl,de
add hl,de
ld b, [hl] ld b, [hl]
inc hl inc hl
ld a, [hli] ld a, [hli]

View File

@ -630,9 +630,9 @@ DoAnimFrame: ; 8d24b
ld hl, SPRITEANIMSTRUCT_0C ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
push af push af
push de push de
call .Sprites_Sine call .Sprites_Sine
@ -807,9 +807,9 @@ endr
ld hl, SPRITEANIMSTRUCT_0B ld hl, SPRITEANIMSTRUCT_0B
add hl, bc add hl, bc
ld d, [hl] ld d, [hl]
rept 3
inc [hl] inc [hl]
endr inc [hl]
inc [hl]
ld hl, SPRITEANIMSTRUCT_0C ld hl, SPRITEANIMSTRUCT_0C
add hl, bc add hl, bc

View File

@ -154,9 +154,9 @@ InitSpriteAnimStruct:: ; 8cfd6
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, SpriteAnimSeqData ld hl, SpriteAnimSeqData
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld e, l ld e, l
ld d, h ld d, h
; Set hl to the first field (field 0) in the current structure. ; Set hl to the first field (field 0) in the current structure.
@ -521,9 +521,9 @@ GetFrameOAMPointer: ; 8d1a2
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, SpriteAnimOAMData ld hl, SpriteAnimOAMData
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ret ret
; 8d1ac ; 8d1ac

View File

@ -19,9 +19,9 @@ StartMenu:: ; 125cd
ld a, [wd0d2] ld a, [wd0d2]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
call .DrawMenuAccount_ call .DrawMenuAccount_
call MenuFunc_1e7f call DrawVariableLengthMenuBox
call .DrawBugContestStatusBox call .DrawBugContestStatusBox
call Function2e31 call SafeUpdateSprites
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
callba LoadFonts_NoOAMUpdate callba LoadFonts_NoOAMUpdate
call .DrawBugContestStatus call .DrawBugContestStatus
@ -142,7 +142,7 @@ StartMenu:: ; 125cd
call Call_ExitMenu call Call_ExitMenu
call ReloadTilesetAndPalettes call ReloadTilesetAndPalettes
call .DrawMenuAccount_ call .DrawMenuAccount_
call MenuFunc_1e7f call DrawVariableLengthMenuBox
call .DrawBugContestStatus call .DrawBugContestStatus
call UpdateSprites call UpdateSprites
call ret_d90 call ret_d90

View File

@ -102,9 +102,9 @@ CheckDailyResetTimer:: ; 11452
ret nc ret nc
xor a xor a
ld hl, DailyFlags ld hl, DailyFlags
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld hl, wDailyRematchFlags ld hl, wDailyRematchFlags
rept 4 rept 4
@ -381,9 +381,9 @@ CalcMinsHoursDaysSince: ; 115d6
; 115db ; 115db
CalcSecsMinsHoursDaysSince: ; 115db CalcSecsMinsHoursDaysSince: ; 115db
rept 3
inc hl inc hl
endr inc hl
inc hl
ld a, [hSeconds] ld a, [hSeconds]
ld c, a ld c, a
sub [hl] sub [hl]

View File

@ -140,9 +140,9 @@ Special_BattleTowerFade: ; 8c092
ld b, $4 ld b, $4
.asm_8c09c .asm_8c09c
call DmgToCgbTimePals call DmgToCgbTimePals
rept 3
inc hl inc hl
endr inc hl
inc hl
ld c, $7 ld c, $7
call DelayFrames call DelayFrames
dec b dec b
@ -304,9 +304,9 @@ DmgToCgbTimePals: ; 8c14e
ConvertTimePalsIncHL: ; 8c15e ConvertTimePalsIncHL: ; 8c15e
.loop .loop
call DmgToCgbTimePals call DmgToCgbTimePals
rept 3
inc hl inc hl
endr inc hl
inc hl
ld c, 2 ld c, 2
call DelayFrames call DelayFrames
dec b dec b
@ -317,9 +317,9 @@ endr
ConvertTimePalsDecHL: ; 8c16d ConvertTimePalsDecHL: ; 8c16d
.loop .loop
call DmgToCgbTimePals call DmgToCgbTimePals
rept 3
dec hl dec hl
endr dec hl
dec hl
ld c, 2 ld c, 2
call DelayFrames call DelayFrames
dec b dec b

View File

@ -215,9 +215,9 @@ UnreferencedFunction907f1: ; 907f1
ld [hl], a ld [hl], a
pop hl pop hl
call DisplayMinutesWithMinString call DisplayMinutesWithMinString
rept 3
inc hl inc hl
endr inc hl
inc hl
ret ret
; 90810 ; 90810

View File

@ -377,9 +377,9 @@ AnimateTitleCrystal: ; 10ef32
ld a, [hl] ld a, [hl]
add 2 add 2
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
dec c dec c
jr nz, .loop jr nz, .loop

View File

@ -423,9 +423,9 @@ TMHM_DisplayPocketItems: ; 2c9e2 (b:49e2)
.NotTMHM: .NotTMHM:
call TMHMPocket_GetCurrentLineCoord call TMHMPocket_GetCurrentLineCoord
rept 3
inc hl inc hl
endr inc hl
inc hl
push de push de
ld de, TMHM_String_Cancel ld de, TMHM_String_Cancel
call PlaceString call PlaceString

View File

@ -62,9 +62,9 @@ TrainerCard: ; 25105
call WaitBGMap call WaitBGMap
ld hl, wJumptableIndex ld hl, wJumptableIndex
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ret ret

View File

@ -7,9 +7,9 @@ _GetVarAction:: ; 80648 (20:4648)
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, .VarActionTable ld hl, .VarActionTable
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]

View File

@ -326,7 +326,7 @@ RefreshMapSprites: ; 1047f0
jr nz, .skip jr nz, .skip
ld hl, VramState ld hl, VramState
set 0, [hl] set 0, [hl]
call Function2e31 call SafeUpdateSprites
.skip .skip
ld a, [wPlayerSpriteSetupFlags] ld a, [wPlayerSpriteSetupFlags]
and %00011100 and %00011100

View File

@ -62,9 +62,9 @@ FindNest: ; 2a01f
ld b, a ld b, a
ld a, [hli] ld a, [hli]
ld c, a ld c, a
rept 3
inc hl inc hl
endr inc hl
inc hl
ld a, NUM_WILDMONS_PER_AREA_TIME_OF_DAY * 3 ld a, NUM_WILDMONS_PER_AREA_TIME_OF_DAY * 3
call .SearchMapForMon call .SearchMapForMon
jr nc, .next_grass jr nc, .next_grass
@ -267,9 +267,9 @@ ChooseWildEncounter: ; 2a14f
call CheckEncounterRoamMon call CheckEncounterRoamMon
jp c, .startwildbattle jp c, .startwildbattle
rept 3
inc hl inc hl
endr inc hl
inc hl
call CheckOnWater call CheckOnWater
ld de, .WaterMonTable ld de, .WaterMonTable
jr z, .watermon jr z, .watermon
@ -595,9 +595,9 @@ CheckEncounterRoamMon: ; 2a2ce
cp [hl] cp [hl]
jr nz, .DontEncounterRoamMon jr nz, .DontEncounterRoamMon
; We've decided to take on a beast, so stage its information for battle. ; We've decided to take on a beast, so stage its information for battle.
rept 3
dec hl dec hl
endr dec hl
dec hl
ld a, [hli] ld a, [hli]
ld [TempWildMonSpecies], a ld [TempWildMonSpecies], a
ld a, [hl] ld a, [hl]

View File

@ -157,9 +157,9 @@ BattleTower_ExecuteJumptable: ; 8b25b
; 8b281 ; 8b281
.GetTextPointers: ; 8b281 .GetTextPointers: ; 8b281
rept 3
inc de inc de
endr inc de
inc de
ld a, [de] ld a, [de]
ld l, a ld l, a
inc de inc de

View File

@ -340,9 +340,9 @@ ComputeAIContestantScores: ; 138b0
jr z, .loop2 jr z, .loop2
ld c, a ld c, a
ld b, 0 ld b, 0
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld a, [hli] ld a, [hli]
ld [wBugContestTempMon], a ld [wBugContestTempMon], a
ld a, [hli] ld a, [hli]

View File

@ -55,9 +55,9 @@ Special_CelebiShrineEvent: ; 4989a
ld c, $4 ld c, $4
.OAMloop: .OAMloop:
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
inc a inc a
dec c dec c
jr nz, .OAMloop jr nz, .OAMloop

View File

@ -398,9 +398,9 @@ FlyToAnim: ; 8cb33
ld c, $4 ld c, $4
.loop2 .loop2
ld [hli], a ld [hli], a
rept 3
inc hl inc hl
endr inc hl
inc hl
inc a inc a
dec c dec c
jr nz, .loop2 jr nz, .loop2

View File

@ -67,9 +67,9 @@ ChangeHappiness: ; 71c2
dec c dec c
ld b, 0 ld b, 0
ld hl, .Actions ld hl, .Actions
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld d, 0 ld d, 0
add hl, de add hl, de
ld a, [hl] ld a, [hl]

View File

@ -48,7 +48,7 @@ Special_MagnetTrain: ; 8cc04
callab PlaySpriteAnimations callab PlaySpriteAnimations
call MagnetTrain_Jumptable call MagnetTrain_Jumptable
call MagnetTrain_UpdateLYOverrides call MagnetTrain_UpdateLYOverrides
call Function3b0c call PushLYOverrides
call DelayFrame call DelayFrame
jr .loop jr .loop
@ -149,9 +149,9 @@ MagntTrain_LoadGFX_PlayMusic: ; 8ccc9
xor a xor a
ld [hli], a ld [hli], a
ld a, [wMagnetTrainInitPosition] ld a, [wMagnetTrainInitPosition]
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld de, MUSIC_MAGNET_TRAIN ld de, MUSIC_MAGNET_TRAIN
call PlayMusic2 call PlayMusic2
ret ret
@ -426,7 +426,7 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae
callba PlaySpriteAnimations callba PlaySpriteAnimations
call MagnetTrain_Jumptable call MagnetTrain_Jumptable
call MagnetTrain_UpdateLYOverrides call MagnetTrain_UpdateLYOverrides
call Function3b0c call PushLYOverrides
call DelayFrame call DelayFrame
ld a, [rSVBK] ld a, [rSVBK]
push af push af

View File

@ -588,9 +588,9 @@ Function16571: ; 16571
push de push de
ld e, a ld e, a
ld d, 0 ld d, 0
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
pop de pop de
ret ret
; 16613 ; 16613

View File

@ -188,9 +188,9 @@ MassageOrHaircut: ; 7420
.loop .loop
sub [hl] sub [hl]
jr c, .ok jr c, .ok
rept 3
inc hl inc hl
endr inc hl
inc hl
jr .loop jr .loop
.ok .ok

View File

@ -1109,7 +1109,7 @@ PokeAnim_GetSpeciesOrUnown: ; d065c
ret ret
; d0669 ; d0669
Functiond0669: ; d0669 Predef 48 Predef48: ; d0669 Predef 48
ld a, $1 ld a, $1
ld [wBoxAlignment], a ld [wBoxAlignment], a

View File

@ -798,12 +798,7 @@ NamesPointers:: ; 33ab
dbw 0, PartyMonOT dbw 0, PartyMonOT
dbw 0, OTPartyMonOT dbw 0, OTPartyMonOT
dba TrainerClassNames dba TrainerClassNames
; 33c0 dbw $4, $4b52 ; within PackMenuGFX
Function33c0:
inc b
ld d, d
ld c, e
; 33c3 ; 33c3
GetName:: ; 33c3 GetName:: ; 33c3
@ -834,9 +829,9 @@ GetName:: ; 33c3
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, NamesPointers ld hl, NamesPointers
rept 3
add hl, de add hl, de
endr add hl, de
add hl, de
ld a, [hli] ld a, [hli]
rst Bankswitch rst Bankswitch
ld a, [hli] ld a, [hli]
@ -1142,7 +1137,7 @@ InitScrollingMenu:: ; 352f
jp TextBox jp TextBox
; 354b ; 354b
Function354b:: ; 354b joypad JoyTextDelay_ForcehJoyDown:: ; 354b joypad
call DelayFrame call DelayFrame
ld a, [hInMenu] ld a, [hInMenu]
@ -1692,22 +1687,22 @@ PrintLevel:: ; 382d
; How many digits? ; How many digits?
ld c, 2 ld c, 2
cp 100 cp 100
jr c, Function3842 jr c, Print8BitNumRightAlign
; 3-digit numbers overwrite the :L. ; 3-digit numbers overwrite the :L.
dec hl dec hl
inc c inc c
jr Function3842 jr Print8BitNumRightAlign
; 383d ; 383d
Function383d:: ; 383d PrintLevel_Force3Digits:: ; 383d
; Print :L and all 3 digits ; Print :L and all 3 digits
ld [hl], "<LV>" ld [hl], "<LV>"
inc hl inc hl
ld c, 3 ld c, 3
; 3842 ; 3842
Function3842:: ; 3842 Print8BitNumRightAlign:: ; 3842
ld [wd265], a ld [wd265], a
ld de, wd265 ld de, wd265
ld b, PRINTNUM_RIGHTALIGN | 1 ld b, PRINTNUM_RIGHTALIGN | 1
@ -1715,6 +1710,8 @@ Function3842:: ; 3842
; 384d ; 384d
Function384d:: ; 384d Function384d:: ; 384d
; XXX
; GetNthMove
ld hl, wListMoves_MoveIndicesBuffer ld hl, wListMoves_MoveIndicesBuffer
ld c, a ld c, a
ld b, 0 ld b, 0
@ -1907,13 +1904,17 @@ GetPartyLocation:: ; 3927
; 392d ; 392d
Function392d:: ; 392d Function392d:: ; 392d
; XXX
; GetDexNumber
; Probably used in gen 1 to convert index number to dex number
; Not required in gen 2 because index number == dex number
push hl push hl
ld a, b ld a, b
dec a dec a
ld b, 0 ld b, 0
add hl, bc add hl, bc
ld hl, BaseData + 0 ld hl, BaseData + 0
ld bc, $0020 ld bc, BaseData1 - BaseData0
call AddNTimes call AddNTimes
ld a, BANK(BaseData) ld a, BANK(BaseData)
call GetFarHalfword call GetFarHalfword
@ -1925,7 +1926,7 @@ Function392d:: ; 392d
INCLUDE "home/battle.asm" INCLUDE "home/battle.asm"
Function3b0c:: ; 3b0c PushLYOverrides:: ; 3b0c
ld a, [hFFC6] ld a, [hFFC6]
and a and a

View File

@ -421,9 +421,9 @@ Copy1bpp:: ; fa4
push af push af
ld h, 0 ld h, 0
ld l, c ld l, c
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld b, h ld b, h
ld c, l ld c, l
pop af pop af

View File

@ -2,6 +2,8 @@
Function48c:: ; 48c Function48c:: ; 48c
; XXX
; TimeOfDayFade
ld a, [TimeOfDayPal] ld a, [TimeOfDayPal]
ld b, a ld b, a
ld hl, IncGradGBPalTable_11 ld hl, IncGradGBPalTable_11

View File

@ -100,7 +100,7 @@ Init:: ; 17d
ld [rSVBK], a ld [rSVBK], a
call ClearVRAM call ClearVRAM
call ClearSprites call ClearSprites
call Function270 call ClearsScratch
ld a, BANK(LoadPushOAM) ld a, BANK(LoadPushOAM)
@ -194,9 +194,10 @@ ClearVRAM:: ; 245
ClearWRAM:: ; 25a ClearWRAM:: ; 25a
; Wipe swappable WRAM banks (1-7) ; Wipe swappable WRAM banks (1-7)
; Assumes CGB or AGB
ld a, 1 ld a, 1
.asm_25c .bank_loop
push af push af
ld [rSVBK], a ld [rSVBK], a
xor a xor a
@ -206,15 +207,17 @@ ClearWRAM:: ; 25a
pop af pop af
inc a inc a
cp 8 cp 8
jr nc, .asm_25c jr nc, .bank_loop
ret ret
; 270 ; 270
Function270:: ; 270 ClearsScratch:: ; 270
ld a, $0 ; Wipe the first 32 bytes of sScratch
ld a, BANK(sScratch)
call GetSRAMBank call GetSRAMBank
ld hl, $a000 ld hl, sScratch
ld bc, $0020 ld bc, $20
xor a xor a
call ByteFill call ByteFill
call CloseSRAM call CloseSRAM

View File

@ -155,9 +155,9 @@ LoadMetatiles:: ; 2198
add a add a
ld l, a ld l, a
ld h, 0 ld h, 0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld a, [TilesetBlocksAddress] ld a, [TilesetBlocksAddress]
add l add l
ld l, a ld l, a
@ -694,9 +694,9 @@ RestoreFacingAfterWarp:: ; 248a
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
rept 3
inc hl ; get to the warp coords inc hl ; get to the warp coords
endr inc hl ; get to the warp coords
inc hl ; get to the warp coords
ld a, [WarpNumber] ld a, [WarpNumber]
dec a dec a
ld c, a ld c, a
@ -751,9 +751,9 @@ ChangeMap:: ; 24e4
ld [hConnectionStripLength], a ld [hConnectionStripLength], a
ld c, a ld c, a
ld b, 0 ld b, 0
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld c, 3 ld c, 3
add hl, bc add hl, bc
ld a, [MapBlockDataBank] ld a, [MapBlockDataBank]
@ -1072,7 +1072,7 @@ MapTextbox:: ; 269a
push hl push hl
call SpeechTextBox call SpeechTextBox
call Function2e31 call SafeUpdateSprites
ld a, 1 ld a, 1
ld [hOAMUpdate], a ld [hOAMUpdate], a
call ApplyTilemap call ApplyTilemap

View File

@ -229,9 +229,9 @@ _OffsetMenuDataHeader:: ; 1e35
; 1e5d ; 1e5d
DoNthMenu:: ; 1e5d DoNthMenu:: ; 1e5d
call MenuFunc_1e7f call DrawVariableLengthMenuBox
call MenuWriteText call MenuWriteText
call Function1eff call InitMenuCursorAndButtonPermissions
call GetStaticMenuJoypad call GetStaticMenuJoypad
call GetMenuJoypad call GetMenuJoypad
call MenuClickSound call MenuClickSound
@ -239,17 +239,17 @@ DoNthMenu:: ; 1e5d
; 1e70 ; 1e70
SetUpMenu:: ; 1e70 SetUpMenu:: ; 1e70
call MenuFunc_1e7f ; ??? call DrawVariableLengthMenuBox ; ???
call MenuWriteText call MenuWriteText
call Function1eff ; set up selection pointer call InitMenuCursorAndButtonPermissions ; set up selection pointer
ld hl, w2DMenuFlags1 ld hl, w2DMenuFlags1
set 7, [hl] set 7, [hl]
ret ret
MenuFunc_1e7f:: DrawVariableLengthMenuBox::
call CopyMenuData2 call CopyMenuData2
call GetMenuIndexSet call GetMenuIndexSet
call Function1ea6 call AutomaticGetMenuBottomCoord
call MenuBox call MenuBox
ret ret
@ -257,8 +257,8 @@ MenuWriteText::
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call GetMenuIndexSet ; sort out the text call GetMenuIndexSet ; sort out the text
call Function1eda ; actually write it call RunMenuItemPrintingFunction ; actually write it
call Function2e31 call SafeUpdateSprites
ld a, [hOAMUpdate] ld a, [hOAMUpdate]
push af push af
ld a, $1 ld a, $1
@ -269,7 +269,7 @@ MenuWriteText::
ret ret
; 0x1ea6 ; 0x1ea6
Function1ea6:: ; 1ea6 AutomaticGetMenuBottomCoord:: ; 1ea6
ld a, [wMenuBorderLeftCoord] ld a, [wMenuBorderLeftCoord]
ld c, a ld c, a
ld a, [wMenuBorderRightCoord] ld a, [wMenuBorderRightCoord]
@ -310,7 +310,7 @@ GetMenuIndexSet:: ; 1ebd
ret ret
; 1eda ; 1eda
Function1eda:: ; 1eda RunMenuItemPrintingFunction:: ; 1eda
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld bc, 2 * SCREEN_WIDTH + 2 ld bc, 2 * SCREEN_WIDTH + 2
add hl, bc add hl, bc
@ -325,7 +325,7 @@ Function1eda:: ; 1eda
ld d, h ld d, h
ld e, l ld e, l
ld hl, wMenuData2DisplayFunctionPointer ld hl, wMenuData2DisplayFunctionPointer
call .__wMenuData2DisplayFunction__ call ._hl_
pop hl pop hl
ld de, 2 * SCREEN_WIDTH ld de, 2 * SCREEN_WIDTH
add hl, de add hl, de
@ -333,14 +333,14 @@ Function1eda:: ; 1eda
jr .loop jr .loop
; 1efb ; 1efb
.__wMenuData2DisplayFunction__ ; 1efb ._hl_ ; 1efb
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
jp [hl] jp [hl]
; 1eff ; 1eff
Function1eff:: ; 1eff InitMenuCursorAndButtonPermissions:: ; 1eff
call InitVerticalMenuCursor call InitVerticalMenuCursor
ld hl, wMenuJoypadFilter ld hl, wMenuJoypadFilter
ld a, [wMenuData2Flags] ld a, [wMenuData2Flags]

View File

@ -150,9 +150,9 @@ SetMenuAttributes:: ; 1bb1
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
pop bc pop bc
pop hl pop hl
ret ret

View File

@ -525,7 +525,7 @@ Paragraph:: ; 12f2
call LoadBlinkingCursor call LoadBlinkingCursor
.linkbattle .linkbattle
call Function13b6 call Text_WaitBGMap
call ButtonSound call ButtonSound
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
@ -546,7 +546,7 @@ Char4B:: ; 131f
call LoadBlinkingCursor call LoadBlinkingCursor
.communication .communication
call Function13b6 call Text_WaitBGMap
push de push de
call ButtonSound call ButtonSound
@ -598,7 +598,7 @@ PromptText:: ; 135a
call LoadBlinkingCursor call LoadBlinkingCursor
.ok .ok
call Function13b6 call Text_WaitBGMap
call ButtonSound call ButtonSound
ld a, [wLinkMode] ld a, [wLinkMode]
cp LINK_COLOSSEUM cp LINK_COLOSSEUM
@ -655,7 +655,7 @@ TextScroll:: ; 138c
ret ret
; 13b6 ; 13b6
Function13b6:: ; 13b6 Text_WaitBGMap:: ; 13b6
push bc push bc
ld a, [hOAMUpdate] ld a, [hOAMUpdate]
push af push af
@ -1029,6 +1029,8 @@ Text_PlaySound:: ; 1500
; 1522 ; 1522
Function1522:: ; 1522 Function1522:: ; 1522
; XXX
; TX_CRY
push de push de
ld e, [hl] ld e, [hl]
inc hl inc hl

View File

@ -39,7 +39,7 @@ CloseText:: ; 2dcf
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call Function2e31 call SafeUpdateSprites
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
call ReplaceKrisSprite call ReplaceKrisSprite
@ -78,7 +78,7 @@ _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 2e20
ret ret
; 2e31 ; 2e31
Function2e31:: ; 2e31 SafeUpdateSprites:: ; 2e31
ld a, [hOAMUpdate] ld a, [hOAMUpdate]
push af push af
ld a, [hBGMapMode] ld a, [hBGMapMode]
@ -87,7 +87,9 @@ Function2e31:: ; 2e31
ld [hBGMapMode], a ld [hBGMapMode], a
ld a, $1 ld a, $1
ld [hOAMUpdate], a ld [hOAMUpdate], a
call UpdateSprites call UpdateSprites
xor a xor a
ld [hOAMUpdate], a ld [hOAMUpdate], a
call DelayFrame call DelayFrame

View File

@ -937,9 +937,9 @@ GLOBAL EvosAttacksPointers
pop bc pop bc
ret nz ret nz
rept 3
inc hl inc hl
endr inc hl
inc hl
; Moon Stone's constant from Pokémon Red is used. ; Moon Stone's constant from Pokémon Red is used.
; No Pokémon evolve with Burn Heal, ; No Pokémon evolve with Burn Heal,

View File

@ -745,9 +745,9 @@ Function110438: ; 110438
ld a, $c8 ld a, $c8
ld [hli], a ld [hli], a
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld a, $ff ld a, $ff
ld [$c86e], a ld [$c86e], a
@ -968,9 +968,9 @@ Function1105dd: ; 1105dd
ld a, $c8 ld a, $c8
ld [hli], a ld [hli], a
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld a, $ff ld a, $ff
ld [$c86e], a ld [$c86e], a
@ -2274,9 +2274,9 @@ Function110ddd: ; 110ddd
.asm_110ee3 .asm_110ee3
ld hl, $c98b ld hl, $c98b
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
pop bc pop bc
pop de pop de
@ -3081,9 +3081,9 @@ Function1113fe: ; 1113fe
push hl push hl
ld hl, $c829 ld hl, $c829
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld de, $cb47 ld de, $cb47
ld hl, Unknown_112072 ld hl, Unknown_112072
@ -3578,9 +3578,9 @@ _MobileReceive:: ; 1116c5 (44:56c5)
ld [$c800], a ld [$c800], a
xor a xor a
ld hl, $c80a ld hl, $c80a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld hl, $c81f ld hl, $c81f
ld a, [hli] ld a, [hli]
ld b, a ld b, a
@ -9143,9 +9143,9 @@ Function113c8e: ; 113c8e
ld bc, $0003 ld bc, $0003
.asm_113ccf .asm_113ccf
rept 3
dec bc dec bc
endr dec bc
dec bc
ld a, c ld a, c
ld [$cc10], a ld [$cc10], a
ld a, b ld a, b

View File

@ -127,7 +127,7 @@ LoadFonts_NoOAMUpdate:: ; 64bf
call LoadFontsExtra call LoadFontsExtra
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
call Function2e31 call SafeUpdateSprites
call LoadStandardFont call LoadStandardFont
ret ret
@ -933,8 +933,8 @@ StartMenu_PrintBugContestStatus: ; 24be7
ld h, b ld h, b
ld l, c ld l, c
inc hl inc hl
ld c, $3 ld c, 3
call Function3842 call Print8BitNumRightAlign
.skip_level .skip_level
pop af pop af
@ -1517,9 +1517,9 @@ ClearBattleRAM: ; 2ef18
ld [wBattleResult], a ld [wBattleResult], a
ld hl, wPartyMenuCursor ld hl, wPartyMenuCursor
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld [wMenuScrollPosition], a ld [wMenuScrollPosition], a
@ -2782,9 +2782,9 @@ Special_CheckForLuckyNumberWinners: ; 4d87a
jr z, .SkipBox jr z, .SkipBox
ld hl, .BoxBankAddresses ld hl, .BoxBankAddresses
ld b, 0 ld b, 0
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld a, [hli] ld a, [hli]
call GetSRAMBank call GetSRAMBank
ld a, [hli] ld a, [hli]
@ -3505,7 +3505,7 @@ CheckBattleScene: ; 4ea44
.mobile .mobile
ld a, [wcd2f] ld a, [wcd2f]
and a and a
jr nz, .asm_4ea72 jr nz, .from_wram
ld a, $4 ld a, $4
call GetSRAMBank call GetSRAMBank
@ -3520,7 +3520,7 @@ CheckBattleScene: ; 4ea44
and a and a
ret ret
.asm_4ea72 .from_wram
ld a, $5 ld a, $5
ld hl, w5_dc00 ld hl, w5_dc00
call GetFarWRAMByte call GetFarWRAMByte
@ -3782,9 +3782,10 @@ DrawHP: ; 50b10
ld [wWhichHPBar], a ld [wWhichHPBar], a
push hl push hl
push bc push bc
; box mons have full HP
ld a, [MonType] ld a, [MonType]
cp BOXMON cp BOXMON
jr z, .asm_50b30 jr z, .at_least_1_hp
ld a, [TempMonHP] ld a, [TempMonHP]
ld b, a ld b, a
@ -3793,34 +3794,34 @@ DrawHP: ; 50b10
; Any HP? ; Any HP?
or b or b
jr nz, .asm_50b30 jr nz, .at_least_1_hp
xor a xor a
ld c, a ld c, a
ld e, a ld e, a
ld a, 6 ld a, 6
ld d, a ld d, a
jp .asm_50b4a jp .fainted
.asm_50b30 .at_least_1_hp
ld a, [TempMonMaxHP] ld a, [TempMonMaxHP]
ld d, a ld d, a
ld a, [TempMonMaxHP + 1] ld a, [TempMonMaxHP + 1]
ld e, a ld e, a
ld a, [MonType] ld a, [MonType]
cp BOXMON cp BOXMON
jr nz, .asm_50b41 jr nz, .not_boxmon
ld b, d ld b, d
ld c, e ld c, e
.asm_50b41 .not_boxmon
predef ComputeHPBarPixels predef ComputeHPBarPixels
ld a, 6 ld a, 6
ld d, a ld d, a
ld c, a ld c, a
.asm_50b4a .fainted
ld a, c ld a, c
pop bc pop bc
ld c, a ld c, a
@ -3832,14 +3833,14 @@ DrawHP: ; 50b10
pop hl pop hl
; Print HP ; Print HP
ld bc, $15 ; move (1,1) bccoord 1, 1, 0
add hl, bc add hl, bc
ld de, TempMonHP ld de, TempMonHP
ld a, [MonType] ld a, [MonType]
cp BOXMON cp BOXMON
jr nz, .asm_50b66 jr nz, .not_boxmon_2
ld de, TempMonMaxHP ld de, TempMonMaxHP
.asm_50b66 .not_boxmon_2
lb bc, 2, 3 lb bc, 2, 3
call PrintNum call PrintNum
@ -4029,9 +4030,9 @@ ListMovePP: ; 50c50
.skip .skip
pop hl pop hl
rept 3
inc hl inc hl
endr inc hl
inc hl
ld d, h ld d, h
ld e, l ld e, l
ld hl, TempMonMoves ld hl, TempMonMoves
@ -4108,7 +4109,7 @@ Function50cd0: ; 50cd0
jr nz, .loop jr nz, .loop
ret ret
Function50cdb: ; unreferenced predef Predef22: ; unreferenced predef
push hl push hl
push hl push hl
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
@ -5659,19 +5660,19 @@ String_PM: db "PM@" ; 1dd6ff
INCLUDE "engine/diploma.asm" INCLUDE "engine/diploma.asm"
LoadSGBPokedexGFX: ; 1ddf1c LoadSGBPokedexGFX: ; 1ddf1c
ld hl, LZ_1ddf33 ld hl, SGBPokedexGFX_LZ
ld de, VTiles2 tile $31 ld de, VTiles2 tile $31
call Decompress call Decompress
ret ret
LoadSGBPokedexGFX2: ; 1ddf26 (77:5f26) LoadSGBPokedexGFX2: ; 1ddf26 (77:5f26)
ld hl, LZ_1ddf33 ld hl, SGBPokedexGFX_LZ
ld de, VTiles2 tile $31 ld de, VTiles2 tile $31
lb bc, BANK(LZ_1ddf33), $3a lb bc, BANK(SGBPokedexGFX_LZ), $3a
call DecompressRequest2bpp call DecompressRequest2bpp
ret ret
LZ_1ddf33: ; 1ddf33 SGBPokedexGFX_LZ: ; 1ddf33
INCBIN "gfx/pokedex/sgb.2bpp.lz" INCBIN "gfx/pokedex/sgb.2bpp.lz"
LoadQuestionMarkPic: ; 1de0d7 LoadQuestionMarkPic: ; 1de0d7

View File

@ -576,16 +576,16 @@ Function17aa22: ; 17aa22 (5e:6a22)
push de push de
ld a, $3 ld a, $3
call Function17aae0 call Function17aae0
rept 3
add a add a
endr add a
add a
add $0 add $0
push af push af
ld a, $4 ld a, $4
call Function17aae0 call Function17aae0
rept 3
add a add a
endr add a
add a
add $8 add $8
ld c, a ld c, a
pop af pop af

View File

@ -550,9 +550,9 @@ _Get1bpp:: ; 1042b2
ld a, b ld a, b
ld l, c ld l, c
ld h, $0 ld h, $0
rept 3
add hl, hl ; multiply by 8 add hl, hl ; multiply by 8
endr add hl, hl ; multiply by 8
add hl, hl ; multiply by 8
ld c, l ld c, l
ld b, h ld b, h
ld h, d ld h, d

View File

@ -53,9 +53,9 @@ MobileCheckOwnMonAnywhere: ; 4a843
jr z, .asm_4a8d1 jr z, .asm_4a8d1
ld hl, .BoxAddrs ld hl, .BoxAddrs
ld b, 0 ld b, 0
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
ld a, [hli] ld a, [hli]
call GetSRAMBank call GetSRAMBank
ld a, [hli] ld a, [hli]

View File

@ -45,7 +45,9 @@ Function8917a: ; 8917a (22:517a)
ret ret
Function89185: ; 89185 (22:5185) Function89185: ; 89185 (22:5185)
; Compares c bytes starting at de and hl and incrementing together until a match is found. ; strcmp(hl, de, c)
; Compares c bytes starting at de and hl and incrementing together until a mismatch is found.
; Preserves hl and de.
push de push de
push hl push hl
.loop .loop
@ -62,7 +64,9 @@ Function89185: ; 89185 (22:5185)
ret ret
Function89193: ; 89193 Function89193: ; 89193
; copy(hl, de, 4)
; Copies c bytes from hl to de. ; Copies c bytes from hl to de.
; Preserves hl and de.
push de push de
push hl push hl
.loop .loop
@ -355,10 +359,10 @@ Function89305: ; 89305 (22:5305)
Function8931b: ; 8931b Function8931b: ; 8931b
push hl push hl
ld hl, $a03b ld hl, $a03b ; 4:a03b
ld a, [MenuSelection] ld a, [MenuSelection]
dec a dec a
ld bc, $0025 ld bc, 37
call AddNTimes call AddNTimes
ld b, h ld b, h
ld c, l ld c, l
@ -371,7 +375,9 @@ Function8932d: ; 8932d
add hl, bc add hl, bc
Function89331: ; 89331 Function89331: ; 89331
; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator. Sets carry if it does not find a nonspace character. Returns the location of the following character in hl. ; Scans up to 5 characters starting at hl, looking for a nonspace character up to the next terminator.
; Sets carry if it does not find a nonspace character.
; Returns the location of the following character in hl.
push bc push bc
ld c, 5 ld c, 5
.loop .loop
@ -1649,44 +1655,44 @@ String_89a53: ; 89a53
; 89a57 ; 89a57
Function89a57: ; 89a57 Function89a57: ; 89a57
call Function354b call JoyTextDelay_ForcehJoyDown ; joypad
bit 6, c bit D_UP_F, c
jr nz, .asm_89a78 jr nz, .d_up
bit 7, c bit D_DOWN_F, c
jr nz, .asm_89a81 jr nz, .d_down
bit 0, c bit A_BUTTON_F, c
jr nz, .asm_89a70 jr nz, .a_b_button
bit 1, c bit B_BUTTON_F, c
jr nz, .asm_89a70 jr nz, .a_b_button
bit 3, c bit START_F, c
jr nz, .asm_89a74 jr nz, .start_button
scf scf
ret ret
.asm_89a70 .a_b_button
ld a, $1 ld a, $1
and a and a
ret ret
.asm_89a74 .start_button
ld a, $2 ld a, $2
and a and a
ret ret
.asm_89a78 .d_up
call Function89a9b call .MoveCursorUp
call nc, Function89a8a call nc, .PlayPocketSwitchSFX
ld a, $0 ld a, $0
ret ret
.asm_89a81 .d_down
call Function89a93 call .MoveCursorDown
call nc, Function89a8a call nc, .PlayPocketSwitchSFX
ld a, $0 ld a, $0
ret ret
; 89a8a ; 89a8a
Function89a8a: ; 89a8a .PlayPocketSwitchSFX: ; 89a8a
push af push af
ld de, SFX_SWITCH_POCKETS ld de, SFX_SWITCH_POCKETS
call PlaySFX call PlaySFX
@ -1694,42 +1700,42 @@ Function89a8a: ; 89a8a
ret ret
; 89a93 ; 89a93
Function89a93: ; 89a93 .MoveCursorDown: ; 89a93
ld d, $28 ld d, 40
ld e, $1 ld e, 1
call Function89aa3 call .ApplyCursorMovement
ret ret
; 89a9b ; 89a9b
Function89a9b: ; 89a9b .MoveCursorUp: ; 89a9b
ld d, $1 ld d, 1
ld e, $ff ld e, -1
call Function89aa3 call .ApplyCursorMovement
ret ret
; 89aa3 ; 89aa3
Function89aa3: ; 89aa3 .ApplyCursorMovement: ; 89aa3
ld a, [MenuSelection] ld a, [MenuSelection]
ld c, a ld c, a
push bc push bc
.asm_89aa8 .loop
ld a, [MenuSelection] ld a, [MenuSelection]
cp d cp d
jr z, .asm_89ac0 jr z, .equal_to_d
add e add e
jr nz, .asm_89ab2 jr nz, .not_zero
inc a inc a
.asm_89ab2 .not_zero
ld [MenuSelection], a ld [MenuSelection], a
call Function89ac7 call .Function89ac7 ; BCD conversion of data in SRAM?
jr nc, .asm_89aa8 jr nc, .loop
call Function89ae6 call .Function89ae6 ; split [MenuSelection] into [wd030] + [wd031] where [wd030] <= 5
pop bc pop bc
and a and a
ret ret
.asm_89ac0 .equal_to_d
pop bc pop bc
ld a, c ld a, c
ld [MenuSelection], a ld [MenuSelection], a
@ -1737,48 +1743,48 @@ Function89aa3: ; 89aa3
ret ret
; 89ac7 ; 89ac7
Function89ac7: ; 89ac7 .Function89ac7: ; 89ac7
call OpenSRAMBank4 call OpenSRAMBank4
call Function8931b call Function8931b
call Function89ad4 call .Function89ad4
call CloseSRAM call CloseSRAM
ret ret
; 89ad4 ; 89ad4
Function89ad4: ; 89ad4 .Function89ad4: ; 89ad4
push de push de
call Function8932d call Function8932d ; find a non-space character within 5 bytes of bc
jr c, .asm_89ae3 jr c, .no_nonspace_character
ld hl, $0011 ld hl, 17
add hl, bc add hl, bc
call Function89b45 call Function89b45
jr c, .asm_89ae4 jr c, .finish_decode
.asm_89ae3 .no_nonspace_character
and a and a
.asm_89ae4 .finish_decode
pop de pop de
ret ret
; 89ae6 ; 89ae6
Function89ae6: ; 89ae6 .Function89ae6: ; 89ae6
ld hl, wd031 ld hl, wd031
xor a xor a
ld [hl], a ld [hl], a
ld a, [MenuSelection] ld a, [MenuSelection]
.asm_89aee .loop2
cp $6 cp 6
jr c, .asm_89afc jr c, .load_and_ret
sub $5 sub 5
ld c, a ld c, a
ld a, [hl] ld a, [hl]
add $5 add 5
ld [hl], a ld [hl], a
ld a, c ld a, c
jr .asm_89aee jr .loop2
.asm_89afc .load_and_ret
ld [wd030], a ld [wd030], a
ret ret
; 89b00 ; 89b00
@ -1823,48 +1829,50 @@ Function89b3b: ; 89b3b (22:5b3b)
ret ret
Function89b45: ; 89b45 Function89b45: ; 89b45
; some sort of decoder?
; BCD?
push hl push hl
push bc push bc
ld c, $10 ld c, $10
ld e, $0 ld e, $0
.asm_89b4b .loop
ld a, [hli] ld a, [hli]
ld b, a ld b, a
and $f and $f
cp $a cp 10
jr c, .asm_89b5a jr c, .low_nybble_less_than_10
ld a, c ld a, c
cp $b cp $b
jr nc, .asm_89b74 jr nc, .clear_carry
jr .asm_89b71 jr .set_carry
.asm_89b5a .low_nybble_less_than_10
dec c dec c
swap b swap b
inc e inc e
ld a, b ld a, b
and $f and $f
cp $a cp 10
jr c, .asm_89b6c jr c, .high_nybble_less_than_10
ld a, c ld a, c
cp $b cp $b
jr nc, .asm_89b74 jr nc, .clear_carry
jr .asm_89b71 jr .set_carry
.asm_89b6c .high_nybble_less_than_10
inc e inc e
dec c dec c
jr nz, .asm_89b4b jr nz, .loop
dec e dec e
.asm_89b71 .set_carry
scf scf
jr .asm_89b75 jr .finish
.asm_89b74 .clear_carry
and a and a
.asm_89b75 .finish
pop bc pop bc
pop hl pop hl
ret ret
@ -2027,56 +2035,59 @@ Function89c44: ; 89c44 (22:5c44)
ret ret
Function89c67: ; 89c67 (22:5c67) Function89c67: ; 89c67 (22:5c67)
call Function354b ; menu scrolling?
call JoyTextDelay_ForcehJoyDown ; joypad
ld b, $0 ld b, $0
bit 0, c bit A_BUTTON_F, c
jr z, .asm_89c74 jr z, .not_a_button
ld b, $1 ld b, $1
and a and a
ret ret
.asm_89c74
bit 1, c .not_a_button
jr z, .asm_89c7a bit B_BUTTON_F, c
jr z, .not_b_button
scf scf
ret ret
.asm_89c7a
.not_b_button
xor a xor a
bit 6, c bit D_UP_F, c
jr z, .asm_89c81 jr z, .not_d_up
ld a, $1 ld a, $1
.asm_89c81 .not_d_up
bit 7, c bit D_DOWN_F, c
jr z, .asm_89c87 jr z, .not_d_down
ld a, $2 ld a, $2
.asm_89c87 .not_d_down
bit 5, c bit D_LEFT_F, c
jr z, .asm_89c8d jr z, .not_d_left
ld a, $3 ld a, $3
.asm_89c8d .not_d_left
bit 4, c bit D_RIGHT_F, c
jr z, .asm_89c93 jr z, .not_d_right
ld a, $4 ld a, $4
.asm_89c93 .not_d_right
and a and a
ret z ret z ; no dpad pressed
dec a dec a
ld c, a ld c, a
ld d, $0 ld d, $0
ld hl, Unknown_89cbf ld hl, .ScrollData0
ld a, [wd02f] ld a, [wd02f]
and a and a
jr z, .asm_89ca5 jr z, .got_data
ld hl, Unknown_89ccf ld hl, .ScrollData1
.asm_89ca5 .got_data
ld a, [wd011] ld a, [wd011]
and a and a
jr z, .asm_89cb1 jr z, .got_row
ld e, $4 ld e, $4
.asm_89cad .add_n_times
add hl, de add hl, de
dec a dec a
jr nz, .asm_89cad jr nz, .add_n_times
.asm_89cb1 .got_row
ld e, c ld e, c
add hl, de add hl, de
ld a, [hl] ld a, [hl]
@ -2089,13 +2100,13 @@ Function89c67: ; 89c67 (22:5c67)
ret ret
; 89cbf (22:5cbf) ; 89cbf (22:5cbf)
Unknown_89cbf: ; 89cbf .ScrollData0: ; 89cbf
db 0, 2, 0, 0 db 0, 2, 0, 0
db 1, 3, 0, 0 db 1, 3, 0, 0
db 2, 4, 0, 0 db 2, 4, 0, 0
db 3, 0, 0, 0 db 3, 0, 0, 0
Unknown_89ccf: ; 89ccf .ScrollData1: ; 89ccf
db 0, 0, 0, 0 db 0, 0, 0, 0
db 0, 3, 0, 0 db 0, 3, 0, 0
db 2, 4, 0, 0 db 2, 4, 0, 0
@ -2305,7 +2316,7 @@ Jumptable_89e18: ; 89e18 (22:5e18)
Function89e1e: ; 89e1e (22:5e1e) Function89e1e: ; 89e1e (22:5e1e)
call OpenSRAMBank4 call OpenSRAMBank4
ld bc, $a037 ld bc, $a037 ; 4:a037
call Function8b36c call Function8b36c
call CloseSRAM call CloseSRAM
xor a xor a
@ -2648,9 +2659,9 @@ Function8a055: ; 8a055 (22:6055)
ld a, $5 ld a, $5
call Function8a5a3 call Function8a5a3
pop hl pop hl
rept 3
inc hl inc hl
endr inc hl
inc hl
ld a, $6 ld a, $6
call Function8a5a3 call Function8a5a3
call CGBOnly_LoadEDTile call CGBOnly_LoadEDTile
@ -4061,7 +4072,7 @@ Function8aab6: ; 8aab6 (22:6ab6)
; 8aaf0 (22:6af0) ; 8aaf0 (22:6af0)
String_8aaf0: ; 8aaf0 String_8aaf0: ; 8aaf0
db "あたらしい めいし", $4a, "できまし", $22, "@" db "あたらしい めいし<PKMN>できまし<LNBRK>@"
; 8ab00 ; 8ab00
Function8ab00: ; 8ab00 Function8ab00: ; 8ab00
@ -4096,6 +4107,7 @@ Function8ab11: ; 8ab11 (22:6b11)
ret ret
Function8ab3b: ; 8ab3b (22:6b3b) Function8ab3b: ; 8ab3b (22:6b3b)
.pressed_start
call Function891fe call Function891fe
call ClearBGPalettes call ClearBGPalettes
call Function893cc call Function893cc
@ -4114,23 +4126,24 @@ Function8ab3b: ; 8ab3b (22:6b3b)
call Function89a0c call Function89a0c
call CloseSRAM call CloseSRAM
call Function891ab call Function891ab
call Function8ab77 call .JoypadLoop
jr c, Function8ab3b jr c, .pressed_start
ret ret
Function8ab77: ; 8ab77 (22:6b77) .JoypadLoop: ; 8ab77 (22:6b77)
call Function354b call JoyTextDelay_ForcehJoyDown
bit 0, c bit A_BUTTON_F, c
jr nz, .asm_8ab8e jr nz, .a_b_button
bit 1, c bit B_BUTTON_F, c
jr nz, .asm_8ab8e jr nz, .a_b_button
bit 3, c bit START_F, c
jr z, Function8ab77 jr z, .JoypadLoop
call PlayClickSFX call PlayClickSFX
call Function89d0d call Function89d0d
scf scf
ret ret
.asm_8ab8e
.a_b_button
call PlayClickSFX call PlayClickSFX
and a and a
ret ret

View File

@ -54,16 +54,18 @@ Function8b363: ; 8b363
; 8b36c ; 8b36c
Function8b36c: ; 8b36c (22:736c) Function8b36c: ; 8b36c (22:736c)
; [bc + (0:4)] = -1
push bc push bc
ld h, b ld h, b
ld l, c ld l, c
ld bc, $4 ld bc, 4
ld a, -1 ld a, -1
call ByteFill call ByteFill
pop bc pop bc
ret ret
Function8b379: ; 8b379 (22:7379) Function8b379: ; 8b379 (22:7379)
; d = [bc + e]
push bc push bc
ld a, c ld a, c
add e add e
@ -77,6 +79,7 @@ Function8b379: ; 8b379 (22:7379)
ret ret
Function8b385: ; 8b385 (22:7385) Function8b385: ; 8b385 (22:7385)
; [bc + e] = d
push bc push bc
ld a, c ld a, c
add e add e
@ -90,36 +93,39 @@ Function8b385: ; 8b385 (22:7385)
ret ret
Function8b391: ; 8b391 (22:7391) Function8b391: ; 8b391 (22:7391)
; find first e in range(4) such that [bc + e] == -1
; if none exist, return carry
push bc push bc
ld e, $0 ld e, 0
ld d, $4 ld d, 4
.asm_8b396 .loop
ld a, [bc] ld a, [bc]
inc bc inc bc
cp $ff cp -1
jr z, .asm_8b3a2 jr z, .done
inc e inc e
dec d dec d
jr nz, .asm_8b396 jr nz, .loop
dec e dec e
scf scf
.asm_8b3a2 .done
pop bc pop bc
ret ret
Function8b3a4: ; 8b3a4 (22:73a4) Function8b3a4: ; 8b3a4 (22:73a4)
; strcmp(hl, bc, 4)
push de push de
push bc push bc
ld d, b ld d, b
ld e, c ld e, c
ld c, $4 ld c, 4
call Function89185 call Function89185
pop bc pop bc
pop de pop de
ret ret
Function8b3b0: ; 8b3b0 (22:73b0) Function8b3b0: ; 8b3b0 (22:73b0)
ld bc, $a037 ld bc, $a037 ; 4:a037
ld a, [$a60b] ld a, [$a60b]
and a and a
jr z, .asm_8b3c2 jr z, .asm_8b3c2
@ -153,82 +159,88 @@ Function8b3cd: ; 8b3cd (22:73cd)
Function8b3dd: ; 8b3dd (22:73dd) Function8b3dd: ; 8b3dd (22:73dd)
push de push de
push bc push bc
call Function354b call JoyTextDelay_ForcehJoyDown ; joypad
ld a, c ld a, c
pop bc pop bc
pop de pop de
bit 0, a bit A_BUTTON_F, a
jr nz, .asm_8b3f7 jr nz, .a_button
bit 1, a bit B_BUTTON_F, a
jr nz, .asm_8b40e jr nz, .b_button
bit 6, a bit D_UP_F, a
jr nz, .asm_8b429 jr nz, .d_up
bit 7, a bit D_DOWN_F, a
jr nz, .asm_8b443 jr nz, .d_down
and a and a
ret ret
.asm_8b3f7
.a_button
ld a, e ld a, e
cp $3 cp $3
jr z, .asm_8b407 jr z, .e_is_zero
inc e inc e
ld d, $0 ld d, 0
call Function8b385 call Function8b385
xor a xor a
ld [wd010], a ld [wd010], a
ret ret
.asm_8b407
.e_is_zero
call PlayClickSFX call PlayClickSFX
ld d, $0 ld d, $0
scf scf
ret ret
.asm_8b40e
.b_button
ld a, e ld a, e
and a and a
jr nz, .asm_8b41e jr nz, .e_is_not_zero
call PlayClickSFX call PlayClickSFX
ld d, $ff ld d, -1
call Function8b385 call Function8b385
ld d, $1 ld d, 1
scf scf
ret ret
.asm_8b41e
ld d, $ff .e_is_not_zero
ld d, -1
call Function8b385 call Function8b385
dec e dec e
xor a xor a
ld [wd010], a ld [wd010], a
ret ret
.asm_8b429
.d_up
call Function8b379 call Function8b379
ld a, d ld a, d
cp $a cp $a
jr c, .asm_8b433 jr c, .less_than_10_up_1
ld d, $9 ld d, $9
.asm_8b433 .less_than_10_up_1
inc d inc d
ld a, d ld a, d
cp $a cp $a
jr c, .asm_8b43b jr c, .less_than_10_up_2
ld d, $0 ld d, $0
.asm_8b43b .less_than_10_up_2
call Function8b385 call Function8b385
xor a xor a
ld [wd010], a ld [wd010], a
ret ret
.asm_8b443
.d_down
call Function8b379 call Function8b379
ld a, d ld a, d
cp $a cp $a
jr c, .asm_8b44d jr c, .less_than_10_down
ld d, $0 ld d, $0
.asm_8b44d .less_than_10_down
ld a, d ld a, d
dec d dec d
and a and a
jr nz, .asm_8b454 jr nz, .nonzero_down
ld d, $9 ld d, $9
.asm_8b454 .nonzero_down
call Function8b385 call Function8b385
xor a xor a
ld [wd010], a ld [wd010], a
@ -403,6 +415,7 @@ Function8b539: ; 8b539 (22:7539)
ret ret
Function8b555: ; 8b555 (22:7555) Function8b555: ; 8b555 (22:7555)
.loop
ld hl, UnknownText_0x8b5ce ld hl, UnknownText_0x8b5ce
call PrintText call PrintText
ld bc, wd017 ld bc, wd017
@ -416,27 +429,29 @@ Function8b555: ; 8b555 (22:7555)
jr nz, .asm_8b57c jr nz, .asm_8b57c
ld hl, UnknownText_0x8b5e2 ld hl, UnknownText_0x8b5e2
call PrintText call PrintText
jr Function8b555 jr .loop
.asm_8b57c .asm_8b57c
ld hl, UnknownText_0x8b5d3 ld hl, UnknownText_0x8b5d3
call PrintText call PrintText
ld bc, wd013 ld bc, wd013
call Function8b45c call Function8b45c
jr c, Function8b555 jr c, .loop
ld bc, wd017 ld bc, wd017
ld hl, wd013 ld hl, wd013
call Function8b3a4 call Function8b3a4
jr z, .asm_8b5a6 jr z, .strings_equal
call Function89448 call Function89448
ld bc, wd013 ld bc, wd013
call Function8b493 call Function8b493
ld hl, UnknownText_0x8b5d8 ld hl, UnknownText_0x8b5d8
call PrintText call PrintText
jr .asm_8b57c jr .asm_8b57c
.asm_8b5a6
.strings_equal
call OpenSRAMBank4 call OpenSRAMBank4
ld hl, wd013 ld hl, wd013
ld de, $a037 ld de, $a037 ; 4:a037
ld bc, $4 ld bc, $4
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
@ -504,7 +519,7 @@ Function8b5e7: ; 8b5e7 (22:75e7)
ld bc, wd013 ld bc, wd013
call Function8b493 call Function8b493
call OpenSRAMBank4 call OpenSRAMBank4
ld hl, $a037 ld hl, $a037 ; 4:a037
call Function8b3a4 call Function8b3a4
call CloseSRAM call CloseSRAM
jr z, .asm_8b635 jr z, .asm_8b635

View File

@ -1167,9 +1167,9 @@ Function1006fd: ; 1006fd
ld hl, $a800 ld hl, $a800
call GetSRAMBank call GetSRAMBank
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
call CloseSRAM call CloseSRAM
ret ret
; 10070d ; 10070d
@ -7211,9 +7211,9 @@ Function1030cd: ; 1030cd
ld a, [wcf44] ld a, [wcf44]
ld l, a ld l, a
ld h, 0 ld h, 0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld bc, Unknown_103112 ld bc, Unknown_103112
add hl, bc add hl, bc
ld b, $30 ld b, $30

View File

@ -181,9 +181,9 @@ MobileFn_105fe3: mobile ; 105fe3
inc [hl] inc [hl]
jr nz, .asm_106001 jr nz, .asm_106001
ld a, $ff ld a, $ff
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
.asm_106001 .asm_106001
@ -211,9 +211,9 @@ MobileFn_106008: mobile ; 106008
inc [hl] inc [hl]
jr nz, .asm_106027 jr nz, .asm_106027
ld a, $ff ld a, $ff
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
.asm_106027 .asm_106027
@ -606,9 +606,9 @@ _MobilePrintNum:: ; 1061ef
ld de, ._9 ld de, ._9
.three_to_nine_digits .three_to_nine_digits
rept 3
inc de inc de
endr inc de
inc de
dec a dec a
dec a dec a
@ -689,9 +689,9 @@ endr
sbc b sbc b
ld [hPrintNum6], a ld [hPrintNum6], a
ld a, [de] ld a, [de]
rept 3
inc de inc de
endr inc de
inc de
ld b, a ld b, a
ld a, [hPrintNum1] ld a, [hPrintNum1]
sbc b sbc b

View File

@ -634,9 +634,9 @@ Function1144d1: ; 1144d1
dec de dec de
dec de dec de
push de push de
rept 3
inc de inc de
endr inc de
inc de
inc hl inc hl
ld a, [de] ld a, [de]
ld [hli], a ld [hli], a
@ -4460,9 +4460,9 @@ Function1158c2: ; 1158c2
ld bc, $0003 ld bc, $0003
.asm_115914 .asm_115914
rept 3
dec bc dec bc
endr dec bc
dec bc
ld a, c ld a, c
ld [$dc19], a ld [$dc19], a
ld a, b ld a, b
@ -5139,9 +5139,9 @@ endr
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
rept 3
inc de inc de
endr inc de
inc de
ld [hl], d ld [hl], d
dec hl dec hl
ld [hl], e ld [hl], e

View File

@ -3767,9 +3767,9 @@ Function119b6b: ; 119b6b
ld [hld], a ld [hld], a
dec hl dec hl
pop de pop de
rept 3
inc hl inc hl
endr inc hl
inc hl
ld a, h ld a, h
cp $e0 cp $e0
jr c, .asm_119b93 jr c, .asm_119b93

View File

@ -495,9 +495,9 @@ Function171aec: ; 171aec (5c:5aec)
.asm_171b34 .asm_171b34
pop hl pop hl
ld bc, $14 ld bc, $14
rept 3
add hl, bc add hl, bc
endr add hl, bc
add hl, bc
pop af pop af
dec a dec a
jr nz, .asm_171b1b jr nz, .asm_171b1b

View File

@ -4393,9 +4393,9 @@ Function17f3f0: ; 17f3f0
pop hl pop hl
add hl, de add hl, de
add hl, de add hl, de
rept 3
inc hl inc hl
endr inc hl
inc hl
ld e, l ld e, l
ld d, h ld d, h
ld l, c ld l, c

View File

@ -836,9 +836,9 @@ Function4a680: ; 4a680 (12:6680)
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ret ret
Function4a6ab: ; 4a6ab (12:66ab) Function4a6ab: ; 4a6ab (12:66ab)

View File

@ -164,7 +164,7 @@ Function1dc381: ; 1dc381
call TextBox call TextBox
hlcoord 8, 2 hlcoord 8, 2
ld a, [TempMonLevel] ld a, [TempMonLevel]
call Function383d call PrintLevel_Force3Digits
hlcoord 12, 2 hlcoord 12, 2
ld [hl], "◀" ; Filled left triangle ld [hl], "◀" ; Filled left triangle
inc hl inc hl

View File

@ -10,9 +10,9 @@ UnusedTitleScreen: ; 10c000
ld [hBGMapMode], a ld [hBGMapMode], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld [hl], a ld [hl], a
ld hl, UnusedTitleBG_GFX ld hl, UnusedTitleBG_GFX

View File

@ -554,9 +554,9 @@ _InitMG_Mobile_LinkTradePalMap: ; 49797
hlcoord 2, 16, AttrMap hlcoord 2, 16, AttrMap
ld [hli], a ld [hli], a
ld a, $7 ld a, $7
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld a, $2 ld a, $2
ld [hl], a ld [hl], a
hlcoord 2, 17, AttrMap hlcoord 2, 17, AttrMap

View File

@ -472,9 +472,9 @@ endr
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
ld l, a ld l, a
ld h, 0 ld h, 0
rept 3
add hl, hl add hl, hl
endr add hl, hl
add hl, hl
ld de, PokemonPalettes ld de, PokemonPalettes
add hl, de add hl, de
ld a, [wcf65] ld a, [wcf65]

View File

@ -472,9 +472,9 @@ AnimateWaterTile: ; fc402
and 3 << 1 and 3 << 1
; 2 x 8 = 16 bytes per tile ; 2 x 8 = 16 bytes per tile
rept 3
add a add a
endr add a
add a
add WaterTileFrames % $100 add WaterTileFrames % $100
ld l, a ld l, a
@ -511,9 +511,9 @@ ForestTreeLeftAnimation: ; fc45c
.asm_fc46c .asm_fc46c
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
call GetForestTreeFrame call GetForestTreeFrame
rept 3
add a add a
endr add a
add a
add ForestTreeLeftFrames % $100 add ForestTreeLeftFrames % $100
ld l, a ld l, a
ld a, 0 ld a, 0
@ -553,9 +553,9 @@ ForestTreeRightAnimation: ; fc4c4
.asm_fc4d4 .asm_fc4d4
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
call GetForestTreeFrame call GetForestTreeFrame
rept 3
add a add a
endr add a
add a
add ForestTreeLeftFrames % $100 add ForestTreeLeftFrames % $100
ld l, a ld l, a
ld a, 0 ld a, 0
@ -589,9 +589,9 @@ ForestTreeLeftAnimation2: ; fc4f2
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
call GetForestTreeFrame call GetForestTreeFrame
xor 2 xor 2
rept 3
add a add a
endr add a
add a
add ForestTreeLeftFrames % $100 add ForestTreeLeftFrames % $100
ld l, a ld l, a
ld a, 0 ld a, 0
@ -621,9 +621,9 @@ ForestTreeRightAnimation2: ; fc51c
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
call GetForestTreeFrame call GetForestTreeFrame
xor 2 xor 2
rept 3
add a add a
endr add a
add a
add ForestTreeLeftFrames % $100 add ForestTreeLeftFrames % $100
ld l, a ld l, a
ld a, 0 ld a, 0
@ -734,9 +734,9 @@ SafariFountainAnim2: ; fc5eb
ld c, l ld c, l
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
and 6 and 6
rept 3
add a add a
endr add a
add a
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, SafariFountainFrames ld hl, SafariFountainFrames

View File

@ -310,9 +310,9 @@ TrainerType4: ; 3989d
ComputeTrainerReward: ; 3991b (e:591b) ComputeTrainerReward: ; 3991b (e:591b)
ld hl, hProduct ld hl, hProduct
xor a xor a
rept 3
ld [hli], a ld [hli], a
endr ld [hli], a
ld [hli], a
ld a, [wEnemyTrainerBaseReward] ld a, [wEnemyTrainerBaseReward]
ld [hli], a ld [hli], a
ld a, [CurPartyLevel] ld a, [CurPartyLevel]