Split up bank 2; other relabelings

This commit is contained in:
PikalaxALT 2015-10-16 13:35:43 -04:00
parent 1e2ff967aa
commit 4fa6c6daa4
45 changed files with 7856 additions and 7783 deletions

View File

@ -8870,7 +8870,7 @@ Function3f85f: ; 3f85f
ld a, [de]
and a
jr z, .asm_3f8c9
ld a, [wd4b4]
ld a, [wSavedAtLeastOnce]
and a
jr z, .asm_3f8c9
push hl
@ -8967,7 +8967,7 @@ Function3f85f: ; 3f85f
ret
.asm_3f92b
ld a, [wd4b4]
ld a, [wSavedAtLeastOnce]
and a
ret nz
ld de, .Scores
@ -8981,9 +8981,9 @@ Function3f85f: ; 3f85f
; 3f947
.Format ; 3f947
db " --- ", $22, " - - -@"
db " --- <LNBRK> - - -@"
.Record ; 3f964
db $52, "'s RECORD@"
db "<PLAYER>'s RECORD@"
.Result ; 3f96e
db "RESULT WIN LOSE DRAW@"
.Total ; 3f983

View File

@ -46,8 +46,6 @@ CHECK_FLAG EQU 2
; joypad
BUTTONS EQU %00010000
D_PAD EQU %00100000
NO_INPUT EQU %00000000
A_BUTTON EQU %00000001
@ -59,6 +57,11 @@ D_LEFT EQU %00100000
D_UP EQU %01000000
D_DOWN EQU %10000000
BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START
D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN
R_DPAD EQU %00100000
R_BUTTONS EQU %00010000
; screen
HP_BAR_LENGTH EQU 6

View File

@ -34,7 +34,6 @@ POKEDEX_ENTRIES_4 EQU $74
; engine/events.o
; engine/scripting.o
; engine/events_2.o
EVENTS EQU $25

View File

@ -134,14 +134,14 @@ GetFishGroupHeader: ; 9245b
ret
.group11
ld a, [wdfce]
ld a, [wFishingSwarmFlag]
cp 1
jr nz, .end
ld d, 6
jr .end
.group12
ld a, [wdfce]
ld a, [wFishingSwarmFlag]
cp 2
jr nz, .end
ld d, 7

View File

@ -193,7 +193,7 @@ Function109847:: ; 109847
ld a, $5
ld [hVBlank], a
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [hBGMapMode], a
ld [CreditsPos], a

View File

@ -3137,7 +3137,7 @@ Function5803:: ; 5803
Function5815: ; 5815
call Function18de
ret c
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
ld [wd4cd], a
ret
; 581f
@ -3166,7 +3166,7 @@ Function582c: ; 582c
ld hl, OBJECT_09
add hl, bc
ld [hl], 0
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
ld [wd4ce], a
ret
; 5847

View File

@ -1157,8 +1157,8 @@ MenuData2_0x107f7: ; 0x107f7
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, OTPartyMons
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10807
@ -1181,8 +1181,8 @@ MenuData2_0x10816: ; 0x10816
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
dbw 0, OTPartyMon1Exp + 2
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10826
@ -1214,8 +1214,8 @@ MenuData2_0x1084a: ; 0x1084a
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, OTPartyMon1CaughtGender
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 1085a
@ -1525,8 +1525,8 @@ MenuData2_0x10a57: ; 0x10a57
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, NumItems
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10a67
@ -1543,8 +1543,8 @@ MenuData2_0x10a6f: ; 0x10a6f
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, NumItems
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10a7f
@ -1561,8 +1561,8 @@ MenuData2_0x10a87: ; 0x10a87
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
dbw 0, NumKeyItems
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10a97
@ -1579,8 +1579,8 @@ MenuData2_0x10a9f: ; 0x10a9f
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
dbw 0, NumKeyItems
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10aaf
@ -1597,8 +1597,8 @@ MenuData2_0x10ab7: ; 0x10ab7
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, NumBalls
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10ac7
@ -1615,8 +1615,8 @@ MenuData2_0x10acf: ; 0x10acf
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
dbw 0, NumBalls
dbw BANK(Function24ab4), Function24ab4
dbw BANK(Function24ac3), Function24ac3
dbw BANK(PlaceMenuItemName), PlaceMenuItemName
dbw BANK(PlaceMenuItemQuantity), PlaceMenuItemQuantity
dbw BANK(Function244c3), Function244c3
; 10adf

View File

@ -833,7 +833,7 @@ UnknownScript_0xbd544:
pokenamemem QWILFISH, $1
displaylocation ROUTE_32, $2
writebyte $1
special Functionc3fc
special Special_ActivateFishingSwarm
farjump UnknownScript_0xa05d6
UnknownScript_0xbd55c:

View File

@ -16,10 +16,10 @@ Pokedex: ; 40000
push af
xor a
ld [VramState], a
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [$ffde], a
@ -44,7 +44,7 @@ Pokedex: ; 40000
ld [wd959], a
pop af
ld [$ffaa], a
ld [hInMenu], a
pop af
ld [VramState], a
pop af
@ -844,7 +844,7 @@ Function405df: ; 405df (10:45df)
ret
Function40610: ; 40610 (10:4610)
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_RIGHT
jr nz, .right
@ -913,7 +913,7 @@ Function4066c: ; 4066c (10:466c)
ld [wc7e2], a
ld a, [wc7d0]
ld [wc7e3], a
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_UP
jr nz, .up
@ -964,7 +964,7 @@ Function406c5: ; 406c5 (10:46c5)
ld d, a
ld a, [wc7d2]
ld e, a
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_UP
jr nz, Function406ea
@ -1799,7 +1799,7 @@ Function40f4f: ; 40f4f (10:4f4f)
ld a, [wc7d8]
cp $2
jr nc, .asm_40f63
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and $20
jr nz, .asm_40f65
@ -2274,7 +2274,7 @@ Function4135a: ; 4135a (10:535a)
jr nz, .asm_413c1
call Function413f5
jr c, .asm_413bf
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_LEFT | D_UP
and b

View File

@ -83,8 +83,8 @@ PredefPointers:: ; 856b
add_predef Function91d11
add_predef CheckContestMon
add_predef Function8c20f
add_predef Function8c000
add_predef Function8c000_2
add_predef Predef35
add_predef Predef36
add_predef PlayBattleAnim
add_predef Predef38 ; $38
add_predef Predef39

View File

@ -380,7 +380,7 @@ ErasePreviousSave: ; 14cbb
ld [sStackTop + 1], a
call CloseSRAM
ld a, $1
ld [wd4b4], a
ld [wSavedAtLeastOnce], a
ret
; 14ce2
@ -486,7 +486,7 @@ Function14d93: ; 14d93
Function14da0: ; 14da0
ld a, [wd4b4]
ld a, [wSavedAtLeastOnce]
and a
ret nz
call ErasePreviousSave

View File

@ -39,7 +39,7 @@ SpecialsPointers:: ; c029
add_special Special_GetMysteryGiftItem
add_special Special_UnlockMysteryGift
; Bug Catching Contest
; Map Events
add_special BugContestJudging
add_special CheckPartyFullAfterContest
add_special CheckFirstMonFainted
@ -88,25 +88,25 @@ SpecialsPointers:: ; c029
add_special Special_FindAtLeastThatHappy
add_special Special_FindThatSpecies
add_special Special_FindThatSpeciesYourTrainerID
add_special Functionc3ef
add_special Function17421
add_special Function17440
add_special Functionc3ef ; unreferenced
add_special Special_DayCareMon1
add_special Special_DayCareMon2
add_special Special_SelectRandomBugContestContestants
add_special Functionc3fc
add_special Special_ActivateFishingSwarm
add_special ToggleMaptileDecorations
add_special ToggleDecorationsVisibility
add_special SpecialGiveShuckle
add_special SpecialReturnShuckle
add_special Function73f7
add_special Special_BillsGrandfather
add_special SpecialCheckPokerus
add_special Function24b25
add_special Function24b4e
add_special Special_DisplayCoinCaseBalance
add_special Special_DisplayMoneyAndCoinBalance
add_special Function24ae8
add_special Special_CheckForLuckyNumberWinners
add_special Special_CheckLuckyNumberShowFlag
add_special Special_ResetLuckyNumberShowFlag
add_special Function4d9d3
add_special Function88018
add_special Special_PrintTodaysLuckyNumber
add_special Special_SelectApricornForKurt
add_special SpecialNameRater
add_special Functionc2da
add_special GetFirstPokemonHappiness
@ -489,9 +489,9 @@ Functionc3ef: ; c3ef
ret
; c3fc
Functionc3fc: ; c3fc
Special_ActivateFishingSwarm: ; c3fc
ld a, [ScriptVar]
ld [wdfce], a
ld [wFishingSwarmFlag], a
ret
; c403
@ -531,7 +531,7 @@ Special_ResetLuckyNumberShowFlag: ; c422
; c434
Special_CheckLuckyNumberShowFlag: ; c434
callba Function11542
callba CheckLuckyNumberShowFlag
jp ScriptReturnCarry
; c43d

View File

