Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DebugMenu_MonPicker:
- ld a, [hInMenu]
- push af
- call ClearWindowData
- hlcoord 1, 3
- lb bc, 10, 16
- call TextBox
- ld hl, .MenuDataHeader
- call LoadMenuDataHeader
- call ScrollingMenu
- pop af
- ld [hInMenu], a
- ld a, [wScrollingMenuCursorPosition]
- inc a
- ret
- .MenuDataHeader:
- db $40 ; flags
- db 04, 02 ; start coords
- db 13, 17 ; end coords
- dw .MenuData2
- db 1 ; default option
- .MenuData2:
- db %00000001 ; flags
- db 5, 0 ; rows, columns
- db 2 ; horizontal spacing
- dba .NumItems
- dba .PlaceMenuItemName
- .NumItems:
- db NUM_POKEMON - 1
- db 0, 0, -1, 0, 0, 0, -1
- .PlaceMenuItemName:
- ld a, [MenuSelection]
- cp -1
- jr z, .PlaceMenuItemName_cancel
- .PlaceMenuItemName_normal:
- push de
- ld a, [wScrollingMenuCursorPosition]
- inc a
- ld [wNamedObjectIndexBuffer], a
- call GetPokemonName
- pop hl
- push de
- ld de, wNamedObjectIndexBuffer
- lb bc, PRINTNUM_LEADINGZEROS | 1, 3
- call PrintNum
- pop de
- inc hl
- call PlaceString
- ret
- ; Shitty hack to circumvent the cancel option in menus
- .PlaceMenuItemName_cancel:
- push bc
- push de
- call .PlaceMenuItemName_normal
- di
- ld c, 4
- .PlaceMenuItemName_cancel_stackloop:
- pop hl
- push hl
- push hl
- add sp, 4
- dec c
- jr nz, .PlaceMenuItemName_cancel_stackloop
- ld hl, ScrollingMenu_UpdateDisplay.loop
- push hl
- add sp, -2
- ld hl, ReturnFarCall ; Prevent the mangling of hl on return.
- push hl
- add sp, -4
- ei
- pop hl
- ld bc, 2 * SCREEN_WIDTH
- add hl, bc
- pop bc
- inc c
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement