summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/audio.asm127
-rw-r--r--home/copy2.asm4
-rw-r--r--home/map.asm60
-rw-r--r--home/map_objects.asm30
-rw-r--r--home/misc_32c8.asm4
-rw-r--r--home/oam_dma.asm2
-rw-r--r--home/overworld.asm4
-rw-r--r--home/talk_to_npc.asm268
-rw-r--r--home/text.asm10
-rw-r--r--home/tileset.asm22
-rw-r--r--home/time.asm4
-rw-r--r--home/unknown.asm4
-rw-r--r--home/unknown_388f.asm16
-rw-r--r--home/util.asm5
-rw-r--r--home/window.asm2
15 files changed, 450 insertions, 112 deletions
diff --git a/home/audio.asm b/home/audio.asm
index 03a0990..609c8dc 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -140,3 +140,130 @@ PlaySFX:: ; 3d63
ret
WaitPlaySFX:: ; 3d7f
+ call WaitSFX
+ call PlaySFX
+ ret
+
+WaitSFX:: ; 3d86
+ push hl
+.loop
+ ld hl, wChannel5Flags1
+ bit 0, [hl]
+ jr nz, .loop
+ ld hl, wChannel6Flags1
+ bit 0, [hl]
+ jr nz, .loop
+ ld hl, wChannel7Flags1
+ bit 0, [hl]
+ jr nz, .loop
+ ld hl, wChannel8Flags1
+ bit 0, [hl]
+ jr nz, .loop
+ pop hl
+ ret
+
+MaxVolume:: ; 3DA5
+ ld a, $77
+ ld [wVolume], a
+ ret
+
+LowVolume:: ; 3DAB
+ ld a, $33
+ ld [wVolume], a
+ ret
+
+VolumeOff:: ; 3DB1
+ xor a
+ ld [wVolume], a
+ ret
+
+UpdateSoundNTimes:: ; 3DB6
+.loop
+ and a
+ ret z
+ dec a
+ call UpdateSound
+ jr .loop
+
+FadeToMapMusic:: ; 3DBE
+ push hl
+ push de
+ push bc
+ push af
+ call GetMapMusic
+ ld a, [wMapMusic]
+ cp e
+ jr z, .jump
+ ld a, $08
+ ld [wMusicFade], a
+ ld a, e
+ ld [wMusicFadeID], a
+ ld a, d
+ ld [wMusicFadeID+1], a
+ ld a, e
+ ld [wMapMusic], a
+.jump
+ pop af
+ pop bc
+ pop de
+ pop hl
+ ret
+
+PlayMapMusic:: ; 3DE1
+ push hl
+ push de
+ push bc
+ push af
+ call GetMapMusic
+ ld a, [wMapMusic]
+ cp e
+ jr z, .jump
+ push de
+ ld de, $0000
+ call PlayMusic
+ call DelayFrame
+ pop de
+ ld a, e
+ ld [wMapMusic], a
+ call PlayMusic
+.jump
+ pop af
+ pop bc
+ pop de
+ pop hl
+ ret
+
+SpecialMapMusic:: ; 3E05
+ ld a, [wPlayerState]
+ and a
+ jr z, .normal
+ cp $02
+ jr z, .state2
+ ld de, $0009
+ scf
+ ret
+
+.state2 ; 3E14
+ ld de, $0000
+ scf
+ ret
+
+.normal ; 3E19
+ and a
+ ret
+
+GetMapMusic:: ; 3E1B
+ call SpecialMapMusic
+ ret c
+ ld a, [wMapPermissions]
+ cp $01
+ jr z, .jump
+ cp $03
+ jr z, .jump
+ ld de, $0002
+ ret
+.jump ; 3E2E
+ ld de, $0007
+ ret
+
+; 3E32, this is likely not a function. \ No newline at end of file
diff --git a/home/copy2.asm b/home/copy2.asm
index 9baad62..e74ef8b 100644
--- a/home/copy2.asm
+++ b/home/copy2.asm
@@ -2,8 +2,8 @@ INCLUDE "constants.asm"
SECTION "Video Copy functions", ROM0[$0D02]
-Function0d02::
- jpab Function14000
+RedrawPlayerSprite::
+ jpab _RedrawPlayerSprite
LoadFont:: ; 00:0d0a
jpab LoadFontGraphics
diff --git a/home/map.asm b/home/map.asm
index 8105781..7b9bd71 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -448,8 +448,8 @@ FadeIn:: ; 23e5 ; This is not OverworldFadeIn, but I don't know what it is
ret
Function2407:: ; 00:2407
- ld a, $2a
- ld [wcb77], a
+ ld a, NO_MOVEMENT
+ ld [wPlayerMovement], a
xor a
ld [wPlayerAction], a
ld a, [wPlayerFacing]
@@ -470,7 +470,7 @@ Function2407:: ; 00:2407
ld [wPlayerFacing], a
ld a, $0
ld d, $0
- call Function19c0
+ call SetObjectFacing
ret
MapSetup_Connection:: ; 2439
@@ -505,7 +505,7 @@ CheckMovingOffEdgeOfMap:: ; 245e
ret
.down
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
sub 4
ld b, a
ld a, [wMapHeight]
@@ -516,7 +516,7 @@ CheckMovingOffEdgeOfMap:: ; 245e
ret
.up
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
sub 4
cp -1
jr z, .ok
@@ -524,7 +524,7 @@ CheckMovingOffEdgeOfMap:: ; 245e
ret
.left
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
sub 4
cp -1
jr z, .ok
@@ -532,7 +532,7 @@ CheckMovingOffEdgeOfMap:: ; 245e
ret
.right
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
sub 4
ld b, a
ld a, [wMapWidth]
@@ -701,10 +701,10 @@ WarpCheck:: ; 259f
ret
GetDestinationWarpPointer: ; 25b9
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
sub 4
ld d, a
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
sub 4
ld e, a
ld a, [wCurrMapWarpCount]
@@ -1028,15 +1028,15 @@ Function275e:: ; 275e ; TODO: is this used?
ld [wOverworldMapAnchor + 1], a
ld a, [wYCoord]
and 1
- ld [wMetatileStandingY], a
+ ld [wMetatileNextY], a
ld a, [wXCoord]
and 1
- ld [wMetatileStandingX], a
+ ld [wMetatileNextX], a
ret
GetCoordOfUpperLeftCorner:: ; 277a
- ld hl, wOverworldMap
+ ld hl, wOverworldMapBlocks
ld a, [wXCoord]
bit 0, a
jr nz, .increment_then_halve1
@@ -1075,10 +1075,10 @@ GetCoordOfUpperLeftCorner:: ; 277a
ld [wOverworldMapAnchor + 1], a
ld a, [wYCoord]
and 1
- ld [wMetatileStandingY], a
+ ld [wMetatileNextY], a
ld a, [wXCoord]
and 1
- ld [wMetatileStandingX], a
+ ld [wMetatileNextX], a
ret
Function27C7:: ; 27c7 ; TODO
@@ -1175,13 +1175,13 @@ LoadMetatiles:: ; 2822
ApplyFlashlight:: ; 285a
ld hl, wTileMapBackup
- ld a, [wMetatileStandingY]
+ ld a, [wMetatileNextY]
and a
jr z, .top_row
ld bc, $30 ; TODO: constantify this
add hl, bc
.top_row
- ld a, [wMetatileStandingX]
+ ld a, [wMetatileNextX]
and a
jr z, .left_col
inc hl
@@ -1324,12 +1324,12 @@ ENDR
ChangeMap:: ; 294d
- ld hl, wOverworldMap
- ld bc, wOverworldMapEnd - wOverworldMap
+ ld hl, wOverworldMapBlocks
+ ld bc, wOverworldMapBlocksEnd - wOverworldMapBlocks
ld a, 0
call ByteFill
- ld hl, wOverworldMap
+ ld hl, wOverworldMapBlocks
ld a, [wMapWidth]
ldh [hConnectedMapWidth], a
add a, 6
@@ -1593,7 +1593,7 @@ Function2a8d:: ; 00:2a8d
dbbw $05, $33, Function14777
Function2ae5::
-.asm_2ae5: ; 00:2ae5
+.loop: ; 00:2ae5
ld hl, wJoypadFlags
set 4, [hl]
set 6, [hl]
@@ -1608,33 +1608,31 @@ Function2ae5::
bit 7, [hl]
res 7, [hl]
ret nz
- call Function38e3
+ call TestWildBattleStart
ret nz
call OverworldStartButtonCheck
ret nz
- ld hl, PlaceWaitingText
- ld a, $3
- call FarCall_hl
+ callab OverworldMovementCheck
ldh a, [hMapEntryMethod]
and a
ret nz
call Function2c4a
- jr nc, .asm_2ae5
+ jr nc, .loop
callba Function824c
ld a, [wc5ed]
bit 6, a
- jr nz, .asm_2ae5
+ jr nz, .loop
call CheckMovingOffEdgeOfMap
ret c
call WarpCheck
ret c
- jr .asm_2ae5
+ jr .loop
Function2b39::
ld hl, wJoypadFlags
res 4, [hl]
res 6, [hl]
- ld hl, wce63
+ ld hl, wDebugFlags
res 6, [hl]
res 7, [hl]
ld hl, wVramState
@@ -1679,7 +1677,7 @@ Function2b87::
call GetJoypad
call OverworldStartButtonCheck
ret nz
- callab Functionc000
+ callab OverworldMovementCheck
call Function2ba8
jr nc, .asm_2b87
callba Function824c
@@ -1714,8 +1712,8 @@ Function2ba8:: ; 00:2ba8
scf
ret
-Function2be5:: ; 00:2be5
- ld a, [wce63]
+Function2be5:: ; 00:2be5 ; TODO
+ ld a, [wDebugFlags]
bit 7, a
ret nz
ld a, [wMapGroup]
diff --git a/home/map_objects.asm b/home/map_objects.asm
index 70cba50..c473e13 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -315,6 +315,7 @@ UpdateSprites:: ; 00:17a8
ret
GetObjectStruct:: ; 00:17bf
+; Puts the start of the a'th object struct into bc
ld bc, $28
ld hl, wObjectStructs
call AddNTimes
@@ -334,26 +335,34 @@ Function17cb::
call Bankswitch
ret
-Function17de::
+; sets carry flag if the sprite data includes "in-motion" sprites
+IsAnimatedSprite:: ; 00:17de
push hl
push bc
ld c, a
- ld b, $ff
- ld hl, .Data
-.asm_17e6: ; 00:17e6
+ ld b, -1
+ ld hl, .NonAnimatedSprites
+.loop
ld a, [hli]
cp b
- jr z, .asm_17ee
+ jr z, .done
cp c
- jr nz, .asm_17e6
+ jr nz, .loop
scf
-.asm_17ee: ; 00:17ee
+.done
pop bc
pop hl
ret
-.Data: ; 00:17f1
- db $51, $55, $56, $57, $58, $5a, $5b, $ff
+.NonAnimatedSprites: ; 00:17f1
+ db SPRITE_KABIGON
+ db SPRITE_POKE_BALL
+ db SPRITE_POKEDEX
+ db SPRITE_PAPER
+ db SPRITE_OLD_LINK_RECEPTIONIST
+ db SPRITE_EGG
+ db SPRITE_BOULDER
+ db -1
Function17f9::
call GetMapObject
@@ -661,7 +670,8 @@ Function19b5::
res 7, [hl]
ret
-Function19c0::
+SetObjectFacing:: ; 19C0
+ ; a is NPC number, d is direction
push de
call CheckObjectVisibility
pop de
diff --git a/home/misc_32c8.asm b/home/misc_32c8.asm
index 8b423bb..00e41ce 100644
--- a/home/misc_32c8.asm
+++ b/home/misc_32c8.asm
@@ -78,7 +78,7 @@ WaitPressedAny:: ; 369a
CountSetBits:: ; 36b1
; Count the number of bits set in b bytes at hl.
-; Return to a, c, and wce37.
+; Return to a, c, and wCountSetBitsResult.
ld c, $0
.asm_36b3: ; 00:36b3
ld a, [hli]
@@ -94,5 +94,5 @@ CountSetBits:: ; 36b1
dec b
jr nz, .asm_36b3
ld a, c
- ld [wce37], a
+ ld [wCountSetBitsResult], a
ret
diff --git a/home/oam_dma.asm b/home/oam_dma.asm
index 42ecaaf..42c68e7 100644
--- a/home/oam_dma.asm
+++ b/home/oam_dma.asm
@@ -1,6 +1,6 @@
INCLUDE "constants.asm"
-SECTION "OAM DMA", ROMX[$4153],BANK[1]
+SECTION "OAM DMA", ROMX[$4153], BANK[$01]
WriteOAMDMACodeToHRAM:: ; 4153
ld c, LOW(hOAMDMA)
diff --git a/home/overworld.asm b/home/overworld.asm
index 2b37b7c..51ba0f5 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -14,8 +14,8 @@ if DEBUG
and (START | B_BUTTON)
cp (START | B_BUTTON)
jr nz, .regularMenu
- ld a, [wce63]
- bit 1, a
+ ld a, [wDebugFlags]
+ bit DEBUG_FIELD_F, a
ret z ; debug disabled
callba InGameDebugMenu
jr CheckStartmenuSelectHook
diff --git a/home/talk_to_npc.asm b/home/talk_to_npc.asm
index 9ef5dd3..69bee3e 100644
--- a/home/talk_to_npc.asm
+++ b/home/talk_to_npc.asm
@@ -6,9 +6,9 @@ else
SECTION "Unknown 3025", ROM0 [$2fe9]
endc
-Function3025::
+MapDefaultText::
ld hl, .Text
- call Function3111
+ call OpenTextbox
ret
.Text: ; 00:302c
@@ -22,8 +22,8 @@ Function3036:: ; 3036
.Text: ; 00:303a
db "@"
-CallMapTextSubroutine::
- ld a, [wcdb0]
+CallMapTextSubroutine:: ; 00:303b
+ ld a, [wTalkingTargetType]
bit 0, a
jr z, asm_3062
call Function3055
@@ -43,16 +43,16 @@ CallMapTextSubroutine::
Function3055:: ; 00:3055
ldh a, [hFFEA]
ld b, a
-.asm_3058: ; 00:3058
+.Loop: ; 00:3058
ld a, [hli]
cp $ff
ret z
cp b
- jp z, Function3240
- jr .asm_3058
+ jp z, SetFFInAccumulator
+ jr .Loop
asm_3062: ; 00:3062
- ld a, [wcdb0]
+ ld a, [wTalkingTargetType]
bit 1, a
ret z
ld h, d
@@ -71,28 +71,29 @@ asm_3062: ; 00:3062
jp hl
Function307a:: ; 00:307a
- ld hl, wcdb0
+ ld hl, wTalkingTargetType
res 0, [hl]
res 1, [hl]
- call Function3240
+ call SetFFInAccumulator
ret
-Function3085:: ; 00:3085
+PrintTextboxDebugNumbers:: ; 00:3085
push hl
push de
push bc
- ld de, $99
- ld a, [wcdb0]
+ ld de, $0099 ; default address to print from (not a sign or NPC)
+ ld a, [wTalkingTargetType]
bit 0, a
- jr z, .asm_3097
+ jr z, .CheckSign
ld de, hFFEA
- jr .asm_309e
+ jr .PrintNum
-.asm_3097: ; 00:3097
+.CheckSign: ; 00:3097
bit 1, a
- jr z, .asm_309e
+ jr z, .PrintNum
ld de, hFFEE
-.asm_309e: ; 00:309e
+
+.PrintNum: ; 00:309e
hlcoord 4, 12
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNumber
@@ -105,17 +106,17 @@ Function3085:: ; 00:3085
pop hl
ret
-QueueMapTextSubroutine::
+QueueMapTextSubroutine:: ; 00:30b7
ldh a, [hJoyState]
bit A_BUTTON_F, a
- jp z, Function323e
+ jp z, ClearAccumulator ; if we didn't press a
call GetFacingPersonText
- jp nc, Function30e8
+ jp nc, Function30e8 ; if not talking to a person
ld d, $0
ld e, a
- ld a, [wce63]
- bit 1, a
- call nz, Function3085
+ ld a, [wDebugFlags]
+ bit DEBUG_FIELD_F, a
+ call nz, PrintTextboxDebugNumbers ; if debug, print these
ld hl, wMapTextPtr
ld a, [hli]
ld h, [hl]
@@ -128,14 +129,14 @@ QueueMapTextSubroutine::
inc de
ld a, [hl]
ld [de], a
- ld hl, wcdb0
- set 0, [hl]
- call Function3240
+ ld hl, wTalkingTargetType
+ set 0, [hl] ; we're talking to an NPC
+ call SetFFInAccumulator
ret
Function30e8:: ; 00:30e8
call GetFacingSignpost
- jp nc, Function323e
+ jp nc, ClearAccumulator ; if not facing person or sign
ld a, e
ldh [hFFEB], a
ld a, d
@@ -144,14 +145,217 @@ Function30e8:: ; 00:30e8
ldh [hFFED], a
ld a, [hl]
ldh [hFFEE], a
- ld hl, wcdb0
- set 1, [hl]
- call Function3240
+ ld hl, wTalkingTargetType
+ set 1, [hl] ; we're talking to a sign
+ call SetFFInAccumulator
ret
GetFacingPersonText:: ; 00:3103
callba Function776e
ret nc
- call Function319b
+ call TurnNPCTalkingTo
scf
ret
+
+OpenTextbox:: ; 00:3111
+ ; Opens a textbox and waits for input
+ push hl
+ call PrepareTextbox
+ ld a, [wDebugFlags]
+ bit DEBUG_FIELD_F, a
+ call nz, PrintTextboxDebugNumbers
+ pop hl
+ call TextboxIdle
+ ret
+
+OpenTextboxNoInput:: ; 00:3122
+ push hl
+ call PrepareTextbox
+ pop hl
+
+TextboxIdle:: ; 00:3127
+ ; Prints text, then waits for A or B to be pressed, unless bit 5 of JoypadFlags is set.
+ call PrintTextBoxText
+.Loop
+ ld a, [wJoypadFlags]
+ bit 5, a
+ res 5, a
+ ld [wJoypadFlags], a
+ jr nz, .Escape
+ call GetJoypad
+ ldh a, [hJoyDown]
+ and A_BUTTON | B_BUTTON
+ jr nz, .Escape
+ call UpdateTime
+ call UpdateTimeOfDayPalettes
+ call DelayFrame
+ jr .Loop
+.Escape
+ call TextboxCleanup
+ ret
+
+PrepareTextbox:: ; 00:314E
+ call ClearWindowData
+ ldh a, [hROMBank]
+ push af
+ ld a, 01
+ call Bankswitch
+ call ReanchorBGMap_NoOAMUpdate
+ hlcoord 0, 12 ;in the tilemap in WRAM
+ ld b, 04
+ ld c, $12
+ call DrawTextBox
+ call WaitBGMap
+ call LoadFonts_NoOAMUpdate
+ pop af
+ call Bankswitch
+ ret
+
+TextboxCleanup: ; 00:3171
+ callab ReanchorBGMap_NoOAMUpdate
+ call UpdateSprites
+ xor a
+ ldh [hBGMapMode], a
+ ld a, $90
+ ldh [hWY], a
+ call Function318f
+ ld hl, wToolgearFlags
+ res 7, [hl]
+ call InitToolgearBuffer
+ ret
+
+Function318f: ; 00:318f
+ callab Function140ea
+ call RedrawPlayerSprite
+ ret
+
+TurnNPCTalkingTo:: ; 00:319b
+ ; If an NPC is allowed to turn when talked to, turn it.
+ ldh a, [hObjectStructIndexBuffer]
+ call GetObjectStruct
+ ld hl, OBJECT_SPRITE
+ add hl, bc
+ ld a, [hl]
+ call IsAnimatedSprite
+ jr c, .Jump
+ ld a, [wPlayerWalking]
+ xor 04
+ ld hl, OBJECT_DIRECTION_WALKING
+ add hl, bc
+ ld [hl], a
+ push bc
+ call UpdateSprites
+ pop bc
+.Jump
+ ld hl, OBJECT_MAP_OBJECT_INDEX
+ add hl, bc
+ ld a, [hl]
+ sub 02
+ ldh [hFFEA], a
+ ret
+
+Function31C3:: ; 00:31C3
+ ret
+
+CheckInlineTrainer:: ; 00:31C4
+ ; Passed de is the pointer to a map_object struct. If it's an inline trainer, write to relevant wram region.
+ ld hl, MAPOBJECT_OBJECT_STRUCT_ID
+ add hl, de
+ ld a, [hl]
+ call GetObjectStruct
+ call GetInlineMapObject
+ jr nc, .Escape
+ ld hl, MAPOBJECT_POINTER_HI
+ add hl, de
+ ld a, [hl]
+ cp b
+ jr c, .Escape
+ ld hl, MAPOBJECT_OBJECT_STRUCT_ID
+ add hl, de
+ ld a, [hl]
+ add a, a
+ ld hl, wCurrMapInlineTrainers
+ add a, l
+ ld l, a
+ jr nc, .NoCarry
+ inc h
+.NoCarry
+ ld [hl], b
+ inc hl
+ ld [hl], c
+.Escape
+ ret
+
+GetInlineMapObject:: ; 00:31EB
+ ;bc is start of object struct. if c flag set, returns distance in B and direction in C
+ ld hl, OBJECT_NEXT_MAP_X
+ add hl, bc
+ ld a, [wPlayerNextMapX]
+ cp [hl]
+ jr z, .EqualX
+ ld hl, OBJECT_NEXT_MAP_Y
+ add hl, bc
+ ld a, [wPlayerNextMapY]
+ cp [hl]
+ jr z, .EqualY
+ and a
+ ret
+.EqualX
+ ld hl, OBJECT_NEXT_MAP_Y
+ add hl, bc
+ ld a, [wPlayerNextMapY]
+ sub [hl]
+ jr z, .Reset
+ jr nc, .SetDown
+ cpl
+ inc a
+ ld b, a
+ ld c, UP
+ scf
+ ret
+.SetDown ; 3214
+ ld b, a
+ ld c, DOWN
+ scf
+ ret
+.EqualY ; 3219
+ ld hl, OBJECT_NEXT_MAP_X
+ add hl, bc
+ ld a, [wPlayerNextMapX]
+ sub [hl]
+ jr z, .Reset ; (this condition is impossible to meet)
+ jr nc, .SetRight
+ cpl
+ inc a
+ ld b, a
+ ld c, LEFT
+ scf
+ ret
+.SetRight ; 322C
+ ld b, a
+ ld c, RIGHT
+ scf
+ ret
+.Reset ; 3231
+ and a
+ ret
+
+CheckBPressedDebug: ; 3233
+ ; If in debug mode, returns a check on the B button.
+ ld a, [wDebugFlags]
+ bit DEBUG_FIELD_F, a
+ ret z
+ ldh a, [hJoyState]
+ bit B_BUTTON_F, a
+ ret
+
+ClearAccumulator:: ; 323E
+ xor a
+ ret
+
+SetFFInAccumulator:: ; 3240
+ xor a
+ dec a
+ ret
+
+; 3243
diff --git a/home/text.asm b/home/text.asm
index b3cd75c..48662e9 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -156,7 +156,7 @@ ENDM
dict "<TM>", TMChar
dict "<TRAINER>", TrainerChar
dict "<CONT>", ContText
- dict "<……>", SixDotsChar
+ dict "<⋯⋯>", SixDotsChar
dict "<DONE>", DoneText
dict "<PROMPT>", PromptText
dict "<GA>", GaCharacter
@@ -232,7 +232,7 @@ NullChar:: ; 00:0f66
ret
.Text:
- deciram hTextErrno, 1, 2
+ deciram hEventID, 1, 2
text "エラー"
done
@@ -244,7 +244,7 @@ ENDM
PrintMomsName:: print_name wMomsName
PrintPlayerName:: print_name wPlayerName
-PrintRivalName:: print_name wRivalsName
+PrintRivalName:: print_name wRivalName
TrainerChar:: print_name TrainerCharText
TMChar:: print_name TMCharText
@@ -287,7 +287,7 @@ TrainerCharText:: db "トレーナー@"
PCCharText:: db "パソコン@"
RocketCharText:: db "ロケットだん@"
POKeCharText:: db "ポケモン@"
-SixDotsCharText:: db "……@"
+SixDotsCharText:: db "⋯⋯@"
EnemyText:: db "てきの @"
GaCharacterTExt:: db "が @"
@@ -680,7 +680,7 @@ Text_TX_DOTS: ; 11e1 (0:11e1)
ld h, b
ld l, c
.loop
- ld a, "…"
+ ld a, "⋯"
ld [hli], a
push de
call GetJoypad
diff --git a/home/tileset.asm b/home/tileset.asm
index aabf249..4512728 100644
--- a/home/tileset.asm
+++ b/home/tileset.asm
@@ -50,7 +50,7 @@ RefreshPlayerCoords:: ; 2d74
ld a, [wXCoord]
add a, 4
ld d, a
- ld hl, wPlayerStandingMapX
+ ld hl, wPlayerNextMapX
sub [hl]
ld [hl], d
ld hl, wPlayerObjectXCoord
@@ -61,7 +61,7 @@ RefreshPlayerCoords:: ; 2d74
ld a, [wYCoord]
add a, 4
ld e, a
- ld hl, wPlayerStandingMapY
+ ld hl, wPlayerNextMapY
sub [hl]
ld [hl], e
ld hl, wPlayerObjectYCoord
@@ -211,18 +211,18 @@ SaveScreen:: ; 2df1
RefreshTiles:: ; 2e52
call .left_right
call .up_down
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
ld d, a
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
ld e, a
call GetCoordTile
ld [wPlayerStandingTile], a
ret
.up_down ; 2e67
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
ld d, a
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
ld e, a
push de
inc e
@@ -235,9 +235,9 @@ RefreshTiles:: ; 2e52
ret
.left_right ; 2e80
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
ld d, a
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
ld e, a
push de
dec d
@@ -270,10 +270,10 @@ GetFacingTileCoord:: ; 2e99
ld h, [hl]
ld l, a
- ld a, [wPlayerStandingMapX]
+ ld a, [wPlayerNextMapX]
add a, d
ld d, a
- ld a, [wPlayerStandingMapY]
+ ld a, [wPlayerNextMapY]
add a, e
ld e, a
ld a, [hl]
@@ -331,7 +331,7 @@ GetBlockLocation:: ; 2ef8
add a, 6
ld c, a
ld b, 0
- ld hl, wOverworldMap + 1
+ ld hl, wOverworldMapBlocks + 1
add hl, bc
ld a, e
srl a
diff --git a/home/time.asm b/home/time.asm
index 3eba96c..d82235d 100644
--- a/home/time.asm
+++ b/home/time.asm
@@ -32,8 +32,8 @@ UpdateTime:: ; 436 (0:0436)
and $1f
ldh [hRTCHours], a
call CloseSRAM
- ld a, [wce63]
- bit 1, a
+ ld a, [wDebugFlags]
+ bit DEBUG_FIELD_F, a
jr z, .asm_0478
ld a, [wd153]
bit 7, a
diff --git a/home/unknown.asm b/home/unknown.asm
index 6568b5d..3962377 100644
--- a/home/unknown.asm
+++ b/home/unknown.asm
@@ -53,10 +53,8 @@ Function094c::
push af
ld a, BANK(Functionfe255)
call Bankswitch
-
call Functionfe255
pop af
call Bankswitch
-
- jp Function4031
+ jp DebugMenu
diff --git a/home/unknown_388f.asm b/home/unknown_388f.asm
index 453c2f8..1182506 100644
--- a/home/unknown_388f.asm
+++ b/home/unknown_388f.asm
@@ -49,19 +49,19 @@ Function38d8::
ld [wd637], a
ret
-Function38e3::
+TestWildBattleStart::
ldh a, [hJoyState]
- and $f0
- ret z
- call Function3233
- jp nz, Function323e
+ and D_PAD
+ ret z ; if no directions are down, don't try and trigger a wild encounter
+ call CheckBPressedDebug
+ jp nz, ClearAccumulator ; if b button is down, clear acc
callab Function3ee3e
ld a, [wBattleMode]
and a
- ret z
+ ret z ; if no battle, return
ld a, $3
call WriteIntod637
- call Function3240
+ call SetFFInAccumulator
ret
Function3904::
@@ -92,7 +92,7 @@ Function3920::
ld hl, wJoypadFlags
res 4, [hl]
ld hl, .text
- call Function3111
+ call OpenTextbox
call RotateFourPalettesLeft
jp Init
diff --git a/home/util.asm b/home/util.asm
index 880513b..ccc990a 100644
--- a/home/util.asm
+++ b/home/util.asm
@@ -65,12 +65,13 @@ SkipNames:: ; 341f
ret
AddNTimes:: ; 3429 (0:3429)
+; Adds bc to hl, a times
and a
ret z
-.asm_342b
+.loop
add hl, bc
dec a
- jr nz, .asm_342b
+ jr nz, .loop
ret
; 0x3430
diff --git a/home/window.asm b/home/window.asm
index c2dc212..9e86453 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -17,7 +17,7 @@ RefreshScreen::
ret
Function1fea::
- call Function3171
+ call TextboxCleanup
call ClearWindowData
call InitToolgearBuffer
ret