@ -1809,7 +1809,7 @@ CoinVendor_IntroScript: ; 0xbcde0
farwritetext CoinVendor_IntroText
CoinVendor_SellCoinsMenuScript: ; 0xbcde4
special Function24b4e
special Special_DisplayMoneyAndCoinBalance
loadmenudata CoinVendor_MenuDataHeader
interpretmenu2
writebackup

View File

@ -62,7 +62,7 @@ Function11415: ; 11415
ret
; 11420
Function11420: ; 11420
CheckDayDependentEventHL: ; 11420
inc hl
push hl
call Function115cf
@ -98,7 +98,7 @@ Function1144c: ; 1144c
Function11452:: ; 11452
ld hl, wdc1c
call Function11420
call CheckDayDependentEventHL
ret nc
xor a
ld hl, DailyFlags
@ -217,7 +217,7 @@ Function114fc: ; 114fc
ret
; 1150c
Function1150c: ; 1150c
Function1150c: ; Specific version of CheckDayDependentEventHL when hl = $dc3a
ld hl, wdc3b
call Function115cf
call Function115c8
@ -262,9 +262,9 @@ Function1152b: ; 1152b
ret
; 11542
Function11542: ; 11542
CheckLuckyNumberShowFlag: ; 11542
ld hl, wLuckyNumberDayBuffer
jp Function11420
jp CheckDayDependentEventHL
; 11548
Function11548: ; 11548
@ -277,7 +277,7 @@ Function11548: ; 11548
ld [Buffer2], a
call CloseSRAM
ld hl, Buffer1
call Function11420
call CheckDayDependentEventHL
jr nc, .asm_11572
ld hl, Buffer1
call Function11413

344
event/battle_tower.asm Normal file
View File

@ -0,0 +1,344 @@
Function8b1e1: ; 8b1e1
ld de, Unknown_8b1ed
call Function8b25b
ret z
call Function8b231
scf
ret
; 8b1ed
Unknown_8b1ed: ; 8b1ed
db 2
dw Unknown_8b1f2
dw Unknown_8b1f6
Unknown_8b1f2: ; 8b1f2
dw Function8b2bb
dw Function8b2c1
; 8b1f6
Unknown_8b1f6: ; 8b1f6
dw UnknownText_0x8b1fc
dw UnknownText_0x8b23d
dw UnknownText_0x8b242
; 8b1fc
UnknownText_0x8b1fc: ; 0x8b1fc
; Excuse me!
text_jump UnknownText_0x1c5937
db "@"
; 0x8b201
CheckForBattleTowerRules: ; 8b201
ld hl, StringBuffer2
ld [hl], "3"
inc hl
ld [hl], "@"
ld de, CheckForBattleTowerRules_FunctionsText
call Function8b25b
ret z
call Function8b231
scf
ret
; 8b215
CheckForBattleTowerRules_FunctionsText: ; 8b215
db 4
dw CheckForBattleTowerRules_Functions
dw CheckForBattleTowerRules_Text
CheckForBattleTowerRules_Functions: ; 8b21a
dw Function_PartyCountEq3
dw Function_PartySpeciesAreUnique
dw Function_PartyItemsAreUnique
dw Function_HasPartyAnEgg
; 8b222
CheckForBattleTowerRules_Text: ; 8b222
dw JumpText_ExcuseMeYoureNotReady
dw JumbText_OnlyThreePkmnMayBeEntered
dw JumpText_ThePkmnMustAllBeDifferentKinds
dw JumpText_ThePkmnMustNotHoldTheSameItems
dw JumpText_YouCantTakeAnEgg
; 8b22c
JumpText_ExcuseMeYoureNotReady: ; 0x8b22c
; Excuse me. You're not ready.
text_jump Text_ExcuseMeYoureNotReady
db "@"
; 0x8b231
Function8b231: ; 8b231
ld hl, UnknownText_0x8b238
call PrintText
ret
; 8b238
UnknownText_0x8b238: ; 0x8b238
; Please return when you're ready.
text_jump UnknownText_0x1c5962
db "@"
; 0x8b23d
UnknownText_0x8b23d: ; 0x8b23d
; You need at least three #MON.
text_jump UnknownText_0x1c5983
db "@"
; 0x8b242
UnknownText_0x8b242: ; 0x8b242
; Sorry, an EGG doesn't qualify.
text_jump UnknownText_0x1c59a3
db "@"
; 0x8b247
JumbText_OnlyThreePkmnMayBeEntered: ; 0x8b247
; Only three #MON may be entered.
text_jump Text_OnlyThreePkmnMayBeEntered
db "@"
; 0x8b24c
JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c
; The @ #MON must all be different kinds.
text_jump Text_ThePkmnMustAllBeDifferentKinds
db "@"
; 0x8b251
JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251
; The @ #MON must not hold the same items.
text_jump Text_ThePkmnMustNotHoldTheSameItems
db "@"
; 0x8b256
JumpText_YouCantTakeAnEgg: ; 0x8b256
; You can't take an EGG!
text_jump Text_YouCantTakeAnEgg
db "@"
; 0x8b25b
Function8b25b: ; 8b25b
ld bc, $0000
.asm_8b25e
call Function8b26c
call c, Function8b28e
call Function8b276
jr nz, .asm_8b25e
ld a, b
and a
ret
; 8b26c
Function8b26c: ; 8b26c
push de
push bc
call Function8b27a
ld a, c
rst JumpTable
pop bc
pop de
ret
; 8b276
Function8b276: ; 8b276
inc c
ld a, [de]
cp c
ret
; 8b27a
Function8b27a: ; 8b27a
inc de
ld a, [de]
ld l, a
inc de
ld a, [de]
ld h, a
ret
; 8b281
Function8b281: ; 8b281
rept 3
inc de
endr
ld a, [de]
ld l, a
inc de
ld a, [de]
ld h, a
ret
; 8b28a
Function8b28a: ; 8b28a
ld a, [hli]
ld h, [hl]
ld l, a
ret
; 8b28e
Function8b28e: ; 8b28e
push de
push bc
ld a, b
and a
call z, Function8b29d
pop bc
call Function8b2a9
ld b, $1
pop de
ret
; 8b29d
Function8b29d: ; 8b29d
push de
call Function8b281
call Function8b28a
call PrintText
pop de
ret
; 8b2a9
Function8b2a9: ; 8b2a9
push bc
call Function8b281
rept 2
inc hl
endr
ld b, $0
rept 2
add hl, bc
endr
call Function8b28a
call PrintText
pop bc
ret
; 8b2bb
Function8b2bb: ; 8b2bb
ld a, [PartyCount]
cp 3
ret
; 8b2c1
Function8b2c1: ; 8b2c1
ld hl, PartyCount
ld a, [hli]
ld b, $0
ld c, a
.asm_8b2c8
ld a, [hli]
cp EGG
jr z, .asm_8b2ce
inc b
.asm_8b2ce
dec c
jr nz, .asm_8b2c8
ld a, [PartyCount]
cp b
ret z
ld a, b
cp 3
ret
; 8b2da
Function_PartyCountEq3: ; 8b2da
ld a, [PartyCount]
cp 3
ret z
scf
ret
; 8b2e2
Function_PartySpeciesAreUnique: ; 8b2e2
ld hl, PartyMon1Species
call VerifyUniqueness
ret
; 8b2e9
VerifyUniqueness: ; 8b2e9
ld de, PartyCount
ld a, [de]
inc de
dec a
jr z, .done
ld b, a
.loop
push hl
push de
ld c, b
call .isegg
jr z, .next
ld a, [hl]
and a
jr z, .next
.loop2
call .nextmon
call .isegg
jr z, .next2
cp [hl]
jr z, .gotcha
.next2
dec c
jr nz, .loop2
.next
pop de
pop hl
call .nextmon
dec b
jr nz, .loop
.done
and a
ret
.gotcha
pop de
pop hl
scf
ret
; 8b31a
.nextmon: ; 8b31a
push bc
ld bc, PartyMon2 - PartyMon1
add hl, bc
inc de
pop bc
ret
; 8b322
.isegg: ; 8b322
push bc
ld b, a
ld a, [de]
cp EGG
ld a, b
pop bc
ret
; 8b32a
Function_PartyItemsAreUnique: ; 8b32a
ld hl, PartyMon1Item
call VerifyUniqueness
ret
; 8b331
Function_HasPartyAnEgg: ; 8b331
ld hl, PartyCount
ld a, [hli]
ld c, a
.loop
ld a, [hli]
cp EGG
jr z, .found
dec c
jr nz, .loop
and a
ret
.found
scf
ret
; 8b342

339
event/buena.asm Normal file
View File

