diff --git a/.vscode/settings.json b/.vscode/settings.json index 66e108bfbd..d694cb1eb9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -44,7 +44,10 @@ "**/.git": true, "**/.splat_cache": true, ".ninja*": true, - "ver/current": true + "ver/current": true, + "expected": true, + "**/*.i": true, + "docs/doxygen": true, }, "C_Cpp.default.cStandard": "c89", } diff --git a/diff.py b/diff.py index f55217225a..e821978be2 100755 --- a/diff.py +++ b/diff.py @@ -109,6 +109,15 @@ if __name__ == "__main__": help="""Diff .o files rather than a whole binary. This makes it possible to see symbol names. (Recommended)""", ) + parser.add_argument( + "-f", + "--objfile", + dest="objfile", + type=str, + help="""File path for an object file being diffed. When used + the map file isn't searched for the function given. Useful for dynamically + linked libraries.""", + ) parser.add_argument( "-e", "--elf", @@ -132,6 +141,14 @@ if __name__ == "__main__": help="""Tweak --source handling to make it work with binutils < 2.33. Implies --source.""", ) + parser.add_argument( + "-j", + "--section", + dest="diff_section", + default=".text", + metavar="SECTION", + help="Diff restricted to a given output section.", + ) parser.add_argument( "-L", "--line-numbers", @@ -271,7 +288,6 @@ if __name__ == "__main__": metavar="LINES", dest="max_lines", type=int, - default=1024, help="The maximum length of the diff, in lines.", ) parser.add_argument( @@ -356,6 +372,7 @@ except ModuleNotFoundError as e: class ProjectSettings: arch_str: str objdump_executable: str + objdump_flags: List[str] build_command: List[str] map_format: str mw_build_dir: str @@ -365,6 +382,7 @@ class ProjectSettings: source_directories: Optional[List[str]] source_extensions: List[str] show_line_numbers_default: bool + disassemble_all: bool @dataclass @@ -379,11 +397,14 @@ class Config: # Build/objdump options diff_obj: bool + objfile: Optional[str] make: bool source_old_binutils: bool + diff_section: str inlines: bool max_function_size_lines: int max_function_size_bytes: int + max_function_lines_overriden: bool # Display options formatter: "Formatter" @@ -422,11 +443,14 @@ def create_project_settings(settings: Dict[str, Any]) -> ProjectSettings: "source_extensions", [".c", ".h", ".cpp", ".hpp", ".s"] ), objdump_executable=get_objdump_executable(settings.get("objdump_executable")), + objdump_flags=settings.get("objdump_flags", []), map_format=settings.get("map_format", "gnu"), mw_build_dir=settings.get("mw_build_dir", "build/"), show_line_numbers_default=settings.get("show_line_numbers_default", True), + disassemble_all=settings.get("disassemble_all", False), ) +DEFAULT_MAX_LINES = 1024 def create_config(args: argparse.Namespace, project: ProjectSettings) -> Config: arch = get_arch(project.arch_str) @@ -457,15 +481,20 @@ def create_config(args: argparse.Namespace, project: ProjectSettings) -> Config: if show_line_numbers is None: show_line_numbers = project.show_line_numbers_default + max_lines = args.max_lines or DEFAULT_MAX_LINES + return Config( arch=arch, # Build/objdump options diff_obj=args.diff_obj, + objfile=args.objfile, make=args.make, source_old_binutils=args.source_old_binutils, + diff_section=args.diff_section, inlines=args.inlines, - max_function_size_lines=args.max_lines, - max_function_size_bytes=args.max_lines * 4, + max_function_size_lines=max_lines, + max_function_size_bytes=max_lines * 4, + max_function_lines_overriden = args.max_lines is not None, # Display options formatter=formatter, threeway=args.threeway, @@ -488,7 +517,11 @@ def get_objdump_executable(objdump_executable: Optional[str]) -> str: if objdump_executable is not None: return objdump_executable - objdump_candidates = ["mips-linux-gnu-objdump", "mips64-elf-objdump", "mips-elf-objdump"] + objdump_candidates = [ + "mips-linux-gnu-objdump", + "mips64-elf-objdump", + "mips-elf-objdump", + ] for objdump_cand in objdump_candidates: try: subprocess.check_call( @@ -514,7 +547,7 @@ def get_arch(arch_str: str) -> "ArchSettings": raise ValueError(f"Unknown architecture: {arch_str}") -BUFFER_CMD: List[str] = ["tail", "-c", str(10 ** 9)] +BUFFER_CMD: List[str] = ["tail", "-c", str(10**9)] # -S truncates long lines instead of wrapping them # -R interprets color escape sequences @@ -636,6 +669,7 @@ class Text: class TableMetadata: headers: Tuple[Text, ...] current_score: int + max_score: int previous_score: Optional[int] @@ -804,12 +838,7 @@ class JsonFormatter(Formatter): return {"text": s, "format": f.name.lower()} elif isinstance(f, RotationFormat): attrs = asdict(f) - attrs.update( - { - "text": s, - "format": "rotation", - } - ) + attrs.update({"text": s, "format": "rotation"}) return attrs else: static_assert_unreachable(f) @@ -828,6 +857,7 @@ class JsonFormatter(Formatter): for h, name in zip(meta.headers, ("base", "current", "previous")) } output["current_score"] = meta.current_score + output["max_score"] = meta.max_score if meta.previous_score is not None: output["previous_score"] = meta.previous_score output_rows: List[Dict[str, Any]] = [] @@ -956,7 +986,7 @@ def restrict_to_function(dump: str, fn_name: str) -> str: return "" -def serialize_data_references(references: List[Tuple[int, int, str]]) -> str: +def serialize_rodata_references(references: List[Tuple[int, int, str]]) -> str: return "".join( f"DATAREF {text_offset} {from_offset} {from_section}\n" for (text_offset, from_offset, from_section) in references @@ -985,7 +1015,11 @@ def run_objdump(cmd: ObjdumpCommand, config: Config, project: ProjectSettings) - flags, target, restrict = cmd try: out = subprocess.run( - [project.objdump_executable] + config.arch.arch_flags + flags + [target], + [project.objdump_executable] + + config.arch.arch_flags + + project.objdump_flags + + flags + + [target], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -1003,11 +1037,11 @@ def run_objdump(cmd: ObjdumpCommand, config: Config, project: ProjectSettings) - with open(target, "rb") as f: obj_data = f.read() - return preprocess_objdump_out(restrict, obj_data, out) + return preprocess_objdump_out(restrict, obj_data, out, config) def preprocess_objdump_out( - restrict: Optional[str], obj_data: Optional[bytes], objdump_out: str + restrict: Optional[str], obj_data: Optional[bytes], objdump_out: str, config: Config ) -> str: """ Preprocess the output of objdump into a format that `process()` expects. @@ -1027,13 +1061,16 @@ def preprocess_objdump_out( out = out.rstrip("\n") if obj_data: - out = serialize_data_references(parse_elf_data_references(obj_data)) + out + out = ( + serialize_rodata_references(parse_elf_rodata_references(obj_data, config)) + + out + ) return out def search_map_file( - fn_name: str, project: ProjectSettings + fn_name: str, project: ProjectSettings, config: Config ) -> Tuple[Optional[str], Optional[int]]: if not project.mapfile: fail(f"No map file configured; cannot find function {fn_name}.") @@ -1053,7 +1090,7 @@ def search_map_file( cands = [] last_line = "" for line in lines: - if line.startswith(" .text"): + if line.startswith(" " + config.diff_section): cur_objfile = line.split()[3] if "load address" in line: tokens = last_line.split() + line.split() @@ -1078,9 +1115,12 @@ def search_map_file( re.compile( # ram elf rom r" \S+ \S+ (\S+) (\S+) . " - + fn_name - # object name - + r"(?: \(entry of \.(?:init|text)\))? \t(\S+)" + + re.escape(fn_name) + + r"(?: \(entry of " + + re.escape(config.diff_section) + + r"\))? \t" + # object name + + "(\S+)" ), contents, ) @@ -1115,7 +1155,9 @@ def search_map_file( return None, None -def parse_elf_data_references(data: bytes) -> List[Tuple[int, int, str]]: +def parse_elf_rodata_references( + data: bytes, config: Config +) -> List[Tuple[int, int, str]]: e_ident = data[:16] if e_ident[:4] != b"\x7FELF": return [] @@ -1128,7 +1170,6 @@ def parse_elf_data_references(data: bytes) -> List[Tuple[int, int, str]]: is_little_endian = e_ident[5] == 1 str_end = "<" if is_little_endian else ">" str_off = "I" if is_32bit else "Q" - sym_size = {"B": 1, "H": 2, "I": 4, "Q": 8} def read(spec: str, offset: int) -> Tuple[int, ...]: spec = spec.replace("P", str_off) @@ -1180,17 +1221,25 @@ def parse_elf_data_references(data: bytes) -> List[Tuple[int, int, str]]: assert len(symtab_sections) == 1 symtab = sections[symtab_sections[0]] - text_sections = [i for i in range(e_shnum) if sec_names[i] == b".text"] - assert len(text_sections) == 1 + section_name = config.diff_section.encode("utf-8") + text_sections = [ + i + for i in range(e_shnum) + if sec_names[i] == section_name and sections[i].sh_size != 0 + ] + if len(text_sections) != 1: + return [] text_section = text_sections[0] ret: List[Tuple[int, int, str]] = [] for s in sections: if s.sh_type == SHT_REL or s.sh_type == SHT_RELA: if s.sh_info == text_section: - # Skip .text -> .text references + # Skip section_name -> section_name references continue sec_name = sec_names[s.sh_info].decode("latin1") + if sec_name != ".rodata": + continue sec_base = sections[s.sh_info].sh_offset for i in range(0, s.sh_size, s.sh_entsize): if s.sh_type == SHT_REL: @@ -1247,11 +1296,16 @@ def dump_elf( f"--stop-address={end_addr}", ] + if project.disassemble_all: + disassemble_flag = "-D" + else: + disassemble_flag = "-d" + flags2 = [ f"--disassemble={diff_elf_symbol}", ] - objdump_flags = ["-drz", "-j", ".text"] + objdump_flags = [disassemble_flag, "-rz", "-j", config.diff_section] return ( project.myimg, (objdump_flags + flags1, project.baseimg, None), @@ -1273,7 +1327,10 @@ def dump_objfile( if start.startswith("0"): fail("numerical start address not supported with -o; pass a function name") - objfile, _ = search_map_file(start, project) + objfile = config.objfile + if not objfile: + objfile, _ = search_map_file(start, project, config) + if not objfile: fail("Not able to find .o file for function.") @@ -1283,11 +1340,16 @@ def dump_objfile( if not os.path.isfile(objfile): fail(f"Not able to find .o file for function: {objfile} is not a file.") - refobjfile = "ver/current/expected/" + objfile + refobjfile = "ver/us/expected/" + objfile if not os.path.isfile(refobjfile): fail(f'Please ensure an OK .o file exists at "{refobjfile}".') - objdump_flags = ["-drz", "-j", ".text"] + if project.disassemble_all: + disassemble_flag = "-D" + else: + disassemble_flag = "-d" + + objdump_flags = [disassemble_flag, "-rz", "-j", config.diff_section] return ( objfile, (objdump_flags, refobjfile, start), @@ -1304,7 +1366,7 @@ def dump_binary( run_make(project.myimg, project) start_addr = maybe_eval_int(start) if start_addr is None: - _, start_addr = search_map_file(start, project) + _, start_addr = search_map_file(start, project, config) if start_addr is None: fail("Not able to find function in map file.") if end is not None: @@ -1324,10 +1386,18 @@ def dump_binary( ) -class DifferenceNormalizer: +# Example: "ldr r4, [pc, #56] ; (4c )" +ARM32_LOAD_POOL_PATTERN = r"(ldr\s+r([0-9]|1[0-3]),\s+\[pc,.*;\s*)(\([a-fA-F0-9]+.*\))" + + +# The base class is a no-op. +class AsmProcessor: def __init__(self, config: Config) -> None: self.config = config + def process_reloc(self, row: str, prev: str) -> str: + return prev + def normalize(self, mnemonic: str, row: str) -> str: """This should be called exactly once for each line.""" arch = self.config.arch @@ -1339,8 +1409,129 @@ class DifferenceNormalizer: def _normalize_arch_specific(self, mnemonic: str, row: str) -> str: return row + def post_process(self, lines: List["Line"]) -> None: + return -class DifferenceNormalizerAArch64(DifferenceNormalizer): + +class AsmProcessorMIPS(AsmProcessor): + def process_reloc(self, row: str, prev: str) -> str: + arch = self.config.arch + if "R_MIPS_NONE" in row or "R_MIPS_JALR" in row: + # GNU as emits no-op relocations immediately after real ones when + # assembling with -mabi=64. Return without trying to parse 'imm' as an + # integer. + return prev + before, imm, after = parse_relocated_line(prev) + repl = row.split()[-1] + if imm != "0": + # MIPS uses relocations with addends embedded in the code as immediates. + # If there is an immediate, show it as part of the relocation. Ideally + # we'd show this addend in both %lo/%hi, but annoyingly objdump's output + # doesn't include enough information to pair up %lo's and %hi's... + # TODO: handle unambiguous cases where all addends for a symbol are the + # same, or show "+???". + mnemonic = prev.split()[0] + if mnemonic in arch.instructions_with_address_immediates: + imm = hex(int(imm, 16)) + repl += ("" if imm.startswith("-") else "+") + imm + if "R_MIPS_LO16" in row: + repl = f"%lo({repl})" + elif "R_MIPS_HI16" in row: + # Ideally we'd pair up R_MIPS_LO16 and R_MIPS_HI16 to generate a + # correct addend for each, but objdump doesn't give us the order of + # the relocations, so we can't find the right LO16. :( + repl = f"%hi({repl})" + elif "R_MIPS_26" in row: + # Function calls + pass + elif "R_MIPS_PC16" in row: + # Branch to glabel. This gives confusing output, but there's not much + # we can do here. + pass + elif "R_MIPS_GPREL16" in row: + repl = f"%gp_rel({repl})" + elif "R_MIPS_GOT16" in row: + repl = f"%got({repl})" + elif "R_MIPS_CALL16" in row: + repl = f"%call16({repl})" + else: + assert False, f"unknown relocation type '{row}' for line '{prev}'" + return before + repl + after + + +class AsmProcessorPPC(AsmProcessor): + def process_reloc(self, row: str, prev: str) -> str: + arch = self.config.arch + assert any( + r in row for r in ["R_PPC_REL24", "R_PPC_ADDR16", "R_PPC_EMB_SDA21"] + ), f"unknown relocation type '{row}' for line '{prev}'" + before, imm, after = parse_relocated_line(prev) + repl = row.split()[-1] + if "R_PPC_REL24" in row: + # function calls + pass + elif "R_PPC_ADDR16_HI" in row: + # absolute hi of addr + repl = f"{repl}@h" + elif "R_PPC_ADDR16_HA" in row: + # adjusted hi of addr + repl = f"{repl}@ha" + elif "R_PPC_ADDR16_LO" in row: + # lo of addr + repl = f"{repl}@l" + elif "R_PPC_ADDR16" in row: + # 16-bit absolute addr + if "+0x7" in repl: + # remove the very large addends as they are an artifact of (label-_SDA(2)_BASE_) + # computations and are unimportant in a diff setting. + if int(repl.split("+")[1], 16) > 0x70000000: + repl = repl.split("+")[0] + elif "R_PPC_EMB_SDA21" in row: + # small data area + pass + return before + repl + after + + +class AsmProcessorARM32(AsmProcessor): + def process_reloc(self, row: str, prev: str) -> str: + arch = self.config.arch + before, imm, after = parse_relocated_line(prev) + repl = row.split()[-1] + return before + repl + after + + def _normalize_arch_specific(self, mnemonic: str, row: str) -> str: + if self.config.ignore_addr_diffs: + row = self._normalize_bl(mnemonic, row) + row = self._normalize_data_pool(row) + return row + + def _normalize_bl(self, mnemonic: str, row: str) -> str: + if mnemonic != "bl": + return row + + row, _ = split_off_address(row) + return row + "" + + def _normalize_data_pool(self, row: str) -> str: + pool_match = re.search(ARM32_LOAD_POOL_PATTERN, row) + return pool_match.group(1) if pool_match else row + + def post_process(self, lines: List["Line"]) -> None: + lines_by_line_number = {} + for line in lines: + lines_by_line_number[line.line_num] = line + for line in lines: + if line.data_pool_addr is None: + continue + + # Add data symbol and its address to the line. + line_original = lines_by_line_number[line.data_pool_addr].original + value = line_original.split()[1] + addr = "{:x}".format(line.data_pool_addr) + line.original = line.normalized_original + f"={value} ({addr})" + + +class AsmProcessorAArch64(AsmProcessor): def __init__(self, config: Config) -> None: super().__init__(config) self._adrp_pair_registers: Set[str] = set() @@ -1390,23 +1581,6 @@ class DifferenceNormalizerAArch64(DifferenceNormalizer): return row -class DifferenceNormalizerARM32(DifferenceNormalizer): - def __init__(self, config: Config) -> None: - super().__init__(config) - - def _normalize_arch_specific(self, mnemonic: str, row: str) -> str: - if self.config.ignore_addr_diffs: - row = self._normalize_bl(mnemonic, row) - return row - - def _normalize_bl(self, mnemonic: str, row: str) -> str: - if mnemonic != "bl": - return row - - row, _ = split_off_address(row) - return row + "" - - @dataclass class ArchSettings: name: str @@ -1416,13 +1590,15 @@ class ArchSettings: re_sprel: Pattern[str] re_large_imm: Pattern[str] re_imm: Pattern[str] + re_reloc: Pattern[str] branch_instructions: Set[str] instructions_with_address_immediates: Set[str] forbidden: Set[str] = field(default_factory=lambda: set(string.ascii_letters + "_")) arch_flags: List[str] = field(default_factory=list) branch_likely_instructions: Set[str] = field(default_factory=set) - difference_normalizer: Type[DifferenceNormalizer] = DifferenceNormalizer + proc: Type[AsmProcessor] = AsmProcessor big_endian: Optional[bool] = True + delay_slot_instructions: Set[str] = field(default_factory=set) MIPS_BRANCH_LIKELY_INSTRUCTIONS = { @@ -1481,7 +1657,6 @@ ARM32_BRANCH_INSTRUCTIONS = { } AARCH64_BRANCH_INSTRUCTIONS = { - "bl", "b", "b.eq", "b.ne", @@ -1533,17 +1708,23 @@ PPC_BRANCH_INSTRUCTIONS = { MIPS_SETTINGS = ArchSettings( name="mips", re_int=re.compile(r"[0-9]+"), - re_comment=re.compile(r"<.*?>"), - re_reg=re.compile( - r"\$?\b(a[0-3]|t[0-9]|s[0-8]|at|v[01]|f[12]?[0-9]|f3[01]|k[01]|fp|ra|zero)\b" - ), + re_comment=re.compile(r"<.*>"), + # Includes: + # - General purpose registers v0..1, a0..7, t0..9, s0..8, zero, at, fp, k0..1/kt0..1 + # - Float registers f0..31, or fv0..1, fa0..7, ft0..15, fs0..8 plus odd complements + # (actually used number depends on ABI) + # sp, gp should not be in this list + re_reg=re.compile(r"\$?\b([astv][0-9]|at|f[astv]?[0-9]+f?|kt?[01]|fp|ra|zero)\b"), re_sprel=re.compile(r"(?<=,)([0-9]+|0x[0-9a-f]+)\(sp\)"), re_large_imm=re.compile(r"-?[1-9][0-9]{2,}|-?0x[0-9a-f]{3,}"), re_imm=re.compile(r"(\b|-)([0-9]+|0x[0-9a-fA-F]+)\b(?!\(sp)|%(lo|hi)\([^)]*\)"), + re_reloc=re.compile(r"R_MIPS_"), arch_flags=["-m", "mips:4300"], branch_likely_instructions=MIPS_BRANCH_LIKELY_INSTRUCTIONS, branch_instructions=MIPS_BRANCH_INSTRUCTIONS, instructions_with_address_immediates=MIPS_BRANCH_INSTRUCTIONS.union({"jal", "j"}), + delay_slot_instructions=MIPS_BRANCH_INSTRUCTIONS.union({"j", "jal", "jr", "jalr"}), + proc=AsmProcessorMIPS, ) MIPSEL_SETTINGS = replace(MIPS_SETTINGS, name="mipsel", big_endian=False) @@ -1551,7 +1732,7 @@ MIPSEL_SETTINGS = replace(MIPS_SETTINGS, name="mipsel", big_endian=False) ARM32_SETTINGS = ArchSettings( name="arm32", re_int=re.compile(r"[0-9]+"), - re_comment=re.compile(r"(<.*?>|//.*$)"), + re_comment=re.compile(r"(<.*>|//.*$)"), # Includes: # - General purpose registers: r0..13 # - Frame pointer registers: lr (r14), pc (r15) @@ -1563,42 +1744,54 @@ ARM32_SETTINGS = ArchSettings( re_sprel=re.compile(r"sp, #-?(0x[0-9a-fA-F]+|[0-9]+)\b"), re_large_imm=re.compile(r"-?[1-9][0-9]{2,}|-?0x[0-9a-f]{3,}"), re_imm=re.compile(r"(?|//.*$)"), - # GPRs and FP registers: X0-X30, W0-W30, [DSHQ]0..31 + re_comment=re.compile(r"(<.*>|//.*$)"), + # GPRs and FP registers: X0-X30, W0-W30, [BHSDVQ]0..31 + # (FP registers may be followed by data width and number of elements, e.g. V0.4S) # The zero registers and SP should not be in this list. - re_reg=re.compile(r"\$?\b([dshq][12]?[0-9]|[dshq]3[01]|[xw][12]?[0-9]|[xw]30)\b"), + re_reg=re.compile( + r"\$?\b([bhsdvq]([12]?[0-9]|3[01])(\.\d\d?[bhsdvq])?|[xw][12]?[0-9]|[xw]30)\b" + ), re_sprel=re.compile(r"sp, #-?(0x[0-9a-fA-F]+|[0-9]+)\b"), re_large_imm=re.compile(r"-?[1-9][0-9]{2,}|-?0x[0-9a-f]{3,}"), re_imm=re.compile(r"(?|//.*$)"), + re_comment=re.compile(r"(<.*>|//.*$)"), re_reg=re.compile(r"\$?\b([rf][0-9]+)\b"), re_sprel=re.compile(r"(?<=,)(-?[0-9]+|-?0x[0-9a-f]+)\(r1\)"), re_large_imm=re.compile(r"-?[1-9][0-9]{2,}|-?0x[0-9a-f]{3,}"), re_imm=re.compile(r"(\b|-)([0-9]+|0x[0-9a-fA-F]+)\b(?!\(r1)|[^@]*@(ha|h|lo)"), + re_reloc=re.compile(r"R_PPC_"), branch_instructions=PPC_BRANCH_INSTRUCTIONS, instructions_with_address_immediates=PPC_BRANCH_INSTRUCTIONS.union({"bl"}), + proc=AsmProcessorPPC, ) ARCH_SETTINGS = [ MIPS_SETTINGS, MIPSEL_SETTINGS, ARM32_SETTINGS, + ARMEL_SETTINGS, AARCH64_SETTINGS, PPC_SETTINGS, ] @@ -1618,6 +1811,7 @@ def hexify_int(row: str, pat: Match[str], arch: ArchSettings) -> str: def parse_relocated_line(line: str) -> Tuple[str, str, str]: + # Pick out the last argument for c in ",\t ": if c in line: ind2 = line.rindex(c) @@ -1626,6 +1820,7 @@ def parse_relocated_line(line: str) -> Tuple[str, str, str]: raise Exception(f"failed to parse relocated line: {line}") before = line[: ind2 + 1] after = line[ind2 + 1 :] + # Move an optional ($reg) part of it to 'after' ind2 = after.find("(") if ind2 == -1: imm, after = after, "" @@ -1636,79 +1831,6 @@ def parse_relocated_line(line: str) -> Tuple[str, str, str]: return before, imm, after -def process_mips_reloc(row: str, prev: str, arch: ArchSettings) -> str: - before, imm, after = parse_relocated_line(prev) - repl = row.split()[-1] - if imm != "0": - # MIPS uses relocations with addends embedded in the code as immediates. - # If there is an immediate, show it as part of the relocation. Ideally - # we'd show this addend in both %lo/%hi, but annoyingly objdump's output - # doesn't include enough information to pair up %lo's and %hi's... - # TODO: handle unambiguous cases where all addends for a symbol are the - # same, or show "+???". - mnemonic = prev.split()[0] - if ( - mnemonic in arch.instructions_with_address_immediates - and not imm.startswith("0x") - ): - imm = "0x" + imm - repl += "+" + imm if int(imm, 0) > 0 else imm - if "R_MIPS_LO16" in row: - repl = f"%lo({repl})" - elif "R_MIPS_HI16" in row: - # Ideally we'd pair up R_MIPS_LO16 and R_MIPS_HI16 to generate a - # correct addend for each, but objdump doesn't give us the order of - # the relocations, so we can't find the right LO16. :( - repl = f"%hi({repl})" - elif "R_MIPS_26" in row: - # Function calls - pass - elif "R_MIPS_PC16" in row: - # Branch to glabel. This gives confusing output, but there's not much - # we can do here. - pass - else: - assert False, f"unknown relocation type '{row}' for line '{prev}'" - return before + repl + after - - -def process_ppc_reloc(row: str, prev: str) -> str: - assert any( - r in row for r in ["R_PPC_REL24", "R_PPC_ADDR16", "R_PPC_EMB_SDA21"] - ), f"unknown relocation type '{row}' for line '{prev}'" - before, imm, after = parse_relocated_line(prev) - repl = row.split()[-1] - if "R_PPC_REL24" in row: - # function calls - pass - elif "R_PPC_ADDR16_HI" in row: - # absolute hi of addr - repl = f"{repl}@h" - elif "R_PPC_ADDR16_HA" in row: - # adjusted hi of addr - repl = f"{repl}@ha" - elif "R_PPC_ADDR16_LO" in row: - # lo of addr - repl = f"{repl}@l" - elif "R_PPC_ADDR16" in row: - # 16-bit absolute addr - if "+0x7" in repl: - # remove the very large addends as they are an artifact of (label-_SDA(2)_BASE_) - # computations and are unimportant in a diff setting. - if int(repl.split("+")[1], 16) > 0x70000000: - repl = repl.split("+")[0] - elif "R_PPC_EMB_SDA21" in row: - # small data area - pass - return before + repl + after - - -def process_arm_reloc(row: str, prev: str, arch: ArchSettings) -> str: - before, imm, after = parse_relocated_line(prev) - repl = row.split()[-1] - return before + repl + after - - def pad_mnemonic(line: str) -> str: if "\t" not in line: return line @@ -1725,6 +1847,7 @@ class Line: scorable_line: str line_num: Optional[int] = None branch_target: Optional[int] = None + data_pool_addr: Optional[int] = None source_filename: Optional[str] = None source_line_num: Optional[int] = None source_lines: List[str] = field(default_factory=list) @@ -1733,7 +1856,7 @@ class Line: def process(dump: str, config: Config) -> List[Line]: arch = config.arch - normalizer = arch.difference_normalizer(config) + processor = arch.proc(config) skip_next = False source_lines = [] source_filename = None @@ -1775,7 +1898,7 @@ def process(dump: str, config: Config) -> List[Line]: ) break - if not re.match(r"^ +[0-9a-f]+:\t", row): + if not re.match(r"^\s+[0-9a-f]+:\s+", row): # This regex is conservative, and assumes the file path does not contain "weird" # characters like colons, tabs, or angle brackets. if re.match( @@ -1786,13 +1909,22 @@ def process(dump: str, config: Config) -> List[Line]: source_lines.append(row) continue + # If the instructions loads a data pool symbol, extract the address of + # the symbol. + data_pool_addr = None + pool_match = re.search(ARM32_LOAD_POOL_PATTERN, row) + if pool_match: + offset = pool_match.group(3).split(" ")[0][1:] + data_pool_addr = int(offset, 16) + m_comment = re.search(arch.re_comment, row) comment = m_comment[0] if m_comment else None row = re.sub(arch.re_comment, "", row) + line_num_str = row.split(":")[0] row = row.rstrip() tabs = row.split("\t") row = "\t".join(tabs[2:]) - line_num = eval_line_num(tabs[0].strip()) + line_num = eval_line_num(line_num_str.strip()) if line_num in data_refs: refs = data_refs[line_num] @@ -1817,8 +1949,15 @@ def process(dump: str, config: Config) -> List[Line]: row_parts = [part.lstrip() for part in row.split(" ", 1)] mnemonic = row_parts[0].strip() - if mnemonic not in arch.instructions_with_address_immediates: - row = re.sub(arch.re_int, lambda m: hexify_int(row, m, arch), row) + addr = "" + if mnemonic in arch.instructions_with_address_immediates: + row, addr = split_off_address(row) + # objdump prefixes addresses with 0x/-0x if they don't resolve to some + # symbol + offset. Strip that. + addr = addr.replace("0x", "") + + row = re.sub(arch.re_int, lambda m: hexify_int(row, m, arch), row) + row += addr # Let 'original' be 'row' with relocations applied, while we continue # transforming 'row' into a coarser version that ignores registers and @@ -1827,27 +1966,17 @@ def process(dump: str, config: Config) -> List[Line]: while i < len(lines): reloc_row = lines[i] - if "R_AARCH64_" in reloc_row: - # TODO: handle relocation - pass - elif "R_MIPS_" in reloc_row: - original = process_mips_reloc(reloc_row, original, arch) - elif "R_PPC_" in reloc_row: - original = process_ppc_reloc(reloc_row, original) - elif "R_ARM_" in reloc_row: - original = process_arm_reloc(reloc_row, original, arch) + if re.search(arch.re_reloc, reloc_row): + original = processor.process_reloc(reloc_row, original) else: break i += 1 - normalized_original = normalizer.normalize(mnemonic, original) + normalized_original = processor.normalize(mnemonic, original) scorable_line = normalized_original if not config.score_stack_differences: scorable_line = re.sub(arch.re_sprel, "addr(sp)", scorable_line) - if mnemonic in arch.branch_instructions: - # Replace the final argument with "" - scorable_line = re.sub(r"[^, \t]+$", "", scorable_line) if skip_next: skip_next = False @@ -1870,8 +1999,6 @@ def process(dump: str, config: Config) -> List[Line]: branch_target = None if mnemonic in arch.branch_instructions: branch_target = int(row_parts[1].strip().split(",")[-1], 16) - if mnemonic in arch.branch_likely_instructions: - branch_target -= 4 output.append( Line( @@ -1882,6 +2009,7 @@ def process(dump: str, config: Config) -> List[Line]: scorable_line=scorable_line, line_num=line_num, branch_target=branch_target, + data_pool_addr=data_pool_addr, source_filename=source_filename, source_line_num=source_line_num, source_lines=source_lines, @@ -1896,6 +2024,7 @@ def process(dump: str, config: Config) -> List[Line]: elif stop_after_delay_slot: break + processor.post_process(output) return output @@ -1917,7 +2046,9 @@ def split_off_address(line: str) -> Tuple[str, str]: parts = line.split(",") if len(parts) < 2: parts = line.split(None, 1) - off = len(line) - len(parts[-1]) + if len(parts) < 2: + parts.append("") + off = len(line) - len(parts[-1].strip()) return line[:off], line[off:] @@ -1933,7 +2064,7 @@ def diff_sequences( ) -> List[Tuple[str, int, int, int, int]]: if ( algorithm != "levenshtein" - or len(seq1) * len(seq2) > 4 * 10 ** 8 + or len(seq1) * len(seq2) > 4 * 10**8 or len(seq1) + len(seq2) >= 0x110000 ): return diff_sequences_difflib(seq1, seq2) @@ -2057,6 +2188,10 @@ def score_diff_lines( def diff_delete(line: str) -> None: deletions.append(line) + + # if config.max_function_lines_overriden: + # max_index = min(config.max_function_size_lines, len(lines)) + # else: # Find the end of the last long streak of matching mnemonics, if it looks # like the objdump output was truncated. This is used to skip scoring # misaligned lines at the end of the diff. @@ -2115,6 +2250,18 @@ class OutputLine: class Diff: lines: List[OutputLine] score: int + max_score: int + + +def trim_nops(lines: List[Line], arch: ArchSettings) -> List[Line]: + lines = lines[:] + while ( + lines + and lines[-1].mnemonic == "nop" + and (len(lines) == 1 or lines[-2].mnemonic not in arch.delay_slot_instructions) + ): + lines.pop() + return lines def do_diff(lines1: List[Line], lines2: List[Line], config: Config) -> Diff: @@ -2144,8 +2291,11 @@ def do_diff(lines1: List[Line], lines2: List[Line], config: Config) -> Diff: btset.add(bt) sc(str(bt)) + lines1 = trim_nops(lines1, arch) + lines2 = trim_nops(lines2, arch) + diffed_lines = diff_lines(lines1, lines2, config.algorithm) - score = score_diff_lines(diffed_lines, config) + max_score = len(lines1) * config.penalty_deletion line_num_base = -1 line_num_offset = 0 @@ -2213,10 +2363,15 @@ def do_diff(lines1: List[Line], lines2: List[Line], config: Config) -> Diff: line2_line = line_num_2to1[line2.line_num] line2_target = (line2_line[0] + (target - line2.line_num), 0) - # Set the key for three-way diffing to a normalized version. + # Adjust the branch target for scoring and three-way diffing. norm2, norm_branch2 = split_off_address(line2.normalized_original) - if norm_branch2 != "": - line2.normalized_original = norm2 + str(line2_target) + if norm_branch2 != "": + retargetted = hex(line2_target[0]).replace("0x", "") + if line2_target[1] != 0: + retargetted += f"+{line2_target[1]}" + line2.normalized_original = norm2 + retargetted + sc_base, _ = split_off_address(line2.scorable_line) + line2.scorable_line = sc_base + retargetted same_target = line2_target == (line1.branch_target, 0) else: # Do a naive comparison for non-branches (e.g. function calls). @@ -2376,7 +2531,9 @@ def do_diff(lines1: List[Line], lines2: List[Line], config: Config) -> Diff: ) ) - return Diff(lines=output, score=score) + score = score_diff_lines(diffed_lines, config) + output = output[config.skip_lines :] + return Diff(lines=output, score=score, max_score=max_score) def chunk_diff_lines( @@ -2452,13 +2609,14 @@ def align_diffs( Text(f"{padding}PREVIOUS ({old_diff.score})"), ), current_score=new_diff.score, + max_score=new_diff.max_score, previous_score=old_diff.score, ) old_chunks = chunk_diff_lines(old_diff.lines) new_chunks = chunk_diff_lines(new_diff.lines) diff_lines = [] empty = OutputLine(Text(), Text(), None, True, False, None, None) - assert len(old_chunks) == len(new_chunks), "same target" + #assert len(old_chunks) == len(new_chunks), "same target" for old_chunk, new_chunk in zip(old_chunks, new_chunks): if isinstance(old_chunk, list): assert isinstance(new_chunk, list) @@ -2495,6 +2653,7 @@ def align_diffs( Text(f"{padding}CURRENT ({new_diff.score})"), ), current_score=new_diff.score, + max_score=new_diff.max_score, previous_score=None, ) diff_lines = [(line, line) for line in new_diff.lines] @@ -2609,10 +2768,9 @@ class Display: self.last_diff_output = diff_output meta, diff_lines = align_diffs(last_diff_output, diff_output, self.config) - diff_lines = diff_lines[self.config.skip_lines :] output = self.config.formatter.table(meta, diff_lines) refresh_key = ( - [[col.key2 for col in x[1:]] for x in diff_lines], + [line.key2 for line in diff_output.lines], diff_output.score, ) return (output, refresh_key) diff --git a/include/common_structs.h b/include/common_structs.h index 417290dbe9..c0e46dd307 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -1214,7 +1214,8 @@ typedef struct ItemEntity { /* 0x2E */ u8 unkCounter; /* 0x2F */ s8 unk_2F; /* 0x30 */ f32 scale; - /* 0x34 */ char unk_34[8]; + /* 0x34 */ Vec3s unk_34; + /* 0x3A */ char unk_3A[2]; /* 0x3C */ s32 framesLeft; /* 0x40 */ s32* currentState; /* 0x44 */ s32 unk_44; @@ -1805,7 +1806,8 @@ typedef struct Encounter { } Encounter; // size = 0x5C typedef struct PlayerPathElement { - /* 0x00 */ char unk_00[4]; + /* 0x00 */ s8 isJumping; + /* 0x03 */ char unk_01[3]; /* 0x04 */ Vec3f pos; } PlayerPathElement; // size = 0x10 @@ -2422,20 +2424,21 @@ typedef struct PopupMessage { /* 0x18 */ Message* message; } PopupMessage; // size = 0x1C -typedef struct struct8015A578 { +typedef struct Struct8015A578 { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 unk_01; /* 0x02 */ u8 unk_02; /* 0x03 */ u8 unk_03[5]; /* 0x08 */ f32 unk_08; -} struct8015A578; // size = 0x0C + /* 0x0C */ char unk_0C[0x4]; +} Struct8015A578; // size = 0x10 typedef struct SaveMetadata { /* 0x00 */ s32 timePlayed; /* 0x04 */ u8 spiritsRescued; /* 0x05 */ char unk_05[0x1]; /* 0x06 */ s8 level; - /* 0x07 */ char filename[8]; + /* 0x07 */ unsigned char filename[8]; /* 0x0F */ char unk_0F[0x1]; /* 0x10 */ s32 unk_10; /* 0x14 */ s32 unk_14; diff --git a/include/effects.h b/include/effects.h index 2d78760807..4a69a4ec36 100644 --- a/include/effects.h +++ b/include/effects.h @@ -813,7 +813,7 @@ EffectInstance* fx_windy_leaves(s32, f32, f32, f32); EffectInstance* fx_falling_leaves(s32, f32, f32, f32); void fx_stars_spread(s32, f32, f32, f32, s32, s32); void fx_steam_burst(s32, f32, f32, f32, f32, s32); -void fx_stars_orbiting(s32, f32, f32, f32, f32, s32, s32*); +void fx_stars_orbiting(s32, f32, f32, f32, f32, s32, EffectInstance**); void fx_big_snowflakes(s32, f32, f32, f32); EffectInstance* fx_debuff(s32, f32, f32, f32); void fx_green_impact(s32, f32, f32, f32, f32); @@ -825,7 +825,7 @@ EffectInstance* fx_fire_breath(s32, f32, f32, f32, f32, f32, f32, s32, s32, s32) EffectInstance* fx_shimmer_burst(s32, f32, f32, f32, f32, s32); EffectInstance* fx_energy_shockwave(s32, f32, f32, f32, f32, s32); EffectInstance* fx_shimmer_wave(s32, f32, f32, f32, f32, f32, s32, s32); -void fx_aura(s32, f32, f32, f32, f32, s32*); +void fx_aura(s32, f32, f32, f32, f32, EffectInstance**); EffectInstance* fx_3C(s32, f32, f32, f32, f32, s32*); void fx_3D(s32, f32, f32, f32, f32, f32, f32, s32, s32*); EffectInstance* fx_blast(s32, f32, f32, f32, f32, s32); diff --git a/include/enums.h b/include/enums.h index 48442c339c..a4ed41a956 100644 --- a/include/enums.h +++ b/include/enums.h @@ -510,6 +510,7 @@ enum SoundIDs { SOUND_D4 = 0x000000D4, SOUND_D5 = 0x000000D5, SOUND_D6 = 0x000000D6, + SOUND_DC = 0x000000DC, SOUND_HIT_PLAYER_NORMAL = 0x000000E1, SOUND_HIT_PLAYER_FIRE = 0x000000E2, SOUND_HIT_PLAYER_ICE = 0x000000E3, @@ -517,6 +518,7 @@ enum SoundIDs { SOUND_HIT_NORMAL = 0x000000E9, SOUND_HIT_FIRE = 0x000000EA, SOUND_HIT_ICE = 0x000000EB, + SOUND_F1 = 0x000000F1, SOUND_108 = 0x00000108, SOUND_IMMUNE = 0x0000010C, SOUND_HIT_BONES = 0x0000010D, @@ -527,6 +529,7 @@ enum SoundIDs { SOUND_LAND = 0x0000014B, SOUND_HIT_BLOCK = 0x0000014E, SOUND_SEARCH_BUSH = 0x00000153, + SOUND_158 = 0x00000158, SOUND_162 = 0x00000162, SOUND_ENTER_PIPE = 0x00000163, SOUND_SMASH_GOOMNUT_TREE = 0x00000165, @@ -587,6 +590,7 @@ enum SoundIDs { SOUND_367 = 0x00000367, SOUND_368 = 0x00000368, SOUND_369 = 0x00000369, + SOUND_372 = 0x00000372, SOUND_375 = 0x00000375, SOUND_376 = 0x00000376, SOUND_377 = 0x00000377, @@ -621,6 +625,9 @@ enum SoundIDs { SOUND_INFLICT_STATUS = 0x00002032, //< Stop, poison, paralyze SOUND_2038 = 0x00002038, SOUND_2039 = 0x00002039, + SOUND_205B = 0x0000205B, + SOUND_2072 = 0x00002072, + SOUND_2073 = 0x00002073, SOUND_BOMB_BLAST = 0x00002076, SOUND_JUMP_2081 = 0x00002081, SOUND_JUMP_8BIT_MARIO = 0x00002082, @@ -644,6 +651,12 @@ enum SoundIDs { SOUND_2112 = 0x00002112, SOUND_2113 = 0x00002113, SOUND_2114 = 0x00002114, + SOUND_2115 = 0x00002115, + SOUND_2116 = 0x00002116, + SOUND_2117 = 0x00002117, + SOUND_2118 = 0x00002118, + SOUND_2119 = 0x00002119, + SOUND_211A = 0x0000211A, }; enum Cams { diff --git a/include/filemenu.h b/include/filemenu.h index 976f12c705..bd6f963f3e 100644 --- a/include/filemenu.h +++ b/include/filemenu.h @@ -32,7 +32,9 @@ WINDOW_UPDATE_FUNC(filemenu_update_show_name_input); WINDOW_UPDATE_FUNC(filemenu_update_show_options_left); WINDOW_UPDATE_FUNC(filemenu_update_show_options_right); WINDOW_UPDATE_FUNC(filemenu_update_show_options_bottom); +WINDOW_UPDATE_FUNC(filemenu_update_show_with_rotation); +WINDOW_UPDATE_FUNC(filemenu_update_hidden_name_input); WINDOW_UPDATE_FUNC(filemenu_update_hidden_options_left); WINDOW_UPDATE_FUNC(filemenu_update_hidden_options_right); WINDOW_UPDATE_FUNC(filemenu_update_hidden_title); @@ -40,8 +42,10 @@ WINDOW_UPDATE_FUNC(filemenu_update_hidden_options_bottom); WINDOW_UPDATE_FUNC(filemenu_update_hidden_with_rotation); WINDOW_UPDATE_FUNC(filemenu_update_select_file); +WINDOW_UPDATE_FUNC(filemenu_update_deselect_file); WINDOW_UPDATE_FUNC(filemenu_update_show_name_confirm); +WINDOW_UPDATE_FUNC(filemenu_update_hidden_name_confirm); WINDOW_UPDATE_FUNC(main_menu_window_update); diff --git a/include/functions.h b/include/functions.h index ce0414a874..e3dc7aaba6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -30,6 +30,7 @@ u32 _heap_free(HeapNode* heapNodeList, void* addrToFree); void* _heap_realloc(HeapNode* heapNodeList, void* addr, u32 newSize); HeapNode* _heap_create(HeapNode* addr, u32 size); s32 dma_copy(Addr romStart, Addr romEnd, void* vramDest); +f32 rand_float(void); void copy_matrix(Matrix4f src, Matrix4f dest); s32 _Printf(PrintCallback pfn, char* arg, const char* fmt, va_list ap); @@ -58,6 +59,8 @@ s32 create_entity(EntityBlueprint*, s32, s32, s32, s32, ...); void entity_shattering_idle(Entity* entity); void func_802666E4(Actor* actor, f32 x, f32 y, f32 z, s32 damage); +s32 entity_raycast_down(f32*, f32*, f32*, f32*, f32*, f32*); + void step_game_loop(void); s32 resume_all_group(s32 groupFlags); f32 length2D(f32 x, f32 y); @@ -383,6 +386,7 @@ PlayerData* get_player_data(void); s32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32); s32 npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*); +s32 npc_raycast_up(s32, f32*, f32*, f32*, f32*); s32 player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32); s32 player_raycast_below_cam_relative(PlayerStatus*, f32*, f32*, f32*, f32*, f32*, f32*, f32*, f32*); s32 npc_test_move_taller_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32); @@ -410,6 +414,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 initialState, u8 g f32 get_player_normal_yaw(void); void set_standard_shadow_scale(Shadow* shadow, f32 scale); void set_peach_shadow_scale(Shadow* shadow, f32 scale); +s32 is_block_on_ground(Entity* block); void set_animation(s32 actorID, s32, s32 animationIndex); void set_animation_rate(s32 actorID, s32 partIndex, f32 rate); void func_8011B7C0(u16, s32, s32); @@ -510,6 +515,7 @@ Evt* get_script_by_index(s32 index); s32 get_lava_reset_pos(f32* x, f32* y, f32* z); void start_rumble(s32, s32); +void update_locomotion_state(void); void start_rumble_type(u32); void start_falling(void); @@ -903,9 +909,9 @@ void clear_trigger_data(void); void clear_script_list(void); void clear_entity_data(s32); void clear_effect_data(void); -void clear_area_flags(void); -void update_locomotion_state(void); +void clear_saved_variables(void); +void clear_area_flags(void); void func_802BFB44_323694(f32 arg0); f32 get_player_normal_pitch(void); diff --git a/include/npc.h b/include/npc.h index eb46abe885..e76f0d79df 100644 --- a/include/npc.h +++ b/include/npc.h @@ -452,19 +452,19 @@ void func_8003D3BC(Npc* npc); void func_8003D624(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6); -void func_8003D660(Npc* npc, s32 arg1); +void func_8003D660(Npc* npc, s32); -void func_8003D788(Npc* npc, s32 arg1); +void func_8003D788(Npc* npc, s32); -void func_8003DA38(Npc* npc, s32 arg1); +void func_8003DA38(Npc* npc, s32); -s32 func_8003DC38(void); +s32 func_8003DC38(Npc*, s32); -void func_8003DFA0(Npc* npc); +void func_8003DFA0(Npc* npc, s32); -void func_8003E0D4(Npc* npc); +void func_8003E0D4(Npc* npc, s32); -void func_8003E1D0(Npc* npc); +void func_8003E1D0(Npc* npc, s32); /// Duplicate of set_defeated(). void COPY_set_defeated(s32 mapID, s32 encounterID); diff --git a/include/variables.h b/include/variables.h index 6532a1a009..f109084ab6 100644 --- a/include/variables.h +++ b/include/variables.h @@ -90,6 +90,7 @@ extern s16 D_8010CD10; extern s16 D_8010CD12; extern s32 D_8010CD20; extern s32 D_801595A0; +extern Struct8015A578 D_8015A578; extern BackgroundHeader gBackgroundImage; diff --git a/src/163400.c b/src/163400.c index e675f9c059..fc0b5b89fd 100644 --- a/src/163400.c +++ b/src/163400.c @@ -183,10 +183,9 @@ void filemenu_update_cursor(void) { filemenu_cursorGoalAlpha2 = 0xFF; } -// problem with second loop declaration -#ifdef NON_MATCHING void filemenu_update(void) { MenuPanel* menu = filemenu_menus[filemenu_8024C098]; + MenuPanel** menuIt; s32 i; for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) { @@ -218,18 +217,15 @@ void filemenu_update(void) { } } - for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) { - menu = filemenu_menus[i]; - if (menu->initialized) { - if (menu->fpUpdate != NULL) { - menu->fpUpdate(menu); - } + // TODO clean up bad match + menuIt = &filemenu_menus; + for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++, menuIt++) { + menu = *menuIt; + if (menu->initialized && menu->fpUpdate != NULL) { + menu->fpUpdate(menu); } } } -#else -INCLUDE_ASM(s32, "163400", filemenu_update); -#endif void func_8024330C( s32 windowIdx, @@ -708,8 +704,8 @@ void filemenu_cleanup(void) { set_window_update(i, WINDOW_UPDATE_HIDE); } - set_window_update(0x18, WINDOW_UPDATE_HIDE); - set_window_update(0x17, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_PAUSE_TUTORIAL, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_PAUSE_DECRIPTION, WINDOW_UPDATE_HIDE); func_80244BC4(); } diff --git a/src/165490.c b/src/165490.c index b4cc088c8d..89c140d287 100644 --- a/src/165490.c +++ b/src/165490.c @@ -353,10 +353,10 @@ void filemenu_main_init(MenuPanel* menu) { *posXPtr = x; if (menu->page != 0) { - set_window_update(0x35, WINDOW_UPDATE_HIDE); - set_window_update(0x37, WINDOW_UPDATE_HIDE); - set_window_update(0x33, WINDOW_UPDATE_HIDE); - set_window_update(0x34, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_53, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_55, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_51, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_52, WINDOW_UPDATE_HIDE); } menu->initialized = 1; } @@ -495,19 +495,19 @@ void filemenu_main_handle_input(MenuPanel* menu) { filemenu_8024C110[i] = 0xF7; } D_8024C090 = 0; - set_window_update(0x30, filemenu_update_show_name_input); - set_window_update(0x31, filemenu_update_show_name_input); - set_window_update(0x2D, filemenu_update_hidden_with_rotation); - set_window_update(0x33, filemenu_update_hidden_with_rotation); - set_window_update(0x34, filemenu_update_hidden_with_rotation); - set_window_update(0x35, filemenu_update_hidden_with_rotation); - set_window_update(0x36, filemenu_update_hidden_with_rotation); - set_window_update(0x37, filemenu_update_hidden_with_rotation); - set_window_update(0x35, filemenu_update_hidden_with_rotation); - set_window_update(0x38, filemenu_update_hidden_with_rotation); - set_window_update(0x39, filemenu_update_hidden_with_rotation); - set_window_update(0x3A, filemenu_update_hidden_with_rotation); - set_window_update(0x3B, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_48, filemenu_update_show_name_input); + set_window_update(WINDOW_ID_49, filemenu_update_show_name_input); + set_window_update(WINDOW_ID_45, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_54, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_56, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_57, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_58, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_59, filemenu_update_hidden_with_rotation); sfx_play_sound(SOUND_MENU_NEXT); filemenu_8024C098 = 3; temp_a0 = filemenu_menus[filemenu_8024C098]; @@ -517,50 +517,50 @@ void filemenu_main_handle_input(MenuPanel* menu) { } if (menu->selected == 6) { - set_window_update(0x33, filemenu_update_hidden_options_left); - set_window_update(0x34, filemenu_update_hidden_options_right); - set_window_update(0x35, filemenu_update_hidden_options_bottom); - set_window_update(0x36, filemenu_update_hidden_options_bottom); - set_window_update(0x37, filemenu_update_hidden_options_bottom); - set_window_update(0x38, filemenu_update_hidden_options_left); - set_window_update(0x39, filemenu_update_hidden_options_right); - set_window_update(0x3A, filemenu_update_hidden_options_left); - set_window_update(0x3B, filemenu_update_hidden_options_right); - set_window_update(0x2D, filemenu_update_hidden_title); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_54, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_56, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_57, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_58, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_59, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_45, filemenu_update_hidden_title); sfx_play_sound(SOUND_D6); set_game_mode(0xF); } else if (menu->selected == 4) { sfx_play_sound(SOUND_MENU_NEXT); menu->page = 1; filemenu_set_selected(menu, 1, 2); - set_window_update(0x33, filemenu_update_hidden_options_left); - set_window_update(0x34, filemenu_update_hidden_options_right); - set_window_update(0x35, filemenu_update_hidden_options_bottom); - set_window_update(0x37, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_options_bottom); } else if (menu->selected == 5) { sfx_play_sound(SOUND_MENU_NEXT); menu->page = 3; filemenu_set_selected(menu, 1, 2); - set_window_update(0x33, filemenu_update_hidden_options_left); - set_window_update(0x34, filemenu_update_hidden_options_right); - set_window_update(0x35, filemenu_update_hidden_options_bottom); - set_window_update(0x37, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_options_bottom); } else if (menu->selected < 4) { sfx_play_sound(SOUND_MENU_NEXT); - set_window_update(0x2D, filemenu_update_hidden_with_rotation); - set_window_update(0x33, filemenu_update_hidden_with_rotation); - set_window_update(0x34, filemenu_update_hidden_with_rotation); - set_window_update(0x35, filemenu_update_hidden_with_rotation); - set_window_update(0x36, filemenu_update_hidden_with_rotation); - set_window_update(0x37, filemenu_update_hidden_with_rotation); - set_window_update(0x35, filemenu_update_hidden_with_rotation); - set_window_update(0x38, filemenu_update_hidden_with_rotation); - set_window_update(0x39, filemenu_update_hidden_with_rotation); - set_window_update(0x3A, filemenu_update_hidden_with_rotation); - set_window_update(0x3B, filemenu_update_hidden_with_rotation); - set_window_update(menu->selected + 56, filemenu_update_select_file); + set_window_update(WINDOW_ID_45, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_54, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_56, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_57, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_58, filemenu_update_hidden_with_rotation); + set_window_update(WINDOW_ID_59, filemenu_update_hidden_with_rotation); + set_window_update(menu->selected + WINDOW_ID_56, filemenu_update_select_file); sfx_play_sound(SOUND_MENU_NEXT); - set_window_update(0x32, 1); + set_window_update(WINDOW_ID_50, WINDOW_UPDATE_SHOW); gWindows[50].pos.y = 143; gWindows[50].width = 69; gWindows[50].height = 44; @@ -581,15 +581,15 @@ void filemenu_main_handle_input(MenuPanel* menu) { if (menu->selected == 6) { sfx_play_sound(SOUND_MENU_NEXT); menu->page = 0; - set_window_update(0x33, filemenu_update_show_options_left); - set_window_update(0x34, filemenu_update_show_options_right); - set_window_update(0x35, filemenu_update_show_options_bottom); - set_window_update(0x37, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_show_options_bottom); filemenu_set_selected(menu, 0, 2); } else if (menu->selected < 4) { if (gSaveSlotHasData[menu->selected] != 0) { sfx_play_sound(SOUND_MENU_NEXT); - set_window_update(0x32, filemenu_update_show_name_confirm); + set_window_update(WINDOW_ID_50, filemenu_update_show_name_confirm); gWindows[50].pos.y = 121; gWindows[50].width = 69; gWindows[50].height = 44; @@ -613,10 +613,10 @@ void filemenu_main_handle_input(MenuPanel* menu) { if (menu->selected == 6) { sfx_play_sound(SOUND_MENU_NEXT); menu->page = 0; - set_window_update(0x33, filemenu_update_show_options_left); - set_window_update(0x34, filemenu_update_show_options_right); - set_window_update(0x35, filemenu_update_show_options_bottom); - set_window_update(0x37, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_show_options_bottom); filemenu_set_selected(menu, 0, 1); } else if (menu->selected < 4) { if (gSaveSlotHasData[menu->selected] != 0) { @@ -649,15 +649,15 @@ void filemenu_main_handle_input(MenuPanel* menu) { gWindows[47].pos.y = ((gWindows[47].parent != -1) ? (gWindows[gWindows[47].parent].height / 2) : 240 / 2) - gWindows[47].height / 2; - set_window_update(0x2F, 1); - set_window_update(0x32, 2); + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE); fio_load_game(filemenu_loadedFileIdx); gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx]; fio_save_game(filemenu_iterFileIdx); gSaveSlotHasData[filemenu_iterFileIdx] = 1; } else { sfx_play_sound(SOUND_MENU_NEXT); - set_window_update(0x32, filemenu_update_show_name_confirm); + set_window_update(WINDOW_ID_50, filemenu_update_show_name_confirm); gWindows[50].pos.y = 121; gWindows[50].width = 69; @@ -686,14 +686,14 @@ void filemenu_main_handle_input(MenuPanel* menu) { sfx_play_sound(SOUND_MENU_NEXT); filemenu_8024C098 = 2; filemenu_menus[filemenu_8024C098]->page = 1; - set_window_update(0x2C, main_menu_window_update); - set_window_update(0x2F, 1); - set_window_update(0x32, 2); + set_window_update(WINDOW_ID_PAUSE_CURSOR, main_menu_window_update); + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE); fio_save_game(menu->selected); gSaveSlotHasData[menu->selected] = 1; } else { sfx_play_sound(SOUND_MENU_NEXT); - set_window_update(0x32, filemenu_update_show_name_confirm); + set_window_update(WINDOW_ID_50, filemenu_update_show_name_confirm); gWindows[50].pos.y = 127; gWindows[50].width = 69; gWindows[50].height = 44; @@ -735,35 +735,35 @@ void filemenu_main_handle_input(MenuPanel* menu) { switch (menu->page) { case 0: - set_window_update(0x33, filemenu_update_hidden_options_left); - set_window_update(0x34, filemenu_update_hidden_options_right); - set_window_update(0x35, filemenu_update_hidden_options_bottom); - set_window_update(0x36, filemenu_update_hidden_options_bottom); - set_window_update(0x37, filemenu_update_hidden_options_bottom); - set_window_update(0x38, filemenu_update_hidden_options_left); - set_window_update(0x39, filemenu_update_hidden_options_right); - set_window_update(0x3A, filemenu_update_hidden_options_left); - set_window_update(0x3B, filemenu_update_hidden_options_right); - set_window_update(0x2D, filemenu_update_hidden_title); + set_window_update(WINDOW_ID_51, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_54, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_hidden_options_bottom); + set_window_update(WINDOW_ID_56, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_57, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_58, filemenu_update_hidden_options_left); + set_window_update(WINDOW_ID_59, filemenu_update_hidden_options_right); + set_window_update(WINDOW_ID_45, filemenu_update_hidden_title); sfx_play_sound(SOUND_D6); set_game_mode(0xF); break; case 1: menu->page = 0; filemenu_set_selected(menu, 0, 2); - set_window_update(0x33, filemenu_update_show_options_left); - set_window_update(0x34, filemenu_update_show_options_right); - set_window_update(0x35, filemenu_update_show_options_bottom); - set_window_update(0x37, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_show_options_bottom); sfx_play_sound(SOUND_MENU_BACK); break; case 3: menu->page = 0; filemenu_set_selected(menu, 1, 2); - set_window_update(0x33, filemenu_update_show_options_left); - set_window_update(0x34, filemenu_update_show_options_right); - set_window_update(0x35, filemenu_update_show_options_bottom); - set_window_update(0x37, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, filemenu_update_show_options_bottom); sfx_play_sound(SOUND_MENU_BACK); break; case 4: diff --git a/src/167570.c b/src/167570.c index 7108692748..fc2995444a 100644 --- a/src/167570.c +++ b/src/167570.c @@ -1,6 +1,9 @@ #include "common.h" #include "filemenu.h" +#include "fio.h" +extern SaveMetadata gSaveSlotMetadata[4]; +extern u8 gSaveSlotHasData[4]; extern MenuWindowBP D_8024A0CC[2]; void filemenu_yesno_draw_options_contents(MenuPanel* tab, s32 posX, s32 posY) { @@ -90,7 +93,7 @@ void filemenu_yesno_draw_prompt_contents(MenuPanel* tab, s32 posX, s32 posY) { } xOffset = (147 - (i * 11)) / 2; - filemenu_draw_file_name(&filemenu_8024C110, i + 1, posX + xOffset, posY + 22, 0xFF, 0, 8, 0xB); + filemenu_draw_file_name(&filemenu_8024C110[0], i + 1, posX + xOffset, posY + 22, 0xFF, 0, 8, 0xB); xOffset += (i + 1) * 11; filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_20), posX + xOffset, posY + 22, 0xFF, 0, 0); filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK), posX + 70, posY + 38, 0xFF, 0, 0); @@ -115,9 +118,230 @@ void filemenu_yesno_init(MenuPanel* tab) { tab->initialized = TRUE; } -static const f32 padding = 0.0f; +void filemenu_yesno_handle_input(MenuPanel* menu) { + s32 oldSelected = menu->selected; -INCLUDE_ASM(s32, "167570", filemenu_yesno_handle_input); + if (filemenu_heldButtons & BUTTON_STICK_UP) { + menu->row--; + if (menu->row < 0) { + menu->row = 0; + } + } + + if (filemenu_heldButtons & BUTTON_STICK_DOWN) { + menu->row++; + if (menu->row >= menu->numRows) { + menu->row = menu->numRows - 1; + } + } + + menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu); + + if (oldSelected != menu->selected) { + sfx_play_sound(SOUND_MENU_CHANGE_SELECTION); + } + + if ((filemenu_pressedButtons & BUTTON_START) && menu->page == 4) { + filemenu_set_selected(menu, 0, 0); + filemenu_pressedButtons = BUTTON_A; + } + + if (filemenu_pressedButtons & BUTTON_A) { + u32 slot; + u32 slot2; + u32 slot3; + u32 slot4; + s32 i; + + sfx_play_sound(SOUND_MENU_NEXT); + + switch (menu->selected) { + case 0: + switch (menu->page) { + case 0: + filemenu_8024C098 = 2; + filemenu_menus[filemenu_8024C098]->page = 0; + gWindows[47].width = 182; + gWindows[47].height = 25; + gWindows[47].pos.x = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].width / 2) + : SCREEN_WIDTH / 2) - gWindows[47].width / 2; + gWindows[47].pos.y = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].height / 2) + : SCREEN_HEIGHT / 2) - gWindows[47].height / 2; + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + + slot = filemenu_menus[0]->selected; + for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) { + gSaveSlotMetadata[slot].filename[i] = 0xF7; + } + gSaveSlotMetadata[slot].level = 0; + gSaveSlotMetadata[slot].timePlayed = 0; + gSaveSlotMetadata[slot].spiritsRescued = 0; + fio_erase_game(slot); + gSaveSlotHasData[slot] = FALSE; + break; + case 3: + filemenu_8024C098 = 2; + filemenu_menus[filemenu_8024C098]->page = 2; + gWindows[47].width = 154; + gWindows[47].height = 39; + gWindows[47].pos.x = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].width / 2) + : SCREEN_WIDTH / 2) - gWindows[47].width / 2; + gWindows[47].pos.y = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].height / 2) + : SCREEN_HEIGHT / 2) - gWindows[47].height / 2; + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + fio_load_game(filemenu_loadedFileIdx); + gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx]; + fio_save_game(filemenu_iterFileIdx); + gSaveSlotHasData[filemenu_iterFileIdx] = TRUE; + break; + case 1: + filemenu_8024C098 = 2; + filemenu_menus[filemenu_8024C098]->page = 1; + gWindows[47].width = 153; + gWindows[47].height = 25; + gWindows[47].pos.x = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].width / 2) + : SCREEN_WIDTH / 2) - gWindows[47].width / 2; + gWindows[47].pos.y = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].height / 2) + : SCREEN_HEIGHT / 2) - gWindows[47].height / 2; + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + gSaveSlotMetadata[filemenu_menus[0]->selected] = gSaveSlotMetadata[gGameStatusPtr->saveSlot]; + fio_save_game(filemenu_menus[0]->selected); + gSaveSlotHasData[filemenu_menus[0]->selected] = TRUE; + break; + case 2: + clear_player_data(); + clear_saved_variables(); + gGameStatusPtr->areaID = 0; + gGameStatusPtr->mapID = 0xB; + gGameStatusPtr->entryID = 0; + evt_set_variable(NULL, EVT_STORY_PROGRESS, STORY_INTRO); + + slot2 = filemenu_menus[0]->selected; + for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) { + gSaveSlotMetadata[slot2].filename[i] = filemenu_8024C110[i]; + } + fio_save_game(slot2); + gSaveSlotHasData[slot2] = TRUE; + set_window_update(WINDOW_ID_48, (s32)filemenu_update_hidden_name_input); + set_window_update(WINDOW_ID_49, (s32)filemenu_update_hidden_name_input); + set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + filemenu_8024C098 = 2; + filemenu_menus[2]->page = 3; + gWindows[47].width = 184; + gWindows[47].height = 25; + gWindows[47].pos.x = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].width / 2) + : SCREEN_WIDTH / 2) - gWindows[47].width / 2; + gWindows[47].pos.y = ((gWindows[47].parent != -1) + ? (gWindows[gWindows[47].parent].height / 2) + : SCREEN_HEIGHT / 2) - gWindows[47].height / 2; + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW); + break; + case 4: + slot3 = filemenu_menus[0]->selected; + if (gGameStatusPtr->soundOutputMode != 1 - D_800D95E8.saveSlot || + slot3 != (u8)D_800D95E8.saveCount) + { + D_800D95E8.saveSlot = 1 - gGameStatusPtr->soundOutputMode; + D_800D95E8.saveCount = slot3; + fio_flush_backups(); + } + fio_load_game(slot3); + set_game_mode(0xF); + break; + } + break; + case 1: + switch (menu->page) { + case 0: + case 1: + case 3: + filemenu_8024C098 = 0; + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + break; + case 2: + filemenu_8024C098 = 3; + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + break; + case 4: + filemenu_8024C098 = 0; + slot4 = filemenu_menus[0]->selected; + set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation); + set_window_update(slot4 + 0x38, (s32)filemenu_update_deselect_file); + set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE); + break; + } + break; + } + } + + if (filemenu_pressedButtons & BUTTON_B) { + u32 slot; + + sfx_play_sound(SOUND_MENU_BACK); + filemenu_set_selected(menu, 0, 1); + + switch (menu->page) { + case 0: + case 1: + case 3: + filemenu_8024C098 = 0; + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + break; + case 2: + filemenu_8024C098 = 3; + set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm); + break; + case 4: + filemenu_8024C098 = 0; + slot = filemenu_menus[0]->selected; + set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation); + set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation); + set_window_update(slot + WINDOW_ID_56, (s32)filemenu_update_deselect_file); + set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE); + break; + } + } +} void filemenu_yesno_update(void) { } diff --git a/src/168590.c b/src/168590.c index 56c91c139a..b2b7837e80 100644 --- a/src/168590.c +++ b/src/168590.c @@ -59,18 +59,18 @@ void filemenu_info_handle_input(void) { switch(page) { case 1: menu->page = 0; - set_window_update(0x33, (s32)filemenu_update_show_options_left); - set_window_update(0x34, (s32)filemenu_update_show_options_right); - set_window_update(0x35, (s32)filemenu_update_show_options_bottom); - set_window_update(0x37, (s32)filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom); filemenu_set_selected(menu, 0, 2); break; case 4: menu->page = 0; - set_window_update(0x33, (s32)filemenu_update_show_options_left); - set_window_update(0x34, (s32)filemenu_update_show_options_right); - set_window_update(0x35, (s32)filemenu_update_show_options_bottom); - set_window_update(0x37, (s32)filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left); + set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right); + set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom); + set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom); filemenu_set_selected(menu, 1, 2); break; case 2: @@ -78,7 +78,7 @@ void filemenu_info_handle_input(void) { filemenu_set_selected(menu, 1, 2); break; } - set_window_update(0x2F, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_47, WINDOW_UPDATE_HIDE); } } diff --git a/src/18C790.c b/src/18C790.c index a8cfe7018a..f937194397 100644 --- a/src/18C790.c +++ b/src/18C790.c @@ -619,7 +619,7 @@ void btl_state_update_celebration(void) { x = 20; y = 186; set_window_properties(8, 20, 186, 280, 32, 20, func_80260948, NULL, -1); - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); gBattleState2 = BATTLE_STATE2_UNK_8; } break; @@ -662,7 +662,7 @@ void btl_state_update_celebration(void) { break; case BATTLE_STATE2_UNK_9: hud_element_free(D_8029FAE8); - set_window_update(8, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); switch (battleStatus->currentSubmenu) { case 0: @@ -770,7 +770,7 @@ void btl_state_update_celebration(void) { x = 160 - (width / 2); y = 80; set_window_properties(9, x, y, width, 28, 10, func_80260A20, NULL, -1); - set_window_update(9, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW); D_8029FB4C = 60; gBattleState2 = BATTLE_STATE2_UNK_10; break; @@ -782,7 +782,7 @@ void btl_state_update_celebration(void) { D_8029FB4C--; break; } - set_window_update(9, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE); gBattleState2 = BATTLE_STATE2_UNK_8; break; case BATTLE_STATE2_UNK_14: diff --git a/src/190A10.c b/src/190A10.c index f35f28d20f..487d025dfb 100644 --- a/src/190A10.c +++ b/src/190A10.c @@ -1,6 +1,32 @@ #include "common.h" -INCLUDE_ASM(s32, "190A10", func_80262130); +extern s32 D_8010C968; +extern s32 D_8010C98C; + +s32 func_80262130(f32 inX, f32 inY, f32 inZ, f32 arg3, f32 radius) { + f32 x = inX; + f32 y = inY; + f32 z = inZ; + f32 hitDepth = arg3; + s32 ret = FALSE; + s32 phi_s0 = 0; + + if (npc_raycast_down_around(0, &x, &y, &z, &hitDepth, 90.0f, radius) && hitDepth <= arg3) { + s32 type = get_collider_type_by_id(D_8010C98C & 0xFF); + s32 type2 = get_collider_type_by_id(D_8010C968 & 0xFF); + + phi_s0 = type & type2; + if (phi_s0 != (D_8010C98C & 0xFF)) { + phi_s0 = 0; + } + } + + if (phi_s0 == 1) { + ret = TRUE; + } + + return ret; +} s32 func_8026220C(f32 arg0, f32 arg1) { return (arg1 > 100.0f) ? 28 : 0; diff --git a/src/415D90.c b/src/415D90.c index e4ee0a6b66..26cc992dbe 100644 --- a/src/415D90.c +++ b/src/415D90.c @@ -349,17 +349,17 @@ void func_802A27D0(void) { void func_802A27E4(void) { s32 i; - set_window_update(1, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_1, WINDOW_UPDATE_HIDE); if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, WINDOW_UPDATE_HIDE); - set_window_update(3, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_2, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_3, WINDOW_UPDATE_HIDE); } else { - set_window_update(4, WINDOW_UPDATE_HIDE); - set_window_update(5, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_4, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_5, WINDOW_UPDATE_HIDE); } - set_window_update(8, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); for (i = 0; i < battle_menu_moveOptionCount; i++) { hud_element_free(battle_menu_moveOptionIconIDs[i]); @@ -398,17 +398,17 @@ void func_802A2910(void) { } hud_element_set_script(battle_menu_moveCursorIcon, HudScript_AnimatedHandPointer); - set_window_update(1, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_1, WINDOW_UPDATE_TRANSPARENT); if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, WINDOW_UPDATE_TRANSPARENT); - set_window_update(3, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_2, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_3, WINDOW_UPDATE_TRANSPARENT); } else { - set_window_update(4, WINDOW_UPDATE_TRANSPARENT); - set_window_update(5, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_4, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_5, WINDOW_UPDATE_TRANSPARENT); } - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); battle_menu_moveTextColor = 10; D_802AD10F = 1; battle_menu_moveTextOpacity = 255; @@ -420,16 +420,16 @@ void func_802A2AB8(void) { s32* moveOptionCostUnitIconIDs; s32 i; - set_window_update(1, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_1, WINDOW_UPDATE_TRANSPARENT); if (!battle_menu_hasSpiritsMenu) { - set_window_update(2, WINDOW_UPDATE_TRANSPARENT); - set_window_update(3, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_2, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_3, WINDOW_UPDATE_TRANSPARENT); } else { - set_window_update(4, WINDOW_UPDATE_TRANSPARENT); - set_window_update(5, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_4, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_5, WINDOW_UPDATE_TRANSPARENT); } - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); moveOptionIconIDs = battle_menu_moveOptionIconIDs; @@ -455,7 +455,7 @@ void func_802A2AB8(void) { } void func_802A2C58(void) { - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); battle_menu_moveState = 30; } @@ -576,9 +576,9 @@ void func_802A4718(void) { void func_802A472C(void) { s32 i; - set_window_update(6, WINDOW_UPDATE_HIDE); - set_window_update(7, WINDOW_UPDATE_HIDE); - set_window_update(8, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_6, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_7, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); for (i = 0; i < D_802AD66C; i++) { hud_element_free(D_802AD628[i]); @@ -600,9 +600,9 @@ void func_802A47E0(void) { hud_element_set_tint(D_802AD61C, 0xFF, 0xFF, 0xFF); hud_element_set_tint(D_802AD620, 0xFF, 0xFF, 0xFF); hud_element_set_script(D_802AD618, HudScript_AnimatedHandPointer); - set_window_update(6, WINDOW_UPDATE_TRANSPARENT); - set_window_update(7, WINDOW_UPDATE_TRANSPARENT); - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_6, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_7, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); D_802AD614 = 10; D_802AD60B = 1; D_802AD624 = 255; @@ -612,9 +612,9 @@ void func_802A47E0(void) { void func_802A48FC(void) { s32 i; - set_window_update(6, WINDOW_UPDATE_TRANSPARENT); - set_window_update(7, WINDOW_UPDATE_TRANSPARENT); - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_6, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_7, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); for (i = 0; i < D_802AD66C; i++) { hud_element_set_tint(D_802AD628[i], 0xFF, 0xFF, 0xFF); @@ -630,9 +630,9 @@ void func_802A48FC(void) { } void func_802A4A10(void) { - set_window_update(6, WINDOW_UPDATE_TRANSPARENT); - set_window_update(7, WINDOW_UPDATE_TRANSPARENT); - set_window_update(8, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_6, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_7, WINDOW_UPDATE_TRANSPARENT); + set_window_update(WINDOW_ID_8, WINDOW_UPDATE_SHOW); D_802AD604 = 30; } diff --git a/src/80850_len_3060.c b/src/80850_len_3060.c index 6ff03d1dc5..0671712e22 100644 --- a/src/80850_len_3060.c +++ b/src/80850_len_3060.c @@ -492,7 +492,7 @@ void update_coin_counter(void) { if ((uiStatus->displayCoins == playerData->coins) || (uiStatus->unk_6C[0] <= 30)) { uiStatus->unk_6C[0] -= 1; if (uiStatus->unk_6C[0] == 0) { - set_window_update(20, (s32)basic_hidden_window_update); + set_window_update(WINDOW_ID_20, (s32)basic_hidden_window_update); uiStatus->unk_6C[1] = 15; D_8010CD10 = 0; D_8010CD12 = 1; @@ -513,7 +513,7 @@ void show_coin_counter(void) { s32 index; if ((D_8010CD10 != 0) || (D_8010CD12 != 0)) { - set_window_update(20, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_20, WINDOW_UPDATE_HIDE); if (uiStatus->iconIndex12 > -1) { hud_element_free(uiStatus->iconIndex10); hud_element_free(uiStatus->iconIndex11); @@ -527,7 +527,7 @@ void show_coin_counter(void) { if (uiStatus->unk_6C[0] == 0) { set_window_properties(0x14, 32, 164, 64, 20, 0x15, coin_counter_draw_content, 0, -1); - set_window_update(20, (s32)basic_window_update); + set_window_update(WINDOW_ID_20, (s32)basic_window_update); index = hud_element_create(HudScript_MenuTimes); uiStatus->iconIndex10 = index; hud_element_set_flags(index, HUD_ELEMENT_FLAGS_80); diff --git a/src/8a860_len_3f30.c b/src/8a860_len_3f30.c index 4e9a3a82b7..7739b54637 100644 --- a/src/8a860_len_3f30.c +++ b/src/8a860_len_3f30.c @@ -239,62 +239,62 @@ s32 popup_menu_update(void) { } else { set_window_properties(0xF, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); } - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 1: set_window_properties(0xE, posX, posY, 0x8B, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0x11, 0xD, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_HIDE); - set_window_update(0x11, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; case 3: set_window_properties(0xE, posX, posY, 0xA2, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 0x11, -6, 0x60, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 4: set_window_properties(0xE, posX, posY, 0x92, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0x11, 0xC, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_HIDE); - set_window_update(0x11, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; case 5: set_window_properties(0xE, posX, posY, 0xA7, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 0x16, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 8: set_window_properties(0xE, posX, posY, 0xAA, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 0x20, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 9: set_window_properties(0xE, posX, posY, 0x91, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 10: set_window_properties(0xE, posX, posY, 0x80, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 0xC, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 11: set_window_properties(0xE, posX, posY, 0x95, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0xF, 6, -6, 0x8B, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_SHOW); - set_window_update(0x11, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE); break; case 13: set_window_properties(0xE, posX, posY, 0x83, ((s8) D_8010D656 * 0xD) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1); set_window_properties(0x11, 0xA, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE); - set_window_update(0xF, WINDOW_UPDATE_HIDE); - set_window_update(0x11, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW); break; } @@ -374,18 +374,18 @@ s32 popup_menu_update(void) { case 8: case 9: case 12: - set_window_update(0xE, WINDOW_UPDATE_SHOW); - set_window_update(0x13, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW); break; case 1: case 4: - set_window_update(0xE, WINDOW_UPDATE_SHOW); - set_window_update(0x13, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW); break; case 10: case 11: case 13: - set_window_update(0xE, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); break; } } else { @@ -399,35 +399,35 @@ s32 popup_menu_update(void) { case 8: case 9: case 12: - set_window_update(0xE, (s32)basic_window_update); + set_window_update(WINDOW_ID_14, (s32)basic_window_update); sfx_play_sound(1); - set_window_update(0x13, (s32)basic_window_update); + set_window_update(WINDOW_ID_19, (s32)basic_window_update); break; case 1: case 4: - set_window_update(0xE, (s32)basic_window_update); + set_window_update(WINDOW_ID_14, (s32)basic_window_update); sfx_play_sound(2); - set_window_update(0x13, (s32)basic_window_update); + set_window_update(WINDOW_ID_19, (s32)basic_window_update); break; case 10: case 11: case 13: - set_window_update(0xE, (s32)basic_window_update); + set_window_update(WINDOW_ID_14, (s32)basic_window_update); sfx_play_sound(1); break; } - set_window_update(0x15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW); } if (gPopupMenu->popupType == 3) { - set_window_update(0x10, (s32)basic_window_update); - set_window_update(0x14, (s32)basic_window_update); + set_window_update(WINDOW_ID_16, (s32)basic_window_update); + set_window_update(WINDOW_ID_20, (s32)basic_window_update); } if (gPopupMenu->popupType == 4) { - set_window_update(0x12, (s32)basic_window_update); + set_window_update(WINDOW_ID_18, (s32)basic_window_update); } if (gPopupMenu->popupType == 5) { - set_window_update(0x10, (s32)basic_window_update); + set_window_update(WINDOW_ID_16, (s32)basic_window_update); } D_8010D640 = 1; break; @@ -636,18 +636,18 @@ s32 popup_menu_update(void) { case 8: case 9: case 12: - set_window_update(0xE, WINDOW_UPDATE_HIDE); - set_window_update(0x13, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE); break; case 1: case 4: - set_window_update(0xE, WINDOW_UPDATE_HIDE); - set_window_update(0x13, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE); break; case 10: case 11: case 13: - set_window_update(0xE, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); break; } destroy_popup_menu(); @@ -688,14 +688,14 @@ s32 popup_menu_update(void) { gPopupMenu->result = -1; return 0; case 31: - set_window_update(0xE, WINDOW_UPDATE_HIDE); - set_window_update(0x13, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE); if (D_8010D68E != 0) { - set_window_update(0x15, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE); } width = get_msg_width(0x1D006B, 0) + 23; set_window_properties(9, 160 - (width / 2), 0x50, width, 0x28, 0x14, func_800F4CF0, NULL, -1); - set_window_update(9, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW); D_8010D644 = 0x3C; D_8010D640 = 0x20; return 0; @@ -707,11 +707,11 @@ s32 popup_menu_update(void) { D_8010D644--; return 0; } - set_window_update(9, WINDOW_UPDATE_HIDE); - set_window_update(0xE, WINDOW_UPDATE_SHOW); - set_window_update(0x13, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW); if (D_8010D68E != 0) { - set_window_update(0x15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW); } D_8010D640 = 1; gPopupMenu->result = 0; @@ -749,18 +749,18 @@ s32 popup_menu_update(void) { case 8: case 9: case 12: - set_window_update(0xE, WINDOW_UPDATE_HIDE); - set_window_update(0x13, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE); break; case 1: case 4: - set_window_update(0xE, WINDOW_UPDATE_HIDE); - set_window_update(0x13, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE); break; case 10: case 11: case 13: - set_window_update(0xE, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE); break; } @@ -772,14 +772,14 @@ s32 popup_menu_update(void) { } width = get_msg_width(msgID, 0) + 23; set_window_properties(0x15, 160 - (width / 2), 76, width, 32, 0x13, func_800F4C1C, NULL, -1); - set_window_update(0x15, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW); D_8010D6A0 = msg_get_printer_for_msg(0x1E001D, &D_8010D6A4); msg_printer_set_origin_pos(D_8010D6A0, 160, 0x90); D_8010D640 = 0x65; break; case 101: if (D_8010D6A4 == 1) { - set_window_update(0x15, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE); switch (D_8010D6A0->currentOption) { case 0: D_8010D640 = 0x66; @@ -825,18 +825,18 @@ s32 popup_menu_update(void) { case 8: case 9: case 12: - set_window_update(0xE, WINDOW_UPDATE_SHOW); - set_window_update(0x13, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW); break; case 1: case 4: - set_window_update(0xE, WINDOW_UPDATE_SHOW); - set_window_update(0x13, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW); break; case 10: case 11: case 13: - set_window_update(0xE, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW); break; } D_8010D690 = 0xA; diff --git a/src/C50A0.c b/src/C50A0.c index ab9501e884..2785198bbc 100644 --- a/src/C50A0.c +++ b/src/C50A0.c @@ -1,5 +1,6 @@ #include "common.h" #include "effects.h" +#include "hud_element.h" #define MAX_ITEM_ENTITIES 256 @@ -11,16 +12,26 @@ extern ItemEntity* D_801561A0[MAX_ITEM_ENTITIES]; extern ItemEntity** D_801565A0; // item entity list extern s16 D_801565A4; extern s16 D_801565A8; +extern s32 D_80155D80; extern s16 D_80155D8C; extern s16 D_80155D8E; extern s16 D_80155D90; -void item_entity_load(ItemEntity* itemEntity); +extern s32* SparkleScript_Coin; + +void item_entity_load(ItemEntity*); +void item_entity_update(ItemEntity*); +void appendGfx_item_entity(void*); void draw_item_entities(void); void func_80132D94(void); -void func_8013559C(ItemEntity* itemEntity); +s32 test_item_player_collision(ItemEntity*); +void update_item_entity_collectable(ItemEntity*); +void func_8013559C(ItemEntity*); +void update_item_entity_static(ItemEntity*); void func_801356C4(void); +void func_801356CC(ItemEntity*); void func_801356D4(void); +void update_item_entity_temp(ItemEntity*); INCLUDE_ASM(s32, "C50A0", draw_ci_image_with_clipping); @@ -59,16 +70,13 @@ s32 sparkle_script_step(ItemEntity* itemEntity) { itemEntity->unk_44 = *currentState++; itemEntity->currentState = currentState; break; - case 2: itemEntity->currentState = itemEntity->sequenceStart; - return 1; - + return TRUE; case 3: itemEntity->sequenceStart = currentState; itemEntity->currentState = currentState; - return 1; - + return TRUE; case 7: itemEntity->framesLeft = *currentState++; itemEntity->unk_4C = *currentState++; @@ -77,16 +85,13 @@ s32 sparkle_script_step(ItemEntity* itemEntity) { itemEntity->unk_58 = *currentState++; itemEntity->currentState = currentState; break; - case 4: itemEntity->currentState = currentState++; itemEntity->currentState = currentState++; - case 0: - return 1; + return TRUE; } - - return 0; + return FALSE; } void sparkle_script_update(ItemEntity* itemEntity) { @@ -183,10 +188,95 @@ INCLUDE_ASM(s32, "C50A0", make_item_entity_at_player); INCLUDE_ASM(s32, "C50A0", item_entity_update); -INCLUDE_ASM(s32, "C50A0", update_item_entities); +void update_item_entities(void) { + ItemEntity* entity; + ItemEntity* entity2; + f32 x, y, z, hitDepth; + s32 coin; + s32 i; + + if (!(gOverrideFlags & 0xC00)) { + for (i = 0; i < 0x100; i++) { + entity = D_801565A0[i]; + + if (entity != NULL && entity->flags != 0) { + if (entity->itemID == ITEM_COIN) { + if (rand_int(100) > 90) { + sparkle_script_init(entity, &SparkleScript_Coin); + D_80155D8C = rand_int(16) - 8; + D_80155D8E = rand_int(16) - 8; + D_80155D90 = 5; + } + sparkle_script_update(entity); + } + + item_entity_update(entity); + + switch (entity->type) { + case 0: + update_item_entity_static(entity); + break; + case 1: + case 2: + func_801356CC(entity); + break; + case 3: + case 12: + case 16: + case 20: + case 23: + update_item_entity_collectable(entity); + break; + case 28: + update_item_entity_temp(entity); + break; + } + + + entity = D_801565A0[i]; + if (entity != NULL) { + s32 xs, ys, zs; + + switch (entity->type) { + case 0: + case 3: + case 12: + case 16: + case 28: + xs = entity->position.x; + ys = entity->position.y; + zs = entity->position.z; + + if (xs != entity->unk_34.x || ys != entity->unk_34.y || zs != entity->unk_34.z) { + Shadow* shadow = get_shadow_by_index(entity->shadowIndex); + + x = entity->position.x; + y = entity->position.y + 12.0f; + z = entity->position.z; + hitDepth = 1000.0f; + npc_raycast_down_sides(0x20000, &x, &y, &z, &hitDepth); + + shadow->position.x = x; + shadow->position.y = y; + shadow->position.z = z; + shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x; + shadow->rotation.y = 0.0f; + shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z; + set_standard_shadow_scale(shadow, hitDepth * 0.5f); + } + break; + } + entity->unk_34.x = entity->position.x; + entity->unk_34.y = entity->position.y; + entity->unk_34.z = entity->position.z; + } + } + do {} while (0); // required to match + } + } +} INCLUDE_ASM(s32, "C50A0", appendGfx_item_entity); -void appendGfx_item_entity(void* itemEntity); void draw_item_entities(void) { RenderTask rt; @@ -318,7 +408,6 @@ void func_80133A94(s32 idx, s32 itemID) { item_entity_load(item); } -s32 test_item_player_collision(ItemEntity* itemEntity); INCLUDE_ASM(s32, "C50A0", test_item_player_collision); s32 test_item_entity_position(f32 x, f32 y, f32 z, f32 dist) { @@ -443,7 +532,7 @@ void func_8013559C(ItemEntity* itemEntity) { } void update_item_entity_static(ItemEntity* itemEntity) { - if ((s8)itemEntity->state == 0 && test_item_player_collision(itemEntity)) { + if (itemEntity->state == 0 && test_item_player_collision(itemEntity)) { D_801565A4 = 1; itemEntity->type = 28; itemEntity->state = 0; @@ -455,7 +544,7 @@ void update_item_entity_static(ItemEntity* itemEntity) { void func_801356C4(void) { } -void func_801356CC(void) { +void func_801356CC(ItemEntity* itemEntity) { } void func_801356D4(void) { @@ -471,7 +560,7 @@ void func_801369D0(s32 arg1, s32 x, s32 y) { draw_msg(0x1D0060, x + 12, y + 4, 255, 52, 0); } -void func_80136A08(ItemEntity* itemEntity, s32 posX, s32 arg2) { +void func_80136A08(ItemEntity* itemEntity, s32 posX, s32 posY) { ItemData* itemData = &gItemTable[itemEntity->itemID]; s32 itemMsg; @@ -481,7 +570,7 @@ void func_80136A08(ItemEntity* itemEntity, s32 posX, s32 arg2) { case 10: case 11: itemMsg = itemData->itemMsg; - draw_msg(itemMsg, posX + 8, arg2, 255, 0xA, 0); + draw_msg(itemMsg, posX + 8, posY, 255, 0xA, 0); break; } } diff --git a/src/E225B0.c b/src/E225B0.c index 957318f212..b2ae5db7b5 100644 --- a/src/E225B0.c +++ b/src/E225B0.c @@ -32,7 +32,6 @@ extern Gfx D_802B7C00_E231B0[]; extern void (*D_8010C93C)(void); extern struct802B7C78* D_802B7C78_E23228; -extern struct8015A578 D_8015A578; void fold_appendGfx_component(s32, UnknownCommand*, s32, Matrix4f*); void func_802B735C_E2290C(void); @@ -172,7 +171,7 @@ void func_802B735C_E2290C(void) { } } - if (D_802B7C78_E23228->unk_18++ >= 0x33) { + if (D_802B7C78_E23228->unk_18++ > 50) { D_8015A578.unk_02 = 0; D_8010C93C = NULL; playerStatus->animFlags &= ~0x100; diff --git a/src/a5dd0_len_114e0.c b/src/a5dd0_len_114e0.c index 3e7b1d81fa..6fc1c28dc2 100644 --- a/src/a5dd0_len_114e0.c +++ b/src/a5dd0_len_114e0.c @@ -1015,7 +1015,6 @@ extern RenderTask* mdl_renderTaskLists[3]; extern s32 mdl_renderTaskMode; extern s32 mdl_renderTaskCount; // num render task entries? -extern s8 D_8015A578; extern TextureHandle mdl_textureHandles[128]; extern RenderTask mdl_clearRenderTasks[3][0x100]; @@ -1035,6 +1034,9 @@ void entity_free_static_data(EntityBlueprint* data); void update_entity_shadow_position(Entity* entity); s32 entity_raycast_down(f32* x, f32* y, f32* z, f32* hitYaw, f32* hitPitch, f32* hitLength); void func_80117D00(Model* model); +void appendGfx_model_group(Model* model); +void render_transform_group_node(ModelNode* node); +void render_transform_group(ModelTransformGroup* group); void load_model_transforms(ModelNode* model, ModelNode* parent, Matrix4f mdlTxMtx, s32 treeDepth); void enable_transform_group(u16 modelID); @@ -1156,7 +1158,7 @@ void update_entities(void) { } update_shadows(); - D_8015A578 = 0; + D_8015A578.unk_00 = 0; } void update_shadows(void) { @@ -2228,7 +2230,7 @@ s32 is_block_on_ground(Entity* block) { ret = hitLength; if (ret == 32767) { - ret = 0; + ret = FALSE; } return ret; @@ -2237,26 +2239,20 @@ s32 is_block_on_ground(Entity* block) { void state_delegate_NOP(void) { } -// Dumb temp and weird i decrement and temp increment stuff needed to match void clear_game_modes(void) { - GameMode* state = &gMainGameState[0]; + GameMode* gameMode; s32 i; - for (i = ARRAY_COUNT(gMainGameState) - 1; i >= 0; i--, state++) { - state->flags = 0; + for (gameMode = gMainGameState, i = 0; i < ARRAY_COUNT(gMainGameState); i++, gameMode++) { + gameMode->flags = 0; } } -// weird ordering at the beginning -#ifndef NON_EQUIVALENT -INCLUDE_ASM(s32, "a5dd0_len_114e0", set_next_game_mode); -#else GameMode* set_next_game_mode(GameMode* arg0) { GameMode* gameMode; s32 i; - for (i = 0; i < ARRAY_COUNT(gMainGameState); i++) { - gameMode = &gMainGameState[i]; + for (gameMode = gMainGameState, i = 0; i < ARRAY_COUNT(gMainGameState); i++, gameMode++) { if (gameMode->flags == 0) { break; } @@ -2288,7 +2284,6 @@ GameMode* set_next_game_mode(GameMode* arg0) { return gameMode; } -#endif GameMode* set_game_mode_slot(s32 i, GameMode* arg0) { GameMode* gameMode = &gMainGameState[i]; @@ -2627,7 +2622,278 @@ INCLUDE_ASM(s32, "a5dd0_len_114e0", func_80116674); INCLUDE_ASM(s32, "a5dd0_len_114e0", func_80116698); +// this function has weird control flow and suqqz +#ifdef NON_EQUIVALENT +void render_models(void) { + Camera* camera = &gCameras[gCurrentCameraID]; + s32 distance; + s32 cond; + s32 i; + + RenderTask rt; + RenderTask* rtPtr = &rt; + f32 sp38; + f32 sp3C; + f32 sp40; + f32 sp44; + f32 sp48; + f32 sp4C; + f32 sp50; + f32 sp54; + f32 sp58; + f32 sp5C; + f32 sp60; + f32 sp64; + f32 sp68; + f32 sp6C; + f32 sp70; + f32 sp74; + f32 sp78; + f32 sp7C; + f32 sp80; + f32 sp84; + f32 centerX, centerY, centerZ; + f32 sp98; + f32 spA0; + + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f0_6; + f32 temp_f0_7; + f32 temp_f0_8; + f32 temp_f12; + f32 temp_f12_10; + f32 temp_f12_11; + f32 temp_f12_12; + f32 temp_f12_13; + f32 temp_f12_14; + f32 temp_f12_15; + f32 temp_f12_16; + f32 temp_f12_2; + f32 temp_f12_3; + f32 temp_f12_4; + f32 temp_f12_5; + f32 temp_f12_6; + f32 temp_f12_7; + f32 temp_f12_8; + f32 temp_f12_9; + f32 temp_f20; + f32 temp_f20_2; + f32 temp_f20_3; + f32 temp_f20_4; + f32 temp_f20_5; + f32 temp_f20_6; + f32 temp_f20_7; + f32 temp_f20_8; + f32 temp_f26; + f32 temp_f28; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f2_5; + f32 temp_f2_6; + f32 temp_f2_7; + f32 temp_f2_8; + f32 temp_f4; + f32 temp_f4_10; + f32 temp_f4_11; + f32 temp_f4_12; + f32 temp_f4_13; + f32 temp_f4_14; + f32 temp_f4_15; + f32 temp_f4_16; + f32 temp_f4_17; + f32 temp_f4_18; + f32 temp_f4_19; + f32 temp_f4_20; + f32 temp_f4_21; + f32 temp_f4_22; + f32 temp_f4_23; + f32 temp_f4_24; + f32 temp_f4_2; + f32 temp_f4_3; + f32 temp_f4_4; + f32 temp_f4_5; + f32 temp_f4_6; + f32 temp_f4_7; + f32 temp_f4_8; + f32 temp_f4_9; + f32 temp_f6; + f32 temp_f6_2; + f32 temp_f6_3; + f32 temp_f6_4; + f32 temp_f6_5; + f32 temp_f6_6; + f32 temp_f6_7; + f32 temp_f6_8; + f32 temp_f8; + f32 temp_f8_2; + f32 temp_f8_3; + f32 temp_f8_4; + f32 temp_f8_5; + f32 temp_f8_6; + f32 temp_f8_7; + f32 temp_f8_8; + + sp48 = camera->perspectiveMatrix[0][0]; + sp4C = camera->perspectiveMatrix[0][1]; + sp50 = camera->perspectiveMatrix[0][2]; + sp54 = camera->perspectiveMatrix[0][3]; + sp58 = camera->perspectiveMatrix[1][0]; + sp5C = camera->perspectiveMatrix[1][1]; + sp60 = camera->perspectiveMatrix[1][2]; + sp64 = camera->perspectiveMatrix[1][3]; + sp68 = camera->perspectiveMatrix[2][0]; + sp6C = camera->perspectiveMatrix[2][1]; + sp70 = camera->perspectiveMatrix[2][2]; + sp74 = camera->perspectiveMatrix[2][3]; + sp78 = camera->perspectiveMatrix[3][0]; + sp7C = camera->perspectiveMatrix[3][1]; + sp80 = camera->perspectiveMatrix[3][2]; + sp84 = camera->perspectiveMatrix[3][3]; + + for (i = 0; i < ARRAY_COUNT(*gCurrentModels); i++) { + Model* model = (*gCurrentModels)[i]; + + if (model != NULL) { + if (model->flags == 0) { + continue; + } + + if (model->flags & 4) { + continue; + } + + if (model->flags & 2) { + continue; + } + + if (model->flags & 0x20) { + continue; + } + + if (model->flags & 0x8) { + continue; + } + + centerX = model->center.x; + centerY = model->center.y; + centerZ = model->center.z; + + if (model->flags & 0x200) { + ModelNodeProperty* propertyList = model->modelNode->propertyList; + + temp_f26 = (f32) propertyList->dataType; + sp98 = temp_f26; + spA0 = (f32) propertyList[1].dataType; + temp_f28 = (f32) propertyList[1].key; + temp_f4 = centerX - temp_f26; + temp_f12 = centerY - spA0; + temp_f20 = centerZ - temp_f28; + temp_f6 = (sp48 * temp_f4) + (sp58 * temp_f12) + (sp68 * temp_f20) + sp78; + temp_f8 = (sp4C * temp_f4) + (sp5C * temp_f12) + (sp6C * temp_f20) + sp7C; + temp_f2 = (sp50 * temp_f4) + (sp60 * temp_f12) + (sp70 * temp_f20) + sp80; + temp_f4_2 = (sp54 * temp_f4) + (sp64 * temp_f12) + (sp74 * temp_f20) + sp84; + cond = FALSE; + + if ((temp_f4_2 != 0.0f) && + ((temp_f0 = 1.0f / temp_f4_2, temp_f4_3 = temp_f6 * temp_f0, temp_f12_2 = temp_f8 * temp_f0, !((temp_f2 * temp_f0) > -1.0f)) || !(temp_f4_3 >= -1.0f) || !(temp_f4_3 <= 1.0f) || !(temp_f12_2 >= -1.0f) || !(temp_f12_2 <= 1.0f)) && ((sp98 == 0.0f) || ((temp_f4_4 = centerX + sp98, temp_f12_3 = centerY - spA0, temp_f20_2 = centerZ - temp_f28, temp_f6_2 = (sp48 * temp_f4_4) + (sp58 * temp_f12_3) + (sp68 * temp_f20_2) + sp78, temp_f8_2 = (sp4C * temp_f4_4) + (sp5C * temp_f12_3) + (sp6C * temp_f20_2) + sp7C, temp_f2_2 = (sp50 * temp_f4_4) + (sp60 * temp_f12_3) + (sp70 * temp_f20_2) + sp80, temp_f4_5 = (sp54 * temp_f4_4) + (sp64 * temp_f12_3) + (sp74 * temp_f20_2) + sp84, (temp_f4_5 != 0.0f)) && ((temp_f0_2 = 1.0f / temp_f4_5, temp_f4_6 = temp_f6_2 * temp_f0_2, temp_f12_4 = temp_f8_2 * temp_f0_2, !((temp_f2_2 * temp_f0_2) > -1.0f)) || !(temp_f4_6 >= -1.0f) || !(temp_f4_6 <= 1.0f) || !(temp_f12_4 >= -1.0f) || !(temp_f12_4 <= 1.0f)))) && ((spA0 == 0.0f) || ((temp_f4_7 = centerX - sp98, temp_f12_5 = centerY + spA0, temp_f20_3 = centerZ - temp_f28, temp_f6_3 = (sp48 * temp_f4_7) + (sp58 * temp_f12_5) + (sp68 * temp_f20_3) + sp78, temp_f8_3 = (sp4C * temp_f4_7) + (sp5C * temp_f12_5) + (sp6C * temp_f20_3) + sp7C, temp_f2_3 = (sp50 * temp_f4_7) + (sp60 * temp_f12_5) + (sp70 * temp_f20_3) + sp80, temp_f4_8 = (sp54 * temp_f4_7) + (sp64 * temp_f12_5) + (sp74 * temp_f20_3) + sp84, (temp_f4_8 != 0.0f)) && ((temp_f0_3 = 1.0f / temp_f4_8, temp_f4_9 = temp_f6_3 * temp_f0_3, temp_f12_6 = temp_f8_3 * temp_f0_3, !((temp_f2_3 * temp_f0_3) > -1.0f)) || !(temp_f4_9 >= -1.0f) || !(temp_f4_9 <= 1.0f) || !(temp_f12_6 >= -1.0f) || !(temp_f12_6 <= 1.0f))))) { + if ((sp98 != 0.0f) && (spA0 != 0.0f)) { + temp_f4_10 = centerX + sp98; + temp_f12_7 = centerY + spA0; + temp_f20_4 = centerZ - temp_f28; + temp_f6_4 = (sp48 * temp_f4_10) + (sp58 * temp_f12_7) + (sp68 * temp_f20_4) + sp78; + temp_f8_4 = (sp4C * temp_f4_10) + (sp5C * temp_f12_7) + (sp6C * temp_f20_4) + sp7C; + temp_f2_4 = (sp50 * temp_f4_10) + (sp60 * temp_f12_7) + (sp70 * temp_f20_4) + sp80; + temp_f4_11 = (sp54 * temp_f4_10) + (sp64 * temp_f12_7) + (sp74 * temp_f20_4) + sp84; + + if (temp_f4_11 != 0.0f) { + temp_f0_4 = 1.0f / temp_f4_11; + temp_f4_12 = temp_f6_4 * temp_f0_4; + temp_f12_8 = temp_f8_4 * temp_f0_4; + if (((temp_f2_4 * temp_f0_4) > -1.0f) && (temp_f4_12 >= -1.0f) && (temp_f4_12 <= 1.0f) && (temp_f12_8 >= -1.0f)) { + if (!(temp_f12_8 <= 1.0f)) { + goto block_36; + } + } else { + goto block_37; + } + } + } else { +block_36: +block_37: + if (((temp_f28 == 0.0f) || ((temp_f4_13 = centerX - sp98, temp_f12_9 = centerY - spA0, temp_f20_5 = centerZ + temp_f28, temp_f6_5 = (sp48 * temp_f4_13) + (sp58 * temp_f12_9) + (sp68 * temp_f20_5) + sp78, temp_f8_5 = (sp4C * temp_f4_13) + (sp5C * temp_f12_9) + (sp6C * temp_f20_5) + sp7C, temp_f2_5 = (sp50 * temp_f4_13) + (sp60 * temp_f12_9) + (sp70 * temp_f20_5) + sp80, temp_f4_14 = (sp54 * temp_f4_13) + (sp64 * temp_f12_9) + (sp74 * temp_f20_5) + sp84, (temp_f4_14 != 0.0f)) && ((temp_f0_5 = 1.0f / temp_f4_14, temp_f4_15 = temp_f6_5 * temp_f0_5, temp_f12_10 = temp_f8_5 * temp_f0_5, !((temp_f2_5 * temp_f0_5) > -1.0f)) || !(temp_f4_15 >= -1.0f) || !(temp_f4_15 <= 1.0f) || !(temp_f12_10 >= -1.0f) || !(temp_f12_10 <= 1.0f)))) && ((sp98 == 0.0f) || (temp_f28 == 0.0f) || ((temp_f4_16 = centerX + sp98, temp_f12_11 = centerY - spA0, temp_f20_6 = centerZ + temp_f28, temp_f6_6 = (sp48 * temp_f4_16) + (sp58 * temp_f12_11) + (sp68 * temp_f20_6) + sp78, temp_f8_6 = (sp4C * temp_f4_16) + (sp5C * temp_f12_11) + (sp6C * temp_f20_6) + sp7C, temp_f2_6 = (sp50 * temp_f4_16) + (sp60 * temp_f12_11) + (sp70 * temp_f20_6) + sp80, temp_f4_17 = (sp54 * temp_f4_16) + (sp64 * temp_f12_11) + (sp74 * temp_f20_6) + sp84, (temp_f4_17 != 0.0f)) && ((temp_f0_6 = 1.0f / temp_f4_17, temp_f4_18 = temp_f6_6 * temp_f0_6, temp_f12_12 = temp_f8_6 * temp_f0_6, !((temp_f2_6 * temp_f0_6) > -1.0f)) || !(temp_f4_18 >= -1.0f) || !(temp_f4_18 <= 1.0f) || !(temp_f12_12 >= -1.0f) || !(temp_f12_12 <= 1.0f)))) && ((spA0 == 0.0f) || (temp_f28 == 0.0f) || ((temp_f4_19 = centerX - sp98, temp_f12_13 = centerY + spA0, temp_f20_7 = centerZ + temp_f28, temp_f6_7 = (sp48 * temp_f4_19) + (sp58 * temp_f12_13) + (sp68 * temp_f20_7) + sp78, temp_f8_7 = (sp4C * temp_f4_19) + (sp5C * temp_f12_13) + (sp6C * temp_f20_7) + sp7C, temp_f2_7 = (sp50 * temp_f4_19) + (sp60 * temp_f12_13) + (sp70 * temp_f20_7) + sp80, temp_f4_20 = (sp54 * temp_f4_19) + (sp64 * temp_f12_13) + (sp74 * temp_f20_7) + sp84, (temp_f4_20 != 0.0f)) && ((temp_f0_7 = 1.0f / temp_f4_20, temp_f4_21 = temp_f6_7 * temp_f0_7, temp_f12_14 = temp_f8_7 * temp_f0_7, !((temp_f2_7 * temp_f0_7) > -1.0f)) || !(temp_f4_21 >= -1.0f) || !(temp_f4_21 <= 1.0f) || !(temp_f12_14 >= -1.0f) || !(temp_f12_14 <= 1.0f)))) && ((sp98 == 0.0f) || (spA0 == 0.0f) || (temp_f28 == 0.0f) || ((temp_f4_22 = centerX + sp98, temp_f12_15 = centerY + spA0, temp_f20_8 = centerZ + temp_f28, temp_f6_8 = (sp48 * temp_f4_22) + (sp58 * temp_f12_15) + (sp68 * temp_f20_8) + sp78, temp_f8_8 = (sp4C * temp_f4_22) + (sp5C * temp_f12_15) + (sp6C * temp_f20_8) + sp7C, temp_f2_8 = (sp50 * temp_f4_22) + (sp60 * temp_f12_15) + (sp70 * temp_f20_8) + sp80, temp_f4_23 = (sp54 * temp_f4_22) + (sp64 * temp_f12_15) + (sp74 * temp_f20_8) + sp84, (temp_f4_23 != 0.0f)) && ((temp_f0_8 = 1.0f / temp_f4_23, temp_f4_24 = temp_f6_8 * temp_f0_8, temp_f12_16 = temp_f8_8 * temp_f0_8, !((temp_f2_8 * temp_f0_8) > -1.0f)) || !(temp_f4_24 >= -1.0f) || !(temp_f4_24 <= 1.0f) || !(temp_f12_16 >= -1.0f) || !(temp_f12_16 <= 1.0f))))) { + cond = TRUE; + } + } + } + + if (cond) { + continue; + } + } + + transform_point(camera->perspectiveMatrix[0], centerX, centerY, centerZ, 1.0f, &sp38, &sp3C, &sp40, &sp44); + distance = sp40 + 5000.0f; + if (distance < 0) { + distance = 0; + } else if (distance > 10000) { + distance = 10000; + } + rtPtr->appendGfxArg = model; + if (model->modelNode->type == SHAPE_TYPE_GROUP) { + rtPtr->appendGfx = appendGfx_model_group; + } else { + rtPtr->appendGfx = appendGfx_model; + } + rtPtr->distance = -distance; + rtPtr->renderMode = model->renderMode; + queue_render_task(rtPtr); + } + } + + for (i = 0; i < ARRAY_COUNT(*gCurrentTransformGroups); i++) { + ModelTransformGroup* group = (*gCurrentTransformGroups)[i]; + f32 centerX, centerY, centerZ; + s32 distance; + + if (group == NULL) { + continue; + } + if (group->flags == 0) { + continue; + } + if (group->flags & MODEL_TRANSFORM_GROUP_FLAGS_4) { + continue; + } + + centerX = group->center.x; + centerY = group->center.y; + centerZ = group->center.z; + + transform_point(camera->perspectiveMatrix, centerX, centerY, centerZ, 1.0f, &sp38, &sp3C, &sp40, &sp44); + if (sp44 == 0.0f) { + sp44 = 1.0f; + } + + distance = (sp40 / sp44) * 10000.0f; + + if (!(group->flags & MODEL_TRANSFORM_GROUP_FLAGS_2)) { + rtPtr->appendGfx = render_transform_group; + rtPtr->appendGfxArg = group; + rtPtr->distance = -distance; + rtPtr->renderMode = group->renderMode; + queue_render_task(rtPtr); + } + } +} +#else INCLUDE_ASM(s32, "a5dd0_len_114e0", render_models); +#endif void appendGfx_model_group(Model* model) { s32 modelTreeDepth = (*mdl_currentModelTreeNodeInfo)[model->modelID].treeDepth; @@ -3306,7 +3572,13 @@ void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, s32* baseVtx, s32* gfxCoun INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_local_gfx_update_vtx_pointers); -INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_local_gfx_copy_vertices); +void mdl_local_gfx_copy_vertices(u8* from, s32 num, u8* to) { + u32 i; + + for (i = 0; i < num * 16; i++) { + to[i] = from[i]; + } +} INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_make_local_vertex_copy); diff --git a/src/bss2.c b/src/bss2.c index 395a2974b2..4b28584efd 100644 --- a/src/bss2.c +++ b/src/bss2.c @@ -26,10 +26,7 @@ BSS s32 D_8010C958; BSS s32 D_8010C95C; BSS s32 D_8010C960; BSS s32 D_8010C964; -BSS s8 D_8010C968; -BSS char D_8010C969; -BSS char D_8010C96A; -BSS s8 D_8010C96B; +BSS s32 D_8010C968; BSS s32 D_8010C96C; BSS s32 D_8010C970; BSS s32 D_8010C974; @@ -63,9 +60,9 @@ BSS s32 D_8010CD20; BSS char D_8010CD24[0xC]; BSS s32 D_8010CD30; BSS s32 D_8010CD34; -BSS s32 PlayerMoveHistory; +BSS s32 gPlayerMoveHistory; BSS char D_8010CD3C[0x27C]; -BSS s32 PlayerMoveHistoryIndex; +BSS s32 gPlayerMoveHistoryIndex; BSS s32 D_8010CFBC; BSS s32 wPartnerTetherDistance; BSS s32 D_8010CFC4; diff --git a/src/e0b30_len_b80.c b/src/e0b30_len_b80.c index 7b28ab5017..6843f64d1e 100644 --- a/src/e0b30_len_b80.c +++ b/src/e0b30_len_b80.c @@ -239,7 +239,7 @@ s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s1 s32 func_8014A964(s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s16 arg4, s16 arg5) { if (gGameStatusPtr->demoState != 0) { - return 1; + return TRUE; } else { MusicSettings* musicSetting = &gMusicSettings[playerIndex]; @@ -247,7 +247,7 @@ s32 func_8014A964(s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s1 func_800559C4(musicSetting->songName); musicSetting->flags &= ~MUSIC_SETTINGS_FLAGS_1; - return 1; + return TRUE; } else { s32 defaultVariation = bgm_get_map_default_variation(songID); if (defaultVariation >= 0) { @@ -263,7 +263,7 @@ s32 func_8014A964(s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s1 musicSetting->unk_02 = 1; musicSetting->flags &= ~MUSIC_SETTINGS_FLAGS_2; - return 1; + return TRUE; } } } @@ -272,11 +272,11 @@ s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2) { MusicSettings* musicSetting = &gMusicSettings[playerIndex]; if (!(musicSetting->flags & MUSIC_SETTINGS_FLAGS_1)) { - return 0; + return FALSE; } if (!(musicSetting->flags & MUSIC_SETTINGS_FLAGS_2)) { - return 0; + return FALSE; } switch (arg2) { @@ -290,8 +290,7 @@ s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2) { func_80056068(musicSetting->songName, arg1); break; } - - return 1; + return TRUE; } s32 func_8014AB0C(s32 playerIndex, s16 arg1) { @@ -367,25 +366,21 @@ void bgm_update_volume(void) { } } -// can't figure out the loop -#ifdef NON_EQUIVALENT s32 func_8014AD40(void) { + MusicSettings* settings = &gMusicSettings[0]; s32 i; - for (i = 0; i < 2; i++) { - if (!(gMusicSettings[i].flags & MUSIC_SETTINGS_FLAGS_1)) { + for (i = 0; i < 2; i++, settings++) { + if (!(settings->flags & MUSIC_SETTINGS_FLAGS_1)) { continue; } - if (func_800559FC(gMusicSettings[i].songName) != 0) { - return 1; + if (func_800559FC(settings->songName)) { + return TRUE; } } - return 0; + return FALSE; } -#else -INCLUDE_ASM(s32, "e0b30_len_b80", func_8014AD40); -#endif void bgm_pop_song(void) { MusicSettings* musicSetting = &gMusicSettings[0]; diff --git a/src/entity/103CD0.c b/src/entity/103CD0.c new file mode 100644 index 0000000000..de10e1c2c2 --- /dev/null +++ b/src/entity/103CD0.c @@ -0,0 +1,66 @@ +#include "common.h" + +void entity_shattering_setupGfx(s32 entityIndex); + +void entity_BrickBlock_idle(Entity* entity) { + entity_base_block_idle(entity); +} + +INCLUDE_ASM(void, "entity/103CD0", entity_shattering_init_pieces, Entity* entity, void* arg1, void* arg2); + +INCLUDE_ASM(void, "entity/103CD0", entity_shattering_idle, Entity* entity); + +#ifdef NON_EQUIVALENT +// display list issues +void entity_shattering_setupGfx(s32 entityIndex) { + Gfx* temp_s2; + SwitchData* data; + struct802E2BA4* phi_fp; + Matrix4f subroutine_arg6; + Matrix4f subroutine_arg16; + Matrix4f subroutine_arg36; + Matrix4f subroutine_arg48; + s32 i; + f32 x_inv; + f32 y_inv; + f32 z_inv; + Entity* entity; + f32 threeSixty; + f32 someFloat; + f32 one; + s16 temp; + + temp_s2 = gMasterGfxPos; + threeSixty = 360.0f; + someFloat = 0.00390625f; + entity = get_entity_by_index(entityIndex); + data = entity->dataBuf.swtch; + x_inv = -entity->position.x; + y_inv = -entity->position.y; + z_inv = -entity->position.z; + phi_fp = data->renderYaw; + for (i = 0; i < 24; i++) { + if (data->unk_3C.s == 0xFF) { + gDPSetRenderMode(temp_s2++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + gDPSetCombineMode(temp_s2++, G_CC_MODULATEIA, G_CC_MODULATEIA); + } else { + gDPSetCombineLERP(temp_s2++, 0, 0, 0, TEXEL0, SHADE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0); + gDPSetPrimColor(temp_s2++, 0, 0, 0x00, 0x00, 0x00, data->unk_3C.b[1]) + } + guTranslateF(&subroutine_arg6, x_inv, y_inv, z_inv); + guRotateF(&subroutine_arg36, data->unk_8B[i] * threeSixty * someFloat, 1.0f, 0.0f, 0.0f); + guRotateF(&subroutine_arg48, data->unk_A4[i] * threeSixty * someFloat, 0.0f, 1.0f, 0.0f); + guMtxCatF(&subroutine_arg36, &subroutine_arg48, &subroutine_arg48); + guMtxCatF(&subroutine_arg48, &subroutine_arg6, &subroutine_arg6); + guTranslateF(&subroutine_arg16, data->unk_C0[i], data->unk_124[i], data->unk_188[i]); + guMtxCatF(&subroutine_arg6, &subroutine_arg16, &subroutine_arg16); + guMtxF2L(&subroutine_arg16, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(temp_s2++, &gDisplayContext->matrixStack[++gMatrixListPos], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPDisplayList(temp_s2++, entity->vertexData + phi_fp->unk_02[i][0]); + gSPPopMatrix(temp_s2++, G_MTX_MODELVIEW); + } + gMasterGfxPos = temp_s2; +} +#else +INCLUDE_ASM(s32, "entity/103CD0", entity_shattering_setupGfx); +#endif diff --git a/src/104730.c b/src/entity/104730.c similarity index 71% rename from src/104730.c rename to src/entity/104730.c index ab170ae3cc..fd9db07eb0 100644 --- a/src/104730.c +++ b/src/entity/104730.c @@ -142,7 +142,9 @@ s32 D_802E99FC[7] = { &D_0A003508, 0x00000002, 0x00000000, }; -EntityBlueprint Entity_SavePoint = { 0x4200, 0x0020, &D_802E99FC, {0, 0, 0, 0}, entity_SaveBlock_init, &D_802E9930, entity_block_handle_collision, E4B2E0_ROM_START, E4B2E0_ROM_END, 32, {0x19, 0x19, 0x19}}; +EntityBlueprint Entity_SavePoint = { + 0x4200, 0x0020, &D_802E99FC, {0, 0, 0, 0}, entity_SaveBlock_init, &D_802E9930, entity_block_handle_collision, E4B2E0_ROM_START, E4B2E0_ROM_END, 32, {0x19, 0x19, 0x19} +}; // potential file split(?) s32 D_802E9A3C[1] = { @@ -198,10 +200,18 @@ s32 D_802E9B94[7] = { (s32) &D_0A000740, 0x00000002, 0x00000000, }; -EntityBlueprint Entity_RedSwitch = { 0xA000, 0x002C, &D_802E9B78, {0, 0, 0, 0}, entity_base_switch_init, &D_802E9A40, NULL, E62AC0_ROM_START, E62AC0_ROM_END, ENTITY_TYPE_RED_SWITCH, {0x16, 0x17, 0x16} }; -EntityBlueprint Entity_BlueSwitch = { 0xAA04, 0x002C, &D_802E9B40, {0, 0, 0, 0}, entity_BlueSwitch_init, &D_802E9AC4, NULL, E639C0_ROM_START, E639C0_ROM_END, ENTITY_TYPE_BLUE_SWITCH, {0x16, 0x17, 0x16} }; -EntityBlueprint Entity_HugeBlueSwitch = { 0xAA04, 0x002C, &D_802E9B5C, {0, 0, 0, 0}, entity_HugeBlueSwitch_init, &D_802E9A88, NULL, E639C0_ROM_START, E639C0_ROM_END, ENTITY_TYPE_HUGE_BLUE_SWITCH, {0x42, 0x4B, 0x42} }; -EntityBlueprint Entity_GreenStompSwitch = { 0xC000, 0x002C, &D_802E9B94, {0, 0, 0, 0}, entity_base_switch_init, &D_802E9B00, NULL, E62370_ROM_START, E62370_ROM_END, ENTITY_TYPE_GREEN_STOMP_SWITCH, {0x32, 0x0F, 0x32} }; +EntityBlueprint Entity_RedSwitch = { + 0xA000, 0x002C, &D_802E9B78, {0, 0, 0, 0}, entity_base_switch_init, &D_802E9A40, NULL, E62AC0_ROM_START, E62AC0_ROM_END, ENTITY_TYPE_RED_SWITCH, {0x16, 0x17, 0x16} +}; +EntityBlueprint Entity_BlueSwitch = { + 0xAA04, 0x002C, &D_802E9B40, {0, 0, 0, 0}, entity_BlueSwitch_init, &D_802E9AC4, NULL, E639C0_ROM_START, E639C0_ROM_END, ENTITY_TYPE_BLUE_SWITCH, {0x16, 0x17, 0x16} +}; +EntityBlueprint Entity_HugeBlueSwitch = { + 0xAA04, 0x002C, &D_802E9B5C, {0, 0, 0, 0}, entity_HugeBlueSwitch_init, &D_802E9A88, NULL, E639C0_ROM_START, E639C0_ROM_END, ENTITY_TYPE_HUGE_BLUE_SWITCH, {0x42, 0x4B, 0x42} +}; +EntityBlueprint Entity_GreenStompSwitch = { + 0xC000, 0x002C, &D_802E9B94, {0, 0, 0, 0}, entity_base_switch_init, &D_802E9B00, NULL, E62370_ROM_START, E62370_ROM_END, ENTITY_TYPE_GREEN_STOMP_SWITCH, {0x32, 0x0F, 0x32} +}; s32 D_802E9C40[12] = { 0x00000007, 0x00000020, 0x00000003, 0x00000000, @@ -214,13 +224,27 @@ s32 D_802E9C70[7] = { (s32) &D_802E9828, 0x00000002, 0x00000000 }; -EntityBlueprint Entity_ShatteringHammer1Block = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E32420_ROM_START, E32420_ROM_END, ENTITY_TYPE_HAMMER1_BLOCK, {0x10, 0x10, 0x10}}; -EntityBlueprint Entity_ShatteringHammer2Block = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E35670_ROM_START, E35670_ROM_END, ENTITY_TYPE_HAMMER2_BLOCK, {0x10, 0x10, 0x10}}; -EntityBlueprint Entity_ShatteringHammer3Block = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E38890_ROM_START, E38890_ROM_END, ENTITY_TYPE_HAMMER3_BLOCK, {0x10, 0x10, 0x10}}; -EntityBlueprint Entity_ShatteringHammer1BlockTiny = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E32420_ROM_START, E32420_ROM_END, ENTITY_TYPE_HAMMER1_BLOCK_TINY, {0x08, 0x08, 0x08}}; -EntityBlueprint Entity_ShatteringHammer2BlockTiny = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E35670_ROM_START, E35670_ROM_END, ENTITY_TYPE_HAMMER2_BLOCK_TINY, {0x08, 0x08, 0x08}}; -EntityBlueprint Entity_ShatteringHammer3BlockTiny = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E38890_ROM_START, E38890_ROM_END, ENTITY_TYPE_HAMMER3_BLOCK_TINY, {0x08, 0x08, 0x08}}; -EntityBlueprint Entity_ShatteringBrickBlock = { 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E3E260_ROM_START, E3E260_ROM_END, ENTITY_TYPE_BRICK_BLOCK, {0x08, 0x08, 0x08}}; +EntityBlueprint Entity_ShatteringHammer1Block = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E32420_ROM_START, E32420_ROM_END, ENTITY_TYPE_HAMMER1_BLOCK, {0x10, 0x10, 0x10} +}; +EntityBlueprint Entity_ShatteringHammer2Block = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E35670_ROM_START, E35670_ROM_END, ENTITY_TYPE_HAMMER2_BLOCK, {0x10, 0x10, 0x10} +}; +EntityBlueprint Entity_ShatteringHammer3Block = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E38890_ROM_START, E38890_ROM_END, ENTITY_TYPE_HAMMER3_BLOCK, {0x10, 0x10, 0x10} +}; +EntityBlueprint Entity_ShatteringHammer1BlockTiny = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E32420_ROM_START, E32420_ROM_END, ENTITY_TYPE_HAMMER1_BLOCK_TINY, {0x08, 0x08, 0x08} +}; +EntityBlueprint Entity_ShatteringHammer2BlockTiny = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E35670_ROM_START, E35670_ROM_END, ENTITY_TYPE_HAMMER2_BLOCK_TINY, {0x08, 0x08, 0x08} +}; +EntityBlueprint Entity_ShatteringHammer3BlockTiny = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E38890_ROM_START, E38890_ROM_END, ENTITY_TYPE_HAMMER3_BLOCK_TINY, {0x08, 0x08, 0x08} +}; +EntityBlueprint Entity_ShatteringBrickBlock = { + 0x0000, 0x0250, &D_802E9C70, {0, 0, 0, 0}, entity_shattering_block_init, &D_802E9C40, NULL, E3E260_ROM_START, E3E260_ROM_END, ENTITY_TYPE_BRICK_BLOCK, {0x08, 0x08, 0x08} +}; void entity_shattering_block_init(Entity* entity) { u32 type; @@ -231,7 +255,10 @@ void entity_shattering_block_init(Entity* entity) { entity->dataBuf.swtch->unk_38 = entity->position.y; type = get_entity_type((u8)entity->listIndex); - if ((type - 24) < 3) { + if (type == ENTITY_TYPE_HAMMER1_BLOCK_TINY || + type == ENTITY_TYPE_HAMMER2_BLOCK_TINY || + type == ENTITY_TYPE_HAMMER3_BLOCK_TINY) + { entity->scale.x = 0.5f; entity->scale.y = 0.5f; entity->scale.z = 0.5f; @@ -254,7 +281,7 @@ void entity_shattering_block_init(Entity* entity) { a2 = &D_0A001218; break; case ENTITY_TYPE_BRICK_BLOCK: - sfx_play_sound_at_position(0x158, 0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_158, 0, entity->position.x, entity->position.y, entity->position.z); a1 = &D_0A003F70; a2 = &D_0A002318; break; @@ -275,32 +302,29 @@ void entity_shattering_block_init(Entity* entity) { } void entity_breakable_block_create_shattering_entity(Entity* entity) { - u32 type; - EntityBlueprint* addr = NULL; + EntityBlueprint* bp = NULL; - type = get_entity_type(entity->listIndex); - - switch (type) { + switch (get_entity_type(entity->listIndex)) { case ENTITY_TYPE_HAMMER1_BLOCK: - addr = &Entity_ShatteringHammer1Block; + bp = &Entity_ShatteringHammer1Block; break; case ENTITY_TYPE_HAMMER1_BLOCK_TINY: - addr = &Entity_ShatteringHammer1BlockTiny; + bp = &Entity_ShatteringHammer1BlockTiny; break; case ENTITY_TYPE_HAMMER2_BLOCK: - addr = &Entity_ShatteringHammer2Block; + bp = &Entity_ShatteringHammer2Block; break; case ENTITY_TYPE_HAMMER2_BLOCK_TINY: - addr = &Entity_ShatteringHammer2BlockTiny; + bp = &Entity_ShatteringHammer2BlockTiny; break; case ENTITY_TYPE_HAMMER3_BLOCK: - addr = &Entity_ShatteringHammer3Block; + bp = &Entity_ShatteringHammer3Block; break; case ENTITY_TYPE_HAMMER3_BLOCK_TINY: - addr = &Entity_ShatteringHammer3BlockTiny; + bp = &Entity_ShatteringHammer3BlockTiny; break; case ENTITY_TYPE_BRICK_BLOCK: - addr = &Entity_ShatteringBrickBlock; + bp = &Entity_ShatteringBrickBlock; break; case ENTITY_TYPE_MULTI_COIN_BRICK: case ENTITY_TYPE_YELLOW_BLOCK: @@ -311,9 +335,9 @@ void entity_breakable_block_create_shattering_entity(Entity* entity) { break; } - if (addr == NULL) { + if (bp == NULL) { return; } - create_entity(addr, entity->position.x, entity->position.y, entity->position.z, 0, 0x80000000); + create_entity(bp, entity->position.x, entity->position.y, entity->position.z, 0, 0x80000000); } diff --git a/src/entity/SimpleSpring.c b/src/entity/SimpleSpring.c index 5a384b0e14..82cdc3b3e7 100644 --- a/src/entity/SimpleSpring.c +++ b/src/entity/SimpleSpring.c @@ -1,7 +1,5 @@ #include "common.h" -extern void* D_8015A578; - INCLUDE_ASM(s32, "entity/SimpleSpring", entity_ScriptSpring_idle); #ifdef NON_EQUIVALENT @@ -104,7 +102,7 @@ void entity_HiddenPanel_init(Entity* ent) { s32 phi_v0; data = ent->dataBuf.unk; - mem_clear(&D_8015A578, 0x10); + mem_clear(&D_8015A578, sizeof(D_8015A578)); ent->unk3C = &entity_HiddenPanel_setupGfx; data->unk6 = 0xFFFF; data->unk24 = (?32) ent->unk4C; @@ -127,7 +125,7 @@ void entity_HiddenPanel_init(Entity* ent) { guMtxCatF(&sp58, &sp18, &sp18); guScaleF(&sp58, ent->scale.x, ent->scale.y, ent->scale.z); guMtxCatF(&sp58, &sp18, temp_s1); - if ((D_8015A578.unk1 & 1) != 0) { + if (D_8015A578.unk_01 & 1) { entity_set_render_script(ent, &D_802EAAE0); phi_v0 = 0xA0001B0 & 0xFFFF; } else { @@ -136,7 +134,7 @@ void entity_HiddenPanel_init(Entity* ent) { temp_a1 = ent->vertexData + phi_v0; data->unk78 = temp_a1; mdl_project_tex_coords(data->unk74, temp_a1, temp_s2 + 0x34, ent->unk44); - D_8015A578.unk1 = (u8) (D_8015A578.unk1 + 1); + D_8015A578.unk_01++; } #else diff --git a/src/entity/Switch.c b/src/entity/Switch.c index 13186f9ad6..ebb219715f 100644 --- a/src/entity/Switch.c +++ b/src/entity/Switch.c @@ -1,8 +1,8 @@ #include "common.h" #include "effects.h" -#define REFLECTED_SWITCH_LINKED 2 #define REFLECTED_SWITCH_HIDDEN 1 +#define REFLECTED_SWITCH_LINKED 2 void entity_shattering_init_pieces(Entity* entity, void* arg1, void* arg2); @@ -23,7 +23,7 @@ void entity_GreenStompSwitch_retract(Entity* entity) { SwitchData* data = entity->dataBuf.swtch; u16 curTime = data->greenMotionTimer--; - if (curTime) { + if (curTime != 0) { entity->position.y -= 1.8625; return; } @@ -36,7 +36,7 @@ void entity_GreenStompSwitch_extend(Entity* entity) { SwitchData* data = entity->dataBuf.swtch; u16 curTime = data->greenMotionTimer--; - if (curTime) { + if (curTime != 0) { entity->position.y += 1.8625; return; } @@ -44,8 +44,6 @@ void entity_GreenStompSwitch_extend(Entity* entity) { data->greenMotionTimer = 8; } -void entity_raycast_down(f32*, f32*, f32*, f32*, f32*, f32*); - void entity_switch_fall_down(Entity* entity) { SwitchData* data = entity->dataBuf.swtch; f32 hitDepth = 10.0f; @@ -57,11 +55,12 @@ void entity_switch_fall_down(Entity* entity) { entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitDepth); - if ((entity->position.y != y) && (entity->position.y > y)) { - f32 var = data->fallVelocity; - var += 0.5; - data->fallVelocity = var; - entity->position.y -= var; + if (entity->position.y != y && entity->position.y > y) { + f32 fallVelocity = data->fallVelocity; + + fallVelocity += 0.5; + data->fallVelocity = fallVelocity; + entity->position.y -= fallVelocity; if (entity->position.y < y) { entity->position.y = y; } @@ -142,8 +141,6 @@ void entity_base_switch_anim_init(Entity* entity) { } s32 entity_RedSwitch_animate_scale(Entity* entity) { - f32 temp_f0; - f32 temp_f2; f32 temp_f4; f32 temp_f6; SwitchData* data = entity->dataBuf.swtch; @@ -151,7 +148,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { s32 phi_s2 = 0; switch (data->animStateScaleX) { - case 0: // switch 1 + case 0: temp_f6 = data->baseScale.z * 0.3; temp_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 4.0; phi_f4 = temp_f4; @@ -165,7 +162,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleX++; } break; - case 1: // switch 1 + case 1: temp_f6 = data->baseScale.z * -0.2; temp_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 6.0; phi_f4 = temp_f4; @@ -179,7 +176,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleX++; } break; - case 2: // switch 1 + case 2: temp_f6 = data->baseScale.z * 0.15; temp_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 4.0; phi_f4 = temp_f4; @@ -193,7 +190,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleX++; } break; - case 3: // switch 1 + case 3: temp_f6 = data->baseScale.z * -0.1; temp_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 6.0; phi_f4 = temp_f4; @@ -207,7 +204,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleX++; } break; - case 4: // switch 1 + case 4: temp_f4 = (data->baseScale.x - entity->scale.x) / 4.0; phi_f4 = temp_f4; if (temp_f4 < 0.01) { @@ -221,7 +218,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleX++; } break; - case 5: // switch 1 + case 5: phi_s2++; break; } @@ -229,8 +226,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { entity->scale.z = entity->scale.x; switch (data->animStateScaleY) { - - case 0: // switch 2 + case 0: temp_f6 = data->baseScale.z * -0.5; temp_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 5.0; phi_f4 = temp_f4; @@ -244,7 +240,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleY++; } break; - case 1: // switch 2 + case 1: temp_f6 = data->baseScale.z * 0.1; temp_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 10.0; phi_f4 = temp_f4; @@ -258,7 +254,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleY++; } break; - case 2: // switch 2 + case 2: temp_f6 = data->baseScale.z * -0.3; temp_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 5.0; phi_f4 = temp_f4; @@ -272,7 +268,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleY++; } break; - case 3: // switch 2 + case 3: temp_f6 = data->baseScale.z * 0.0; temp_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 10.0; phi_f4 = temp_f4; @@ -286,7 +282,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleY++; } break; - case 4: // switch 2 + case 4: temp_f4 = (data->baseScale.y - entity->scale.y) / 5.0; phi_f4 = temp_f4; if (temp_f4 > -0.01) { @@ -300,7 +296,7 @@ s32 entity_RedSwitch_animate_scale(Entity* entity) { data->animStateScaleY++; } break; - case 5: // switch 2 + case 5: phi_s2++; break; } @@ -320,7 +316,6 @@ void entity_base_switch_start_bound_script(Entity* entity) { } void entity_base_switch_animate_scale(Entity* entity) { - f32 temp_f0; f32 temp_f4; f32 scaleChange; SwitchData* data = entity->dataBuf.swtch; @@ -454,8 +449,8 @@ void entity_base_switch_animate_scale(Entity* entity) { } data->scaleAnimTimer++; - if ((data->scaleAnimTimer == 10) && (data->linkedSwitch == NULL)) { - fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 0x3C); + if (data->scaleAnimTimer == 10 && data->linkedSwitch == NULL) { + fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 60); } } @@ -501,66 +496,3 @@ void entity_HugeBlueSwitch_init(Entity* entity) { data->baseScale.y = 3.0f; data->baseScale.z = 3.0f; } - -void entity_BrickBlock_idle(Entity* entity) { - entity_base_block_idle(entity); -} - -INCLUDE_ASM(void, "entity/Switch", entity_shattering_init_pieces, Entity* entity, void* arg1, void* arg2); - -INCLUDE_ASM(void, "entity/Switch", entity_shattering_idle, Entity* entity); - -#ifdef NON_EQUIVALENT -// display list issues -void entity_shattering_setupGfx(s32 entityIndex) { - Gfx* temp_s2; - SwitchData* data; - struct802E2BA4* phi_fp; - Matrix4f subroutine_arg6; - Matrix4f subroutine_arg16; - Matrix4f subroutine_arg36; - Matrix4f subroutine_arg48; - s32 i; - f32 x_inv; - f32 y_inv; - f32 z_inv; - Entity* entity; - f32 threeSixty; - f32 someFloat; - f32 one; - s16 temp; - - temp_s2 = gMasterGfxPos; - threeSixty = 360.0f; - someFloat = 0.00390625f; - entity = get_entity_by_index(entityIndex); - data = entity->dataBuf.swtch; - x_inv = -entity->position.x; - y_inv = -entity->position.y; - z_inv = -entity->position.z; - phi_fp = data->renderYaw; - for (i = 0; i < 24; i++) { - if (data->unk_3C.s == 0xFF) { - gDPSetRenderMode(temp_s2++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - gDPSetCombineMode(temp_s2++, G_CC_MODULATEIA, G_CC_MODULATEIA); - } else { - gDPSetCombineLERP(temp_s2++, 0, 0, 0, TEXEL0, SHADE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0); - gDPSetPrimColor(temp_s2++, 0, 0, 0x00, 0x00, 0x00, data->unk_3C.b[1]) - } - guTranslateF(&subroutine_arg6, x_inv, y_inv, z_inv); - guRotateF(&subroutine_arg36, data->unk_8B[i] * threeSixty * someFloat, 1.0f, 0.0f, 0.0f); - guRotateF(&subroutine_arg48, data->unk_A4[i] * threeSixty * someFloat, 0.0f, 1.0f, 0.0f); - guMtxCatF(&subroutine_arg36, &subroutine_arg48, &subroutine_arg48); - guMtxCatF(&subroutine_arg48, &subroutine_arg6, &subroutine_arg6); - guTranslateF(&subroutine_arg16, data->unk_C0[i], data->unk_124[i], data->unk_188[i]); - guMtxCatF(&subroutine_arg6, &subroutine_arg16, &subroutine_arg16); - guMtxF2L(&subroutine_arg16, &gDisplayContext->matrixStack[gMatrixListPos]); - gSPMatrix(temp_s2++, &gDisplayContext->matrixStack[++gMatrixListPos], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPDisplayList(temp_s2++, entity->vertexData + phi_fp->unk_02[i][0]); - gSPPopMatrix(temp_s2++, G_MTX_MODELVIEW); - } - gMasterGfxPos = temp_s2; -} -#else -INCLUDE_ASM(s32, "entity/Switch", entity_shattering_setupGfx); -#endif diff --git a/src/fio.c b/src/fio.c index 5e6b095fee..4214d81af7 100644 --- a/src/fio.c +++ b/src/fio.c @@ -27,7 +27,7 @@ s32 get_spirits_rescued(void) { s32 fio_calc_header_checksum(void) { u32 sum = 0; - s32* it = D_800D95E8; + s32* it = &D_800D95E8; u32 i; for (i = 0; i < 0x20; i++, it++) { @@ -66,16 +66,16 @@ s32 fio_has_valid_backup(void) { s32 fio_flush_backups(void) { s32 checksum; - strcpy(D_800D95E8, &magicSaveString); - D_800D95E8[12] = 0; - D_800D95E8[13] = -1; + strcpy(D_800D95E8.magicString, &magicSaveString); + D_800D95E8.crc1 = 0; + D_800D95E8.crc2 = -1; checksum = fio_calc_header_checksum(); - D_800D95E8[12] = checksum; - D_800D95E8[13] = ~checksum; + D_800D95E8.crc1 = checksum; + D_800D95E8.crc2 = ~checksum; fio_erase_flash(6); - fio_write_flash(6, D_800D95E8, 128); + fio_write_flash(6, &D_800D95E8, 0x80); fio_erase_flash(7); - fio_write_flash(7, D_800D95E8, 128); + fio_write_flash(7, &D_800D95E8, 0x80); return 1; } @@ -84,7 +84,7 @@ s32 fio_calc_file_checksum(SaveData* saveData) { s32* it = saveData; u32 i; - for (i = 0; i < 0x4E0; i++, it++) { + for (i = 0; i < sizeof(*saveData) / sizeof(*it); i++, it++) { sum += *it; } return sum; diff --git a/src/fio.h b/src/fio.h index 6bb03249cd..6eccff9a41 100644 --- a/src/fio.h +++ b/src/fio.h @@ -51,7 +51,7 @@ extern s32 physicalSaveInfo[6][2]; extern s32 nextAvailableSavePage; -extern s32 D_800D95E8[]; +extern SaveData D_800D95E8; extern s32 D_8009A6B0[]; diff --git a/src/npc.c b/src/npc.c index 799ce3e122..55c1d0dfbc 100644 --- a/src/npc.c +++ b/src/npc.c @@ -22,7 +22,7 @@ void STUB_npc_callback(Npc* npc) { } void mtx_ident_mirror_y(Matrix4f mtx) { - guMtxIdentF(*mtx); + guMtxIdentF(mtx); mtx[0][0] = 1.0f; mtx[1][1] = -1.0f; mtx[2][2] = 1.0f; @@ -575,7 +575,7 @@ void render_npcs(void) { Npc* npc = (*gCurrentNpcListPtr)[i]; if (npc != NULL) { if (npc->flags && !(npc->flags & (NPC_FLAG_80000000 | NPC_FLAG_1000000 | NPC_FLAG_4 | NPC_FLAG_2))) { - transform_point(&cam->perspectiveMatrix, npc->pos.x, npc->pos.y, npc->pos.z, 1.0f, &x, &y, &z, &s); + transform_point(cam->perspectiveMatrix, npc->pos.x, npc->pos.y, npc->pos.z, 1.0f, &x, &y, &z, &s); if (!(s < 0.01) || !(s > -0.01)) { phi_f20 = ((z * 5000.0f) / s) + 5000.0f; if (phi_f20 < 0.0f) { @@ -686,7 +686,6 @@ void set_npc_sprite(Npc* npc, s32 anim, s32** extraAnimList) { ASSERT(npc->spriteInstanceID >= 0); } - npc->currentAnim.w = anim; if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { @@ -1195,27 +1194,33 @@ Npc* npc_find_closest_simple(f32 x, f32 y, f32 z, f32 radius) { // Needs work #ifdef NON_EQUIVALENT s32 npc_find_standing_on_entity(s32 arg0) { - s32 entityIndex = (arg0 | 0x4000); - s32 yTemp = get_entity_by_index(entityIndex)->position.y - 10.0f; + s32 entityIndex = arg0 | 0x4000; + Entity* entity = get_entity_by_index(entityIndex); + s32 y = entity->position.y - 10.0f; + s32 floorID; s32 i; for (i = 0; i < ARRAY_COUNT(*gCurrentNpcListPtr); i++) { Npc* npc = (*gCurrentNpcListPtr)[i]; - if (npc != NULL && npc->flags != 0) { - if (!(npc->flags & (0x80000000 | 0x4))) { - if (!(npc->pos.y < yTemp)) { - s32 temp_v0; + if (npc != NULL) { + if (npc->flags != 0) { + if (!(npc->flags & 0x80000004)) { + if (!(npc->pos.y < y)) { + if (npc->flags & 0x8008) { + floorID = npc_get_collider_below(npc); + if (floorID == 0) { + continue; + } + } else { + floorID = npc->currentFloor; - if (npc->flags & 0x8008) { - temp_v0 = npc_get_collider_below(npc); - if (temp_v0 != 0) { - if (entityIndex == temp_v0) { - return i; + if (!(floorID & 0x4000)) { + continue; } } - } else if (npc->unk_84 & 0x4000) { - if (entityIndex == npc->unk_84) { + + if (entityIndex == floorID) { return i; } } @@ -1337,14 +1342,12 @@ void func_8003D624(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s func_8003D3BC(npc); } -#ifdef NON_EQUIVALENT -// Rodata padding issue. Most likely belongs to a separate TU than the function above with the switch. void func_8003D660(Npc* npc, s32 arg1) { PartnerActionStatus* temp = &gPartnerActionStatus; if ((npc->flags & (NPC_FLAG_400000 | NPC_FLAG_2)) == NPC_FLAG_400000) { if (npc->moveSpeed != 0.0f) { - switch (get_collider_type_by_id((u16)npc->unk_84) & 0xFF) { + switch (get_collider_type_by_id((u16)npc->currentFloor) & 0xFF) { case 6: func_8003DA38(npc, arg1); return; @@ -1352,7 +1355,7 @@ void func_8003D660(Npc* npc, s32 arg1) { func_8003DC38(npc, arg1); return; case 8: - if ((temp->unk_00 == 0) || (temp->unk_03 != 8)) { + if ((temp->actionState.b[0] == 0) || (temp->actionState.b[3] != 8)) { func_8003DFA0(npc, arg1); return; } @@ -1374,14 +1377,13 @@ void func_8003D660(Npc* npc, s32 arg1) { } } } -#else -INCLUDE_ASM(void, "npc", func_8003D660, Npc* npc, s32 arg1); -#endif + +static const f32 padding[2] = { 0.0f, 0.0f }; // todo remove when below funcs are decompiled void func_8003D788(Npc* npc, s32 arg1) { s32 phi_a2; - f32 subroutine_argA; - f32 subroutine_argB; + f32 sinTheta; + f32 cosTheta; phi_a2 = 0; if (gGameStatusPtr->areaID == 5) { @@ -1402,23 +1404,59 @@ void func_8003D788(Npc* npc, s32 arg1) { if (D_80077C14++ >= 4) { D_80077C14 = 0; if (phi_a2 == 0) { - sin_cos_rad((clamp_angle(-npc->yaw) * TAU) / 360.0f, &subroutine_argA, &subroutine_argB); - fx_walking_dust(0, npc->pos.x + (npc->collisionRadius * subroutine_argA * 0.2f), npc->pos.y + 1.5f, - npc->pos.z + (npc->collisionRadius * subroutine_argB * 0.2f), subroutine_argA, subroutine_argB); + sin_cos_rad((clamp_angle(-npc->yaw) * TAU) / 360.0f, &sinTheta, &cosTheta); + fx_walking_dust(0, npc->pos.x + (npc->collisionRadius * sinTheta * 0.2f), npc->pos.y + 1.5f, + npc->pos.z + (npc->collisionRadius * cosTheta * 0.2f), sinTheta, cosTheta); } else { - sin_cos_rad((clamp_angle(npc->yaw) * TAU) / 360.0f, &subroutine_argA, &subroutine_argB); - fx_misc_particles(3, npc->pos.x + (npc->collisionRadius * subroutine_argA), npc->pos.y + 1.5f, - npc->pos.z + (npc->collisionRadius * subroutine_argB), 5.0f, 10.0f, 1.0f, 5, 30); + sin_cos_rad((clamp_angle(npc->yaw) * TAU) / 360.0f, &sinTheta, &cosTheta); + fx_misc_particles(3, npc->pos.x + (npc->collisionRadius * sinTheta), npc->pos.y + 1.5f, + npc->pos.z + (npc->collisionRadius * cosTheta), 5.0f, 10.0f, 1.0f, 5, 30); } } } } +// floats suck +#ifdef NON_MATCHING +void func_8003DA38(Npc* npc, s32 arg1) { + f32 theta; + f32 sinTheta; + f32 cosTheta; + f32 x, y, z; + + if (arg1 == 2 && D_80077C1E == 5) { + fx_flower_splash(npc->pos.x, npc->pos.y + 14.0f, npc->pos.z, D_80077C18); + D_80077C18 = clamp_angle(D_80077C18 + 35.0f); + D_80077C1E = 0; + return; + } + + D_80077C1E++; + if (D_80077C1E > 5) { + D_80077C1E = 5; + } + + if (D_80077C1C++ > 0) { + D_80077C1C = 0; + theta = clamp_angle(-npc->yaw) * TAU / 360.0f; + sinTheta = sin_rad(theta); + cosTheta = cos_rad(theta); + + x = npc->pos.x + (npc->collisionRadius * sinTheta * -0.4f); + z = npc->pos.z + (npc->collisionRadius * cosTheta * -0.4f); + y = npc->pos.y + 15.5f; + + fx_flower_trail(1, x, y, z, -npc->yaw + rand_int(10) - 5.0f, D_80077C20); + D_80077C20 = D_80077C20 == 0; + } +} +#else INCLUDE_ASM(void, "npc", func_8003DA38, Npc* npc, s32 arg1); +#endif INCLUDE_ASM(s32, "npc", func_8003DC38); -void func_8003DFA0(Npc* npc) { +void func_8003DFA0(Npc* npc, s32 arg1) { if (D_80077C30++ >= 4) { f32 temp_f20; f32 x; @@ -1434,7 +1472,7 @@ void func_8003DFA0(Npc* npc) { } } -void func_8003E0D4(Npc* npc) { +void func_8003E0D4(Npc* npc, s32 arg1) { if (D_80077C38++ >= 4) { f32 theta; f32 sinTheta; @@ -1449,7 +1487,7 @@ void func_8003E0D4(Npc* npc) { } } -void func_8003E1D0(Npc* npc) { +void func_8003E1D0(Npc* npc, s32 arg1) { if (D_80077C3A++ >= 4) { f32 temp_f20; f32 x; @@ -1666,8 +1704,6 @@ s32 kill_encounter(Enemy* enemy) { } } -#ifdef NON_EQUIVALENT -// regalloc. s2/s3 switched void kill_enemy(Enemy* enemy) { EncounterStatus* encounterStatus = &gCurrentEncounter; Encounter* encounter = encounterStatus->encounterList[enemy->encounterIndex]; @@ -1718,20 +1754,20 @@ void kill_enemy(Enemy* enemy) { } } - if (!(enemy->flags & ENEMY_FLAGS_4)) { - if (!(enemy->flags & ENEMY_FLAGS_8) || (enemy == encounterStatus->currentEnemy)) { - if (!(enemy->flags & ENEMY_FLAGS_1)) { - if (!(enemy->flags & ENEMY_FLAGS_10)) { - COPY_set_defeated((s8)encounterStatus->mapID, encounter->encounterID + i); + do { + if (!(enemy->flags & ENEMY_FLAGS_4)) { + if (!(enemy->flags & ENEMY_FLAGS_8) || (enemy == encounterStatus->currentEnemy)) { + if (!(enemy->flags & ENEMY_FLAGS_1)) { + if (!(enemy->flags & ENEMY_FLAGS_10)) { + COPY_set_defeated(encounterStatus->mapID, encounter->encounterID + i); + } } } } - } + } while (0); // required to match + heap_free(enemy); } -#else -INCLUDE_ASM(void, "npc", kill_enemy); -#endif s32 bind_enemy_ai(Enemy* enemy, EvtScript* aiScriptBytecode) { Evt* aiScript; diff --git a/src/pause/pause_main.c b/src/pause/pause_main.c index 0428665225..34891c8170 100644 --- a/src/pause/pause_main.c +++ b/src/pause/pause_main.c @@ -610,7 +610,7 @@ void pause_init(void) { posX = 225; for (i = 6; i > 0; i--) { if (!gPausePanels[i]->initialized) { - set_window_update(24 + i, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_PAUSE_TUTORIAL + i, WINDOW_UPDATE_HIDE); } else { gWindows[WINDOW_ID_PAUSE_TUTORIAL + i].pos.x = posX + 14; posX -= 45; diff --git a/src/status_icons.c b/src/status_icons.c index 5396c86b59..b2287388d8 100644 --- a/src/status_icons.c +++ b/src/status_icons.c @@ -242,7 +242,7 @@ void update_merlee_message(PopupMessage* popup) { } if (closeMessage) { - set_window_update(9, WINDOW_UPDATE_HIDE); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE); D_800A0F40 = 0; dispose_merlee_message(popup); } @@ -270,7 +270,7 @@ void draw_merlee_message(PopupMessage* popup) { width = get_msg_width(messageID, 0) + 30; xPos = 160 - (width / 2); set_window_properties(9, xPos, 80, width, D_80078160[get_msg_lines(messageID) - 1], 0, draw_merlee_message_string, popup, -1); - set_window_update(9, WINDOW_UPDATE_SHOW); + set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW); } } diff --git a/src/world/action/encounter.c b/src/world/action/encounter.c index 82681ef193..5269a602c3 100644 --- a/src/world/action/encounter.c +++ b/src/world/action/encounter.c @@ -3,13 +3,17 @@ extern f32 D_802B6770_E27C80; -//wip - not good yet -#ifdef NON_EQUIVALENT +// the switch +#ifdef NON_MATCHING void func_802B6000_E28A30(void) { PlayerStatus* playerStatus = &gPlayerStatus; + s32 oldFlags = playerStatus->flags; if (playerStatus->flags < 0) { - playerStatus->flags &= 0x7FF7FFF1; + playerStatus->flags &= ~( + PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_8 | + PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING + ); playerStatus->fallState = 0; playerStatus->framesOnGround = 0; playerStatus->decorationList = 0; @@ -19,10 +23,13 @@ void func_802B6000_E28A30(void) { } if (playerStatus->animFlags & 0x400000) { - if (gPartnerActionStatus.actionState.b[3] == 8) { - func_802BD100_317020(playerStatus->flags); - } else if (gPartnerActionStatus.actionState.b[3] == 7) { - func_802BD100_317020(playerStatus->flags); + switch (gPartnerActionStatus.actionState.b[3]) { + case 8: + func_802BD100_317020(oldFlags); + break; + case 7: + func_802BD100_317020(oldFlags); + break; } } } diff --git a/src/world/action/hammer.c b/src/world/action/hammer.c index dd5e19e398..54232e032a 100644 --- a/src/world/action/hammer.c +++ b/src/world/action/hammer.c @@ -12,6 +12,8 @@ typedef struct HammerHitData { extern HammerHitData* HammerHit; +void func_802B6820_E256F0(void); + s32 action_hammer_is_swinging_away(s32 animID) { if (animID & 0x1000000) { return TRUE; @@ -44,17 +46,17 @@ void action_hammer_play_hit_fx(s32 hitID) { shakeAmt = 1.2f; time = 1; radius = 28; - soundID = 0x211A; + soundID = SOUND_211A; } else if (gPlayerData.hammerLevel == 1) { shakeAmt = 0.8f; time = 1; radius = 16; - soundID = 0x2119; + soundID = SOUND_2119; } else { shakeAmt = 0.4f; time = 1; radius = 4; - soundID = 0x2118; + soundID = SOUND_2118; } theta = (func_800E5348() * TAU) / 360.0f; @@ -79,30 +81,137 @@ void action_hammer_play_hit_fx(s32 hitID) { switch (is_ability_active(ABILITY_ATTACK_FX)) { case 1: - soundID = 0x372; + soundID = SOUND_372; break; case 2: - soundID = 0xF1; + soundID = SOUND_F1; break; case 3: - soundID = 0xDC; + soundID = SOUND_DC; break; case 4: - soundID = 0x2072; + soundID = SOUND_2072; break; case 5: - soundID = 0x2073; + soundID = SOUND_2073; break; case 6: - soundID = 0x205B; + soundID = SOUND_205B; break; } sfx_play_sound_at_player(soundID, 0); - start_rumble(0x100, 0x32); + start_rumble(0x100, 50); } -INCLUDE_ASM(s32, "world/action/hammer", func_802B62A4_E25174); +s32 func_802B62A4_E25174(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + f32 yaw; + f32 angle; + f32 outSinTheta; + f32 outCosTheta; + f32 playerX, playerY, playerZ; + f32 x, y, z; + s32 ret; + s32 i; + + yaw = func_800E5348(); + if (action_hammer_is_swinging_away(playerStatus->trueAnimation)) { + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + if (angle >= 90.0f && angle < 270.0f) { + yaw += -30.0f; + } else { + yaw += 30.0f; + } + } + + sin_cos_rad(yaw * TAU / 360.0f, &outSinTheta, &outCosTheta); + playerX = playerStatus->position.x; + playerY = playerStatus->position.y; + playerZ = playerStatus->position.z; + + for (i = 1; i < 16; i++) { + x = playerX + (outSinTheta * i); + y = playerY; + z = playerZ - (outCosTheta * i); + ret = player_test_lateral_overlap(3, playerStatus, &x, &y, &z, 4.0f, yaw); + if (ret >= 0) { + HammerHit->hitPos.x = x; + HammerHit->hitPos.y = y; + HammerHit->hitPos.z = z; + break; + } + } + + if (i >= 0x10) { + yaw = func_800E5348(); + if (!action_hammer_is_swinging_away(playerStatus->trueAnimation)) { + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + if (angle >= 90.0f && angle < 270.0f) { + yaw += 15.0f; + } else { + yaw += -15.0f; + } + } + + sin_cos_rad(yaw * TAU / 360.0f, &outSinTheta, &outCosTheta); + for (i = 1; i < 16; i++) { + x = playerX + (outSinTheta * i); + y = playerY; + z = playerZ - (outCosTheta * i); + + ret = player_test_lateral_overlap(3, playerStatus, &x, &y, &z, 4.0f, yaw); + if (ret >= 0) { + HammerHit->hitPos.x = x; + HammerHit->hitPos.y = y; + HammerHit->hitPos.z = z; + break; + } + } + } + + if (ret >= 0 && (ret & 0x4000)) { + s32 hammerLevel = gPlayerData.hammerLevel; + + switch (get_entity_type(ret)) { + case ENTITY_TYPE_HAMMER1_BLOCK: + case ENTITY_TYPE_HAMMER1_BLOCK_TINY: + if (hammerLevel >= 0) { + ret = -1; + } else { + playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + } + break; + case ENTITY_TYPE_HAMMER2_BLOCK: + case ENTITY_TYPE_HAMMER2_BLOCK_TINY: + if (hammerLevel >= 1) { + ret = -1; + } else { + playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + } + break; + case ENTITY_TYPE_HAMMER3_BLOCK: + case ENTITY_TYPE_HAMMER3_BLOCK_TINY: + if (hammerLevel >= 2) { + ret = -1; + } else { + playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + } + break; + case ENTITY_TYPE_WOODEN_CRATE: + case ENTITY_TYPE_BOMBABLE_ROCK: + playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_SHIVERING; + break; + case ENTITY_TYPE_BLUE_SWITCH: + case ENTITY_TYPE_RED_SWITCH: + case ENTITY_TYPE_BRICK_BLOCK: + ret = -1; + break; + } + } + + return ret; +} void action_hammer_update(void) { PlayerStatus* playerStatus = &gPlayerStatus; @@ -119,27 +228,27 @@ void action_hammer_update(void) { playerStatus->fallState = 0; playerStatus->currentSpeed = 0.0f; playerStatus->unk_BC = 0; - HammerHit->hitID = func_802B62A4_E25174(HammerHit); + HammerHit->hitID = func_802B62A4_E25174(); if (gPlayerData.hammerLevel == 2) { - soundID = 0x2117; + soundID = SOUND_2117; animID = 0x6001A; if (HammerHit->hitID < 0) { - soundID = 0x2117; + soundID = SOUND_2117; animID = 0x60018; } } else if (gPlayerData.hammerLevel == 1) { - soundID = 0x2116; + soundID = SOUND_2116; animID = 0x60016; if (HammerHit->hitID < 0) { - soundID = 0x2116; + soundID = SOUND_2116; animID = 0x60014; } } else { - soundID = 0x2115; + soundID = SOUND_2115; animID = 0x60012; if (HammerHit->hitID < 0) { - soundID = 0x2115; + soundID = SOUND_2115; animID = 0x60010; } } @@ -156,8 +265,149 @@ void action_hammer_update(void) { } else if (HammerHit->timer < 2) { HammerHit->timer++; } else { - func_802B6820_E256F0(HammerHit); + func_802B6820_E256F0(); } } -INCLUDE_ASM(s32, "world/action/hammer", func_802B6820_E256F0); +void func_802B6820_E256F0(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + CollisionStatus* collisionStatus; + f32 yaw; + f32 angle; + f32 outSinTheta; + f32 outCosTheta; + f32 playerX, playerY, playerZ; + f32 x, y, z; + s32 result; + s32 hammerLevel; + s32 soundID; + u32 unk_BC; + s32 ten; + s32 ret; + s32 i; + + do { + collisionStatus = &gCollisionStatus; + } while (0); // required to match; + + yaw = func_800E5348(); + if (action_hammer_is_swinging_away(playerStatus->trueAnimation)) { + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + if (angle >= 90.0f && angle < 270.0f) { + yaw += -30.0f; + } else { + yaw += 30.0f; + } + } + + sin_cos_rad(yaw * TAU / 360.0f, &outSinTheta, &outCosTheta); + playerX = playerStatus->position.x; + playerY = playerStatus->position.y; + playerZ = playerStatus->position.z; + + for (i = 1; i < 16; i++) { + x = playerX + (outSinTheta * i); + y = playerY; + z = playerZ - (outCosTheta * i); + result = player_test_lateral_overlap(3, playerStatus, &x, &y, &z, 4.0f, yaw); + if (HammerHit->unk_14 == 0) { + collisionStatus->lastWallHammered = result; + if (result >= 0) { + if (result & 0x4000) { + get_entity_by_index(result)->unk_07 = 0; + } + } + } + + if (result >= 0) { + break; + } + } + + if (i >= 16) { + yaw = func_800E5348(); + if (action_hammer_is_swinging_away(playerStatus->trueAnimation) == 0) { + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + if (angle >= 90.0f && angle < 270.0f) { + yaw += 15.0f; + } else { + yaw += -15.0f; + } + } + sin_cos_rad(yaw * TAU / 360.0f, &outSinTheta, &outCosTheta); + + for (i = 1; i < 16; i++) { + x = playerX + (outSinTheta * i); + y = playerY; + z = playerZ - (outCosTheta * i); + result = player_test_lateral_overlap(3, playerStatus, &x, &y, &z, 4.0f, yaw); + if (HammerHit->unk_14 == 0) { + collisionStatus->lastWallHammered = result; + if (result >= 0) { + if (result & 0x4000) { + get_entity_by_index(result)->unk_07 = 0; + } + } + } + + if (result >= 0) { + break; + } + } + } + + if (HammerHit->timer == 2) { + hammerLevel = gPlayerData.hammerLevel; + if (hammerLevel == 2) { + soundID = SOUND_2117; + } else if (hammerLevel == 1) { + soundID = SOUND_2116; + } else { + soundID = SOUND_2115; + } + sfx_play_sound_at_player(soundID, 0); + + action_hammer_play_hit_fx(HammerHit->hitID); + + if (collisionStatus->lastWallHammered >= 0 && (collisionStatus->lastWallHammered & 0x4000)) { + get_entity_by_index(collisionStatus->lastWallHammered)->unk_07 = 0; + playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000; + } else if (HammerHit->hitID < 0) { + playerStatus->flags |= PLAYER_STATUS_FLAGS_1000000; + } + + if (HammerHit->hitID < 0 && gPlayerData.hammerLevel >= 2) { + D_8015A578.unk_00 = 1; + D_8015A578.unk_08 = playerStatus->position.y; + } + } + + if (playerStatus->fallState == 0 && result >= 0 && HammerHit->unk_14 == 0) { + playerStatus->fallState++; + } + if (playerStatus->fallState == 1 && result < 0) { + playerStatus->fallState = 2; + } + HammerHit->timer += 1; + if (result >= 0) { + HammerHit->unk_14 = 1; + } + if (HammerHit->timer == 6) { + playerStatus->flags &= ~PLAYER_STATUS_FLAGS_200000; + } + + unk_BC = playerStatus->unk_BC; + if (unk_BC == 1) { + if (HammerHit->timer >= 7 && (playerStatus->pressedButtons & BUTTON_B)) { + HammerHit->unk_1C = unk_BC; + } + + HammerHit->unk_14 = 0; + ten = 10; // required to match + if (HammerHit->unk_1C != 0 || HammerHit->timer > ten) { + playerStatus->flags &= ~PLAYER_STATUS_FLAGS_1000000; + set_action_state(ACTION_STATE_IDLE); + } + playerStatus->flags &= ~PLAYER_STATUS_FLAGS_200000; + } +} diff --git a/src/world/action/land.c b/src/world/action/land.c index 1424bff3ad..0b3064dd81 100644 --- a/src/world/action/land.c +++ b/src/world/action/land.c @@ -4,14 +4,14 @@ void func_802B62CC_E24BEC(void); void func_802B644C_E24D6C(void); void func_802B6000_E24920(void) { - CollisionStatus* currentCollisionStatus = &gCollisionStatus; + CollisionStatus* collisionStatus = &gCollisionStatus; PlayerStatus* playerStatus = &gPlayerStatus; Camera* camera = &gCameras[CAM_DEFAULT]; f32 inputMoveMagnitude; f32 inputMoveAngle; s32 jumpInputCheck; s32 phi_a0; - + if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_USING_PEACH_PHYSICS) { func_802B62CC_E24BEC(); return; @@ -19,11 +19,11 @@ void func_802B6000_E24920(void) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | - PLAYER_STATUS_FLAGS_800000 | - PLAYER_STATUS_FLAGS_80000 | + PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | + PLAYER_STATUS_FLAGS_800000 | + PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_FLYING | - PLAYER_STATUS_FLAGS_FALLING | + PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING ); playerStatus->fallState = 0; @@ -33,26 +33,22 @@ void func_802B6000_E24920(void) { playerStatus->landPos.z = playerStatus->position.z; if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_8BIT_MARIO) { - phi_a0 = 0x90000; - phi_a0 |= 0x2; - + phi_a0 = 0x90002; + } else if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT)) { + phi_a0 = 0x10009; } else { phi_a0 = 0x6000B; - if (!(playerStatus->animFlags & 1)) { - phi_a0 = 0x10000; - phi_a0 |= 0x9; - } } - + suggest_player_anim_clearUnkFlag(phi_a0); sfx_play_sound_at_player(0x8161, 0); sfx_play_sound_at_player(0x148, 0); - if (!(currentCollisionStatus->currentFloor & 0x4000)) { + if (!(collisionStatus->currentFloor & 0x4000)) { phys_adjust_cam_on_landing(); } - currentCollisionStatus->lastTouchedFloor = -1; + collisionStatus->lastTouchedFloor = -1; playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_40000; camera->moveFlags &= ~0x4; } @@ -64,7 +60,7 @@ void func_802B6000_E24920(void) { if (jumpInputCheck != 0 || jumpInputCheck < playerStatus->fallState) { if (inputMoveMagnitude == 0.0f) { - set_action_state(0); + set_action_state(ACTION_STATE_IDLE); return; } if (inputMoveMagnitude != 0.0f) { @@ -75,7 +71,7 @@ void func_802B6000_E24920(void) { } void func_802B61C0_E24AE0(void) { - CollisionStatus* currentCollisionStatus = &gCollisionStatus; + CollisionStatus* collisionStatus = &gCollisionStatus; PlayerStatus* playerStatus = &gPlayerStatus; f32 inputMoveMagnitude; f32 inputMoveAngle; @@ -87,11 +83,11 @@ void func_802B61C0_E24AE0(void) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~( - PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | - PLAYER_STATUS_FLAGS_800000 | - PLAYER_STATUS_FLAGS_80000 | + PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED | + PLAYER_STATUS_FLAGS_800000 | + PLAYER_STATUS_FLAGS_80000 | PLAYER_STATUS_FLAGS_FLYING | - PLAYER_STATUS_FLAGS_FALLING | + PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING ); playerStatus->fallState = 0; @@ -100,11 +96,11 @@ void func_802B61C0_E24AE0(void) { playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; - if (!(currentCollisionStatus->currentFloor & 0x4000)) { + if (!(collisionStatus->currentFloor & 0x4000)) { phys_adjust_cam_on_landing(); } - currentCollisionStatus->lastTouchedFloor = -1; + collisionStatus->lastTouchedFloor = -1; } playerStatus->fallState++; @@ -116,17 +112,15 @@ void func_802B61C0_E24AE0(void) { if (inputMoveMagnitude != 0.0f) { playerStatus->targetYaw = inputMoveAngle; } - + update_locomotion_state(); } void func_802B62CC_E24BEC(void) { - CollisionStatus* currentCollisionStatus = &gCollisionStatus; + CollisionStatus* collisionStatus = &gCollisionStatus; PlayerStatus* playerStatus = &gPlayerStatus; f32 inputMoveMagnitude; f32 inputMoveAngle; - s32 squaredStick0; - s32 squaredStick1; if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; @@ -137,13 +131,13 @@ void func_802B62CC_E24BEC(void) { playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; - sfx_play_sound_at_player(0x148, 0); + sfx_play_sound_at_player(SOUND_SOFT_LAND, 0); - if (!(currentCollisionStatus->currentFloor & 0x4000)) { + if (!(collisionStatus->currentFloor & 0x4000)) { phys_adjust_cam_on_landing(); } - currentCollisionStatus->lastTouchedFloor = -1; + collisionStatus->lastTouchedFloor = -1; } playerStatus->fallState++; @@ -151,33 +145,27 @@ void func_802B62CC_E24BEC(void) { player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); - if (inputMoveMagnitude != 0.0f) { + if (inputMoveMagnitude == 0.0f) { + set_action_state(ACTION_STATE_IDLE); + } else { if (inputMoveMagnitude != 0.0f) { playerStatus->targetYaw = inputMoveAngle; } - squaredStick0 = SQ(playerStatus->stickAxis[0]); - squaredStick1 = SQ(playerStatus->stickAxis[1]); - - if (!(sqrtf(squaredStick0 + squaredStick1) > 55.0f)) { + if (sqrtf(SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1])) > 55.0f) { + set_action_state(ACTION_STATE_RUN); + } else { set_action_state(ACTION_STATE_WALK); - return; } - - set_action_state(ACTION_STATE_RUN); - } else { - set_action_state(ACTION_STATE_IDLE); } } void func_802B644C_E24D6C(void) { - CollisionStatus* currentCollisionStatus = &gCollisionStatus; + CollisionStatus* collisionStatus = &gCollisionStatus; PlayerStatus* playerStatus = &gPlayerStatus; f32 inputMoveMagnitude; f32 inputMoveAngle; - s32 squaredStick0; - s32 squaredStick1; - + if (playerStatus->flags & PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PLAYER_STATUS_FLAGS_ACTION_STATE_CHANGED; playerStatus->fallState = 0; @@ -187,26 +175,21 @@ void func_802B644C_E24D6C(void) { playerStatus->landPos.x = playerStatus->position.x; playerStatus->landPos.z = playerStatus->position.z; - if (!(currentCollisionStatus->currentFloor & 0x4000)) { + if (!(collisionStatus->currentFloor & 0x4000)) { phys_adjust_cam_on_landing(); } - - currentCollisionStatus->lastTouchedFloor = -1; + collisionStatus->lastTouchedFloor = -1; } - playerStatus->fallState = playerStatus->fallState + 1; + playerStatus->fallState++; playerStatus->currentSpeed *= 0.6f; - player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); if (inputMoveMagnitude != 0.0f) { playerStatus->targetYaw = inputMoveAngle; } - squaredStick0 = playerStatus->stickAxis[0] * playerStatus->stickAxis[0]; - squaredStick1 = playerStatus->stickAxis[1] * playerStatus->stickAxis[1]; - - if (sqrtf(squaredStick0 + squaredStick1) > 55.0f) { + if (sqrtf(SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1])) > 55.0f) { set_action_state(ACTION_STATE_RUN); } else { set_action_state(ACTION_STATE_WALK); diff --git a/src/world/action/super_boots.c b/src/world/action/super_boots.c index 8a6c00dec0..d7983850a7 100644 --- a/src/world/action/super_boots.c +++ b/src/world/action/super_boots.c @@ -1,7 +1,6 @@ #include "common.h" extern f32 D_802B6730; -extern struct struct8015A578 D_8015A578; s32 func_802B6648_E27428(void); @@ -9,7 +8,7 @@ void func_802B6000_E26DE0(void) { PlayerStatus* playerStatus = &gPlayerStatus; CollisionStatus* collisionStatus = &gCollisionStatus; Entity* entity; - struct8015A578* tempStruct; + Struct8015A578* tempStruct; s32 sp10; s32 tempCondition; f32 temp_f20; diff --git a/src/world/action/ultra_boots.c b/src/world/action/ultra_boots.c index 4cf6f19dec..ecc6a68723 100644 --- a/src/world/action/ultra_boots.c +++ b/src/world/action/ultra_boots.c @@ -3,15 +3,12 @@ extern s32 gSpinHistoryBufferPos; extern s32 gSpinHistoryPosY[5]; extern s16 gSpinHistoryPosAngle[5]; -extern struct struct8015A578 D_8015A578; s32 func_802B65F8_E26D08(void); void func_802B6000_E26710(void) { PlayerStatus* playerStatus = &gPlayerStatus; CollisionStatus* collisionStatus = &gCollisionStatus; - struct8015A578* tempStruct; - struct8015A578* tempStruct2; f32 temp_f0; f32 temp_f20; u8 colliderType; @@ -116,9 +113,8 @@ void func_802B6000_E26710(void) { sfx_play_sound_at_player(0x14A, 0); start_rumble(0x100, 0x32); - tempStruct = &D_8015A578; - tempStruct->unk_00 = 1; - tempStruct->unk_08 = playerStatus->position.y; + D_8015A578.unk_00 = 1; + D_8015A578.unk_08 = playerStatus->position.y; playerStatus->flags |= 0x400; return; } @@ -144,9 +140,8 @@ void func_802B6000_E26710(void) { sfx_play_sound_at_player(0x14A, 0); start_rumble(0x100, 0x32); - tempStruct2 = &D_8015A578; - tempStruct2->unk_00 = 1; - tempStruct2->unk_08 = playerStatus->position.y; + D_8015A578.unk_00 = 1; + D_8015A578.unk_08 = playerStatus->position.y; playerStatus->flags |= 0x400; } break; diff --git a/src/world/partners.c b/src/world/partners.c index 327c0c77f3..4409d7864d 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -92,19 +92,13 @@ extern s16 D_8010CFC8; extern s16 D_8010CFCA; extern s16 D_8010CFCE; extern s32 D_802C0000; -extern s32 PlayerMoveHistoryIndex; +extern s32 gPlayerMoveHistoryIndex; extern s32 D_8010CFBC; -extern s32 D_8010CFCC; +extern s16 D_8010CFCC; -extern struct player_path_element PlayerMoveHistory[40]; +extern PlayerPathElement gPlayerMoveHistory[40]; extern EvtScript D_802C05CC_32579C; -typedef struct player_path_element{ - /* 0x00 */ s8 isJumping; - /* 0x03 */ char unk_01[3]; - /* 0x04 */ Vec3f position; -}player_path_element; // size unknown - s32 partner_is_idle(Npc* partner); s32 world_partner_can_player_pause_default(Npc* partner); void _use_partner_ability(void); @@ -330,9 +324,9 @@ WorldPartner wPartners[12] = { }, }; -f32 SavedPartnerPosX = 0; -f32 SavedPartnerPosY = 0; -f32 SavedPartnerPosZ = 0; +f32 wSavedPartnerPosX = 0; +f32 wSavedPartnerPosY = 0; +f32 wSavedPartnerPosZ = 0; PartnerAnimations gPartnerAnimations[] = { {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, @@ -504,9 +498,9 @@ void switch_to_partner(s32 arg0) { D_8010CFE8 = 4; } else { D_8010CFE8 = 6; - SavedPartnerPosX = playerStatus->position.x; - SavedPartnerPosY = playerStatus->position.y; - SavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->position.x; + wSavedPartnerPosY = playerStatus->position.y; + wSavedPartnerPosZ = playerStatus->position.z; } } } @@ -527,9 +521,9 @@ void partner_init_after_battle(s32 arg0) { D_8010CFE8 = 4; } else { D_8010CFE8 = 6; - SavedPartnerPosX = playerStatus->position.x; - SavedPartnerPosY = playerStatus->position.y; - SavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->position.x; + wSavedPartnerPosY = playerStatus->position.y; + wSavedPartnerPosZ = playerStatus->position.z; } } } @@ -598,9 +592,9 @@ void partner_reset_data(void) { } wPartner = NULL; - SavedPartnerPosX = playerStatus->position.x; - SavedPartnerPosY = playerStatus->position.y; - SavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->position.x; + wSavedPartnerPosY = playerStatus->position.y; + wSavedPartnerPosZ = playerStatus->position.z; if (D_8010CFD8 == 0) { D_8010CFE8 = 1; @@ -627,9 +621,9 @@ void partner_initialize_data(void) { actionStatus->unk_358 = 0; actionStatus->actionState.b[2] = 0; wPartner = NULL; - SavedPartnerPosX = 0; - SavedPartnerPosY = 0; - SavedPartnerPosZ = 0; + wSavedPartnerPosX = 0; + wSavedPartnerPosY = 0; + wSavedPartnerPosZ = 0; } s32 partner_test_enemy_collision(s32 arg0) { @@ -719,30 +713,70 @@ void partner_resume_ability_script(void) { } } -INCLUDE_ASM(void, "world/partners", partner_walking_enable, Npc* partner, s32 val); +void partner_walking_enable(Npc* partner, s32 val) { + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerPathElement* it = gPlayerMoveHistory; + s32 i; + + partner->pos.x = wSavedPartnerPosX; + partner->pos.y = wSavedPartnerPosY; + partner->pos.z = wSavedPartnerPosZ; + + for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) { + it->pos.x = playerStatus->position.x; + it->pos.y = playerStatus->position.y; + it->pos.z = playerStatus->position.z; + it->isJumping = FALSE; + } + + gPlayerMoveHistoryIndex = 0; + D_8010CFBC = 0; + D_8010CFCA = val ? 2 : 0; + D_8010CFC8 = 0; + + if (D_8010CFC4 == 1 || D_8010CFC4 == 3) { + D_8010CFC4 = 0; + D_8010CFCA = 0; + D_8010CFC8 = 0; + } else if (D_8010CFC4 == 2) { + D_8010CFCA = 0; + D_8010CFC8 = 50; + } + + D_8010CFCE = 0; + D_8010CFCC = 0; + wPartnerMoveTime = 16; + wPartnerTetherDistance = 40.0f; + partner->currentAnim.w = gPartnerAnimations[D_8010CFD8].anims[5]; + func_800EA5B8(&partner->flags); + partner->collisionChannel = 0x10000; + partner->jumpVelocity = 0.0f; + partner->flags |= NPC_FLAG_400000 | NPC_FLAG_GRAVITY | NPC_FLAG_100; + partner->jumpScale = 1.8f; +} void partner_walking_update_player_tracking(Npc* partner) { PlayerStatus* playerStatus = &gPlayerStatus; s32 isPlayerJumping; - player_path_element* currentSnapshot; + PlayerPathElement* currentSnapshot; if ((playerStatus->flags & 6) != 0) { isPlayerJumping = (playerStatus->actionState == ACTION_STATE_LAND || playerStatus->actionState == ACTION_STATE_STEP_DOWN) ^ 1; } else { isPlayerJumping = FALSE; } - currentSnapshot = &PlayerMoveHistory[PlayerMoveHistoryIndex]; - if (((currentSnapshot->isJumping == 0) || (isPlayerJumping == 0)) && - ((currentSnapshot->position.x != playerStatus->position.x) || (currentSnapshot->position.y != playerStatus->position.y) - || (currentSnapshot->position.z != playerStatus->position.z))) { - if (D_8010CFBC != PlayerMoveHistoryIndex + 1) { - if (++PlayerMoveHistoryIndex >= ARRAY_COUNT(PlayerMoveHistory)) { - PlayerMoveHistoryIndex = 0; + currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; + if ((!currentSnapshot->isJumping || !isPlayerJumping) && + ((currentSnapshot->pos.x != playerStatus->position.x) || (currentSnapshot->pos.y != playerStatus->position.y) + || (currentSnapshot->pos.z != playerStatus->position.z))) { + if (D_8010CFBC != gPlayerMoveHistoryIndex + 1) { + if (++gPlayerMoveHistoryIndex >= ARRAY_COUNT(gPlayerMoveHistory)) { + gPlayerMoveHistoryIndex = 0; } - currentSnapshot = &PlayerMoveHistory[PlayerMoveHistoryIndex]; - currentSnapshot->position.x = playerStatus->position.x; - currentSnapshot->position.y = playerStatus->position.y; - currentSnapshot->position.z = playerStatus->position.z; + currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; + currentSnapshot->pos.x = playerStatus->position.x; + currentSnapshot->pos.y = playerStatus->position.y; + currentSnapshot->pos.z = playerStatus->position.z; currentSnapshot->isJumping = isPlayerJumping; } } @@ -772,18 +806,61 @@ void partner_walking_update_motion(Npc* partner) { } partner_do_player_collision(partner); - SavedPartnerPosX = partner->pos.x; - SavedPartnerPosY = partner->pos.y; - SavedPartnerPosZ = partner->pos.z; + wSavedPartnerPosX = partner->pos.x; + wSavedPartnerPosY = partner->pos.y; + wSavedPartnerPosZ = partner->pos.z; } INCLUDE_ASM(void, "world/partners", partner_walking_follow_player, Npc* partner); -INCLUDE_ASM(void, "world/partners", partner_flying_enable, Npc* partner, s32 val); +void partner_flying_enable(Npc* partner, s32 val) { + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerPathElement* it = gPlayerMoveHistory; + s32 i; + + partner->pos.x = wSavedPartnerPosX; + partner->pos.y = wSavedPartnerPosY; + partner->pos.z = wSavedPartnerPosZ; + + for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) { + it->pos.x = wSavedPartnerPosX; + it->pos.y = wSavedPartnerPosY; + it->pos.z = wSavedPartnerPosZ; + it->isJumping = FALSE; + } + + gPlayerMoveHistoryIndex = 0; + D_8010CFBC = 0; + + if (!val) { + D_8010CFC8 = 0; + D_8010CFCA = 0; + } else if (D_8010CFC4 == 0) { + D_8010CFC8 = 15; + D_8010CFCA = 2; + } else if (D_8010CFC4 == 1 || D_8010CFC4 == 3) { + D_8010CFC4 = 0; + D_8010CFC8 = 0; + D_8010CFCA = 0; + } else if (D_8010CFC4 == 2) { + D_8010CFC8 = 50; + D_8010CFCA = 0; + } + + D_8010CFCE = 0; + D_8010CFCC = 0; + wPartnerMoveTime = 16; + wPartnerTetherDistance = 40.0f; + partner->currentAnim.w = gPartnerAnimations[D_8010CFD8].anims[5]; + func_800EA5B8(&partner->flags); + partner->collisionChannel = 0x10000; + partner->flags |= NPC_FLAG_100; + partner->flags &= ~NPC_FLAG_GRAVITY; +} void partner_flying_update_player_tracking(Npc* partner) { PlayerStatus* playerStatus = &gPlayerStatus; - player_path_element* currentSnapShot; + PlayerPathElement* currentSnapshot; f32 effectiveY; s32 zero = 0; // TODO fix this as || zero == 0 is always going to be true as is @@ -791,18 +868,18 @@ void partner_flying_update_player_tracking(Npc* partner) { if ((playerStatus->actionState == ACTION_STATE_HIT_LAVA) || (playerStatus->actionState == ACTION_STATE_HIT_FIRE)) { effectiveY = playerStatus->lastGoodPosition.y + partner->collisionHeight + 5; } - currentSnapShot = &PlayerMoveHistory[PlayerMoveHistoryIndex]; - if ((!currentSnapShot->isJumping || zero == 0) && (currentSnapShot->position.x != playerStatus->position.x || currentSnapShot->position.y != effectiveY - || currentSnapShot->position.z != playerStatus->position.z)) { - if (D_8010CFBC != PlayerMoveHistoryIndex + 1) { - if (++PlayerMoveHistoryIndex >= ARRAY_COUNT(PlayerMoveHistory)) { - PlayerMoveHistoryIndex = 0; + currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; + if ((!currentSnapshot->isJumping || zero == 0) && (currentSnapshot->pos.x != playerStatus->position.x || currentSnapshot->pos.y != effectiveY + || currentSnapshot->pos.z != playerStatus->position.z)) { + if (D_8010CFBC != gPlayerMoveHistoryIndex + 1) { + if (++gPlayerMoveHistoryIndex >= ARRAY_COUNT(gPlayerMoveHistory)) { + gPlayerMoveHistoryIndex = 0; } - currentSnapShot = &PlayerMoveHistory[PlayerMoveHistoryIndex]; - currentSnapShot->position.x = playerStatus->position.x; - currentSnapShot->position.y = effectiveY; - currentSnapShot->position.z = playerStatus->position.z; - currentSnapShot->isJumping = zero; + currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; + currentSnapshot->pos.x = playerStatus->position.x; + currentSnapshot->pos.y = effectiveY; + currentSnapshot->pos.z = playerStatus->position.z; + currentSnapshot->isJumping = zero; } } } @@ -841,9 +918,9 @@ s32 partner_put_away(Npc* partner) { tempPosY = playerStatus->position.y + (playerStatus->colliderHeight / 2); partner->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight / 2); tempPosZ = playerStatus->position.z; - SavedPartnerPosX = tempMoveToX; - SavedPartnerPosY = tempMoveToY; - SavedPartnerPosZ = tempMoveToZ; + wSavedPartnerPosX = tempMoveToX; + wSavedPartnerPosY = tempMoveToY; + wSavedPartnerPosZ = tempMoveToZ; partner->moveSpeed = 4.0f; partner->jumpScale = 1.6f; partner->moveToPos.z = tempPosZ; @@ -950,7 +1027,21 @@ void func_800EF43C(void) { D_8010CFCE = 0; } -INCLUDE_ASM(void, "world/partners", partner_clear_player_tracking, Npc* partner); +void partner_clear_player_tracking(Npc* partner) { + PlayerPathElement* it = gPlayerMoveHistory; + s32 i; + + wSavedPartnerPosX = partner->pos.x; + wSavedPartnerPosY = partner->pos.y; + wSavedPartnerPosZ = partner->pos.z; + + for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) { + it->pos.x = wSavedPartnerPosX; + it->pos.y = wSavedPartnerPosY; + it->pos.z = wSavedPartnerPosZ; + it->isJumping = FALSE; + } +} s32 func_800EF4E0(void) { PlayerStatus* playerStatus = &gPlayerStatus; @@ -960,17 +1051,17 @@ s32 func_800EF4E0(void) { if (playerStatus->unk_90 == 0.0f) { if (!(playerStatus->spriteFacingAngle >= 90.0f) || !(playerStatus->spriteFacingAngle < 270.0f)) { ret = 1; - playerStatus->targetYaw = clamp_angle(cameras[0].currentYaw - 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw - 90.0f); } else { - playerStatus->targetYaw = clamp_angle(cameras[0].currentYaw + 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw + 90.0f); ret = 0; } - } else if (get_clamped_angle_diff(cameras[0].currentYaw, playerStatus->targetYaw) < 0.0f) { + } else if (get_clamped_angle_diff(cameras[CAM_DEFAULT].currentYaw, playerStatus->targetYaw) < 0.0f) { ret = 1; - playerStatus->targetYaw = clamp_angle(cameras[0].currentYaw - 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw - 90.0f); } else { ret = 0; - playerStatus->targetYaw = clamp_angle(cameras[0].currentYaw + 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw + 90.0f); } playerStatus->currentYaw = playerStatus->targetYaw; diff --git a/src/world/script_api/7E0E80.c b/src/world/script_api/7E0E80.c index 0d424407bf..c758bb44de 100644 --- a/src/world/script_api/7E0E80.c +++ b/src/world/script_api/7E0E80.c @@ -769,11 +769,11 @@ void draw_shop_items(void) { ShopItemEntity* shopItemEntities; if (shop->flags & SHOP_FLAGS_1) { - set_window_update(10, basic_window_update); - set_window_update(11, basic_window_update); + set_window_update(WINDOW_ID_10, basic_window_update); + set_window_update(WINDOW_ID_11, basic_window_update); } else { - set_window_update(10, basic_hidden_window_update); - set_window_update(11, basic_hidden_window_update); + set_window_update(WINDOW_ID_10, basic_hidden_window_update); + set_window_update(WINDOW_ID_11, basic_hidden_window_update); } if (shop->flags & SHOP_FLAGS_1) { diff --git a/ver/us/asm/nonmatchings/163400/filemenu_update.s b/ver/us/asm/nonmatchings/163400/filemenu_update.s deleted file mode 100644 index a4e1a0de7f..0000000000 --- a/ver/us/asm/nonmatchings/163400/filemenu_update.s +++ /dev/null @@ -1,106 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel filemenu_update -/* 163A00 802431A0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 163A04 802431A4 AFB00010 */ sw $s0, 0x10($sp) -/* 163A08 802431A8 2410002C */ addiu $s0, $zero, 0x2c -/* 163A0C 802431AC 2406FFFF */ addiu $a2, $zero, -1 -/* 163A10 802431B0 0200282D */ daddu $a1, $s0, $zero -/* 163A14 802431B4 3C028025 */ lui $v0, %hi(filemenu_8024C098) -/* 163A18 802431B8 8042C098 */ lb $v0, %lo(filemenu_8024C098)($v0) -/* 163A1C 802431BC 3C038016 */ lui $v1, %hi(D_8015A2D0) -/* 163A20 802431C0 2463A2D0 */ addiu $v1, $v1, %lo(D_8015A2D0) -/* 163A24 802431C4 AFBF0018 */ sw $ra, 0x18($sp) -/* 163A28 802431C8 AFB10014 */ sw $s1, 0x14($sp) -/* 163A2C 802431CC 00021080 */ sll $v0, $v0, 2 -/* 163A30 802431D0 3C048025 */ lui $a0, %hi(filemenu_menus) -/* 163A34 802431D4 00822021 */ addu $a0, $a0, $v0 -/* 163A38 802431D8 8C849B84 */ lw $a0, %lo(filemenu_menus)($a0) -.L802431DC: -/* 163A3C 802431DC 80620003 */ lb $v0, 3($v1) -/* 163A40 802431E0 10460003 */ beq $v0, $a2, .L802431F0 -/* 163A44 802431E4 00000000 */ nop -/* 163A48 802431E8 54450006 */ bnel $v0, $a1, .L80243204 -/* 163A4C 802431EC 26100001 */ addiu $s0, $s0, 1 -.L802431F0: -/* 163A50 802431F0 90620000 */ lbu $v0, ($v1) -/* 163A54 802431F4 30420008 */ andi $v0, $v0, 8 -/* 163A58 802431F8 14400006 */ bnez $v0, .L80243214 -/* 163A5C 802431FC 2A020040 */ slti $v0, $s0, 0x40 -/* 163A60 80243200 26100001 */ addiu $s0, $s0, 1 -.L80243204: -/* 163A64 80243204 2A020040 */ slti $v0, $s0, 0x40 -/* 163A68 80243208 1440FFF4 */ bnez $v0, .L802431DC -/* 163A6C 8024320C 24630020 */ addiu $v1, $v1, 0x20 -/* 163A70 80243210 2A020040 */ slti $v0, $s0, 0x40 -.L80243214: -/* 163A74 80243214 1440000B */ bnez $v0, .L80243244 -/* 163A78 80243218 00000000 */ nop -/* 163A7C 8024321C 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* 163A80 80243220 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* 163A84 80243224 8C430020 */ lw $v1, 0x20($v0) -/* 163A88 80243228 8C420010 */ lw $v0, 0x10($v0) -/* 163A8C 8024322C 3C018025 */ lui $at, %hi(filemenu_heldButtons) -/* 163A90 80243230 AC23C08C */ sw $v1, %lo(filemenu_heldButtons)($at) -/* 163A94 80243234 3C018025 */ lui $at, %hi(filemenu_pressedButtons) -/* 163A98 80243238 AC22C084 */ sw $v0, %lo(filemenu_pressedButtons)($at) -/* 163A9C 8024323C 08090C95 */ j .L80243254 -/* 163AA0 80243240 00000000 */ nop -.L80243244: -/* 163AA4 80243244 3C018025 */ lui $at, %hi(filemenu_heldButtons) -/* 163AA8 80243248 AC20C08C */ sw $zero, %lo(filemenu_heldButtons)($at) -/* 163AAC 8024324C 3C018025 */ lui $at, %hi(filemenu_pressedButtons) -/* 163AB0 80243250 AC20C084 */ sw $zero, %lo(filemenu_pressedButtons)($at) -.L80243254: -/* 163AB4 80243254 3C058025 */ lui $a1, %hi(filemenu_pressedButtons) -/* 163AB8 80243258 24A5C084 */ addiu $a1, $a1, %lo(filemenu_pressedButtons) -/* 163ABC 8024325C 8CA30000 */ lw $v1, ($a1) -/* 163AC0 80243260 30624000 */ andi $v0, $v1, 0x4000 -/* 163AC4 80243264 10400004 */ beqz $v0, .L80243278 -/* 163AC8 80243268 3C02FFFF */ lui $v0, 0xffff -/* 163ACC 8024326C 34427FFF */ ori $v0, $v0, 0x7fff -/* 163AD0 80243270 00621024 */ and $v0, $v1, $v0 -/* 163AD4 80243274 ACA20000 */ sw $v0, ($a1) -.L80243278: -/* 163AD8 80243278 3C058025 */ lui $a1, %hi(filemenu_heldButtons) -/* 163ADC 8024327C 24A5C08C */ addiu $a1, $a1, %lo(filemenu_heldButtons) -/* 163AE0 80243280 8CA30000 */ lw $v1, ($a1) -/* 163AE4 80243284 30624000 */ andi $v0, $v1, 0x4000 -/* 163AE8 80243288 10400004 */ beqz $v0, .L8024329C -/* 163AEC 8024328C 3C02FFFF */ lui $v0, 0xffff -/* 163AF0 80243290 34427FFF */ ori $v0, $v0, 0x7fff -/* 163AF4 80243294 00621024 */ and $v0, $v1, $v0 -/* 163AF8 80243298 ACA20000 */ sw $v0, ($a1) -.L8024329C: -/* 163AFC 8024329C 90820000 */ lbu $v0, ($a0) -/* 163B00 802432A0 10400006 */ beqz $v0, .L802432BC -/* 163B04 802432A4 00000000 */ nop -/* 163B08 802432A8 8C820010 */ lw $v0, 0x10($a0) -/* 163B0C 802432AC 10400003 */ beqz $v0, .L802432BC -/* 163B10 802432B0 00000000 */ nop -/* 163B14 802432B4 0040F809 */ jalr $v0 -/* 163B18 802432B8 00000000 */ nop -.L802432BC: -/* 163B1C 802432BC 3C118025 */ lui $s1, %hi(filemenu_menus) -/* 163B20 802432C0 26319B84 */ addiu $s1, $s1, %lo(filemenu_menus) -/* 163B24 802432C4 0000802D */ daddu $s0, $zero, $zero -.L802432C8: -/* 163B28 802432C8 8E240000 */ lw $a0, ($s1) -/* 163B2C 802432CC 90820000 */ lbu $v0, ($a0) -/* 163B30 802432D0 10400006 */ beqz $v0, .L802432EC -/* 163B34 802432D4 26100001 */ addiu $s0, $s0, 1 -/* 163B38 802432D8 8C820014 */ lw $v0, 0x14($a0) -/* 163B3C 802432DC 10400003 */ beqz $v0, .L802432EC -/* 163B40 802432E0 00000000 */ nop -/* 163B44 802432E4 0040F809 */ jalr $v0 -/* 163B48 802432E8 00000000 */ nop -.L802432EC: -/* 163B4C 802432EC 2A020004 */ slti $v0, $s0, 4 -/* 163B50 802432F0 1440FFF5 */ bnez $v0, .L802432C8 -/* 163B54 802432F4 26310004 */ addiu $s1, $s1, 4 -/* 163B58 802432F8 8FBF0018 */ lw $ra, 0x18($sp) -/* 163B5C 802432FC 8FB10014 */ lw $s1, 0x14($sp) -/* 163B60 80243300 8FB00010 */ lw $s0, 0x10($sp) -/* 163B64 80243304 03E00008 */ jr $ra -/* 163B68 80243308 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/167570/filemenu_yesno_handle_input.s b/ver/us/asm/nonmatchings/167570/filemenu_yesno_handle_input.s deleted file mode 100644 index dfd762cbe3..0000000000 --- a/ver/us/asm/nonmatchings/167570/filemenu_yesno_handle_input.s +++ /dev/null @@ -1,773 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -dlabel jtbl_8024C018 -.word .L80247370_167BD0, .L80247664_167EC4, .L802477F8_168058, .L802474E4_167D44, .L80247A3C_16829C, 0 - -dlabel jtbl_8024C030 -.word .L80247AC4_168324, .L80247AC4_168324, .L80247ADC_16833C, .L80247AC4_168324, .L80247AF8_168358, 0 - -dlabel jtbl_8024C048 -.word .L80247C08_168468, .L80247C08_168468, .L80247C20_168480, .L80247C08_168468, .L80247C3C_16849C, 0 - -.section .text - -glabel filemenu_yesno_handle_input -/* 167A4C 802471EC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 167A50 802471F0 AFB20018 */ sw $s2, 0x18($sp) -/* 167A54 802471F4 0080902D */ daddu $s2, $a0, $zero -/* 167A58 802471F8 3C028025 */ lui $v0, %hi(filemenu_heldButtons) -/* 167A5C 802471FC 8C42C08C */ lw $v0, %lo(filemenu_heldButtons)($v0) -/* 167A60 80247200 3C030001 */ lui $v1, 1 -/* 167A64 80247204 AFBF001C */ sw $ra, 0x1c($sp) -/* 167A68 80247208 AFB10014 */ sw $s1, 0x14($sp) -/* 167A6C 8024720C AFB00010 */ sw $s0, 0x10($sp) -/* 167A70 80247210 92450003 */ lbu $a1, 3($s2) -/* 167A74 80247214 00431024 */ and $v0, $v0, $v1 -/* 167A78 80247218 10400007 */ beqz $v0, .L80247238 -/* 167A7C 8024721C 00000000 */ nop -/* 167A80 80247220 92420002 */ lbu $v0, 2($s2) -/* 167A84 80247224 2442FFFF */ addiu $v0, $v0, -1 -/* 167A88 80247228 A2420002 */ sb $v0, 2($s2) -/* 167A8C 8024722C 00021600 */ sll $v0, $v0, 0x18 -/* 167A90 80247230 04420001 */ bltzl $v0, .L80247238 -/* 167A94 80247234 A2400002 */ sb $zero, 2($s2) -.L80247238: -/* 167A98 80247238 3C028025 */ lui $v0, %hi(filemenu_heldButtons) -/* 167A9C 8024723C 8C42C08C */ lw $v0, %lo(filemenu_heldButtons)($v0) -/* 167AA0 80247240 3C030002 */ lui $v1, 2 -/* 167AA4 80247244 00431024 */ and $v0, $v0, $v1 -/* 167AA8 80247248 1040000C */ beqz $v0, .L8024727C -/* 167AAC 8024724C 00000000 */ nop -/* 167AB0 80247250 92420002 */ lbu $v0, 2($s2) -/* 167AB4 80247254 82430006 */ lb $v1, 6($s2) -/* 167AB8 80247258 24420001 */ addiu $v0, $v0, 1 -/* 167ABC 8024725C A2420002 */ sb $v0, 2($s2) -/* 167AC0 80247260 00021600 */ sll $v0, $v0, 0x18 -/* 167AC4 80247264 00021603 */ sra $v0, $v0, 0x18 -/* 167AC8 80247268 0043102A */ slt $v0, $v0, $v1 -/* 167ACC 8024726C 92430006 */ lbu $v1, 6($s2) -/* 167AD0 80247270 14400002 */ bnez $v0, .L8024727C -/* 167AD4 80247274 2462FFFF */ addiu $v0, $v1, -1 -/* 167AD8 80247278 A2420002 */ sb $v0, 2($s2) -.L8024727C: -/* 167ADC 8024727C 82420004 */ lb $v0, 4($s2) -/* 167AE0 80247280 82430005 */ lb $v1, 5($s2) -/* 167AE4 80247284 00430018 */ mult $v0, $v1 -/* 167AE8 80247288 00003812 */ mflo $a3 -/* 167AEC 8024728C 82420006 */ lb $v0, 6($s2) -/* 167AF0 80247290 00000000 */ nop -/* 167AF4 80247294 00E20018 */ mult $a3, $v0 -/* 167AF8 80247298 00002012 */ mflo $a0 -/* 167AFC 8024729C 82420002 */ lb $v0, 2($s2) -/* 167B00 802472A0 00000000 */ nop -/* 167B04 802472A4 00620018 */ mult $v1, $v0 -/* 167B08 802472A8 00001812 */ mflo $v1 -/* 167B0C 802472AC 00831821 */ addu $v1, $a0, $v1 -/* 167B10 802472B0 82440001 */ lb $a0, 1($s2) -/* 167B14 802472B4 8E420008 */ lw $v0, 8($s2) -/* 167B18 802472B8 00641821 */ addu $v1, $v1, $a0 -/* 167B1C 802472BC 00431021 */ addu $v0, $v0, $v1 -/* 167B20 802472C0 90420000 */ lbu $v0, ($v0) -/* 167B24 802472C4 A2420003 */ sb $v0, 3($s2) -/* 167B28 802472C8 304200FF */ andi $v0, $v0, 0xff -/* 167B2C 802472CC 10A20003 */ beq $a1, $v0, .L802472DC -/* 167B30 802472D0 00000000 */ nop -/* 167B34 802472D4 0C05272D */ jal sfx_play_sound -/* 167B38 802472D8 240400C7 */ addiu $a0, $zero, 0xc7 -.L802472DC: -/* 167B3C 802472DC 3C108025 */ lui $s0, %hi(filemenu_pressedButtons) -/* 167B40 802472E0 2610C084 */ addiu $s0, $s0, %lo(filemenu_pressedButtons) -/* 167B44 802472E4 8E020000 */ lw $v0, ($s0) -/* 167B48 802472E8 30421000 */ andi $v0, $v0, 0x1000 -/* 167B4C 802472EC 10400009 */ beqz $v0, .L80247314 -/* 167B50 802472F0 24020004 */ addiu $v0, $zero, 4 -/* 167B54 802472F4 82430004 */ lb $v1, 4($s2) -/* 167B58 802472F8 14620006 */ bne $v1, $v0, .L80247314 -/* 167B5C 802472FC 0240202D */ daddu $a0, $s2, $zero -/* 167B60 80247300 0000282D */ daddu $a1, $zero, $zero -/* 167B64 80247304 0C090B65 */ jal filemenu_set_selected -/* 167B68 80247308 00A0302D */ daddu $a2, $a1, $zero -/* 167B6C 8024730C 34028000 */ ori $v0, $zero, 0x8000 -/* 167B70 80247310 AE020000 */ sw $v0, ($s0) -.L80247314: -/* 167B74 80247314 3C028025 */ lui $v0, %hi(filemenu_pressedButtons) -/* 167B78 80247318 8C42C084 */ lw $v0, %lo(filemenu_pressedButtons)($v0) -/* 167B7C 8024731C 30428000 */ andi $v0, $v0, 0x8000 -/* 167B80 80247320 10400225 */ beqz $v0, .L80247BB8 -/* 167B84 80247324 00000000 */ nop -/* 167B88 80247328 0C05272D */ jal sfx_play_sound -/* 167B8C 8024732C 240400C9 */ addiu $a0, $zero, 0xc9 -/* 167B90 80247330 92430003 */ lbu $v1, 3($s2) -/* 167B94 80247334 10600005 */ beqz $v1, .L8024734C -/* 167B98 80247338 24020001 */ addiu $v0, $zero, 1 -/* 167B9C 8024733C 106201D8 */ beq $v1, $v0, .L80247AA0 -/* 167BA0 80247340 00000000 */ nop -/* 167BA4 80247344 08091EEE */ j .L80247BB8 -/* 167BA8 80247348 00000000 */ nop -.L8024734C: -/* 167BAC 8024734C 82430004 */ lb $v1, 4($s2) -/* 167BB0 80247350 2C620005 */ sltiu $v0, $v1, 5 -/* 167BB4 80247354 10400218 */ beqz $v0, .L80247BB8 -/* 167BB8 80247358 00031080 */ sll $v0, $v1, 2 -/* 167BBC 8024735C 3C018025 */ lui $at, %hi(jtbl_8024C018) -/* 167BC0 80247360 00220821 */ addu $at, $at, $v0 -/* 167BC4 80247364 8C22C018 */ lw $v0, %lo(jtbl_8024C018)($at) -/* 167BC8 80247368 00400008 */ jr $v0 -/* 167BCC 8024736C 00000000 */ nop -.L80247370_167BD0: -/* 167BD0 80247370 24020002 */ addiu $v0, $zero, 2 -/* 167BD4 80247374 3C038025 */ lui $v1, %hi(filemenu_menus + 0x8) -/* 167BD8 80247378 8C639B8C */ lw $v1, %lo(filemenu_menus + 0x8)($v1) -/* 167BDC 8024737C 3C048016 */ lui $a0, %hi(gWindows) -/* 167BE0 80247380 24849D50 */ addiu $a0, $a0, %lo(gWindows) -/* 167BE4 80247384 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 167BE8 80247388 A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 167BEC 8024738C 240200B6 */ addiu $v0, $zero, 0xb6 -/* 167BF0 80247390 A0600004 */ sb $zero, 4($v1) -/* 167BF4 80247394 808305E3 */ lb $v1, 0x5e3($a0) -/* 167BF8 80247398 A48205F0 */ sh $v0, 0x5f0($a0) -/* 167BFC 8024739C 24020019 */ addiu $v0, $zero, 0x19 -/* 167C00 802473A0 A48205F2 */ sh $v0, 0x5f2($a0) -/* 167C04 802473A4 2402FFFF */ addiu $v0, $zero, -1 -/* 167C08 802473A8 1062000B */ beq $v1, $v0, .L802473D8 -/* 167C0C 802473AC 248505EC */ addiu $a1, $a0, 0x5ec -/* 167C10 802473B0 00031140 */ sll $v0, $v1, 5 -/* 167C14 802473B4 00441021 */ addu $v0, $v0, $a0 -/* 167C18 802473B8 94420010 */ lhu $v0, 0x10($v0) -/* 167C1C 802473BC 00021400 */ sll $v0, $v0, 0x10 -/* 167C20 802473C0 00021C03 */ sra $v1, $v0, 0x10 -/* 167C24 802473C4 000217C2 */ srl $v0, $v0, 0x1f -/* 167C28 802473C8 00621821 */ addu $v1, $v1, $v0 -/* 167C2C 802473CC 00031843 */ sra $v1, $v1, 1 -/* 167C30 802473D0 08091CF9 */ j .L802473E4 -/* 167C34 802473D4 2463FFA5 */ addiu $v1, $v1, -0x5b -.L802473D8: -/* 167C38 802473D8 24030045 */ addiu $v1, $zero, 0x45 -/* 167C3C 802473DC 3C048016 */ lui $a0, %hi(gWindows) -/* 167C40 802473E0 24849D50 */ addiu $a0, $a0, %lo(gWindows) -.L802473E4: -/* 167C44 802473E4 A4A30000 */ sh $v1, ($a1) -/* 167C48 802473E8 948205F2 */ lhu $v0, 0x5f2($a0) -/* 167C4C 802473EC 00021400 */ sll $v0, $v0, 0x10 -/* 167C50 802473F0 00021C03 */ sra $v1, $v0, 0x10 -/* 167C54 802473F4 000217C2 */ srl $v0, $v0, 0x1f -/* 167C58 802473F8 00621821 */ addu $v1, $v1, $v0 -/* 167C5C 802473FC 00032843 */ sra $a1, $v1, 1 -/* 167C60 80247400 808305E3 */ lb $v1, 0x5e3($a0) -/* 167C64 80247404 2402FFFF */ addiu $v0, $zero, -1 -/* 167C68 80247408 1062000B */ beq $v1, $v0, .L80247438 -/* 167C6C 8024740C 248605EE */ addiu $a2, $a0, 0x5ee -/* 167C70 80247410 00031140 */ sll $v0, $v1, 5 -/* 167C74 80247414 00441021 */ addu $v0, $v0, $a0 -/* 167C78 80247418 94420012 */ lhu $v0, 0x12($v0) -/* 167C7C 8024741C 00021400 */ sll $v0, $v0, 0x10 -/* 167C80 80247420 00021C03 */ sra $v1, $v0, 0x10 -/* 167C84 80247424 000217C2 */ srl $v0, $v0, 0x1f -/* 167C88 80247428 00621821 */ addu $v1, $v1, $v0 -/* 167C8C 8024742C 00031843 */ sra $v1, $v1, 1 -/* 167C90 80247430 08091D10 */ j .L80247440 -/* 167C94 80247434 00651023 */ subu $v0, $v1, $a1 -.L80247438: -/* 167C98 80247438 24020078 */ addiu $v0, $zero, 0x78 -/* 167C9C 8024743C 00451023 */ subu $v0, $v0, $a1 -.L80247440: -/* 167CA0 80247440 2404002F */ addiu $a0, $zero, 0x2f -/* 167CA4 80247444 24050001 */ addiu $a1, $zero, 1 -/* 167CA8 80247448 0C051F9F */ jal set_window_update -/* 167CAC 8024744C A4C20000 */ sh $v0, ($a2) -/* 167CB0 80247450 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 167CB4 80247454 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 167CB8 80247458 0C051F9F */ jal set_window_update -/* 167CBC 8024745C 24040032 */ addiu $a0, $zero, 0x32 -/* 167CC0 80247460 0000202D */ daddu $a0, $zero, $zero -/* 167CC4 80247464 3C028025 */ lui $v0, %hi(filemenu_menus) -/* 167CC8 80247468 8C429B84 */ lw $v0, %lo(filemenu_menus)($v0) -/* 167CCC 8024746C 3C068007 */ lui $a2, %hi(gSaveSlotMetadata) -/* 167CD0 80247470 24C679C4 */ addiu $a2, $a2, %lo(gSaveSlotMetadata) -/* 167CD4 80247474 90500003 */ lbu $s0, 3($v0) -/* 167CD8 80247478 240500F7 */ addiu $a1, $zero, 0xf7 -/* 167CDC 8024747C 00101040 */ sll $v0, $s0, 1 -/* 167CE0 80247480 00501021 */ addu $v0, $v0, $s0 -/* 167CE4 80247484 000218C0 */ sll $v1, $v0, 3 -/* 167CE8 80247488 00831021 */ addu $v0, $a0, $v1 -.L8024748C: -/* 167CEC 8024748C 00461021 */ addu $v0, $v0, $a2 -/* 167CF0 80247490 A0450007 */ sb $a1, 7($v0) -/* 167CF4 80247494 24840001 */ addiu $a0, $a0, 1 -/* 167CF8 80247498 28820008 */ slti $v0, $a0, 8 -/* 167CFC 8024749C 1440FFFB */ bnez $v0, .L8024748C -/* 167D00 802474A0 00831021 */ addu $v0, $a0, $v1 -/* 167D04 802474A4 0200202D */ daddu $a0, $s0, $zero -/* 167D08 802474A8 3C038007 */ lui $v1, %hi(gSaveSlotMetadata) -/* 167D0C 802474AC 246379C4 */ addiu $v1, $v1, %lo(gSaveSlotMetadata) -/* 167D10 802474B0 00101040 */ sll $v0, $s0, 1 -/* 167D14 802474B4 00501021 */ addu $v0, $v0, $s0 -/* 167D18 802474B8 000210C0 */ sll $v0, $v0, 3 -/* 167D1C 802474BC 00431021 */ addu $v0, $v0, $v1 -/* 167D20 802474C0 A0400006 */ sb $zero, 6($v0) -/* 167D24 802474C4 AC400000 */ sw $zero, ($v0) -/* 167D28 802474C8 0C00AD0B */ jal fio_erase_game -/* 167D2C 802474CC A0400004 */ sb $zero, 4($v0) -/* 167D30 802474D0 3C018007 */ lui $at, %hi(gSaveSlotHasData) -/* 167D34 802474D4 00300821 */ addu $at, $at, $s0 -/* 167D38 802474D8 A0207A24 */ sb $zero, %lo(gSaveSlotHasData)($at) -/* 167D3C 802474DC 08091EEE */ j .L80247BB8 -/* 167D40 802474E0 00000000 */ nop -.L802474E4_167D44: -/* 167D44 802474E4 24020002 */ addiu $v0, $zero, 2 -/* 167D48 802474E8 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 167D4C 802474EC A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 167D50 802474F0 24020002 */ addiu $v0, $zero, 2 -/* 167D54 802474F4 3C048016 */ lui $a0, %hi(gWindows) -/* 167D58 802474F8 24849D50 */ addiu $a0, $a0, %lo(gWindows) -/* 167D5C 802474FC 3C038025 */ lui $v1, %hi(filemenu_menus + 0x8) -/* 167D60 80247500 8C639B8C */ lw $v1, %lo(filemenu_menus + 0x8)($v1) -/* 167D64 80247504 A0620004 */ sb $v0, 4($v1) -/* 167D68 80247508 808305E3 */ lb $v1, 0x5e3($a0) -/* 167D6C 8024750C 2402009A */ addiu $v0, $zero, 0x9a -/* 167D70 80247510 A48205F0 */ sh $v0, 0x5f0($a0) -/* 167D74 80247514 24020027 */ addiu $v0, $zero, 0x27 -/* 167D78 80247518 A48205F2 */ sh $v0, 0x5f2($a0) -/* 167D7C 8024751C 2402FFFF */ addiu $v0, $zero, -1 -/* 167D80 80247520 1062000B */ beq $v1, $v0, .L80247550 -/* 167D84 80247524 248505EC */ addiu $a1, $a0, 0x5ec -/* 167D88 80247528 00031140 */ sll $v0, $v1, 5 -/* 167D8C 8024752C 00441021 */ addu $v0, $v0, $a0 -/* 167D90 80247530 94420010 */ lhu $v0, 0x10($v0) -/* 167D94 80247534 00021400 */ sll $v0, $v0, 0x10 -/* 167D98 80247538 00021C03 */ sra $v1, $v0, 0x10 -/* 167D9C 8024753C 000217C2 */ srl $v0, $v0, 0x1f -/* 167DA0 80247540 00621821 */ addu $v1, $v1, $v0 -/* 167DA4 80247544 00031843 */ sra $v1, $v1, 1 -/* 167DA8 80247548 08091D57 */ j .L8024755C -/* 167DAC 8024754C 2463FFB3 */ addiu $v1, $v1, -0x4d -.L80247550: -/* 167DB0 80247550 24030053 */ addiu $v1, $zero, 0x53 -/* 167DB4 80247554 3C048016 */ lui $a0, %hi(gWindows) -/* 167DB8 80247558 24849D50 */ addiu $a0, $a0, %lo(gWindows) -.L8024755C: -/* 167DBC 8024755C A4A30000 */ sh $v1, ($a1) -/* 167DC0 80247560 948205F2 */ lhu $v0, 0x5f2($a0) -/* 167DC4 80247564 00021400 */ sll $v0, $v0, 0x10 -/* 167DC8 80247568 00021C03 */ sra $v1, $v0, 0x10 -/* 167DCC 8024756C 000217C2 */ srl $v0, $v0, 0x1f -/* 167DD0 80247570 00621821 */ addu $v1, $v1, $v0 -/* 167DD4 80247574 00032843 */ sra $a1, $v1, 1 -/* 167DD8 80247578 808305E3 */ lb $v1, 0x5e3($a0) -/* 167DDC 8024757C 2402FFFF */ addiu $v0, $zero, -1 -/* 167DE0 80247580 1062000B */ beq $v1, $v0, .L802475B0 -/* 167DE4 80247584 248605EE */ addiu $a2, $a0, 0x5ee -/* 167DE8 80247588 00031140 */ sll $v0, $v1, 5 -/* 167DEC 8024758C 00441021 */ addu $v0, $v0, $a0 -/* 167DF0 80247590 94420012 */ lhu $v0, 0x12($v0) -/* 167DF4 80247594 00021400 */ sll $v0, $v0, 0x10 -/* 167DF8 80247598 00021C03 */ sra $v1, $v0, 0x10 -/* 167DFC 8024759C 000217C2 */ srl $v0, $v0, 0x1f -/* 167E00 802475A0 00621821 */ addu $v1, $v1, $v0 -/* 167E04 802475A4 00031843 */ sra $v1, $v1, 1 -/* 167E08 802475A8 08091D6E */ j .L802475B8 -/* 167E0C 802475AC 00651023 */ subu $v0, $v1, $a1 -.L802475B0: -/* 167E10 802475B0 24020078 */ addiu $v0, $zero, 0x78 -/* 167E14 802475B4 00451023 */ subu $v0, $v0, $a1 -.L802475B8: -/* 167E18 802475B8 2404002F */ addiu $a0, $zero, 0x2f -/* 167E1C 802475BC 24050001 */ addiu $a1, $zero, 1 -/* 167E20 802475C0 0C051F9F */ jal set_window_update -/* 167E24 802475C4 A4C20000 */ sh $v0, ($a2) -/* 167E28 802475C8 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 167E2C 802475CC 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 167E30 802475D0 0C051F9F */ jal set_window_update -/* 167E34 802475D4 24040032 */ addiu $a0, $zero, 0x32 -/* 167E38 802475D8 3C118025 */ lui $s1, %hi(filemenu_loadedFileIdx) -/* 167E3C 802475DC 2631C094 */ addiu $s1, $s1, %lo(filemenu_loadedFileIdx) -/* 167E40 802475E0 0C00ACB4 */ jal fio_load_game -/* 167E44 802475E4 8E240000 */ lw $a0, ($s1) -/* 167E48 802475E8 3C108025 */ lui $s0, %hi(filemenu_iterFileIdx) -/* 167E4C 802475EC 2610C080 */ addiu $s0, $s0, %lo(filemenu_iterFileIdx) -/* 167E50 802475F0 3C068007 */ lui $a2, %hi(gSaveSlotMetadata) -/* 167E54 802475F4 24C679C4 */ addiu $a2, $a2, %lo(gSaveSlotMetadata) -/* 167E58 802475F8 8E040000 */ lw $a0, ($s0) -/* 167E5C 802475FC 8E250000 */ lw $a1, ($s1) -/* 167E60 80247600 0080102D */ daddu $v0, $a0, $zero -/* 167E64 80247604 00021840 */ sll $v1, $v0, 1 -/* 167E68 80247608 00621821 */ addu $v1, $v1, $v0 -/* 167E6C 8024760C 000318C0 */ sll $v1, $v1, 3 -/* 167E70 80247610 00661821 */ addu $v1, $v1, $a2 -/* 167E74 80247614 00051040 */ sll $v0, $a1, 1 -/* 167E78 80247618 00451021 */ addu $v0, $v0, $a1 -/* 167E7C 8024761C 000210C0 */ sll $v0, $v0, 3 -/* 167E80 80247620 00461021 */ addu $v0, $v0, $a2 -/* 167E84 80247624 8C480000 */ lw $t0, ($v0) -/* 167E88 80247628 8C490004 */ lw $t1, 4($v0) -/* 167E8C 8024762C 8C4A0008 */ lw $t2, 8($v0) -/* 167E90 80247630 8C4B000C */ lw $t3, 0xc($v0) -/* 167E94 80247634 AC680000 */ sw $t0, ($v1) -/* 167E98 80247638 AC690004 */ sw $t1, 4($v1) -/* 167E9C 8024763C AC6A0008 */ sw $t2, 8($v1) -/* 167EA0 80247640 AC6B000C */ sw $t3, 0xc($v1) -/* 167EA4 80247644 8C480010 */ lw $t0, 0x10($v0) -/* 167EA8 80247648 8C490014 */ lw $t1, 0x14($v0) -/* 167EAC 8024764C AC680010 */ sw $t0, 0x10($v1) -/* 167EB0 80247650 0C00ACDD */ jal fio_save_game -/* 167EB4 80247654 AC690014 */ sw $t1, 0x14($v1) -/* 167EB8 80247658 8E030000 */ lw $v1, ($s0) -/* 167EBC 8024765C 08091DF9 */ j .L802477E4 -/* 167EC0 80247660 24020001 */ addiu $v0, $zero, 1 -.L80247664_167EC4: -/* 167EC4 80247664 24020002 */ addiu $v0, $zero, 2 -/* 167EC8 80247668 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 167ECC 8024766C A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 167ED0 80247670 24020001 */ addiu $v0, $zero, 1 -/* 167ED4 80247674 3C048016 */ lui $a0, %hi(gWindows) -/* 167ED8 80247678 24849D50 */ addiu $a0, $a0, %lo(gWindows) -/* 167EDC 8024767C 3C038025 */ lui $v1, %hi(filemenu_menus + 0x8) -/* 167EE0 80247680 8C639B8C */ lw $v1, %lo(filemenu_menus + 0x8)($v1) -/* 167EE4 80247684 A0620004 */ sb $v0, 4($v1) -/* 167EE8 80247688 808305E3 */ lb $v1, 0x5e3($a0) -/* 167EEC 8024768C 24020099 */ addiu $v0, $zero, 0x99 -/* 167EF0 80247690 A48205F0 */ sh $v0, 0x5f0($a0) -/* 167EF4 80247694 24020019 */ addiu $v0, $zero, 0x19 -/* 167EF8 80247698 A48205F2 */ sh $v0, 0x5f2($a0) -/* 167EFC 8024769C 2402FFFF */ addiu $v0, $zero, -1 -/* 167F00 802476A0 1062000B */ beq $v1, $v0, .L802476D0 -/* 167F04 802476A4 248505EC */ addiu $a1, $a0, 0x5ec -/* 167F08 802476A8 00031140 */ sll $v0, $v1, 5 -/* 167F0C 802476AC 00441021 */ addu $v0, $v0, $a0 -/* 167F10 802476B0 94420010 */ lhu $v0, 0x10($v0) -/* 167F14 802476B4 00021400 */ sll $v0, $v0, 0x10 -/* 167F18 802476B8 00021C03 */ sra $v1, $v0, 0x10 -/* 167F1C 802476BC 000217C2 */ srl $v0, $v0, 0x1f -/* 167F20 802476C0 00621821 */ addu $v1, $v1, $v0 -/* 167F24 802476C4 00031843 */ sra $v1, $v1, 1 -/* 167F28 802476C8 08091DB7 */ j .L802476DC -/* 167F2C 802476CC 2463FFB4 */ addiu $v1, $v1, -0x4c -.L802476D0: -/* 167F30 802476D0 24030054 */ addiu $v1, $zero, 0x54 -/* 167F34 802476D4 3C048016 */ lui $a0, %hi(gWindows) -/* 167F38 802476D8 24849D50 */ addiu $a0, $a0, %lo(gWindows) -.L802476DC: -/* 167F3C 802476DC A4A30000 */ sh $v1, ($a1) -/* 167F40 802476E0 948205F2 */ lhu $v0, 0x5f2($a0) -/* 167F44 802476E4 00021400 */ sll $v0, $v0, 0x10 -/* 167F48 802476E8 00021C03 */ sra $v1, $v0, 0x10 -/* 167F4C 802476EC 000217C2 */ srl $v0, $v0, 0x1f -/* 167F50 802476F0 00621821 */ addu $v1, $v1, $v0 -/* 167F54 802476F4 00032843 */ sra $a1, $v1, 1 -/* 167F58 802476F8 808305E3 */ lb $v1, 0x5e3($a0) -/* 167F5C 802476FC 2402FFFF */ addiu $v0, $zero, -1 -/* 167F60 80247700 1062000B */ beq $v1, $v0, .L80247730 -/* 167F64 80247704 248605EE */ addiu $a2, $a0, 0x5ee -/* 167F68 80247708 00031140 */ sll $v0, $v1, 5 -/* 167F6C 8024770C 00441021 */ addu $v0, $v0, $a0 -/* 167F70 80247710 94420012 */ lhu $v0, 0x12($v0) -/* 167F74 80247714 00021400 */ sll $v0, $v0, 0x10 -/* 167F78 80247718 00021C03 */ sra $v1, $v0, 0x10 -/* 167F7C 8024771C 000217C2 */ srl $v0, $v0, 0x1f -/* 167F80 80247720 00621821 */ addu $v1, $v1, $v0 -/* 167F84 80247724 00031843 */ sra $v1, $v1, 1 -/* 167F88 80247728 08091DCE */ j .L80247738 -/* 167F8C 8024772C 00651023 */ subu $v0, $v1, $a1 -.L80247730: -/* 167F90 80247730 24020078 */ addiu $v0, $zero, 0x78 -/* 167F94 80247734 00451023 */ subu $v0, $v0, $a1 -.L80247738: -/* 167F98 80247738 2404002F */ addiu $a0, $zero, 0x2f -/* 167F9C 8024773C 24050001 */ addiu $a1, $zero, 1 -/* 167FA0 80247740 0C051F9F */ jal set_window_update -/* 167FA4 80247744 A4C20000 */ sh $v0, ($a2) -/* 167FA8 80247748 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 167FAC 8024774C 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 167FB0 80247750 0C051F9F */ jal set_window_update -/* 167FB4 80247754 24040032 */ addiu $a0, $zero, 0x32 -/* 167FB8 80247758 3C108025 */ lui $s0, %hi(filemenu_menus) -/* 167FBC 8024775C 26109B84 */ addiu $s0, $s0, %lo(filemenu_menus) -/* 167FC0 80247760 8E020000 */ lw $v0, ($s0) -/* 167FC4 80247764 90420003 */ lbu $v0, 3($v0) -/* 167FC8 80247768 3C058007 */ lui $a1, %hi(gSaveSlotMetadata) -/* 167FCC 8024776C 24A579C4 */ addiu $a1, $a1, %lo(gSaveSlotMetadata) -/* 167FD0 80247770 00021840 */ sll $v1, $v0, 1 -/* 167FD4 80247774 00621821 */ addu $v1, $v1, $v0 -/* 167FD8 80247778 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* 167FDC 8024777C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* 167FE0 80247780 000318C0 */ sll $v1, $v1, 3 -/* 167FE4 80247784 90440166 */ lbu $a0, 0x166($v0) -/* 167FE8 80247788 00651821 */ addu $v1, $v1, $a1 -/* 167FEC 8024778C 00041040 */ sll $v0, $a0, 1 -/* 167FF0 80247790 00441021 */ addu $v0, $v0, $a0 -/* 167FF4 80247794 000210C0 */ sll $v0, $v0, 3 -/* 167FF8 80247798 00451021 */ addu $v0, $v0, $a1 -/* 167FFC 8024779C 8C480000 */ lw $t0, ($v0) -/* 168000 802477A0 8C490004 */ lw $t1, 4($v0) -/* 168004 802477A4 8C4A0008 */ lw $t2, 8($v0) -/* 168008 802477A8 8C4B000C */ lw $t3, 0xc($v0) -/* 16800C 802477AC AC680000 */ sw $t0, ($v1) -/* 168010 802477B0 AC690004 */ sw $t1, 4($v1) -/* 168014 802477B4 AC6A0008 */ sw $t2, 8($v1) -/* 168018 802477B8 AC6B000C */ sw $t3, 0xc($v1) -/* 16801C 802477BC 8C480010 */ lw $t0, 0x10($v0) -/* 168020 802477C0 8C490014 */ lw $t1, 0x14($v0) -/* 168024 802477C4 AC680010 */ sw $t0, 0x10($v1) -/* 168028 802477C8 AC690014 */ sw $t1, 0x14($v1) -/* 16802C 802477CC 8E020000 */ lw $v0, ($s0) -/* 168030 802477D0 0C00ACDD */ jal fio_save_game -/* 168034 802477D4 90440003 */ lbu $a0, 3($v0) -/* 168038 802477D8 8E020000 */ lw $v0, ($s0) -/* 16803C 802477DC 90430003 */ lbu $v1, 3($v0) -/* 168040 802477E0 24020001 */ addiu $v0, $zero, 1 -.L802477E4: -/* 168044 802477E4 3C018007 */ lui $at, %hi(gSaveSlotHasData) -/* 168048 802477E8 00230821 */ addu $at, $at, $v1 -/* 16804C 802477EC A0227A24 */ sb $v0, %lo(gSaveSlotHasData)($at) -/* 168050 802477F0 08091EEE */ j .L80247BB8 -/* 168054 802477F4 00000000 */ nop -.L802477F8_168058: -/* 168058 802477F8 0C039CE8 */ jal clear_player_data -/* 16805C 802477FC 00000000 */ nop -/* 168060 80247800 0C0514C8 */ jal clear_saved_variables -/* 168064 80247804 00000000 */ nop -/* 168068 80247808 0000202D */ daddu $a0, $zero, $zero -/* 16806C 8024780C 3C05F5DE */ lui $a1, 0xf5de -/* 168070 80247810 34A50180 */ ori $a1, $a1, 0x180 -/* 168074 80247814 2406FF80 */ addiu $a2, $zero, -0x80 -/* 168078 80247818 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* 16807C 8024781C 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* 168080 80247820 2402000B */ addiu $v0, $zero, 0xb -/* 168084 80247824 A4600086 */ sh $zero, 0x86($v1) -/* 168088 80247828 A462008C */ sh $v0, 0x8c($v1) -/* 16808C 8024782C 0C0B2026 */ jal evt_set_variable -/* 168090 80247830 A460008E */ sh $zero, 0x8e($v1) -/* 168094 80247834 0000202D */ daddu $a0, $zero, $zero -/* 168098 80247838 3C028025 */ lui $v0, %hi(filemenu_menus) -/* 16809C 8024783C 8C429B84 */ lw $v0, %lo(filemenu_menus)($v0) -/* 1680A0 80247840 3C078007 */ lui $a3, %hi(gSaveSlotMetadata) -/* 1680A4 80247844 24E779C4 */ addiu $a3, $a3, %lo(gSaveSlotMetadata) -/* 1680A8 80247848 90510003 */ lbu $s1, 3($v0) -/* 1680AC 8024784C 3C068025 */ lui $a2, %hi(filemenu_8024C110) -/* 1680B0 80247850 24C6C110 */ addiu $a2, $a2, %lo(filemenu_8024C110) -/* 1680B4 80247854 00111040 */ sll $v0, $s1, 1 -/* 1680B8 80247858 00511021 */ addu $v0, $v0, $s1 -/* 1680BC 8024785C 000228C0 */ sll $a1, $v0, 3 -/* 1680C0 80247860 00851021 */ addu $v0, $a0, $a1 -.L80247864: -/* 1680C4 80247864 00861821 */ addu $v1, $a0, $a2 -/* 1680C8 80247868 24840001 */ addiu $a0, $a0, 1 -/* 1680CC 8024786C 90630000 */ lbu $v1, ($v1) -/* 1680D0 80247870 00471021 */ addu $v0, $v0, $a3 -/* 1680D4 80247874 A0430007 */ sb $v1, 7($v0) -/* 1680D8 80247878 28820008 */ slti $v0, $a0, 8 -/* 1680DC 8024787C 1440FFF9 */ bnez $v0, .L80247864 -/* 1680E0 80247880 00851021 */ addu $v0, $a0, $a1 -/* 1680E4 80247884 0C00ACDD */ jal fio_save_game -/* 1680E8 80247888 0220202D */ daddu $a0, $s1, $zero -/* 1680EC 8024788C 24040030 */ addiu $a0, $zero, 0x30 -/* 1680F0 80247890 3C108024 */ lui $s0, %hi(filemenu_update_hidden_name_input) -/* 1680F4 80247894 26103628 */ addiu $s0, $s0, %lo(filemenu_update_hidden_name_input) -/* 1680F8 80247898 24020001 */ addiu $v0, $zero, 1 -/* 1680FC 8024789C 3C018007 */ lui $at, %hi(gSaveSlotHasData) -/* 168100 802478A0 00310821 */ addu $at, $at, $s1 -/* 168104 802478A4 A0227A24 */ sb $v0, %lo(gSaveSlotHasData)($at) -/* 168108 802478A8 0C051F9F */ jal set_window_update -/* 16810C 802478AC 0200282D */ daddu $a1, $s0, $zero -/* 168110 802478B0 24040031 */ addiu $a0, $zero, 0x31 -/* 168114 802478B4 0C051F9F */ jal set_window_update -/* 168118 802478B8 0200282D */ daddu $a1, $s0, $zero -/* 16811C 802478BC 2404002D */ addiu $a0, $zero, 0x2d -/* 168120 802478C0 3C108024 */ lui $s0, %hi(filemenu_update_show_with_rotation) -/* 168124 802478C4 2610381C */ addiu $s0, $s0, %lo(filemenu_update_show_with_rotation) -/* 168128 802478C8 0C051F9F */ jal set_window_update -/* 16812C 802478CC 0200282D */ daddu $a1, $s0, $zero -/* 168130 802478D0 24040033 */ addiu $a0, $zero, 0x33 -/* 168134 802478D4 0C051F9F */ jal set_window_update -/* 168138 802478D8 0200282D */ daddu $a1, $s0, $zero -/* 16813C 802478DC 24040034 */ addiu $a0, $zero, 0x34 -/* 168140 802478E0 0C051F9F */ jal set_window_update -/* 168144 802478E4 0200282D */ daddu $a1, $s0, $zero -/* 168148 802478E8 24040035 */ addiu $a0, $zero, 0x35 -/* 16814C 802478EC 0C051F9F */ jal set_window_update -/* 168150 802478F0 0200282D */ daddu $a1, $s0, $zero -/* 168154 802478F4 24040036 */ addiu $a0, $zero, 0x36 -/* 168158 802478F8 0C051F9F */ jal set_window_update -/* 16815C 802478FC 0200282D */ daddu $a1, $s0, $zero -/* 168160 80247900 24040037 */ addiu $a0, $zero, 0x37 -/* 168164 80247904 0C051F9F */ jal set_window_update -/* 168168 80247908 0200282D */ daddu $a1, $s0, $zero -/* 16816C 8024790C 24040035 */ addiu $a0, $zero, 0x35 -/* 168170 80247910 0C051F9F */ jal set_window_update -/* 168174 80247914 0200282D */ daddu $a1, $s0, $zero -/* 168178 80247918 24040038 */ addiu $a0, $zero, 0x38 -/* 16817C 8024791C 0C051F9F */ jal set_window_update -/* 168180 80247920 0200282D */ daddu $a1, $s0, $zero -/* 168184 80247924 24040039 */ addiu $a0, $zero, 0x39 -/* 168188 80247928 0C051F9F */ jal set_window_update -/* 16818C 8024792C 0200282D */ daddu $a1, $s0, $zero -/* 168190 80247930 2404003A */ addiu $a0, $zero, 0x3a -/* 168194 80247934 0C051F9F */ jal set_window_update -/* 168198 80247938 0200282D */ daddu $a1, $s0, $zero -/* 16819C 8024793C 2404003B */ addiu $a0, $zero, 0x3b -/* 1681A0 80247940 0C051F9F */ jal set_window_update -/* 1681A4 80247944 0200282D */ daddu $a1, $s0, $zero -/* 1681A8 80247948 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 1681AC 8024794C 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 1681B0 80247950 0C051F9F */ jal set_window_update -/* 1681B4 80247954 24040032 */ addiu $a0, $zero, 0x32 -/* 1681B8 80247958 24020002 */ addiu $v0, $zero, 2 -/* 1681BC 8024795C 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 1681C0 80247960 A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 1681C4 80247964 24020003 */ addiu $v0, $zero, 3 -/* 1681C8 80247968 3C048016 */ lui $a0, %hi(gWindows) -/* 1681CC 8024796C 24849D50 */ addiu $a0, $a0, %lo(gWindows) -/* 1681D0 80247970 3C038025 */ lui $v1, %hi(filemenu_menus + 0x8) -/* 1681D4 80247974 8C639B8C */ lw $v1, %lo(filemenu_menus + 0x8)($v1) -/* 1681D8 80247978 A0620004 */ sb $v0, 4($v1) -/* 1681DC 8024797C 808305E3 */ lb $v1, 0x5e3($a0) -/* 1681E0 80247980 240200B8 */ addiu $v0, $zero, 0xb8 -/* 1681E4 80247984 A48205F0 */ sh $v0, 0x5f0($a0) -/* 1681E8 80247988 24020019 */ addiu $v0, $zero, 0x19 -/* 1681EC 8024798C A48205F2 */ sh $v0, 0x5f2($a0) -/* 1681F0 80247990 2402FFFF */ addiu $v0, $zero, -1 -/* 1681F4 80247994 1062000B */ beq $v1, $v0, .L802479C4 -/* 1681F8 80247998 248505EC */ addiu $a1, $a0, 0x5ec -/* 1681FC 8024799C 00031140 */ sll $v0, $v1, 5 -/* 168200 802479A0 00441021 */ addu $v0, $v0, $a0 -/* 168204 802479A4 94420010 */ lhu $v0, 0x10($v0) -/* 168208 802479A8 00021400 */ sll $v0, $v0, 0x10 -/* 16820C 802479AC 00021C03 */ sra $v1, $v0, 0x10 -/* 168210 802479B0 000217C2 */ srl $v0, $v0, 0x1f -/* 168214 802479B4 00621821 */ addu $v1, $v1, $v0 -/* 168218 802479B8 00031843 */ sra $v1, $v1, 1 -/* 16821C 802479BC 08091E74 */ j .L802479D0 -/* 168220 802479C0 2463FFA4 */ addiu $v1, $v1, -0x5c -.L802479C4: -/* 168224 802479C4 24030044 */ addiu $v1, $zero, 0x44 -/* 168228 802479C8 3C048016 */ lui $a0, %hi(gWindows) -/* 16822C 802479CC 24849D50 */ addiu $a0, $a0, %lo(gWindows) -.L802479D0: -/* 168230 802479D0 A4A30000 */ sh $v1, ($a1) -/* 168234 802479D4 948205F2 */ lhu $v0, 0x5f2($a0) -/* 168238 802479D8 00021400 */ sll $v0, $v0, 0x10 -/* 16823C 802479DC 00021C03 */ sra $v1, $v0, 0x10 -/* 168240 802479E0 000217C2 */ srl $v0, $v0, 0x1f -/* 168244 802479E4 00621821 */ addu $v1, $v1, $v0 -/* 168248 802479E8 00032843 */ sra $a1, $v1, 1 -/* 16824C 802479EC 808305E3 */ lb $v1, 0x5e3($a0) -/* 168250 802479F0 2402FFFF */ addiu $v0, $zero, -1 -/* 168254 802479F4 1062000B */ beq $v1, $v0, .L80247A24 -/* 168258 802479F8 248605EE */ addiu $a2, $a0, 0x5ee -/* 16825C 802479FC 00031140 */ sll $v0, $v1, 5 -/* 168260 80247A00 00441021 */ addu $v0, $v0, $a0 -/* 168264 80247A04 94420012 */ lhu $v0, 0x12($v0) -/* 168268 80247A08 00021400 */ sll $v0, $v0, 0x10 -/* 16826C 80247A0C 00021C03 */ sra $v1, $v0, 0x10 -/* 168270 80247A10 000217C2 */ srl $v0, $v0, 0x1f -/* 168274 80247A14 00621821 */ addu $v1, $v1, $v0 -/* 168278 80247A18 00031843 */ sra $v1, $v1, 1 -/* 16827C 80247A1C 08091E8B */ j .L80247A2C -/* 168280 80247A20 00651023 */ subu $v0, $v1, $a1 -.L80247A24: -/* 168284 80247A24 24020078 */ addiu $v0, $zero, 0x78 -/* 168288 80247A28 00451023 */ subu $v0, $v0, $a1 -.L80247A2C: -/* 16828C 80247A2C A4C20000 */ sh $v0, ($a2) -/* 168290 80247A30 2404002F */ addiu $a0, $zero, 0x2f -/* 168294 80247A34 08091EEC */ j .L80247BB0 -/* 168298 80247A38 24050001 */ addiu $a1, $zero, 1 -.L80247A3C_16829C: -/* 16829C 80247A3C 3C05800E */ lui $a1, %hi(D_800D95E8) -/* 1682A0 80247A40 24A595E8 */ addiu $a1, $a1, %lo(D_800D95E8) -/* 1682A4 80247A44 24060001 */ addiu $a2, $zero, 1 -/* 1682A8 80247A48 8CA20038 */ lw $v0, 0x38($a1) -/* 1682AC 80247A4C 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* 1682B0 80247A50 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* 1682B4 80247A54 3C048025 */ lui $a0, %hi(filemenu_menus) -/* 1682B8 80247A58 8C849B84 */ lw $a0, %lo(filemenu_menus)($a0) -/* 1682BC 80247A5C 00C21023 */ subu $v0, $a2, $v0 -/* 1682C0 80247A60 906300AB */ lbu $v1, 0xab($v1) -/* 1682C4 80247A64 90900003 */ lbu $s0, 3($a0) -/* 1682C8 80247A68 14620004 */ bne $v1, $v0, .L80247A7C -/* 1682CC 80247A6C 00C31023 */ subu $v0, $a2, $v1 -/* 1682D0 80247A70 90A2003F */ lbu $v0, 0x3f($a1) -/* 1682D4 80247A74 12020004 */ beq $s0, $v0, .L80247A88 -/* 1682D8 80247A78 00C31023 */ subu $v0, $a2, $v1 -.L80247A7C: -/* 1682DC 80247A7C ACA20038 */ sw $v0, 0x38($a1) -/* 1682E0 80247A80 0C00AC13 */ jal fio_flush_backups -/* 1682E4 80247A84 ACB0003C */ sw $s0, 0x3c($a1) -.L80247A88: -/* 1682E8 80247A88 0C00ACB4 */ jal fio_load_game -/* 1682EC 80247A8C 0200202D */ daddu $a0, $s0, $zero -/* 1682F0 80247A90 0C00CD3C */ jal set_game_mode -/* 1682F4 80247A94 2404000F */ addiu $a0, $zero, 0xf -/* 1682F8 80247A98 08091EEE */ j .L80247BB8 -/* 1682FC 80247A9C 00000000 */ nop -.L80247AA0: -/* 168300 80247AA0 82430004 */ lb $v1, 4($s2) -/* 168304 80247AA4 2C620005 */ sltiu $v0, $v1, 5 -/* 168308 80247AA8 10400043 */ beqz $v0, .L80247BB8 -/* 16830C 80247AAC 00031080 */ sll $v0, $v1, 2 -/* 168310 80247AB0 3C018025 */ lui $at, %hi(jtbl_8024C030) -/* 168314 80247AB4 00220821 */ addu $at, $at, $v0 -/* 168318 80247AB8 8C22C030 */ lw $v0, %lo(jtbl_8024C030)($at) -/* 16831C 80247ABC 00400008 */ jr $v0 -/* 168320 80247AC0 00000000 */ nop -.L80247AC4_168324: -/* 168324 80247AC4 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 168328 80247AC8 A020C098 */ sb $zero, %lo(filemenu_8024C098)($at) -/* 16832C 80247ACC 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 168330 80247AD0 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 168334 80247AD4 08091EEC */ j .L80247BB0 -/* 168338 80247AD8 24040032 */ addiu $a0, $zero, 0x32 -.L80247ADC_16833C: -/* 16833C 80247ADC 24020003 */ addiu $v0, $zero, 3 -/* 168340 80247AE0 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 168344 80247AE4 A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 168348 80247AE8 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 16834C 80247AEC 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 168350 80247AF0 08091EEC */ j .L80247BB0 -/* 168354 80247AF4 24040032 */ addiu $a0, $zero, 0x32 -.L80247AF8_168358: -/* 168358 80247AF8 2404002D */ addiu $a0, $zero, 0x2d -/* 16835C 80247AFC 3C108024 */ lui $s0, %hi(filemenu_update_show_with_rotation) -/* 168360 80247B00 2610381C */ addiu $s0, $s0, %lo(filemenu_update_show_with_rotation) -/* 168364 80247B04 3C028025 */ lui $v0, %hi(filemenu_menus) -/* 168368 80247B08 8C429B84 */ lw $v0, %lo(filemenu_menus)($v0) -/* 16836C 80247B0C 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 168370 80247B10 A020C098 */ sb $zero, %lo(filemenu_8024C098)($at) -/* 168374 80247B14 90510003 */ lbu $s1, 3($v0) -/* 168378 80247B18 0C051F9F */ jal set_window_update -/* 16837C 80247B1C 0200282D */ daddu $a1, $s0, $zero -/* 168380 80247B20 24040033 */ addiu $a0, $zero, 0x33 -/* 168384 80247B24 0C051F9F */ jal set_window_update -/* 168388 80247B28 0200282D */ daddu $a1, $s0, $zero -/* 16838C 80247B2C 24040034 */ addiu $a0, $zero, 0x34 -/* 168390 80247B30 0C051F9F */ jal set_window_update -/* 168394 80247B34 0200282D */ daddu $a1, $s0, $zero -/* 168398 80247B38 24040035 */ addiu $a0, $zero, 0x35 -/* 16839C 80247B3C 0C051F9F */ jal set_window_update -/* 1683A0 80247B40 0200282D */ daddu $a1, $s0, $zero -/* 1683A4 80247B44 24040036 */ addiu $a0, $zero, 0x36 -/* 1683A8 80247B48 0C051F9F */ jal set_window_update -/* 1683AC 80247B4C 0200282D */ daddu $a1, $s0, $zero -/* 1683B0 80247B50 24040037 */ addiu $a0, $zero, 0x37 -/* 1683B4 80247B54 0C051F9F */ jal set_window_update -/* 1683B8 80247B58 0200282D */ daddu $a1, $s0, $zero -/* 1683BC 80247B5C 24040035 */ addiu $a0, $zero, 0x35 -/* 1683C0 80247B60 0C051F9F */ jal set_window_update -/* 1683C4 80247B64 0200282D */ daddu $a1, $s0, $zero -/* 1683C8 80247B68 24040038 */ addiu $a0, $zero, 0x38 -/* 1683CC 80247B6C 0C051F9F */ jal set_window_update -/* 1683D0 80247B70 0200282D */ daddu $a1, $s0, $zero -/* 1683D4 80247B74 24040039 */ addiu $a0, $zero, 0x39 -/* 1683D8 80247B78 0C051F9F */ jal set_window_update -/* 1683DC 80247B7C 0200282D */ daddu $a1, $s0, $zero -/* 1683E0 80247B80 2404003A */ addiu $a0, $zero, 0x3a -/* 1683E4 80247B84 0C051F9F */ jal set_window_update -/* 1683E8 80247B88 0200282D */ daddu $a1, $s0, $zero -/* 1683EC 80247B8C 2404003B */ addiu $a0, $zero, 0x3b -/* 1683F0 80247B90 0C051F9F */ jal set_window_update -/* 1683F4 80247B94 0200282D */ daddu $a1, $s0, $zero -/* 1683F8 80247B98 3C058024 */ lui $a1, %hi(filemenu_update_deselect_file) -/* 1683FC 80247B9C 24A53B10 */ addiu $a1, $a1, %lo(filemenu_update_deselect_file) -/* 168400 80247BA0 0C051F9F */ jal set_window_update -/* 168404 80247BA4 26240038 */ addiu $a0, $s1, 0x38 -/* 168408 80247BA8 24040032 */ addiu $a0, $zero, 0x32 -/* 16840C 80247BAC 24050002 */ addiu $a1, $zero, 2 -.L80247BB0: -/* 168410 80247BB0 0C051F9F */ jal set_window_update -/* 168414 80247BB4 00000000 */ nop -.L80247BB8: -/* 168418 80247BB8 3C028025 */ lui $v0, %hi(filemenu_pressedButtons) -/* 16841C 80247BBC 8C42C084 */ lw $v0, %lo(filemenu_pressedButtons)($v0) -/* 168420 80247BC0 30424000 */ andi $v0, $v0, 0x4000 -/* 168424 80247BC4 1040004D */ beqz $v0, .L80247CFC -/* 168428 80247BC8 00000000 */ nop -/* 16842C 80247BCC 0C05272D */ jal sfx_play_sound -/* 168430 80247BD0 240400CA */ addiu $a0, $zero, 0xca -/* 168434 80247BD4 0240202D */ daddu $a0, $s2, $zero -/* 168438 80247BD8 0000282D */ daddu $a1, $zero, $zero -/* 16843C 80247BDC 0C090B65 */ jal filemenu_set_selected -/* 168440 80247BE0 24060001 */ addiu $a2, $zero, 1 -/* 168444 80247BE4 82440004 */ lb $a0, 4($s2) -/* 168448 80247BE8 2C820005 */ sltiu $v0, $a0, 5 -/* 16844C 80247BEC 10400043 */ beqz $v0, .L80247CFC -/* 168450 80247BF0 00041080 */ sll $v0, $a0, 2 -/* 168454 80247BF4 3C018025 */ lui $at, %hi(jtbl_8024C048) -/* 168458 80247BF8 00220821 */ addu $at, $at, $v0 -/* 16845C 80247BFC 8C22C048 */ lw $v0, %lo(jtbl_8024C048)($at) -/* 168460 80247C00 00400008 */ jr $v0 -/* 168464 80247C04 00000000 */ nop -.L80247C08_168468: -/* 168468 80247C08 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 16846C 80247C0C A020C098 */ sb $zero, %lo(filemenu_8024C098)($at) -/* 168470 80247C10 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 168474 80247C14 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 168478 80247C18 08091F3D */ j .L80247CF4 -/* 16847C 80247C1C 24040032 */ addiu $a0, $zero, 0x32 -.L80247C20_168480: -/* 168480 80247C20 24020003 */ addiu $v0, $zero, 3 -/* 168484 80247C24 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 168488 80247C28 A022C098 */ sb $v0, %lo(filemenu_8024C098)($at) -/* 16848C 80247C2C 3C058024 */ lui $a1, %hi(filemenu_update_hidden_name_confirm) -/* 168490 80247C30 24A53EEC */ addiu $a1, $a1, %lo(filemenu_update_hidden_name_confirm) -/* 168494 80247C34 08091F3D */ j .L80247CF4 -/* 168498 80247C38 24040032 */ addiu $a0, $zero, 0x32 -.L80247C3C_16849C: -/* 16849C 80247C3C 2404002D */ addiu $a0, $zero, 0x2d -/* 1684A0 80247C40 3C108024 */ lui $s0, %hi(filemenu_update_show_with_rotation) -/* 1684A4 80247C44 2610381C */ addiu $s0, $s0, %lo(filemenu_update_show_with_rotation) -/* 1684A8 80247C48 3C028025 */ lui $v0, %hi(filemenu_menus) -/* 1684AC 80247C4C 8C429B84 */ lw $v0, %lo(filemenu_menus)($v0) -/* 1684B0 80247C50 3C018025 */ lui $at, %hi(filemenu_8024C098) -/* 1684B4 80247C54 A020C098 */ sb $zero, %lo(filemenu_8024C098)($at) -/* 1684B8 80247C58 90510003 */ lbu $s1, 3($v0) -/* 1684BC 80247C5C 0C051F9F */ jal set_window_update -/* 1684C0 80247C60 0200282D */ daddu $a1, $s0, $zero -/* 1684C4 80247C64 24040033 */ addiu $a0, $zero, 0x33 -/* 1684C8 80247C68 0C051F9F */ jal set_window_update -/* 1684CC 80247C6C 0200282D */ daddu $a1, $s0, $zero -/* 1684D0 80247C70 24040034 */ addiu $a0, $zero, 0x34 -/* 1684D4 80247C74 0C051F9F */ jal set_window_update -/* 1684D8 80247C78 0200282D */ daddu $a1, $s0, $zero -/* 1684DC 80247C7C 24040035 */ addiu $a0, $zero, 0x35 -/* 1684E0 80247C80 0C051F9F */ jal set_window_update -/* 1684E4 80247C84 0200282D */ daddu $a1, $s0, $zero -/* 1684E8 80247C88 24040036 */ addiu $a0, $zero, 0x36 -/* 1684EC 80247C8C 0C051F9F */ jal set_window_update -/* 1684F0 80247C90 0200282D */ daddu $a1, $s0, $zero -/* 1684F4 80247C94 24040037 */ addiu $a0, $zero, 0x37 -/* 1684F8 80247C98 0C051F9F */ jal set_window_update -/* 1684FC 80247C9C 0200282D */ daddu $a1, $s0, $zero -/* 168500 80247CA0 24040035 */ addiu $a0, $zero, 0x35 -/* 168504 80247CA4 0C051F9F */ jal set_window_update -/* 168508 80247CA8 0200282D */ daddu $a1, $s0, $zero -/* 16850C 80247CAC 24040038 */ addiu $a0, $zero, 0x38 -/* 168510 80247CB0 0C051F9F */ jal set_window_update -/* 168514 80247CB4 0200282D */ daddu $a1, $s0, $zero -/* 168518 80247CB8 24040039 */ addiu $a0, $zero, 0x39 -/* 16851C 80247CBC 0C051F9F */ jal set_window_update -/* 168520 80247CC0 0200282D */ daddu $a1, $s0, $zero -/* 168524 80247CC4 2404003A */ addiu $a0, $zero, 0x3a -/* 168528 80247CC8 0C051F9F */ jal set_window_update -/* 16852C 80247CCC 0200282D */ daddu $a1, $s0, $zero -/* 168530 80247CD0 2404003B */ addiu $a0, $zero, 0x3b -/* 168534 80247CD4 0C051F9F */ jal set_window_update -/* 168538 80247CD8 0200282D */ daddu $a1, $s0, $zero -/* 16853C 80247CDC 3C058024 */ lui $a1, %hi(filemenu_update_deselect_file) -/* 168540 80247CE0 24A53B10 */ addiu $a1, $a1, %lo(filemenu_update_deselect_file) -/* 168544 80247CE4 0C051F9F */ jal set_window_update -/* 168548 80247CE8 26240038 */ addiu $a0, $s1, 0x38 -/* 16854C 80247CEC 24040032 */ addiu $a0, $zero, 0x32 -/* 168550 80247CF0 24050002 */ addiu $a1, $zero, 2 -.L80247CF4: -/* 168554 80247CF4 0C051F9F */ jal set_window_update -/* 168558 80247CF8 00000000 */ nop -.L80247CFC: -/* 16855C 80247CFC 8FBF001C */ lw $ra, 0x1c($sp) -/* 168560 80247D00 8FB20018 */ lw $s2, 0x18($sp) -/* 168564 80247D04 8FB10014 */ lw $s1, 0x14($sp) -/* 168568 80247D08 8FB00010 */ lw $s0, 0x10($sp) -/* 16856C 80247D0C 03E00008 */ jr $ra -/* 168570 80247D10 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/190A10/func_80262130.s b/ver/us/asm/nonmatchings/190A10/func_80262130.s deleted file mode 100644 index ebe5b5fe47..0000000000 --- a/ver/us/asm/nonmatchings/190A10/func_80262130.s +++ /dev/null @@ -1,62 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80262130 -/* 190A10 80262130 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* 190A14 80262134 AFB20038 */ sw $s2, 0x38($sp) -/* 190A18 80262138 0000902D */ daddu $s2, $zero, $zero -/* 190A1C 8026213C AFB00030 */ sw $s0, 0x30($sp) -/* 190A20 80262140 0240802D */ daddu $s0, $s2, $zero -/* 190A24 80262144 0240202D */ daddu $a0, $s2, $zero -/* 190A28 80262148 27A2002C */ addiu $v0, $sp, 0x2c -/* 190A2C 8026214C C7A20058 */ lwc1 $f2, 0x58($sp) -/* 190A30 80262150 27A50020 */ addiu $a1, $sp, 0x20 -/* 190A34 80262154 AFA60028 */ sw $a2, 0x28($sp) -/* 190A38 80262158 27A60024 */ addiu $a2, $sp, 0x24 -/* 190A3C 8026215C F7B40040 */ sdc1 $f20, 0x40($sp) -/* 190A40 80262160 4487A000 */ mtc1 $a3, $f20 -/* 190A44 80262164 3C0142B4 */ lui $at, 0x42b4 -/* 190A48 80262168 44810000 */ mtc1 $at, $f0 -/* 190A4C 8026216C 27A70028 */ addiu $a3, $sp, 0x28 -/* 190A50 80262170 AFBF003C */ sw $ra, 0x3c($sp) -/* 190A54 80262174 AFB10034 */ sw $s1, 0x34($sp) -/* 190A58 80262178 E7AC0020 */ swc1 $f12, 0x20($sp) -/* 190A5C 8026217C E7AE0024 */ swc1 $f14, 0x24($sp) -/* 190A60 80262180 E7B4002C */ swc1 $f20, 0x2c($sp) -/* 190A64 80262184 AFA20010 */ sw $v0, 0x10($sp) -/* 190A68 80262188 E7A00014 */ swc1 $f0, 0x14($sp) -/* 190A6C 8026218C 0C0371DE */ jal npc_raycast_down_around -/* 190A70 80262190 E7A20018 */ swc1 $f2, 0x18($sp) -/* 190A74 80262194 10400013 */ beqz $v0, .L802621E4 -/* 190A78 80262198 24020001 */ addiu $v0, $zero, 1 -/* 190A7C 8026219C C7A0002C */ lwc1 $f0, 0x2c($sp) -/* 190A80 802621A0 4614003E */ c.le.s $f0, $f20 -/* 190A84 802621A4 00000000 */ nop -/* 190A88 802621A8 4500000E */ bc1f .L802621E4 -/* 190A8C 802621AC 00000000 */ nop -/* 190A90 802621B0 3C118011 */ lui $s1, %hi(D_8010C98C) -/* 190A94 802621B4 2631C98C */ addiu $s1, $s1, %lo(D_8010C98C) -/* 190A98 802621B8 0C016F6A */ jal get_collider_type_by_id -/* 190A9C 802621BC 92240003 */ lbu $a0, 3($s1) -/* 190AA0 802621C0 3C048011 */ lui $a0, %hi(D_8010C96B) -/* 190AA4 802621C4 9084C96B */ lbu $a0, %lo(D_8010C96B)($a0) -/* 190AA8 802621C8 0C016F6A */ jal get_collider_type_by_id -/* 190AAC 802621CC 0040802D */ daddu $s0, $v0, $zero -/* 190AB0 802621D0 92230003 */ lbu $v1, 3($s1) -/* 190AB4 802621D4 02028024 */ and $s0, $s0, $v0 -/* 190AB8 802621D8 56030001 */ bnel $s0, $v1, .L802621E0 -/* 190ABC 802621DC 0240802D */ daddu $s0, $s2, $zero -.L802621E0: -/* 190AC0 802621E0 24020001 */ addiu $v0, $zero, 1 -.L802621E4: -/* 190AC4 802621E4 52020001 */ beql $s0, $v0, .L802621EC -/* 190AC8 802621E8 0040902D */ daddu $s2, $v0, $zero -.L802621EC: -/* 190ACC 802621EC 0240102D */ daddu $v0, $s2, $zero -/* 190AD0 802621F0 8FBF003C */ lw $ra, 0x3c($sp) -/* 190AD4 802621F4 8FB20038 */ lw $s2, 0x38($sp) -/* 190AD8 802621F8 8FB10034 */ lw $s1, 0x34($sp) -/* 190ADC 802621FC 8FB00030 */ lw $s0, 0x30($sp) -/* 190AE0 80262200 D7B40040 */ ldc1 $f20, 0x40($sp) -/* 190AE4 80262204 03E00008 */ jr $ra -/* 190AE8 80262208 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/C50A0/update_item_entities.s b/ver/us/asm/nonmatchings/C50A0/update_item_entities.s deleted file mode 100644 index f31c01d8d8..0000000000 --- a/ver/us/asm/nonmatchings/C50A0/update_item_entities.s +++ /dev/null @@ -1,202 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -dlabel jtbl_80150BD8 -.word .L80131FD8_C86D8, .L80131FE8_C86E8, .L80131FE8_C86E8, .L80131FF8_C86F8, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80131FF8_C86F8, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80131FF8_C86F8, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80131FF8_C86F8, .L80132010_C8710, .L80132010_C8710, .L80131FF8_C86F8, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132010_C8710, .L80132008_C8708, 0 - -dlabel jtbl_80150C50 -.word .L8013204C_C874C, .L80132140_C8840, .L80132140_C8840, .L8013204C_C874C, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L8013204C_C874C, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L8013204C_C874C, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L80132140_C8840, .L8013204C_C874C, 0 - -.section .text - -glabel update_item_entities -/* C85EC 80131EEC 3C02800A */ lui $v0, %hi(gOverrideFlags) -/* C85F0 80131EF0 8C42A650 */ lw $v0, %lo(gOverrideFlags)($v0) -/* C85F4 80131EF4 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* C85F8 80131EF8 AFBF0038 */ sw $ra, 0x38($sp) -/* C85FC 80131EFC AFB30034 */ sw $s3, 0x34($sp) -/* C8600 80131F00 AFB20030 */ sw $s2, 0x30($sp) -/* C8604 80131F04 AFB1002C */ sw $s1, 0x2c($sp) -/* C8608 80131F08 30420C00 */ andi $v0, $v0, 0xc00 -/* C860C 80131F0C 1440009E */ bnez $v0, .L80132188 -/* C8610 80131F10 AFB00028 */ sw $s0, 0x28($sp) -/* C8614 80131F14 0000982D */ daddu $s3, $zero, $zero -/* C8618 80131F18 0260902D */ daddu $s2, $s3, $zero -.L80131F1C: -/* C861C 80131F1C 3C028015 */ lui $v0, %hi(D_801565A0) -/* C8620 80131F20 8C4265A0 */ lw $v0, %lo(D_801565A0)($v0) -/* C8624 80131F24 02421021 */ addu $v0, $s2, $v0 -/* C8628 80131F28 8C510000 */ lw $s1, ($v0) -/* C862C 80131F2C 52200093 */ beql $s1, $zero, .L8013217C -/* C8630 80131F30 26730001 */ addiu $s3, $s3, 1 -/* C8634 80131F34 8E220000 */ lw $v0, ($s1) -/* C8638 80131F38 1040008F */ beqz $v0, .L80132178 -/* C863C 80131F3C 24020157 */ addiu $v0, $zero, 0x157 -/* C8640 80131F40 86230018 */ lh $v1, 0x18($s1) -/* C8644 80131F44 14620019 */ bne $v1, $v0, .L80131FAC -/* C8648 80131F48 00000000 */ nop -/* C864C 80131F4C 0C00A67F */ jal rand_int -/* C8650 80131F50 24040064 */ addiu $a0, $zero, 0x64 -/* C8654 80131F54 2842005B */ slti $v0, $v0, 0x5b -/* C8658 80131F58 14400012 */ bnez $v0, .L80131FA4 -/* C865C 80131F5C 00000000 */ nop -/* C8660 80131F60 3C058010 */ lui $a1, %hi(SparkleScript_Coin) -/* C8664 80131F64 24A54AC0 */ addiu $a1, $a1, %lo(SparkleScript_Coin) -/* C8668 80131F68 0C04C27C */ jal sparkle_script_init -/* C866C 80131F6C 0220202D */ daddu $a0, $s1, $zero -/* C8670 80131F70 0C00A67F */ jal rand_int -/* C8674 80131F74 24040010 */ addiu $a0, $zero, 0x10 -/* C8678 80131F78 2442FFF8 */ addiu $v0, $v0, -8 -/* C867C 80131F7C 3C018015 */ lui $at, %hi(D_80155D8C) -/* C8680 80131F80 A4225D8C */ sh $v0, %lo(D_80155D8C)($at) -/* C8684 80131F84 0C00A67F */ jal rand_int -/* C8688 80131F88 24040010 */ addiu $a0, $zero, 0x10 -/* C868C 80131F8C 2442FFF8 */ addiu $v0, $v0, -8 -/* C8690 80131F90 3C018015 */ lui $at, %hi(D_80155D8E) -/* C8694 80131F94 A4225D8E */ sh $v0, %lo(D_80155D8E)($at) -/* C8698 80131F98 24020005 */ addiu $v0, $zero, 5 -/* C869C 80131F9C 3C018015 */ lui $at, %hi(D_80155D90) -/* C86A0 80131FA0 A4225D90 */ sh $v0, %lo(D_80155D90)($at) -.L80131FA4: -/* C86A4 80131FA4 0C04C2B3 */ jal sparkle_script_update -/* C86A8 80131FA8 0220202D */ daddu $a0, $s1, $zero -.L80131FAC: -/* C86AC 80131FAC 0C04C775 */ jal item_entity_update -/* C86B0 80131FB0 0220202D */ daddu $a0, $s1, $zero -/* C86B4 80131FB4 8223001B */ lb $v1, 0x1b($s1) -/* C86B8 80131FB8 2C62001D */ sltiu $v0, $v1, 0x1d -/* C86BC 80131FBC 10400014 */ beqz $v0, .L80132010_C8710 -/* C86C0 80131FC0 00031080 */ sll $v0, $v1, 2 -/* C86C4 80131FC4 3C018015 */ lui $at, %hi(jtbl_80150BD8) -/* C86C8 80131FC8 00220821 */ addu $at, $at, $v0 -/* C86CC 80131FCC 8C220BD8 */ lw $v0, %lo(jtbl_80150BD8)($at) -/* C86D0 80131FD0 00400008 */ jr $v0 -/* C86D4 80131FD4 00000000 */ nop -.L80131FD8_C86D8: -/* C86D8 80131FD8 0C04D596 */ jal update_item_entity_static -/* C86DC 80131FDC 0220202D */ daddu $a0, $s1, $zero -/* C86E0 80131FE0 0804C804 */ j .L80132010_C8710 -/* C86E4 80131FE4 00000000 */ nop -.L80131FE8_C86E8: -/* C86E8 80131FE8 0C04D5B3 */ jal func_801356CC -/* C86EC 80131FEC 0220202D */ daddu $a0, $s1, $zero -/* C86F0 80131FF0 0804C804 */ j .L80132010_C8710 -/* C86F4 80131FF4 00000000 */ nop -.L80131FF8_C86F8: -/* C86F8 80131FF8 0C04D094 */ jal update_item_entity_collectable -/* C86FC 80131FFC 0220202D */ daddu $a0, $s1, $zero -/* C8700 80132000 0804C804 */ j .L80132010_C8710 -/* C8704 80132004 00000000 */ nop -.L80132008_C8708: -/* C8708 80132008 0C04D5B7 */ jal update_item_entity_temp -/* C870C 8013200C 0220202D */ daddu $a0, $s1, $zero -.L80132010_C8710: -/* C8710 80132010 3C028015 */ lui $v0, %hi(D_801565A0) -/* C8714 80132014 8C4265A0 */ lw $v0, %lo(D_801565A0)($v0) -/* C8718 80132018 02421021 */ addu $v0, $s2, $v0 -/* C871C 8013201C 8C510000 */ lw $s1, ($v0) -/* C8720 80132020 52200056 */ beql $s1, $zero, .L8013217C -/* C8724 80132024 26730001 */ addiu $s3, $s3, 1 -/* C8728 80132028 8223001B */ lb $v1, 0x1b($s1) -/* C872C 8013202C 2C62001D */ sltiu $v0, $v1, 0x1d -/* C8730 80132030 10400043 */ beqz $v0, .L80132140_C8840 -/* C8734 80132034 00031080 */ sll $v0, $v1, 2 -/* C8738 80132038 3C018015 */ lui $at, %hi(jtbl_80150C50) -/* C873C 8013203C 00220821 */ addu $at, $at, $v0 -/* C8740 80132040 8C220C50 */ lw $v0, %lo(jtbl_80150C50)($at) -/* C8744 80132044 00400008 */ jr $v0 -/* C8748 80132048 00000000 */ nop -.L8013204C_C874C: -/* C874C 8013204C C6200008 */ lwc1 $f0, 8($s1) -/* C8750 80132050 C622000C */ lwc1 $f2, 0xc($s1) -/* C8754 80132054 86220034 */ lh $v0, 0x34($s1) -/* C8758 80132058 4600020D */ trunc.w.s $f8, $f0 -/* C875C 8013205C 44034000 */ mfc1 $v1, $f8 -/* C8760 80132060 C6200010 */ lwc1 $f0, 0x10($s1) -/* C8764 80132064 4600120D */ trunc.w.s $f8, $f2 -/* C8768 80132068 44054000 */ mfc1 $a1, $f8 -/* C876C 8013206C 4600020D */ trunc.w.s $f8, $f0 -/* C8770 80132070 44044000 */ mfc1 $a0, $f8 -/* C8774 80132074 14620007 */ bne $v1, $v0, .L80132094 -/* C8778 80132078 00000000 */ nop -/* C877C 8013207C 86220036 */ lh $v0, 0x36($s1) -/* C8780 80132080 14A20004 */ bne $a1, $v0, .L80132094 -/* C8784 80132084 00000000 */ nop -/* C8788 80132088 86220038 */ lh $v0, 0x38($s1) -/* C878C 8013208C 1082002C */ beq $a0, $v0, .L80132140_C8840 -/* C8790 80132090 00000000 */ nop -.L80132094: -/* C8794 80132094 0C044181 */ jal get_shadow_by_index -/* C8798 80132098 86240020 */ lh $a0, 0x20($s1) -/* C879C 8013209C 3C040002 */ lui $a0, 2 -/* C87A0 801320A0 27A50018 */ addiu $a1, $sp, 0x18 -/* C87A4 801320A4 27A30024 */ addiu $v1, $sp, 0x24 -/* C87A8 801320A8 0040802D */ daddu $s0, $v0, $zero -/* C87AC 801320AC 27A6001C */ addiu $a2, $sp, 0x1c -/* C87B0 801320B0 C6200008 */ lwc1 $f0, 8($s1) -/* C87B4 801320B4 3C014140 */ lui $at, 0x4140 -/* C87B8 801320B8 44811000 */ mtc1 $at, $f2 -/* C87BC 801320BC 3C01447A */ lui $at, 0x447a -/* C87C0 801320C0 44813000 */ mtc1 $at, $f6 -/* C87C4 801320C4 27A70020 */ addiu $a3, $sp, 0x20 -/* C87C8 801320C8 E7A00018 */ swc1 $f0, 0x18($sp) -/* C87CC 801320CC C620000C */ lwc1 $f0, 0xc($s1) -/* C87D0 801320D0 C6240010 */ lwc1 $f4, 0x10($s1) -/* C87D4 801320D4 46020000 */ add.s $f0, $f0, $f2 -/* C87D8 801320D8 E7A60024 */ swc1 $f6, 0x24($sp) -/* C87DC 801320DC E7A40020 */ swc1 $f4, 0x20($sp) -/* C87E0 801320E0 E7A0001C */ swc1 $f0, 0x1c($sp) -/* C87E4 801320E4 0C0372DF */ jal npc_raycast_down_sides -/* C87E8 801320E8 AFA30010 */ sw $v1, 0x10($sp) -/* C87EC 801320EC C7A00018 */ lwc1 $f0, 0x18($sp) -/* C87F0 801320F0 C7A2001C */ lwc1 $f2, 0x1c($sp) -/* C87F4 801320F4 C7A40020 */ lwc1 $f4, 0x20($sp) -/* C87F8 801320F8 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* C87FC 801320FC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* C8800 80132100 E6000010 */ swc1 $f0, 0x10($s0) -/* C8804 80132104 E6020014 */ swc1 $f2, 0x14($s0) -/* C8808 80132108 E6040018 */ swc1 $f4, 0x18($s0) -/* C880C 8013210C C7A20024 */ lwc1 $f2, 0x24($sp) -/* C8810 80132110 3C013F00 */ lui $at, 0x3f00 -/* C8814 80132114 44810000 */ mtc1 $at, $f0 -/* C8818 80132118 C444011C */ lwc1 $f4, 0x11c($v0) -/* C881C 8013211C 46001082 */ mul.s $f2, $f2, $f0 -/* C8820 80132120 00000000 */ nop -/* C8824 80132124 AE00002C */ sw $zero, 0x2c($s0) -/* C8828 80132128 E6040028 */ swc1 $f4, 0x28($s0) -/* C882C 8013212C C4400124 */ lwc1 $f0, 0x124($v0) -/* C8830 80132130 44051000 */ mfc1 $a1, $f2 -/* C8834 80132134 0200202D */ daddu $a0, $s0, $zero -/* C8838 80132138 0C044A17 */ jal set_standard_shadow_scale -/* C883C 8013213C E4800030 */ swc1 $f0, 0x30($a0) -.L80132140_C8840: -/* C8840 80132140 C6200008 */ lwc1 $f0, 8($s1) -/* C8844 80132144 C6220010 */ lwc1 $f2, 0x10($s1) -/* C8848 80132148 4600020D */ trunc.w.s $f8, $f0 -/* C884C 8013214C 44024000 */ mfc1 $v0, $f8 -/* C8850 80132150 C620000C */ lwc1 $f0, 0xc($s1) -/* C8854 80132154 A6220034 */ sh $v0, 0x34($s1) -/* C8858 80132158 4600020D */ trunc.w.s $f8, $f0 -/* C885C 8013215C 44024000 */ mfc1 $v0, $f8 -/* C8860 80132160 00000000 */ nop -/* C8864 80132164 A6220036 */ sh $v0, 0x36($s1) -/* C8868 80132168 4600120D */ trunc.w.s $f8, $f2 -/* C886C 8013216C 44024000 */ mfc1 $v0, $f8 -/* C8870 80132170 00000000 */ nop -/* C8874 80132174 A6220038 */ sh $v0, 0x38($s1) -.L80132178: -/* C8878 80132178 26730001 */ addiu $s3, $s3, 1 -.L8013217C: -/* C887C 8013217C 2A620100 */ slti $v0, $s3, 0x100 -/* C8880 80132180 1440FF66 */ bnez $v0, .L80131F1C -/* C8884 80132184 26520004 */ addiu $s2, $s2, 4 -.L80132188: -/* C8888 80132188 8FBF0038 */ lw $ra, 0x38($sp) -/* C888C 8013218C 8FB30034 */ lw $s3, 0x34($sp) -/* C8890 80132190 8FB20030 */ lw $s2, 0x30($sp) -/* C8894 80132194 8FB1002C */ lw $s1, 0x2c($sp) -/* C8898 80132198 8FB00028 */ lw $s0, 0x28($sp) -/* C889C 8013219C 03E00008 */ jr $ra -/* C88A0 801321A0 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/ver/us/asm/nonmatchings/a5dd0_len_114e0/mdl_local_gfx_copy_vertices.s b/ver/us/asm/nonmatchings/a5dd0_len_114e0/mdl_local_gfx_copy_vertices.s deleted file mode 100644 index 2db5318d57..0000000000 --- a/ver/us/asm/nonmatchings/a5dd0_len_114e0/mdl_local_gfx_copy_vertices.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel mdl_local_gfx_copy_vertices -/* B2830 8011C130 00052900 */ sll $a1, $a1, 4 -/* B2834 8011C134 10A00009 */ beqz $a1, .L8011C15C -/* B2838 8011C138 0000382D */ daddu $a3, $zero, $zero -/* B283C 8011C13C 00C71821 */ addu $v1, $a2, $a3 -.L8011C140: -/* B2840 8011C140 00871021 */ addu $v0, $a0, $a3 -/* B2844 8011C144 90420000 */ lbu $v0, ($v0) -/* B2848 8011C148 24E70001 */ addiu $a3, $a3, 1 -/* B284C 8011C14C A0620000 */ sb $v0, ($v1) -/* B2850 8011C150 00E5102B */ sltu $v0, $a3, $a1 -/* B2854 8011C154 1440FFFA */ bnez $v0, .L8011C140 -/* B2858 8011C158 00C71821 */ addu $v1, $a2, $a3 -.L8011C15C: -/* B285C 8011C15C 03E00008 */ jr $ra -/* B2860 8011C160 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/a5dd0_len_114e0/set_next_game_mode.s b/ver/us/asm/nonmatchings/a5dd0_len_114e0/set_next_game_mode.s deleted file mode 100644 index e9de00e3e8..0000000000 --- a/ver/us/asm/nonmatchings/a5dd0_len_114e0/set_next_game_mode.s +++ /dev/null @@ -1,71 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel set_next_game_mode -/* A92BC 80112BBC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* A92C0 80112BC0 AFB00010 */ sw $s0, 0x10($sp) -/* A92C4 80112BC4 3C108015 */ lui $s0, %hi(gMainGameState) -/* A92C8 80112BC8 26101700 */ addiu $s0, $s0, %lo(gMainGameState) -/* A92CC 80112BCC 0000182D */ daddu $v1, $zero, $zero -/* A92D0 80112BD0 AFBF0014 */ sw $ra, 0x14($sp) -.L80112BD4: -/* A92D4 80112BD4 96020000 */ lhu $v0, ($s0) -/* A92D8 80112BD8 10400006 */ beqz $v0, .L80112BF4 -/* A92DC 80112BDC 28620002 */ slti $v0, $v1, 2 -/* A92E0 80112BE0 24630001 */ addiu $v1, $v1, 1 -/* A92E4 80112BE4 28620002 */ slti $v0, $v1, 2 -/* A92E8 80112BE8 1440FFFA */ bnez $v0, .L80112BD4 -/* A92EC 80112BEC 26100018 */ addiu $s0, $s0, 0x18 -/* A92F0 80112BF0 28620002 */ slti $v0, $v1, 2 -.L80112BF4: -/* A92F4 80112BF4 14400003 */ bnez $v0, .L80112C04 -/* A92F8 80112BF8 24020003 */ addiu $v0, $zero, 3 -.L80112BFC: -/* A92FC 80112BFC 08044AFF */ j .L80112BFC -/* A9300 80112C00 00000000 */ nop -.L80112C04: -/* A9304 80112C04 A6020000 */ sh $v0, ($s0) -/* A9308 80112C08 8C820004 */ lw $v0, 4($a0) -/* A930C 80112C0C AE020004 */ sw $v0, 4($s0) -/* A9310 80112C10 8C820008 */ lw $v0, 8($a0) -/* A9314 80112C14 8E030004 */ lw $v1, 4($s0) -/* A9318 80112C18 AE020008 */ sw $v0, 8($s0) -/* A931C 80112C1C 8C820010 */ lw $v0, 0x10($a0) -/* A9320 80112C20 AE00000C */ sw $zero, 0xc($s0) -/* A9324 80112C24 14600004 */ bnez $v1, .L80112C38 -/* A9328 80112C28 AE020010 */ sw $v0, 0x10($s0) -/* A932C 80112C2C 3C028011 */ lui $v0, %hi(state_delegate_NOP) -/* A9330 80112C30 24422B90 */ addiu $v0, $v0, %lo(state_delegate_NOP) -/* A9334 80112C34 AE020004 */ sw $v0, 4($s0) -.L80112C38: -/* A9338 80112C38 8E020008 */ lw $v0, 8($s0) -/* A933C 80112C3C 14400004 */ bnez $v0, .L80112C50 -/* A9340 80112C40 00000000 */ nop -/* A9344 80112C44 3C028011 */ lui $v0, %hi(state_delegate_NOP) -/* A9348 80112C48 24422B90 */ addiu $v0, $v0, %lo(state_delegate_NOP) -/* A934C 80112C4C AE020008 */ sw $v0, 8($s0) -.L80112C50: -/* A9350 80112C50 8E02000C */ lw $v0, 0xc($s0) -/* A9354 80112C54 14400004 */ bnez $v0, .L80112C68 -/* A9358 80112C58 00000000 */ nop -/* A935C 80112C5C 3C028011 */ lui $v0, %hi(state_delegate_NOP) -/* A9360 80112C60 24422B90 */ addiu $v0, $v0, %lo(state_delegate_NOP) -/* A9364 80112C64 AE02000C */ sw $v0, 0xc($s0) -.L80112C68: -/* A9368 80112C68 8E020010 */ lw $v0, 0x10($s0) -/* A936C 80112C6C 14400004 */ bnez $v0, .L80112C80 -/* A9370 80112C70 00000000 */ nop -/* A9374 80112C74 3C028011 */ lui $v0, %hi(state_delegate_NOP) -/* A9378 80112C78 24422B90 */ addiu $v0, $v0, %lo(state_delegate_NOP) -/* A937C 80112C7C AE020010 */ sw $v0, 0x10($s0) -.L80112C80: -/* A9380 80112C80 8E030004 */ lw $v1, 4($s0) -/* A9384 80112C84 3C028011 */ lui $v0, %hi(state_delegate_NOP) -/* A9388 80112C88 24422B90 */ addiu $v0, $v0, %lo(state_delegate_NOP) -/* A938C 80112C8C 0060F809 */ jalr $v1 -/* A9390 80112C90 AE020014 */ sw $v0, 0x14($s0) -/* A9394 80112C94 0200102D */ daddu $v0, $s0, $zero -/* A9398 80112C98 8FBF0014 */ lw $ra, 0x14($sp) -/* A939C 80112C9C 8FB00010 */ lw $s0, 0x10($sp) -/* A93A0 80112CA0 03E00008 */ jr $ra -/* A93A4 80112CA4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/e0b30_len_b80/func_8014AD40.s b/ver/us/asm/nonmatchings/e0b30_len_b80/func_8014AD40.s deleted file mode 100644 index 899f1b8f05..0000000000 --- a/ver/us/asm/nonmatchings/e0b30_len_b80/func_8014AD40.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8014AD40 -/* E1440 8014AD40 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E1444 8014AD44 AFB00010 */ sw $s0, 0x10($sp) -/* E1448 8014AD48 3C108016 */ lui $s0, %hi(gMusicSettings) -/* E144C 8014AD4C 26109AF0 */ addiu $s0, $s0, %lo(gMusicSettings) -/* E1450 8014AD50 AFB10014 */ sw $s1, 0x14($sp) -/* E1454 8014AD54 0000882D */ daddu $s1, $zero, $zero -/* E1458 8014AD58 AFBF0018 */ sw $ra, 0x18($sp) -.L8014AD5C: -/* E145C 8014AD5C 96020000 */ lhu $v0, ($s0) -/* E1460 8014AD60 30420001 */ andi $v0, $v0, 1 -/* E1464 8014AD64 10400006 */ beqz $v0, .L8014AD80 -/* E1468 8014AD68 26310001 */ addiu $s1, $s1, 1 -/* E146C 8014AD6C 8E040018 */ lw $a0, 0x18($s0) -/* E1470 8014AD70 0C01567F */ jal func_800559FC -/* E1474 8014AD74 00000000 */ nop -/* E1478 8014AD78 14400005 */ bnez $v0, .L8014AD90 -/* E147C 8014AD7C 24020001 */ addiu $v0, $zero, 1 -.L8014AD80: -/* E1480 8014AD80 2A220002 */ slti $v0, $s1, 2 -/* E1484 8014AD84 1440FFF5 */ bnez $v0, .L8014AD5C -/* E1488 8014AD88 26100030 */ addiu $s0, $s0, 0x30 -/* E148C 8014AD8C 0000102D */ daddu $v0, $zero, $zero -.L8014AD90: -/* E1490 8014AD90 8FBF0018 */ lw $ra, 0x18($sp) -/* E1494 8014AD94 8FB10014 */ lw $s1, 0x14($sp) -/* E1498 8014AD98 8FB00010 */ lw $s0, 0x10($sp) -/* E149C 8014AD9C 03E00008 */ jr $ra -/* E14A0 8014ADA0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_idle.s b/ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_idle.s similarity index 100% rename from ver/us/asm/nonmatchings/entity/Switch/entity_shattering_idle.s rename to ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_idle.s diff --git a/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_init_pieces.s b/ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_init_pieces.s similarity index 100% rename from ver/us/asm/nonmatchings/entity/Switch/entity_shattering_init_pieces.s rename to ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_init_pieces.s diff --git a/ver/us/asm/nonmatchings/entity/Switch/entity_shattering_setupGfx.s b/ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_setupGfx.s similarity index 100% rename from ver/us/asm/nonmatchings/entity/Switch/entity_shattering_setupGfx.s rename to ver/us/asm/nonmatchings/entity/103CD0/entity_shattering_setupGfx.s diff --git a/ver/us/asm/nonmatchings/npc/func_8003D660.s b/ver/us/asm/nonmatchings/npc/func_8003D660.s deleted file mode 100644 index b7389edff7..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003D660.s +++ /dev/null @@ -1,93 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -dlabel jtbl_80098590 -.word .L8003D750_18B50, .L8003D764_18B64, .L8003D764_18B64, .L8003D764_18B64, .L8003D764_18B64, .L8003D6E8_18AE8, .L8003D6FC_18AFC, .L8003D710_18B10, .L8003D73C_18B3C, 0, 0, 0 - -.section .text - -glabel func_8003D660 -/* 18A60 8003D660 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 18A64 8003D664 AFB00010 */ sw $s0, 0x10($sp) -/* 18A68 8003D668 0080802D */ daddu $s0, $a0, $zero -/* 18A6C 8003D66C AFB10014 */ sw $s1, 0x14($sp) -/* 18A70 8003D670 3C020040 */ lui $v0, 0x40 -/* 18A74 8003D674 34420002 */ ori $v0, $v0, 2 -/* 18A78 8003D678 AFBF001C */ sw $ra, 0x1c($sp) -/* 18A7C 8003D67C AFB20018 */ sw $s2, 0x18($sp) -/* 18A80 8003D680 8E030000 */ lw $v1, ($s0) -/* 18A84 8003D684 3C128011 */ lui $s2, %hi(gPartnerActionStatus) -/* 18A88 8003D688 2652EBB0 */ addiu $s2, $s2, %lo(gPartnerActionStatus) -/* 18A8C 8003D68C 00621824 */ and $v1, $v1, $v0 -/* 18A90 8003D690 3C020040 */ lui $v0, 0x40 -/* 18A94 8003D694 14620036 */ bne $v1, $v0, .L8003D770 -/* 18A98 8003D698 00A0882D */ daddu $s1, $a1, $zero -/* 18A9C 8003D69C C6020018 */ lwc1 $f2, 0x18($s0) -/* 18AA0 8003D6A0 44800000 */ mtc1 $zero, $f0 -/* 18AA4 8003D6A4 00000000 */ nop -/* 18AA8 8003D6A8 46001032 */ c.eq.s $f2, $f0 -/* 18AAC 8003D6AC 00000000 */ nop -/* 18AB0 8003D6B0 4501002F */ bc1t .L8003D770 -/* 18AB4 8003D6B4 00000000 */ nop -/* 18AB8 8003D6B8 0C016F6A */ jal get_collider_type_by_id -/* 18ABC 8003D6BC 96040084 */ lhu $a0, 0x84($s0) -/* 18AC0 8003D6C0 304200FF */ andi $v0, $v0, 0xff -/* 18AC4 8003D6C4 2443FFFF */ addiu $v1, $v0, -1 -/* 18AC8 8003D6C8 2C620009 */ sltiu $v0, $v1, 9 -/* 18ACC 8003D6CC 10400025 */ beqz $v0, .L8003D764_18B64 -/* 18AD0 8003D6D0 00031080 */ sll $v0, $v1, 2 -/* 18AD4 8003D6D4 3C01800A */ lui $at, %hi(jtbl_80098590) -/* 18AD8 8003D6D8 00220821 */ addu $at, $at, $v0 -/* 18ADC 8003D6DC 8C228590 */ lw $v0, %lo(jtbl_80098590)($at) -/* 18AE0 8003D6E0 00400008 */ jr $v0 -/* 18AE4 8003D6E4 00000000 */ nop -.L8003D6E8_18AE8: -/* 18AE8 8003D6E8 0200202D */ daddu $a0, $s0, $zero -/* 18AEC 8003D6EC 0C00F68E */ jal func_8003DA38 -/* 18AF0 8003D6F0 0220282D */ daddu $a1, $s1, $zero -/* 18AF4 8003D6F4 0800F5DC */ j .L8003D770 -/* 18AF8 8003D6F8 00000000 */ nop -.L8003D6FC_18AFC: -/* 18AFC 8003D6FC 0200202D */ daddu $a0, $s0, $zero -/* 18B00 8003D700 0C00F70E */ jal func_8003DC38 -/* 18B04 8003D704 0220282D */ daddu $a1, $s1, $zero -/* 18B08 8003D708 0800F5DC */ j .L8003D770 -/* 18B0C 8003D70C 00000000 */ nop -.L8003D710_18B10: -/* 18B10 8003D710 82420000 */ lb $v0, ($s2) -/* 18B14 8003D714 10400004 */ beqz $v0, .L8003D728 -/* 18B18 8003D718 24020008 */ addiu $v0, $zero, 8 -/* 18B1C 8003D71C 82430003 */ lb $v1, 3($s2) -/* 18B20 8003D720 10620013 */ beq $v1, $v0, .L8003D770 -/* 18B24 8003D724 00000000 */ nop -.L8003D728: -/* 18B28 8003D728 0200202D */ daddu $a0, $s0, $zero -/* 18B2C 8003D72C 0C00F7E8 */ jal func_8003DFA0 -/* 18B30 8003D730 0220282D */ daddu $a1, $s1, $zero -/* 18B34 8003D734 0800F5DC */ j .L8003D770 -/* 18B38 8003D738 00000000 */ nop -.L8003D73C_18B3C: -/* 18B3C 8003D73C 0200202D */ daddu $a0, $s0, $zero -/* 18B40 8003D740 0C00F835 */ jal func_8003E0D4 -/* 18B44 8003D744 0220282D */ daddu $a1, $s1, $zero -/* 18B48 8003D748 0800F5DC */ j .L8003D770 -/* 18B4C 8003D74C 00000000 */ nop -.L8003D750_18B50: -/* 18B50 8003D750 0200202D */ daddu $a0, $s0, $zero -/* 18B54 8003D754 0C00F874 */ jal func_8003E1D0 -/* 18B58 8003D758 0220282D */ daddu $a1, $s1, $zero -/* 18B5C 8003D75C 0800F5DC */ j .L8003D770 -/* 18B60 8003D760 00000000 */ nop -.L8003D764_18B64: -/* 18B64 8003D764 0200202D */ daddu $a0, $s0, $zero -/* 18B68 8003D768 0C00F5E2 */ jal func_8003D788 -/* 18B6C 8003D76C 0220282D */ daddu $a1, $s1, $zero -.L8003D770: -/* 18B70 8003D770 8FBF001C */ lw $ra, 0x1c($sp) -/* 18B74 8003D774 8FB20018 */ lw $s2, 0x18($sp) -/* 18B78 8003D778 8FB10014 */ lw $s1, 0x14($sp) -/* 18B7C 8003D77C 8FB00010 */ lw $s0, 0x10($sp) -/* 18B80 8003D780 03E00008 */ jr $ra -/* 18B84 8003D784 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/kill_enemy.s b/ver/us/asm/nonmatchings/npc/kill_enemy.s deleted file mode 100644 index f9f40f9e78..0000000000 --- a/ver/us/asm/nonmatchings/npc/kill_enemy.s +++ /dev/null @@ -1,121 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel kill_enemy -/* 19BAC 8003E7AC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 19BB0 8003E7B0 AFB00010 */ sw $s0, 0x10($sp) -/* 19BB4 8003E7B4 0080802D */ daddu $s0, $a0, $zero -/* 19BB8 8003E7B8 AFBF0020 */ sw $ra, 0x20($sp) -/* 19BBC 8003E7BC AFB3001C */ sw $s3, 0x1c($sp) -/* 19BC0 8003E7C0 AFB20018 */ sw $s2, 0x18($sp) -/* 19BC4 8003E7C4 AFB10014 */ sw $s1, 0x14($sp) -/* 19BC8 8003E7C8 82020004 */ lb $v0, 4($s0) -/* 19BCC 8003E7CC 00021080 */ sll $v0, $v0, 2 -/* 19BD0 8003E7D0 3C13800B */ lui $s3, %hi(gCurrentEncounter+0x28) -/* 19BD4 8003E7D4 02629821 */ addu $s3, $s3, $v0 -/* 19BD8 8003E7D8 8E730F38 */ lw $s3, %lo(gCurrentEncounter+0x28)($s3) -/* 19BDC 8003E7DC 8E640000 */ lw $a0, ($s3) -/* 19BE0 8003E7E0 3C12800B */ lui $s2, %hi(gCurrentEncounter) -/* 19BE4 8003E7E4 26520F10 */ addiu $s2, $s2, %lo(gCurrentEncounter) -/* 19BE8 8003E7E8 18800009 */ blez $a0, .L8003E810 -/* 19BEC 8003E7EC 0000882D */ daddu $s1, $zero, $zero -/* 19BF0 8003E7F0 0260182D */ daddu $v1, $s3, $zero -.L8003E7F4: -/* 19BF4 8003E7F4 8C620004 */ lw $v0, 4($v1) -/* 19BF8 8003E7F8 10500005 */ beq $v0, $s0, .L8003E810 -/* 19BFC 8003E7FC 00000000 */ nop -/* 19C00 8003E800 26310001 */ addiu $s1, $s1, 1 -/* 19C04 8003E804 0224102A */ slt $v0, $s1, $a0 -/* 19C08 8003E808 1440FFFA */ bnez $v0, .L8003E7F4 -/* 19C0C 8003E80C 24630004 */ addiu $v1, $v1, 4 -.L8003E810: -/* 19C10 8003E810 8E020034 */ lw $v0, 0x34($s0) -/* 19C14 8003E814 10400003 */ beqz $v0, .L8003E824 -/* 19C18 8003E818 00000000 */ nop -/* 19C1C 8003E81C 0C0B102B */ jal kill_script_by_ID -/* 19C20 8003E820 8E04004C */ lw $a0, 0x4c($s0) -.L8003E824: -/* 19C24 8003E824 8E020038 */ lw $v0, 0x38($s0) -/* 19C28 8003E828 10400003 */ beqz $v0, .L8003E838 -/* 19C2C 8003E82C 00000000 */ nop -/* 19C30 8003E830 0C0B102B */ jal kill_script_by_ID -/* 19C34 8003E834 8E040050 */ lw $a0, 0x50($s0) -.L8003E838: -/* 19C38 8003E838 8E02003C */ lw $v0, 0x3c($s0) -/* 19C3C 8003E83C 10400003 */ beqz $v0, .L8003E84C -/* 19C40 8003E840 00000000 */ nop -/* 19C44 8003E844 0C0B102B */ jal kill_script_by_ID -/* 19C48 8003E848 8E040054 */ lw $a0, 0x54($s0) -.L8003E84C: -/* 19C4C 8003E84C 8E020040 */ lw $v0, 0x40($s0) -/* 19C50 8003E850 10400003 */ beqz $v0, .L8003E860 -/* 19C54 8003E854 00000000 */ nop -/* 19C58 8003E858 0C0B102B */ jal kill_script_by_ID -/* 19C5C 8003E85C 8E040058 */ lw $a0, 0x58($s0) -.L8003E860: -/* 19C60 8003E860 8E020044 */ lw $v0, 0x44($s0) -/* 19C64 8003E864 10400003 */ beqz $v0, .L8003E874 -/* 19C68 8003E868 00000000 */ nop -/* 19C6C 8003E86C 0C0B102B */ jal kill_script_by_ID -/* 19C70 8003E870 8E04005C */ lw $a0, 0x5c($s0) -.L8003E874: -/* 19C74 8003E874 8E020048 */ lw $v0, 0x48($s0) -/* 19C78 8003E878 10400003 */ beqz $v0, .L8003E888 -/* 19C7C 8003E87C 00000000 */ nop -/* 19C80 8003E880 0C0B102B */ jal kill_script_by_ID -/* 19C84 8003E884 8E040060 */ lw $a0, 0x60($s0) -.L8003E888: -/* 19C88 8003E888 86040008 */ lh $a0, 8($s0) -/* 19C8C 8003E88C AE000020 */ sw $zero, 0x20($s0) -/* 19C90 8003E890 AE000024 */ sw $zero, 0x24($s0) -/* 19C94 8003E894 AE000028 */ sw $zero, 0x28($s0) -/* 19C98 8003E898 AE00002C */ sw $zero, 0x2c($s0) -/* 19C9C 8003E89C 0C00EABB */ jal get_npc_unsafe -/* 19CA0 8003E8A0 AE000030 */ sw $zero, 0x30($s0) -/* 19CA4 8003E8A4 0C00E273 */ jal free_npc -/* 19CA8 8003E8A8 0040202D */ daddu $a0, $v0, $zero -/* 19CAC 8003E8AC 8E040064 */ lw $a0, 0x64($s0) -/* 19CB0 8003E8B0 50800004 */ beql $a0, $zero, .L8003E8C4 -/* 19CB4 8003E8B4 0000202D */ daddu $a0, $zero, $zero -/* 19CB8 8003E8B8 0C00AB4B */ jal heap_free -/* 19CBC 8003E8BC 00000000 */ nop -/* 19CC0 8003E8C0 0000202D */ daddu $a0, $zero, $zero -.L8003E8C4: -/* 19CC4 8003E8C4 0260182D */ daddu $v1, $s3, $zero -.L8003E8C8: -/* 19CC8 8003E8C8 8C620004 */ lw $v0, 4($v1) -/* 19CCC 8003E8CC 50500001 */ beql $v0, $s0, .L8003E8D4 -/* 19CD0 8003E8D0 AC600004 */ sw $zero, 4($v1) -.L8003E8D4: -/* 19CD4 8003E8D4 24840001 */ addiu $a0, $a0, 1 -/* 19CD8 8003E8D8 28820010 */ slti $v0, $a0, 0x10 -/* 19CDC 8003E8DC 1440FFFA */ bnez $v0, .L8003E8C8 -/* 19CE0 8003E8E0 24630004 */ addiu $v1, $v1, 4 -/* 19CE4 8003E8E4 8E030000 */ lw $v1, ($s0) -/* 19CE8 8003E8E8 30620004 */ andi $v0, $v1, 4 -/* 19CEC 8003E8EC 1440000E */ bnez $v0, .L8003E928 -/* 19CF0 8003E8F0 30620008 */ andi $v0, $v1, 8 -/* 19CF4 8003E8F4 10400004 */ beqz $v0, .L8003E908 -/* 19CF8 8003E8F8 30620001 */ andi $v0, $v1, 1 -/* 19CFC 8003E8FC 8E42008C */ lw $v0, 0x8c($s2) -/* 19D00 8003E900 16020009 */ bne $s0, $v0, .L8003E928 -/* 19D04 8003E904 30620001 */ andi $v0, $v1, 1 -.L8003E908: -/* 19D08 8003E908 14400007 */ bnez $v0, .L8003E928 -/* 19D0C 8003E90C 30620010 */ andi $v0, $v1, 0x10 -/* 19D10 8003E910 14400005 */ bnez $v0, .L8003E928 -/* 19D14 8003E914 00000000 */ nop -/* 19D18 8003E918 86650048 */ lh $a1, 0x48($s3) -/* 19D1C 8003E91C 82440020 */ lb $a0, 0x20($s2) -/* 19D20 8003E920 0C00F8B8 */ jal COPY_set_defeated -/* 19D24 8003E924 00B12821 */ addu $a1, $a1, $s1 -.L8003E928: -/* 19D28 8003E928 0C00AB4B */ jal heap_free -/* 19D2C 8003E92C 0200202D */ daddu $a0, $s0, $zero -/* 19D30 8003E930 8FBF0020 */ lw $ra, 0x20($sp) -/* 19D34 8003E934 8FB3001C */ lw $s3, 0x1c($sp) -/* 19D38 8003E938 8FB20018 */ lw $s2, 0x18($sp) -/* 19D3C 8003E93C 8FB10014 */ lw $s1, 0x14($sp) -/* 19D40 8003E940 8FB00010 */ lw $s0, 0x10($sp) -/* 19D44 8003E944 03E00008 */ jr $ra -/* 19D48 8003E948 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/action/hammer/func_802B62A4_E25174.s b/ver/us/asm/nonmatchings/world/action/hammer/func_802B62A4_E25174.s deleted file mode 100644 index 9238f40c2b..0000000000 --- a/ver/us/asm/nonmatchings/world/action/hammer/func_802B62A4_E25174.s +++ /dev/null @@ -1,287 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -dlabel jtbl_802B6E08_E25CD8 -.word .L802B6670_E25540, .L802B6670_E25540, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6670_E25540, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6634_E25504, .L802B6644_E25514, .L802B6654_E25524, .L802B6634_E25504, .L802B6644_E25514, .L802B6654_E25524, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6674_E25544, .L802B6660_E25530, .L802B6674_E25544, .L802B6660_E25530, 0, 0 - -.section .text - -glabel func_802B62A4_E25174 -/* E25174 802B62A4 27BDFF88 */ addiu $sp, $sp, -0x78 -/* E25178 802B62A8 AFBF0048 */ sw $ra, 0x48($sp) -/* E2517C 802B62AC AFB30044 */ sw $s3, 0x44($sp) -/* E25180 802B62B0 AFB20040 */ sw $s2, 0x40($sp) -/* E25184 802B62B4 AFB1003C */ sw $s1, 0x3c($sp) -/* E25188 802B62B8 AFB00038 */ sw $s0, 0x38($sp) -/* E2518C 802B62BC F7BC0070 */ sdc1 $f28, 0x70($sp) -/* E25190 802B62C0 F7BA0068 */ sdc1 $f26, 0x68($sp) -/* E25194 802B62C4 F7B80060 */ sdc1 $f24, 0x60($sp) -/* E25198 802B62C8 F7B60058 */ sdc1 $f22, 0x58($sp) -/* E2519C 802B62CC 0C0394D2 */ jal func_800E5348 -/* E251A0 802B62D0 F7B40050 */ sdc1 $f20, 0x50($sp) -/* E251A4 802B62D4 3C128011 */ lui $s2, %hi(gPlayerStatus) -/* E251A8 802B62D8 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus) -/* E251AC 802B62DC 8E4400A4 */ lw $a0, 0xa4($s2) -/* E251B0 802B62E0 0C0AD800 */ jal action_hammer_is_swinging_away -/* E251B4 802B62E4 46000586 */ mov.s $f22, $f0 -/* E251B8 802B62E8 10400030 */ beqz $v0, .L802B63AC -/* E251BC 802B62EC 27A50020 */ addiu $a1, $sp, 0x20 -/* E251C0 802B62F0 3C038007 */ lui $v1, %hi(gCurrentCameraID) -/* E251C4 802B62F4 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1) -/* E251C8 802B62F8 3C0142B4 */ lui $at, 0x42b4 -/* E251CC 802B62FC 4481A000 */ mtc1 $at, $f20 -/* E251D0 802B6300 00031080 */ sll $v0, $v1, 2 -/* E251D4 802B6304 00431021 */ addu $v0, $v0, $v1 -/* E251D8 802B6308 00021080 */ sll $v0, $v0, 2 -/* E251DC 802B630C 00431023 */ subu $v0, $v0, $v1 -/* E251E0 802B6310 000218C0 */ sll $v1, $v0, 3 -/* E251E4 802B6314 00431021 */ addu $v0, $v0, $v1 -/* E251E8 802B6318 000210C0 */ sll $v0, $v0, 3 -/* E251EC 802B631C 4614B000 */ add.s $f0, $f22, $f20 -/* E251F0 802B6320 3C01800B */ lui $at, %hi(gCameras+0x6C) -/* E251F4 802B6324 00220821 */ addu $at, $at, $v0 -/* E251F8 802B6328 C42C1DEC */ lwc1 $f12, %lo(gCameras+0x6C)($at) -/* E251FC 802B632C 0C00A6C9 */ jal clamp_angle -/* E25200 802B6330 460C0301 */ sub.s $f12, $f0, $f12 -/* E25204 802B6334 46000086 */ mov.s $f2, $f0 -/* E25208 802B6338 4602A03E */ c.le.s $f20, $f2 -/* E2520C 802B633C 00000000 */ nop -/* E25210 802B6340 45000015 */ bc1f .L802B6398 -/* E25214 802B6344 00000000 */ nop -/* E25218 802B6348 3C014387 */ lui $at, 0x4387 -/* E2521C 802B634C 44810000 */ mtc1 $at, $f0 -/* E25220 802B6350 00000000 */ nop -/* E25224 802B6354 4600103C */ c.lt.s $f2, $f0 -/* E25228 802B6358 00000000 */ nop -/* E2522C 802B635C 4500000E */ bc1f .L802B6398 -/* E25230 802B6360 00000000 */ nop -/* E25234 802B6364 3C01C1F0 */ lui $at, 0xc1f0 -/* E25238 802B6368 44810000 */ mtc1 $at, $f0 -/* E2523C 802B636C 080AD8EA */ j .L802B63A8 -/* E25240 802B6370 4600B580 */ add.s $f22, $f22, $f0 -.L802B6374: -/* E25244 802B6374 3C02802B */ lui $v0, %hi(HammerHit) -/* E25248 802B6378 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E2524C 802B637C C7A00028 */ lwc1 $f0, 0x28($sp) -/* E25250 802B6380 C7A2002C */ lwc1 $f2, 0x2c($sp) -/* E25254 802B6384 C7A40030 */ lwc1 $f4, 0x30($sp) -/* E25258 802B6388 E4400000 */ swc1 $f0, ($v0) -/* E2525C 802B638C E4420004 */ swc1 $f2, 4($v0) -/* E25260 802B6390 080AD919 */ j .L802B6464 -/* E25264 802B6394 E4440008 */ swc1 $f4, 8($v0) -.L802B6398: -/* E25268 802B6398 3C0141F0 */ lui $at, 0x41f0 -/* E2526C 802B639C 44810000 */ mtc1 $at, $f0 -/* E25270 802B63A0 00000000 */ nop -/* E25274 802B63A4 4600B580 */ add.s $f22, $f22, $f0 -.L802B63A8: -/* E25278 802B63A8 27A50020 */ addiu $a1, $sp, 0x20 -.L802B63AC: -/* E2527C 802B63AC 3C0140C9 */ lui $at, 0x40c9 -/* E25280 802B63B0 34210FD0 */ ori $at, $at, 0xfd0 -/* E25284 802B63B4 44816000 */ mtc1 $at, $f12 -/* E25288 802B63B8 27A60024 */ addiu $a2, $sp, 0x24 -/* E2528C 802B63BC 460CB302 */ mul.s $f12, $f22, $f12 -/* E25290 802B63C0 00000000 */ nop -/* E25294 802B63C4 24100001 */ addiu $s0, $zero, 1 -/* E25298 802B63C8 27B30030 */ addiu $s3, $sp, 0x30 -/* E2529C 802B63CC 3C0143B4 */ lui $at, 0x43b4 -/* E252A0 802B63D0 44810000 */ mtc1 $at, $f0 -/* E252A4 802B63D4 3C014080 */ lui $at, 0x4080 -/* E252A8 802B63D8 4481A000 */ mtc1 $at, $f20 -/* E252AC 802B63DC 0C00A82D */ jal sin_cos_rad -/* E252B0 802B63E0 46006303 */ div.s $f12, $f12, $f0 -/* E252B4 802B63E4 C65C0028 */ lwc1 $f28, 0x28($s2) -/* E252B8 802B63E8 C65A002C */ lwc1 $f26, 0x2c($s2) -/* E252BC 802B63EC C6580030 */ lwc1 $f24, 0x30($s2) -.L802B63F0: -/* E252C0 802B63F0 C7A00020 */ lwc1 $f0, 0x20($sp) -/* E252C4 802B63F4 44901000 */ mtc1 $s0, $f2 -/* E252C8 802B63F8 00000000 */ nop -/* E252CC 802B63FC 468010A0 */ cvt.s.w $f2, $f2 -/* E252D0 802B6400 46020002 */ mul.s $f0, $f0, $f2 -/* E252D4 802B6404 00000000 */ nop -/* E252D8 802B6408 C7A40024 */ lwc1 $f4, 0x24($sp) -/* E252DC 802B640C 46022102 */ mul.s $f4, $f4, $f2 -/* E252E0 802B6410 00000000 */ nop -/* E252E4 802B6414 24040003 */ addiu $a0, $zero, 3 -/* E252E8 802B6418 0240282D */ daddu $a1, $s2, $zero -/* E252EC 802B641C 4600E000 */ add.s $f0, $f28, $f0 -/* E252F0 802B6420 27A60028 */ addiu $a2, $sp, 0x28 -/* E252F4 802B6424 27A7002C */ addiu $a3, $sp, 0x2c -/* E252F8 802B6428 4604C101 */ sub.s $f4, $f24, $f4 -/* E252FC 802B642C E7BA002C */ swc1 $f26, 0x2c($sp) -/* E25300 802B6430 E7A00028 */ swc1 $f0, 0x28($sp) -/* E25304 802B6434 E7A40030 */ swc1 $f4, 0x30($sp) -/* E25308 802B6438 AFB30010 */ sw $s3, 0x10($sp) -/* E2530C 802B643C E7B40014 */ swc1 $f20, 0x14($sp) -/* E25310 802B6440 0C037B01 */ jal player_test_lateral_overlap -/* E25314 802B6444 E7B60018 */ swc1 $f22, 0x18($sp) -/* E25318 802B6448 0040882D */ daddu $s1, $v0, $zero -/* E2531C 802B644C 0621FFC9 */ bgez $s1, .L802B6374 -/* E25320 802B6450 00000000 */ nop -/* E25324 802B6454 26100001 */ addiu $s0, $s0, 1 -/* E25328 802B6458 2A020010 */ slti $v0, $s0, 0x10 -/* E2532C 802B645C 1440FFE4 */ bnez $v0, .L802B63F0 -/* E25330 802B6460 00000000 */ nop -.L802B6464: -/* E25334 802B6464 2A020010 */ slti $v0, $s0, 0x10 -/* E25338 802B6468 14400061 */ bnez $v0, .L802B65F0 -/* E2533C 802B646C 00000000 */ nop -/* E25340 802B6470 0C0394D2 */ jal func_800E5348 -/* E25344 802B6474 00000000 */ nop -/* E25348 802B6478 8E4400A4 */ lw $a0, 0xa4($s2) -/* E2534C 802B647C 0C0AD800 */ jal action_hammer_is_swinging_away -/* E25350 802B6480 46000586 */ mov.s $f22, $f0 -/* E25354 802B6484 14400030 */ bnez $v0, .L802B6548 -/* E25358 802B6488 27A50020 */ addiu $a1, $sp, 0x20 -/* E2535C 802B648C 3C038007 */ lui $v1, %hi(gCurrentCameraID) -/* E25360 802B6490 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1) -/* E25364 802B6494 3C0142B4 */ lui $at, 0x42b4 -/* E25368 802B6498 4481A000 */ mtc1 $at, $f20 -/* E2536C 802B649C 00031080 */ sll $v0, $v1, 2 -/* E25370 802B64A0 00431021 */ addu $v0, $v0, $v1 -/* E25374 802B64A4 00021080 */ sll $v0, $v0, 2 -/* E25378 802B64A8 00431023 */ subu $v0, $v0, $v1 -/* E2537C 802B64AC 000218C0 */ sll $v1, $v0, 3 -/* E25380 802B64B0 00431021 */ addu $v0, $v0, $v1 -/* E25384 802B64B4 000210C0 */ sll $v0, $v0, 3 -/* E25388 802B64B8 4614B000 */ add.s $f0, $f22, $f20 -/* E2538C 802B64BC 3C01800B */ lui $at, %hi(gCameras+0x6C) -/* E25390 802B64C0 00220821 */ addu $at, $at, $v0 -/* E25394 802B64C4 C42C1DEC */ lwc1 $f12, %lo(gCameras+0x6C)($at) -/* E25398 802B64C8 0C00A6C9 */ jal clamp_angle -/* E2539C 802B64CC 460C0301 */ sub.s $f12, $f0, $f12 -/* E253A0 802B64D0 46000086 */ mov.s $f2, $f0 -/* E253A4 802B64D4 4602A03E */ c.le.s $f20, $f2 -/* E253A8 802B64D8 00000000 */ nop -/* E253AC 802B64DC 45000015 */ bc1f .L802B6534 -/* E253B0 802B64E0 00000000 */ nop -/* E253B4 802B64E4 3C014387 */ lui $at, 0x4387 -/* E253B8 802B64E8 44810000 */ mtc1 $at, $f0 -/* E253BC 802B64EC 00000000 */ nop -/* E253C0 802B64F0 4600103C */ c.lt.s $f2, $f0 -/* E253C4 802B64F4 00000000 */ nop -/* E253C8 802B64F8 4500000E */ bc1f .L802B6534 -/* E253CC 802B64FC 00000000 */ nop -/* E253D0 802B6500 3C014170 */ lui $at, 0x4170 -/* E253D4 802B6504 44810000 */ mtc1 $at, $f0 -/* E253D8 802B6508 080AD951 */ j .L802B6544 -/* E253DC 802B650C 4600B580 */ add.s $f22, $f22, $f0 -.L802B6510: -/* E253E0 802B6510 3C02802B */ lui $v0, %hi(HammerHit) -/* E253E4 802B6514 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E253E8 802B6518 C7A00028 */ lwc1 $f0, 0x28($sp) -/* E253EC 802B651C C7A2002C */ lwc1 $f2, 0x2c($sp) -/* E253F0 802B6520 C7A40030 */ lwc1 $f4, 0x30($sp) -/* E253F4 802B6524 E4400000 */ swc1 $f0, ($v0) -/* E253F8 802B6528 E4420004 */ swc1 $f2, 4($v0) -/* E253FC 802B652C 080AD97C */ j .L802B65F0 -/* E25400 802B6530 E4440008 */ swc1 $f4, 8($v0) -.L802B6534: -/* E25404 802B6534 3C01C170 */ lui $at, 0xc170 -/* E25408 802B6538 44810000 */ mtc1 $at, $f0 -/* E2540C 802B653C 00000000 */ nop -/* E25410 802B6540 4600B580 */ add.s $f22, $f22, $f0 -.L802B6544: -/* E25414 802B6544 27A50020 */ addiu $a1, $sp, 0x20 -.L802B6548: -/* E25418 802B6548 3C0140C9 */ lui $at, 0x40c9 -/* E2541C 802B654C 34210FD0 */ ori $at, $at, 0xfd0 -/* E25420 802B6550 44816000 */ mtc1 $at, $f12 -/* E25424 802B6554 27A60024 */ addiu $a2, $sp, 0x24 -/* E25428 802B6558 460CB302 */ mul.s $f12, $f22, $f12 -/* E2542C 802B655C 00000000 */ nop -/* E25430 802B6560 24100001 */ addiu $s0, $zero, 1 -/* E25434 802B6564 27B30030 */ addiu $s3, $sp, 0x30 -/* E25438 802B6568 3C0143B4 */ lui $at, 0x43b4 -/* E2543C 802B656C 44810000 */ mtc1 $at, $f0 -/* E25440 802B6570 3C014080 */ lui $at, 0x4080 -/* E25444 802B6574 4481A000 */ mtc1 $at, $f20 -/* E25448 802B6578 0C00A82D */ jal sin_cos_rad -/* E2544C 802B657C 46006303 */ div.s $f12, $f12, $f0 -.L802B6580: -/* E25450 802B6580 C7A00020 */ lwc1 $f0, 0x20($sp) -/* E25454 802B6584 44901000 */ mtc1 $s0, $f2 -/* E25458 802B6588 00000000 */ nop -/* E2545C 802B658C 468010A0 */ cvt.s.w $f2, $f2 -/* E25460 802B6590 46020002 */ mul.s $f0, $f0, $f2 -/* E25464 802B6594 00000000 */ nop -/* E25468 802B6598 C7A40024 */ lwc1 $f4, 0x24($sp) -/* E2546C 802B659C 46022102 */ mul.s $f4, $f4, $f2 -/* E25470 802B65A0 00000000 */ nop -/* E25474 802B65A4 24040003 */ addiu $a0, $zero, 3 -/* E25478 802B65A8 0240282D */ daddu $a1, $s2, $zero -/* E2547C 802B65AC 4600E000 */ add.s $f0, $f28, $f0 -/* E25480 802B65B0 27A60028 */ addiu $a2, $sp, 0x28 -/* E25484 802B65B4 27A7002C */ addiu $a3, $sp, 0x2c -/* E25488 802B65B8 4604C101 */ sub.s $f4, $f24, $f4 -/* E2548C 802B65BC E7BA002C */ swc1 $f26, 0x2c($sp) -/* E25490 802B65C0 E7A00028 */ swc1 $f0, 0x28($sp) -/* E25494 802B65C4 E7A40030 */ swc1 $f4, 0x30($sp) -/* E25498 802B65C8 AFB30010 */ sw $s3, 0x10($sp) -/* E2549C 802B65CC E7B40014 */ swc1 $f20, 0x14($sp) -/* E254A0 802B65D0 0C037B01 */ jal player_test_lateral_overlap -/* E254A4 802B65D4 E7B60018 */ swc1 $f22, 0x18($sp) -/* E254A8 802B65D8 0040882D */ daddu $s1, $v0, $zero -/* E254AC 802B65DC 0621FFCC */ bgez $s1, .L802B6510 -/* E254B0 802B65E0 26100001 */ addiu $s0, $s0, 1 -/* E254B4 802B65E4 2A020010 */ slti $v0, $s0, 0x10 -/* E254B8 802B65E8 1440FFE5 */ bnez $v0, .L802B6580 -/* E254BC 802B65EC 00000000 */ nop -.L802B65F0: -/* E254C0 802B65F0 06200020 */ bltz $s1, .L802B6674_E25544 -/* E254C4 802B65F4 32224000 */ andi $v0, $s1, 0x4000 -/* E254C8 802B65F8 1040001F */ beqz $v0, .L802B6678 -/* E254CC 802B65FC 0220102D */ daddu $v0, $s1, $zero -/* E254D0 802B6600 3C108011 */ lui $s0, %hi(gPlayerData+0x1) -/* E254D4 802B6604 8210F291 */ lb $s0, %lo(gPlayerData+0x1)($s0) -/* E254D8 802B6608 0C0441A9 */ jal get_entity_type -/* E254DC 802B660C 0220202D */ daddu $a0, $s1, $zero -/* E254E0 802B6610 2443FFF9 */ addiu $v1, $v0, -7 -/* E254E4 802B6614 2C620020 */ sltiu $v0, $v1, 0x20 -/* E254E8 802B6618 10400016 */ beqz $v0, .L802B6674_E25544 -/* E254EC 802B661C 00031080 */ sll $v0, $v1, 2 -/* E254F0 802B6620 3C01802B */ lui $at, %hi(jtbl_802B6E08_E25CD8) -/* E254F4 802B6624 00220821 */ addu $at, $at, $v0 -/* E254F8 802B6628 8C226E08 */ lw $v0, %lo(jtbl_802B6E08_E25CD8)($at) -/* E254FC 802B662C 00400008 */ jr $v0 -/* E25500 802B6630 00000000 */ nop -.L802B6634_E25504: -/* E25504 802B6634 0603000F */ bgezl $s0, .L802B6674_E25544 -/* E25508 802B6638 2411FFFF */ addiu $s1, $zero, -1 -/* E2550C 802B663C 080AD998 */ j .L802B6660_E25530 -/* E25510 802B6640 00000000 */ nop -.L802B6644_E25514: -/* E25514 802B6644 5E00000B */ bgtzl $s0, .L802B6674_E25544 -/* E25518 802B6648 2411FFFF */ addiu $s1, $zero, -1 -/* E2551C 802B664C 080AD998 */ j .L802B6660_E25530 -/* E25520 802B6650 00000000 */ nop -.L802B6654_E25524: -/* E25524 802B6654 2A020002 */ slti $v0, $s0, 2 -/* E25528 802B6658 50400006 */ beql $v0, $zero, .L802B6674_E25544 -/* E2552C 802B665C 2411FFFF */ addiu $s1, $zero, -1 -.L802B6660_E25530: -/* E25530 802B6660 8E420004 */ lw $v0, 4($s2) -/* E25534 802B6664 34420400 */ ori $v0, $v0, 0x400 -/* E25538 802B6668 080AD99D */ j .L802B6674_E25544 -/* E2553C 802B666C AE420004 */ sw $v0, 4($s2) -.L802B6670_E25540: -/* E25540 802B6670 2411FFFF */ addiu $s1, $zero, -1 -.L802B6674_E25544: -/* E25544 802B6674 0220102D */ daddu $v0, $s1, $zero -.L802B6678: -/* E25548 802B6678 8FBF0048 */ lw $ra, 0x48($sp) -/* E2554C 802B667C 8FB30044 */ lw $s3, 0x44($sp) -/* E25550 802B6680 8FB20040 */ lw $s2, 0x40($sp) -/* E25554 802B6684 8FB1003C */ lw $s1, 0x3c($sp) -/* E25558 802B6688 8FB00038 */ lw $s0, 0x38($sp) -/* E2555C 802B668C D7BC0070 */ ldc1 $f28, 0x70($sp) -/* E25560 802B6690 D7BA0068 */ ldc1 $f26, 0x68($sp) -/* E25564 802B6694 D7B80060 */ ldc1 $f24, 0x60($sp) -/* E25568 802B6698 D7B60058 */ ldc1 $f22, 0x58($sp) -/* E2556C 802B669C D7B40050 */ ldc1 $f20, 0x50($sp) -/* E25570 802B66A0 03E00008 */ jr $ra -/* E25574 802B66A4 27BD0078 */ addiu $sp, $sp, 0x78 diff --git a/ver/us/asm/nonmatchings/world/action/hammer/func_802B6820_E256F0.s b/ver/us/asm/nonmatchings/world/action/hammer/func_802B6820_E256F0.s deleted file mode 100644 index 31be606735..0000000000 --- a/ver/us/asm/nonmatchings/world/action/hammer/func_802B6820_E256F0.s +++ /dev/null @@ -1,387 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel action_hammer_try_hit -/* E256F0 802B6820 27BDFF88 */ addiu $sp, $sp, -0x78 -/* E256F4 802B6824 AFB20040 */ sw $s2, 0x40($sp) -/* E256F8 802B6828 3C128011 */ lui $s2, %hi(gPlayerStatus) -/* E256FC 802B682C 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus) -/* E25700 802B6830 AFBF004C */ sw $ra, 0x4c($sp) -/* E25704 802B6834 AFB40048 */ sw $s4, 0x48($sp) -/* E25708 802B6838 AFB30044 */ sw $s3, 0x44($sp) -/* E2570C 802B683C AFB1003C */ sw $s1, 0x3c($sp) -/* E25710 802B6840 AFB00038 */ sw $s0, 0x38($sp) -/* E25714 802B6844 F7BC0070 */ sdc1 $f28, 0x70($sp) -/* E25718 802B6848 F7BA0068 */ sdc1 $f26, 0x68($sp) -/* E2571C 802B684C F7B80060 */ sdc1 $f24, 0x60($sp) -/* E25720 802B6850 F7B60058 */ sdc1 $f22, 0x58($sp) -/* E25724 802B6854 F7B40050 */ sdc1 $f20, 0x50($sp) -/* E25728 802B6858 3C148016 */ lui $s4, %hi(gCollisionStatus) -/* E2572C 802B685C 2694A550 */ addiu $s4, $s4, %lo(gCollisionStatus) -/* E25730 802B6860 0C0394D2 */ jal func_800E5348 -/* E25734 802B6864 00000000 */ nop -/* E25738 802B6868 8E4400A4 */ lw $a0, 0xa4($s2) -/* E2573C 802B686C 0C0AD800 */ jal action_hammer_is_swinging_away -/* E25740 802B6870 46000586 */ mov.s $f22, $f0 -/* E25744 802B6874 10400024 */ beqz $v0, .L802B6908 -/* E25748 802B6878 27A50020 */ addiu $a1, $sp, 0x20 -/* E2574C 802B687C 3C038007 */ lui $v1, %hi(gCurrentCameraID) -/* E25750 802B6880 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1) -/* E25754 802B6884 3C0142B4 */ lui $at, 0x42b4 -/* E25758 802B6888 4481A000 */ mtc1 $at, $f20 -/* E2575C 802B688C 00031080 */ sll $v0, $v1, 2 -/* E25760 802B6890 00431021 */ addu $v0, $v0, $v1 -/* E25764 802B6894 00021080 */ sll $v0, $v0, 2 -/* E25768 802B6898 00431023 */ subu $v0, $v0, $v1 -/* E2576C 802B689C 000218C0 */ sll $v1, $v0, 3 -/* E25770 802B68A0 00431021 */ addu $v0, $v0, $v1 -/* E25774 802B68A4 000210C0 */ sll $v0, $v0, 3 -/* E25778 802B68A8 4614B000 */ add.s $f0, $f22, $f20 -/* E2577C 802B68AC 3C01800B */ lui $at, %hi(gCameras+0x6C) -/* E25780 802B68B0 00220821 */ addu $at, $at, $v0 -/* E25784 802B68B4 C42C1DEC */ lwc1 $f12, %lo(gCameras+0x6C)($at) -/* E25788 802B68B8 0C00A6C9 */ jal clamp_angle -/* E2578C 802B68BC 460C0301 */ sub.s $f12, $f0, $f12 -/* E25790 802B68C0 46000086 */ mov.s $f2, $f0 -/* E25794 802B68C4 4602A03E */ c.le.s $f20, $f2 -/* E25798 802B68C8 00000000 */ nop -/* E2579C 802B68CC 45000009 */ bc1f .L802B68F4 -/* E257A0 802B68D0 00000000 */ nop -/* E257A4 802B68D4 3C014387 */ lui $at, 0x4387 -/* E257A8 802B68D8 44810000 */ mtc1 $at, $f0 -/* E257AC 802B68DC 00000000 */ nop -/* E257B0 802B68E0 4600103C */ c.lt.s $f2, $f0 -/* E257B4 802B68E4 3C01C1F0 */ lui $at, 0xc1f0 -/* E257B8 802B68E8 44810000 */ mtc1 $at, $f0 -/* E257BC 802B68EC 45030005 */ bc1tl .L802B6904 -/* E257C0 802B68F0 4600B580 */ add.s $f22, $f22, $f0 -.L802B68F4: -/* E257C4 802B68F4 3C0141F0 */ lui $at, 0x41f0 -/* E257C8 802B68F8 44810000 */ mtc1 $at, $f0 -/* E257CC 802B68FC 00000000 */ nop -/* E257D0 802B6900 4600B580 */ add.s $f22, $f22, $f0 -.L802B6904: -/* E257D4 802B6904 27A50020 */ addiu $a1, $sp, 0x20 -.L802B6908: -/* E257D8 802B6908 3C0140C9 */ lui $at, 0x40c9 -/* E257DC 802B690C 34210FD0 */ ori $at, $at, 0xfd0 -/* E257E0 802B6910 44816000 */ mtc1 $at, $f12 -/* E257E4 802B6914 27A60024 */ addiu $a2, $sp, 0x24 -/* E257E8 802B6918 460CB302 */ mul.s $f12, $f22, $f12 -/* E257EC 802B691C 00000000 */ nop -/* E257F0 802B6920 24110001 */ addiu $s1, $zero, 1 -/* E257F4 802B6924 27B30030 */ addiu $s3, $sp, 0x30 -/* E257F8 802B6928 3C0143B4 */ lui $at, 0x43b4 -/* E257FC 802B692C 44810000 */ mtc1 $at, $f0 -/* E25800 802B6930 3C014080 */ lui $at, 0x4080 -/* E25804 802B6934 4481A000 */ mtc1 $at, $f20 -/* E25808 802B6938 0C00A82D */ jal sin_cos_rad -/* E2580C 802B693C 46006303 */ div.s $f12, $f12, $f0 -/* E25810 802B6940 C65C0028 */ lwc1 $f28, 0x28($s2) -/* E25814 802B6944 C65A002C */ lwc1 $f26, 0x2c($s2) -/* E25818 802B6948 C6580030 */ lwc1 $f24, 0x30($s2) -.L802B694C: -/* E2581C 802B694C C7A40020 */ lwc1 $f4, 0x20($sp) -/* E25820 802B6950 44910000 */ mtc1 $s1, $f0 -/* E25824 802B6954 00000000 */ nop -/* E25828 802B6958 46800020 */ cvt.s.w $f0, $f0 -/* E2582C 802B695C 46002102 */ mul.s $f4, $f4, $f0 -/* E25830 802B6960 00000000 */ nop -/* E25834 802B6964 C7A20024 */ lwc1 $f2, 0x24($sp) -/* E25838 802B6968 46001082 */ mul.s $f2, $f2, $f0 -/* E2583C 802B696C 00000000 */ nop -/* E25840 802B6970 24040003 */ addiu $a0, $zero, 3 -/* E25844 802B6974 0240282D */ daddu $a1, $s2, $zero -/* E25848 802B6978 4604E100 */ add.s $f4, $f28, $f4 -/* E2584C 802B697C 27A60028 */ addiu $a2, $sp, 0x28 -/* E25850 802B6980 27A7002C */ addiu $a3, $sp, 0x2c -/* E25854 802B6984 4602C081 */ sub.s $f2, $f24, $f2 -/* E25858 802B6988 E7BA002C */ swc1 $f26, 0x2c($sp) -/* E2585C 802B698C E7A40028 */ swc1 $f4, 0x28($sp) -/* E25860 802B6990 E7A20030 */ swc1 $f2, 0x30($sp) -/* E25864 802B6994 AFB30010 */ sw $s3, 0x10($sp) -/* E25868 802B6998 E7B40014 */ swc1 $f20, 0x14($sp) -/* E2586C 802B699C 0C037B01 */ jal player_test_lateral_overlap -/* E25870 802B69A0 E7B60018 */ swc1 $f22, 0x18($sp) -/* E25874 802B69A4 3C03802B */ lui $v1, %hi(HammerHit) -/* E25878 802B69A8 8C636DB0 */ lw $v1, %lo(HammerHit)($v1) -/* E2587C 802B69AC 8C630014 */ lw $v1, 0x14($v1) -/* E25880 802B69B0 14600009 */ bnez $v1, .L802B69D8 -/* E25884 802B69B4 0040802D */ daddu $s0, $v0, $zero -/* E25888 802B69B8 06000009 */ bltz $s0, .L802B69E0 -/* E2588C 802B69BC A6900014 */ sh $s0, 0x14($s4) -/* E25890 802B69C0 32024000 */ andi $v0, $s0, 0x4000 -/* E25894 802B69C4 10400004 */ beqz $v0, .L802B69D8 -/* E25898 802B69C8 00000000 */ nop -/* E2589C 802B69CC 0C04417A */ jal get_entity_by_index -/* E258A0 802B69D0 0200202D */ daddu $a0, $s0, $zero -/* E258A4 802B69D4 A0400007 */ sb $zero, 7($v0) -.L802B69D8: -/* E258A8 802B69D8 06010005 */ bgez $s0, .L802B69F0 -/* E258AC 802B69DC 2A220010 */ slti $v0, $s1, 0x10 -.L802B69E0: -/* E258B0 802B69E0 26310001 */ addiu $s1, $s1, 1 -/* E258B4 802B69E4 2A220010 */ slti $v0, $s1, 0x10 -/* E258B8 802B69E8 1440FFD8 */ bnez $v0, .L802B694C -/* E258BC 802B69EC 00000000 */ nop -.L802B69F0: -/* E258C0 802B69F0 14400062 */ bnez $v0, .L802B6B7C -/* E258C4 802B69F4 00000000 */ nop -/* E258C8 802B69F8 0C0394D2 */ jal func_800E5348 -/* E258CC 802B69FC 00000000 */ nop -/* E258D0 802B6A00 8E4400A4 */ lw $a0, 0xa4($s2) -/* E258D4 802B6A04 0C0AD800 */ jal action_hammer_is_swinging_away -/* E258D8 802B6A08 46000586 */ mov.s $f22, $f0 -/* E258DC 802B6A0C 14400024 */ bnez $v0, .L802B6AA0 -/* E258E0 802B6A10 27A50020 */ addiu $a1, $sp, 0x20 -/* E258E4 802B6A14 3C038007 */ lui $v1, %hi(gCurrentCameraID) -/* E258E8 802B6A18 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1) -/* E258EC 802B6A1C 3C0142B4 */ lui $at, 0x42b4 -/* E258F0 802B6A20 4481A000 */ mtc1 $at, $f20 -/* E258F4 802B6A24 00031080 */ sll $v0, $v1, 2 -/* E258F8 802B6A28 00431021 */ addu $v0, $v0, $v1 -/* E258FC 802B6A2C 00021080 */ sll $v0, $v0, 2 -/* E25900 802B6A30 00431023 */ subu $v0, $v0, $v1 -/* E25904 802B6A34 000218C0 */ sll $v1, $v0, 3 -/* E25908 802B6A38 00431021 */ addu $v0, $v0, $v1 -/* E2590C 802B6A3C 000210C0 */ sll $v0, $v0, 3 -/* E25910 802B6A40 4614B000 */ add.s $f0, $f22, $f20 -/* E25914 802B6A44 3C01800B */ lui $at, %hi(gCameras+0x6C) -/* E25918 802B6A48 00220821 */ addu $at, $at, $v0 -/* E2591C 802B6A4C C42C1DEC */ lwc1 $f12, %lo(gCameras+0x6C)($at) -/* E25920 802B6A50 0C00A6C9 */ jal clamp_angle -/* E25924 802B6A54 460C0301 */ sub.s $f12, $f0, $f12 -/* E25928 802B6A58 46000086 */ mov.s $f2, $f0 -/* E2592C 802B6A5C 4602A03E */ c.le.s $f20, $f2 -/* E25930 802B6A60 00000000 */ nop -/* E25934 802B6A64 45000009 */ bc1f .L802B6A8C -/* E25938 802B6A68 00000000 */ nop -/* E2593C 802B6A6C 3C014387 */ lui $at, 0x4387 -/* E25940 802B6A70 44810000 */ mtc1 $at, $f0 -/* E25944 802B6A74 00000000 */ nop -/* E25948 802B6A78 4600103C */ c.lt.s $f2, $f0 -/* E2594C 802B6A7C 3C014170 */ lui $at, 0x4170 -/* E25950 802B6A80 44810000 */ mtc1 $at, $f0 -/* E25954 802B6A84 45030005 */ bc1tl .L802B6A9C -/* E25958 802B6A88 4600B580 */ add.s $f22, $f22, $f0 -.L802B6A8C: -/* E2595C 802B6A8C 3C01C170 */ lui $at, 0xc170 -/* E25960 802B6A90 44810000 */ mtc1 $at, $f0 -/* E25964 802B6A94 00000000 */ nop -/* E25968 802B6A98 4600B580 */ add.s $f22, $f22, $f0 -.L802B6A9C: -/* E2596C 802B6A9C 27A50020 */ addiu $a1, $sp, 0x20 -.L802B6AA0: -/* E25970 802B6AA0 3C0140C9 */ lui $at, 0x40c9 -/* E25974 802B6AA4 34210FD0 */ ori $at, $at, 0xfd0 -/* E25978 802B6AA8 44816000 */ mtc1 $at, $f12 -/* E2597C 802B6AAC 27A60024 */ addiu $a2, $sp, 0x24 -/* E25980 802B6AB0 460CB302 */ mul.s $f12, $f22, $f12 -/* E25984 802B6AB4 00000000 */ nop -/* E25988 802B6AB8 24110001 */ addiu $s1, $zero, 1 -/* E2598C 802B6ABC 27B30030 */ addiu $s3, $sp, 0x30 -/* E25990 802B6AC0 3C0143B4 */ lui $at, 0x43b4 -/* E25994 802B6AC4 44810000 */ mtc1 $at, $f0 -/* E25998 802B6AC8 3C014080 */ lui $at, 0x4080 -/* E2599C 802B6ACC 4481A000 */ mtc1 $at, $f20 -/* E259A0 802B6AD0 0C00A82D */ jal sin_cos_rad -/* E259A4 802B6AD4 46006303 */ div.s $f12, $f12, $f0 -.L802B6AD8: -/* E259A8 802B6AD8 C7A40020 */ lwc1 $f4, 0x20($sp) -/* E259AC 802B6ADC 44910000 */ mtc1 $s1, $f0 -/* E259B0 802B6AE0 00000000 */ nop -/* E259B4 802B6AE4 46800020 */ cvt.s.w $f0, $f0 -/* E259B8 802B6AE8 46002102 */ mul.s $f4, $f4, $f0 -/* E259BC 802B6AEC 00000000 */ nop -/* E259C0 802B6AF0 C7A20024 */ lwc1 $f2, 0x24($sp) -/* E259C4 802B6AF4 46001082 */ mul.s $f2, $f2, $f0 -/* E259C8 802B6AF8 00000000 */ nop -/* E259CC 802B6AFC 24040003 */ addiu $a0, $zero, 3 -/* E259D0 802B6B00 0240282D */ daddu $a1, $s2, $zero -/* E259D4 802B6B04 4604E100 */ add.s $f4, $f28, $f4 -/* E259D8 802B6B08 27A60028 */ addiu $a2, $sp, 0x28 -/* E259DC 802B6B0C 27A7002C */ addiu $a3, $sp, 0x2c -/* E259E0 802B6B10 4602C081 */ sub.s $f2, $f24, $f2 -/* E259E4 802B6B14 E7BA002C */ swc1 $f26, 0x2c($sp) -/* E259E8 802B6B18 E7A40028 */ swc1 $f4, 0x28($sp) -/* E259EC 802B6B1C E7A20030 */ swc1 $f2, 0x30($sp) -/* E259F0 802B6B20 AFB30010 */ sw $s3, 0x10($sp) -/* E259F4 802B6B24 E7B40014 */ swc1 $f20, 0x14($sp) -/* E259F8 802B6B28 0C037B01 */ jal player_test_lateral_overlap -/* E259FC 802B6B2C E7B60018 */ swc1 $f22, 0x18($sp) -/* E25A00 802B6B30 3C03802B */ lui $v1, %hi(HammerHit) -/* E25A04 802B6B34 8C636DB0 */ lw $v1, %lo(HammerHit)($v1) -/* E25A08 802B6B38 8C630014 */ lw $v1, 0x14($v1) -/* E25A0C 802B6B3C 14600009 */ bnez $v1, .L802B6B64 -/* E25A10 802B6B40 0040802D */ daddu $s0, $v0, $zero -/* E25A14 802B6B44 06000009 */ bltz $s0, .L802B6B6C -/* E25A18 802B6B48 A6900014 */ sh $s0, 0x14($s4) -/* E25A1C 802B6B4C 32024000 */ andi $v0, $s0, 0x4000 -/* E25A20 802B6B50 10400004 */ beqz $v0, .L802B6B64 -/* E25A24 802B6B54 00000000 */ nop -/* E25A28 802B6B58 0C04417A */ jal get_entity_by_index -/* E25A2C 802B6B5C 0200202D */ daddu $a0, $s0, $zero -/* E25A30 802B6B60 A0400007 */ sb $zero, 7($v0) -.L802B6B64: -/* E25A34 802B6B64 06010005 */ bgez $s0, .L802B6B7C -/* E25A38 802B6B68 00000000 */ nop -.L802B6B6C: -/* E25A3C 802B6B6C 26310001 */ addiu $s1, $s1, 1 -/* E25A40 802B6B70 2A220010 */ slti $v0, $s1, 0x10 -/* E25A44 802B6B74 1440FFD8 */ bnez $v0, .L802B6AD8 -/* E25A48 802B6B78 00000000 */ nop -.L802B6B7C: -/* E25A4C 802B6B7C 3C02802B */ lui $v0, %hi(HammerHit) -/* E25A50 802B6B80 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E25A54 802B6B84 8C440018 */ lw $a0, 0x18($v0) -/* E25A58 802B6B88 24020002 */ addiu $v0, $zero, 2 -/* E25A5C 802B6B8C 14820032 */ bne $a0, $v0, .L802B6C58 -/* E25A60 802B6B90 00000000 */ nop -/* E25A64 802B6B94 3C038011 */ lui $v1, %hi(gPlayerData+0x1) -/* E25A68 802B6B98 8063F291 */ lb $v1, %lo(gPlayerData+0x1)($v1) -/* E25A6C 802B6B9C 14640003 */ bne $v1, $a0, .L802B6BAC -/* E25A70 802B6BA0 24020001 */ addiu $v0, $zero, 1 -/* E25A74 802B6BA4 080ADAEE */ j .L802B6BB8 -/* E25A78 802B6BA8 24042117 */ addiu $a0, $zero, 0x2117 -.L802B6BAC: -/* E25A7C 802B6BAC 14620002 */ bne $v1, $v0, .L802B6BB8 -/* E25A80 802B6BB0 24042115 */ addiu $a0, $zero, 0x2115 -/* E25A84 802B6BB4 24042116 */ addiu $a0, $zero, 0x2116 -.L802B6BB8: -/* E25A88 802B6BB8 0C052736 */ jal sfx_play_sound_at_player -/* E25A8C 802B6BBC 0000282D */ daddu $a1, $zero, $zero -/* E25A90 802B6BC0 3C02802B */ lui $v0, %hi(HammerHit) -/* E25A94 802B6BC4 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E25A98 802B6BC8 0C0AD812 */ jal action_hammer_play_hit_fx -/* E25A9C 802B6BCC 8C440010 */ lw $a0, 0x10($v0) -/* E25AA0 802B6BD0 86840014 */ lh $a0, 0x14($s4) -/* E25AA4 802B6BD4 96820014 */ lhu $v0, 0x14($s4) -/* E25AA8 802B6BD8 04800007 */ bltz $a0, .L802B6BF8 -/* E25AAC 802B6BDC 30424000 */ andi $v0, $v0, 0x4000 -/* E25AB0 802B6BE0 10400005 */ beqz $v0, .L802B6BF8 -/* E25AB4 802B6BE4 00000000 */ nop -/* E25AB8 802B6BE8 0C04417A */ jal get_entity_by_index -/* E25ABC 802B6BEC 00000000 */ nop -/* E25AC0 802B6BF0 080ADB03 */ j .L802B6C0C -/* E25AC4 802B6BF4 A0400007 */ sb $zero, 7($v0) -.L802B6BF8: -/* E25AC8 802B6BF8 3C02802B */ lui $v0, %hi(HammerHit) -/* E25ACC 802B6BFC 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E25AD0 802B6C00 8C420010 */ lw $v0, 0x10($v0) -/* E25AD4 802B6C04 04410014 */ bgez $v0, .L802B6C58 -/* E25AD8 802B6C08 00000000 */ nop -.L802B6C0C: -/* E25ADC 802B6C0C 8E420000 */ lw $v0, ($s2) -/* E25AE0 802B6C10 3C030100 */ lui $v1, 0x100 -/* E25AE4 802B6C14 00431025 */ or $v0, $v0, $v1 -/* E25AE8 802B6C18 AE420000 */ sw $v0, ($s2) -/* E25AEC 802B6C1C 3C02802B */ lui $v0, %hi(HammerHit) -/* E25AF0 802B6C20 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E25AF4 802B6C24 8C420010 */ lw $v0, 0x10($v0) -/* E25AF8 802B6C28 0441000B */ bgez $v0, .L802B6C58 -/* E25AFC 802B6C2C 00000000 */ nop -/* E25B00 802B6C30 3C028011 */ lui $v0, %hi(gPlayerData+0x1) -/* E25B04 802B6C34 8042F291 */ lb $v0, %lo(gPlayerData+0x1)($v0) -/* E25B08 802B6C38 28420002 */ slti $v0, $v0, 2 -/* E25B0C 802B6C3C 14400006 */ bnez $v0, .L802B6C58 -/* E25B10 802B6C40 24030001 */ addiu $v1, $zero, 1 -/* E25B14 802B6C44 3C028016 */ lui $v0, %hi(D_8015A578) -/* E25B18 802B6C48 2442A578 */ addiu $v0, $v0, %lo(D_8015A578) -/* E25B1C 802B6C4C C640002C */ lwc1 $f0, 0x2c($s2) -/* E25B20 802B6C50 A0430000 */ sb $v1, ($v0) -/* E25B24 802B6C54 E4400008 */ swc1 $f0, 8($v0) -.L802B6C58: -/* E25B28 802B6C58 824200B6 */ lb $v0, 0xb6($s2) -/* E25B2C 802B6C5C 14400009 */ bnez $v0, .L802B6C84 -/* E25B30 802B6C60 924300B6 */ lbu $v1, 0xb6($s2) -/* E25B34 802B6C64 06000007 */ bltz $s0, .L802B6C84 -/* E25B38 802B6C68 00000000 */ nop -/* E25B3C 802B6C6C 3C02802B */ lui $v0, %hi(HammerHit) -/* E25B40 802B6C70 8C426DB0 */ lw $v0, %lo(HammerHit)($v0) -/* E25B44 802B6C74 8C420014 */ lw $v0, 0x14($v0) -/* E25B48 802B6C78 14400002 */ bnez $v0, .L802B6C84 -/* E25B4C 802B6C7C 24620001 */ addiu $v0, $v1, 1 -/* E25B50 802B6C80 A24200B6 */ sb $v0, 0xb6($s2) -.L802B6C84: -/* E25B54 802B6C84 824300B6 */ lb $v1, 0xb6($s2) -/* E25B58 802B6C88 24020001 */ addiu $v0, $zero, 1 -/* E25B5C 802B6C8C 14620004 */ bne $v1, $v0, .L802B6CA0 -/* E25B60 802B6C90 00000000 */ nop -/* E25B64 802B6C94 06010002 */ bgez $s0, .L802B6CA0 -/* E25B68 802B6C98 24020002 */ addiu $v0, $zero, 2 -/* E25B6C 802B6C9C A24200B6 */ sb $v0, 0xb6($s2) -.L802B6CA0: -/* E25B70 802B6CA0 3C05802B */ lui $a1, %hi(HammerHit) -/* E25B74 802B6CA4 24A56DB0 */ addiu $a1, $a1, %lo(HammerHit) -/* E25B78 802B6CA8 8CA30000 */ lw $v1, ($a1) -/* E25B7C 802B6CAC 8C620018 */ lw $v0, 0x18($v1) -/* E25B80 802B6CB0 24420001 */ addiu $v0, $v0, 1 -/* E25B84 802B6CB4 06000003 */ bltz $s0, .L802B6CC4 -/* E25B88 802B6CB8 AC620018 */ sw $v0, 0x18($v1) -/* E25B8C 802B6CBC 24020001 */ addiu $v0, $zero, 1 -/* E25B90 802B6CC0 AC620014 */ sw $v0, 0x14($v1) -.L802B6CC4: -/* E25B94 802B6CC4 8CA20000 */ lw $v0, ($a1) -/* E25B98 802B6CC8 8C430018 */ lw $v1, 0x18($v0) -/* E25B9C 802B6CCC 24020006 */ addiu $v0, $zero, 6 -/* E25BA0 802B6CD0 14620005 */ bne $v1, $v0, .L802B6CE8 -/* E25BA4 802B6CD4 3C03FFDF */ lui $v1, 0xffdf -/* E25BA8 802B6CD8 8E420000 */ lw $v0, ($s2) -/* E25BAC 802B6CDC 3463FFFF */ ori $v1, $v1, 0xffff -/* E25BB0 802B6CE0 00431024 */ and $v0, $v0, $v1 -/* E25BB4 802B6CE4 AE420000 */ sw $v0, ($s2) -.L802B6CE8: -/* E25BB8 802B6CE8 964400BC */ lhu $a0, 0xbc($s2) -/* E25BBC 802B6CEC 24020001 */ addiu $v0, $zero, 1 -/* E25BC0 802B6CF0 14820020 */ bne $a0, $v0, .L802B6D74 -/* E25BC4 802B6CF4 00000000 */ nop -/* E25BC8 802B6CF8 8CA30000 */ lw $v1, ($a1) -/* E25BCC 802B6CFC 8C620018 */ lw $v0, 0x18($v1) -/* E25BD0 802B6D00 28420007 */ slti $v0, $v0, 7 -/* E25BD4 802B6D04 14400005 */ bnez $v0, .L802B6D1C -/* E25BD8 802B6D08 00000000 */ nop -/* E25BDC 802B6D0C 8E4200E0 */ lw $v0, 0xe0($s2) -/* E25BE0 802B6D10 30424000 */ andi $v0, $v0, 0x4000 -/* E25BE4 802B6D14 54400001 */ bnel $v0, $zero, .L802B6D1C -/* E25BE8 802B6D18 AC64001C */ sw $a0, 0x1c($v1) -.L802B6D1C: -/* E25BEC 802B6D1C 3C03802B */ lui $v1, %hi(HammerHit) -/* E25BF0 802B6D20 8C636DB0 */ lw $v1, %lo(HammerHit)($v1) -/* E25BF4 802B6D24 8C62001C */ lw $v0, 0x1c($v1) -/* E25BF8 802B6D28 14400006 */ bnez $v0, .L802B6D44 -/* E25BFC 802B6D2C AC600014 */ sw $zero, 0x14($v1) -/* E25C00 802B6D30 8C630018 */ lw $v1, 0x18($v1) -/* E25C04 802B6D34 2402000A */ addiu $v0, $zero, 0xa -/* E25C08 802B6D38 0043102A */ slt $v0, $v0, $v1 -/* E25C0C 802B6D3C 10400009 */ beqz $v0, .L802B6D64 -/* E25C10 802B6D40 3C03FFDF */ lui $v1, 0xffdf -.L802B6D44: -/* E25C14 802B6D44 3C03FEFF */ lui $v1, 0xfeff -/* E25C18 802B6D48 3463FFFF */ ori $v1, $v1, 0xffff -/* E25C1C 802B6D4C 8E420000 */ lw $v0, ($s2) -/* E25C20 802B6D50 0000202D */ daddu $a0, $zero, $zero -/* E25C24 802B6D54 00431024 */ and $v0, $v0, $v1 -/* E25C28 802B6D58 0C039769 */ jal set_action_state -/* E25C2C 802B6D5C AE420000 */ sw $v0, ($s2) -/* E25C30 802B6D60 3C03FFDF */ lui $v1, 0xffdf -.L802B6D64: -/* E25C34 802B6D64 8E420000 */ lw $v0, ($s2) -/* E25C38 802B6D68 3463FFFF */ ori $v1, $v1, 0xffff -/* E25C3C 802B6D6C 00431024 */ and $v0, $v0, $v1 -/* E25C40 802B6D70 AE420000 */ sw $v0, ($s2) -.L802B6D74: -/* E25C44 802B6D74 8FBF004C */ lw $ra, 0x4c($sp) -/* E25C48 802B6D78 8FB40048 */ lw $s4, 0x48($sp) -/* E25C4C 802B6D7C 8FB30044 */ lw $s3, 0x44($sp) -/* E25C50 802B6D80 8FB20040 */ lw $s2, 0x40($sp) -/* E25C54 802B6D84 8FB1003C */ lw $s1, 0x3c($sp) -/* E25C58 802B6D88 8FB00038 */ lw $s0, 0x38($sp) -/* E25C5C 802B6D8C D7BC0070 */ ldc1 $f28, 0x70($sp) -/* E25C60 802B6D90 D7BA0068 */ ldc1 $f26, 0x68($sp) -/* E25C64 802B6D94 D7B80060 */ ldc1 $f24, 0x60($sp) -/* E25C68 802B6D98 D7B60058 */ ldc1 $f22, 0x58($sp) -/* E25C6C 802B6D9C D7B40050 */ ldc1 $f20, 0x50($sp) -/* E25C70 802B6DA0 03E00008 */ jr $ra -/* E25C74 802B6DA4 27BD0078 */ addiu $sp, $sp, 0x78 -/* E25C78 802B6DA8 00000000 */ nop -/* E25C7C 802B6DAC 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/partners/_use_partner_ability.s b/ver/us/asm/nonmatchings/world/partners/_use_partner_ability.s index 4e58206db0..535399df2f 100644 --- a/ver/us/asm/nonmatchings/world/partners/_use_partner_ability.s +++ b/ver/us/asm/nonmatchings/world/partners/_use_partner_ability.s @@ -285,12 +285,12 @@ glabel _use_partner_ability /* 83F84 800EAAD4 A2620012 */ sb $v0, 0x12($s3) /* 83F88 800EAAD8 3C048011 */ lui $a0, %hi(wPartnerNpc) /* 83F8C 800EAADC 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0) -/* 83F90 800EAAE0 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 83F94 800EAAE4 C422833C */ lwc1 $f2, %lo(SavedPartnerPosX)($at) -/* 83F98 800EAAE8 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 83F9C 800EAAEC C4248340 */ lwc1 $f4, %lo(SavedPartnerPosY)($at) -/* 83FA0 800EAAF0 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 83FA4 800EAAF4 C4268344 */ lwc1 $f6, %lo(SavedPartnerPosZ)($at) +/* 83F90 800EAAE0 3C018010 */ lui $at, %hi(wSavedPartnerPosX) +/* 83F94 800EAAE4 C422833C */ lwc1 $f2, %lo(wSavedPartnerPosX)($at) +/* 83F98 800EAAE8 3C018010 */ lui $at, %hi(wSavedPartnerPosY) +/* 83F9C 800EAAEC C4248340 */ lwc1 $f4, %lo(wSavedPartnerPosY)($at) +/* 83FA0 800EAAF0 3C018010 */ lui $at, %hi(wSavedPartnerPosZ) +/* 83FA4 800EAAF4 C4268344 */ lwc1 $f6, %lo(wSavedPartnerPosZ)($at) /* 83FA8 800EAAF8 3C013F80 */ lui $at, 0x3f80 /* 83FAC 800EAAFC 44810000 */ mtc1 $at, $f0 /* 83FB0 800EAB00 3C028011 */ lui $v0, %hi(wPartner) @@ -503,12 +503,12 @@ glabel _use_partner_ability /* 842BC 800EAE0C A2620012 */ sb $v0, 0x12($s3) /* 842C0 800EAE10 3C048011 */ lui $a0, %hi(wPartnerNpc) /* 842C4 800EAE14 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0) -/* 842C8 800EAE18 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 842CC 800EAE1C C422833C */ lwc1 $f2, %lo(SavedPartnerPosX)($at) -/* 842D0 800EAE20 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 842D4 800EAE24 C4248340 */ lwc1 $f4, %lo(SavedPartnerPosY)($at) -/* 842D8 800EAE28 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 842DC 800EAE2C C4268344 */ lwc1 $f6, %lo(SavedPartnerPosZ)($at) +/* 842C8 800EAE18 3C018010 */ lui $at, %hi(wSavedPartnerPosX) +/* 842CC 800EAE1C C422833C */ lwc1 $f2, %lo(wSavedPartnerPosX)($at) +/* 842D0 800EAE20 3C018010 */ lui $at, %hi(wSavedPartnerPosY) +/* 842D4 800EAE24 C4248340 */ lwc1 $f4, %lo(wSavedPartnerPosY)($at) +/* 842D8 800EAE28 3C018010 */ lui $at, %hi(wSavedPartnerPosZ) +/* 842DC 800EAE2C C4268344 */ lwc1 $f6, %lo(wSavedPartnerPosZ)($at) /* 842E0 800EAE30 3C013F80 */ lui $at, 0x3f80 /* 842E4 800EAE34 44810000 */ mtc1 $at, $f0 /* 842E8 800EAE38 3C028011 */ lui $v0, %hi(wPartner) @@ -669,12 +669,12 @@ glabel _use_partner_ability /* 84528 800EB078 C4C2002C */ lwc1 $f2, 0x2c($a2) /* 8452C 800EB07C C4C40030 */ lwc1 $f4, 0x30($a2) /* 84530 800EB080 8C440018 */ lw $a0, 0x18($v0) -/* 84534 800EB084 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 84538 800EB088 E420833C */ swc1 $f0, %lo(SavedPartnerPosX)($at) -/* 8453C 800EB08C 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 84540 800EB090 E4228340 */ swc1 $f2, %lo(SavedPartnerPosY)($at) -/* 84544 800EB094 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 84548 800EB098 E4248344 */ swc1 $f4, %lo(SavedPartnerPosZ)($at) +/* 84534 800EB084 3C018010 */ lui $at, %hi(wSavedPartnerPosX) +/* 84538 800EB088 E420833C */ swc1 $f0, %lo(wSavedPartnerPosX)($at) +/* 8453C 800EB08C 3C018010 */ lui $at, %hi(wSavedPartnerPosY) +/* 84540 800EB090 E4228340 */ swc1 $f2, %lo(wSavedPartnerPosY)($at) +/* 84544 800EB094 3C018010 */ lui $at, %hi(wSavedPartnerPosZ) +/* 84548 800EB098 E4248344 */ swc1 $f4, %lo(wSavedPartnerPosZ)($at) /* 8454C 800EB09C 0C0B0CF8 */ jal start_script /* 84550 800EB0A0 24060020 */ addiu $a2, $zero, 0x20 /* 84554 800EB0A4 3C038011 */ lui $v1, %hi(wPartnerNpc) diff --git a/ver/us/asm/nonmatchings/world/partners/partner_clear_player_tracking.s b/ver/us/asm/nonmatchings/world/partners/partner_clear_player_tracking.s deleted file mode 100644 index f540b0de9b..0000000000 --- a/ver/us/asm/nonmatchings/world/partners/partner_clear_player_tracking.s +++ /dev/null @@ -1,38 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel partner_clear_player_tracking -/* 8890C 800EF45C 3C058011 */ lui $a1, %hi(PlayerMoveHistory) -/* 88910 800EF460 24A5CD38 */ addiu $a1, $a1, %lo(PlayerMoveHistory) -/* 88914 800EF464 0000302D */ daddu $a2, $zero, $zero -/* 88918 800EF468 3C028010 */ lui $v0, %hi(SavedPartnerPosX) -/* 8891C 800EF46C 2442833C */ addiu $v0, $v0, %lo(SavedPartnerPosX) -/* 88920 800EF470 0040482D */ daddu $t1, $v0, $zero -/* 88924 800EF474 3C028010 */ lui $v0, %hi(SavedPartnerPosY) -/* 88928 800EF478 24428340 */ addiu $v0, $v0, %lo(SavedPartnerPosY) -/* 8892C 800EF47C 0040402D */ daddu $t0, $v0, $zero -/* 88930 800EF480 3C028010 */ lui $v0, %hi(SavedPartnerPosZ) -/* 88934 800EF484 24428344 */ addiu $v0, $v0, %lo(SavedPartnerPosZ) -/* 88938 800EF488 0040382D */ daddu $a3, $v0, $zero -/* 8893C 800EF48C C4800038 */ lwc1 $f0, 0x38($a0) -/* 88940 800EF490 C482003C */ lwc1 $f2, 0x3c($a0) -/* 88944 800EF494 C4840040 */ lwc1 $f4, 0x40($a0) -/* 88948 800EF498 24A3000C */ addiu $v1, $a1, 0xc -/* 8894C 800EF49C E5200000 */ swc1 $f0, ($t1) -/* 88950 800EF4A0 E5020000 */ swc1 $f2, ($t0) -/* 88954 800EF4A4 E4E40000 */ swc1 $f4, ($a3) -.L800EF4A8: -/* 88958 800EF4A8 24C60001 */ addiu $a2, $a2, 1 -/* 8895C 800EF4AC C5200000 */ lwc1 $f0, ($t1) -/* 88960 800EF4B0 C5020000 */ lwc1 $f2, ($t0) -/* 88964 800EF4B4 C4E40000 */ lwc1 $f4, ($a3) -/* 88968 800EF4B8 28C20028 */ slti $v0, $a2, 0x28 -/* 8896C 800EF4BC E460FFF8 */ swc1 $f0, -8($v1) -/* 88970 800EF4C0 E462FFFC */ swc1 $f2, -4($v1) -/* 88974 800EF4C4 E4640000 */ swc1 $f4, ($v1) -/* 88978 800EF4C8 24630010 */ addiu $v1, $v1, 0x10 -/* 8897C 800EF4CC A0A00000 */ sb $zero, ($a1) -/* 88980 800EF4D0 1440FFF5 */ bnez $v0, .L800EF4A8 -/* 88984 800EF4D4 24A50010 */ addiu $a1, $a1, 0x10 -/* 88988 800EF4D8 03E00008 */ jr $ra -/* 8898C 800EF4DC 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/partners/partner_flying_enable.s b/ver/us/asm/nonmatchings/world/partners/partner_flying_enable.s deleted file mode 100644 index 1ff188bd9c..0000000000 --- a/ver/us/asm/nonmatchings/world/partners/partner_flying_enable.s +++ /dev/null @@ -1,117 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel partner_flying_enable -/* 867C0 800ED310 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 867C4 800ED314 AFB00010 */ sw $s0, 0x10($sp) -/* 867C8 800ED318 0080802D */ daddu $s0, $a0, $zero -/* 867CC 800ED31C 3C048011 */ lui $a0, %hi(PlayerMoveHistory) -/* 867D0 800ED320 2484CD38 */ addiu $a0, $a0, %lo(PlayerMoveHistory) -/* 867D4 800ED324 0000302D */ daddu $a2, $zero, $zero -/* 867D8 800ED328 3C028010 */ lui $v0, %hi(SavedPartnerPosX) -/* 867DC 800ED32C 2442833C */ addiu $v0, $v0, %lo(SavedPartnerPosX) -/* 867E0 800ED330 0040482D */ daddu $t1, $v0, $zero -/* 867E4 800ED334 3C028010 */ lui $v0, %hi(SavedPartnerPosY) -/* 867E8 800ED338 24428340 */ addiu $v0, $v0, %lo(SavedPartnerPosY) -/* 867EC 800ED33C 0040402D */ daddu $t0, $v0, $zero -/* 867F0 800ED340 3C028010 */ lui $v0, %hi(SavedPartnerPosZ) -/* 867F4 800ED344 24428344 */ addiu $v0, $v0, %lo(SavedPartnerPosZ) -/* 867F8 800ED348 0040382D */ daddu $a3, $v0, $zero -/* 867FC 800ED34C AFBF0014 */ sw $ra, 0x14($sp) -/* 86800 800ED350 C5200000 */ lwc1 $f0, ($t1) -/* 86804 800ED354 C5020000 */ lwc1 $f2, ($t0) -/* 86808 800ED358 C4E40000 */ lwc1 $f4, ($a3) -/* 8680C 800ED35C 2483000C */ addiu $v1, $a0, 0xc -/* 86810 800ED360 E6000038 */ swc1 $f0, 0x38($s0) -/* 86814 800ED364 E602003C */ swc1 $f2, 0x3c($s0) -/* 86818 800ED368 E6040040 */ swc1 $f4, 0x40($s0) -.L800ED36C: -/* 8681C 800ED36C 24C60001 */ addiu $a2, $a2, 1 -/* 86820 800ED370 C5200000 */ lwc1 $f0, ($t1) -/* 86824 800ED374 C5020000 */ lwc1 $f2, ($t0) -/* 86828 800ED378 C4E40000 */ lwc1 $f4, ($a3) -/* 8682C 800ED37C 28C20028 */ slti $v0, $a2, 0x28 -/* 86830 800ED380 E460FFF8 */ swc1 $f0, -8($v1) -/* 86834 800ED384 E462FFFC */ swc1 $f2, -4($v1) -/* 86838 800ED388 E4640000 */ swc1 $f4, ($v1) -/* 8683C 800ED38C 24630010 */ addiu $v1, $v1, 0x10 -/* 86840 800ED390 A0800000 */ sb $zero, ($a0) -/* 86844 800ED394 1440FFF5 */ bnez $v0, .L800ED36C -/* 86848 800ED398 24840010 */ addiu $a0, $a0, 0x10 -/* 8684C 800ED39C 3C018011 */ lui $at, %hi(PlayerMoveHistoryIndex) -/* 86850 800ED3A0 AC20CFB8 */ sw $zero, %lo(PlayerMoveHistoryIndex)($at) -/* 86854 800ED3A4 3C018011 */ lui $at, %hi(D_8010CFBC) -/* 86858 800ED3A8 AC20CFBC */ sw $zero, %lo(D_8010CFBC)($at) -/* 8685C 800ED3AC 14A00005 */ bnez $a1, .L800ED3C4 -/* 86860 800ED3B0 00000000 */ nop -/* 86864 800ED3B4 3C018011 */ lui $at, %hi(D_8010CFC8) -/* 86868 800ED3B8 A420CFC8 */ sh $zero, %lo(D_8010CFC8)($at) -/* 8686C 800ED3BC 0803B50B */ j .L800ED42C -/* 86870 800ED3C0 00000000 */ nop -.L800ED3C4: -/* 86874 800ED3C4 3C048011 */ lui $a0, %hi(D_8010CFC4) -/* 86878 800ED3C8 2484CFC4 */ addiu $a0, $a0, %lo(D_8010CFC4) -/* 8687C 800ED3CC 8C830000 */ lw $v1, ($a0) -/* 86880 800ED3D0 14600009 */ bnez $v1, .L800ED3F8 -/* 86884 800ED3D4 24020001 */ addiu $v0, $zero, 1 -/* 86888 800ED3D8 2402000F */ addiu $v0, $zero, 0xf -/* 8688C 800ED3DC 3C018011 */ lui $at, %hi(D_8010CFC8) -/* 86890 800ED3E0 A422CFC8 */ sh $v0, %lo(D_8010CFC8)($at) -/* 86894 800ED3E4 24020002 */ addiu $v0, $zero, 2 -/* 86898 800ED3E8 3C018011 */ lui $at, %hi(D_8010CFCA) -/* 8689C 800ED3EC A422CFCA */ sh $v0, %lo(D_8010CFCA)($at) -/* 868A0 800ED3F0 0803B50D */ j .L800ED434 -/* 868A4 800ED3F4 00000000 */ nop -.L800ED3F8: -/* 868A8 800ED3F8 10620003 */ beq $v1, $v0, .L800ED408 -/* 868AC 800ED3FC 24020003 */ addiu $v0, $zero, 3 -/* 868B0 800ED400 14620006 */ bne $v1, $v0, .L800ED41C -/* 868B4 800ED404 24020002 */ addiu $v0, $zero, 2 -.L800ED408: -/* 868B8 800ED408 AC800000 */ sw $zero, ($a0) -/* 868BC 800ED40C 3C018011 */ lui $at, %hi(D_8010CFC8) -/* 868C0 800ED410 A420CFC8 */ sh $zero, %lo(D_8010CFC8)($at) -/* 868C4 800ED414 0803B50B */ j .L800ED42C -/* 868C8 800ED418 00000000 */ nop -.L800ED41C: -/* 868CC 800ED41C 14620005 */ bne $v1, $v0, .L800ED434 -/* 868D0 800ED420 24020032 */ addiu $v0, $zero, 0x32 -/* 868D4 800ED424 3C018011 */ lui $at, %hi(D_8010CFC8) -/* 868D8 800ED428 A422CFC8 */ sh $v0, %lo(D_8010CFC8)($at) -.L800ED42C: -/* 868DC 800ED42C 3C018011 */ lui $at, %hi(D_8010CFCA) -/* 868E0 800ED430 A420CFCA */ sh $zero, %lo(D_8010CFCA)($at) -.L800ED434: -/* 868E4 800ED434 3C038011 */ lui $v1, %hi(D_8010CFD8) -/* 868E8 800ED438 8C63CFD8 */ lw $v1, %lo(D_8010CFD8)($v1) -/* 868EC 800ED43C 3C014220 */ lui $at, 0x4220 -/* 868F0 800ED440 44810000 */ mtc1 $at, $f0 -/* 868F4 800ED444 0200202D */ daddu $a0, $s0, $zero -/* 868F8 800ED448 3C018011 */ lui $at, %hi(D_8010CFCE) -/* 868FC 800ED44C A420CFCE */ sh $zero, %lo(D_8010CFCE)($at) -/* 86900 800ED450 3C018011 */ lui $at, %hi(D_8010CFCC) -/* 86904 800ED454 A420CFCC */ sh $zero, %lo(D_8010CFCC)($at) -/* 86908 800ED458 000310C0 */ sll $v0, $v1, 3 -/* 8690C 800ED45C 00431021 */ addu $v0, $v0, $v1 -/* 86910 800ED460 00021080 */ sll $v0, $v0, 2 -/* 86914 800ED464 3C038010 */ lui $v1, %hi(gPartnerAnimations+0x14) -/* 86918 800ED468 00621821 */ addu $v1, $v1, $v0 -/* 8691C 800ED46C 8C63835C */ lw $v1, %lo(gPartnerAnimations+0x14)($v1) -/* 86920 800ED470 24020010 */ addiu $v0, $zero, 0x10 -/* 86924 800ED474 3C018010 */ lui $at, %hi(wPartnerMoveTime) -/* 86928 800ED478 AC22802C */ sw $v0, %lo(wPartnerMoveTime)($at) -/* 8692C 800ED47C 3C018011 */ lui $at, %hi(wPartnerTetherDistance) -/* 86930 800ED480 E420CFC0 */ swc1 $f0, %lo(wPartnerTetherDistance)($at) -/* 86934 800ED484 0C03A96E */ jal func_800EA5B8 -/* 86938 800ED488 AE030028 */ sw $v1, 0x28($s0) -/* 8693C 800ED48C 8E020000 */ lw $v0, ($s0) -/* 86940 800ED490 3C030001 */ lui $v1, 1 -/* 86944 800ED494 AE030080 */ sw $v1, 0x80($s0) -/* 86948 800ED498 2403FDFF */ addiu $v1, $zero, -0x201 -/* 8694C 800ED49C 34420100 */ ori $v0, $v0, 0x100 -/* 86950 800ED4A0 00431024 */ and $v0, $v0, $v1 -/* 86954 800ED4A4 AE020000 */ sw $v0, ($s0) -/* 86958 800ED4A8 8FBF0014 */ lw $ra, 0x14($sp) -/* 8695C 800ED4AC 8FB00010 */ lw $s0, 0x10($sp) -/* 86960 800ED4B0 03E00008 */ jr $ra -/* 86964 800ED4B4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/partners/partner_flying_follow_player.s b/ver/us/asm/nonmatchings/world/partners/partner_flying_follow_player.s index f45e7bd9c6..d7bf9aeddc 100644 --- a/ver/us/asm/nonmatchings/world/partners/partner_flying_follow_player.s +++ b/ver/us/asm/nonmatchings/world/partners/partner_flying_follow_player.s @@ -35,8 +35,8 @@ glabel partner_flying_follow_player /* 86F04 800EDA54 00400008 */ jr $v0 /* 86F08 800EDA58 00000000 */ nop .L800EDA5C_86F0C: -/* 86F0C 800EDA5C 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 86F10 800EDA60 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 86F0C 800EDA5C 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 86F10 800EDA60 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 86F14 800EDA64 44806000 */ mtc1 $zero, $f12 /* 86F18 800EDA68 3C028011 */ lui $v0, %hi(D_8010CFBC) /* 86F1C 800EDA6C 8C42CFBC */ lw $v0, %lo(D_8010CFBC)($v0) @@ -56,12 +56,12 @@ glabel partner_flying_follow_player /* 86F54 800EDAA4 E7A20020 */ swc1 $f2, 0x20($sp) /* 86F58 800EDAA8 E7A40024 */ swc1 $f4, 0x24($sp) /* 86F5C 800EDAAC E7A00028 */ swc1 $f0, 0x28($sp) -/* 86F60 800EDAB0 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 86F64 800EDAB4 E422833C */ swc1 $f2, %lo(SavedPartnerPosX)($at) -/* 86F68 800EDAB8 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 86F6C 800EDABC E4248340 */ swc1 $f4, %lo(SavedPartnerPosY)($at) -/* 86F70 800EDAC0 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 86F74 800EDAC4 E4208344 */ swc1 $f0, %lo(SavedPartnerPosZ)($at) +/* 86F60 800EDAB0 3C018010 */ lui $at, %hi(wSavedPartnerPosX) +/* 86F64 800EDAB4 E422833C */ swc1 $f2, %lo(wSavedPartnerPosX)($at) +/* 86F68 800EDAB8 3C018010 */ lui $at, %hi(wSavedPartnerPosY) +/* 86F6C 800EDABC E4248340 */ swc1 $f4, %lo(wSavedPartnerPosY)($at) +/* 86F70 800EDAC0 3C018010 */ lui $at, %hi(wSavedPartnerPosZ) +/* 86F74 800EDAC4 E4208344 */ swc1 $f0, %lo(wSavedPartnerPosZ)($at) /* 86F78 800EDAC8 45020008 */ bc1fl .L800EDAEC /* 86F7C 800EDACC 46083000 */ add.s $f0, $f6, $f8 /* 86F80 800EDAD0 460A4081 */ sub.s $f2, $f8, $f10 @@ -172,8 +172,8 @@ glabel partner_flying_follow_player .L800EDC58: /* 87108 800EDC58 3C128011 */ lui $s2, %hi(D_8010CFBC) /* 8710C 800EDC5C 2652CFBC */ addiu $s2, $s2, %lo(D_8010CFBC) -/* 87110 800EDC60 3C148011 */ lui $s4, %hi(PlayerMoveHistory) -/* 87114 800EDC64 2694CD38 */ addiu $s4, $s4, %lo(PlayerMoveHistory) +/* 87110 800EDC60 3C148011 */ lui $s4, %hi(gPlayerMoveHistory) +/* 87114 800EDC64 2694CD38 */ addiu $s4, $s4, %lo(gPlayerMoveHistory) .L800EDC68: /* 87118 800EDC68 C7AC0020 */ lwc1 $f12, 0x20($sp) /* 8711C 800EDC6C C7AE0028 */ lwc1 $f14, 0x28($sp) @@ -234,8 +234,8 @@ glabel partner_flying_follow_player /* 871F4 800EDD44 46200020 */ cvt.s.d $f0, $f0 .L800EDD48: /* 871F8 800EDD48 8E430000 */ lw $v1, ($s2) -/* 871FC 800EDD4C 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 87200 800EDD50 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 871FC 800EDD4C 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 87200 800EDD50 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 87204 800EDD54 1062FF92 */ beq $v1, $v0, .L800EDBA0 /* 87208 800EDD58 00000000 */ nop /* 8720C 800EDD5C C62C0038 */ lwc1 $f12, 0x38($s1) @@ -280,8 +280,8 @@ glabel partner_flying_follow_player /* 8729C 800EDDEC 3C048011 */ lui $a0, %hi(D_8010CFBC) /* 872A0 800EDDF0 2484CFBC */ addiu $a0, $a0, %lo(D_8010CFBC) /* 872A4 800EDDF4 8C830000 */ lw $v1, ($a0) -/* 872A8 800EDDF8 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 872AC 800EDDFC 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 872A8 800EDDF8 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 872AC 800EDDFC 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 872B0 800EDE00 106202D9 */ beq $v1, $v0, .L800EE968_87E18 /* 872B4 800EDE04 24620001 */ addiu $v0, $v1, 1 /* 872B8 800EDE08 AC820000 */ sw $v0, ($a0) @@ -289,8 +289,8 @@ glabel partner_flying_follow_player /* 872C0 800EDE10 50400001 */ beql $v0, $zero, .L800EDE18 /* 872C4 800EDE14 AC800000 */ sw $zero, ($a0) .L800EDE18: -/* 872C8 800EDE18 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 872CC 800EDE1C 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 872C8 800EDE18 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 872CC 800EDE1C 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 872D0 800EDE20 8C820000 */ lw $v0, ($a0) /* 872D4 800EDE24 3C013FA6 */ lui $at, 0x3fa6 /* 872D8 800EDE28 34216666 */ ori $at, $at, 0x6666 @@ -521,8 +521,8 @@ glabel partner_flying_follow_player /* 87634 800EE184 0803BA5A */ j .L800EE968_87E18 /* 87638 800EE188 A6020000 */ sh $v0, ($s0) .L800EE18C_8763C: -/* 8763C 800EE18C 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 87640 800EE190 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 8763C 800EE18C 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 87640 800EE190 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 87644 800EE194 C62C0038 */ lwc1 $f12, 0x38($s1) /* 87648 800EE198 C62E0040 */ lwc1 $f14, 0x40($s1) /* 8764C 800EE19C 8E660028 */ lw $a2, 0x28($s3) @@ -733,8 +733,8 @@ glabel partner_flying_follow_player /* 87960 800EE4B0 4481C000 */ mtc1 $at, $f24 /* 87964 800EE4B4 3C128011 */ lui $s2, %hi(D_8010CFBC) /* 87968 800EE4B8 2652CFBC */ addiu $s2, $s2, %lo(D_8010CFBC) -/* 8796C 800EE4BC 3C148011 */ lui $s4, %hi(PlayerMoveHistory) -/* 87970 800EE4C0 2694CD38 */ addiu $s4, $s4, %lo(PlayerMoveHistory) +/* 8796C 800EE4BC 3C148011 */ lui $s4, %hi(gPlayerMoveHistory) +/* 87970 800EE4C0 2694CD38 */ addiu $s4, $s4, %lo(gPlayerMoveHistory) .L800EE4C4: /* 87974 800EE4C4 82020000 */ lb $v0, ($s0) /* 87978 800EE4C8 14400024 */ bnez $v0, .L800EE55C @@ -760,8 +760,8 @@ glabel partner_flying_follow_player /* 879C8 800EE518 45010010 */ bc1t .L800EE55C /* 879CC 800EE51C 00000000 */ nop /* 879D0 800EE520 8E430000 */ lw $v1, ($s2) -/* 879D4 800EE524 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 879D8 800EE528 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 879D4 800EE524 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 879D8 800EE528 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 879DC 800EE52C 1062000B */ beq $v1, $v0, .L800EE55C /* 879E0 800EE530 24620001 */ addiu $v0, $v1, 1 /* 879E4 800EE534 AE420000 */ sw $v0, ($s2) diff --git a/ver/us/asm/nonmatchings/world/partners/partner_flying_update_motion.s b/ver/us/asm/nonmatchings/world/partners/partner_flying_update_motion.s index aaabb2dfcd..0e9be6cb88 100644 --- a/ver/us/asm/nonmatchings/world/partners/partner_flying_update_motion.s +++ b/ver/us/asm/nonmatchings/world/partners/partner_flying_update_motion.s @@ -268,12 +268,12 @@ glabel partner_flying_update_motion /* 86E60 800ED9B0 C602003C */ lwc1 $f2, 0x3c($s0) /* 86E64 800ED9B4 C6040040 */ lwc1 $f4, 0x40($s0) .L800ED9B8: -/* 86E68 800ED9B8 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 86E6C 800ED9BC E420833C */ swc1 $f0, %lo(SavedPartnerPosX)($at) -/* 86E70 800ED9C0 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 86E74 800ED9C4 E4228340 */ swc1 $f2, %lo(SavedPartnerPosY)($at) -/* 86E78 800ED9C8 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 86E7C 800ED9CC E4248344 */ swc1 $f4, %lo(SavedPartnerPosZ)($at) +/* 86E68 800ED9B8 3C018010 */ lui $at, %hi(wSavedPartnerPosX) +/* 86E6C 800ED9BC E420833C */ swc1 $f0, %lo(wSavedPartnerPosX)($at) +/* 86E70 800ED9C0 3C018010 */ lui $at, %hi(wSavedPartnerPosY) +/* 86E74 800ED9C4 E4228340 */ swc1 $f2, %lo(wSavedPartnerPosY)($at) +/* 86E78 800ED9C8 3C018010 */ lui $at, %hi(wSavedPartnerPosZ) +/* 86E7C 800ED9CC E4248344 */ swc1 $f4, %lo(wSavedPartnerPosZ)($at) /* 86E80 800ED9D0 8FBF004C */ lw $ra, 0x4c($sp) /* 86E84 800ED9D4 8FB60048 */ lw $s6, 0x48($sp) /* 86E88 800ED9D8 8FB50044 */ lw $s5, 0x44($sp) diff --git a/ver/us/asm/nonmatchings/world/partners/partner_walking_enable.s b/ver/us/asm/nonmatchings/world/partners/partner_walking_enable.s deleted file mode 100644 index c8cb3cc5d0..0000000000 --- a/ver/us/asm/nonmatchings/world/partners/partner_walking_enable.s +++ /dev/null @@ -1,111 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel partner_walking_enable -/* 84D58 800EB8A8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 84D5C 800EB8AC AFB00010 */ sw $s0, 0x10($sp) -/* 84D60 800EB8B0 0080802D */ daddu $s0, $a0, $zero -/* 84D64 800EB8B4 3C078011 */ lui $a3, %hi(gPlayerStatus) -/* 84D68 800EB8B8 24E7EFC8 */ addiu $a3, $a3, %lo(gPlayerStatus) -/* 84D6C 800EB8BC 3C048011 */ lui $a0, %hi(PlayerMoveHistory) -/* 84D70 800EB8C0 2484CD38 */ addiu $a0, $a0, %lo(PlayerMoveHistory) -/* 84D74 800EB8C4 0000302D */ daddu $a2, $zero, $zero -/* 84D78 800EB8C8 3C018010 */ lui $at, %hi(SavedPartnerPosX) -/* 84D7C 800EB8CC C420833C */ lwc1 $f0, %lo(SavedPartnerPosX)($at) -/* 84D80 800EB8D0 3C018010 */ lui $at, %hi(SavedPartnerPosY) -/* 84D84 800EB8D4 C4228340 */ lwc1 $f2, %lo(SavedPartnerPosY)($at) -/* 84D88 800EB8D8 3C018010 */ lui $at, %hi(SavedPartnerPosZ) -/* 84D8C 800EB8DC C4248344 */ lwc1 $f4, %lo(SavedPartnerPosZ)($at) -/* 84D90 800EB8E0 2483000C */ addiu $v1, $a0, 0xc -/* 84D94 800EB8E4 AFBF0014 */ sw $ra, 0x14($sp) -/* 84D98 800EB8E8 E6000038 */ swc1 $f0, 0x38($s0) -/* 84D9C 800EB8EC E602003C */ swc1 $f2, 0x3c($s0) -/* 84DA0 800EB8F0 E6040040 */ swc1 $f4, 0x40($s0) -.L800EB8F4: -/* 84DA4 800EB8F4 C4E00028 */ lwc1 $f0, 0x28($a3) -/* 84DA8 800EB8F8 E460FFF8 */ swc1 $f0, -8($v1) -/* 84DAC 800EB8FC C4E0002C */ lwc1 $f0, 0x2c($a3) -/* 84DB0 800EB900 24C60001 */ addiu $a2, $a2, 1 -/* 84DB4 800EB904 E460FFFC */ swc1 $f0, -4($v1) -/* 84DB8 800EB908 C4E00030 */ lwc1 $f0, 0x30($a3) -/* 84DBC 800EB90C 28C20028 */ slti $v0, $a2, 0x28 -/* 84DC0 800EB910 E4600000 */ swc1 $f0, ($v1) -/* 84DC4 800EB914 24630010 */ addiu $v1, $v1, 0x10 -/* 84DC8 800EB918 A0800000 */ sb $zero, ($a0) -/* 84DCC 800EB91C 1440FFF5 */ bnez $v0, .L800EB8F4 -/* 84DD0 800EB920 24840010 */ addiu $a0, $a0, 0x10 -/* 84DD4 800EB924 3C038011 */ lui $v1, %hi(D_8010CFCA) -/* 84DD8 800EB928 2463CFCA */ addiu $v1, $v1, %lo(D_8010CFCA) -/* 84DDC 800EB92C 3C018011 */ lui $at, %hi(PlayerMoveHistoryIndex) -/* 84DE0 800EB930 AC20CFB8 */ sw $zero, %lo(PlayerMoveHistoryIndex)($at) -/* 84DE4 800EB934 3C018011 */ lui $at, %hi(D_8010CFBC) -/* 84DE8 800EB938 AC20CFBC */ sw $zero, %lo(D_8010CFBC)($at) -/* 84DEC 800EB93C 10A00003 */ beqz $a1, .L800EB94C -/* 84DF0 800EB940 24020002 */ addiu $v0, $zero, 2 -/* 84DF4 800EB944 0803AE54 */ j .L800EB950 -/* 84DF8 800EB948 A4620000 */ sh $v0, ($v1) -.L800EB94C: -/* 84DFC 800EB94C A4600000 */ sh $zero, ($v1) -.L800EB950: -/* 84E00 800EB950 3C048011 */ lui $a0, %hi(D_8010CFC8) -/* 84E04 800EB954 2484CFC8 */ addiu $a0, $a0, %lo(D_8010CFC8) -/* 84E08 800EB958 3C058011 */ lui $a1, %hi(D_8010CFC4) -/* 84E0C 800EB95C 24A5CFC4 */ addiu $a1, $a1, %lo(D_8010CFC4) -/* 84E10 800EB960 A4800000 */ sh $zero, ($a0) -/* 84E14 800EB964 8CA30000 */ lw $v1, ($a1) -/* 84E18 800EB968 24020001 */ addiu $v0, $zero, 1 -/* 84E1C 800EB96C 10620003 */ beq $v1, $v0, .L800EB97C -/* 84E20 800EB970 24020003 */ addiu $v0, $zero, 3 -/* 84E24 800EB974 14620006 */ bne $v1, $v0, .L800EB990 -/* 84E28 800EB978 24020002 */ addiu $v0, $zero, 2 -.L800EB97C: -/* 84E2C 800EB97C ACA00000 */ sw $zero, ($a1) -/* 84E30 800EB980 3C018011 */ lui $at, %hi(D_8010CFCA) -/* 84E34 800EB984 A420CFCA */ sh $zero, %lo(D_8010CFCA)($at) -/* 84E38 800EB988 0803AE69 */ j .L800EB9A4 -/* 84E3C 800EB98C A4800000 */ sh $zero, ($a0) -.L800EB990: -/* 84E40 800EB990 14620004 */ bne $v1, $v0, .L800EB9A4 -/* 84E44 800EB994 24020032 */ addiu $v0, $zero, 0x32 -/* 84E48 800EB998 3C018011 */ lui $at, %hi(D_8010CFCA) -/* 84E4C 800EB99C A420CFCA */ sh $zero, %lo(D_8010CFCA)($at) -/* 84E50 800EB9A0 A4820000 */ sh $v0, ($a0) -.L800EB9A4: -/* 84E54 800EB9A4 3C038011 */ lui $v1, %hi(D_8010CFD8) -/* 84E58 800EB9A8 8C63CFD8 */ lw $v1, %lo(D_8010CFD8)($v1) -/* 84E5C 800EB9AC 3C014220 */ lui $at, 0x4220 -/* 84E60 800EB9B0 44810000 */ mtc1 $at, $f0 -/* 84E64 800EB9B4 0200202D */ daddu $a0, $s0, $zero -/* 84E68 800EB9B8 3C018011 */ lui $at, %hi(D_8010CFCE) -/* 84E6C 800EB9BC A420CFCE */ sh $zero, %lo(D_8010CFCE)($at) -/* 84E70 800EB9C0 3C018011 */ lui $at, %hi(D_8010CFCC) -/* 84E74 800EB9C4 A420CFCC */ sh $zero, %lo(D_8010CFCC)($at) -/* 84E78 800EB9C8 000310C0 */ sll $v0, $v1, 3 -/* 84E7C 800EB9CC 00431021 */ addu $v0, $v0, $v1 -/* 84E80 800EB9D0 00021080 */ sll $v0, $v0, 2 -/* 84E84 800EB9D4 3C038010 */ lui $v1, %hi(gPartnerAnimations+0x14) -/* 84E88 800EB9D8 00621821 */ addu $v1, $v1, $v0 -/* 84E8C 800EB9DC 8C63835C */ lw $v1, %lo(gPartnerAnimations+0x14)($v1) -/* 84E90 800EB9E0 24020010 */ addiu $v0, $zero, 0x10 -/* 84E94 800EB9E4 3C018010 */ lui $at, %hi(wPartnerMoveTime) -/* 84E98 800EB9E8 AC22802C */ sw $v0, %lo(wPartnerMoveTime)($at) -/* 84E9C 800EB9EC 3C018011 */ lui $at, %hi(wPartnerTetherDistance) -/* 84EA0 800EB9F0 E420CFC0 */ swc1 $f0, %lo(wPartnerTetherDistance)($at) -/* 84EA4 800EB9F4 0C03A96E */ jal func_800EA5B8 -/* 84EA8 800EB9F8 AE030028 */ sw $v1, 0x28($s0) -/* 84EAC 800EB9FC 3C030040 */ lui $v1, 0x40 -/* 84EB0 800EBA00 3C020001 */ lui $v0, 1 -/* 84EB4 800EBA04 AE020080 */ sw $v0, 0x80($s0) -/* 84EB8 800EBA08 8E020000 */ lw $v0, ($s0) -/* 84EBC 800EBA0C 3C013FE6 */ lui $at, 0x3fe6 -/* 84EC0 800EBA10 34216666 */ ori $at, $at, 0x6666 -/* 84EC4 800EBA14 44810000 */ mtc1 $at, $f0 -/* 84EC8 800EBA18 34630300 */ ori $v1, $v1, 0x300 -/* 84ECC 800EBA1C AE00001C */ sw $zero, 0x1c($s0) -/* 84ED0 800EBA20 00431025 */ or $v0, $v0, $v1 -/* 84ED4 800EBA24 AE020000 */ sw $v0, ($s0) -/* 84ED8 800EBA28 E6000014 */ swc1 $f0, 0x14($s0) -/* 84EDC 800EBA2C 8FBF0014 */ lw $ra, 0x14($sp) -/* 84EE0 800EBA30 8FB00010 */ lw $s0, 0x10($sp) -/* 84EE4 800EBA34 03E00008 */ jr $ra -/* 84EE8 800EBA38 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/partners/partner_walking_follow_player.s b/ver/us/asm/nonmatchings/world/partners/partner_walking_follow_player.s index 836780d573..bebe1ee4db 100644 --- a/ver/us/asm/nonmatchings/world/partners/partner_walking_follow_player.s +++ b/ver/us/asm/nonmatchings/world/partners/partner_walking_follow_player.s @@ -52,8 +52,8 @@ glabel partner_walking_follow_player /* 851C0 800EBD10 0803B005 */ j .L800EC014 /* 851C4 800EBD14 AE230028 */ sw $v1, 0x28($s1) .L800EBD18_851C8: -/* 851C8 800EBD18 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 851CC 800EBD1C 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 851C8 800EBD18 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 851CC 800EBD1C 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 851D0 800EBD20 C62C0038 */ lwc1 $f12, 0x38($s1) /* 851D4 800EBD24 C62E0040 */ lwc1 $f14, 0x40($s1) /* 851D8 800EBD28 3C028011 */ lui $v0, %hi(D_8010CFBC) @@ -129,8 +129,8 @@ glabel partner_walking_follow_player .L800EBE38: /* 852E8 800EBE38 3C128011 */ lui $s2, %hi(D_8010CFBC) /* 852EC 800EBE3C 2652CFBC */ addiu $s2, $s2, %lo(D_8010CFBC) -/* 852F0 800EBE40 3C148011 */ lui $s4, %hi(PlayerMoveHistory) -/* 852F4 800EBE44 2694CD38 */ addiu $s4, $s4, %lo(PlayerMoveHistory) +/* 852F0 800EBE40 3C148011 */ lui $s4, %hi(gPlayerMoveHistory) +/* 852F4 800EBE44 2694CD38 */ addiu $s4, $s4, %lo(gPlayerMoveHistory) .L800EBE48: /* 852F8 800EBE48 C7AC0028 */ lwc1 $f12, 0x28($sp) /* 852FC 800EBE4C C7AE0030 */ lwc1 $f14, 0x30($sp) @@ -211,8 +211,8 @@ glabel partner_walking_follow_player /* 85420 800EBF70 E620000C */ swc1 $f0, 0xc($s1) .L800EBF74: /* 85424 800EBF74 8E430000 */ lw $v1, ($s2) -/* 85428 800EBF78 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 8542C 800EBF7C 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 85428 800EBF78 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 8542C 800EBF7C 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 85430 800EBF80 1062FF55 */ beq $v1, $v0, .L800EBCD8 /* 85434 800EBF84 24620001 */ addiu $v0, $v1, 1 /* 85438 800EBF88 AE420000 */ sw $v0, ($s2) @@ -309,8 +309,8 @@ glabel partner_walking_follow_player /* 8558C 800EC0DC AC600000 */ sw $zero, ($v1) .L800EC0E0: /* 85590 800EC0E0 8C620000 */ lw $v0, ($v1) -/* 85594 800EC0E4 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 85598 800EC0E8 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 85594 800EC0E4 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 85598 800EC0E8 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 8559C 800EC0EC C62C0038 */ lwc1 $f12, 0x38($s1) /* 855A0 800EC0F0 C62E0040 */ lwc1 $f14, 0x40($s1) /* 855A4 800EC0F4 00021100 */ sll $v0, $v0, 4 @@ -340,8 +340,8 @@ glabel partner_walking_follow_player /* 85600 800EC150 3C058011 */ lui $a1, %hi(D_8010CFBC) /* 85604 800EC154 24A5CFBC */ addiu $a1, $a1, %lo(D_8010CFBC) /* 85608 800EC158 8CA40000 */ lw $a0, ($a1) -/* 8560C 800EC15C 3C038011 */ lui $v1, %hi(PlayerMoveHistoryIndex) -/* 85610 800EC160 8C63CFB8 */ lw $v1, %lo(PlayerMoveHistoryIndex)($v1) +/* 8560C 800EC15C 3C038011 */ lui $v1, %hi(gPlayerMoveHistoryIndex) +/* 85610 800EC160 8C63CFB8 */ lw $v1, %lo(gPlayerMoveHistoryIndex)($v1) /* 85614 800EC164 14830016 */ bne $a0, $v1, .L800EC1C0 /* 85618 800EC168 0040902D */ daddu $s2, $v0, $zero /* 8561C 800EC16C 2642FFFE */ addiu $v0, $s2, -2 @@ -373,8 +373,8 @@ glabel partner_walking_follow_player /* 85680 800EC1D0 ACA00000 */ sw $zero, ($a1) .L800EC1D4: /* 85684 800EC1D4 8CA20000 */ lw $v0, ($a1) -/* 85688 800EC1D8 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 8568C 800EC1DC 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 85688 800EC1D8 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 8568C 800EC1DC 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 85690 800EC1E0 00021100 */ sll $v0, $v0, 4 /* 85694 800EC1E4 00438021 */ addu $s0, $v0, $v1 /* 85698 800EC1E8 C6000004 */ lwc1 $f0, 4($s0) @@ -716,8 +716,8 @@ glabel partner_walking_follow_player /* 85BA4 800EC6F4 0803B4B9 */ j .L800ED2E4_86794 /* 85BA8 800EC6F8 00000000 */ nop .L800EC6FC_85BAC: -/* 85BAC 800EC6FC 3C038011 */ lui $v1, %hi(PlayerMoveHistory) -/* 85BB0 800EC700 2463CD38 */ addiu $v1, $v1, %lo(PlayerMoveHistory) +/* 85BAC 800EC6FC 3C038011 */ lui $v1, %hi(gPlayerMoveHistory) +/* 85BB0 800EC700 2463CD38 */ addiu $v1, $v1, %lo(gPlayerMoveHistory) /* 85BB4 800EC704 C62C0038 */ lwc1 $f12, 0x38($s1) /* 85BB8 800EC708 C62E0040 */ lwc1 $f14, 0x40($s1) /* 85BBC 800EC70C 8E660028 */ lw $a2, 0x28($s3) @@ -1007,8 +1007,8 @@ glabel partner_walking_follow_player /* 85FF8 800ECB48 4481B000 */ mtc1 $at, $f22 /* 85FFC 800ECB4C 3C128011 */ lui $s2, %hi(D_8010CFBC) /* 86000 800ECB50 2652CFBC */ addiu $s2, $s2, %lo(D_8010CFBC) -/* 86004 800ECB54 3C148011 */ lui $s4, %hi(PlayerMoveHistory) -/* 86008 800ECB58 2694CD38 */ addiu $s4, $s4, %lo(PlayerMoveHistory) +/* 86004 800ECB54 3C148011 */ lui $s4, %hi(gPlayerMoveHistory) +/* 86008 800ECB58 2694CD38 */ addiu $s4, $s4, %lo(gPlayerMoveHistory) .L800ECB5C: /* 8600C 800ECB5C 82020000 */ lb $v0, ($s0) /* 86010 800ECB60 14400028 */ bnez $v0, .L800ECC04 @@ -1033,8 +1033,8 @@ glabel partner_walking_follow_player /* 8605C 800ECBAC 45010012 */ bc1t .L800ECBF8 /* 86060 800ECBB0 00000000 */ nop /* 86064 800ECBB4 8E430000 */ lw $v1, ($s2) -/* 86068 800ECBB8 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 8606C 800ECBBC 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 86068 800ECBB8 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 8606C 800ECBBC 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 86070 800ECBC0 1062000D */ beq $v1, $v0, .L800ECBF8 /* 86074 800ECBC4 24620001 */ addiu $v0, $v1, 1 /* 86078 800ECBC8 AE420000 */ sw $v0, ($s2) @@ -1059,8 +1059,8 @@ glabel partner_walking_follow_player /* 860B8 800ECC08 4481B000 */ mtc1 $at, $f22 /* 860BC 800ECC0C 3C128011 */ lui $s2, %hi(D_8010CFBC) /* 860C0 800ECC10 2652CFBC */ addiu $s2, $s2, %lo(D_8010CFBC) -/* 860C4 800ECC14 3C148011 */ lui $s4, %hi(PlayerMoveHistory) -/* 860C8 800ECC18 2694CD38 */ addiu $s4, $s4, %lo(PlayerMoveHistory) +/* 860C4 800ECC14 3C148011 */ lui $s4, %hi(gPlayerMoveHistory) +/* 860C8 800ECC18 2694CD38 */ addiu $s4, $s4, %lo(gPlayerMoveHistory) .L800ECC1C: /* 860CC 800ECC1C 82020000 */ lb $v0, ($s0) /* 860D0 800ECC20 104001AE */ beqz $v0, .L800ED2DC @@ -1085,8 +1085,8 @@ glabel partner_walking_follow_player /* 8611C 800ECC6C 4501019B */ bc1t .L800ED2DC /* 86120 800ECC70 24020001 */ addiu $v0, $zero, 1 /* 86124 800ECC74 8E430000 */ lw $v1, ($s2) -/* 86128 800ECC78 3C028011 */ lui $v0, %hi(PlayerMoveHistoryIndex) -/* 8612C 800ECC7C 8C42CFB8 */ lw $v0, %lo(PlayerMoveHistoryIndex)($v0) +/* 86128 800ECC78 3C028011 */ lui $v0, %hi(gPlayerMoveHistoryIndex) +/* 8612C 800ECC7C 8C42CFB8 */ lw $v0, %lo(gPlayerMoveHistoryIndex)($v0) /* 86130 800ECC80 1062000D */ beq $v1, $v0, .L800ECCB8 /* 86134 800ECC84 24620001 */ addiu $v0, $v1, 1 /* 86138 800ECC88 AE420000 */ sw $v0, ($s2) diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index c01958ddee..8977739733 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -770,7 +770,8 @@ segments: subsegments: - [0x102610, c, entity/SaveBlock] - [0x102C80, c, entity/Switch] - - [0x104730, c, 104730] + - [0x103CD0, c, entity/103CD0] + - [0x104730, c, entity/104730] - [0x104940, c, entity/Block] - [0x105700, c, entity/ItemBlock] - [0x105F90, c, entity/HeartBlock] @@ -786,7 +787,7 @@ segments: - [0x10AAF0, data] #- [0x10AB70, i4, shadow/10AB70, 32, 32] #- [0x10AD70, i4, shadow/10AD70, 32, 32] - - [0x10AF70, .data, 104730] + - [0x10AF70, .data, entity/104730] - [0x10B610, data] - [0x10C880] - type: code diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index ee6e242e1a..9a7bb3883e 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -2240,9 +2240,9 @@ wPartnerMoveSpeed = 0x800F8030; // type:data rom:0x914E0 D_800F8034 = 0x800F8034; // type:data rom:0x914E4 D_800F803A = 0x800F803A; // type:data rom:0x914EA wPartners = 0x800F803C; // type:data rom:0x914EC size:0x300 -SavedPartnerPosX = 0x800F833C; // type:data rom:0x917EC -SavedPartnerPosY = 0x800F8340; // type:data rom:0x917F0 -SavedPartnerPosZ = 0x800F8344; // type:data rom:0x917F4 +wSavedPartnerPosX = 0x800F833C; // type:data rom:0x917EC +wSavedPartnerPosY = 0x800F8340; // type:data rom:0x917F0 +wSavedPartnerPosZ = 0x800F8344; // type:data rom:0x917F4 gPartnerAnimations = 0x800F8348; // rom:0x917F8 size:0x1B0 D_800B6590 = 0x800B6590; // type:data rom:0x91990 D_800F84F8 = 0x800F84F8; // type:data rom:0x919A8 @@ -2292,9 +2292,6 @@ D_8010C95C = 0x8010C95C; // type:data rom:0xA5E0C D_8010C960 = 0x8010C960; // type:data rom:0xA5E10 D_8010C964 = 0x8010C964; // type:data rom:0xA5E14 D_8010C968 = 0x8010C968; // type:data rom:0xA5E18 -D_8010C969 = 0x8010C969; // type:data rom:0xA5E19 -D_8010C96A = 0x8010C96A; // type:data rom:0xA5E1A -D_8010C96B = 0x8010C96B; // type:data rom:0xA5E1B D_8010C96C = 0x8010C96C; // type:data rom:0xA5E1C D_8010C970 = 0x8010C970; // type:data rom:0xA5E20 D_8010C974 = 0x8010C974; // type:data rom:0xA5E24 @@ -19746,7 +19743,6 @@ D_8010C95C = 0x8010C95C; // type:data D_8010C960 = 0x8010C960; // type:data D_8010C964 = 0x8010C964; // type:data D_8010C968 = 0x8010C968; // type:data -D_8010C96B = 0x8010C96B; // type:data D_8010C96C = 0x8010C96C; // type:data D_8010C970 = 0x8010C970; // type:data D_8010C974 = 0x8010C974; // type:data @@ -19771,8 +19767,8 @@ D_8010CD12 = 0x8010CD12; // type:data D_8010CD20 = 0x8010CD20; // type:data D_8010CD30 = 0x8010CD30; // type:data D_8010CD34 = 0x8010CD34; // type:data -PlayerMoveHistory = 0x8010CD38; // type:data -PlayerMoveHistoryIndex = 0x8010CFB8; // type:data +gPlayerMoveHistory = 0x8010CD38; // type:data +gPlayerMoveHistoryIndex = 0x8010CFB8; // type:data D_8010CFBC = 0x8010CFBC; // type:data wPartnerTetherDistance = 0x8010CFC0; // type:data D_8010CFC4 = 0x8010CFC4; // type:data