summaryrefslogtreecommitdiff
path: root/scripts/silphco9.asm
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-08-30 17:55:02 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-08-30 17:55:02 -0400
commitd2ed7674f499b1fd6c4059da40b8b42c6bf96995 (patch)
treef581489b522fc647477d7b36dee072d553c44fd1 /scripts/silphco9.asm
parent3394d8320f35f524231aa13bd9cae34e22246a6d (diff)
parent1a987d1e1ab96ca9553d4253c72858057332a03a (diff)
Merge branch 'master' of https://github.com/iimarckus/pokered
Doesn't build.
Diffstat (limited to 'scripts/silphco9.asm')
-rwxr-xr-xscripts/silphco9.asm112
1 files changed, 57 insertions, 55 deletions
diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm
index e8b16927..02638459 100755
--- a/scripts/silphco9.asm
+++ b/scripts/silphco9.asm
@@ -13,46 +13,49 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
bit 5, [hl]
res 5, [hl]
ret z
- ld hl, DataTable_5d82e ; $582e
+ ld hl, SilphCo9GateCoords
call SilphCo9Script_5d837
call SilphCo9Script_5d863
- ld a, [wd834]
- bit 0, a
+ CheckEvent EVENT_SILPH_CO_9_UNLOCKED_DOOR1
jr nz, .asm_5d7f8
push af
ld a, $5f
- ld [wd09f], a
- ld bc, $401
+ ld [wNewTileBlockID], a
+ lb bc, 4, 1
predef ReplaceTileBlock
pop af
.asm_5d7f8
- bit 1, a
+ CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
jr nz, .asm_5d80b
push af
ld a, $54
- ld [wd09f], a
- ld bc, $209
+ ld [wNewTileBlockID], a
+ lb bc, 2, 9
predef ReplaceTileBlock
pop af
.asm_5d80b
- bit 2, a
+ CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR2
jr nz, .asm_5d81e
push af
ld a, $54
- ld [wd09f], a
- ld bc, $509
+ ld [wNewTileBlockID], a
+ lb bc, 5, 9
predef ReplaceTileBlock
pop af
.asm_5d81e
- bit 3, a
+ CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3
ret nz
ld a, $5f
- ld [wd09f], a
- ld bc, $605
+ ld [wNewTileBlockID], a
+ lb bc, 6, 5
predef_jump ReplaceTileBlock
-DataTable_5d82e: ; 5d82e (17:582e)
- db $04,$01,$02,$09,$05,$09,$06,$05,$FF
+SilphCo9GateCoords: ; 5d82e (17:582e)
+ db $04,$01
+ db $02,$09
+ db $05,$09
+ db $06,$05
+ db $FF
SilphCo9Script_5d837: ; 5d837 (17:5837)
push hl
@@ -91,28 +94,28 @@ SilphCo9Script_5d837: ; 5d837 (17:5837)
ret
SilphCo9Script_5d863: ; 5d863 (17:5863)
- ld hl, wd834
+ EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
ld a, [$ffe0]
and a
ret z
cp $1
- jr nz, .asm_5d871
- set 0, [hl]
+ jr nz, .next1
+ SetEventReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR1
ret
-.asm_5d871
+.next1
cp $2
- jr nz, .asm_5d878
- set 1, [hl]
+ jr nz, .next2
+ SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR2, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
ret
-.asm_5d878
+.next2
cp $3
- jr nz, .asm_5d87f
- set 2, [hl]
+ jr nz, .next3
+ SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR3, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
ret
-.asm_5d87f
+.next3
cp $4
ret nz
- set 3, [hl]
+ SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR1
ret
SilphCo9ScriptPointers: ; 5d885 (17:5885)
@@ -128,39 +131,38 @@ SilphCo9TextPointers: ; 5d88b (17:588b)
SilphCo9TrainerHeaders: ; 5d893 (17:5893)
SilphCo9TrainerHeader0: ; 5d893 (17:5893)
- db $2 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0
db ($4 << 4) ; trainer's view range
- dw wd833 ; flag's byte
- dw SilphCo9BattleText1 ; 0x5912 TextBeforeBattle
- dw SilphCo9AfterBattleText1 ; 0x591c TextAfterBattle
- dw SilphCo9EndBattleText1 ; 0x5917 TextEndBattle
- dw SilphCo9EndBattleText1 ; 0x5917 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0
+ dw SilphCo9BattleText1 ; TextBeforeBattle
+ dw SilphCo9AfterBattleText1 ; TextAfterBattle
+ dw SilphCo9EndBattleText1 ; TextEndBattle
+ dw SilphCo9EndBattleText1 ; TextEndBattle
SilphCo9TrainerHeader1: ; 5d89f (17:589f)
- db $3 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1
db ($2 << 4) ; trainer's view range
- dw wd833 ; flag's byte
- dw SilphCo9BattleText2 ; 0x5921 TextBeforeBattle
- dw SilphCo9AfterBattleText2 ; 0x592b TextAfterBattle
- dw SilphCo9EndBattleText2 ; 0x5926 TextEndBattle
- dw SilphCo9EndBattleText2 ; 0x5926 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1
+ dw SilphCo9BattleText2 ; TextBeforeBattle
+ dw SilphCo9AfterBattleText2 ; TextAfterBattle
+ dw SilphCo9EndBattleText2 ; TextEndBattle
+ dw SilphCo9EndBattleText2 ; TextEndBattle
SilphCo9TrainerHeader2: ; 5d8ab (17:58ab)
- db $4 ; flag's bit
+ dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2
db ($4 << 4) ; trainer's view range
- dw wd833 ; flag's byte
- dw SilphCo9BattleText3 ; 0x5930 TextBeforeBattle
- dw SilphCo9AfterBattleText3 ; 0x593a TextAfterBattle
- dw SilphCo9EndBattleText3 ; 0x5935 TextEndBattle
- dw SilphCo9EndBattleText3 ; 0x5935 TextEndBattle
+ dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2
+ dw SilphCo9BattleText3 ; TextBeforeBattle
+ dw SilphCo9AfterBattleText3 ; TextAfterBattle
+ dw SilphCo9EndBattleText3 ; TextEndBattle
+ dw SilphCo9EndBattleText3 ; TextEndBattle
db $ff
SilphCo9Text1: ; 5d8b8 (17:58b8)
- db $08 ; asm
- ld a, [wd838]
- bit 7, a
- jr nz, .asm_a14c3 ; 0x5d8be
+ TX_ASM
+ CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
+ jr nz, .asm_5d8dc
ld hl, SilphCo9Text_5d8e5
call PrintText
predef HealParty
@@ -169,11 +171,11 @@ SilphCo9Text1: ; 5d8b8 (17:58b8)
call GBFadeInFromWhite
ld hl, SilphCo9Text_5d8ea
call PrintText
- jr .asm_b6e28 ; 0x5d8da
-.asm_a14c3 ; 0x5d8dc
+ jr .asm_5d8e2
+.asm_5d8dc
ld hl, SilphCo9Text_5d8ef
call PrintText
-.asm_b6e28 ; 0x5d8e2
+.asm_5d8e2
jp TextScriptEnd
SilphCo9Text_5d8e5: ; 5d8e5 (17:58e5)
@@ -189,19 +191,19 @@ SilphCo9Text_5d8ef: ; 5d8ef (17:58ef)
db "@"
SilphCo9Text2: ; 5d8f4 (17:58f4)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo9TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
SilphCo9Text3: ; 5d8fe (17:58fe)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo9TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
SilphCo9Text4: ; 5d908 (17:5908)
- db $08 ; asm
+ TX_ASM
ld hl, SilphCo9TrainerHeader2
call TalkToTrainer
jp TextScriptEnd