@ -0,0 +1,339 @@
SpecialBuenasPassword: ; 8af6b
xor a
ld [wcf76], a
ld hl, MenuDataHeader_0x8afa9
call CopyMenuDataHeader
ld a, [wdc4a]
ld c, a
callba GetBuenasPassword
ld a, [wcf83]
add c
add $2
ld [wcf85], a
call Function1c00
call Function1e5d
callba Function4ae5e
ld b, $0
ld a, [MenuSelection]
ld c, a
ld a, [wdc4a]
and $3
cp c
jr nz, .asm_8afa4
ld b, $1
.asm_8afa4
ld a, b
ld [ScriptVar], a
ret
; 8afa9
MenuDataHeader_0x8afa9: ; 0x8afa9
db $40 ; flags
db 00, 00 ; start coords
db 07, 10 ; end coords
dw MenuData2_0x8afb2
db 1 ; default option
; 0x8afb1
db 0
MenuData2_0x8afb2: ; 0x8afb2
db $81 ; flags
db 0 ; items
dw Unknown_8afb8
dw Function8afbd
; 0x8afb4
Unknown_8afb8: ; 8afb8
db 3
db 0, 1, 2
db -1
Function8afbd: ; 8afbd
push de
ld a, [wdc4a]
and $f0
ld c, a
ld a, [MenuSelection]
add c
ld c, a
callba GetBuenasPassword
pop hl
call PlaceString
ret
; 8afd4
SpecialBuenaPrize: ; 8afd4
xor a
ld [wd0e4], a
ld a, $1
ld [MenuSelection], a
call Function8b0d6
call Function8b090
ld hl, UnknownText_0x8b072
call PrintText
jr .asm_8aff1
.asm_8afeb
ld hl, UnknownText_0x8b072
call Function105a
.asm_8aff1
call DelayFrame
call UpdateSprites
call Function8b097
call Function8b0e2
jr z, .asm_8b05f
ld [wcf75], a
call GetBuenaPrize
ld a, [hl]
ld [wd265], a
call GetItemName
ld hl, UnknownText_0x8b077
call Function105a
call YesNoBox
jr c, .asm_8afeb
ld a, [wcf75]
call GetBuenaPrize
inc hl
ld a, [hld]
ld c, a
ld a, [wdc4b]
cp c
jr c, .asm_8b047
ld a, [hli]
push hl
ld [CurItem], a
ld a, $1
ld [wd10c], a
ld hl, NumItems
call ReceiveItem
pop hl
jr nc, .asm_8b04c
ld a, [hl]
ld c, a
ld a, [wdc4b]
sub c
ld [wdc4b], a
call Function8b097
jr .asm_8b051
.asm_8b047
ld hl, UnknownText_0x8b081
jr .asm_8b05a
.asm_8b04c
ld hl, UnknownText_0x8b086
jr .asm_8b05a
.asm_8b051
ld de, SFX_TRANSACTION
call PlaySFX
ld hl, UnknownText_0x8b07c
.asm_8b05a
call Function105a
jr .asm_8afeb
.asm_8b05f
call WriteBackup
call WriteBackup
ld hl, UnknownText_0x8b08b
call PrintText
call Functiona36
call PlayClickSFX
ret
; 8b072
UnknownText_0x8b072: ; 0x8b072
; Which prize would you like?
text_jump UnknownText_0x1c589f
db "@"
; 0x8b077
UnknownText_0x8b077: ; 0x8b077
; ? Is that right?
text_jump UnknownText_0x1c58bc
db "@"
; 0x8b07c
UnknownText_0x8b07c: ; 0x8b07c
; Here you go!
text_jump UnknownText_0x1c58d1
db "@"
; 0x8b081
UnknownText_0x8b081: ; 0x8b081
; You don't have enough points.
text_jump UnknownText_0x1c58e0
db "@"
; 0x8b086
UnknownText_0x8b086: ; 0x8b086
; You have no room for it.
text_jump UnknownText_0x1c58ff
db "@"
; 0x8b08b
UnknownText_0x8b08b: ; 0x8b08b
; Oh. Please come back again!
text_jump UnknownText_0x1c591a
db "@"
; 0x8b090
Function8b090: ; 8b090
ld hl, MenuDataHeader_0x8b0d1
call LoadMenuDataHeader
ret
; 8b097
Function8b097: ; 8b097
ld de, wdc4b
call Function8b09e
ret
; 8b09e
Function8b09e: ; 8b09e
push de
xor a
ld [hBGMapMode], a
ld hl, MenuDataHeader_0x8b0d1
call CopyMenuDataHeader
call Function1cbb
call UpdateSprites
call GetMemTileCoord
ld bc, $0015
add hl, bc
ld de, String_8b0ca
call PlaceString
ld h, b
ld l, c
inc hl
ld a, $7f
ld [hli], a
ld [hld], a
pop de
lb bc, 1, 2
call PrintNum
ret
; 8b0ca
String_8b0ca:
db "Points@"
; 8b0d1
MenuDataHeader_0x8b0d1: ; 0x8b0d1
db $40 ; flags
db 11, 00 ; start coords
db 13, 11 ; end coords
; 8b0d6
Function8b0d6: ; 8b0d6
ld hl, MenuDataHeader_0x8b0dd
call LoadMenuDataHeader
ret
; 8b0dd
MenuDataHeader_0x8b0dd: ; 0x8b0dd
db $40 ; flags
db 00, 00 ; start coords
db 11, 17 ; end coords
; 8b0e2
Function8b0e2: ; 8b0e2
ld hl, MenuDataHeader_0x8b113
call CopyMenuDataHeader
ld a, [MenuSelection]
ld [wcf88], a
xor a
ld [wcf76], a
ld [hBGMapMode], a
call Function352f
call UpdateSprites
call Function350c
ld a, [MenuSelection]
ld c, a
ld a, [wcfa9]
ld [MenuSelection], a
ld a, [wcf73]
cp $2
jr z, .asm_8b111
ld a, c
and a
ret nz
.asm_8b111
xor a
ret
; 8b113
MenuDataHeader_0x8b113: ; 0x8b113
db $40 ; flags
db 01, 01 ; start coords
db 09, 16 ; end coords
dw MenuData2_0x8b11c
db 1 ; default option
; 0x8b11b
db 0
MenuData2_0x8b11c: ; 0x8b11c
db $10 ; flags
db 4 ; items
db $d, $1
dbw BANK(Unknown_8b129), Unknown_8b129
dbw BANK(BuenaPrizeItem), BuenaPrizeItem
dbw BANK(BuenaPrizePoints), BuenaPrizePoints
; 8b129
Unknown_8b129: ; 8b129
db 9
db 1, 2, 3, 4, 5, 6, 7, 8, 9, $ff
; 8b134
BuenaPrizeItem: ; 8b134
ld a, [MenuSelection]
call GetBuenaPrize
ld a, [hl]
push de
ld [wd265], a
call GetItemName
pop hl
call PlaceString
ret
; 8b147
BuenaPrizePoints: ; 8b147
ld a, [MenuSelection]
call GetBuenaPrize
inc hl
ld a, [hl]
ld c, "0"
add c
ld [de], a
ret
; 8b154
GetBuenaPrize: ; 8b154
dec a
ld hl, BuenaPrizes
ld b, 0
ld c, a
rept 2
add hl, bc
endr
ret
; 8b15e
BuenaPrizes: ; 8b15e
db ULTRA_BALL, 2
db FULL_RESTORE, 2
db NUGGET, 3
db RARE_CANDY, 3
db PROTEIN, 5
db IRON, 5
db CARBOS, 5
db CALCIUM, 5
db HP_UP, 5
; 8b170

415
event/kurt.asm Normal file
View File

