pokegold-spaceworld/engine/debug/sound_debug_menu.asm
Alieneer 605b2d2810
Disassemble Unreferenced_GetMoveSound + minor cleanup (#139)
Removes some useless origins and fixes the table in fifteen puzzle minigames.
Changes `[hl+]` to `[hli]`.
2026-06-08 15:09:55 -04:00

133 lines
2.1 KiB
NASM
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

INCLUDE "constants.asm"
SECTION "engine/debug/sound_debug_menu.asm", ROMX
_DebugMenuSoundTest::
call ClearTileMap
call LoadFontExtra
call ClearSprites
call GetMemSGBLayout
xor a
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
.RefreshScreenAndLoop:
call WaitBGMap
.Loop:
call ClearJoypad
call GetJoypad
ldh a, [hJoyDown]
and a
jr z, .Loop
bit A_BUTTON_F, a
jr nz, .a_pressed
bit B_BUTTON_F, a
jr nz, .b_pressed
bit START_F, a
jr nz, .start_pressed
bit D_UP_F, a
jr nz, .up_pressed
bit D_DOWN_F, a
jr nz, .down_pressed
ret
.a_pressed
; BUG: The selected sound won't play as the PlaySFX call isn't present.
; Loading the soundbank is pointless as all sounds share the same bank, this would be correct in pokered.
ldh a, [hDebugMenuSoundBank]
ld c, a
ldh a, [hDebugMenuSoundID]
; ld e, a
; ld d, 0
; callfar PlaySFX
jr .RefreshScreenAndLoop
.up_pressed
ldh a, [hDebugMenuSoundMenuIndex]
inc a
cp 55
jr nz, .SetIndex
xor a
.SetIndex:
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
jr .RefreshScreenAndLoop
.down_pressed
ldh a, [hDebugMenuSoundMenuIndex]
dec a
cp -1
jr nz, .SetIndex2
ld a, 54
.SetIndex2:
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
jr .RefreshScreenAndLoop
.start_pressed
ldh a, [hDebugMenuSoundBank]
ld c, a
ld a, -1
jr .RefreshScreenAndLoop
.b_pressed
ldh a, [hDebugMenuSoundBank]
ld c, a
ld a, 10
ld [wcdb5], a
ld [wcdb6], a
ld a, $ff
ld [wcdb4], a
jr .RefreshScreenAndLoop
.DetermineDescriptionPointer:
ld hl, SoundTestTextPointers
ldh a, [hDebugMenuSoundMenuIndex]
add a
add a ; a * 4
ld d, 0
ld e, a
add hl, de
ld a, [hli]
ldh [hDebugMenuSoundID], a
ld a, [hli]
ldh [hDebugMenuSoundBank], a
ld a, [hli]
ld e, a
ld d, [hl]
call CopyStringToStringBuffer2
call .DisplayText
ret
.DisplayText:
ld hl, hDebugMenuSoundMenuIndex
inc [hl]
ld hl, .String
call PrintText
ld hl, hDebugMenuSoundMenuIndex
dec [hl]
ld c, 3
call DelayFrames
ret
.String:
deciram hDebugMenuSoundMenuIndex, 1, 1
text_start
line "@"
text_from_ram wStartDay
text " "
done
INCLUDE "data/sound_test_text_pointers.inc"