2022-06-06 14:25:42 -07:00
|
|
|
DEF UNOWNSTAMP_BOLD_A EQU "♂" ; $ef
|
|
|
|
DEF UNOWNSTAMP_BOLD_B EQU "♀" ; $f5
|
2018-06-25 20:14:52 -07:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
_UnownPrinter:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wUnownDex]
|
2015-11-16 19:29:54 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hInMenu]
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOptions]
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
|
|
|
set NO_TEXT_SCROLL, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOptions], a
|
2015-11-16 19:29:54 -08:00
|
|
|
call ClearBGPalettes
|
2020-02-13 09:30:13 -08:00
|
|
|
call ClearTilemap
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
ld de, UnownDexATile
|
2018-06-25 20:14:52 -07:00
|
|
|
ld hl, vTiles0 tile UNOWNSTAMP_BOLD_A
|
2018-12-25 09:49:54 -08:00
|
|
|
lb bc, BANK(UnownDexATile), 1
|
2015-11-16 19:29:54 -08:00
|
|
|
call Request1bpp
|
|
|
|
|
|
|
|
ld de, UnownDexBTile
|
2018-06-25 20:14:52 -07:00
|
|
|
ld hl, vTiles0 tile UNOWNSTAMP_BOLD_B
|
2015-11-16 19:29:54 -08:00
|
|
|
lb bc, BANK(UnownDexBTile), 1
|
|
|
|
call Request1bpp
|
|
|
|
|
|
|
|
hlcoord 0, 0
|
|
|
|
lb bc, 3, 18
|
2023-08-11 03:28:14 -07:00
|
|
|
call Textbox1bpp
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
hlcoord 0, 5
|
|
|
|
lb bc, 7, 7
|
2023-08-11 03:28:14 -07:00
|
|
|
call Textbox1bpp
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
hlcoord 0, 14
|
|
|
|
lb bc, 2, 18
|
2023-08-11 03:28:14 -07:00
|
|
|
call Textbox1bpp
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
hlcoord 1, 2
|
|
|
|
ld de, AlphRuinsStampString
|
|
|
|
call PlaceString
|
|
|
|
|
|
|
|
hlcoord 1, 16
|
|
|
|
ld de, UnownDexDoWhatString
|
|
|
|
call PlaceString
|
|
|
|
|
|
|
|
hlcoord 10, 6
|
|
|
|
ld de, UnownDexMenuString
|
|
|
|
call PlaceString
|
|
|
|
|
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
2015-12-19 11:48:30 -08:00
|
|
|
call .UpdateUnownFrontpic
|
2015-11-16 19:29:54 -08:00
|
|
|
call WaitBGMap
|
|
|
|
|
|
|
|
ld a, UNOWN
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonDVs], a
|
|
|
|
ld [wTempMonDVs + 1], a
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2023-07-26 08:01:20 -07:00
|
|
|
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
|
|
|
|
call GetCGBLayout
|
2024-02-10 15:16:00 -08:00
|
|
|
call SetDefaultBGPAndOBP
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
.joy_loop
|
|
|
|
call JoyTextDelay
|
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2015-11-16 19:29:54 -08:00
|
|
|
and B_BUTTON
|
|
|
|
jr nz, .pressed_b
|
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyPressed]
|
2022-06-06 14:22:48 -07:00
|
|
|
vc_patch Forbid_printing_Unown
|
2022-03-12 15:34:04 -08:00
|
|
|
if DEF(_CRYSTAL11_VC)
|
2023-05-28 07:12:33 -07:00
|
|
|
and NO_INPUT
|
2022-03-12 15:34:04 -08:00
|
|
|
else
|
2015-11-16 19:29:54 -08:00
|
|
|
and A_BUTTON
|
2022-03-12 15:34:04 -08:00
|
|
|
endc
|
|
|
|
vc_patch_end
|
2015-11-16 19:29:54 -08:00
|
|
|
jr nz, .pressed_a
|
|
|
|
|
2015-12-19 11:48:30 -08:00
|
|
|
call .LeftRight
|
2015-11-16 19:29:54 -08:00
|
|
|
call DelayFrame
|
|
|
|
jr .joy_loop
|
|
|
|
|
|
|
|
.pressed_a
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
push af
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall PrintUnownStamp
|
2015-11-16 19:29:54 -08:00
|
|
|
call RestartMapMusic
|
|
|
|
pop af
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
jr .joy_loop
|
|
|
|
|
|
|
|
.pressed_b
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wOptions], a
|
2015-11-16 19:29:54 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-16 19:29:54 -08:00
|
|
|
call ReturnToMapFromSubmenu
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.LeftRight:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-16 19:29:54 -08:00
|
|
|
and D_RIGHT
|
|
|
|
jr nz, .press_right
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-16 19:29:54 -08:00
|
|
|
and D_LEFT
|
|
|
|
jr nz, .press_left
|
|
|
|
ret
|
|
|
|
|
|
|
|
.press_left
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr nz, .wrap_around_left
|
2020-04-17 07:52:59 -07:00
|
|
|
ld [hl], NUM_UNOWN + 1
|
2015-11-16 19:29:54 -08:00
|
|
|
.wrap_around_left
|
|
|
|
dec [hl]
|
|
|
|
jr .return
|
|
|
|
|
|
|
|
.press_right
|
|
|
|
ld hl, wJumptableIndex
|
|
|
|
ld a, [hl]
|
2020-04-17 07:52:59 -07:00
|
|
|
cp NUM_UNOWN
|
2015-11-16 19:29:54 -08:00
|
|
|
jr c, .wrap_around_right
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [hl], -1
|
2015-11-16 19:29:54 -08:00
|
|
|
.wrap_around_right
|
|
|
|
inc [hl]
|
|
|
|
|
|
|
|
.return
|
2015-12-19 11:48:30 -08:00
|
|
|
call .UpdateUnownFrontpic
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.UpdateUnownFrontpic:
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, [wJumptableIndex]
|
2020-04-17 07:52:59 -07:00
|
|
|
cp NUM_UNOWN
|
2016-05-08 11:11:24 -07:00
|
|
|
jr z, .vacant
|
2015-11-16 19:29:54 -08:00
|
|
|
inc a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wUnownLetter], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ld a, UNOWN
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-16 19:29:54 -08:00
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetMonFrontpic
|
2016-05-08 11:11:24 -07:00
|
|
|
call .Load2bppToSRAM
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 6
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hGraphicStartTile], a
|
2015-11-16 19:29:54 -08:00
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $31
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall RotateUnownFrontpic
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
.Load2bppToSRAM:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-16 19:29:54 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wDecompressScratch)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-16 19:29:54 -08:00
|
|
|
|
|
|
|
ld a, BANK(sScratch)
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-12-19 11:48:30 -08:00
|
|
|
ld de, wDecompressScratch
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, sScratch
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hROMBank]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, a
|
|
|
|
ld c, $31
|
|
|
|
call Get2bpp
|
|
|
|
call CloseSRAM
|
|
|
|
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
.vacant
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 1, 6
|
|
|
|
lb bc, 7, 7
|
|
|
|
call ClearBox
|
|
|
|
hlcoord 1, 9
|
|
|
|
ld de, UnownDexVacantString
|
|
|
|
call PlaceString
|
2018-01-08 20:07:46 -08:00
|
|
|
xor a ; sScratch
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2015-11-16 19:29:54 -08:00
|
|
|
ld hl, sScratch
|
|
|
|
ld bc, $31 tiles
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles2 tile $31
|
2015-11-16 19:29:54 -08:00
|
|
|
ld de, sScratch
|
|
|
|
ld c, $31
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hROMBank]
|
2015-11-16 19:29:54 -08:00
|
|
|
ld b, a
|
|
|
|
call Get2bpp
|
|
|
|
call CloseSRAM
|
|
|
|
ld c, 20
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
|
|
|
|
AlphRuinsStampString:
|
|
|
|
db " ALPH RUINS STAMP@"
|
|
|
|
|
|
|
|
UnownDexDoWhatString:
|
|
|
|
db "Do what?@"
|
|
|
|
|
|
|
|
UnownDexMenuString:
|
2018-06-25 20:14:52 -07:00
|
|
|
db UNOWNSTAMP_BOLD_A, " PRINT"
|
|
|
|
next UNOWNSTAMP_BOLD_B, " CANCEL"
|
2015-11-16 19:29:54 -08:00
|
|
|
next "← PREVIOUS"
|
|
|
|
next "→ NEXT"
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
UnownDexVacantString:
|
|
|
|
db "VACANT@"
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
UnownDexATile:
|
2017-12-15 14:50:45 -08:00
|
|
|
INCBIN "gfx/printer/bold_a.1bpp"
|
2018-06-24 07:09:41 -07:00
|
|
|
UnownDexBTile:
|
2017-12-15 14:50:45 -08:00
|
|
|
INCBIN "gfx/printer/bold_b.1bpp"
|
2015-11-16 19:29:54 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
PlaceUnownPrinterFrontpic:
|
2015-11-16 19:29:54 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 7, 11
|
|
|
|
ld a, $31
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hGraphicStartTile], a
|
2015-11-16 19:29:54 -08:00
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2015-11-16 19:29:54 -08:00
|
|
|
ret
|