@ -0,0 +1,415 @@
Kurt_PrintTextWhichApricorn: ; 88000
ld hl, UnknownText_0x88007
call PrintText
ret
; 88007
UnknownText_0x88007: ; 0x88007
; Which APRICORN should I use?
text_jump UnknownText_0x1bc06b
db "@"
; 0x8800c
Kurt_PrintTextHowMany: ; 8800c
ld hl, UnknownText_0x88013
call PrintText
ret
; 88013
UnknownText_0x88013: ; 0x88013
; How many should I make?
text_jump UnknownText_0x1bc089
db "@"
; 0x88018
Special_SelectApricornForKurt: ; 88018
call Function1d6e
ld c, $1
xor a
ld [wd0e4], a
ld [wdca4], a
.loop
push bc
call Kurt_PrintTextWhichApricorn
pop bc
ld a, c
ld [MenuSelection], a
call Kurt_SelectApricorn
ld a, c
ld [ScriptVar], a
and a
jr z, .done
ld [CurItem], a
ld a, [wcfa9]
ld c, a
push bc
call Kurt_PrintTextHowMany
call Kurt_SelectQuantity
pop bc
jr nc, .loop
ld a, [wd10c]
ld [wdca4], a
call Kurt_GiveUpSelectedQuantityOfSelectedApricorn
.done
call Function1d7d
ret
; 88055
Kurt_SelectApricorn: ; 88055
callba FindApricornsInBag
jr c, .nope
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection]
ld [wcf88], a
xor a
ld [hBGMapMode], a
call Function352f
call UpdateSprites
call Function350c
ld a, [wcf73]
cp $2
jr z, .nope
ld a, [MenuSelection]
cp -1
jr nz, .done
.nope
xor a
.done
ld c, a
ret
; 88086
.MenuDataHeader: ; 0x88086
db $40 ; flags
db 01, 01 ; start coords
db 10, 13 ; end coords
dw .MenuData2
db 1 ; default option
; 0x8808e
db 0
.MenuData2: ; 0x8808f
db $10 ; flags
db 4, 7
db 1
dbw 0, Buffer1
dbw BANK(.Name), .Name
dbw BANK(.Quantity), .Quantity
dbw BANK(NULL), NULL
.Name: ; 8809f
ld a, [MenuSelection]
and a
ret z
callba PlaceMenuItemName
ret
; 880ab
.Quantity: ; 880ab
ld a, [MenuSelection]
ld [CurItem], a
call Kurt_GetQuantityOfApricorn
ret z
ld a, [wd10c]
ld [wcf75], a
callba PlaceMenuItemQuantity
ret
; 880c2
Kurt_SelectQuantity: ; 880c2
ld a, [CurItem]
ld [MenuSelection], a
call Kurt_GetQuantityOfApricorn
jr z, .done
ld a, [wd10c]
ld [wd10d], a
ld a, $1
ld [wd10c], a
ld hl, .MenuDataHeader
call LoadMenuDataHeader
.loop
xor a
ld [hBGMapMode], a
call Function1cbb
call UpdateSprites
call .PlaceApricornName
call PlaceApricornQuantity
call Function321c
callba Function27a28
jr nc, .loop
push bc
call PlayClickSFX
pop bc
ld a, b
cp -1
jr z, .done
ld a, [wd10c]
ld [wd10c], a ; What is the point of this operation?
scf
.done
call WriteBackup
ret
; 8810d
.MenuDataHeader: ; 0x8810d
db $40 ; flags
db 09, 06 ; start coords
db 12, 19 ; end coords
db 0, 0, -1, 0 ; XXX
.PlaceApricornName: ; 88116
call GetMemTileCoord
ld de, $0015
add hl, de
ld d, h
ld e, l
callba PlaceMenuItemName
ret
; 88126
PlaceApricornQuantity: ; 88126
call GetMemTileCoord
ld de, $0032
add hl, de
ld [hl], "×"
inc hl
ld de, wd10c
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
jp PrintNum
; 88139
Kurt_GetQuantityOfApricorn: ; 88139
push bc
ld hl, NumItems
ld a, [CurItem]
ld c, a
ld b, $0
.loop
inc hl
ld a, [hli]
cp -1
jr z, .done
cp c
jr nz, .loop
ld a, [hl]
add b
ld b, a
jr nc, .loop
ld b, -1
.done
ld a, b
sub 99
jr c, .done2
ld b, 99
.done2
ld a, b
ld [wd10c], a
and a
pop bc
ret
; 88161
Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
; Get the quantity of Apricorns of type [CurItem]
; in the bag. Compatible with multiple stacks.
; Initialize the search.
push de
push bc
ld hl, NumItems
ld a, [CurItem]
ld c, a
ld e, $0
xor a
ld [ItemCountBuffer], a
ld a, -1
ld [MiscBuffer2], a
; Search for [CurItem] in the bag.
.loop1
; Increase the total count.
ld a, [ItemCountBuffer]
inc a
ld [ItemCountBuffer], a
; Get the index of the next item.
inc hl
ld a, [hli]
; If we've reached the end of the pocket, break.
cp -1
jr z, .okay1
; If we haven't found what we're looking for, continue.
cp c
jr nz, .loop1
; Increment the result counter and store the bag index of the match.
ld d, $0
push hl
ld hl, MiscBuffer2
add hl, de
inc e
ld a, [ItemCountBuffer]
dec a
ld [hli], a
ld a, -1
ld [hl], a
pop hl
jr .loop1
.okay1
; How many stacks have we found?
ld a, e
and a
jr z, .done
dec a
jr z, .OnlyOne
ld hl, MiscBuffer2
.loop2
ld a, [hl]
ld c, a
push hl
.loop3
inc hl
ld a, [hl]
cp -1
jr z, .okay2
ld b, a
ld a, c
call Kurt_GetAddressOfApricornQuantity
ld e, a
ld a, b
call Kurt_GetAddressOfApricornQuantity
sub e
jr z, .equal
jr c, .less
jr .loop3
.equal
ld a, c
sub b
jr nc, .loop3
.less
ld a, c
ld c, b
ld [hl], a
ld a, c
pop hl
ld [hl], a
push hl
jr .loop3
.okay2
pop hl
inc hl
ld a, [hl]
cp -1
jr nz, .loop2
.OnlyOne
ld hl, MiscBuffer2
.loop4
ld a, [hl]
cp -1
jr z, .done
push hl
ld [ItemCountBuffer], a
call Kurt_GetRidOfItem
pop hl
ld a, [wd10c]
and a
jr z, .done
push hl
ld a, [hli]
ld c, a
.loop5
ld a, [hli]
cp -1
jr z, .okay3
cp c
jr c, .loop5
dec a
dec hl
ld [hli], a
jr .loop5
.okay3
pop hl
inc hl
jr .loop4
.done
ld a, [wd10c]
and a
pop bc
pop de
ret
; 88201
Kurt_GetAddressOfApricornQuantity: ; 88201
push hl
push bc
ld hl, NumItems
inc hl
ld c, a
ld b, $0
rept 2
add hl, bc
endr
inc hl
ld a, [hl]
pop bc
pop hl
ret
; 88211
Kurt_GetRidOfItem: ; 88211
push bc
ld hl, NumItems
ld a, [ItemCountBuffer]
ld c, a
ld b, $0
inc hl
rept 2
add hl, bc
endr
ld a, [CurItem]
ld c, a
ld a, [hli]
cp -1
jr z, .done
cp c
jr nz, .done
ld a, [wd10c]
ld c, a
ld a, [hl]
sub c
ld b, c
jr nc, .okay
add c
ld b, a
.okay
push bc
ld hl, NumItems
ld a, b
ld [wd10c], a
call TossItem
pop bc
ld a, c
sub b
.done
ld [wd10c], a
pop bc
ret
; 88248

View File

@ -1,8 +1,8 @@
Special_BankOfMom: ; 16218
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [wcf63], a
.asm_16223
@ -14,7 +14,7 @@ Special_BankOfMom: ; 16218
.asm_1622f
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
; 16233

300
event/unown.asm Normal file
View File

@ -0,0 +1,300 @@
SpecialHoOhChamber: ; 0x8addb
ld hl, PartySpecies
ld a, [hl]
cp HO_OH ; is Ho-oh the first Pokémon in the party?
jr nz, .done ; if not, we're done
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.done
ret
; 0x8adef
SpecialOmanyteChamber: ; 8adef
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, CHECK_FLAG
call EventFlagAction
ld a, c
and a
jr nz, .nope
ld a, WATER_STONE
ld [CurItem], a
ld hl, NumItems
call CheckItem
jr c, .open
ld a, [PartyCount]
ld b, a
inc b
.loop
dec b
jr z, .nope
ld a, b
dec a
ld [CurPartyMon], a
push bc
ld a, PartyMon1Item - PartyMon1
call GetPartyParamLocation
pop bc
ld a, [hl]
cp WATER_STONE
jr nz, .loop
.open
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.nope
ret
; 8ae30
SpecialAerodactylChamber: ; 8ae30
push de
push bc
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsofAlphAerodactylChamber_SecondMapHeader / $100
jr nz, .nope
ld a, l
cp RuinsofAlphAerodactylChamber_SecondMapHeader % $100
jr nz, .nope
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
ld b, SET_FLAG
call EventFlagAction
scf
jr .done
.nope
and a
.done
pop bc
pop de
ret
; 8ae4e
SpecialKabutoChamber: ; 8ae4e
push hl
push de
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsofAlphKabutoChamber_SecondMapHeader / $100
jr nz, .done
ld a, l
cp RuinsofAlphKabutoChamber_SecondMapHeader % $100
jr nz, .done
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.done
pop de
pop hl
ret
; 8ae68
Special_DisplayUnownWords: ; 8ae68
ld a, [ScriptVar]
ld hl, MenuDataHeader_0x8aed5
and a
jr z, .asm_8ae79
ld d, $0
ld e, $5
.asm_8ae75
add hl, de
dec a
jr nz, .asm_8ae75
.asm_8ae79
call LoadMenuDataHeader
xor a
ld [hBGMapMode], a
call Function1cbb
call UpdateSprites
call Function321c
call GetMemTileCoord
inc hl
ld d, $0
ld e, $14
rept 2
add hl, de
endr
ld a, [ScriptVar]
ld c, a
ld de, Unknown_8aebc
and a
jr z, .asm_8aea5
.asm_8ae9c
ld a, [de]
inc de
cp $ff
jr nz, .asm_8ae9c
dec c
jr nz, .asm_8ae9c
.asm_8aea5
call Function8af09
ld bc, AttrMap - TileMap
add hl, bc
call Function8aee9
call Function3200
call Functiona36
call PlayClickSFX
call WriteBackup
ret
; 8aebc
Unknown_8aebc: ; 8aebc
db $08, $44, $04, $00, $2e, $08, $ff
db $26, $20, $0c, $0e, $46, $ff
db $4c, $00, $46, $08, $42, $ff
db $0e, $2c, $64, $2c, $0e, $ff
; 8aed5
MenuDataHeader_0x8aed5: ; 0x8aed5
db $40 ; flags
db 04, 03 ; start coords
db 09, 16 ; end coords
MenuDataHeader_0x8aeda: ; 0x8aeda
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
MenuDataHeader_0x8aedf: ; 0x8aedf
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
MenuDataHeader_0x8aee4: ; 0x8aee4
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
; 8aee9
Function8aee9: ; 8aee9
.asm_8aee9
ld a, [de]
cp $ff
ret z
cp $60
ld a, $d
jr c, .asm_8aef5
ld a, $5
.asm_8aef5
call Function8aefd
rept 2
inc hl
endr
inc de
jr .asm_8aee9
; 8aefd
Function8aefd: ; 8aefd
push hl
ld [hli], a
ld [hld], a
ld b, $0
ld c, $14
add hl, bc
ld [hli], a
ld [hl], a
pop hl
ret
; 8af09
Function8af09: ; 8af09
push hl
push de
.asm_8af0b
ld a, [de]
cp $ff
jr z, .asm_8af19
ld c, a
call Function8af1c
rept 2
inc hl
endr
inc de
jr .asm_8af0b
.asm_8af19
pop de
pop hl
ret
; 8af1c
Function8af1c: ; 8af1c
push hl
ld a, c
cp $60
jr z, .asm_8af3b
cp $62
jr z, .asm_8af4b
cp $64
jr z, .asm_8af5b
ld [hli], a
inc a
ld [hld], a
dec a
ld b, $0
ld c, $14
add hl, bc
ld c, $10
add c
ld [hli], a
inc a
ld [hl], a
pop hl
ret
.asm_8af3b
ld [hl], $5b
inc hl
ld [hl], $5c
ld bc, $0013
add hl, bc
ld [hl], $4d
inc hl
ld [hl], $5d
pop hl
ret
.asm_8af4b
ld [hl], $4e
inc hl
ld [hl], $4f
ld bc, $0013
add hl, bc
ld [hl], $5e
inc hl
ld [hl], $5f
pop hl
ret
.asm_8af5b
ld [hl], $2
inc hl
ld [hl], $3
ld bc, $0013
add hl, bc
ld [hl], $3
inc hl
ld [hl], $2
pop hl
ret
; 8af6b

