diff options
-rw-r--r-- | engine/battle/ai/items.asm | 9 | ||||
-rw-r--r-- | engine/battle/battle_transition.asm | 4 | ||||
-rw-r--r-- | engine/battle/core.asm | 2 | ||||
-rw-r--r-- | engine/battle_anims/anim_commands.asm | 10 | ||||
-rw-r--r-- | engine/events/npc_trade.asm | 4 | ||||
-rw-r--r-- | engine/games/slot_machine.asm | 13 | ||||
-rw-r--r-- | engine/gfx/color.asm | 9 | ||||
-rw-r--r-- | engine/items/tmhm.asm | 4 | ||||
-rw-r--r-- | engine/overworld/map_objects.asm | 10 | ||||
-rw-r--r-- | engine/phone/phone.asm | 2 | ||||
-rw-r--r-- | engine/pokegear/pokegear.asm | 2 | ||||
-rw-r--r-- | engine/pokemon/stats_screen.asm | 3 | ||||
-rw-r--r-- | engine/rtc/print_hours_mins.asm | 1 |
13 files changed, 43 insertions, 30 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index 8bd45ea4f..480d1ef60 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -758,7 +758,14 @@ EnemyUsedDireHit: ld a, DIRE_HIT jp PrintText_UsedItemOn_AND_AIUpdateHUD -Function3851e: ; unreferenced +AICheckEnemyFractionMaxHP: ; unreferenced +; Input: a = divisor +; Work: bc = [wEnemyMonMaxHP] / a +; Work: de = [wEnemyMonHP] +; Output: +; - c, nz if [wEnemyMonHP] > [wEnemyMonMaxHP] / a +; - nc, z if [wEnemyMonHP] = [wEnemyMonMaxHP] / a +; - nc, nz if [wEnemyMonHP] < [wEnemyMonMaxHP] / a ldh [hDivisor], a ld hl, wEnemyMonMaxHP ld a, [hli] diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 8071d475e..726ef5d92 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -826,9 +826,9 @@ ENDM jr nz, .row ret -Function8c7c9: ; unreferenced +UnusedWaitBGMapOnce: ; unreferenced ld a, 1 - ldh [hBGMapMode], a + ldh [hBGMapMode], a ; redundant call WaitBGMap xor a ldh [hBGMapMode], a diff --git a/engine/battle/core.asm b/engine/battle/core.asm index cc7ef2e37..70cfde261 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -8201,7 +8201,7 @@ InitEnemyWildmon: predef PlaceGraphic ret -Function3f662: ; unreferenced +FillEnemyMovesFromMoveIndicesBuffer: ; unreferenced ld hl, wEnemyMonMoves ld de, wListMoves_MoveIndicesBuffer ld b, NUM_MOVES diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index f42ca7b50..cfaaf0087 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -216,16 +216,18 @@ ClearActorHud: call ClearBox ret -Functioncc220: ; unreferenced +PlaceWindowOverBattleTextbox: ; unreferenced xor a ldh [hBGMapMode], a - ld a, LOW(vBGMap0 tile $28) + ; bgcoord hBGMapAddress, 0, 20 + ld a, LOW(vBGMap0 + 20 * BG_MAP_WIDTH) ldh [hBGMapAddress], a - ld a, HIGH(vBGMap0 tile $28) + ld a, HIGH(vBGMap0 + 20 * BG_MAP_WIDTH) ldh [hBGMapAddress + 1], a call WaitBGMap2 - ld a, $60 + ld a, (SCREEN_HEIGHT - TEXTBOX_HEIGHT) * TILE_WIDTH ldh [hWY], a + ; bgcoord hBGMapAddress, 0, 0 xor a ; LOW(vBGMap0) ldh [hBGMapAddress], a ld a, HIGH(vBGMap0) diff --git a/engine/events/npc_trade.asm b/engine/events/npc_trade.asm index 0f9c7d9f5..94aaace72 100644 --- a/engine/events/npc_trade.asm +++ b/engine/events/npc_trade.asm @@ -312,14 +312,14 @@ CopyTradeName: call CopyBytes ret -Functionfcdfb: ; unreferenced +Trade_CopyFourCharString: ; unreferenced ld bc, 4 call CopyBytes ld a, "@" ld [de], a ret -Functionfce05: ; unreferenced +Trade_CopyThreeCharString: ; unreferenced ld bc, 3 call CopyBytes ld a, "@" diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm index 744792bbd..84f50e69d 100644 --- a/engine/games/slot_machine.asm +++ b/engine/games/slot_machine.asm @@ -230,8 +230,7 @@ SlotsLoop: call PrintNum ret -Function92811: ; unreferenced -; debug function? +DebugPrintSlotBias: ; unreferenced ld a, [wSlotBias] add 0 daa @@ -248,8 +247,8 @@ Function92811: ; unreferenced ld [hl], a ret -Function9282c: ; unreferenced -; animate OAM tiles? +AnimateSlotReelIcons: ; unreferenced +; This animation was present in pokegold-spaceworld. ld hl, wcf66 ld a, [hl] inc [hl] @@ -259,7 +258,7 @@ Function9282c: ; unreferenced ld c, NUM_SPRITE_OAM_STRUCTS - 16 .loop ld a, [hl] - xor %00100000 + xor $20 ; alternate between $00-$1f and $20-$3f ld [hli], a ; tile id rept SPRITEOAMSTRUCT_LENGTH - 1 inc hl @@ -845,7 +844,9 @@ Slots_UpdateReelPositionAndOAM: jr nz, .loop ret -Function92bbe: ; unreferenced +GetUnknownSlotReelData: ; unreferenced +; Used to get OAM attribute values for slot reels? +; (final Slots_UpdateReelPositionAndOAM above reuses tile IDs as OAM palettes) push hl srl a srl a diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 2c8fdf85d..cf71e4803 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -719,12 +719,13 @@ GetMonPalettePointer: call _GetMonPalettePointer ret -Function9779: ; unreferenced +CGBCopyBattleObjectPals: ; unreferenced +; dummied out ret call CheckCGB ret z ld hl, BattleObjectPals - ld a, $90 + ld a, (1 << rOBPI_AUTO_INCREMENT) | $10 ldh [rOBPI], a ld c, 6 palettes .loop @@ -745,7 +746,7 @@ INCLUDE "gfx/battle_anims/battle_anims.pal" Function97cc: ; unreferenced call CheckCGB ret z - ld a, $90 + ld a, (1 << rOBPI_AUTO_INCREMENT) | $10 ldh [rOBPI], a ld a, PREDEFPAL_TRADE_TUBE call GetPredefPal @@ -952,7 +953,7 @@ _InitSGBBorderPals: dw DataSndPacket7 dw DataSndPacket8 -Function9911: ; unreferenced +UpdateSGBBorder: ; unreferenced di xor a ldh [rJOYP], a diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm index 8afd4bf79..0334b9a2e 100644 --- a/engine/items/tmhm.asm +++ b/engine/items/tmhm.asm @@ -484,7 +484,7 @@ TMHM_PlaySFX_ReadText2: pop de ret -Function2cadf: ; unreferenced +VerboseReceiveTMHM: ; unreferenced call ConvertCurItemIntoCurTMHM call .CheckHaveRoomForTMHM ld hl, .NoRoomTMHMText @@ -510,7 +510,7 @@ Function2cadf: ; unreferenced add hl, bc ld a, [hl] inc a - cp NUM_TMS * 2 + cp MAX_ITEM_STACK + 1 ret nc ld [hl], a ret diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index 7c83f4fea..7f8b8c189 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -26,7 +26,7 @@ DeleteMapObject:: pop bc ret -Function437b: +HandleObjectStep: call .CheckObjectStillVisible ret c call .HandleStepType @@ -609,7 +609,7 @@ MapObjectMovementPattern: ret .ObeyDPad: - ld hl, Function5000 + ld hl, ApplyPlayerMovementByte jp HandleMovementData .Movement08: @@ -630,7 +630,7 @@ MapObjectMovementPattern: jp _GetMovementObject .Movement0d: - ld hl, Function5000 + ld hl, ApplyPlayerMovementByte jp HandleMovementData .Movement0e: @@ -1823,7 +1823,7 @@ UpdateJumpPosition: db -4, -6, -8, -10, -11, -12, -12, -12 db -11, -10, -9, -8, -6, -4, 0, 0 -Function5000: ; unscripted? +ApplyPlayerMovementByte: ; copy [wPlayerNextMovement] to [wPlayerMovement] ld a, [wPlayerNextMovement] ld hl, wPlayerMovement @@ -2419,7 +2419,7 @@ HandleNPCStep:: ldh [hMapObjectIndexBuffer], a call DoesObjectHaveASprite jr z, .next - call Function437b + call HandleObjectStep .next ld hl, OBJECT_LENGTH add hl, bc diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index c4c40bbd9..18533678c 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -528,7 +528,7 @@ Phone_CallEnd: call HangUp_Wait20Frames ret -Function90316: +HangUp_ShutDown: ; unreferenced ld de, SFX_SHUT_DOWN_PC call PlaySFX ret diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 54caaf543..d47db6c53 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -2789,7 +2789,7 @@ INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" FlyMapLabelBorderGFX: INCBIN "gfx/pokegear/flymap_label_border.1bpp" -Function92311: +Function92311: ; unreferenced xor a ld [wTownMapPlayerIconLandmark], a call ClearBGPalettes diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index 97121aa3d..a6ad0818e 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -483,7 +483,8 @@ StatsScreen_InitUpperHalf: dw sBoxMonNicknames dw wBufferMonNick -Function4df7f: ; unreferenced +StatsScreen_PlaceVerticalDivider: ; unreferenced +; The Japanese stats screen has a vertical divider. hlcoord 7, 0 ld bc, SCREEN_WIDTH ld d, SCREEN_HEIGHT diff --git a/engine/rtc/print_hours_mins.asm b/engine/rtc/print_hours_mins.asm index 2cc6cc326..5c4c2fdb7 100644 --- a/engine/rtc/print_hours_mins.asm +++ b/engine/rtc/print_hours_mins.asm @@ -1,4 +1,5 @@ Function1dd6a9: ; unreferenced +; Debug function? ld a, b ld b, c ld c, a |