Skip to content

Commit 22e3e1f

Browse files
authored
Merge pull request #5 from AtmaTek/1_0_2
1 0 2
2 parents a32c8c2 + 4654ab6 commit 22e3e1f

6 files changed

Lines changed: 31 additions & 53 deletions

File tree

args/espers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def menu(args):
147147
for index, entry in enumerate(entries):
148148
key, value = entry
149149
try:
150+
value = value.replace("Original (Random Rates)", "Random Rates")
151+
value = value.replace("Shuffle (Random Rates)", "Shuffle R Rates")
150152
value = value.replace("Random Value", "")
151153
value = value.replace("Random Percent", "")
152154
value = value.replace("Balanced Random", "Balanced")

battle/check_dragon_boss.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,55 +29,61 @@ def __init__(self):
2929

3030
"DRAGON_CHECK_LOOP_START",
3131
asm.CMP(f0.dragon_formations, asm.LNG_X),
32-
asm.BEQ("INCREMENT_DRAGON_COUNT"), # branch if formation in dragon formations
32+
asm.BEQ("CHECK_DRAGON_DEFEATED_BIT"), # branch if formation in dragon formations
3333
asm.INX(),
3434
asm.INX(),
3535
asm.CPX(f0.dragon_formations_size, asm.IMM16),
3636
asm.BLT("DRAGON_CHECK_LOOP_START"), # branch if not checked all dragon formations
3737
asm.BRA("CHECK_BOSS_FORMATIONS"),
3838

39-
"INCREMENT_DRAGON_COUNT",
40-
asm.INC(dragons_defeated_address, asm.ABS),
39+
"CHECK_DRAGON_DEFEATED_BIT",
4140
asm.TXA(), # a = formation index * 2
4241
asm.LSR(), # a = formation index
4342
asm.CLC(),
4443
asm.ADC(battle_bit.bit(battle_bit.DRAGON_DEFEATED_START), asm.IMM16),
4544
asm.LDX(0x0008, asm.IMM16),
4645
asm.JSR(f0.divide, asm.ABS), # a = byte, x = bit
47-
asm.PHY(),
48-
asm.TAY(), # y = dragon battle byte
46+
asm.PHA(),
4947
asm.JSR(f0.set_bit_x, asm.ABS), # set bit #x in a
50-
asm.ORA(dragon_bits_start, asm.ABS_Y),
51-
asm.STA(dragon_bits_start, asm.ABS_Y), # set dragon defeated battle bit
52-
asm.PLY(),
48+
asm.PLX(), # x = byte (pushed from a)
49+
asm.BIT(dragon_bits_start, asm.ABS_X), # is dragon defeated bit set?
50+
asm.BNE("RETURN"),
51+
52+
"SET_DRAGON_DEFEATED",
53+
asm.ORA(dragon_bits_start, asm.ABS_X),
54+
asm.STA(dragon_bits_start, asm.ABS_X), # set dragon defeated bit
55+
asm.INC(dragons_defeated_address, asm.ABS), # increment dragons defeated count
5356
asm.BRA("RETURN"),
5457

5558
"CHECK_BOSS_FORMATIONS",
5659
asm.LDX(0x0000, asm.IMM16), # formation table index = 0
5760

5861
"BOSS_CHECK_LOOP_START",
5962
asm.CMP(f0.boss_formations, asm.LNG_X),
60-
asm.BEQ("INCREMENT_BOSS_COUNT"), # branch if formation in boss formations
63+
asm.BEQ("CHECK_BOSS_DEFEATED_BIT"), # branch if formation in boss formations
6164
asm.INX(),
6265
asm.INX(),
6366
asm.CPX(f0.boss_formations_size, asm.IMM16),
6467
asm.BLT("BOSS_CHECK_LOOP_START"), # branch if not checked all boss formations
6568
asm.BRA("RETURN"),
6669

67-
"INCREMENT_BOSS_COUNT",
68-
asm.INC(bosses_defeated_address, asm.ABS),
70+
"CHECK_BOSS_DEFEATED_BIT",
6971
asm.TXA(), # a = formation index * 2
7072
asm.LSR(), # a = formation index
7173
asm.CLC(),
7274
asm.ADC(battle_bit.bit(battle_bit.BOSS_DEFEATED_START), asm.IMM16),
7375
asm.LDX(0x0008, asm.IMM16),
7476
asm.JSR(f0.divide, asm.ABS), # a = byte, x = bit
75-
asm.PHY(),
76-
asm.TAY(), # y = boss battle byte
77+
asm.PHA(),
7778
asm.JSR(f0.set_bit_x, asm.ABS), # set bit #x in a
78-
asm.ORA(boss_bits_start, asm.ABS_Y),
79-
asm.STA(boss_bits_start, asm.ABS_Y), # set boss defeated battle bit
80-
asm.PLY(),
79+
asm.PLX(), # x = byte (pushed from a)
80+
asm.BIT(boss_bits_start, asm.ABS_X), # is boss defeated bit set?
81+
asm.BNE("RETURN"),
82+
83+
"SET_BOSS_DEFEATED",
84+
asm.ORA(boss_bits_start, asm.ABS_X),
85+
asm.STA(boss_bits_start, asm.ABS_X), # set boss defeated bit
86+
asm.INC(bosses_defeated_address, asm.ABS), # increment bosses defeated count
8187

8288
"RETURN",
8389
asm.PLP(),

event/veldt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def battle_events_mod(self):
387387

388388
battle_event.OpenMultiLineDialogWindow(),
389389
battle_event.DisplayMultiLineDialog(gau_char_arrives_dialog_id), # Gau: Uwaoo~!!
390-
battle_event.FinishCheck(),
390+
battle_event.IncrementChecksComplete(),
391391
battle_event.CloseMultiLineDialogWindow(),
392392
battle_event.End(),
393393
)

instruction/battle_event.py

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -86,50 +86,20 @@ class DisplayMultiLineDialog(_Instruction):
8686
def __init__(self, dialog_id):
8787
super().__init__(0x01, dialog_id)
8888

89-
class FinishCheck(_Instruction):
89+
class IncrementChecksComplete(_Instruction):
9090
def __init__(self):
91-
import objectives
92-
import data.dialogs as dialogs
93-
9491
import data.event_word as event_word
9592
checks_complete_address = event_word.address(event_word.CHECKS_COMPLETE)
9693

9794
src = [
9895
asm.INC(checks_complete_address, asm.ABS),
99-
]
100-
for objective in objectives:
101-
src += [
102-
asm.XY8(),
103-
objective.check_complete.battle(),
104-
asm.XY16(),
105-
asm.CMP(0x00, asm.IMM8),
106-
asm.BEQ("AFTER_DIALOG" + str(objective.id)), # if not complete, go to next objective
107-
108-
asm.LDA(dialogs.get_multi_line_battle_objective(objective.id), asm.IMM8),
109-
asm.A16(),
110-
asm.ASL(), # a = dialog id * 2 (2 bytes per pointer)
111-
asm.TAX(), # x = dialog id * 2
112-
asm.A8(),
113-
asm.JSL(START_ADDRESS_SNES + c1.display_multi_line_dialog), # display objective complete dialog
114-
115-
"AFTER_DIALOG" + str(objective.id),
116-
]
117-
src += [
118-
"RETURN",
119-
asm.RTL(),
120-
]
121-
space = Write(Bank.F0, src, "battle event finish check")
122-
finish_check = space.start_address
123-
124-
src = [
125-
asm.JSL(START_ADDRESS_SNES + finish_check),
12696
asm.RTS(),
12797
]
128-
space = Write(Bank.C1, src, "battle event finish check command")
98+
space = Write(Bank.C1, src, "battle event increment checks complete command")
12999
address = space.start_address
130100

131101
opcode = 0x15
132102
_set_opcode_address(opcode, address)
133103

134-
FinishCheck.__init__ = lambda self : super().__init__(opcode)
104+
IncrementChecksComplete.__init__ = lambda self : super().__init__(opcode)
135105
self.__init__()

instruction/field/y_npc/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def imperial():
124124

125125
def main_character():
126126
from data.characters import Characters
127-
from args.custom import DEFAULT_CHARACTER_SPRITES
128-
from args.custom import DEFAULT_CHARACTER_SPRITE_PALETTES
127+
from data.character_sprites import DEFAULT_CHARACTER_SPRITES
128+
from data.character_palettes import DEFAULT_CHARACTER_SPRITE_PALETTES
129129

130130
sprites = DEFAULT_CHARACTER_SPRITES[:Characters.CHARACTER_COUNT]
131131
palettes = args.sprite_palettes

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.1"
1+
__version__ = "1.0.2"

0 commit comments

Comments
 (0)