View File

@ -1184,15 +1184,15 @@ Function352f:: ; 352f
Function354b:: ; 354b
call DelayFrame
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Functiona57
pop af
ld [$ffaa], a
ld [hInMenu], a
ld a, [$ffa9]
ld a, [hJoyLast]
and D_RIGHT + D_LEFT + D_UP + D_DOWN
ld c, a
ld a, [hJoyPressed]
@ -2220,7 +2220,7 @@ Function3f6e:: ; 3f6e
; 3f7c
Function3f7c:: ; 3f7c
call Function1cfd
call GetMemTileCoord
call Function1c53
dec b
dec c

View File

@ -39,7 +39,7 @@ Joypad:: ; 935
; We can only get four inputs at a time.
; We take d-pad first for no particular reason.
ld a, D_PAD
ld a, R_DPAD
ld [rJOYP], a
; Read twice to give the request time to take.
rept 2
@ -57,7 +57,7 @@ endr
; Buttons make 8 total inputs (A, B, Select, Start).
; We can fit this into one byte.
ld a, BUTTONS
ld a, R_BUTTONS
ld [rJOYP], a
; Wait for input to stabilize.
rept 6
@ -285,7 +285,7 @@ Functiona1b:: ; a1b
cp D_UP | SELECT | B_BUTTON
jr z, .asm_a34
ld a, [$ffa9]
ld a, [hJoyLast]
and START | A_BUTTON
jr nz, .asm_a34
@ -325,29 +325,29 @@ CloseText:: ; a46
Functiona57:: ; a57
call GetJoypad
ld a, [$ffaa]
ld a, [hInMenu]
and a
ld a, [hJoyPressed]
jr z, .asm_a63
jr z, .ok
ld a, [hJoyDown]
.asm_a63
.ok
ld [hJoyLast], a
ld a, [hJoyPressed]
and a
jr z, .asm_a70
jr z, .checkframedelay
ld a, 15
ld [TextDelayFrames], a
ret
.asm_a70
.checkframedelay
ld a, [TextDelayFrames]
and a
jr z, .asm_a7a
jr z, .restartframedelay
xor a
ld [hJoyLast], a
ret
.asm_a7a
.restartframedelay
ld a, 5
ld [TextDelayFrames], a
ret
@ -356,23 +356,23 @@ Functiona57:: ; a57
Functiona80:: ; a80
ld a, [hConnectionStripLength]
push af
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
push af
xor a
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
ld [hConnectedMapWidth], a
.asm_a8d
push hl
hlcoord 18, 17
call Functionb06
pop hl
call Functiona57
ld a, [$ffa9]
ld a, [hJoyLast]
and $3
jr z, .asm_a8d
pop af
ld [$ffb0], a
ld [hConnectedMapWidth], a
pop af
ld [hConnectionStripLength], a
ret
@ -380,7 +380,7 @@ Functiona80:: ; a80
Functionaa5:: ; aa5
call Functiona57
ld a, [$ffa9]
ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, Functionaa5
ret
@ -456,16 +456,16 @@ Functionb06:: ; b06
dec a
ld [hConnectionStripLength], a
ret nz
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $7a
ld [hl], a
ld a, $ff
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret
.asm_b27
@ -477,12 +477,12 @@ Functionb06:: ; b06
ret nz
dec a
ld [hConnectionStripLength], a
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $6
ld [$ffb0], a
ld [hConnectedMapWidth], a
ld a, $ee
ld [hl], a
ret

View File

@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81
call Function1c66
ld a, [wcf91]
bit 7, a
jr z, .asm_1da7 ; 0x1d98 $d
jr z, .cancel ; 0x1d98 $d
call Function1c10
call Function1bc9
call Function1ff8
bit 1, a
jr z, .asm_1da9 ; 0x1da5 $2
.asm_1da7
jr z, .okay ; 0x1da5 $2
.cancel
scf
ret
.asm_1da9
.okay
and a
ret
; 0x1dab
@ -165,15 +165,15 @@ Function1dfe:: ; 1dfe
call DelayFrames
call WriteBackup
pop af
jr c, .asm_1e16
jr c, .no
ld a, [wcfa9]
cp 2 ; no
jr z, .asm_1e16
jr z, .no
and a
ret
.asm_1e16
ld a, $2
.no
ld a, 2
ld [wcfa9], a
scf
ret
@ -308,7 +308,7 @@ Function1ebd:: ; 1ebd
; 1eda
Function1eda:: ; 1eda
call Function1cfd
call GetMemTileCoord
ld bc, $002a
add hl, bc
.asm_1ee1
@ -521,13 +521,13 @@ Function1ff0:: ; 1ff0
Function1ff8:: ; 1ff8
push af
and $3
jr z, .asm_2007
jr z, .nosound
ld hl, wcf81
bit 3, [hl]
jr nz, .asm_2007
jr nz, .nosound
call PlayClickSFX
.asm_2007
.nosound
pop af
ret
; 2009

View File

@ -159,11 +159,11 @@ Function1bd3:: ; 1bd3
Function1bdd:: ; 1bdd
push bc
push af
ld a, [$ffa9]
and $f0
ld a, [hJoyLast]
and D_PAD
ld b, a
ld a, [hJoyPressed]
and $f
and BUTTONS
or b
ld b, a
pop af
@ -214,7 +214,7 @@ WriteBackup:: ; 0x1c17
ret
Function1c23:: ; 0x1c23
call Function1cfd
call GetMemTileCoord
call Function1c30
call Function1d19
call Function1c30

View File

@ -79,6 +79,7 @@ DmgToCgbBGPals:: ; c9f
ld [rBGP], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .end
@ -89,7 +90,7 @@ DmgToCgbBGPals:: ; c9f
ld a, [rSVBK]
push af
ld a, 5
ld a, 5 ; gfx
ld [rSVBK], a
; copy & reorder bg pal buffer
@ -165,16 +166,21 @@ DmgToCgbObjPals:: ; ccb
Functioncf8:: ; cf8
ld [rOBP0], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .asm_d22
jr z, .done
push hl
push de
push bc
ld a, [rSVBK]
push af
ld a, $5
ld a, 5 ; gfx
ld [rSVBK], a
ld hl, OBPals
ld de, Unkn2Pals
ld a, [rOBP0]
@ -183,13 +189,15 @@ Functioncf8:: ; cf8
call CopyPals
ld a, $1
ld [hCGBPalUpdate], a
pop af
ld [rSVBK], a
pop bc
pop de
pop hl
.asm_d22
.done
pop af
ret
; d24

View File

