예제 #1
0
    def __init__(
        self,
        rom_start,
        rom_end,
        type,
        name,
        vram_start,
        extract,
        given_subalign,
        exclusive_ram_id,
        given_dir,
        symbol_name_format,
        symbol_name_format_no_rom,
        args,
        yaml,
    ):
        super().__init__(
            rom_start,
            rom_end,
            type,
            name,
            vram_start,
            extract,
            given_subalign,
            exclusive_ram_id,
            given_dir,
            symbol_name_format=symbol_name_format,
            symbol_name_format_no_rom=symbol_name_format_no_rom,
            args=args,
            yaml=yaml,
        )

        with open(options.get_asm_path() / ".." / "effect_shims.yaml") as f:
            self.shims = yaml_loader.load(f.read(),
                                          Loader=yaml_loader.SafeLoader)
예제 #2
0
    def __init__(self, rom_start, rom_end, type, name, vram_start, extract,
                 given_subalign, given_is_overlay, given_dir, args, yml):
        super().__init__(rom_start, rom_end, type, name, vram_start, extract,
                         given_subalign, given_is_overlay, given_dir, args,
                         yml)

        with open(options.get_asm_path() / ".." / "effect_shims.yaml") as f:
            self.shims = yaml.load(f.read(), Loader=yaml.SafeLoader)
예제 #3
0
 def out_path(self) -> Optional[Path]:
     if self.type.startswith("."):
         if self.sibling:
             # C file
             return self.sibling.out_path()
         else:
             # Implied C file
             return options.get_src_path() / self.dir / f"{self.name}.c"
     else:
         # ASM
         return options.get_asm_path() / "data" / self.dir / f"{self.name}.{self.type}.s"
예제 #4
0
파일: c.py 프로젝트: chansuke/papermario
    def split(self, rom_bytes: bytes):
        if not self.rom_start == self.rom_end:
            asm_out_dir = options.get_asm_path() / "nonmatchings" / self.dir
            asm_out_dir.mkdir(parents=True, exist_ok=True)

            for func in self.funcs_text:
                func_name = self.parent.get_symbol(func,
                                                   type="func",
                                                   local_only=True).name

                if func_name not in self.defined_funcs:
                    self.create_c_asm_file(self.funcs_text, func, asm_out_dir,
                                           func_name)

            c_path = self.out_path()
            if c_path:
                if not os.path.exists(c_path) and options.get(
                        "create_new_c_files", True):
                    self.create_c_file(self.funcs_text, asm_out_dir, c_path)
예제 #5
0
 def out_path(self) -> Path:
     return options.get_asm_path() / self.dir / f"{self.name}.s"