From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- scripts/silphco4.asm | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'scripts/silphco4.asm') diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index a3953e27..aff77e4a 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,8 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - ld a, [wd82a] - bit 0, a + CheckEvent EVENT_718 jr nz, .asm_19d48 push af ld a, $54 @@ -73,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - ld hl, wd82a + EventFlagAddress hl, EVENT_718 ld a, [$ffe0] and a ret z cp $1 - jr nz, .asm_19d97 - set 0, [hl] + jr nz, .next + SetEventReuseHL EVENT_718 ret -.asm_19d97 - set 1, [hl] +.next + SetEventAfterBranchReuseHL EVENT_719, EVENT_718 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) @@ -101,27 +100,27 @@ SilphCo4TextPointers: ; 19da0 (6:5da0) 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 + 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 + 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 + dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_3 dw SilphCo4BattleText4 ; TextBeforeBattle dw SilphCo4AfterBattleText4 ; TextAfterBattle dw SilphCo4EndBattleText4 ; TextEndBattle -- cgit v1.2.3 From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- scripts/silphco4.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/silphco4.asm') diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index aff77e4a..815170ff 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -16,7 +16,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - CheckEvent EVENT_718 + CheckEvent EVENT_SILPH_CO_4_UNLOCKED_DOOR1 jr nz, .asm_19d48 push af ld a, $54 @@ -25,7 +25,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) 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 @@ -72,16 +72,16 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - EventFlagAddress hl, EVENT_718 + EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ld a, [$ffe0] and a ret z cp $1 jr nz, .next - SetEventReuseHL EVENT_718 + SetEventReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret .next - SetEventAfterBranchReuseHL EVENT_719, EVENT_718 + SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret SilphCo4ScriptPointers: ; 19d9a (6:5d9a) -- cgit v1.2.3