@ -17,19 +17,19 @@ ClearBox:: ; fb6
ld a, " "
FillBoxWithByte::
.col
.row
push bc
push hl
.row
.col
ld [hli], a
dec c
jr nz, .row
jr nz, .col
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .col
jr nz, .row
ret
; fc8
@ -61,8 +61,11 @@ ClearScreen:: ; fdb
TextBox:: ; fe8
; Draw a text box width c height b at hl.
; Dimensions do not include the border.
; Draw a text box at hl with room for
; b lines of c characters each.
; Places a border around the textbox,
; then switches the palette to the
; text black-and-white scheme.
push bc
push hl
call TextBoxBorder
@ -263,14 +266,14 @@ endm
dict "<ROCKET>", RocketChar
dict "<TM>", TMChar
dict "<TRNER>", TrainerChar
dict $23, Char23
dict $22, Char22
dict $23, PlaceKougeki
dict "<LNBRK>", Char22
dict "<CONT>", ContText
dict "<......>", SixDotsChar
dict "<DONE>", DoneText
dict "<PROMPT>", PromptText
dict "<PKMN>", PlacePKMN
dict $24, PlacePOKE
dict "<POKE>", PlacePOKE
dict $25, NextChar
dict2 $1f, " "
dict "<DEXEND>", PlaceDexEnd
@ -349,7 +352,7 @@ TMChar: print_name TMCharText ; 11b0
PCChar: print_name PCCharText ; 11b7
RocketChar: print_name RocketCharText ; 11be
PlacePOKe: print_name PlacePOKeText ; 11c5
Char23: print_name Char23Text ; 11cc
PlaceKougeki: print_name KougekiText ; 11cc
SixDotsChar: print_name SixDotsCharText ; 11d3
PlacePKMN: print_name PlacePKMNText ; 11da
PlacePOKE: print_name PlacePOKEText ; 11e1
@ -444,7 +447,7 @@ TrainerCharText:: db "TRAINER@" ; 1276
PCCharText:: db "PC@" ; 127e
RocketCharText:: db "ROCKET@" ; 1281
PlacePOKeText:: db "POKé@" ; 1288
Char23Text:: db "こうげき@" ; 128d
KougekiText:: db "こうげき@" ; 128d
SixDotsCharText:: db "……@" ; 1292
EnemyText:: db "Enemy @" ; 1295
PlacePKMNText:: db "<PK><MN>@" ; PK MN ; 129c

View File

@ -99,7 +99,7 @@ Function1c89:: ; 1c89
ld a, [wcf91]
bit 4, a
ret z
call Function1cfd
call GetMemTileCoord
ld a, [de]
ld c, a
inc de
@ -109,7 +109,7 @@ Function1c89:: ; 1c89
; 1cbb
Function1cbb:: ; 1cbb
call Function1cfd
call GetMemTileCoord
call Function1c53
dec b
dec c
@ -139,7 +139,7 @@ Function1cc6:: ; 1cc6
; 1ce1
Function1ce1:: ; 1ce1
call Function1cfd
call GetMemTileCoord
ld bc, $0015
add hl, bc
call Function1c53
@ -150,7 +150,7 @@ Function1ce1:: ; 1ce1
; 1cf1
Function1cf1:: ; 1cf1
call Function1cfd
call GetMemTileCoord
call Function1c53
inc c
inc b
@ -159,7 +159,7 @@ Function1cf1:: ; 1cf1
; 1cfd
Function1cfd:: ; 1cfd
GetMemTileCoord:: ; 1cfd
ld a, [wcf83]
ld c, a
ld a, [wcf82]

View File

@ -146,7 +146,7 @@ VBlank0:: ; 2b1
rst Bankswitch
ld a, [hSeconds]
ld [$ffe3], a
ld [hSecondsBackup], a
ret
; 325

View File

@ -15,6 +15,8 @@ hMinutes EQU $ff96
hSeconds EQU $ff98
hVBlankCounter EQU $ff9b
hROMBank EQU $ff9d
hVBlank EQU $ff9e
hMapEntryMethod EQU $ff9f
@ -27,6 +29,7 @@ hJoyReleased EQU $ffa6
hJoyPressed EQU $ffa7
hJoyDown EQU $ffa8
hJoyLast EQU $ffa9
hInMenu EQU $ffaa
hConnectionStripLength EQU $ffaf
hConnectedMapWidth EQU $ffb0
@ -44,6 +47,8 @@ hMultiplicand EQU $ffb4 ; 3 bytes long
hMultiplier EQU $ffb7 ; 1 byte long
hProduct EQU $ffb3 ; result (4 bytes long)
hMathBuffer EQU $ffb8
hPrintNum1 EQU $ffb3
hPrintNum2 EQU $ffb4
hPrintNum3 EQU $ffb5
@ -51,7 +56,6 @@ hPrintNum4 EQU $ffb6
hPrintNum5 EQU $ffb7
hPrintNum6 EQU $ffb8
hPrintNum7 EQU $ffb9
hMathBuffer EQU $ffb8
hMoneyTemp EQU $ffc3
@ -81,7 +85,7 @@ hLastTalked EQU $ffe0
hRandom EQU $ffe1
hRandomAdd EQU $ffe1
hRandomSub EQU $ffe2
hSecondsBackup EQU $ffe3
hBattleTurn EQU $ffe4
hCGBPalUpdate EQU $ffe5
hCGB EQU $ffe6

View File

@ -6,43 +6,53 @@ INCLUDE "gbhw.asm"
SECTION "Main", ROMX
Function110000: ; 110000 (44:4000)
; Copy b bytes from hl to de
.loop
ld a, [hli]
ld [de], a
inc de
dec b
jr nz, Function110000
jr nz, .loop
ret
; 110007 (44:4007)
Function110007: ; 110007
.asm_110007
; Copy bytes from hl to de until a 0 is encountered.
; Include the 0 in the copy, and count the number of
; nonzero bytes copied. Keep the de pointer at the
; copied zero.
.loop
ld a, [hli]
ld [de], a
or a
ret z
inc de
inc bc
jr .asm_110007
jr .loop
; 11000f
Function11000f: ; 11000f
; Copy bytes from hl to de until a 0 is encountered,
; or a bytes have been copied, whichever comes first.
; Add the byte count to the count previously stored
; in bc.
push bc
ld c, $0
ld b, a
dec b
.asm_110014
.loop
ld a, [hli]
ld [de], a
or a
jr z, .asm_110020
jr z, .done
inc de
inc c
dec b
jr nz, .asm_110014
jr nz, .loop
xor a
ld [de], a
.asm_110020
.done
ld a, c
pop bc
add c
@ -54,6 +64,7 @@ Function11000f: ; 11000f
; 110029
Function110029: ; 110029 (44:4029)
; Clear two bytes at $ca3a.
xor a
ld hl, $ca3a
ld [hli], a
@ -61,21 +72,25 @@ Function110029: ; 110029 (44:4029)
ret
Function110030:: ; 110030 (44:4030)
; Use the byte at $c988 as a parameter
; for a jumptable.
; If [$c988] in {12, 14, 16},
; clear [$c835].
push de
ld a, [$c988]
cp $c
jr z, .asm_110047
cp $e
jr z, .asm_110047
cp $10
jr z, .asm_110047
cp 2 * 6
jr z, .noreset
cp 2 * 7
jr z, .noreset
cp 2 * 8
jr z, .noreset
xor a
ld [$c835], a
ld a, [$c988]
.asm_110047
.noreset
ld d, $0
ld e, a
ld hl, Jumptable_110070
ld hl, .jumptable
add hl, de
ld a, [hli]
ld [$c988], a
@ -89,19 +104,19 @@ Function110030:: ; 110030 (44:4030)
push hl
ld a, $36
cp l
jr nz, .asm_110066
jr nz, .okay
ld a, $42
cp h
.asm_110066
.okay
call nz, Function1100b4
ld hl, $c986
ld a, [hli]
ld h, [hl]
ld l, a
ret
ret ; indirectly jump to the function loaded from the jumptable, which returns to Function3e60.
; 110070 (44:4070)
Jumptable_110070: ; 110070
.jumptable: ; 110070
dw Function110115
dw Function110236
dw Function110291
@ -140,7 +155,7 @@ Jumptable_110070: ; 110070
Function1100b4: ; 1100b4 (44:40b4)
push bc
.asm_1100b5
.loop
di
ld a, [$c800]
ld b, a
@ -150,19 +165,19 @@ Function1100b4: ; 1100b4 (44:40b4)
ei
or a
bit 0, a
jr z, .asm_1100da
jr z, .done
ld a, b
or a
jr nz, .asm_1100b5
jr nz, .loop
ld a, c
cp $4
jr z, .asm_1100b5
jr z, .loop
xor a
ld [$c80f], a
ld hl, $c821
set 1, [hl]
scf
.asm_1100da
.done
pop bc
ret
; 1100dc (44:40dc)

View File

@ -106,6 +106,7 @@
charmap "♂", $ef
charmap "¥", $f0
charmap "×", $f1
charmap "·", $f2
charmap "/", $f3
charmap ",", $f4
charmap "♀", $f5
@ -306,3 +307,4 @@
charmap "<......>", $56
charmap "<START>", $00
charmap "<DEXEND>", $5f
charmap "<LNBRK>", $22

8042
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ UnknownScript_0x189553:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal LICKITUNG, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -48,7 +48,7 @@ UnknownScript_0x189592:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal ODDISH, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -62,7 +62,7 @@ UnknownScript_0x1895b3:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal STARYU, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -78,7 +78,7 @@ UnknownScript_0x1895d4:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal GROWLITHE, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -92,7 +92,7 @@ UnknownScript_0x1895f9:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal VULPIX, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -106,7 +106,7 @@ UnknownScript_0x18961a:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal PICHU, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0

View File

