portable pc

This commit is contained in:
Thorn Avery 2024-01-29 16:43:33 +13:00
parent 031bee1627
commit 94ef32cb10
6 changed files with 53 additions and 10 deletions

View file

@ -3,7 +3,7 @@ DrawStartMenu::
CheckEvent EVENT_GOT_POKEDEX
; menu with pokedex
hlcoord 10, 0
ld b, $0e
ld b, $10
ld c, $08
jr nz, .drawTextBoxBorder
; shorter menu if the player doesn't have the pokedex
@ -33,7 +33,7 @@ DrawStartMenu::
; case for having pokedex
ld de, StartMenuPokedexText
call PrintStartMenuItem
ld a, $07
ld a, $08
.storeMenuItemCount
ld [wMaxMenuItem], a ; number of menu items
ld de, StartMenuPokemonText
@ -53,6 +53,11 @@ DrawStartMenu::
call PrintStartMenuItem
ld de, StartMenuOptionText
call PrintStartMenuItem
CheckEvent EVENT_GOT_POKEDEX
jr z, .dontPrintPortablePC
ld de, StartMenuPortablePCText
call PrintStartMenuItem
.dontPrintPortablePC
ld de, StartMenuExitText
call PlaceString
ld hl, wd730
@ -80,6 +85,9 @@ StartMenuExitText:
StartMenuOptionText:
db "OPTION@"
StartMenuPortablePCText:
db "PORT.PC@"
PrintStartMenuItem:
push hl
call PlaceString

View file

@ -835,3 +835,28 @@ SwitchPartyMon_InitVarOrSwapData:
pop de
pop hl
ret
StartMenu_PortablePC::
ld a, [wCurMap]
cp LORELEIS_ROOM
jr z, .cantUseItHere
cp BRUNOS_ROOM
jr z, .cantUseItHere
cp AGATHAS_ROOM
jr z, .cantUseItHere
cp LANCES_ROOM
jr z, .cantUseItHere
callfar ActivatePC
jr .done
.cantUseItHere
ld hl, CantUsePCHere
call PrintText
.done
call LoadScreenTilesFromBuffer2
call LoadTextBoxTilePatterns
call UpdateSprites
jp RedisplayStartMenu
CantUsePCHere:
text_far _CantUsePCHere
text_end