shithub: pokecrystal

Download patch

ref: d9603e3e331655bb7e061b612730b68cd4378f96
parent: e475ce6fdaad21ba34a64a708f7c23bad5625917
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun Oct 4 18:34:50 EDT 2020

Identify more unnamed labels

--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -980,7 +980,7 @@
 	ret
 
 .negative
-	and $3f
+	and %00111111
 	cp $20
 	jr nc, .minus_256
 	cp $18
@@ -1995,7 +1995,7 @@
 	dw .one
 	dw .two   ; Jump Kick, Hi Jump Kick
 	dw .three ; Rolling Kick
-	dw .four
+	dw .four  ; Rolling Kick (continued)
 
 .zero
 	ret
@@ -2005,13 +2005,13 @@
 	add hl, bc
 	ld a, [hl]
 	cp $30
-	jr c, .unknown_cdb24
+	jr c, .move_down
 	ld hl, BATTLEANIMSTRUCT_JUMPTABLE_INDEX
 	add hl, bc
 	ld [hl], $0
 	ret
 
-.unknown_cdb24
+.move_down
 	add $4
 	ld [hl], a
 	ret
--- a/engine/events/pokecenter_pc.asm
+++ b/engine/events/pokecenter_pc.asm
@@ -233,28 +233,28 @@
 	ld [wWhichIndexSet], a
 	ld hl, PlayersPCAskWhatDoText
 	call PC_DisplayTextWaitMenu
-	call Function15715
+	call .PlayersPC
 	call ExitMenu
 	ret
 
-Function15715:
+.PlayersPC:
 	xor a
 	ld [wPCItemsCursor], a
 	ld [wPCItemsScrollPosition], a
 	ld hl, PlayersPCMenuData
 	call LoadMenuHeader
-.asm_15722
+.loop
 	call UpdateTimePals
 	call DoNthMenu
-	jr c, .asm_15731
+	jr c, .turn_off
 	call MenuJumptable
-	jr nc, .asm_15722
-	jr .asm_15732
+	jr nc, .loop
+	jr .done
 
-.asm_15731
+.turn_off
 	xor a
 
-.asm_15732
+.done
 	call ExitMenu
 	ret
 
--- a/engine/games/slot_machine.asm
+++ b/engine/games/slot_machine.asm
@@ -185,7 +185,7 @@
 	ld [wCurSpriteOAMAddr], a
 	callfar DoNextFrameForFirst16Sprites
 	call .PrintCoinsAndPayout
-	call .Stubbed_Function927d3
+	call .Stubbed_AlternateMatchingSevensPalette
 	call DelayFrame
 	and a
 	ret
@@ -194,7 +194,7 @@
 	scf
 	ret
 
-.Stubbed_Function927d3:
+.Stubbed_AlternateMatchingSevensPalette:
 ; dummied out
 	ret
 	ld a, [wReel1ReelAction]
@@ -206,7 +206,7 @@
 	ld a, [wFirstTwoReelsMatchingSevens]
 	and a
 	jr nz, .matching_sevens
-	ld a, %11100100
+	ld a, %11100100 ; alternates two palettes
 	call DmgToCgbBGPals
 	ret
 
@@ -849,17 +849,22 @@
 	push hl
 	srl a
 	srl a
-	add LOW(.Unknown_92bce)
+	add LOW(.data)
 	ld l, a
 	ld a, 0
-	adc HIGH(.Unknown_92bce)
+	adc HIGH(.data)
 	ld h, a
 	ld a, [hl]
 	pop hl
 	ret
 
-.Unknown_92bce:
-	db 0, 1, 2, 3, 4, 5
+.data:
+	db 0 ; SLOTS_SEVEN
+	db 1 ; SLOTS_POKEBALL
+	db 2 ; SLOTS_CHERRY
+	db 3 ; SLOTS_PIKACHU
+	db 4 ; SLOTS_SQUIRTLE
+	db 5 ; SLOTS_STARYU
 
 ReelActionJumptable:
 	ld hl, REEL_ACTION
@@ -1090,11 +1095,11 @@
 	add hl, bc
 	ld a, [hl]
 	and a
-	jr z, .asm_92d02
+	jr z, .ready
 	dec [hl]
 	ret
 
-.asm_92d02
+.ready
 	ld a, SFX_THROW_BALL
 	call Slots_PlaySFX
 	ld hl, REEL_ACTION
--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -133,7 +133,7 @@
 	ld [hl], e
 	ret
 
-Function8b07: ; unreferenced
+Intro_LoadMagikarpPalettes: ; unreferenced
 	call CheckCGB
 	ret z
 ; CGB only
@@ -166,7 +166,7 @@
 	RGB 08, 16, 28
 	RGB 00, 00, 00
 
-Function8b3f: ; unreferenced
+Intro_LoadAllPal0: ; unreferenced
 	call CheckCGB
 	ret nz
 	ldh a, [hSGB]
@@ -175,7 +175,7 @@
 	ld hl, BlkPacket_AllPal0
 	jp PushSGBPals
 