@ -17,82 +17,82 @@ MapCeladonGameCornerPrizeRoomSignpost0Script:
writetext UnknownText_0x7293e
closetext
checkitem COIN_CASE
iffalse UnknownScript_0x7278a
iffalse CeladonPrizeRoom_NoCoinCase
writetext UnknownText_0x72974
UnknownScript_0x726fd:
special Function24b25
CeladonPrizeRoom_tmcounterloop:
special Special_DisplayCoinCaseBalance
loadmenudata MenuDataHeader_0x72790
interpretmenu2
writebackup
if_equal $1, UnknownScript_0x72714
if_equal $2, UnknownScript_0x72730
if_equal $3, UnknownScript_0x7274c
jump UnknownScript_0x72784
if_equal $1, .doubleteam
if_equal $2, .psychic
if_equal $3, .hyperbeam
jump CeladonPrizeRoom_cancel
UnknownScript_0x72714:
.doubleteam:
checkcoins 1500
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_DOUBLE_TEAM, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
giveitem TM_DOUBLE_TEAM, $1
iffalse UnknownScript_0x7277e
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_DOUBLE_TEAM, 1
iffalse CeladonPrizeRoom_notenoughroom
takecoins 1500
jump UnknownScript_0x7276d
jump CeladonPrizeRoom_purchased
UnknownScript_0x72730:
.psychic:
checkcoins 3500
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_PSYCHIC, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
giveitem TM_PSYCHIC, $1
iffalse UnknownScript_0x7277e
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_PSYCHIC, 1
iffalse CeladonPrizeRoom_notenoughroom
takecoins 3500
jump UnknownScript_0x7276d
jump CeladonPrizeRoom_purchased
UnknownScript_0x7274c:
.hyperbeam:
checkcoins 7500
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
itemtotext TM_HYPER_BEAM, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
giveitem TM_HYPER_BEAM, $1
iffalse UnknownScript_0x7277e
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
giveitem TM_HYPER_BEAM, 1
iffalse CeladonPrizeRoom_notenoughroom
takecoins 7500
jump UnknownScript_0x7276d
jump CeladonPrizeRoom_purchased
UnknownScript_0x72768:
CeladonPrizeRoom_askbuy:
writetext UnknownText_0x72991
yesorno
end
UnknownScript_0x7276d:
CeladonPrizeRoom_purchased:
waitbutton
playsound SFX_TRANSACTION
writetext UnknownText_0x729ad
closetext
jump UnknownScript_0x726fd
jump CeladonPrizeRoom_tmcounterloop
UnknownScript_0x72778:
CeladonPrizeRoom_notenoughcoins:
writetext UnknownText_0x729bb
closetext
loadmovesprites
end
UnknownScript_0x7277e:
CeladonPrizeRoom_notenoughroom:
writetext UnknownText_0x729d8
closetext
loadmovesprites
end
UnknownScript_0x72784:
CeladonPrizeRoom_cancel:
writetext UnknownText_0x729f2
closetext
loadmovesprites
end
UnknownScript_0x7278a:
CeladonPrizeRoom_NoCoinCase:
writetext UnknownText_0x72a14
closetext
loadmovesprites
@ -121,26 +121,26 @@ MapCeladonGameCornerPrizeRoomSignpost1Script:
writetext UnknownText_0x7293e
closetext
checkitem COIN_CASE
iffalse UnknownScript_0x7278a
UnknownScript_0x727d3:
iffalse CeladonPrizeRoom_NoCoinCase
.loop:
writetext UnknownText_0x72974
special Function24b25
special Special_DisplayCoinCaseBalance
loadmenudata MenuDataHeader_0x72877
interpretmenu2
writebackup
if_equal $1, UnknownScript_0x727ed
if_equal $2, UnknownScript_0x7281b
if_equal $3, UnknownScript_0x72849
jump UnknownScript_0x72784
if_equal $1, .pikachu
if_equal $2, .porygon
if_equal $3, .larvitar
jump CeladonPrizeRoom_cancel
UnknownScript_0x727ed:
.pikachu:
checkcoins 2222
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, UnknownScript_0x7277e
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem PIKACHU, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitbutton
playsound SFX_TRANSACTION
writetext UnknownText_0x729ad
@ -149,16 +149,16 @@ UnknownScript_0x727ed:
special Special_GameCornerPrizeMonCheckDex
givepoke PIKACHU, 25
takecoins 2222
jump UnknownScript_0x727d3
jump .loop
UnknownScript_0x7281b:
.porygon:
checkcoins 5555
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, UnknownScript_0x7277e
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem PORYGON, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitbutton
playsound SFX_TRANSACTION
writetext UnknownText_0x729ad
@ -167,16 +167,16 @@ UnknownScript_0x7281b:
special Special_GameCornerPrizeMonCheckDex
givepoke PORYGON, 15
takecoins 5555
jump UnknownScript_0x727d3
jump .loop
UnknownScript_0x72849:
.larvitar:
checkcoins 8888
if_equal $2, UnknownScript_0x72778
if_equal $2, CeladonPrizeRoom_notenoughcoins
checkcode VAR_PARTYCOUNT
if_equal $6, UnknownScript_0x7277e
if_equal $6, CeladonPrizeRoom_notenoughroom
pokenamemem LARVITAR, $0
scall UnknownScript_0x72768
iffalse UnknownScript_0x72784
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_cancel
waitbutton
playsound SFX_TRANSACTION
writetext UnknownText_0x729ad
@ -185,7 +185,7 @@ UnknownScript_0x72849:
special Special_GameCornerPrizeMonCheckDex
givepoke LARVITAR, 40
takecoins 8888
jump UnknownScript_0x727d3
jump .loop
MenuDataHeader_0x72877:

View File

@ -43,7 +43,7 @@ MoveTutor:
writetext UnknownText_0x199042
yesorno
iffalse .Refused
special Function24b25
special Special_DisplayCoinCaseBalance
writetext UnknownText_0x199090
yesorno
iffalse .Refused2
@ -114,7 +114,7 @@ MoveTutor:
takecoins 4000
waitbutton
playsound SFX_TRANSACTION
special Function24b25
special Special_DisplayCoinCaseBalance
writetext UnknownText_0x19918b
closetext
loadmovesprites

View File

@ -49,7 +49,7 @@ ReceptionistScript_0x56c28:
iffalse UnknownScript_0x56cc3
writetext UnknownText_0x56e8b
UnknownScript_0x56c36: ; 056c36
special Function24b25
special Special_DisplayCoinCaseBalance
loadmenudata MenuDataHeader_0x56cc9
interpretmenu2
writebackup
@ -153,7 +153,7 @@ ReceptionistScript_0x56d01:
iffalse UnknownScript_0x56cc3
UnknownScript_0x56d0c:
writetext UnknownText_0x56e8b
special Function24b25
special Special_DisplayCoinCaseBalance
loadmenudata MenuDataHeader_0x56db0
interpretmenu2
writebackup

View File

@ -127,7 +127,7 @@ KurtScript_0x18e178:
writetext UnknownText_0x18e736
keeptextopen
setevent EVENT_DRAGON_SHRINE_QUESTION_2
special Function88018
special Special_SelectApricornForKurt
if_equal $0, .Cancel
if_equal BLU_APRICORN, .Blu
if_equal YLW_APRICORN, .Ylw

View File

@ -30,7 +30,7 @@ GentlemanScript_0x5cd3d:
iffalse .skip
special Special_ResetLuckyNumberShowFlag
.skip:
special Function4d9d3
special Special_PrintTodaysLuckyNumber
checkflag ENGINE_LUCKY_NUMBER_SHOW
iftrue .GameOver
writetext UnknownText_0x5cf3a

View File

@ -65,13 +65,13 @@ UnknownScript_0x7805b:
DaycareMon1Script_0x78065:
loadfont
special Function17421
special Special_DayCareMon1
loadmovesprites
end
DaycareMon2Script_0x7806b:
loadfont
special Function17440
special Special_DayCareMon2
loadmovesprites
end

View File

@ -151,13 +151,13 @@ Function17a770: ; 17a770 (5e:6770)
ret
Function17a781: ; 17a781 (5e:6781)
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Functiona57
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
Function17a78f: ; 17a78f (5e:678f)
@ -261,7 +261,7 @@ Function17a81a: ; 17a81a (5e:681a)
ret
Function17a83c: ; 17a83c (5e:683c)
ld a, [$ffa9]
ld a, [hJoyLast]
and $f0
ld c, a
ld a, [hJoyPressed] ; $ff00+$a7

4435
misc/mobile_22.asm Normal file

File diff suppressed because it is too large Load Diff

1155
misc/mobile_22_2.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2010,7 +2010,7 @@ Function100cb5: ; 100cb5
cp b
jr z, .asm_100d17
ld [wd0d8], a
ld a, [$ffa9]
ld a, [hJoyLast]
ld b, a
bit 1, b
jr nz, .asm_100d17
@ -2497,7 +2497,7 @@ Unknown_100ff3: ; 100ff3
dbwww $80, PlayerName, NAME_LENGTH, NULL
dbwww $80, PlayerName, NAME_LENGTH, NULL
dbwww $80, PlayerID, 2, NULL
dbwww $80, wd84a, 2, NULL
dbwww $80, wSecretID, 2, NULL
dbwww $80, PlayerGender, 1, NULL
dbwww $04, $a603, 8, NULL
dbwww $04, $a007, $30, NULL

View File

