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

Some files were not shown because too many files have changed in this diff Show More