-Function8b4d: ; unreferenced
+Intro_LoadBetaIntroVenusaurPalettes: ; unreferenced
 	call CheckCGB
 	jr nz, .cgb
 	ldh a, [hSGB]
@@ -190,7 +190,7 @@
 	call GetPredefPal
 	jp LoadHLPaletteIntoDE
 
-Function8b67: ; unreferenced
+Intro_LoadPackPalettes: ; unreferenced
 	call CheckCGB
 	jr nz, .cgb
 	ldh a, [hSGB]
@@ -273,7 +273,7 @@
 	call LoadPalette_White_Col1_Col2_Black
 	ret
 
-Function8bec: ; unreferenced
+LoadBetaPokerPalettes: ; unreferenced
 	ldh a, [hCGB]
 	and a
 	jr nz, .cgb
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -1267,7 +1267,7 @@
 	farcall _ResetClock
 	jp Init
 
-Function639b: ; unreferenced
+UpdateTitleTrailSprite: ; unreferenced
 	; If bit 0 or 1 of [wTitleScreenTimer] is set, we don't need to be here.
 	ld a, [wTitleScreenTimer]
 	and %00000011
@@ -1279,9 +1279,9 @@
 	ld h, 0
 	add hl, hl
 	add hl, hl
-	ld de, .Data_63ca
+	ld de, .TitleTrailCoords
 	add hl, de
-	; If bit 2 of [wTitleScreenTimer] is set, get the second dw; else, get the first dw
+	; If bit 2 of [wTitleScreenTimer] is set, get the second coords; else, get the first coords
 	ld a, [wTitleScreenTimer]
 	and %00000100
 	srl a
@@ -1299,14 +1299,25 @@
 	call InitSpriteAnimStruct
 	ret
 
-.Data_63ca:
-; frame 0 y, x; frame 1 y, x
-	db 11 * 8 + 4, 10 * 8,  0 * 8,      0 * 8
-	db 11 * 8 + 4, 13 * 8, 11 * 8 + 4, 11 * 8
-	db 11 * 8 + 4, 13 * 8, 11 * 8 + 4, 15 * 8
-	db 11 * 8 + 4, 17 * 8, 11 * 8 + 4, 15 * 8
-	db  0 * 8,      0 * 8, 11 * 8 + 4, 15 * 8
-	db  0 * 8,      0 * 8, 11 * 8 + 4, 11 * 8
+.TitleTrailCoords:
+trail_coords: MACRO
+rept _NARG / 2
+_dx = 4
+if \1 == 0 && \2 == 0
+_dx = 0
+endc
+	dbpixel \1, \2, _dx, 0
+	shift
+	shift
+endr
+ENDM
+	; frame 0 y, x; frame 1 y, x
+	trail_coords 11, 10,  0,  0
+	trail_coords 11, 13, 11, 11
+	trail_coords 11, 13, 11, 15
+	trail_coords 11, 17, 11, 15
+	trail_coords  0,  0, 11, 15
+	trail_coords  0,  0, 11, 11
 
 Copyright:
 	call ClearTilemap
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -311,7 +311,7 @@
 	scf
 	ret
 
-Function90199:
+MakePhoneCallFromPokegear:
 	; Don't do the call if you're in a link communication
 	ld a, [wLinkMode]
 	and a
@@ -465,7 +465,7 @@
 Phone_CallerTextboxWithName:
 	ld a, [wCurCaller]
 	ld b, a
-	call Function90363
+	call Phone_TextboxWithName
 	ret
 
 PhoneCall::
@@ -575,7 +575,7 @@
 	farcall PhoneRing_CopyTilemapAtOnce
 	ret
 
-Function90363:
+Phone_TextboxWithName:
 	push bc
 	call Phone_CallerTextbox
 	hlcoord 1, 1
@@ -585,7 +585,7 @@
 	ld d, h
 	ld e, l
 	pop bc
-	call Function90380
+	call GetCallerClassAndName
 	ret
 
 Phone_CallerTextbox:
@@ -595,7 +595,7 @@
 	call Textbox
 	ret
 
-Function90380:
+GetCallerClassAndName:
 	ld h, d
 	ld l, e
 	ld a, b
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -905,7 +905,7 @@
 	call WaitSFX
 	ld a, [wPokegearPhoneSelectedPerson]
 	ld b, a
-	call Function90199
+	call MakePhoneCallFromPokegear
 	ld c, 10
 	call DelayFrames
 	ld hl, wOptions
@@ -1050,7 +1050,7 @@
 	ld e, l
 	pop af
 	ld b, a
-	call Function90380
+	call GetCallerClassAndName
 	pop hl
 	ld a, [wPokegearPhoneLoadNameBuffer]
 	inc a
--- a/engine/pokemon/mon_menu.asm
+++ b/engine/pokemon/mon_menu.asm
@@ -346,11 +346,11 @@
 	call GetPartyItemLocation
 	ld a, [hl]
 	and a
-	jr z, .asm_12c8c
+	jr z, .not_holding_item
 
 	ld [wCurItem], a
 	call ReceiveItemFromPokemon