@ -7656,13 +7656,13 @@ Function117656: ; 117656
; 11765d
Function11765d: ; 11765d (45:765d)
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Function11766b
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
Function11766b: ; 11766b (45:766b)
@ -7798,7 +7798,7 @@ Function117764: ; 117764 (45:7764)
ld a, [hl]
and $2
jr nz, asm_1177d6
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and $40
jr nz, asm_1177f1
@ -7973,11 +7973,11 @@ Function1178aa: ; 1178aa (45:78aa)
ld hl, MenuDataHeader_1179b5
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
ld hl, MenuDataHeader_1179bd
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
callba Function104061
hlcoord 16, 8
ld de, String_1179c5
@ -8076,7 +8076,7 @@ Function117984: ; 117984 (45:7984)
ld hl, MenuDataHeader_1179b5
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
callba Function104061
hlcoord 1, 14
ld de, String_1179e1
@ -8150,13 +8150,13 @@ INCBIN "data/mobile/ascii-sym.txt"
; Mobile Stadium option from the continue/newgame menu.
; XXX better function names
MobileStudium: ; 0x117a7f
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Function117a8d
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
; 0x117a8d
@ -8236,7 +8236,7 @@ Function117b14:
ld hl, Data117cbc
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
jp Function117cdd
Function117b28:
@ -8248,7 +8248,7 @@ Function117b31:
ld hl, Data117cc4
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
hlcoord 16, 8
ld de, YesNo117ccc
call PlaceString
@ -8386,7 +8386,7 @@ Function117c4a:
ld hl, Data117cbc
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
callba Function104061
ld hl, MobileStadiumSuccessText
call PrintText
@ -9756,7 +9756,7 @@ Function118936:
ld hl, MenuDataHeader_119cf7
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
call Function321c
hlcoord 16, 8, AttrMap
ld a, $40
@ -13211,7 +13211,7 @@ Function11a207: ; 11a207
ld hl, MenuDataHeader_11a2de
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
call Function321c
hlcoord 16, 8
ld de, String_11a2cf
@ -14328,10 +14328,10 @@ Function11ac51: ; 11ac51
push af
xor a
ld [VramState], a
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [$ffde], a
ld [wcd49], a
@ -14358,7 +14358,7 @@ Function11ac51: ; 11ac51
.asm_11aca8
call ClearSprites
pop af
ld [$ffaa], a
ld [hInMenu], a
pop af
ld [VramState], a
pop af
@ -14428,7 +14428,7 @@ Function11ad1b: ; 11ad1b
ld a, [wcfa9]
ld [wcd82], a
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ld a, $10
ld [wc3b7], a
ld hl, Function8e83f
@ -15099,7 +15099,7 @@ Function11b175: ; 11b175
ld d, a
ld a, [wc7d2]
ld e, a
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and $40
jr nz, .asm_11b19a
@ -15780,11 +15780,11 @@ Function11b538: ; 11b538
ld [wcd2b], a
ld [bc], a
inc bc
ld a, [wd84a]
ld a, [wSecretID]
ld [wcd2c], a
ld [bc], a
inc bc
ld a, [wd84b]
ld a, [wSecretID + 1]
ld [wcd2d], a
ld [bc], a
inc bc
@ -16832,13 +16832,13 @@ Function11c156: ; 11c156
; 11c1ab
Function11c1ab: ; 11c1ab
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Function11c1b9
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
; 11c1b9
@ -17154,7 +17154,7 @@ Function11c3ed: ; 11c3ed (47:43ed)
ld a, [de]
and $1
jr nz, .asm_11c42c
ld de, $ffa9
ld de, hJoyLast
ld a, [de]
and $40
jr nz, .asm_11c47c
@ -17326,7 +17326,7 @@ Function11c53d: ; 11c53d (47:453d)
and A_BUTTON
jr nz, .a
ld de, $ffa9
ld de, hJoyLast
ld a, [de]
and D_UP
@ -17570,7 +17570,7 @@ Function11c675: ; 11c675 (47:4675)
ret
.select
ld de, $ffa9
ld de, hJoyLast
ld a, [de]
and D_UP
jr nz, .asm_11c708
@ -18644,7 +18644,7 @@ Function11ce2b: ; 11ce2b (47:4e2b)
and B_BUTTON
jr nz, .b
ld de, $ffa9
ld de, hJoyLast
ld a, [de]
and D_UP
jr nz, .up
@ -22362,7 +22362,7 @@ Function16d70c: ; 16d70c
Function16d713: ; 16d713
push bc
push af
ld a, [$ffa9]
ld a, [hJoyLast]
and $f0
ld b, a
ld a, [hJoyPressed]
@ -22701,9 +22701,9 @@ Function170139: ; 170139
ld [hli], a
ld a, [PlayerID + 1]
ld [hli], a
ld a, [wd84a]
ld a, [wSecretID]
ld [hli], a
ld a, [wd84b]
ld a, [wSecretID + 1]
ld [hli], a
ld e, l
ld d, h
@ -24504,13 +24504,13 @@ GFX_171848:
INCBIN "gfx/unknown/171848.2bpp"
Function1719c8: ; 1719c8 (5c:59c8)
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
call Function1719d6
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
Function1719d6: ; 1719d6 (5c:59d6)
@ -24801,7 +24801,7 @@ Function171beb: ; 171beb (5c:5beb)
ld hl, MenuDataHeader_171c6b
call LoadMenuDataHeader
call Function1cbb
call Function1cfd
call GetMemTileCoord
callba Function104061
hlcoord 1, 14
ld de, String_171c73

View File

@ -547,7 +547,7 @@ Function10ed51: ; 10ed51
call _TitleScreen
.loop
call Functiona57
ld a, [$ffa9]
ld a, [hJoyLast]
ld b, a
and 1
jr nz, .done

View File

@ -145,8 +145,10 @@ VBGMap1::
SECTION "Stack", WRAM0
wc000::
StackBottom::
ds $ff
Stack::
StackTop::
ds 1
@ -1224,8 +1226,11 @@ wcf76:: ds 1
wcf77:: ds 1
wcf78:: ds 9
wcf81:: ds 1
; dw related to tilemap
wcf82:: ds 1
wcf83:: ds 1
wcf84:: ds 1
wcf85:: ds 1
wcf86:: ds 1
@ -1342,38 +1347,46 @@ OptionsEnd::
wcfd4:: ds 1
wcfd5:: ds 1
wcfd6:: ds 1
wcfd7:: ds 1
wcfd7:: ds 1 ; related to time
ds 40
SECTION "WRAM 1", WRAMX, BANK [1]
MiscBuffer0::
wd000:: ds 1
MiscBuffer1::
wd001:: ds 1
wd002::
MiscBuffer2::
PhoneScriptBank::
DefaultFlypoint:: ; d002
LuckyNumberDigit1Buffer::
ds 1
wd003::
MiscBuffer3::
LuckyNumberDigit2Buffer::
PhoneCallerLo::
ds 1
wd004::
MiscBuffer4::
LuckyNumberDigit3Buffer::
PhoneCallerHi::
ds 1
wd005::
MiscBuffer5::
LuckyNumberDigit4Buffer::
StartFlypoint:: ; d005
ds 1
wd006::
MiscBuffer6::
LuckyNumberDigit5Buffer::
EndFlypoint:: ; d006
ds 1
wd007::
MiscBuffer7::
MovementBuffer:: ; d007
ds 1
@ -1447,6 +1460,7 @@ wd048:: ds 1
wLossTextPointer:: ds 2
wd04b:: ds 2
wd04d:: ds 1
MenuItemsListEnd::
wd04e:: ds 2
wd050:: ds 10
wd05a:: ds 12
@ -1521,6 +1535,7 @@ wd105:: ds 1
CurItem:: ; d106
ds 1
ItemCountBuffer:: ; d107
wd107:: ds 1
CurPartySpecies:: ; d108
@ -1716,7 +1731,6 @@ EvolvableFlags:: ; d1e8
flag_array PARTY_LENGTH
wd1e9:: ds 1
wd1ea::
MagikarpLength::
Buffer1:: ; d1ea
ds 1
@ -1967,7 +1981,7 @@ RivalName:: ds NAME_LENGTH ; d493
RedsName:: ds NAME_LENGTH ; d49e
GreensName:: ds NAME_LENGTH ; d4a9
wd4b4:: ds 1
wSavedAtLeastOnce:: ds 1
wSpawnAfterChampion:: ds 1
; init time set at newgame
@ -2106,7 +2120,7 @@ CurTimeOfDay:: ; d848
ds 1
wd84a:: ds 1
wSecretID:: ds 1
wd84b:: ds 1
StatusFlags:: ; d84c
ds 1
@ -2402,8 +2416,8 @@ wSpecialPhoneCallID:: ds 2
wdc33:: ds 2
wdc35:: ds 4
wdc39:: ds 1
wdc3a:: ds 1
wdc3b:: ds 5
wdc3a:: ds 1 ; related to time
wdc3b:: ds 5 ; related to time
wdc40:: ds 1
wdc41:: ds 1
wdc42:: ds 8
@ -2562,7 +2576,7 @@ wContestMon:: party_struct wContestMon ; df9c
wdfcc:: ds 1
wdfcd:: ds 1
wdfce:: ds 1
wFishingSwarmFlag:: ds 1
roam_struct: MACRO
\1Species:: db
@ -2728,7 +2742,8 @@ w5_d422:: ds $40
SECTION "WRAM 6", WRAMX, BANK [6]
w6_d000:: ds $600
w6_d000:: ds $400
w6_d400:: ds $200
w6_d600:: ds $600
INCLUDE "sram.asm"