You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Special script annotation, trainer constant enumeration, person-event structure update
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -739,3 +739,14 @@ OBJECT_STRUCT_3_DATA_HEIGHT EQU 37
|
|||||||
const EMOTE_ROD_UP ; 9
|
const EMOTE_ROD_UP ; 9
|
||||||
const EMOTE_ROD_LEFT ; a
|
const EMOTE_ROD_LEFT ; a
|
||||||
const EMOTE_ROD_RIGHT ; b
|
const EMOTE_ROD_RIGHT ; b
|
||||||
|
|
||||||
|
const_def
|
||||||
|
const SIGNPOST_READ
|
||||||
|
const SIGNPOST_UP
|
||||||
|
const SIGNPOST_DOWN
|
||||||
|
const SIGNPOST_RIGHT
|
||||||
|
const SIGNPOST_LEFT
|
||||||
|
const SIGNPOST_IFSET
|
||||||
|
const SIGNPOST_IFNOTSET
|
||||||
|
const SIGNPOST_ITEMIFSET
|
||||||
|
const SIGNPOST_COPY
|
||||||
|
@ -12,6 +12,7 @@ PLAYER_NAME_LENGTH EQU 8
|
|||||||
PKMN_NAME_LENGTH EQU 11
|
PKMN_NAME_LENGTH EQU 11
|
||||||
MOVE_NAME_LENGTH EQU 13
|
MOVE_NAME_LENGTH EQU 13
|
||||||
ITEM_NAME_LENGTH EQU 13
|
ITEM_NAME_LENGTH EQU 13
|
||||||
|
TRAINER_CLASS_NAME_LENGTH EQU 13
|
||||||
NAME_LENGTH EQU 11
|
NAME_LENGTH EQU 11
|
||||||
LV_CHAR EQU $6e
|
LV_CHAR EQU $6e
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
; pokemon
|
||||||
const_value set 1
|
const_value set 1
|
||||||
const BULBASAUR
|
const BULBASAUR
|
||||||
const IVYSAUR
|
const IVYSAUR
|
||||||
@ -257,3 +258,58 @@ const_value SET const_value + -1
|
|||||||
NUM_POKEMON EQU const_value
|
NUM_POKEMON EQU const_value
|
||||||
|
|
||||||
EGG EQU 253
|
EGG EQU 253
|
||||||
|
|
||||||
|
; pokemon structure in RAM
|
||||||
|
const_def
|
||||||
|
|
||||||
|
const MON_SPECIES
|
||||||
|
const MON_ITEM
|
||||||
|
const MON_MOVE1
|
||||||
|
const MON_MOVE2
|
||||||
|
const MON_MOVE3
|
||||||
|
const MON_MOVE4
|
||||||
|
const MON_ID
|
||||||
|
const MON_07
|
||||||
|
const MON_EXP
|
||||||
|
const MON_09
|
||||||
|
const MON_0A
|
||||||
|
const MON_HP_EXP
|
||||||
|
const MON_0C
|
||||||
|
const MON_ATK_EXP
|
||||||
|
const MON_0E
|
||||||
|
const MON_DEF_EXP
|
||||||
|
const MON_10
|
||||||
|
const MON_SPD_EXP
|
||||||
|
const MON_12
|
||||||
|
const MON_SPC_EXP
|
||||||
|
const MON_14
|
||||||
|
const MON_DVS
|
||||||
|
const MON_16
|
||||||
|
const MON_PP1
|
||||||
|
const MON_PP2
|
||||||
|
const MON_PP3
|
||||||
|
const MON_PP4
|
||||||
|
const MON_HAPPINESS
|
||||||
|
const MON_PKRUS
|
||||||
|
const MON_CAUGHTTIME
|
||||||
|
const MON_CAUGHTGENDER
|
||||||
|
const MON_LEVEL
|
||||||
|
BOXMON_STRUCT_LENGTH EQU const_value
|
||||||
|
|
||||||
|
const MON_STATUS
|
||||||
|
const MON_21
|
||||||
|
const MON_HP
|
||||||
|
const MON_23
|
||||||
|
const MON_MAXHP
|
||||||
|
const MON_25
|
||||||
|
const MON_ATK
|
||||||
|
const MON_27
|
||||||
|
const MON_DEF
|
||||||
|
const MON_29
|
||||||
|
const MON_SPD
|
||||||
|
const MON_2B
|
||||||
|
const MON_SAT
|
||||||
|
const MON_2D
|
||||||
|
const MON_SDF
|
||||||
|
const MON_2F
|
||||||
|
PARTYMON_STRUCT_LENGTH EQU const_value
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -71,5 +71,3 @@ PLAYER_SURF_PIKA EQU 8
|
|||||||
|
|
||||||
OBJECT_STRUCT_LENGTH EQU 40
|
OBJECT_STRUCT_LENGTH EQU 40
|
||||||
NUM_OBJECT_STRUCTS EQU 13
|
NUM_OBJECT_STRUCTS EQU 13
|
||||||
|
|
||||||
PARTYMON_STRUCT_LENGTH EQU 48
|
|
||||||
|
@ -358,7 +358,7 @@ CheckTileEvent: ; 96874
|
|||||||
call CheckBit2_ScriptFlags3
|
call CheckBit2_ScriptFlags3
|
||||||
jr z, .bit2
|
jr z, .bit2
|
||||||
|
|
||||||
callba Function104820
|
callba CheckMovingOffEdgeOfMap
|
||||||
jr c, .return4
|
jr c, .return4
|
||||||
|
|
||||||
call Function2238
|
call Function2238
|
||||||
@ -368,7 +368,7 @@ CheckTileEvent: ; 96874
|
|||||||
call CheckBit1_ScriptFlags3
|
call CheckBit1_ScriptFlags3
|
||||||
jr z, .bit1
|
jr z, .bit1
|
||||||
|
|
||||||
call Function2ad4
|
call CheckCurrentMapXYTriggers
|
||||||
jr c, .movement
|
jr c, .movement
|
||||||
|
|
||||||
.bit1
|
.bit1
|
||||||
@ -398,12 +398,12 @@ CheckTileEvent: ; 96874
|
|||||||
.return6
|
.return6
|
||||||
ld a, [StandingTile]
|
ld a, [StandingTile]
|
||||||
call CheckPitTile
|
call CheckPitTile
|
||||||
jr nz, .asm_968b6
|
jr nz, .pittile
|
||||||
ld a, 6
|
ld a, 6
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_968b6
|
.pittile
|
||||||
ld a, 5
|
ld a, 5
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@ -528,8 +528,8 @@ Function9693a: ; 9693a
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.elevator
|
.elevator
|
||||||
ld a, BANK(UnknownScript_0x135f8)
|
ld a, BANK(BugCatchingContestOverScript)
|
||||||
ld hl, UnknownScript_0x135f8
|
ld hl, BugCatchingContestOverScript
|
||||||
call CallScript
|
call CallScript
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@ -764,8 +764,8 @@ TryReadSign: ; 96a38
|
|||||||
ld de, EngineBuffer1
|
ld de, EngineBuffer1
|
||||||
ld bc, 3
|
ld bc, 3
|
||||||
call FarCopyBytes
|
call FarCopyBytes
|
||||||
ld a, BANK(UnknownScript_0x13625)
|
ld a, BANK(SignpostItemScript)
|
||||||
ld hl, UnknownScript_0x13625
|
ld hl, SignpostItemScript
|
||||||
call CallScript
|
call CallScript
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@ -817,7 +817,7 @@ CheckSignFlag: ; 96ad8
|
|||||||
call GetFarHalfword
|
call GetFarHalfword
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
ld b, $2
|
ld b, $2 ; check
|
||||||
call EventFlagAction
|
call EventFlagAction
|
||||||
ld a, c
|
ld a, c
|
||||||
and a
|
and a
|
||||||
@ -1024,8 +1024,8 @@ Function96bd7: ; 96bd7
|
|||||||
dec a
|
dec a
|
||||||
ld [wdca1], a
|
ld [wdca1], a
|
||||||
ret nz
|
ret nz
|
||||||
ld a, BANK(UnknownScript_0x13619)
|
ld a, BANK(RepelWoreOffScript)
|
||||||
ld hl, UnknownScript_0x13619
|
ld hl, RepelWoreOffScript
|
||||||
call CallScript
|
call CallScript
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
; More overworld event handling.
|
; More overworld event handling.
|
||||||
|
|
||||||
|
|
||||||
Function97c28:: ; 97c28
|
WarpToLastSpawn:: ; 97c28
|
||||||
ld hl, StatusFlags2
|
ld hl, StatusFlags2
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
res 2, [hl]
|
res 2, [hl]
|
||||||
@ -48,46 +48,46 @@ Function97c5f:: ; 97c5f
|
|||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
ld [EngineBuffer1], a
|
ld [EngineBuffer1], a
|
||||||
ld c, a
|
ld c, a
|
||||||
callba Function1365b
|
callba CheckFacingTileForStd
|
||||||
jr c, .asm_97cb9
|
jr c, .done
|
||||||
|
|
||||||
call CheckCutTreeTile
|
call CheckCutTreeTile
|
||||||
jr nz, .whirlpool
|
jr nz, .whirlpool
|
||||||
callba TryCutOW
|
callba TryCutOW
|
||||||
jr .asm_97cb9
|
jr .done
|
||||||
|
|
||||||
.whirlpool
|
.whirlpool
|
||||||
ld a, [EngineBuffer1]
|
ld a, [EngineBuffer1]
|
||||||
call CheckWhirlpoolTile
|
call CheckWhirlpoolTile
|
||||||
jr nz, .waterfall
|
jr nz, .waterfall
|
||||||
callba TryWhirlpoolOW
|
callba TryWhirlpoolOW
|
||||||
jr .asm_97cb9
|
jr .done
|
||||||
|
|
||||||
.waterfall
|
.waterfall
|
||||||
ld a, [EngineBuffer1]
|
ld a, [EngineBuffer1]
|
||||||
call CheckWaterfallTile
|
call CheckWaterfallTile
|
||||||
jr nz, .headbutt
|
jr nz, .headbutt
|
||||||
callba TryWaterfallOW
|
callba TryWaterfallOW
|
||||||
jr .asm_97cb9
|
jr .done
|
||||||
|
|
||||||
.headbutt
|
.headbutt
|
||||||
ld a, [EngineBuffer1]
|
ld a, [EngineBuffer1]
|
||||||
call CheckHeadbuttTreeTile
|
call CheckHeadbuttTreeTile
|
||||||
jr nz, .surf
|
jr nz, .surf
|
||||||
callba TryHeadbuttOW
|
callba TryHeadbuttOW
|
||||||
jr c, .asm_97cb9
|
jr c, .done
|
||||||
jr .asm_97cb7
|
jr .noevent
|
||||||
|
|
||||||
.surf
|
.surf
|
||||||
callba TrySurfOW
|
callba TrySurfOW
|
||||||
jr nc, .asm_97cb7
|
jr nc, .noevent
|
||||||
jr .asm_97cb9
|
jr .done
|
||||||
|
|
||||||
.asm_97cb7
|
.noevent
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_97cb9
|
.done
|
||||||
call PlayClickSFX
|
call PlayClickSFX
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
scf
|
scf
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
Special:: ; c01b
|
Special:: ; c01b
|
||||||
; Run script special de.
|
; Run script special de.
|
||||||
ld hl, SpecialsPointers
|
ld hl, SpecialsPointers
|
||||||
add hl, de
|
add_n_times hl, de, 3
|
||||||
add hl, de
|
|
||||||
add hl, de
|
|
||||||
ld b, [hl]
|
ld b, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
@ -16,32 +14,36 @@ Special:: ; c01b
|
|||||||
; c029
|
; c029
|
||||||
|
|
||||||
SpecialsPointers:: ; c029
|
SpecialsPointers:: ; c029
|
||||||
add_special Function97c28
|
add_special WarpToLastSpawn
|
||||||
add_special Function29ce8
|
|
||||||
add_special Function29d11
|
; Communications
|
||||||
add_special Function29d92
|
add_special Special_SetBitsForLinkTradeRequest
|
||||||
add_special Function29e66
|
add_special Special_WaitForLinkedFriend
|
||||||
add_special Function29e82
|
add_special Special_CheckLinkTimeout
|
||||||
add_special Function29efa
|
add_special Special_TryQuickSave
|
||||||
add_special Function29eee
|
add_special Special_CheckBothSelectedSameRoom
|
||||||
add_special Function29c92
|
add_special Special_FailedLinkToPast
|
||||||
add_special Function29cf1
|
add_special Special_CloseLink
|
||||||
add_special Function29cfa
|
add_special Special_AbortLink
|
||||||
add_special Function29bfb
|
add_special Special_SetBitsForBattleRequest
|
||||||
add_special Function29c7b
|
add_special Special_SetBitsForTimeCapsuleRequest
|
||||||
add_special Function29ec4
|
add_special Special_CheckTimeCapsuleCompatibility
|
||||||
add_special Function29ed9
|
add_special Special_EnterTimeCapsule
|
||||||
add_special Function29eaf
|
add_special Special_TradeCenter
|
||||||
add_special Function29f47
|
add_special Special_Colosseum
|
||||||
add_special Functionc2f6
|
add_special Special_TimeCapsule
|
||||||
add_special Functionc309
|
add_special Special_CableClubCheckWhichChris
|
||||||
add_special Function1050b9
|
add_special Special_CheckMysteryGift
|
||||||
|
add_special Special_GetMysteryGiftItem
|
||||||
|
add_special Special_UnlockMysteryGift
|
||||||
|
|
||||||
|
; Bug Catching Contest
|
||||||
add_special BugContestJudging
|
add_special BugContestJudging
|
||||||
add_special CheckPartyFullAfterContest
|
add_special CheckPartyFullAfterContest
|
||||||
add_special Function13a12
|
add_special CheckFirstMonFainted
|
||||||
add_special ContestReturnMons
|
add_special ContestReturnMons
|
||||||
add_special Function135db
|
add_special Special_GiveParkBalls
|
||||||
add_special Functionfbb32
|
add_special Special_CheckMagikarpLength
|
||||||
add_special Functionfbcd2
|
add_special Functionfbcd2
|
||||||
add_special HealParty
|
add_special HealParty
|
||||||
add_special Function1559a
|
add_special Function1559a
|
||||||
@ -87,7 +89,7 @@ SpecialsPointers:: ; c029
|
|||||||
add_special Functionc3ef
|
add_special Functionc3ef
|
||||||
add_special Function17421
|
add_special Function17421
|
||||||
add_special Function17440
|
add_special Function17440
|
||||||
add_special Function139a8
|
add_special Special_SelectRandomBugContestContestants
|
||||||
add_special Functionc3fc
|
add_special Functionc3fc
|
||||||
add_special Function26feb
|
add_special Function26feb
|
||||||
add_special Function27043
|
add_special Function27043
|
||||||
@ -170,7 +172,7 @@ SpecialsPointers:: ; c029
|
|||||||
add_special SpecialMonCheck
|
add_special SpecialMonCheck
|
||||||
add_special Functionc225
|
add_special Functionc225
|
||||||
add_special Function170bd2
|
add_special Function170bd2
|
||||||
add_special Function10366e
|
add_special Mobile_SelectThreeMons
|
||||||
add_special Function1037eb
|
add_special Function1037eb
|
||||||
add_special Function10383c
|
add_special Function10383c
|
||||||
add_special Mobile_HealParty
|
add_special Mobile_HealParty
|
||||||
@ -309,21 +311,21 @@ Functionc2e7: ; c2e7
|
|||||||
ret
|
ret
|
||||||
; c2f6
|
; c2f6
|
||||||
|
|
||||||
Functionc2f6: ; c2f6
|
Special_CheckMysteryGift: ; c2f6
|
||||||
ld a, $0
|
ld a, $0
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld a, [$abe2]
|
ld a, [$abe2]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_c302
|
jr z, .no
|
||||||
inc a
|
inc a
|
||||||
|
|
||||||
.asm_c302
|
.no
|
||||||
ld [ScriptVar], a
|
ld [ScriptVar], a
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
ret
|
ret
|
||||||
; c309
|
; c309
|
||||||
|
|
||||||
Functionc309: ; c309
|
Special_GetMysteryGiftItem: ; c309
|
||||||
ld a, $0
|
ld a, $0
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld a, [$abe2]
|
ld a, [$abe2]
|
||||||
|
@ -357,33 +357,33 @@ BugContestResults_CleanUp
|
|||||||
loadmovesprites
|
loadmovesprites
|
||||||
dotrigger $0
|
dotrigger $0
|
||||||
domaptrigger GROUP_ROUTE_35_NATIONAL_PARK_GATE, MAP_ROUTE_35_NATIONAL_PARK_GATE, $0
|
domaptrigger GROUP_ROUTE_35_NATIONAL_PARK_GATE, MAP_ROUTE_35_NATIONAL_PARK_GATE, $0
|
||||||
setevent EVENT_716
|
setevent EVENT_BUG_CATCHING_CONTESTANT_1A
|
||||||
setevent EVENT_717
|
setevent EVENT_BUG_CATCHING_CONTESTANT_2A
|
||||||
setevent EVENT_718
|
setevent EVENT_BUG_CATCHING_CONTESTANT_3A
|
||||||
setevent EVENT_719
|
setevent EVENT_BUG_CATCHING_CONTESTANT_4A
|
||||||
setevent EVENT_71A
|
setevent EVENT_BUG_CATCHING_CONTESTANT_5A
|
||||||
setevent EVENT_71B
|
setevent EVENT_BUG_CATCHING_CONTESTANT_6A
|
||||||
setevent EVENT_71C
|
setevent EVENT_BUG_CATCHING_CONTESTANT_7A
|
||||||
setevent EVENT_71D
|
setevent EVENT_BUG_CATCHING_CONTESTANT_8A
|
||||||
setevent EVENT_71E
|
setevent EVENT_BUG_CATCHING_CONTESTANT_9A
|
||||||
setevent EVENT_71F
|
setevent EVENT_BUG_CATCHING_CONTESTANT_10A
|
||||||
setevent EVENT_720
|
setevent EVENT_BUG_CATCHING_CONTESTANT_1B
|
||||||
setevent EVENT_721
|
setevent EVENT_BUG_CATCHING_CONTESTANT_2B
|
||||||
setevent EVENT_722
|
setevent EVENT_BUG_CATCHING_CONTESTANT_3B
|
||||||
setevent EVENT_723
|
setevent EVENT_BUG_CATCHING_CONTESTANT_4B
|
||||||
setevent EVENT_724
|
setevent EVENT_BUG_CATCHING_CONTESTANT_5B
|
||||||
setevent EVENT_725
|
setevent EVENT_BUG_CATCHING_CONTESTANT_6B
|
||||||
setevent EVENT_726
|
setevent EVENT_BUG_CATCHING_CONTESTANT_7B
|
||||||
setevent EVENT_727
|
setevent EVENT_BUG_CATCHING_CONTESTANT_8B
|
||||||
setevent EVENT_728
|
setevent EVENT_BUG_CATCHING_CONTESTANT_9B
|
||||||
setevent EVENT_729
|
setevent EVENT_BUG_CATCHING_CONTESTANT_10B
|
||||||
setflag ENGINE_DAILY_BUG_CONTEST
|
setflag ENGINE_DAILY_BUG_CONTEST
|
||||||
special PlayMapMusic
|
special PlayMapMusic
|
||||||
end
|
end
|
||||||
; 0xbc31e
|
; 0xbc31e
|
||||||
|
|
||||||
BugContestResults_FirstPlace ; 0xbc31e
|
BugContestResults_FirstPlace ; 0xbc31e
|
||||||
setevent EVENT_000
|
setevent EVENT_CHRIS1_IN_CABLE_CLUB
|
||||||
itemtotext SUN_STONE, $1
|
itemtotext SUN_STONE, $1
|
||||||
farwritetext ContestResults_PlayerWonAPrizeText
|
farwritetext ContestResults_PlayerWonAPrizeText
|
||||||
closetext
|
closetext
|
||||||
@ -439,45 +439,45 @@ BugContestResults_NoRoomForBerry ; 0xbc375
|
|||||||
; 0xbc380
|
; 0xbc380
|
||||||
|
|
||||||
BugContestResults_EnsureNoDuplicateSprites ; 0xbc380
|
BugContestResults_EnsureNoDuplicateSprites ; 0xbc380
|
||||||
checkevent EVENT_716
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_1A
|
||||||
iftrue .skip1
|
iftrue .skip1
|
||||||
clearevent EVENT_720
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_1B
|
||||||
.skip1
|
.skip1
|
||||||
checkevent EVENT_717
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_2A
|
||||||
iftrue .skip2
|
iftrue .skip2
|
||||||
clearevent EVENT_721
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_2B
|
||||||
.skip2
|
.skip2
|
||||||
checkevent EVENT_718
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_3A
|
||||||
iftrue .skip3
|
iftrue .skip3
|
||||||
clearevent EVENT_722
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_3B
|
||||||
.skip3
|
.skip3
|
||||||
checkevent EVENT_719
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_4A
|
||||||
iftrue .skip4
|
iftrue .skip4
|
||||||
clearevent EVENT_723
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_4B
|
||||||
.skip4
|
.skip4
|
||||||
checkevent EVENT_71A
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_5A
|
||||||
iftrue .skip5
|
iftrue .skip5
|
||||||
clearevent EVENT_724
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_5B
|
||||||
.skip5
|
.skip5
|
||||||
checkevent EVENT_71B
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_6A
|
||||||
iftrue .skip6
|
iftrue .skip6
|
||||||
clearevent EVENT_725
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_6B
|
||||||
.skip6
|
.skip6
|
||||||
checkevent EVENT_71C
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_7A
|
||||||
iftrue .skip7
|
iftrue .skip7
|
||||||
clearevent EVENT_726
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_7B
|
||||||
.skip7
|
.skip7
|
||||||
checkevent EVENT_71D
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_8A
|
||||||
iftrue .skip8
|
iftrue .skip8
|
||||||
clearevent EVENT_727
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_8B
|
||||||
.skip8
|
.skip8
|
||||||
checkevent EVENT_71E
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_9A
|
||||||
iftrue .skip9
|
iftrue .skip9
|
||||||
clearevent EVENT_728
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_9B
|
||||||
.skip9
|
.skip9
|
||||||
checkevent EVENT_71F
|
checkevent EVENT_BUG_CATCHING_CONTESTANT_10A
|
||||||
iftrue .skip10
|
iftrue .skip10
|
||||||
clearevent EVENT_729
|
clearevent EVENT_BUG_CATCHING_CONTESTANT_10B
|
||||||
.skip10
|
.skip10
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ InitializeEventsScript:
|
|||||||
setevent EVENT_6FD
|
setevent EVENT_6FD
|
||||||
setevent EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE
|
setevent EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE
|
||||||
setevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER
|
setevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER
|
||||||
setevent EVENT_702
|
setevent EVENT_COP_IN_ELMS_LAB
|
||||||
setevent EVENT_703
|
setevent EVENT_703
|
||||||
setevent EVENT_704
|
setevent EVENT_704
|
||||||
setevent EVENT_BOULDER_IN_ICE_PATH_1
|
setevent EVENT_BOULDER_IN_ICE_PATH_1
|
||||||
@ -511,26 +511,26 @@ InitializeEventsScript:
|
|||||||
setevent EVENT_BOULDER_IN_ICE_PATH_3
|
setevent EVENT_BOULDER_IN_ICE_PATH_3
|
||||||
setevent EVENT_BOULDER_IN_ICE_PATH_4
|
setevent EVENT_BOULDER_IN_ICE_PATH_4
|
||||||
setevent EVENT_715
|
setevent EVENT_715
|
||||||
setevent EVENT_716
|
setevent EVENT_BUG_CATCHING_CONTESTANT_1A
|
||||||
setevent EVENT_717
|
setevent EVENT_BUG_CATCHING_CONTESTANT_2A
|
||||||
setevent EVENT_718
|
setevent EVENT_BUG_CATCHING_CONTESTANT_3A
|
||||||
setevent EVENT_719
|
setevent EVENT_BUG_CATCHING_CONTESTANT_4A
|
||||||
setevent EVENT_71A
|
setevent EVENT_BUG_CATCHING_CONTESTANT_5A
|
||||||
setevent EVENT_71B
|
setevent EVENT_BUG_CATCHING_CONTESTANT_6A
|
||||||
setevent EVENT_71C
|
setevent EVENT_BUG_CATCHING_CONTESTANT_7A
|
||||||
setevent EVENT_71D
|
setevent EVENT_BUG_CATCHING_CONTESTANT_8A
|
||||||
setevent EVENT_71E
|
setevent EVENT_BUG_CATCHING_CONTESTANT_9A
|
||||||
setevent EVENT_71F
|
setevent EVENT_BUG_CATCHING_CONTESTANT_10A
|
||||||
setevent EVENT_720
|
setevent EVENT_BUG_CATCHING_CONTESTANT_1B
|
||||||
setevent EVENT_721
|
setevent EVENT_BUG_CATCHING_CONTESTANT_2B
|
||||||
setevent EVENT_722
|
setevent EVENT_BUG_CATCHING_CONTESTANT_3B
|
||||||
setevent EVENT_723
|
setevent EVENT_BUG_CATCHING_CONTESTANT_4B
|
||||||
setevent EVENT_724
|
setevent EVENT_BUG_CATCHING_CONTESTANT_5B
|
||||||
setevent EVENT_725
|
setevent EVENT_BUG_CATCHING_CONTESTANT_6B
|
||||||
setevent EVENT_726
|
setevent EVENT_BUG_CATCHING_CONTESTANT_7B
|
||||||
setevent EVENT_727
|
setevent EVENT_BUG_CATCHING_CONTESTANT_8B
|
||||||
setevent EVENT_728
|
setevent EVENT_BUG_CATCHING_CONTESTANT_9B
|
||||||
setevent EVENT_729
|
setevent EVENT_BUG_CATCHING_CONTESTANT_10B
|
||||||
setevent EVENT_72C
|
setevent EVENT_72C
|
||||||
setevent EVENT_72F
|
setevent EVENT_72F
|
||||||
setevent EVENT_72D
|
setevent EVENT_72D
|
||||||
@ -549,7 +549,7 @@ InitializeEventsScript:
|
|||||||
setevent EVENT_74D
|
setevent EVENT_74D
|
||||||
setevent EVENT_MET_BILL
|
setevent EVENT_MET_BILL
|
||||||
setevent EVENT_713
|
setevent EVENT_713
|
||||||
setevent EVENT_711
|
setevent EVENT_MYSTERY_GIFT_DELIVERY_GUY
|
||||||
setevent EVENT_6D4
|
setevent EVENT_6D4
|
||||||
setevent EVENT_WAREHOUSE_LAYOUT_1
|
setevent EVENT_WAREHOUSE_LAYOUT_1
|
||||||
setevent EVENT_WAREHOUSE_BLOCKED_OFF
|
setevent EVENT_WAREHOUSE_BLOCKED_OFF
|
||||||
|
13
home.asm
13
home.asm
@ -499,13 +499,14 @@ Function31cf:: ; 31cf
|
|||||||
StringCmp:: ; 31db
|
StringCmp:: ; 31db
|
||||||
; Compare c bytes at de and hl.
|
; Compare c bytes at de and hl.
|
||||||
; Return z if they all match.
|
; Return z if they all match.
|
||||||
|
.loop
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp [hl]
|
cp [hl]
|
||||||
ret nz
|
ret nz
|
||||||
inc de
|
inc de
|
||||||
inc hl
|
inc hl
|
||||||
dec c
|
dec c
|
||||||
jr nz, StringCmp
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
; 0x31e4
|
; 0x31e4
|
||||||
|
|
||||||
@ -866,9 +867,7 @@ GetName:: ; 33c3
|
|||||||
ld e, a
|
ld e, a
|
||||||
ld d, 0
|
ld d, 0
|
||||||
ld hl, NamesPointers
|
ld hl, NamesPointers
|
||||||
add hl, de
|
add_n_times hl, de, 3
|
||||||
add hl, de
|
|
||||||
add hl, de
|
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
@ -880,7 +879,7 @@ GetName:: ; 33c3
|
|||||||
call GetNthString
|
call GetNthString
|
||||||
|
|
||||||
ld de, StringBuffer1
|
ld de, StringBuffer1
|
||||||
ld bc, $000d
|
ld bc, ITEM_NAME_LENGTH
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
|
|
||||||
.done
|
.done
|
||||||
@ -1209,7 +1208,7 @@ Function3567:: ; 3567
|
|||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
|
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function3574
|
call Function3574
|
||||||
|
|
||||||
pop bc
|
pop bc
|
||||||
@ -1355,7 +1354,7 @@ CheckTrainerBattle2:: ; 3600
|
|||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
|
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call CheckTrainerBattle
|
call CheckTrainerBattle
|
||||||
|
|
||||||
pop bc
|
pop bc
|
||||||
|
210
home/map.asm
210
home/map.asm
@ -9,40 +9,48 @@ Function210f:: ; 210f
|
|||||||
; 211b
|
; 211b
|
||||||
|
|
||||||
CheckTriggers:: ; 211b
|
CheckTriggers:: ; 211b
|
||||||
|
; Checks wCurrentMapTriggerPointer. If it's empty, returns -1 in a. Otherwise, returns the active trigger ID in a.
|
||||||
push hl
|
push hl
|
||||||
ld hl, BikeFlags + 2
|
ld hl, wCurrentMapTriggerPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
or h
|
or h
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
jr nz, .asm_2128
|
jr nz, .triggerexists
|
||||||
ld a, -1
|
ld a, -1
|
||||||
|
|
||||||
.asm_2128
|
.triggerexists
|
||||||
pop hl
|
pop hl
|
||||||
ret
|
ret
|
||||||
; 212a
|
; 212a
|
||||||
|
|
||||||
GetCurrentMapTrigger:: ; 212a
|
GetCurrentMapTrigger:: ; 212a
|
||||||
|
; Grabs the wram map trigger pointer for the current map and loads it into wCurrentMapTriggerPointer.
|
||||||
|
; If there are no triggers, both bytes of wCurrentMapTriggerPointer are wiped clean.
|
||||||
|
; Copy the current map group and number into bc. This is needed for GetMapTrigger.
|
||||||
ld a, [MapGroup]
|
ld a, [MapGroup]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [MapNumber]
|
ld a, [MapNumber]
|
||||||
ld c, a
|
ld c, a
|
||||||
|
; Blank out wCurrentMapTriggerPointer; this is the default scenario.
|
||||||
xor a
|
xor a
|
||||||
ld [BikeFlags + 2], a
|
ld [wCurrentMapTriggerPointer], a
|
||||||
ld [BikeFlags + 3], a
|
ld [wCurrentMapTriggerPointer + 1], a
|
||||||
call GetMapTrigger
|
call GetMapTrigger
|
||||||
ret c
|
ret c ; The map is not in the trigger table
|
||||||
|
; Load the trigger table pointer from de into wCurrentMapTriggerPointer
|
||||||
ld a, e
|
ld a, e
|
||||||
ld [BikeFlags + 2], a
|
ld [wCurrentMapTriggerPointer], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [BikeFlags + 3], a
|
ld [wCurrentMapTriggerPointer + 1], a
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
; 2147
|
; 2147
|
||||||
|
|
||||||
GetMapTrigger:: ; 2147
|
GetMapTrigger:: ; 2147
|
||||||
|
; Searches the trigger table for the map group and number loaded in bc, and returns the wram pointer in de.
|
||||||
|
; If the map is not in the trigger table, returns carry.
|
||||||
push bc
|
push bc
|
||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
@ -50,34 +58,34 @@ GetMapTrigger:: ; 2147
|
|||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
|
|
||||||
ld hl, MapTriggers
|
ld hl, MapTriggers
|
||||||
.asm_2151
|
.loop
|
||||||
push hl
|
push hl
|
||||||
ld a, [hli]
|
ld a, [hli] ; map group, or terminator
|
||||||
cp $ff
|
cp -1
|
||||||
jr z, .asm_2167
|
jr z, .end ; the current map is not in the trigger table
|
||||||
cp b
|
cp b
|
||||||
jr nz, .asm_2160
|
jr nz, .next ; map group did not match
|
||||||
ld a, [hli]
|
ld a, [hli] ; map number
|
||||||
cp c
|
cp c
|
||||||
jr nz, .asm_2160
|
jr nz, .next ; map number did not match
|
||||||
jr .asm_216a
|
jr .found ; we found our map
|
||||||
|
|
||||||
.asm_2160
|
.next
|
||||||
pop hl
|
pop hl
|
||||||
ld de, $0004
|
ld de, 4 ; size of an entry in the trigger table
|
||||||
add hl, de
|
add hl, de
|
||||||
jr .asm_2151
|
jr .loop
|
||||||
|
|
||||||
.asm_2167
|
.end
|
||||||
scf
|
scf
|
||||||
jr .asm_216d
|
jr .done
|
||||||
|
|
||||||
.asm_216a
|
.found
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
ld d, [hl]
|
ld d, [hl]
|
||||||
|
|
||||||
.asm_216d
|
.done
|
||||||
pop hl
|
pop hl
|
||||||
pop bc
|
pop bc
|
||||||
ld a, b
|
ld a, b
|
||||||
@ -234,7 +242,7 @@ Function2252:: ; 2252
|
|||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
|
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function2266
|
call Function2266
|
||||||
|
|
||||||
pop de
|
pop de
|
||||||
@ -305,7 +313,7 @@ Function22a7:: ; 22a7
|
|||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
|
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function22b4
|
call Function22b4
|
||||||
|
|
||||||
pop af
|
pop af
|
||||||
@ -381,7 +389,7 @@ Function2300:: ; 2300
|
|||||||
|
|
||||||
Function2309:: ; 2309
|
Function2309:: ; 2309
|
||||||
call Function2326
|
call Function2326
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function234f
|
call Function234f
|
||||||
xor a
|
xor a
|
||||||
call Function2336
|
call Function2336
|
||||||
@ -390,7 +398,7 @@ Function2309:: ; 2309
|
|||||||
|
|
||||||
Function2317:: ; 2317
|
Function2317:: ; 2317
|
||||||
call Function2326
|
call Function2326
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function234f
|
call Function234f
|
||||||
ld a, $1
|
ld a, $1
|
||||||
call Function2336
|
call Function2336
|
||||||
@ -548,7 +556,7 @@ Function23da:: ; 23da
|
|||||||
Function23f1:: ; 23f1
|
Function23f1:: ; 23f1
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld [wdbfe], a
|
ld [wCurrentMapXYTriggerCount], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wdbff], a
|
ld [wdbff], a
|
||||||
ld a, h
|
ld a, h
|
||||||
@ -564,7 +572,7 @@ Function23f1:: ; 23f1
|
|||||||
Function2408:: ; 2408
|
Function2408:: ; 2408
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld [wdc01], a
|
ld [wCurrentMapSignpostCount], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wdc02], a
|
ld [wdc02], a
|
||||||
ld a, h
|
ld a, h
|
||||||
@ -972,7 +980,7 @@ Function263b:: ; 263b
|
|||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function2653
|
call Function2653
|
||||||
jr nc, .done
|
jr nc, .done
|
||||||
|
|
||||||
@ -1607,13 +1615,13 @@ Function298b:: ; 298b
|
|||||||
ld a, [TileDown]
|
ld a, [TileDown]
|
||||||
and $7
|
and $7
|
||||||
cp $2
|
cp $2
|
||||||
jr z, .asm_299f
|
jr z, .ok
|
||||||
cp $6
|
cp $6
|
||||||
jr z, .asm_299f
|
jr z, .ok
|
||||||
cp $7
|
cp $7
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
.asm_299f
|
.ok
|
||||||
ld a, [TilePermissions]
|
ld a, [TilePermissions]
|
||||||
or $8
|
or $8
|
||||||
ld [TilePermissions], a
|
ld [TilePermissions], a
|
||||||
@ -1626,13 +1634,13 @@ Function29a8:: ; 29a8
|
|||||||
ld a, [TileUp]
|
ld a, [TileUp]
|
||||||
and $7
|
and $7
|
||||||
cp $3
|
cp $3
|
||||||
jr z, .asm_29bc
|
jr z, .ok
|
||||||
cp $4
|
cp $4
|
||||||
jr z, .asm_29bc
|
jr z, .ok
|
||||||
cp $5
|
cp $5
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
.asm_29bc
|
.ok
|
||||||
ld a, [TilePermissions]
|
ld a, [TilePermissions]
|
||||||
or $4
|
or $4
|
||||||
ld [TilePermissions], a
|
ld [TilePermissions], a
|
||||||
@ -1645,13 +1653,13 @@ Function29c5:: ; 29c5
|
|||||||
ld a, [TileRight]
|
ld a, [TileRight]
|
||||||
and $7
|
and $7
|
||||||
cp $1
|
cp $1
|
||||||
jr z, .asm_29d9
|
jr z, .ok
|
||||||
cp $5
|
cp $5
|
||||||
jr z, .asm_29d9
|
jr z, .ok
|
||||||
cp $7
|
cp $7
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
.asm_29d9
|
.ok
|
||||||
ld a, [TilePermissions]
|
ld a, [TilePermissions]
|
||||||
or $1
|
or $1
|
||||||
ld [TilePermissions], a
|
ld [TilePermissions], a
|
||||||
@ -1664,13 +1672,13 @@ Function29e2:: ; 29e2
|
|||||||
ld a, [TileLeft]
|
ld a, [TileLeft]
|
||||||
and $7
|
and $7
|
||||||
cp $0
|
cp $0
|
||||||
jr z, .asm_29f6
|
jr z, .ok
|
||||||
cp $4
|
cp $4
|
||||||
jr z, .asm_29f6
|
jr z, .ok
|
||||||
cp $6
|
cp $6
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
.asm_29f6
|
.ok
|
||||||
ld a, [TilePermissions]
|
ld a, [TilePermissions]
|
||||||
or $2
|
or $2
|
||||||
ld [TilePermissions], a
|
ld [TilePermissions], a
|
||||||
@ -1696,8 +1704,7 @@ GetFacingTileCoord:: ; 2a07
|
|||||||
srl a
|
srl a
|
||||||
ld l, a
|
ld l, a
|
||||||
ld h, 0
|
ld h, 0
|
||||||
add hl, hl
|
add_n_times hl, hl, 2
|
||||||
add hl, hl
|
|
||||||
ld de, .Directions
|
ld de, .Directions
|
||||||
add hl, de
|
add hl, de
|
||||||
|
|
||||||
@ -1736,33 +1743,32 @@ Function2a3c:: ; 2a3c
|
|||||||
call GetBlockLocation
|
call GetBlockLocation
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_2a63
|
jr z, .nope
|
||||||
ld l, a
|
ld l, a
|
||||||
ld h, $0
|
ld h, $0
|
||||||
add hl, hl
|
add_n_times hl, hl, 2
|
||||||
add hl, hl
|
|
||||||
ld a, [TilesetCollisionAddress]
|
ld a, [TilesetCollisionAddress]
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [TilesetCollisionAddress + 1]
|
ld a, [TilesetCollisionAddress + 1]
|
||||||
ld b, a
|
ld b, a
|
||||||
add hl, bc
|
add hl, bc
|
||||||
rr d
|
rr d
|
||||||
jr nc, .asm_2a56
|
jr nc, .nocarry
|
||||||
inc hl
|
inc hl
|
||||||
|
|
||||||
.asm_2a56
|
.nocarry
|
||||||
rr e
|
rr e
|
||||||
jr nc, .asm_2a5c
|
jr nc, .nocarry2
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
|
|
||||||
.asm_2a5c
|
.nocarry2
|
||||||
ld a, [TilesetCollisionBank]
|
ld a, [TilesetCollisionBank]
|
||||||
call GetFarByte
|
call GetFarByte
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_2a63
|
.nope
|
||||||
ld a, $ff
|
ld a, -1
|
||||||
ret
|
ret
|
||||||
; 2a66
|
; 2a66
|
||||||
|
|
||||||
@ -1775,20 +1781,20 @@ GetBlockLocation:: ; 2a66
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld a, e
|
ld a, e
|
||||||
srl a
|
srl a
|
||||||
jr z, .asm_2a84
|
jr z, .nope
|
||||||
and a
|
and a
|
||||||
.asm_2a78
|
.loop
|
||||||
srl a
|
srl a
|
||||||
jr nc, .asm_2a7d
|
jr nc, .ok
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
||||||
.asm_2a7d
|
.ok
|
||||||
sla c
|
sla c
|
||||||
rl b
|
rl b
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_2a78
|
jr nz, .loop
|
||||||
|
|
||||||
.asm_2a84
|
.nope
|
||||||
ld c, d
|
ld c, d
|
||||||
srl c
|
srl c
|
||||||
ld b, $0
|
ld b, $0
|
||||||
@ -1799,128 +1805,138 @@ GetBlockLocation:: ; 2a66
|
|||||||
|
|
||||||
CheckFacingSign:: ; 2a8b
|
CheckFacingSign:: ; 2a8b
|
||||||
call GetFacingTileCoord
|
call GetFacingTileCoord
|
||||||
|
; Load facing into b.
|
||||||
ld b, a
|
ld b, a
|
||||||
|
; Convert the coordinates at de to within-boundaries coordinates.
|
||||||
ld a, d
|
ld a, d
|
||||||
sub 4
|
sub 4
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, e
|
ld a, e
|
||||||
sub 4
|
sub 4
|
||||||
ld e, a
|
ld e, a
|
||||||
ld a, [wdc01]
|
; If there are no signposts, we don't need to be here.
|
||||||
|
ld a, [wCurrentMapSignpostCount]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function2aaa
|
call CheckIfFacingTileCoordIsSign
|
||||||
pop hl
|
pop hl
|
||||||
ld a, h
|
ld a, h
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ret
|
ret
|
||||||
; 2aaa
|
; 2aaa
|
||||||
|
|
||||||
Function2aaa:: ; 2aaa
|
CheckIfFacingTileCoordIsSign:: ; 2aaa
|
||||||
|
; Checks to see if you are facing a signpost. If so, copies it into EngineBuffer1 and sets carry.
|
||||||
ld hl, wdc02
|
ld hl, wdc02
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
.asm_2ab0
|
.loop
|
||||||
push hl
|
push hl
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp e
|
cp e
|
||||||
jr nz, .asm_2abb
|
jr nz, .next
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp d
|
cp d
|
||||||
jr nz, .asm_2abb
|
jr nz, .next
|
||||||
jr .asm_2ac8
|
jr .copysign
|
||||||
|
|
||||||
.asm_2abb
|
.next
|
||||||
pop hl
|
pop hl
|
||||||
ld a, 5
|
ld a, 5 ; signpost event length
|
||||||
add l
|
add l
|
||||||
ld l, a
|
ld l, a
|
||||||
jr nc, .asm_2ac3
|
jr nc, .nocarry
|
||||||
inc h
|
inc h
|
||||||
|
|
||||||
.asm_2ac3
|
.nocarry
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_2ab0
|
jr nz, .loop
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_2ac8
|
.copysign
|
||||||
pop hl
|
pop hl
|
||||||
ld de, EngineBuffer1
|
ld de, EngineBuffer1
|
||||||
ld bc, 5
|
ld bc, 5 ; signpost event length
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
; 2ad4
|
; 2ad4
|
||||||
|
|
||||||
Function2ad4:: ; 2ad4
|
CheckCurrentMapXYTriggers:: ; 2ad4
|
||||||
ld a, [wdbfe]
|
; If there are no xy triggers, we don't need to be here.
|
||||||
|
ld a, [wCurrentMapXYTriggerCount]
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
; Copy the trigger count into c.
|
||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hROMBank]
|
ld a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
call Function2c52
|
call SwitchToMapScriptHeaderBank
|
||||||
call Function2ae7
|
call CheckStandingOnXYTrigger
|
||||||
pop hl
|
pop hl
|
||||||
ld a, h
|
ld a, h
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ret
|
ret
|
||||||
; 2ae7
|
; 2ae7
|
||||||
|
|
||||||
Function2ae7:: ; 2ae7
|
CheckStandingOnXYTrigger:: ; 2ae7
|
||||||
|
; Checks to see if you are standing on an xy-trigger. If yes, copies the trigger to EngineBuffer1 and sets carry.
|
||||||
ld hl, wdbff
|
ld hl, wdbff
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld h, [hl]
|
ld h, [hl]
|
||||||
ld l, a
|
ld l, a
|
||||||
|
; Load the active trigger ID into b
|
||||||
call CheckTriggers
|
call CheckTriggers
|
||||||
ld b, a
|
ld b, a
|
||||||
|
; Load your current coordinates into de. This will be used to check if your position is in the xy-trigger table for the current map.
|
||||||
ld a, [MapX]
|
ld a, [MapX]
|
||||||
sub $4
|
sub 4
|
||||||
ld d, a
|
ld d, a
|
||||||
ld a, [MapY]
|
ld a, [MapY]
|
||||||
sub $4
|
sub 4
|
||||||
ld e, a
|
ld e, a
|
||||||
.asm_2afd
|
|
||||||
|
.loop
|
||||||
push hl
|
push hl
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp b
|
cp b
|
||||||
jr z, .asm_2b06
|
jr z, .got_id
|
||||||
cp $ff
|
cp -1
|
||||||
jr nz, .asm_2b10
|
jr nz, .next
|
||||||
|
|
||||||
.asm_2b06
|
.got_id
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp e
|
cp e
|
||||||
jr nz, .asm_2b10
|
jr nz, .next
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp d
|
cp d
|
||||||
jr nz, .asm_2b10
|
jr nz, .next
|
||||||
jr .asm_2b1d
|
jr .copytrigger
|
||||||
|
|
||||||
.asm_2b10
|
.next
|
||||||
pop hl
|
pop hl
|
||||||
ld a, $8
|
ld a, $8 ; xy-trigger size
|
||||||
add l
|
add l
|
||||||
ld l, a
|
ld l, a
|
||||||
jr nc, .asm_2b18
|
jr nc, .nocarry
|
||||||
inc h
|
inc h
|
||||||
|
|
||||||
.asm_2b18
|
.nocarry
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_2afd
|
jr nz, .loop
|
||||||
xor a
|
xor a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_2b1d
|
.copytrigger
|
||||||
pop hl
|
pop hl
|
||||||
ld de, EngineBuffer1
|
ld de, EngineBuffer1
|
||||||
ld bc, $0008
|
ld bc, $0008 ; xy-trigger size
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@ -2139,7 +2155,7 @@ Function2c3d:: ; 2c3d
|
|||||||
ret
|
ret
|
||||||
; 2c52
|
; 2c52
|
||||||
|
|
||||||
Function2c52:: ; 2c52
|
SwitchToMapScriptHeaderBank:: ; 2c52
|
||||||
ld a, [MapScriptHeaderBank]
|
ld a, [MapScriptHeaderBank]
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ret
|
ret
|
||||||
|
@ -13,6 +13,7 @@ INCLUDE "macros/pic.asm"
|
|||||||
INCLUDE "macros/predef.asm"
|
INCLUDE "macros/predef.asm"
|
||||||
INCLUDE "macros/rst.asm"
|
INCLUDE "macros/rst.asm"
|
||||||
INCLUDE "macros/mobile.asm"
|
INCLUDE "macros/mobile.asm"
|
||||||
|
INCLUDE "macros/trainer.asm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -281,5 +281,6 @@
|
|||||||
charmap "<TARGET>", $59
|
charmap "<TARGET>", $59
|
||||||
charmap "<USER>", $5a
|
charmap "<USER>", $5a
|
||||||
charmap "<ENEMY>", $3f
|
charmap "<ENEMY>", $3f
|
||||||
|
charmap "<PKMN>", $4a
|
||||||
|
|
||||||
charmap "<PLAY_G>", $14 ; <PLAYER> + gender
|
charmap "<PLAY_G>", $14 ; <PLAYER> + gender
|
||||||
|
@ -446,15 +446,15 @@ AzaleaGym_MapEventHeader:
|
|||||||
|
|
||||||
; signposts
|
; signposts
|
||||||
db 2
|
db 2
|
||||||
signpost 13, 3, $0, AzaleaGymStatue
|
signpost 13, 3, SIGNPOST_READ, AzaleaGymStatue
|
||||||
signpost 13, 6, $0, AzaleaGymStatue
|
signpost 13, 6, SIGNPOST_READ, AzaleaGymStatue
|
||||||
|
|
||||||
; people-events
|
; people-events
|
||||||
db 7
|
db 7
|
||||||
person_event SPRITE_BUGSY, 11, 9, $3, $0, 255, 255, $a0, 0, BugsyScript_0x18ec1e, -1
|
person_event SPRITE_BUGSY, 11, 9, DOWN << 2 | $3, $0, -1, -1, (PAL_OW_GREEN << 4) | $80, 0, BugsyScript_0x18ec1e, -1
|
||||||
person_event SPRITE_BUG_CATCHER, 7, 9, $a, $0, 255, 255, $b2, 2, TrainerBug_catcherBug_catcher_benny, -1
|
person_event SPRITE_BUG_CATCHER, 7, 9, LEFT << 2 | $2, $0, -1, -1, (PAL_OW_BROWN << 4) | $82, 2, TrainerBug_catcherBug_catcher_benny, -1
|
||||||
person_event SPRITE_BUG_CATCHER, 12, 12, $6, $0, 255, 255, $b2, 3, TrainerBug_catcherAl, -1
|
person_event SPRITE_BUG_CATCHER, 12, 12, UP << 2 | $2, $0, -1, -1, (PAL_OW_BROWN << 4) | $82, 3, TrainerBug_catcherAl, -1
|
||||||
person_event SPRITE_BUG_CATCHER, 6, 4, $6, $0, 255, 255, $b2, 3, TrainerBug_catcherJosh, -1
|
person_event SPRITE_BUG_CATCHER, 6, 4, UP << 2 | $2, $0, -1, -1, (PAL_OW_BROWN << 4) | $82, 3, TrainerBug_catcherJosh, -1
|
||||||
person_event SPRITE_TWIN, 14, 8, $6, $0, 255, 255, $82, 1, TrainerTwinsAmyandmay1, -1
|
person_event SPRITE_TWIN, 14, 8, UP << 2 | $2, $0, -1, -1, (PAL_OW_RED << 4) | $82, 1, TrainerTwinsAmyandmay1, -1
|
||||||
person_event SPRITE_TWIN, 14, 9, $6, $0, 255, 255, $82, 1, TrainerTwinsAmyandmay2, -1
|
person_event SPRITE_TWIN, 14, 9, UP << 2 | $2, $0, -1, -1, (PAL_OW_RED << 4) | $82, 1, TrainerTwinsAmyandmay2, -1
|
||||||
person_event SPRITE_GYM_GUY, 17, 11, $6, $0, 255, 255, $80, 0, AzaleaGymGuyScript, -1
|
person_event SPRITE_GYM_GUY, 17, 11, UP << 2 | $2, $0, -1, -1, (PAL_OW_RED << 4) | $80, 0, AzaleaGymGuyScript, -1
|
||||||
|
@ -57,6 +57,6 @@ AzaleaMart_MapEventHeader:
|
|||||||
|
|
||||||
; people-events
|
; people-events
|
||||||
db 3
|
db 3
|
||||||
person_event SPRITE_CLERK, 7, 5, $9, $0, 255, 255, $0, 0, ClerkScript_0x18e040, -1
|
person_event SPRITE_CLERK, 7, 5, LEFT << 2 | $1, $0, -1, -1, $0, 0, ClerkScript_0x18e040, -1
|
||||||
person_event SPRITE_COOLTRAINER_M, 9, 6, $7, $0, 255, 255, $0, 0, CooltrainerMScript_0x18e047, -1
|
person_event SPRITE_COOLTRAINER_M, 9, 6, UP << 2 | $3, $0, -1, -1, $0, 0, CooltrainerMScript_0x18e047, -1
|
||||||
person_event SPRITE_BUG_CATCHER, 6, 11, $5, $2, 255, 255, $80, 0, BugCatcherScript_0x18e04a, -1
|
person_event SPRITE_BUG_CATCHER, 6, 11, UP << 2 | $1, $2, -1, -1, (PAL_OW_RED << 4) | $80, 0, BugCatcherScript_0x18e04a, -1
|
||||||
|
@ -90,7 +90,7 @@ AzaleaPokeCenter1F_MapEventHeader:
|
|||||||
|
|
||||||
; people-events
|
; people-events
|
||||||
db 4
|
db 4
|
||||||
person_event SPRITE_NURSE, 5, 7, $6, $0, 255, 255, $0, 0, NurseScript_0x18db28, -1
|
person_event SPRITE_NURSE, 5, 7, UP << 2 | $2, $0, -1, -1, $0, 0, NurseScript_0x18db28, -1
|
||||||
person_event SPRITE_GENTLEMAN, 10, 13, $4, $10, 255, 255, $0, 0, GentlemanScript_0x18db2b, -1
|
person_event SPRITE_GENTLEMAN, 10, 13, UP << 2 | $0, $10, -1, -1, $0, 0, GentlemanScript_0x18db2b, -1
|
||||||
person_event SPRITE_FISHING_GURU, 5, 10, $6, $0, 255, 255, $0, 0, FishingGuruScript_0x18db2e, -1
|
person_event SPRITE_FISHING_GURU, 5, 10, UP << 2 | $2, $0, -1, -1, $0, 0, FishingGuruScript_0x18db2e, -1
|
||||||
person_event SPRITE_POKEFAN_F, 8, 5, $2, $21, 255, 255, $0, 0, PokefanFScript_0x18db31, -1
|
person_event SPRITE_POKEFAN_F, 8, 5, DOWN << 2 | $2, $21, -1, -1, $0, 0, PokefanFScript_0x18db31, -1
|
||||||
|
@ -470,27 +470,27 @@ AzaleaTown_MapEventHeader:
|
|||||||
|
|
||||||
; signposts
|
; signposts
|
||||||
db 9
|
db 9
|
||||||
signpost 9, 19, $0, AzaleaTownSign
|
signpost 9, 19, SIGNPOST_READ, AzaleaTownSign
|
||||||
signpost 9, 10, $0, KurtsHouseSign
|
signpost 9, 10, SIGNPOST_READ, KurtsHouseSign
|
||||||
signpost 15, 14, $0, AzaleaGymSign
|
signpost 15, 14, SIGNPOST_READ, AzaleaGymSign
|
||||||
signpost 7, 29, $0, SlowpokeWellSign
|
signpost 7, 29, SIGNPOST_READ, SlowpokeWellSign
|
||||||
signpost 13, 19, $0, CharcoalKilnSign
|
signpost 13, 19, SIGNPOST_READ, CharcoalKilnSign
|
||||||
signpost 9, 16, $0, AzaleaTownPokeCenterSign
|
signpost 9, 16, SIGNPOST_READ, AzaleaTownPokeCenterSign
|
||||||
signpost 5, 22, $0, AzaleaTownMartSign
|
signpost 5, 22, SIGNPOST_READ, AzaleaTownMartSign
|
||||||
signpost 9, 3, $0, AzaleaTownIlextForestSign
|
signpost 9, 3, SIGNPOST_READ, AzaleaTownIlextForestSign
|
||||||
signpost 6, 31, $7, MapAzaleaTownSignpostItem8
|
signpost 6, 31, SIGNPOST_ITEMIFSET, MapAzaleaTownSignpostItem8
|
||||||
|
|
||||||
; people-events
|
; people-events
|
||||||
db 12
|
db 12
|
||||||
person_event SPRITE_AZALEA_ROCKET, 13, 35, $6, $0, 255, 255, $0, 0, AzaleaRocketScript_0x1980ab, EVENT_6FA
|
person_event SPRITE_AZALEA_ROCKET, 13, 35, UP << 2 | $2, $0, -1, -1, $0, 0, AzaleaRocketScript_0x1980ab, EVENT_6FA
|
||||||
person_event SPRITE_GRAMPS, 13, 25, $2, $21, 255, 255, $0, 0, GrampsScript_0x1980b1, -1
|
person_event SPRITE_GRAMPS, 13, 25, DOWN << 2 | $2, $21, -1, -1, $0, 0, GrampsScript_0x1980b1, -1
|
||||||
person_event SPRITE_TEACHER, 17, 19, $4, $20, 255, 255, $90, 0, TeacherScript_0x1980c5, -1
|
person_event SPRITE_TEACHER, 17, 19, UP << 2 | $0, $20, -1, -1, (PAL_OW_BLUE << 4) | $80, 0, TeacherScript_0x1980c5, -1
|
||||||
person_event SPRITE_YOUNGSTER, 13, 11, $5, $1, 255, 255, $a0, 0, YoungsterScript_0x1980c8, -1
|
person_event SPRITE_YOUNGSTER, 13, 11, UP << 2 | $1, $1, -1, -1, (PAL_OW_GREEN << 4) | $80, 0, YoungsterScript_0x1980c8, -1
|
||||||
person_event SPRITE_SLOWPOKE, 21, 12, $1, $0, 255, 255, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
person_event SPRITE_SLOWPOKE, 21, 12, DOWN << 2 | $1, $0, -1, -1, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
||||||
person_event SPRITE_SLOWPOKE, 13, 22, $1, $0, 255, 255, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
person_event SPRITE_SLOWPOKE, 13, 22, DOWN << 2 | $1, $0, -1, -1, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
||||||
person_event SPRITE_SLOWPOKE, 13, 33, $1, $0, 255, 255, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
person_event SPRITE_SLOWPOKE, 13, 33, DOWN << 2 | $1, $0, -1, -1, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
||||||
person_event SPRITE_SLOWPOKE, 19, 19, $1, $0, 255, 255, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
person_event SPRITE_SLOWPOKE, 19, 19, DOWN << 2 | $1, $0, -1, -1, $0, 0, SlowpokeScript_0x1980cb, EVENT_6F9
|
||||||
person_event SPRITE_FRUIT_TREE, 6, 12, $1, $0, 255, 255, $0, 0, WhiteApricornTree, -1
|
person_event SPRITE_FRUIT_TREE, 6, 12, DOWN << 2 | $1, $0, -1, -1, $0, 0, WhiteApricornTree, -1
|
||||||
person_event SPRITE_AZALEA_ROCKET, 14, 15, $8, $0, 255, 255, $0, 0, ObjectEvent, EVENT_6BF
|
person_event SPRITE_AZALEA_ROCKET, 14, 15, LEFT << 2 | $0, $0, -1, -1, $0, 0, ObjectEvent, EVENT_6BF
|
||||||
person_event SPRITE_AZALEA_ROCKET, 20, 14, $6, $0, 255, 255, $0, 0, AzaleaRocketScript_0x1980ae, EVENT_6FC
|
person_event SPRITE_AZALEA_ROCKET, 20, 14, UP << 2 | $2, $0, -1, -1, $0, 0, AzaleaRocketScript_0x1980ae, EVENT_6FC
|
||||||
person_event SPRITE_KURT_OUTSIDE, 9, 10, $8, $0, 255, 255, $0, 0, KurtOutsideScript_0x19810c, EVENT_7A4
|
person_event SPRITE_KURT_OUTSIDE, 9, 10, LEFT << 2 | $0, $0, -1, -1, $0, 0, KurtOutsideScript_0x19810c, EVENT_7A4
|
||||||
|
@ -79,7 +79,7 @@ UnknownScript_0x9e40f:
|
|||||||
yesorno
|
yesorno
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
dotrigger $0
|
dotrigger $0
|
||||||
special Function29e66
|
special Special_TryQuickSave
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
dotrigger $1
|
dotrigger $1
|
||||||
writebyte $1
|
writebyte $1
|
||||||
@ -168,7 +168,7 @@ UnknownScript_0x9e4be:
|
|||||||
writetext UnknownText_0x9ef1f
|
writetext UnknownText_0x9ef1f
|
||||||
yesorno
|
yesorno
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
special Function29e66
|
special Special_TryQuickSave
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
writebyte $1
|
writebyte $1
|
||||||
special Function170687
|
special Function170687
|
||||||
@ -207,7 +207,7 @@ UnknownScript_0x9e515:
|
|||||||
yesorno
|
yesorno
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
dotrigger $0
|
dotrigger $0
|
||||||
special Function29e66
|
special Special_TryQuickSave
|
||||||
iffalse UnknownScript_0x9e3fc
|
iffalse UnknownScript_0x9e3fc
|
||||||
dotrigger $1
|
dotrigger $1
|
||||||
writebyte $6
|
writebyte $6
|
||||||
@ -806,12 +806,12 @@ BattleTower1F_MapEventHeader:
|
|||||||
|
|
||||||
; signposts
|
; signposts
|
||||||
db 1
|
db 1
|
||||||
signpost 6, 6, $0, MapBattleTower1FSignpost0Script
|
signpost 6, 6, SIGNPOST_READ, MapBattleTower1FSignpost0Script
|
||||||
|
|
||||||
; people-events
|
; people-events
|
||||||
db 5
|
db 5
|
||||||
person_event SPRITE_RECEPTIONIST, 10, 11, $6, $0, 255, 255, $0, 0, ReceptionistScript_0x9e3e2, -1
|
person_event SPRITE_RECEPTIONIST, 10, 11, UP << 2 | $2, $0, -1, -1, $0, 0, ReceptionistScript_0x9e3e2, -1
|
||||||
person_event SPRITE_YOUNGSTER, 13, 18, $9, $0, 255, 255, $b0, 0, YoungsterScript_0x9e55d, -1
|
person_event SPRITE_YOUNGSTER, 13, 18, LEFT << 2 | $1, $0, -1, -1, (PAL_OW_BROWN << 4) | $80, 0, YoungsterScript_0x9e55d, -1
|
||||||
person_event SPRITE_COOLTRAINER_F, 13, 8, $5, $1, 255, 255, $80, 0, CooltrainerFScript_0x9e568, -1
|
person_event SPRITE_COOLTRAINER_F, 13, 8, UP << 2 | $1, $1, -1, -1, (PAL_OW_RED << 4) | $80, 0, CooltrainerFScript_0x9e568, -1
|
||||||
person_event SPRITE_BUG_CATCHER, 7, 5, $2, $11, 255, 255, $90, 0, BugCatcherScript_0x9e56b, -1
|
person_event SPRITE_BUG_CATCHER, 7, 5, DOWN << 2 | $2, $11, -1, -1, (PAL_OW_BLUE << 4) | $80, 0, BugCatcherScript_0x9e56b, -1
|
||||||
person_event SPRITE_GRANNY, 7, 18, $4, $10, 255, 255, $0, 0, GrannyScript_0x9e56e, -1
|
person_event SPRITE_GRANNY, 7, 18, UP << 2 | $0, $10, -1, -1, $0, 0, GrannyScript_0x9e56e, -1
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user