-	jr nc, .asm_12c94
+	jr nc, .item_storage_full
 
 	farcall ItemIsMail
 	call GetPartyItemLocation
@@ -360,18 +360,18 @@
 	call GetItemName
 	ld hl, PokemonTookItemText
 	call MenuTextboxBackup
-	jr .asm_12c9a
+	jr .done
 
-.asm_12c8c
+.not_holding_item
 	ld hl, PokemonNotHoldingText
 	call MenuTextboxBackup
-	jr .asm_12c9a
+	jr .done
 
-.asm_12c94
+.item_storage_full
 	ld hl, ItemStorageFullText
 	call MenuTextboxBackup
 
-.asm_12c9a
+.done
 	ret
 
 GiveTakeItemMenuData:
--- a/engine/printer/print_party.asm
+++ b/engine/printer/print_party.asm
@@ -8,12 +8,12 @@
 	hlcoord 17, 1, wPrinterTilemapBuffer
 	ld a, $62
 	ld [hli], a
-	inc a
+	inc a ; $63
 	ld [hl], a
 	hlcoord 17, 2, wPrinterTilemapBuffer
 	ld a, $64
 	ld [hli], a
-	inc a
+	inc a ; $65
 	ld [hl], a
 	hlcoord 1, 9, wPrinterTilemapBuffer
 	ld a, " "
@@ -173,7 +173,7 @@
 	ld [wNamedObjectIndexBuffer], a
 	ld [wCurSpecies], a
 	ld hl, wPartyMonNicknames
-	call Function1dc50e
+	call GetCurPartyMonName
 	hlcoord 8, 4
 	call PlaceString
 	hlcoord 9, 6
@@ -190,14 +190,14 @@
 	lb bc, PRINTNUM_LEADINGZEROS | 1, 3
 	call PrintNum
 	hlcoord 1, 9
-	ld de, String1dc550
+	ld de, PrintParty_OTString
 	call PlaceString
 	ld hl, wPartyMonOT
-	call Function1dc50e
+	call GetCurPartyMonName
 	hlcoord 4, 9
 	call PlaceString
 	hlcoord 1, 11
-	ld de, String1dc559
+	ld de, PrintParty_IDNoString
 	call PlaceString
 	hlcoord 4, 11
 	ld de, wTempMonID
@@ -204,12 +204,12 @@
 	lb bc, PRINTNUM_LEADINGZEROS | 2, 5
 	call PrintNum
 	hlcoord 1, 14
-	ld de, String1dc554
+	ld de, PrintParty_MoveString
 	call PlaceString
 	hlcoord 7, 14
 	ld a, [wTempMonMoves + 0]
-	call Function1dc51a
-	call Function1dc52c
+	call PlaceMoveNameString
+	call PlaceGenderAndShininess
 	ld hl, wTempMonDVs
 	predef GetUnownLetter
 	ld hl, wBoxAlignment
@@ -249,15 +249,15 @@
 	call CopyBytes
 	hlcoord 7, 0
 	ld a, [wTempMonMoves + 1]
-	call Function1dc51a
+	call PlaceMoveNameString
 	hlcoord 7, 2
 	ld a, [wTempMonMoves + 2]
-	call Function1dc51a
+	call PlaceMoveNameString
 	hlcoord 7, 4
 	ld a, [wTempMonMoves + 3]
-	call Function1dc51a
+	call PlaceMoveNameString
 	hlcoord 7, 7
-	ld de, String1dc55d
+	ld de, PrintParty_StatsString
 	call PlaceString
 	hlcoord 16, 7
 	ld de, wTempMonAttack
@@ -285,7 +285,7 @@
 	call PrintNum
 	ret
 
-Function1dc50e:
+GetCurPartyMonName:
 	ld bc, NAME_LENGTH
 	ld a, [wCurPartyMon]
 	call AddNTimes
@@ -293,7 +293,7 @@
 	ld d, h
 	ret
 
-Function1dc51a:
+PlaceMoveNameString:
 	and a
 	jr z, .no_move
 
@@ -302,13 +302,13 @@
 	jr .got_string
 
 .no_move
-	ld de, String1dc584
+	ld de, PrintParty_NoMoveString
 
 .got_string
 	call PlaceString
 	ret
 
-Function1dc52c:
+PlaceGenderAndShininess:
 	farcall GetGender
 	ld a, " "
 	jr c, .got_gender
@@ -326,16 +326,16 @@
 	ld [hl], "⁂"
 	ret
 
-String1dc550:
+PrintParty_OTString:
 	db "OT/@"
 
-String1dc554:
+PrintParty_MoveString:
 	db "MOVE@"
 
-String1dc559:
+PrintParty_IDNoString:
 	db "<ID>№.@"
 
-String1dc55d:
+PrintParty_StatsString:
 	db   "ATTACK"
 	next "DEFENSE"
 	next "SPCL.ATK"
@@ -343,7 +343,7 @@
 	next "SPEED"
 	db   "@"
 
-String1dc584:
+PrintParty_NoMoveString:
 	db "------------@"
 
 GBPrinterHPIcon: