summaryrefslogtreecommitdiff
path: root/scripts/silphco4.asm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/silphco4.asm')
-rwxr-xr-xscripts/silphco4.asm89
1 files changed, 45 insertions, 44 deletions
diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm
index 15a46dd3..0dad6f6b 100755
--- a/scripts/silphco4.asm
+++ b/scripts/silphco4.asm
@@ -13,28 +13,29 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21)
bit 5, [hl]
res 5, [hl]
ret z
- ld hl, SilphCo4Data19d58
+ ld hl, SilphCo4GateCoords
call SilphCo4Script_19d5d
call SilphCo4Script_19d89
- ld a, [wd82a]
- bit 0, a
+ CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1
jr nz, .asm_19d48
push af
ld a, $54
- ld [wd09f], a
- ld bc, $0602
+ ld [wNewTileBlockID], a
+ lb bc, 6, 2
predef ReplaceTileBlock
pop af
.asm_19d48
- bit 1, a
+ CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
ret nz
ld a, $54
- ld [wd09f], a
- ld bc, $0406
+ ld [wNewTileBlockID], a
+ lb bc, 4, 6
predef_jump ReplaceTileBlock
-SilphCo4Data19d58: ; 19d58 (6:5d58)
- db $06, $02, $04, $06, $ff
+SilphCo4GateCoords: ; 19d58 (6:5d58)
+ db $06,$02
+ db $04,$06
+ db $FF
SilphCo4Script_19d5d: ; 19d5d (6:5d5d)
push hl
@@ -49,19 +50,19 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d)
.asm_19d69
ld a, [hli]
cp $ff
- jr z, .asm_19d85 ; 0x19d6c $17
+ jr z, .asm_19d85
push hl
ld hl, $ffe0
inc [hl]
pop hl
cp b
- jr z, .asm_19d7a ; 0x19d75 $3
+ jr z, .asm_19d7a
inc hl
- jr .asm_19d69 ; 0x19d78 $ef
+ jr .asm_19d69
.asm_19d7a
ld a, [hli]
cp c
- jr nz, .asm_19d69 ; 0x19d7c $eb
+ jr nz, .asm_19d69
ld hl, wCardKeyDoorY
xor a
ld [hli], a
@@ -73,16 +74,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d)
ret
SilphCo4Script_19d89: ; 19d89 (6:5d89)
- ld hl, wd82a
+ EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
ld a, [$ffe0]
and a
ret z
cp $1
- jr nz, .asm_19d97 ; 0x19d92 $3
- set 0, [hl]
+ jr nz, .next
+ SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1
ret
-.asm_19d97
- set 1, [hl]
+.next
+ SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
ret
SilphCo4ScriptPointers: ; 19d9a (6:5d9a)
@@ -95,42 +96,42 @@ SilphCo4TextPointers: ; 19da0 (6:5da0)
dw SilphCo4Text2
dw SilphCo4Text3
dw SilphCo4Text4
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
SilphCo4TrainerHeaders: ; 19dae (6:5dae)
SilphCo4TrainerHeader0: ; 19dae (6:5dae)
- db $2 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_0
db ($4 << 4) ; trainer's view range
- dw wd829 ; flag's byte
- dw SilphCo4BattleText2 ; 0x5df4 TextBeforeBattle
- dw SilphCo4AfterBattleText2 ; 0x5dfe TextAfterBattle
- dw SilphCo4EndBattleText2 ; 0x5df9 TextEndBattle
- dw SilphCo4EndBattleText2 ; 0x5df9 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_0
+ dw SilphCo4BattleText2 ; TextBeforeBattle
+ dw SilphCo4AfterBattleText2 ; TextAfterBattle
+ dw SilphCo4EndBattleText2 ; TextEndBattle
+ dw SilphCo4EndBattleText2 ; TextEndBattle
SilphCo4TrainerHeader2: ; 19dba (6:5dba)
- db $3 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_2
db ($3 << 4) ; trainer's view range
- dw wd829 ; flag's byte
- dw SilphCo4BattleText3 ; 0x5e0d TextBeforeBattle
- dw SilphCo4AfterBattleText3 ; 0x5e17 TextAfterBattle
- dw SilphCo4EndBattleText3 ; 0x5e12 TextEndBattle
- dw SilphCo4EndBattleText3 ; 0x5e12 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_2
+ dw SilphCo4BattleText3 ; TextBeforeBattle
+ dw SilphCo4AfterBattleText3 ; TextAfterBattle
+ dw SilphCo4EndBattleText3 ; TextEndBattle
+ dw SilphCo4EndBattleText3 ; TextEndBattle
SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6)
- db $4 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_3
db ($4 << 4) ; trainer's view range
- dw wd829 ; flag's byte
- dw SilphCo4BattleText4 ; 0x5e26 TextBeforeBattle
- dw SilphCo4AfterBattleText4 ; 0x5e30 TextAfterBattle
- dw SilphCo4EndBattleText4 ; 0x5e2b TextEndBattle
- dw SilphCo4EndBattleText4 ; 0x5e2b TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_3
+ dw SilphCo4BattleText4 ; TextBeforeBattle
+ dw SilphCo4AfterBattleText4 ; TextAfterBattle
+ dw SilphCo4EndBattleText4 ; TextEndBattle
+ dw SilphCo4EndBattleText4 ; TextEndBattle
db $ff
SilphCo4Text1: ; 19dd3 (6:5dd3)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo4Text_19de0
ld de, SilphCo4Text_19de5
call SilphCo6Script_1a22f
@@ -145,7 +146,7 @@ SilphCo4Text_19de5: ; 19de5 (6:5de5)
db "@"
SilphCo4Text2: ; 19dea (6:5dea)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo4TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
@@ -163,7 +164,7 @@ SilphCo4AfterBattleText2: ; 19dfe (6:5dfe)
db "@"
SilphCo4Text3: ; 19e03 (6:5e03)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo4TrainerHeader2
call TalkToTrainer
jp TextScriptEnd
@@ -181,7 +182,7 @@ SilphCo4AfterBattleText3: ; 19e17 (6:5e17)
db "@"
SilphCo4Text4: ; 19e1c (6:5e1c)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo4TrainerHeader3
call TalkToTrainer
jp TextScriptEnd