mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-03-21 17:24:42 -05:00
Merge pull request #80 from yenatch/master
loadwilddata takes 3 params, and fix engine flag parsing.
This commit is contained in:
commit
e0bbcbce7a
|
|
@ -1454,14 +1454,15 @@ class DataByteWordMacro(Command):
|
|||
|
||||
|
||||
event_flags = wram.read_constants(os.path.join(conf.path, 'constants/event_flags.asm'))
|
||||
engine_flags = wram.read_constants(os.path.join(conf.path, 'constants/engine_flags.asm'))
|
||||
|
||||
class EventFlagParam(MultiByteParam):
|
||||
|
||||
def to_asm(self):
|
||||
if self.parsed_number in event_flags.keys():
|
||||
return event_flags[self.parsed_number]
|
||||
return MultiByteParam.to_asm(self)
|
||||
return event_flags.get(self.parsed_number) or MultiByteParam.to_asm(self)
|
||||
|
||||
class EngineFlagParam(MultiByteParam):
|
||||
def to_asm(self):
|
||||
return engine_flags.get(self.parsed_number) or MultiByteParam.to_asm(self)
|
||||
|
||||
|
||||
class MovementCommand(Command):
|
||||
|
|
@ -2276,9 +2277,9 @@ pksv_crystal_more = {
|
|||
0x31: ["checkevent", ["event_flag", EventFlagParam]],
|
||||
0x32: ["clearevent", ["event_flag", EventFlagParam]],
|
||||
0x33: ["setevent", ["event_flag", EventFlagParam]],
|
||||
0x34: ["checkflag", ["event_flag", EventFlagParam]],
|
||||
0x35: ["clearflag", ["event_flag", EventFlagParam]],
|
||||
0x36: ["setflag", ["event_flag", EventFlagParam]],
|
||||
0x34: ["checkflag", ["engine_flag", EngineFlagParam]],
|
||||
0x35: ["clearflag", ["engine_flag", EngineFlagParam]],
|
||||
0x36: ["setflag", ["engine_flag", EngineFlagParam]],
|
||||
0x37: ["wildon"],
|
||||
0x38: ["wildoff"],
|
||||
0x39: ["xycompare", ["pointer", MultiByteParam]],
|
||||
|
|
@ -2388,7 +2389,7 @@ pksv_crystal_more = {
|
|||
0x9D: ["checkphonecall"],
|
||||
0x9E: ["verbosegiveitem", ["item", ItemLabelByte], ["quantity", DecimalParam]],
|
||||
0x9F: ["verbosegiveitem2", ["item", ItemLabelByte], ["var", SingleByteParam]],
|
||||
0xA0: ["loadwilddata", ["map_group", MapGroupParam], ["map_id", MapIdParam]],
|
||||
0xA0: ["loadwilddata", ["flag", SingleByteParam], ["map_group", MapGroupParam], ["map_id", MapIdParam]],
|
||||
0xA1: ["halloffame"],
|
||||
0xA2: ["credits"],
|
||||
0xA3: ["warpfacing", ["facing", SingleByteParam], ["map_group", MapGroupParam], ["map_id", MapIdParam], ["x", SingleByteParam], ["y", SingleByteParam]],
|
||||
|
|
|
|||
|
|
@ -1103,10 +1103,6 @@ def read_filename_arguments(filename):
|
|||
arg = int_args.get(arg, False)
|
||||
if arg:
|
||||
parsed_arguments[arg] = int(param)
|
||||
elif len(argument) == 3:
|
||||
w, x, h = argument[:3]
|
||||
if w.isdigit() and h.isdigit() and x == 'x':
|
||||
parsed_arguments['pic_dimensions'] = (int(w), int(h))
|
||||
elif argument == 'interleave':
|
||||
parsed_arguments['interleave'] = True
|
||||
elif argument == 'norepeat':
|
||||
|
|
@ -1114,6 +1110,11 @@ def read_filename_arguments(filename):
|
|||
elif argument == 'arrange':
|
||||
parsed_arguments['norepeat'] = True
|
||||
parsed_arguments['tilemap'] = True
|
||||
elif 'x' in argument:
|
||||
w, h = argument.split('x')
|
||||
if w.isdigit() and h.isdigit():
|
||||
parsed_arguments['pic_dimensions'] = (int(w), int(h))
|
||||
|
||||
return parsed_arguments
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user