diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..0daa1447
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,40 @@
+# These settings are for any web project
+
+# Handle line endings automatically for files detected as text
+# and leave all files detected as binary untouched.
+* text=auto
+
+# Force the following filetypes to have unix eols, so Windows does not break them
+*.* text eol=lf
+
+# Windows forced line-endings
+/.idea/* text eol=crlf
+*.bat text eol=crlf
+
+#
+## These files are binary and should be left untouched
+#
+
+# (binary is a macro for -text -diff)
+*.png binary
+*.jpg binary
+*.jpeg binary
+*.gif binary
+*.ico binary
+*.mov binary
+*.mp4 binary
+*.mp3 binary
+*.flv binary
+*.fla binary
+*.swf binary
+*.gz binary
+*.zip binary
+*.7z binary
+*.ttf binary
+*.eot binary
+*.woff binary
+*.pyc binary
+*.pdf binary
+*.ez binary
+*.bz2 binary
+*.swp binary
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..44003a74
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,66 @@
+# ignore all rom files
+baseroms/*
+*.z64
+*.n64
+*.v64
+
+#compiled or ripped asm
+asm/*
+asm
+build/*
+build/
+
+#binaries ripped from the ROMs
+assets/
+assets/*
+bin/
+bin/*
+
+
+# This folder will hold modified asset binaries
+# these assets will override the original game
+# assets in the bin/ at compile time.
+mod/
+mod/*
+
+
+#compiled object files
+*.slo
+*.lo
+*.o
+*.obj
+
+#Precompiled Headers
+*.gch
+*.pch
+
+#compiled dynamic libraries
+*.so
+*.dylib
+*.dll
+
+#static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+#misc
+__pycache__/
+*__pycache__/
+expected/
+.*/
+*.ld
+*/*.ld
+*.map
+*/*.map
+*auto.txt
+*_auto.*.txt
+*.*auto.txt
+*/.splat_cache
+.splat_cache
+.splat_cache*
+diff_settings.py
+symbol_addrs.us.txt
+ctx.c
+!tools/build
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..d1145cb6
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "tools/n64splat"]
+ path = tools/n64splat
+ url = https://github.com/ethteck/splat.git
+[submodule "tools/asm-processor"]
+ path = tools/asm-processor
+ url = https://github.com/simonlindholm/asm-processor.git
diff --git a/Build Docker Image.bat b/Build Docker Image.bat
new file mode 100644
index 00000000..699075cd
--- /dev/null
+++ b/Build Docker Image.bat
@@ -0,0 +1,3 @@
+@echo off
+docker build . -t donkeykong64
+pause
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..52896518
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,24 @@
+FROM ubuntu:21.04 as build
+
+RUN apt-get update
+
+RUN apt-get install -y \
+ binutils-mips-linux-gnu \
+ build-essential \
+ gcc-mips-linux-gnu \
+ less \
+ libglib2.0 \
+ python3 \
+ python3-pip \
+ unzip \
+ wget \
+ libssl-dev
+
+RUN python3 -m pip install \
+ capstone pylibyaml pyyaml pycparser \
+ colorama ansiwrap watchdog python-Levenshtein cxxfilt \
+ python-ranges \
+ pypng anybadge
+
+RUN mkdir /donkeykong64
+WORKDIR /donkeykong64
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..0e259d42
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+ HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+ i. the right to reproduce, adapt, distribute, perform, display,
+ communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+ likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+ subject to the limitations in paragraph 4(a), below;
+ v. rights protecting the extraction, dissemination, use and reuse of data
+ in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+ European Parliament and of the Council of 11 March 1996 on the legal
+ protection of databases, and under any national implementation
+ thereof, including any amended or successor version of such
+ directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+ world based on applicable law or treaty, and any national
+ implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+ surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+ warranties of any kind concerning the Work, express, implied,
+ statutory or otherwise, including without limitation warranties of
+ title, merchantability, fitness for a particular purpose, non
+ infringement, or the absence of latent or other defects, accuracy, or
+ the present or absence of errors, whether or not discoverable, all to
+ the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+ that may apply to the Work or any use thereof, including without
+ limitation any person's Copyright and Related Rights in the Work.
+ Further, Affirmer disclaims responsibility for obtaining any necessary
+ consents, permissions or other rights required for any use of the
+ Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+ party to this document and has no duty or obligation with respect to
+ this CC0 or use of the Work.
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..822fd418
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,471 @@
+### Configuration ###
+BASENAME = donkeykong64
+VERSION ?= us
+
+### Tools ###
+
+# System tools
+MKDIR := mkdir
+CP := cp
+CD := cd
+RM := rm
+CAT := cat
+DIFF := diff
+GUNZIP := gunzip
+
+# Build tools
+CROSS = mips-linux-gnu-
+CC = ido/ido5.3_recomp/cc #!!! CORRECT COMPILER TO BE DETERMINED
+CPP = cpp
+GCC = $(CROSS)gcc
+AS = $(CROSS)as
+LD = $(CROSS)ld
+OBJDUMP = $(CROSS)objdump
+OBJCOPY = $(CROSS)objcopy
+PYTHON = python3
+GREP := grep -rl
+SPLAT = $(PYTHON) tools/n64splat/split.py
+PRINT := printf
+ASM_PROCESSOR_DIR := tools/asm-processor
+GZIP_DIR := tools/gzip-1.2.4
+
+GZIP := $(GZIP_DIR)/gzip
+ASM_PROCESSOR := $(PYTHON) $(ASM_PROCESSOR_DIR)/asm_processor.py
+SPLAT_INPUTS := $(PYTHON) tools/splat_inputs.py
+PROGRESS := $(PYTHON) tools/progress.py
+PROGRESS_READ := $(PYTHON) tools/progress_read.py
+PNG_TO_INCC := $(PYTHON) tools/build/img/build.py
+
+### Files and Directories ###
+
+# Inputs
+OVERLAYS := global_asm menu multiplayer minecart race bonus water arcade jetpac boss
+
+# Creates a list of all the source files for the given overlay (e.g. BGS_C_SRCS)
+# Appends that list to OVERLAY_C_FILES
+define get_overlay_sources
+ $(1)_C_SRCS := $(filter $(SRC_ROOT)/$(1)/%,$(ALL_C_SRCS))
+ $(1)_ASM_SRCS := $(filter $(ASM_ROOT)/$(1)/%,$(ALL_ASM_SRCS))
+ $(1)_BINS := $(filter $(BIN_ROOT)/$(1)/%,$(ALL_BINS))
+ $(1)_IMGS := $(filter $(BIN_ROOT)/$(1)/%,$(ALL_IMGS))
+ OVERLAY_C_SRCS += $$($(1)_C_SRCS)
+ OVERLAY_ASM_SRCS += $$($(1)_ASM_SRCS)
+ OVERLAY_BINS += $$($(1)_BINS)
+ OVERLAY_IMGS += $$($(1)_IMGS)
+ # Overlay inputs
+ $(1)_NEW_FILES := $$(filter $(BIN_ROOT)/$(1)/%, $(NEW_BINS)) $$(filter $(BIN_ROOT)/$(1)/%, $(NEW_IMGS)) $$(filter $(SRC_ROOT)/$(1)/%, $(NEW_C_SRCS)) $$(filter $(ASM_ROOT)/$(1)/%, $(NEW_ASM_SRCS))
+ OVERLAY_NEW_FILES += $$($(1)_NEW_FILES)
+endef
+
+# Source files
+SRC_ROOT := src
+ASM_ROOT := asm
+BIN_ROOT := bin
+SUBYAML := subyaml
+NONMATCHINGS := nonmatchings
+NONMATCHING_DIR := $(ASM_ROOT)/$(NONMATCHINGS)
+BUILD_ROOT := build
+BUILD_DIR := $(BUILD_ROOT)/$(VERSION)
+ALL_C_SRCS := $(shell find $(SRC_ROOT) -type f -iname '*.c' 2> /dev/null)
+ALL_ASM_SRCS := $(filter-out $(ASM_ROOT)/$(NONMATCHINGS), $(shell find $(ASM_ROOT) -name $(NONMATCHINGS) -prune -o -iname '*.s' 2> /dev/null))
+ALL_BINS := $(shell find $(BIN_ROOT) -type f -iname '*.bin' 2> /dev/null)
+ALL_IMGS := $(shell find $(BIN_ROOT) -type f -iname '*.png' 2> /dev/null)
+# Files referenced in the splat files
+YAML_CALL := $(SPLAT_INPUTS) $(BASENAME).$(VERSION).yaml $(addprefix $(SUBYAML)/, $(addsuffix .$(VERSION).yaml, $(OVERLAYS)))
+YAML_SRCS := $(shell $(SPLAT_INPUTS) $(BASENAME).$(VERSION).yaml $(addprefix $(SUBYAML)/, $(addsuffix .$(VERSION).yaml, $(OVERLAYS))))
+YAML_C_SRCS := $(filter %.c, $(YAML_SRCS))
+YAML_ASM_SRCS := $(filter %.s, $(YAML_SRCS))
+YAML_BINS := $(filter %.bin, $(YAML_SRCS))
+YAML_IMGS := $(filter %.png, $(YAML_SRCS))
+# Files that need to be extracted
+NEW_C_SRCS := $(filter-out $(ALL_C_SRCS), $(YAML_C_SRCS))
+NEW_ASM_SRCS := $(filter-out $(ALL_ASM_SRCS), $(YAML_ASM_SRCS))
+NEW_BINS := $(filter-out $(ALL_BINS), $(YAML_BINS))
+NEW_IMGS := $(filter-out $(ALL_IMGS), $(YAML_IMGS))
+NEW_FILES := $(NEW_C_SRCS) $(NEW_ASM_SRCS) $(NEW_BINS) $(NEW_IMGS)
+$(foreach overlay,$(OVERLAYS),$(eval $(call get_overlay_sources,$(overlay))))
+# Files for the rom itself
+MAIN_C_SRCS := $(filter-out $(OVERLAY_C_SRCS),$(ALL_C_SRCS))
+MAIN_ASM_SRCS := $(filter-out $(OVERLAY_ASM_SRCS),$(ALL_ASM_SRCS))
+MAIN_BINS := $(filter-out $(OVERLAY_BINS),$(ALL_BINS))
+MAIN_IMGS := $(filter-out $(OVERLAY_IMGS),$(ALL_IMGS))
+# Files that need to be extracted for the rom itself
+MAIN_NEW_FILES := $(filter-out $(OVERLAY_NEW_FILES), $(NEW_FILES))
+# Any source files that have GLOBAL_ASM in them or do not exist before splitting
+GLOBAL_ASM_C_SRCS := $(shell $(GREP) GLOBAL_ASM $(SRC_ROOT) arg2)
+define print2
+ @$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n"
+endef
+
+define print3
+ @$(PRINT) "$(RED)$(1) $(BLUE)$(2)$(NO_COL)\n"
+endef
+
+### Flags ###
+
+# Build tool flags
+CFLAGS := -c -Wab,-r4300_mul -non_shared -G 0 -Xfullwarn -Xcpluscomm -signed $(OPT_FLAGS) $(MIPSBIT) -D_FINALROM -DF3DEX2_GBI
+CFLAGS += -woff 649,838,807
+CPPFLAGS := -D_FINALROM -DN_MICRO -DF3DEX_GBI_2x
+INCLUDE_CFLAGS := -I . -I include -I include/2.0L -I include/2.0L/PR
+OPT_FLAGS := -O2
+MIPSBIT := -mips2
+ASFLAGS := -EB -mtune=vr4300 -march=vr4300 -mabi=32 -I include
+GCC_ASFLAGS := -c -x assembler-with-cpp -mabi=32 -ffreestanding -mtune=vr4300 -march=vr4300 -mfix4300 -G 0 -O -mno-shared -fno-PIC -mno-abicalls
+LDFLAGS_COMMON := --no-check-sections --accept-unknown-input-arch -T symbol_addrs.dk64_boot.$(VERSION).txt
+LDFLAGS := -T $(LD_SCRIPT) -T symbol_addrs.rom.$(VERSION).txt -Map $(ELF:.elf=.map) --no-check-sections --accept-unknown-input-arch
+BINOFLAGS := -I binary -O elf32-big
+
+### Rules ###
+
+# Default target, all
+all: verify
+
+# Shows progress for all overlays, boot, and total
+progress: $(OVERLAY_PROG_CSVS) $(MAIN_PROG_CSV) $(TOTAL_PROG_CSV)
+ @$(foreach overlay,$(OVERLAYS),$(PROGRESS_READ) progress/progress.$(overlay).csv $(VERSION) $(overlay) &&) \
+ $(PROGRESS_READ) $(MAIN_PROG_CSV) $(VERSION) dk64_boot
+ @$(PROGRESS_READ) $(TOTAL_PROG_CSV) $(VERSION) total
+
+# Shows progress for a single overlay (e.g. progress-SM)
+$(addprefix progress-,$(OVERLAYS)) : progress-% : progress/progress.%.csv
+ @$(PROGRESS_READ) $< $(VERSION) $*
+
+# Verify that the roms match, also sets up diff_settings
+verify: $(Z64) | $(ALL_DIRS)
+ @$(DIFF) $(BASEROM) $(Z64) > /dev/null && \
+ $(PRINT) "$(YELLOW) _\n//\\ \nV \\ \n \\ \\_\n \\,'.'-.\n |\\ '. '.\n ( \\ '. '-. _,.-:\\ \n \\ \\ '. '-._ __..--' ,-';/\n \\ '. '-. '-..___..---' _.--' ,'/\n '. '. '-._ __..--' ,' /\n '. '-_ ''--..'' _.-' ,'\n '-_ '-.___ __,--' ,'\n '-.__ '----\"\"\" __.-'\n '--..____..--'\n$(BLUE)$(BASENAME).$(VERSION).z64$(NO_COL): $(GREEN)OK$(NO_COL)\n" || \
+ $(PRINT) "$(BLUE)$(BASEROM) $(RED)differs$(NO_COL)\n"
+ @$(PRINT) "def apply(config, args):\n" > diff_settings.py
+ @$(PRINT) "\tconfig[\"baseimg\"] = \"$(BASEROM)\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"myimg\"] = \"$(Z64)\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"mapfile\"] = \"$(Z64:.z64=.map)\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"source_directories\"] = ['$(SRC_ROOT)', 'include']\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"makeflags\"] = ['-s']\n" >> diff_settings.py
+
+# Musical note print for individual overlays
+# Need to figure out how to print this only when building a single overlay
+# $(YELLOW) ╒════╕\n │ │\n _│ _│\n └─┘ └─┘\n
+
+# Verify that any given overlay matches, also sets up diff_settings
+
+verify-%: $(BUILD_DIR)/%.rzip.bin $(BIN_ROOT)/%.$(VERSION).rzip.bin $(BUILD_DIR)/%.full progress/progress_%.svg
+ @$(DIFF) $< $(BIN_ROOT)/$*.$(VERSION).rzip.bin > /dev/null && \
+ $(PRINT) "$(BLUE)%-10s$(NO_COL): $(GREEN)OK$(NO_COL)\n" "$*" || \
+ $(PRINT) "$(BLUE)$* $(RED)differs$(NO_COL)\n"
+ @$(PRINT) "def apply(config, args):\n" > diff_settings.py
+ @$(PRINT) "\tconfig[\"baseimg\"] = \"$(BUILD_DIR)/$*.$(VERSION).bin\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"myimg\"] = \"$(BUILD_DIR)/$*.full\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"mapfile\"] = \"$(BUILD_DIR)/$*.map\"\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"source_directories\"] = ['$(SRC_ROOT)/$*', 'include']\n" >> diff_settings.py
+ @$(PRINT) "\tconfig[\"makeflags\"] = ['TARGET=$*','-s']\n" >> diff_settings.py
+
+$(OVERLAY_PROG_SVGS) : progress/progress_%.svg: progress/progress.%.csv
+ $(call print1,Creating progress svg for:,$*)
+ @$(PROGRESS_READ) $< $(VERSION) $*
+
+$(OVERLAY_PROG_CSVS) : progress/progress.%.csv: $(BUILD_DIR)/%.elf
+ $(call print1,Calculating progress for:,$*)
+ @$(PROGRESS) . $(BUILD_DIR)/$*.elf .code --version $(VERSION) --subcode $* > $@
+
+$(MAIN_PROG_SVG): $(MAIN_PROG_CSV)
+ $(call print1,Creating progress svg for:,boot)
+ @$(PROGRESS_READ) $< $(VERSION) dk64_boot
+
+$(MAIN_PROG_CSV): $(ELF)
+ $(call print1,Calculating progress for:,boot)
+ @$(PROGRESS) . $< .dk64_boot --version $(VERSION) --subcode dk64_boot > $@
+
+$(TOTAL_PROG_SVG): $(TOTAL_PROG_CSV)
+ $(call print0,Creating total progress svg)
+ @$(PROGRESS_READ) $< $(VERSION) total
+
+$(TOTAL_PROG_CSV): $(OVERLAY_PROG_CSVS) $(MAIN_PROG_CSV)
+ $(call print0,Calculating total progress)
+ @cat $^ > $@
+
+# Verify that each overlay matches
+verify-each: $(addprefix verify-,$(OVERLAYS))
+
+# per-overlay rules
+ # .o -> .elf (overlay)
+define global_asm_elf_rule
+ # .o -> .elf (overlay)
+ $(BUILD_DIR)/$(1).elf : $$($(1)_ALL_OBJS) $(1).ld
+ $(call print1,Linking elf:,$$@)
+ $(LD) -T $(1).ld -Map $(BUILD_DIR)/$(1).map $$(LDFLAGS_COMMON) -T symbol_addrs.$(1).$(VERSION).txt -T undefined_syms_auto.$(1).$(VERSION).txt -T undefined_funcs_auto.$(1).$(VERSION).txt -o $$@
+endef
+
+define overlay_elf_rule
+ # .o -> .elf (overlay)
+ $(BUILD_DIR)/$(1).elf : $$($(1)_ALL_OBJS) $(1).ld
+ $(call print1,Linking elf:,$$@)
+ $(LD) -T $(1).ld -Map $(BUILD_DIR)/$(1).map $$(LDFLAGS_COMMON) -T symbol_addrs.$(1).$(VERSION).txt -T symbol_addrs.global_asm.$(VERSION).txt -T undefined_syms_auto.$(1).$(VERSION).txt -T undefined_funcs_auto.$(1).$(VERSION).txt -o $$@
+endef
+
+define overlay_rules
+ # split overlay
+ $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP : $(SUBYAML)/$(1).$(VERSION).yaml $(BUILD_DIR)/$(1).$(VERSION).bin $(SYMBOL_ADDRS)
+ $(call print1,Splitting bin:,$$<)
+ @$(SPLAT) --target $(BUILD_DIR)/$(1).$(VERSION).bin $(SUBYAML)/$(1).$(VERSION).yaml --basedir . > /dev/null
+ @touch $$@
+ @touch $(1).ld
+ # Dummy target to make sure extraction happens before compilation, mainly for extracted asm
+ $$($(1)_C_SRCS) $$($(1)_ASM_SRCS) $$($(1)_BINS) : | $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP
+ @:
+ # Dummy target to make sure extraction happens before processing extracted files and linking
+ $$($(1)_NEW_FILES) $(1).ld: $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP
+ @:
+endef
+$(foreach overlay,$(OVERLAYS),$(eval $(call overlay_rules,$(overlay))))
+$(foreach overlay,$(filter-out global_asm, $(OVERLAYS)),$(eval $(call overlay_elf_rule,$(overlay))))
+$(eval $(call global_asm_elf_rule,global_asm))
+
+
+# mkdir
+$(ALL_DIRS) :
+ $(call print1,Making folder:,$@)
+ @$(MKDIR) -p $@
+
+# .s -> .o (assemble with gcc for preprocessor support)
+$(BUILD_DIR)/%.s.o: %.s | $(ASM_BUILD_DIRS)
+ $(call print2,Assembling:,$<,$@)
+ @$(GCC) $(GCC_ASFLAGS) $(INCLUDE_CFLAGS) -o $@ $<
+
+# .png -> .png.bin
+$(IMG_BINS) : $(BUILD_DIR)/%.png.bin : %.png | $(IMG_BUILD_DIRS)
+ $(call print2,Converting image:,$<,$@)
+ @tools/build/img/build.py auto $< $@
+
+# .png.bin -> .png.o
+$(IMG_OBJS) : $(BUILD_DIR)/%.png.o : $(BUILD_DIR)/%.png.bin
+ $(call print2,Objcopying:,$<,$@)
+ @$(OBJCOPY) $(BINOFLAGS) $< $@
+
+# .bin -> .o
+$(BIN_OBJS) : $(BUILD_DIR)/%.bin.o : %.bin | $(BIN_BUILD_DIRS)
+ $(call print2,Objcopying:,$<,$@)
+ @$(OBJCOPY) $(BINOFLAGS) $< $@
+
+# .bin -> .o (overlay)
+$(OVERLAY_RZIP_OBJS) : $(BUILD_DIR)/$(BIN_ROOT)/%.$(VERSION).rzip.bin.o : $(BUILD_DIR)/%.rzip.bin
+ $(call print2,Objcopying:,$<,$@)
+ @$(OBJCOPY) $(BINOFLAGS) $< $@
+
+# .c -> .o
+$(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS)
+ $(call print2,Compiling:,$<,$@)
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) -o $@ $<
+
+# .c -> .o (mips3)
+$(MIPS3_OBJS) : $(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS)
+ $(call print2,Compiling:,$<,$@)
+ @$(CC) -c -32 $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(LOOP_UNROLL) $(MIPSBIT) -o $@ $<
+ @tools/set_o32abi_bit.py $@
+
+# .c -> .o with asm processor
+$(GLOBAL_ASM_C_OBJS) : $(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS)
+ $(call print2,Compiling (with ASM Processor):,$<,$@)
+ @$(ASM_PROCESSOR) $(OPT_FLAGS) $< > $(BUILD_DIR)/$<
+ @$(CC) -32 $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) -o $@ $(BUILD_DIR)/$<
+ @$(ASM_PROCESSOR) $(OPT_FLAGS) $< --post-process $@ \
+ --assembler "$(AS) $(ASFLAGS)" --asm-prelude $(ASM_PROCESSOR_DIR)/prelude.s
+
+# Split baserom
+$(BUILD_DIR)/SPLAT_TIMESTAMP: $(BASENAME).$(VERSION).yaml $(SYMBOL_ADDRS) | $(BUILD_DIR)
+ $(call print1,Splitting rom:,$<)
+ @touch $@
+ @$(SPLAT) $(BASENAME).$(VERSION).yaml
+ @touch $(LD_SCRIPT)
+# Dummy target to make the LD script and overlay rzips depend on splat being run
+# without causing it to be rerun once for every overlay
+# Bin files are also dependent on the splat timestamp since they get overwritten on resplit
+$(MAIN_NEW_FILES) $(LD_SCRIPT) $(MAIN_BINS) : $(BUILD_DIR)/SPLAT_TIMESTAMP
+ @:
+# Dummy target to make sure extraction happens before compilation, mainly for extracted asm
+$(MAIN_C_SRCS) $(MAIN_ASM_SRCS) : | $(BUILD_DIR)/SPLAT_TIMESTAMP
+ @:
+
+# .rzip.bin -> .bin
+$(OVERLAY_BINS) : $(BUILD_DIR)/%.$(VERSION).bin : $(BIN_ROOT)/%.$(VERSION).rzip.bin | $(BUILD_DIR)
+ $(call print1,Decompressing rzip:,$<)
+ $(GUNZIP) -cf -S .rzip.bin $< > $@
+
+
+# .elf -> .code
+$(OVERLAY_CODE_BINS) : $(BUILD_DIR)/%.code : $(BUILD_DIR)/%.elf
+ $(call print2,Converting overlay code:,$<,$@)
+ @$(OBJCOPY) -O binary --only-section .code --only-section .mips3 $< $@
+
+# .elf -> .data
+$(OVERLAY_DATA_BINS) : $(BUILD_DIR)/%.data : $(BUILD_DIR)/%.elf
+ $(call print2,Converting overlay data:,$<,$@)
+ @$(OBJCOPY) -O binary --only-section .data --only-section .*_data_* $< $@
+
+# .elf -> .full
+$(BUILD_DIR)/%.full : $(BUILD_DIR)/%.elf
+ @$(OBJCOPY) -O binary $< $@
+
+# .data + .code -> .rzip.bin
+$(BUILD_DIR)/%.rzip.bin : $(BUILD_DIR)/%.code $(BUILD_DIR)/%.data $(GZIP)
+ $(call print1,Compressing overlay:,$@)
+ $(GZIP) -cnf -9 $(BUILD_DIR)/$*.code > $@
+ $(GZIP) -cnf -9 $(BUILD_DIR)/$*.data >> $@
+ truncate -s%16 $@
+
+# .o -> .elf (game)
+$(ELF): $(MAIN_ALL_OBJS) $(LD_SCRIPT) $(OVERLAY_RZIP_OBJS) $(addprefix $(BUILD_DIR)/, $(addsuffix .full, $(OVERLAYS)))
+ $(call print1,Linking elf:,$@)
+ @$(LD) $(LDFLAGS) -T undefined_syms_auto.$(VERSION).txt -o $@
+
+# .elf -> .z64
+$(Z64) : $(ELF) $(OVERLAY_PROG_SVGS) $(MAIN_PROG_SVG) $(TOTAL_PROG_SVG)
+ $(call print1,Creating z64:,$@)
+ @$(OBJCOPY) $< $@ -O binary $(OCOPYFLAGS)
+
+$(GZIP_DIR)/%: $(GZIP_DIR)/Makefile
+ $(call print1,Compiling compression tools:,$@)
+ @$(CD) $(GZIP_DIR) && $(MAKE) gzip
+
+$(GZIP_DIR)/Makefile:
+ @$(CD) $(GZIP_DIR) && ./configure
+
+# Combined symbol addresses file
+$(SYMBOL_ADDRS): $(SYMBOL_ADDR_FILES)
+ $(call print0,Combining symbol address files)
+ @$(CAT) symbol_addrs.*.$(VERSION).txt > $@
+
+# Shorthand rules for each overlay (e.g. SM)
+$(OVERLAYS): %: verify-%
+
+clean:
+ $(call print0,Cleaning build artifacts)
+ @$(RM) -rf $(BUILD_ROOT)
+ @$(RM) -rf $(BIN_ROOT)
+ @$(RM) -rf $(NONMATCHING_DIR)
+ @$(RM) -rf $(ASM_ROOT)/*.s
+ @$(RM) -rf $(addprefix $(ASM_ROOT)/,$(filter-out global_asm,$(OVERLAYS)))
+ @$(RM) -rf $(ASM_ROOT)/global_asm/*.s
+ @$(RM) -rf $(ASM_ROOT)/global_asm/os
+ @$(RM) -f undefined_syms_auto* undefined_funcs_auto*
+ @$(RM) -f *.ld
+ @$(RM) -f $(SYMBOL_ADDRS)
+
+# Per-file flag definitions
+build/us/src/dk64_boot/dk64_boot_3C00.c.o: OPT_FLAGS = -O1
+build/us/src/dk64_boot/dk64_boot_61D0.c.o: OPT_FLAGS = -O1
+build/us/src/dk64_boot/gu/%.c.o: OPT_FLAGS = -O3
+build/us/src/dk64_boot/gu/nonmatching/%.c.o: OPT_FLAGS = -O2
+build/us/src/dk64_boot/io/%.c.o: OPT_FLAGS = -O1
+build/us/src/dk64_boot/io/conteepwrite.c.o: OPT_FLAGS = -O2
+build/us/src/dk64_boot/io/contpfs.c.o: OPT_FLAGS = -O2
+build/us/src/dk64_boot/io/contpfs.c.o: MIPSISET := -mips3 -o32
+build/us/src/dk64_boot/io/motor.c.o: OPT_FLAGS = -O2
+build/us/src/dk64_boot/io/crc.c.o: OPT_FLAGS = -O2
+build/us/src/dk64_boot/libc/%.c.o: OPT_FLAGS = -O3
+build/us/src/dk64_boot/libc/ll%.o: MIPSISET := -mips3 -o32
+build/us/src/dk64_boot/libc/ll%.o: OPT_FLAGS := -O1
+build/us/src/dk64_boot/os/%.c.o: OPT_FLAGS = -O1
+
+build/us/src/global_asm/audio/%.c.o: OPT_FLAGS = -g
+
+#build/us/src/dk64_boot/gu/%.c.o: INCLUDE_CFLAGS = -I . -I include -I include/2.0L -I include/2.0L/PR
+
+# Disable implicit rules
+MAKEFLAGS += -r
+
+# Phony targets
+.PHONY: all clean verify $(OVERLAYS) progress $(addprefix progress-,$(OVERLAYS))
+
+# Set up pipefail
+SHELL = /bin/bash -e -o pipefail
+
+# Debug variable print target
+print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
diff --git a/README.md b/README.md
index bddd0a9f..44dec8e0 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,81 @@
-# dk64
+# donkey
+
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
-## Getting started
+Grab tools
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://gitlab.com/dk64_decomp/dk64.git
-git branch -M main
-git push -uf origin main
+```sh
+git submodule update --init --recursive
```
-## Integrate with your tools
+Drop in `US` as `baserom.us.z64` (sha1sum: `cf806ff2603640a748fca5026ded28802f1f4a50`)
-- [ ] [Set up project integrations](https://gitlab.com/dk64_decomp/dk64/-/settings/integrations)
+To extract and build everything
-## Collaborate with your team
+```sh
+make
+```
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
+Build a level or core code section separately (from base of repo):
-## Test and Deploy
-Use the built-in continuous integration in GitLab.
+```sh
+make
+```
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
+where the following are supported values of ``
+- `global_asm`
+- `menu`
+- `multiplayer`
+- `minecart`
+- `bonus`
+- `race`
+- `water`
+- `boss`
+- `arcade`
+- `jetpac`
-***
+## Prerequisites
-# Editing this README
+Ubuntu 18.04 or higher.
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
+```sh
+apt-get update && \
+ apt-get install -y \
+ binutils-mips-linux-gnu \
+ build-essential \
+ gcc-mips-linux-gnu \
+ less \
+ libglib2.0 \
+ python3 \
+ python3-pip \
+ unzip \
+ wget \
+ libssl-dev
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
+python3 -m pip install \
+ capstone pyyaml pylibyaml pycparser \
+ colorama ansiwrap watchdog python-Levenshtein cxxfilt \
+ python-ranges \
+ pypng anybadge
+```
-## Name
-Choose a self-explaining name for your project.
+## Other versions
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
+Drop in `kiosk`, `jp`, or `pal` as `baserom..z64` e.g. `baserom.kiosk.z64`
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+```sh
+make VERSION=kiosk
+```
diff --git a/Start Docker Image.bat b/Start Docker Image.bat
new file mode 100644
index 00000000..682304a3
--- /dev/null
+++ b/Start Docker Image.bat
@@ -0,0 +1,3 @@
+@echo off
+docker run --rm -ti -v %cd%:/donkeykong64 donkeykong64
+pause
\ No newline at end of file
diff --git a/diff.sh b/diff.sh
new file mode 100755
index 00000000..6bdf5bad
--- /dev/null
+++ b/diff.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+python3 ./tools/asm-differ/diff.py -wm3 $1
diff --git a/donkeykong64.us.yaml b/donkeykong64.us.yaml
new file mode 100644
index 00000000..1a8ae9dc
--- /dev/null
+++ b/donkeykong64.us.yaml
@@ -0,0 +1,249 @@
+options:
+ basename: donkeykong64
+ find_file_boundaries: True
+ compiler: "IDO"
+ platform: n64
+ asm_endlabels: yes
+ cpp_args:
+ - "-Iinclude"
+ - "-Iinclude/2.0L"
+ - "-D_LANGUAGE_C"
+ generated_c_preamble: |
+ #include
+ #include "functions.h"
+ #include "variables.h"
+ create_detected_syms: yes
+ undefined_syms_path: undefined_syms.us.txt
+ undefined_funcs_auto_path: undefined_funcs_auto.us.txt
+ undefined_syms_auto_path: undefined_syms_auto.us.txt
+ symbol_addrs_path: symbol_addrs.dk64_boot.us.txt
+ base_path: .
+ target_path: baserom.us.z64
+ asset_path: bin
+ build_path: build/us
+segments:
+ - name: header
+ type: header
+ start: 0x0
+ - name: boot
+ type: bin
+ start: 0x40
+ vram: 0xA4000040
+ subsegments:
+ - [0x0040, asm, boot]
+ - [0x0B70, bin, boot2]
+ - name: dk64_boot
+ type: code
+ start: 0x1000
+ vram: 0x80000400
+ dir: dk64_boot
+ subsegments:
+ - [0x1000, hasm, entry] #DONE
+ - [0x1050, c, dk64_boot_1050]
+ - [0x1630, c, dk64_boot_1630]
+ - [0x1CC0, c, dk64_boot_1CC0]
+ - [0x30E0, c, dk64_boot_30E0]
+ - [0x3390, c, dk64_boot_3390]
+ - [0x3C00, c, dk64_boot_3C00]
+ - [0x3D20, c, dk64_boot_3D20]
+ - [0x5120, hasm, os/invaldcache] #DONE
+ - [0x51D0, c, io/pirawdma] #DONE
+ - [0x52B0, c, io/pigetstat] #DONE
+ - [0x52C0, c, os/recvmesg] #DONE
+ - [0x5400, c, io/viblack] #DONE
+ - [0x5470, c, os/setthreadpri] #DONE
+ - [0x5550, c, os/createmesgqueue] #DONE
+ - [0x5580, c, os/seteventmesg] #DONE
+ - [0x55F0, c, os/createthread]
+ - [0x5740, c, os/startthread] #DONE
+ - [0x5890, c, io/vimgr]
+ - [0x5BA0, c, io/visetmode] #DONE
+ - [0x5C10, bin, dk64_boot_5C10] #??? nops ???
+ - [0x5C70, c, dk64_boot_5C70]
+ - [0x5DC0, hasm, libc/bzero] #DONE
+ - [0x5E60, hasm, os/invalicache] #DONE
+ - [0x5EE0, hasm, os/writebackdcacheall] #DONE
+ - [0x5F10, c, os/initialize]
+ - [0x61D0, c, dk64_boot_61D0] #DONE
+ - [0x6270, hasm, os/writebackdcache] #DONE
+ - [0x62F0, c, dk64_boot_62F0]
+ - [0x6360, c, io/viswapbuf] #DONE
+ - [0x63B0, c, dk64_boot_63B0]
+ - [0x6680, hasm, os/getfpccsr] #DONE
+ - [0x6690, c, gu/nonmatching/usprite]
+ - [0x66E0, c, os/stopthread] #DONE
+ - [0x67A0, c, io/dpsetstat] #DONE
+ - [0x67B0, c, io/spsetstat] #DONE
+ - [0x67C0, c, io/visetspecial] #DONE
+ - [0x6980, c, gu/translate] #DONE
+ - [0x6A20, c, gu/perspective] #DONE
+ - [0x6CB0, c, os/gettime] #DONE
+ - [0x6D40, c, os/settime] #DONE
+ - [0x6D70, c, gu/nonmatching/lookathil]
+ - [0x7560, c, gu/lookat] #DONE
+ - [0x7890, c, gu/ortho] #DONE
+ - [0x7A50, c, io/aisetnextbuf] #DONE
+ - [0x7B00, c, io/aigetlen] #DONE
+ - [0x7B10, c, os/pidma] #DONE
+ - [0x7C20, c, io/controller]
+ - [0x7F60, c, dk64_boot_7F60]
+ - [0x7FD0, c, dk64_boot_7FD0]
+ - [0x81B0, c, libc/llcvt]
+ - [0x83C0, c, os/settimer] #DONE
+ - [0x84A0, c, os/getthreadid] #DONE
+ - [0x84C0, c, io/conteeplongread] #DONE
+ - [0x8550, c, io/conteepwrite]
+ - [0x8920, c, io/conteepprobe]
+ - [0x8990, c, io/motor]
+ - [0x8D60, c, io/dpgetstat] #DONE
+ - [0x8D70, c, io/vigetcurrframebuf] #DONE
+ - [0x8DB0, c, io/vigetnextframebuf] #DONE
+ - [0x8DF0, c, io/sptaskyielded] #DONE
+ - [0x8E70, c, io/sptask] #DONE
+ - [0x9160, c, io/sptaskyield] #DONE
+ - [0x9180, c, gu/scale] #DONE
+ - [0x9220, c, gu/nonmatching/rotate]
+ - [0x9410, c, gu/mtxcatf] #DONE
+ - [0x9620, c, gu/mtxcatl] #DONE
+ - [0x96E0, c, gu/nonmatching/align]
+ - [0x98F0, c, io/piread] #DONE
+ - [0x9930, c, io/vigetmode] #DONE
+ - [0x9980, c, gu/nonmatching/position]
+ - [0x9BA0, c, os/virtualtophysical] #DONE
+ - [0x9C20, hasm, interrupt] #DONE
+ - [0x9C60, c, os/thread]
+ - [0x9CA0, hasm, os/exceptasm]
+ - [0xA5A0, c, io/vi] #DONE
+ - [0xA6E0, c, os/timerintr]
+ - [0xAAE0, c, os/getthreadpri] #DONE
+ - [0xAB00, c, io/vigetcurrcontext] #DONE
+ - [0xAB10, c, io/viswapcontext]
+ - [0xAE10, c, os/sendmesg] #DONE
+ - [0xAF60, hasm, os/getcount] #DONE
+ - [0xAF70, hasm, os/setsr] #DONE
+ - [0xAF80, hasm, os/getsr] #DONE
+ - [0xAF90, hasm, os/setfpccsr] #DONE
+ - [0xAFA0, c, io/sirawread] #DONE
+ - [0xAFF0, c, io/sirawwrite] #DONE
+ - [0xB040, hasm, os/unmaptlball] #DONE
+ - [0xB090, hasm, os/maptlbrdb] #DONE
+ - [0xB0F0, c, io/pirawread] #DONE
+ - [0xB150, c, io/pimgr]
+ - [0xB2C0, c, gu/nonmatching/mtxutil]
+ - [0xB530, c, cosf]
+ - [0xB6A0, c, sinf]
+ - [0xB860, hasm, gu/sqrt] #DONE
+ - [0xB870, c, io/ai] #DONE
+ - [0xB8A0, c, os/jammesg] #DONE
+ - [0xB9F0, c, io/pigetcmdq] #DONE
+ - [0xBA20, c, io/sirawdma]
+ - [0xBAD0, c, io/siacs]
+ - [0xBB90, c, io/conteepread]
+ - [0xBDE0, c, io/crc]
+ - [0xBF50, c, io/contramwritesafe]
+ - [0xBFD0, c, io/contramread]
+ - [0xC200, c, io/spgetstat]
+ - [0xC210, hasm, bcopy] #DONE
+ - [0xC520, c, io/spsetpc] #DONE
+ - [0xC560, c, io/sprawdma] #DONE
+ - [0xC5F0, c, io/sp] #DONE
+ - [0xC620, c, gu/normalize] #DONE
+ - [0xC6B0, c, io/piacs]
+ - [0xC770, hasm, probetlb] #DONE
+ - [0xC830, c, os/setIntMask]
+ - [0xC8D0, c, os/destroythread] #DONE
+ - [0xC9E0, hasm, os/setcompare]
+ - [0xC9F0, c, io/si]
+ - [0xCA20, c, dk64_boot_CA20]
+ - [0xCC00, c, io/devmgr]
+ - [0xD090, c, io/contramwrite]
+ - [0xD2E0, c, io/pfsisplug]
+ - [0xD620, c, io/pfsgetstatus]
+ - [0xD850, c, os/resetglobalintmask]
+ - [0xD8B0, c, io/epirawwrite]
+ - [0xDA10, c, io/epirawread]
+ - [0xDB70, c, os/setglobalintmask] #DONE
+ - [0xDBC0, c, os/yieldthread] #DONE
+ - [0xDC10, c, io/contpfs]
+ - [0xE790, c, dk64_boot_E790]
+ - name: dk64_boot_data
+ dir: dk64_boot
+ type: code
+ start: 0xE8B0
+ vram: 0x8000DCB0
+ subsegments:
+ - [0xE8B0, bin, dk64_boot_data_E8B0]
+ - [0xFB00, .data, io/vimgr]
+ - [0xFB20, bin, dk64_boot_data_FB20]
+ - [0x10CC0, .data, io/aisetnextbuf]
+ - [0x10CD0, bin, dk64_boot_data_10CD0]
+ - [0x10D30, .data, io/vi]
+ - [0x10DA0, bin, dk64_boot_data_10DA0]
+ - [0x11120, .rodata, gu/perspective]
+ - [0x11130, bin, dk64_boot_data_11130] #- [0x11130, .rodata, gu/lookathil]
+ - [0x11140, bin, dk64_boot_data_11140]
+ #- [0x11150, .rodata, gu/rotate]
+ - [0x11160, bin, dk64_boot_data_11160]
+ #- [0x11170, .rodata, gu/position]
+ - [0x11180, bin, dk64_boot_data_11180]
+ - name: global_asm.us.rzip #805fb300
+ type: bin
+ start: 0x113F0
+ subsegments:
+ - [0x113F0, bin]
+ - name: menu.us.rzip
+ type: bin
+ start: 0xCBE70
+ subsegments:
+ - [0xCBE70, bin]
+ - name: multiplayer.us.rzip
+ type: bin
+ start: 0xD4B00
+ subsegments:
+ - [0xD4B00, bin]
+ - name: minecart.us.rzip
+ type: bin
+ start: 0xD6B00
+ subsegments:
+ - [0xD6B00, bin]
+ - name: bonus.us.rzip
+ type: bin
+ start: 0xD9A40
+ subsegments:
+ - [0xD9A40, bin]
+ - name: race.us.rzip
+ type: bin
+ start: 0xDF600
+ subsegments:
+ - [0xDF600, bin]
+ - name: water.us.rzip
+ type: bin
+ start: 0xE6780
+ subsegments:
+ - [0xE6780, bin]
+ - name: boss.us.rzip
+ type: bin
+ start: 0xEA0B0
+ subsegments:
+ - [0xEA0B0, bin]
+ - name: arcade.us.rzip
+ type: bin
+ start: 0xF41A0
+ subsegments:
+ - [0xF41A0, bin]
+ - name: jetpac.us.rzip
+ type: bin
+ start: 0xFD2F0
+ subsegments:
+ - [0xFD2F0, bin]
+ - name: unkown_101A40
+ type: bin
+ start: 0x101A40
+ subsegments:
+ - [0x101A40, bin, unkown_101A40]
+ - name: assets
+ type: bin
+ start: 0x101C50
+ subsegments:
+ - [0x101C50, bin, assets]
+ - [0x2000000]
diff --git a/find_first_diff.sh b/find_first_diff.sh
new file mode 100755
index 00000000..94d9ea59
--- /dev/null
+++ b/find_first_diff.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cmp -l build/us/$1.us.bin build/us/$1.full | gawk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}'
+#diff -y <(xxd build/us/$1.us.bin) <(xxd build/us/$1.full)
\ No newline at end of file
diff --git a/ido/ido5.3_recomp/as1 b/ido/ido5.3_recomp/as1
new file mode 100755
index 00000000..17ff2aa7
Binary files /dev/null and b/ido/ido5.3_recomp/as1 differ
diff --git a/ido/ido5.3_recomp/cc b/ido/ido5.3_recomp/cc
new file mode 100755
index 00000000..6dbb85eb
Binary files /dev/null and b/ido/ido5.3_recomp/cc differ
diff --git a/ido/ido5.3_recomp/cfe b/ido/ido5.3_recomp/cfe
new file mode 100755
index 00000000..d742f7b2
Binary files /dev/null and b/ido/ido5.3_recomp/cfe differ
diff --git a/ido/ido5.3_recomp/err.english.cc b/ido/ido5.3_recomp/err.english.cc
new file mode 100644
index 00000000..6976e38a
--- /dev/null
+++ b/ido/ido5.3_recomp/err.english.cc
@@ -0,0 +1,1260 @@
+@
+ 358 358 358
+ 6464 6482 6553
+ 6553 6593 6728
+ 6728 6746 6803
+ 6803 6808 6808
+ 6808 6818 6818
+ 6818 6826 6826
+ 6826 6847 6847
+ 6847 6875 6922
+ 6922 6930 6930
+ 6930 6939 6939
+ 6939 6948 6948
+ 6948 6974 7120
+ 7120 7149 7204
+ 7210 7248 7311
+ 7317 7350 7442
+ 7450 7497 7627
+ 7635 7709 7930
+ 7938 7975 8063
+ 8071 8113 8253
+ 8261 8289 8289
+ 8298 8338 8445
+ 8460 8502 8635
+ 8650 8690 8819
+ 8834 8857 8965
+ 8965 9008 9113
+ 9119 9142 9227
+ 9235 9282 9451
+ 9451 9462 9462
+ 9462 9477 9477
+ 9477 9497 9497
+ 9497 9545 9545
+ 9545 9584 9584
+ 9584 9604 9662
+ 9662 9682 9720
+ 9720 9749 9749
+ 9749 9788 9788
+ 9788 9802 9802
+ 9802 9829 9829
+ 9829 9861 9861
+ 9861 9904 9904
+ 9904 9920 9920
+ 9920 9962 9962
+ 9962 9988 9988
+ 9988 10014 10014
+10014 10035 10035
+10035 10054 10097
+10097 10115 10115
+10115 10147 10147
+10147 10183 10183
+10183 10208 10208
+10208 10236 10236
+10236 10269 10269
+10269 10304 10304
+10304 10328 10328
+10328 10351 10351
+10351 10371 10371
+10371 10402 10402
+10402 10447 10447
+10447 10497 10497
+10497 10533 10533
+10533 10598 10598
+10606 10630 10630
+10640 10671 10671
+10690 10719 10719
+10728 10752 10795
+10795 10837 10837
+10837 10876 10876
+10876 10900 10900
+10900 10948 10948
+10960 11021 11103
+11103 11128 11128
+11128 11153 11153
+11153 11216 11216
+11216 11239 11239
+11239 11303 11303
+11303 11347 11347
+11357 11393 11393
+11393 11432 11432
+11442 11494 11494
+11494 11536 11536
+11536 11595 11595
+11595 11622 11622
+11622 11684 11684
+11684 11726 11726
+11738 11778 11778
+11782 11813 11813
+11813 11850 11850
+11850 11900 12087
+12111 12120 12120
+12120 12129 12129
+12129 12158 12158
+12158 12192 12192
+12192 12237 12237
+12237 12273 12273
+12273 12326 12326
+12330 12366 12366
+12366 12423 12423
+12427 12482 12482
+12486 12560 12560
+12568 12631 12631
+12637 12691 12691
+12691 12743 12743
+12743 12785 12785
+12785 12826 12826
+12826 12865 12865
+12865 12883 12883
+12883 12946 12946
+12956 12995 12995
+13005 13066 13066
+13077 13163 13163
+13163 13211 13211
+13211 13270 13270
+13270 13318 13318
+13318 13350 13350
+13350 13387 13387
+13387 13428 13428
+13428 13464 13533
+13533 13580 13737
+13737 13776 13854
+13854 13913 13913
+13913 13950 13950
+13950 14118 14118
+14118 14150 14150
+14150 14163 14194
+14194 14224 14255
+14255 14275 14319
+14319 14353 14458
+14466 14484 14530
+14534 14567 14567
+14567 14635 14682
+14690 14742 14742
+14742 14789 14789
+14801 14875 14875
+14886 14947 14947
+14947 14992 14992
+14992 15035 15085
+15085 15134 15205
+15214 15267 15448
+15454 15496 16810
+16822 16875 16960
+16972 17053 17179
+17191 17236 17332
+17344 17491 17841
+17853 17939 18304
+18316 18471 18774
+18786 18952 19323
+19335 19364 19496
+19500 19527 19598
+19598 19613 19776
+19797 19808 19837
+19837 19862 19862
+19868 19927 20026
+20034 20075 20179
+20187 20223 20223
+20223 20290 20382
+20392 20441 20589
+20601 20656 20656
+20656 20699 20818
+20826 20860 21038
+21046 21094 21191
+21203 21236 21314
+21326 21395 21457
+21469 21502 21502
+21502 21587 21731
+21756 21789 21864
+21875 21901 21976
+22013 22059 22220
+22257 22397 22561
+22561 22595 22595
+22603 22623 22623
+22631 22667 22828
+22865 22919 22994
+23031 23059 23120
+23132 23201 23201
+23212 23274 23274
+23285 23345 23345
+23356 23393 23393
+23399 23431 23532
+23542 23587 23646
+23656 23697 23745
+23755 23796 23844
+23854 23876 23928
+23942 23971 24153
+24160 24243 24243
+24247 24273 24743
+24755 24784 24984
+24996 25034 25034
+25034 25075 25273
+25281 25332 25410
+25420 25467 25544
+25554 25583 25744
+25754 25783 26061
+26071 26111 26185
+26194 26239 26525
+26535 26568 26914
+26924 26951 26998
+27008 27035 27082
+27093 27120 27167
+27178 27206 27251
+27261 27289 27334
+27345 27391 27931
+27938 27959 28007
+28019 28037 28037
+28043 28069 28069
+28077 28147 28199
+28207 28266 28266
+28274 28306 28306
+28314 28339 28339
+28347 28404 28510
+28518 28567 28682
+28690 28728 28728
+28736 28782 29023
+29033 29085 29234
+29246 29303 29383
+29395 29432 29570
+29592 29631 29644
+29644 29693 29758
+29767 29810 29875
+29875 29911 29976
+29984 30014 30014
+30027 30086 30151
+30157 30223 30293
+30301 30369 30445
+30457 30511 30568
+30580 30630 30743
+30755 30812 30874
+30886 30959 31035
+31043 31076 31175
+31183 31243 31243
+31251 31323 31323
+31331 31433 31433
+31445 31544 31686
+31698 31740 31740
+31740 31783 31783
+31783 31824 31824
+31824 31873 31996
+32008 32056 32164
+32176 32210 32210
+32229 32271 32271
+32279 32323 32569
+32581 32642 32718
+32739 32779 32916
+32926 32953 33047
+33057 33116 33315
+33325 33373 33373
+33373 33407 33469
+33494 33527 33527
+33536 33573 33573
+33584 33650 33697
+33705 33763 33763
+33763 33797 33797
+33797 33829 33906
+33915 33976 33976
+33985 34016 34098
+34098 34133 34198
+34198 34261 34261
+34269 34312 34312
+34324 34363 34438
+34444 34530 34530
+34538 34596 34626
+34636 34675 34754
+34764 34821 34821
+34821 34867 34950
+34959 35016 35135
+35145 35198 35198
+35208 35266 35344
+35355 35382 35537
+35547 35576 35629
+35637 35705 35705
+35713 35764 35764
+35764 35784 35876
+35888 35932 35950
+35950 36013 36138
+36150 36191 36280
+36286 36314 36419
+36431 36516 36516
+36516 36554 36642
+36642 36689 36808
+36818 36881 37105
+37113 37183 37204
+37204 37225 37225
+37225 37255 37348
+37348 37388 37388
+37388 37454 37454
+37454 37518 37518
+37518 37584 37584
+37584 37717 37717
+37717 37752 37752
+37752 37783 37889
+37901 37928 38034
+38046 38115 38115
+38115 38140 38187
+38195 38219 38339
+38351 38422 38422
+38422 38486 38486
+38486 38555 38555
+38555 38619 38619
+38619 38641 38641
+38641 38758 38758
+38758 38929 38929
+38929 38975 39043
+39055 39084 39133
+39133 39175 39265
+39275 39310 39494
+39504 39547 39576
+39587 39614 39668
+39674 39697 39797
+39797 39845 40094
+40094 40158 40264
+40264 40369 40523
+40523 40593 40593
+40593 40629 40876
+40876 40911 40971
+40977 41026 41026
+41038 41077 41077
+41077 41116 41116
+41116 41156 41156
+41156 41195 41195
+41195 41237 41237
+41237 41285 41285
+41285 41304 41304
+41304 41371 41371
+41371 41429 41429
+41429 41491 41491
+41491 41519 41519
+41519 41572 41572
+41572 41642 41642
+41642 41676 41676
+41676 41713 41713
+41713 41751 41751
+41751 41792 41792
+41792 41856 41856
+41856 41881 41881
+41881 41936 41936
+41936 41977 41977
+41977 42018 42018
+42018 42090 42090
+42090 42162 42162
+42162 42205 42205
+42205 42267 42267
+42267 42294 42294
+42294 42309 42309
+42309 42338 42386
+42393 42425 42522
+42530 42577 42577
+42577 42623 42623
+42623 42643 42725
+42725 42748 42748
+42748 42829 42897
+42901 42952 42952
+42952 42978 43025
+43025 43116 43116
+43116 43171 43171
+43171 43204 43376
+43386 43453 43471
+43471 43547 43780
+43798 43921 44116
+44120 44120 44120
+Out of memory: %s
+There is no more memory left in the system for compiling this program.
+Internal Error Unknown Error Message %s
+1) An internal error, while attempting to print an unavailable message
+2) The error message file is inaccessible or has other problems
+Unknown Signal %s
+1) An unknown signal has been caught
+2) 2 Nested signals
+line
+Warning:
+Fatal:
+Source not available
+Too many errors... goodbye.
+There is a limit of 30 errors before aborting.
+Error:
+reserved
+reserved
+Unknown Control Statement
+1) The line begins with a '#' and is not of the form:
+ # ""
+2) Please compile this program with the preprocessor enabled.
+Unknown character %s ignored
+The character is not part of the source character set.
+2.2.1
+Unknown control character \%s ignored
+The control character is not part of the source character set.
+2.2.1
+Illegal character %s in exponent
+1) Digits or sign expected after 'e' or 'E'.
+2) Digits are expected after sign in exponent.
+3.1.3.1
+Constant is out of range and may be truncated.
+The constant is too large to be accurately represented and may be
+truncated. The limits are in the system include file limits.h.
+2.2.4.2
+Constant is out of range for a 32-bit data type, but accepted as written.
+The constant is too large to fit in a 32-bit data type, but will be
+accurately represented in a wider data type. The value may be truncated,
+depending on its context. The limits are in the system include file
+limits.h.
+2.2.4.2
+Character constant size out of range
+1) No characters in a character constant.
+2) More than 4 bytes in a character constant.
+3.1.3.4
+Wide character constant size out of range
+1) No characters in the multibyte sequence (0 assumed).
+2) More than 1 byte in the multi-byte sequence (only the first byte was converted).
+3.1.3.4
+Invalid multibyte character
+4.10.7.2
+Newline in string or character constant
+1) Terminate your string or character constant with closing quotes.
+2) Put a backslash before the newline.
+3.1.3.4, 3.1.4
+Octal character escape too large: %s > %s
+1) Terminate end of octal sequence with a non-octal character.
+2) Select a character value within the limits.
+Value may be truncated
+3.1.3.4, 3.1.4
+Hex character escape too large: %s > %s
+1) Terminate end of hex sequence with a non-hex character.
+2) Select a character value within the limits.
+Value may be truncated
+3.1.3.4, 3.1.4
+Unexpected End-of-file
+1) Unterminated string or character constant
+2) Missing closing comment marker (*/)
+3) File system problems
+Unrecognized escape sequence in string \%s
+Recognized escape sequences are \a, \b, \f, \n, \r, \t, and \v.
+Character will be treated as un-escaped.
+3.9.2
+Illegal octal digit %s
+Octal constants, beginning with 0, must only have digits between 0 and 7,
+inclusive.
+3.1.3.2
+Unable to open temporary file for compiling %s
+1) TMPDIR environment variable is set to a directory that you have no
+ permissions for.
+2) The file system is full.
+3) System errors beyond the scope of the compiler.
+%s: Hangup
+%s: Interrupt
+%s: Quit (ASCII FS)
+%s: Illegal instruction (not reset when caught)
+%s: Trace trap (not reset when caught)
+%s: IOT instruction
+Also SIGABRT, used by abort, replace SIGIOT in the future
+%s: EMT instruction
+Also SIGXCPU, Exceeded CPU time limit
+%s: Floating point exception
+%s: Kill (cannot be caught or ignored)
+%s: Bus error
+%s: Segmentation violation
+%s: Bad argument to system call
+%s: Write on a pipe with no one to read it
+%s: Alarm clock
+%s: Software termination signal from kill
+%s: User defined signal 1
+%s: User defined signal 2
+%s: Death of a child
+Power-fail restart
+%s: Also SIGXFSZ, exceeded file size limit
+%s: Window change
+%s: Handset, line status change
+%s: Sendablestop signalnot from tty
+%s: Stop signal from tty
+%s: Pollable event occurred
+%s: Input/Output possible signal
+%s: Urgent condition on IO channel
+%s: Window size changes
+%s: Virtual time alarm
+%s: Profiling alarm
+%s: Continue a stopped process
+%s: To readers pgrp upon background tty read
+%s: Like TTIN for output if (tp->t_local<OSTOP)
+%s: Resource lost (eg, record-lock)
+'auto' and 'register' are not allowed in an external declaration
+3.7(10)
+must have function type
+3.7.1(30)
+Functions cannot return arrays
+3.7.1(33), 3.3.2.2
+Declaration list not allowed
+3.7.1(5)
+Too many input files %s
+The command line may contain only one file
+cpp internal error: input stack underflow
+cpp internal error: if stack underflow
+Cannot open the file %s
+No new-line character at the end of the file %s
+2.1.1.2(30)
+Fatal: Exceeded the limit of nesting level for #include file
+Fatal: Exceeded the limit of nesting level for #include file. This limit
+is 200.
+Fail to read the file %s
+Cannot write the file %s
+%s: %s: An if directive is not terminated properly in the file
+%s: %s: nested comment
+%s:%s: Illegal macro name %s; macro name shall be an identifier
+%s:%s: Illegal preprocessing token sequence
+3.8.3(35)
+%s:%s: Illegal macro parameter name
+%s:%s: Non-unique macro parameter name
+3.8.3(18)
+%s:%s: Missing ')' in parameter list for #define %s
+%s:%s: Missing ')' in macro instantiation
+%s:%s: Bad punctuator in the parameter list for #define %s
+%s:%s: Macro %s redefined.
+%s:%s: # operator should be followed by a macro argument name
+%s:%s: Badly formed constant expression%s
+3.4(9), 3.8
+%s:%s: Division by zero in #if or #elif
+3.8
+unknown command line option %s
+extraneous input/output file name %s
+%s: %s: Unterminated string or character constant
+A preprocessing string or character constant token was not
+terminated. Note that preprocessing directives are processed
+after the source file has been divided into preprocessing tokens.
+2.1.1.2(30) 3.1(18) 3.8
+%s: %s:
+%s: %s:
+%s: %s: Unterminated comment
+%s: %s: Unknown directive type %s
+%s: %s: #elif or #else after #else directive
+%s: %s: Bad identifier after the %s
+%s: %s: #%s accepts only one identifier as parameter
+3.8
+%s: %s: Bad identifier after the %s
+%s: %s: text following #%s violates the ANSI C standard.
+3.8
+%s: %s: Bad character %s occurs after the # directive.
+3.8
+%s: %s: the ## operator shall not be the %s token in the replacement list
+3.8.3.3
+%s: %s: the defined operator takes identifier as operand only.
+3.8.1
+%s: %s: Not in a conditional directive while using %s
+%s: %s: Illegal filename specification for #include
+%s: %s: Invalid file name %s for #include
+%s: %s: Cannot open file %s for #include
+%s: %s: Bad argument for #line command
+%s: %s: #error %s
+%s: %s: Tried to redefine predefined macro %s, attempt ignored
+3.8.7(22)
+%s: %s: Undefining predefined macro %s
+3.8.7(22)
+%s: %s: Undefined the ANSI standard library defined macro %s
+4.1.2.1(9)
+%s: %s: The number of arguments in the macro invocation does not match the definition
+%s: %s: Illegal character %s in preprocessor if
+%s: %s: Illegal character %s for number in preprocessor if
+%s: %s: No string is allowed in preprocessor if
+%s: %s: Not supported pragma %s
+%s: %s: Not supported #pragma format
+%s: %s: ANSI C does not allow #ident; %s
+%s: %s: Not supported #ident format
+This cpp extension accepts the following format:
+#ident "any string"
+%s: %s: Not supported #assert/#unassert format
+This cpp extension accepts the following format:
+#assert identifier
+#assert identifier ( pp-tokens )
+#unassert identifier
+#unassert identifier ( pp-tokens )
+%s: %s: Bad assertion predicate format
+The correct syntax for this cpp extension is:
+#assert identifier ( pp-token )
+%s: %s: directive is an upward-compatible ANSI C extension
+%s: This option requires an argument
+%s: %s: A macro has expanded recursively more than %s times. Further expansion will be disabled! Use command-line option: -Wp,-max_rec_depth=depth to recurse deeper.
+A status return from cpp to cfe
+Syntax Error
+The token read was unexpected.
+Syntax Error -- cannot backup
+The token read was unexpected.
+Yacc stack overflow
+The expression is too complicated to parse.
+Trailing comma in enumerator list
+The use of a trailing comma in an enumerator list is not standard C. There
+may be portability problems.
+3.5.2.2
+Empty declaration
+Empty declarations are invalid in standard C.
+3.5
+%s declared, but not referenced.
+redeclaration of '%s'; previous declaration at line %s in file '%s'
+Identifier redeclared in the same scope/block.
+3.1.2.3
+'%s' undefined; reoccurrences will not be reported.
+Non-function name referenced in function call.
+3.3.2.2(18)
+The number of arguments doesn't agree with the number in the declaration.
+3.3.2.2(5)
+'%s' section name longer than 8 characters. Name truncated.
+'%s' is already placed by pragma alloc_text.
+Cannot write ucode file while compiling %s
+1) The file system is full
+2) Permissions problem
+Must have corresponding formal argument for '%s'
+Parameter found in the declaration part, but not in the argument list.
+3.7.1(7)
+Non-prototype declaration is an obsolescent feature.
+The use of function definitions with separate parameter identifier
+and declaration lists (not prototype-format parameter type and
+identifier declarators) is an obsolescent feature.
+3.9.5
+Incompatible function declarations for %s
+For two function types to be compatible, both shall specify compatible
+return types. Moreover, the parameter type lists, if both are present,
+shall agree in the number of parameters and in use of the ellipsis
+terminator; corresponding parameters shall have compatible types. If
+one type has a parameter type list and the other type is specified by
+a function declarator that is not part of a function definition and
+contains an empty identifier list, the parameter list shall not have
+an ellipsis terminator and the type of each parameter shall be
+compatible with they type that results from application of the default
+argument promotions. If one type has a parameter type list and the
+other is specified by a function definition that contains a (possibly
+empty) identifier list, both shall agree in the number of parameters,
+and the type of each prototype parameter shall be compatible with the
+type that results from application of the default argument promotions
+to the type of the corresponding identifier. (For each parameter
+declared with function or array type, its type for these comparisons
+is the one that results from conversion to a pointer type. For each
+parameter declared with qualified type, its type for these comparisons
+is the unqualified version of its declared type.) There you have it!
+3.5.4.3(15)
+Incompatible function return type for this function.
+For two function types to be compatible, both shall specify compatible
+return types.
+3.5.4.3(15)
+The number of parameters for function is different from the previous declaration
+The parameter type lists, if both are present, shall agree in the
+number of parameters and in use of the ellipsis terminator.
+3.5.4.3(15)
+Incompatible type for the function parameter
+If both parameter type lists are present, corresponding
+parameters shall have compatible types.
+3.5.4.3(15)
+Function %s is redeclared with an incompatible argument type (after default argument promotion), which could lead to undefined run-time behaviour.
+The redeclaration could cause arguments at a call site to be passed
+inconsistently with what the function implementation expects, and
+parameters would therefore be accessed erroneously when executing the
+function body. Note that a float argument is promoted to a double
+when passed (potentially through fp registers) to an unprototyped
+function.
+3.5.4.3(15)
+prototype and non-prototype declaration found for %s, ellipsis terminator not allowed
+If one type has a parameter type list and the other type is specified
+by a function declarator that is not part of a function definition and
+contains an empty identifier list, the parameter list shall not have
+an ellipsis terminator and the type of each parameter shall be
+compatible with they type that results from application of the default
+argument promotions.
+3.5.4.3(15)
+prototype and non-prototype declaration found for %s, the type of this parameter is not compatible with the type after applying default argument promotion
+If one type has a parameter type list and the other type is specified
+by a function declarator that is not part of a function definition and
+contains an empty identifier list, the type of each parameter shall be
+compatible with the type that results from application of the default
+argument promotions.
+3.5.4.3(15)
+prototype declaration and non-prototype definition found for %s, the type of this parameter is not compatible with the type after applying default argument promotion
+If one type has a parameter type list and the other is specified by a
+function definition that contains a (possibly empty) identifier list,
+both shall agree in the number of parameters, and the type of each
+prototype parameter shall be compatible with the type that results
+from application of the default argument promotions to the type of the
+corresponding identifier.
+3.5.4.3(15)
+Empty declaration specifiers
+Standard C requires at least a storage class specifier, type specifier,
+or a type qualifier in declarations. 'extern int' assumed.
+3.5
+Can't write to the file %s
+1) The output file cannot be opened for writing.
+2) Out of file space.
+Duplicate '%s'
+typedef, extern, static, auto, register, const, volatile may not
+appear more than once in the same specifier list or qualifier list.
+Duplicate occurrence ignored.
+3.5.1(10) , 3.5.3(5)
+Null input
+There is nothing to compile.
+Illegal type combination
+3.5.2
+Missing ';' at end of structure / union member declaration
+In standard C, each member declaration must be terminated by a ';'. A
+terminating ';' is assumed.
+3.5.2.1
+Missing member name in structure / union
+In standard C, each member declaration have a member name. The missing
+member is assumed to not exist.
+3.5.2.1
+This variable is initialized twice.
+Neither 'const' or 'volatile' have any effect on function results.
+Qualifiers only apply to expressions designating an object that
+can be altered or examined.
+3.5.3(10)
+An integer constant expression is required here.
+The expression that defines the value of an enumeration constant
+shall be an integral constant expression that has a value
+representable as an int.
+3.5.2.2(28)
+(previous declaration of '%s' at line %s in file '%s')
+Must be an integer type greater than zero.
+The array size must be either a char, signed or unsigned integer or
+an enumerated type with a value greater than zero.
+3.5.4.2
+Array size cannot be a long long.
+Arrays with more than 2^32 elements are not yet supported.
+The array size must be either a char, signed or unsigned integer or
+an enumerated type with a value greater than zero.
+3.5.4.2
+bit-field '%s' width is not an integer constant
+The expression that specifies the width of a bit-field shall be an
+integral constant expression.
+3.5.2.1(15)
+bit-field '%s' width is negative
+The expression that specifies the width of a bit-field shall be
+non-negative.
+3.5.2.1(15)
+bit-field '%s' type required to be int, unsigned int, or signed int.
+A bit-field shall have type int, unsigned int, or signed int.
+3.5.2.1(30)
+bit-field %s's type not integer.
+Non-scalar type or pointer type to a non-object for increment or decrement operator.
+The operand of the prefix/postfix increment or decrement operator shall have scalar type; if it is of pointer type, it must point to an object.
+3.3.2.4(37), 3.3.3.1(25)
+Assign value to a function type.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.2.2.1(5)
+Assign value to an array.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Change value for variable of incomplete type.
+The operand of increment and decrement operator shall be a modifiable
+scalar lvalue. An assignment operator shall have a modifiable lvalue
+as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+The left-hand side of the '.' operator must be an addressable lvalue, when a bit-field is not contained within a unit of 32 bits alignment.
+This is a restriction in our implementation, which can be worked
+around by always accessing long long bit-fields indirectly (i.e.
+by means of the '->' operator).
+This expression is not an lvalue.
+3.2.2.1
+Modified an rvalue.
+3.2.2.1
+Change value for constant variable.
+The operand of increment and decrement operators shall be modifiable
+scalar lvalues. An assignment operator shall have a modifiable lvalue
+as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Change value for constant field of a struct or union.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Dereferenced a non-pointer.
+The operand of the unary * operator shall have pointer type.
+3.3.3.2(39)
+The operand of the unary + or - operator shall have arithmetic type.
+3.3.3.3(6)
+The operand of the unary ~ operator shall have integral type.
+3.3.3.3(6)
+The operand of the unary ! operator shall have scalar type.
+3.3.3.3(6)
+Constants must have arithmetic type.
+3.1.3
+Bad type name for cast operator
+The type name for the cast operator should either be void or a
+qualified or unqualified scalar type.
+3.3.4(22)
+Improper cast of non-scalar type expression.
+The operand for the cast operator shall be of scalar type.
+3.3.4(23)
+Cast a pointer into a non-integral type.
+A pointer may be converted to an integral type.
+3.3.4(31)
+Cast a non-integral type into a pointer.
+An integral type may be converted to a pointer.
+3.3.4(31)
+Duplicate member '%s'
+Two members of a struct may not have the same name.
+3.1.2.2(7,25)
+Invalid constant expression.
+Constant expressions shall not contain assignment, increment, decrement,
+function-call, or comma operators, except when they are contained within
+the operand of the sizeof operator.
+3.4(9)
+Constant expressions must be derived from a constant value or a constant
+variable.
+3.4
+Dangerous operand of '&'.
+The operand of the unary & operator shall be either a function
+designator or an lvalue that designates an object that is not a
+bit-field and is not declared with the register storage-class
+specifier. This operand is NOT an lvalue, but we let it pass.
+Note that a segmentation error with possible core dump will result
+when the resulting address does not denote a valid (declared)
+storage location. This feature will be discontinued in future
+releases of the compiler!
+3.3.3.2(36)
+Unacceptable operand of '&'.
+The operand of the unary & operator shall be either a function
+designator or an lvalue that designates an object that is not a
+bit-field and is not declared with the register storage-class
+specifier.
+3.3.3.2(36)
+'&' before array or function; ignored
+Unacceptable operand of sizeof operator.
+The sizeof operator shall not be applied to an expression that has
+function type or an incomplete type, to the parenthesized name of such
+a type, or to an lvalue that designates a bit-field object.
+3.3.3.4
+Unacceptable operand of a multiplicative operator.
+Each of the operands of a multiplicative operator shall have arithmetic type.
+3.3.5(18)
+Unacceptable operand of the remainder operator
+Each of the operands of the remainder (%) operator shall have integral type.
+3.3.5(18)
+Unacceptable operand of '+'.
+For the + operator, either both operands shall have arithmetic type, or
+one operand shall be a pointer to an object type and the other shall
+have integral type.
+3.3.6(39)
+Unacceptable operand of '-'.
+For the subtraction operator, one of the following shall hold: both operands
+have arithmetic type; operands are pointers to qualified or unqualified
+versions of compatible object types; or the left operand is a pointer
+to an object type and the right operand has integral type.
+3.3.6(39)
+Unacceptable operand of shift operator.
+Each of the operands of bitwise shift operators shall have integral type.
+3.3.7(9)
+Unacceptable operand of relational operator.
+For relational operators, one of the following shall hold: both
+operands have arithmetic type; both operands are pointers to qualified
+or unqualified versions of compatible object types; or both operands
+are pointers to qualified or unqualified versions of compatible
+incomplete types.
+3.3.8(32)
+Unacceptable operand of == or !=
+For the == or != operator, one of the following shall hold: both operands
+are pointers to qualified or unqualified versions of compatible types; one
+operand is a pointer to an object or incomplete type and the other is a
+pointer to a qualified or unqualified version of void; or one operand is
+a pointer and the other is a null pointer constant.
+3.3.9(21)
+Unacceptable operand of &.
+Each of the operands shall have integral type.
+3.3.10(7)
+Unacceptable operand of ^.
+Each of the operands shall have integral type.
+3.3.11(18)
+Unacceptable operand of |.
+Each of the operands shall have integral type.
+3.3.12(30)
+Unacceptable operand of &&.
+Each of the operands shall have scalar type.
+3.3.13(7)
+Unacceptable operand of ||.
+Each of the operands shall have scalar type.
+3.3.14(20)
+Unacceptable operand of conditional operator.
+The first operand of conditional operator shall have scalar type. One
+of the following shall hold for the second and third operands:
+both operands have arithmetic type; both operands have compatible
+structure or union types; both operands have void type; both operands
+are pointers to qualified or unqualified versions of compatible types;
+one operand is a pointer and the other is a null pointer constant; or
+one operand is pointer to an object or incomplete type and the other
+is a pointer to a qualified or unqualified version of void.
+3.3.15
+Duplicate label '%s'
+A label name can only occur once in a function.
+3.1.2.1(25)
+Division by zero.
+3.3.5
+Subscripting a non-array.
+3.3.2.1
+Subscripting an array of incomplete type which is not an object type.
+The element of the array shall have an object type.
+3.3.2.1
+Should only subscript an array with an integral expression
+3.3.2.1
+Subscripting an unbounded array
+3.3.2.1
+Array index out of range
+3.3.2.1
+Selector requires struct/union pointer as left hand side
+In K&R mode the expression is implicitly converted to the '.' selector
+for a struct/union left-hand side.
+3.3.2.3
+Selector requires struct/union as left hand side
+In K&R mode the expression is implicitly converted to the '->' selector
+for a struct/union pointer left-hand side.
+3.3.2.3
+member of structure or union required
+3.3.2.3
+types have different qualifier specifications
+For two qualified types to be compatible, both shall have the
+identically qualified version of a compatible type; qualified
+and unqualified versions of a type are distinct types. For two
+types to be compatible their types must be the same.
+3.5.3(26)
+Incompatible array type due to different array size
+For two array types to be compatible, both shall have compatible element
+types; if both size specifiers are present, they shall have the
+same value.
+3.5.4.2(11)
+Incompatible array type due to incompatible element type
+For two array types to be compatible, both shall have compatible element
+types.
+3.5.4.2(11)
+Incompatible pointer type assignment
+The type pointed to by the left-hand side of simple assignment
+statement is incompatible with the type pointed to by the right-hand side.
+3.3.16.1, 3.5.4.1(21)
+Incompatible base type of pointer type
+K&R feature.
+Type %s of %s is incompatible with type %s of %s
+Incompatible types can be resolved by casting or by other means.
+3.3.16.1
+illegal combination of pointer and integer
+Assigning an integral expression to a pointer is a bad practice.
+Type for %s is incompatible with %s
+Incompatible types can be resolved by casting or by other means.
+3.1.2.6
+Bad operand type for += or -=
+3.3.16.2(26)
+A case or default label appears outside a switch statement
+A case or default label shall appear only in a switch statement.
+3.6.1
+The controlling expression of the if statement is not scalar type
+The controlling expression of an if statement shall have scalar type.
+3.6.4.1
+The controlling expression of switch statement is not integral type
+The controlling expression of an switch statement shall have integral type.
+3.6.4.2(20)
+The case label is not an integral constant expression
+The case label shall be an integral constant expression.
+3.6.4.2(22)
+Duplicate case label in the same switch statement
+No two of the case constant expressions in the same switch statement
+shall have the same value after conversion.
+3.6.4.2(22)
+More than one default label in the same switch statement
+There may be at most one default label in a switch statement.
+3.6.4.2(23)
+The controlling expression of the iteration statement is not scalar
+type
+The controlling expression of a iteration statement shall have scalar
+type.
+3.6.5.1
+label '%s' used, but not defined
+The identifier in a goto statement shall name a label located
+somewhere in the enclosing function.
+3.6.6.1
+A continue statement shall appear only in or as a loop body
+3.6.6.2
+A break statement shall appear only in or as a switch body or loop body
+3.6.6.3
+A return statement with an expression should not appear
+in a function '%s', whose return type is void
+3.6.6.4(24)
+A return statement without an expression appears in a
+function '%s', whose return type is not void
+If a return statement without an expression is executed, and the value
+of the function call is used by the caller, the behavior is undefined.
+3.6.6.4(33)
+Internal Error: statement stack underflow
+Long double not supported; double assumed.
+Long float not standard; double assumed.
+Only 'register' allowed in parameter declaration
+The only storage-class specifier that shall occur in a parameter
+declaration is 'register'; illegal storage class ignored.
+3.5.4.3(25)
+Name(s) without types in a function declaration
+An old-style function declaration is not allowed to have names
+in the parameter list; useless names ignored
+3.5.4.3(26)
+Functions cannot return functions
+3.7.1(33), 3.3.2.2
+Functions cannot return a non-object type
+3.3.2.2
+enum declaration must contain enum literals
+Although structs or unions may delay the declaration of their members,
+a similar construction with enum does not exist and is not necessary,
+as there can be no mutual dependencies between the declaration of an
+enumerated type and any other type.
+3.5.2.3(27)
+Register qualification has no effect for this type of object
+Register declarations for array, struct, and function types have
+no effect.
+3.5.1(16), 3.5.1(19)
+Functions cannot be declared 'register'
+The declaration of an identifier for a function that has block
+scope shall have no explicit storage-class specifier other than
+'extern'.
+3.5.1(19)
+'%s' cannot be initialized
+The type of the entity to be initialized shall be an object type
+or an array of unknown size.
+3.5.7(32)
+Cannot initialize 'extern' variable '%s' within a function
+If the declaration of an identifier has block scope, and the
+identifier has 'extern' or 'static' linkage, the declaration
+shall have no initializer for the identifier; initialization
+allowed anyway.
+3.5.7(35)
+initializing an 'extern' is an ANSI C extension
+conflicting declarations for '%s'
+'static' and 'extern' declarations conflict. Which is meant?
+3.1.2.2(15), 3.1.2.2(27)
+Too many initial values for '%s'
+3.5.7(1)
+incompatible types in initialization
+3.3.16(35)
+redefinition of '%s'; previous definition at line %s in file '%s'
+Identifier redeclared in the same scope/block.
+3.1.2.3
+bit-fields as members of a union are an ANSI C invention.
+storage size for '%s' isn't known
+type mismatch in initialization
+Missing braces in a union initialization or illegally formed
+initialization.
+3.5.7(5)
+union '%s' only allowed one initializer for the first member
+3.5.7(5)
+width of '%s' exceeds its type
+the specified bitfield width is too large to be contained within a
+bitfield type.
+structure has no member named '%s'
+This is allowed for compatibility with AT&T pcc-based compilers.
+Reference of an expression of void type or an incomplete type.
+3.2.2.1
+element size of an array shall not be zero
+3.2.2.5(25)
+invalid combination of type specifiers
+Although order is unimportant, not all type specifiers can occur together.
+3.5.2
+declaration must at least declare an identifier, tag, or the member of an enumeration
+3.5(16)
+at most one storage class may be given in the declaration
+Duplicate occurrence ignored.
+3.5.1(10)
+size of function's return type is zero
+The return type of a function must be void or an object type other than array.
+3.7.1(33)
+Expecting an integral return type from the main function
+identifier missing from parameter declaration
+Prototypes for function definitions require identifiers in parameter
+declarations.
+3.7.1(4)
+only 'register' allowed for storage class for parameters
+The declarations in the declaration list shall contain no storage class
+other than 'register', and no initializations.
+3.7.1(10)
+parameters declarations can not have initializations
+3.7.1(10)
+only one instance of 'void' allowed in the parameter list
+'void' must occur by itself (specifying that the function has no parameters).
+3.5.4.3(1)
+%s must have function type
+1) An argument list must be explicitly present in the declarator; it cannot
+ be inherited from a typedef (3.5.4.3).
+2) The declarator is not a function.
+3.7.1(30)
+Illegal hexadecimal constant
+You have no digits after the 0x or 0X. 0x0 assumed.
+3.1.3.2
+value overflows its type in this context. Value is set to be '%s'!
+3.2.1.4
+value is outside range representable for type '%s'
+missing member name
+K&R mode permits a missing member name; otherwise, only bitfields can omit
+the member name.
+3.5.2.1(10)
+useless keyword or type name in declaration
+Type was ignored.
+'%s' declared within and is limited to this function prototype
+Possible program error, since parameter type checking will always fail
+unless the type declaration is visible to the caller.
+3.1.2.1(35)
+Extra spaces within operator, %s assumed
+In ANSI C, the compound assignment operator cannot have embedded
+white space characters.
+3.1.5
+missing size for array '%s'
+Incomplete types permitted for identifiers with internal or
+external linkage, but not automatic linkage.
+3.1.2.5(10)
+can't jump into (from outside of) the body of a 'try' or into either type of handler
+'%s' missing, please #include excpt.h
+excpt.h required to declare exception statements, intrinsics or compiler
+runtime names.
+local function declarations cannot be 'static'
+A function declaration can only contain the storage-class 'static'
+if it is at file scope. Declaration made 'extern'.
+3.5.1(19)
+static function '%s' declared and referenced, but not defined.
+If an identifier declared with internal linkage is used in an
+expression (other than as a part of the operand of a sizeof
+operator), there shall be exactly one external definition for
+the identifier in the translation unit.
+3.7(12)
+pragma argument '%s' must be declared prior to being used in a pragma
+Pragma name ignored.
+Pragma not supported
+'%s' not enabled as intrinsic
+It may have already appeared in a function pragma, or never occurred in
+an intrinsic pragma.
+'%s' is already enabled as an intrinsic
+weak definition for '%s' is later redefined; pragma weak ignored.
+definition of primary name '%s' not found; pragma weak ignored.
+definition of secondary name '%s' not found; pragma weak ignored.
+primary name '%s' is declared as a common or external, and is not defined
+with initial value within this file; pragma weak ignored.
+useless '%s' storage class ignored
+array of functions not allowed
+The element type must be an object type representing a region
+of data storage which can represent values.
+3.1.2.5(23)
+array of voids not allowed
+The element type must be an object type representing a region
+of data storage which can represent values.
+3.1.2.5(23)
+argument for pragma pack must be an integer constant; pragma ignored
+'%s' has wrong tag type.
+Identifier redeclared in the same scope/block.
+3.1.2.3
+missing dimension bound
+For multidimensional arrays, the constant bounds of the array may be
+omitted only for the first member of the sequence.
+3.1.2.5(23)
+Internal error in parameters to function substr; loc: '%s'; len: '%s'.
+Internal error in parameters to function insertstr; indx: '%s'.
+Internal error in function get_tag_name; input is a non-tagged type.
+Internal error in function gen_type_str -- not a type tree '%s'
+Cannot open file '%s'
+Prototype should be moved after tag or a typedef declaration.
+Please look for comments in the extracted header file.
+The extracted header file includes prototypes for static functions,
+which should be removed, if you wish to include the header in a source file
+other than the originator.
+ANSI C requires formal parameter before "..."
+This extension is meant to be used for compatibility with varargs.h
+3.5.4.3(35)
+syntax error: "&..." invalid
+extension used to access "..." formal arguments.
+function '%s' initialized like a variable
+The type of entity to be initialized shall be an object type or an
+array of unknown size.
+3.5.7(31)
+initializer not an array aggregate
+The initializer for an object that has aggregate type shall be a
+brace-enclosed list of initializers for the members of the aggregate,
+written in increasing subscript or member order.
+3.5.7(20)
+'%s' type is incomplete; cannot initialize
+Was the struct ever defined?
+3.5.7.(31)
+'%s' is not standard ANSI.
+This keyword/type is not defined in strict ANSI mode.
+3.1.1
+not a legal asm string
+The first operand of an asm string should be, after argument substitution,
+a legal assembly string.
+The -float option will be ignored in ANSI mode.
+The -float option is ignored, since otherwise program semantics would
+violate the ANSI standard. In particular, fp constants are always
+'double' with ANSI-C, while with -float the type of fp constants will
+depend on the context and may be 'float'.
+ANSI C support unavailable with C compiler bundled with RISC/os
+The C compiler bundled with RISC/os does not support ANSI C. ANSI
+C support requires a separate license.
+Ignored invalid warning number(s) in -woff option, %s%s !
+Warning numbers must be in the range %s to %s.
+The set of warning numbers in cfe is disjoint from the set of warning numbers
+in accom, since accom warnings cannot be mapped one-to-one to cfe warnings.
+'%s' not handled as an intrinsic due to incompatible argument types .
+'__unalign' only qualifies pointers
+'__unalign' indicates the object pointed at by pointer is unaligned (e.g.,
+int * __unalign p). This is an extension to ANSI C and like 'volatile'
+and 'const' can follow the '*' in pointer declarations, but unlike both
+cannot qualify a base type.
+index expression is an anachronism
+ANSI C++ doesn't support array index expressions in delete.
+5.3.4
+member cannot be of function or incomplete type.
+3.5.2.1(12)
+Illegal lint option, '%s', is ignored.
+cannot open header message buffer file
+cannot write header message buffer file
+cannot read header message buffer file
+cannot seek in header message buffer file
+struct/union/enum '%s' is used, but not defined
+static '%s' unused
+nonportable character comparison (chars may be signed or unsigned)
+redundant comparison of unsigned with constant expression
+redundant statement, control flow cannot reach this statement
+'%s' may be used before set
+function parameter '%s' is not used in function '%s'
+'%s' can be const qualified, since it is not set within its lifetime.
+'%s' is not used in function '%s'
+'%s' set but unused in function '%s'
+control may fall through %s statement
+function '%s' has return(e); and return;
+function '%s' may return random value to place of invocation %s
+label without goto: '%s'
+width of %s constant is smaller than size of type (%s)
+explicit conversion from '%s' to '%s' %s
+implicit conversion from '%s' to '%s' %s
+'%s' may be indistinguishable from '%s' due to internal name truncation
+Promoted formal parameter and promoted argument have incompatible types
+No prototype for the definition of '%s' %s
+References to '%s' are substituted by its literal initializer
+ (as included in %s)
+==============
+unsupported language linkage
+string-literal specifies an unsupported linkage
+7.4(1)
+No prototype for the call to %s
+To achieve better type-checking, there should be a full prototype for
+the function being called.
+3.5.4.3
+'inline' only applies to function declarations
+leave statment can occur only within try body
+Microsoft extension
+Use of a Microsoft extension detected without usage of the
+compiler option -msft.
+No parameter mentioned
+A file with no declarations or definitions is accepted as an extension to ANSI C
+The translation unit must contain at least one external definition.
+3.7
+Incompatible signed and unsigned version of a type
+Yacc initialization error
+Internal error: yacc cannot initialize itself.
+The cfe option %s may not be in future releases. We suggest that you not use this option!
+Incompatible char and unsigned char versions of a type
+Lshift with undefined behaviour.
+Lshift with a negative right operand, or a right operand that is greater
+than or equal to the width in bits of the promoted left operand, results
+in undefined behaviour.
+3.3.7(11)
+useless type name in declaration, possibly a semicolon is missing.
+Type was ignored.
+constant initializer expression is invalid (refers to automatic variables).
+All the expressions in an initializer for an object that has static storage
+duration or in the initializer list for an object that has aggregate or
+union type shall be constant expressions. Otherwise, unexpected results
+may occur.
+3.5.7(32) and 3.4
+invalid explicit or implicit conversion of an address constant to an integral value in a constant initializing expression.
+An address constant in a constant initializing expression can neither
+initialize a bit-field nor be directly or indirectly converted to an
+integral type of size different from an address type.
+6.4
diff --git a/ido/ido5.3_recomp/ugen b/ido/ido5.3_recomp/ugen
new file mode 100755
index 00000000..692086f0
Binary files /dev/null and b/ido/ido5.3_recomp/ugen differ
diff --git a/ido/ido5.3_recomp/ujoin b/ido/ido5.3_recomp/ujoin
new file mode 100755
index 00000000..98ba6065
Binary files /dev/null and b/ido/ido5.3_recomp/ujoin differ
diff --git a/ido/ido5.3_recomp/uld b/ido/ido5.3_recomp/uld
new file mode 100755
index 00000000..38833f5b
Binary files /dev/null and b/ido/ido5.3_recomp/uld differ
diff --git a/ido/ido5.3_recomp/umerge b/ido/ido5.3_recomp/umerge
new file mode 100755
index 00000000..5b78e92e
Binary files /dev/null and b/ido/ido5.3_recomp/umerge differ
diff --git a/ido/ido5.3_recomp/uopt b/ido/ido5.3_recomp/uopt
new file mode 100755
index 00000000..49558be9
Binary files /dev/null and b/ido/ido5.3_recomp/uopt differ
diff --git a/ido/ido5.3_recomp/usplit b/ido/ido5.3_recomp/usplit
new file mode 100755
index 00000000..e6a69ef8
Binary files /dev/null and b/ido/ido5.3_recomp/usplit differ
diff --git a/ido/ido7.1_recomp/as1 b/ido/ido7.1_recomp/as1
new file mode 100755
index 00000000..a7bb3adc
Binary files /dev/null and b/ido/ido7.1_recomp/as1 differ
diff --git a/ido/ido7.1_recomp/cc b/ido/ido7.1_recomp/cc
new file mode 100755
index 00000000..e926b545
Binary files /dev/null and b/ido/ido7.1_recomp/cc differ
diff --git a/ido/ido7.1_recomp/cfe b/ido/ido7.1_recomp/cfe
new file mode 100755
index 00000000..3a3e9831
Binary files /dev/null and b/ido/ido7.1_recomp/cfe differ
diff --git a/ido/ido7.1_recomp/err.english.cc b/ido/ido7.1_recomp/err.english.cc
new file mode 100644
index 00000000..b5d5be36
--- /dev/null
+++ b/ido/ido7.1_recomp/err.english.cc
@@ -0,0 +1,1260 @@
+@
+ 358 358 358
+ 6464 6482 6553
+ 6553 6593 6728
+ 6728 6746 6803
+ 6803 6808 6808
+ 6808 6818 6818
+ 6818 6826 6826
+ 6826 6847 6847
+ 6847 6875 6922
+ 6922 6930 6930
+ 6930 6939 6939
+ 6939 6948 6948
+ 6948 6974 7120
+ 7120 7149 7204
+ 7210 7248 7311
+ 7317 7350 7442
+ 7450 7497 7627
+ 7635 7709 7930
+ 7938 7975 8063
+ 8071 8113 8253
+ 8261 8289 8289
+ 8298 8338 8445
+ 8460 8502 8635
+ 8650 8690 8819
+ 8834 8857 8965
+ 8965 9008 9113
+ 9119 9142 9227
+ 9235 9282 9451
+ 9451 9462 9462
+ 9462 9477 9477
+ 9477 9497 9497
+ 9497 9545 9545
+ 9545 9584 9584
+ 9584 9604 9662
+ 9662 9682 9720
+ 9720 9749 9749
+ 9749 9788 9788
+ 9788 9802 9802
+ 9802 9829 9829
+ 9829 9861 9861
+ 9861 9904 9904
+ 9904 9920 9920
+ 9920 9962 9962
+ 9962 9988 9988
+ 9988 10014 10014
+10014 10035 10035
+10035 10054 10097
+10097 10115 10115
+10115 10147 10147
+10147 10183 10183
+10183 10208 10208
+10208 10236 10236
+10236 10269 10269
+10269 10304 10304
+10304 10328 10328
+10328 10351 10351
+10351 10371 10371
+10371 10402 10402
+10402 10447 10447
+10447 10497 10497
+10497 10533 10533
+10533 10598 10598
+10606 10630 10630
+10640 10671 10671
+10690 10719 10719
+10728 10752 10795
+10795 10837 10837
+10837 10876 10876
+10876 10900 10900
+10900 10948 10948
+10960 11021 11103
+11103 11128 11128
+11128 11153 11153
+11153 11216 11216
+11216 11239 11239
+11239 11303 11303
+11303 11347 11347
+11357 11393 11393
+11393 11432 11432
+11442 11494 11494
+11494 11536 11536
+11536 11595 11595
+11595 11622 11622
+11622 11684 11684
+11684 11726 11726
+11738 11778 11778
+11782 11813 11813
+11813 11850 11850
+11850 11900 12087
+12111 12120 12120
+12120 12129 12129
+12129 12158 12158
+12158 12192 12192
+12192 12237 12237
+12237 12273 12273
+12273 12326 12326
+12330 12366 12366
+12366 12423 12423
+12427 12482 12482
+12486 12560 12560
+12568 12631 12631
+12637 12691 12691
+12691 12743 12743
+12743 12785 12785
+12785 12826 12826
+12826 12865 12865
+12865 12883 12883
+12883 12946 12946
+12956 12995 12995
+13005 13066 13066
+13077 13163 13163
+13163 13211 13211
+13211 13270 13270
+13270 13318 13318
+13318 13350 13350
+13350 13387 13387
+13387 13428 13428
+13428 13464 13533
+13533 13580 13737
+13737 13776 13854
+13854 13913 13913
+13913 13950 13950
+13950 14118 14118
+14118 14150 14150
+14150 14163 14194
+14194 14224 14255
+14255 14275 14319
+14319 14353 14458
+14466 14484 14530
+14534 14567 14567
+14567 14635 14682
+14690 14742 14742
+14742 14789 14789
+14801 14875 14875
+14886 14947 14947
+14947 14992 14992
+14992 15035 15085
+15085 15134 15205
+15214 15267 15448
+15454 15496 16810
+16822 16875 16960
+16972 17053 17179
+17191 17236 17332
+17344 17491 17841
+17853 17939 18304
+18316 18471 18774
+18786 18952 19323
+19335 19364 19496
+19500 19527 19598
+19598 19613 19776
+19797 19808 19837
+19837 19862 19862
+19868 19927 20026
+20034 20075 20179
+20187 20223 20223
+20223 20290 20382
+20392 20441 20589
+20601 20656 20656
+20656 20699 20818
+20826 20860 21038
+21046 21094 21191
+21203 21236 21314
+21326 21395 21457
+21469 21502 21502
+21502 21587 21731
+21756 21789 21864
+21875 21901 21976
+22013 22059 22220
+22257 22397 22561
+22561 22595 22595
+22603 22623 22623
+22631 22667 22828
+22865 22919 22994
+23031 23059 23120
+23132 23201 23201
+23212 23274 23274
+23285 23345 23345
+23356 23393 23393
+23399 23431 23532
+23542 23587 23646
+23656 23697 23745
+23755 23796 23844
+23854 23876 23928
+23942 23971 24153
+24160 24243 24243
+24247 24273 24743
+24755 24784 24984
+24996 25034 25034
+25034 25075 25273
+25281 25332 25410
+25420 25467 25544
+25554 25583 25744
+25754 25783 26061
+26071 26111 26185
+26194 26239 26525
+26535 26568 26914
+26924 26951 26998
+27008 27035 27082
+27093 27120 27167
+27178 27206 27251
+27261 27289 27334
+27345 27391 27931
+27938 27959 28007
+28019 28037 28037
+28043 28069 28069
+28077 28147 28199
+28207 28266 28266
+28274 28306 28306
+28314 28339 28339
+28347 28404 28510
+28518 28567 28682
+28690 28728 28728
+28736 28782 29023
+29033 29085 29234
+29246 29303 29383
+29395 29432 29570
+29592 29631 29644
+29644 29693 29758
+29767 29810 29875
+29875 29911 29976
+29984 30014 30014
+30027 30086 30151
+30157 30223 30293
+30301 30369 30445
+30457 30511 30568
+30580 30630 30743
+30755 30812 30874
+30886 30959 31035
+31043 31076 31175
+31183 31243 31243
+31251 31323 31323
+31331 31433 31433
+31445 31544 31686
+31698 31740 31740
+31740 31783 31783
+31783 31824 31824
+31824 31873 31996
+32008 32056 32164
+32176 32210 32210
+32229 32271 32271
+32279 32323 32569
+32581 32642 32718
+32739 32779 32916
+32926 32953 33047
+33057 33116 33315
+33325 33373 33373
+33373 33407 33469
+33494 33527 33527
+33536 33573 33573
+33584 33650 33697
+33705 33763 33763
+33763 33797 33797
+33797 33829 33906
+33915 33976 33976
+33985 34016 34098
+34098 34133 34198
+34198 34261 34261
+34269 34312 34312
+34324 34363 34438
+34444 34530 34530
+34538 34596 34626
+34636 34675 34754
+34764 34821 34821
+34821 34867 34950
+34959 35016 35135
+35145 35198 35198
+35208 35266 35344
+35355 35382 35537
+35547 35576 35629
+35637 35705 35705
+35713 35764 35764
+35764 35784 35876
+35888 35932 35950
+35950 36013 36138
+36150 36191 36280
+36286 36314 36419
+36431 36516 36516
+36516 36554 36642
+36642 36689 36808
+36818 36881 37105
+37113 37183 37204
+37204 37225 37225
+37225 37255 37348
+37348 37388 37388
+37388 37454 37454
+37454 37518 37518
+37518 37584 37584
+37584 37717 37717
+37717 37752 37752
+37752 37783 37889
+37901 37928 38034
+38046 38115 38115
+38115 38140 38187
+38195 38219 38339
+38351 38422 38422
+38422 38486 38486
+38486 38555 38555
+38555 38619 38619
+38619 38641 38641
+38641 38758 38758
+38758 38929 38929
+38929 38975 39043
+39055 39084 39133
+39133 39175 39265
+39275 39310 39494
+39504 39547 39576
+39587 39614 39668
+39674 39697 39797
+39797 39845 40094
+40094 40158 40264
+40264 40369 40523
+40523 40593 40593
+40593 40629 40876
+40876 40911 40971
+40977 41026 41026
+41038 41077 41077
+41077 41116 41116
+41116 41156 41156
+41156 41195 41195
+41195 41237 41237
+41237 41285 41285
+41285 41304 41304
+41304 41371 41371
+41371 41429 41429
+41429 41491 41491
+41491 41519 41519
+41519 41572 41572
+41572 41642 41642
+41642 41676 41676
+41676 41713 41713
+41713 41751 41751
+41751 41792 41792
+41792 41856 41856
+41856 41881 41881
+41881 41944 41944
+41944 41985 41985
+41985 42026 42026
+42026 42098 42098
+42098 42170 42170
+42170 42213 42213
+42213 42275 42275
+42275 42302 42302
+42302 42317 42317
+42317 42346 42394
+42401 42433 42530
+42538 42585 42585
+42585 42631 42631
+42631 42651 42733
+42733 42756 42756
+42756 42837 42905
+42909 42960 42960
+42960 42986 43033
+43033 43124 43124
+43124 43179 43179
+43179 43212 43384
+43394 43461 43479
+43479 43555 43788
+43806 43929 44124
+44128 44128 44128
+Out of memory: %s
+There is no more memory left in the system for compiling this program.
+Internal Error Unknown Error Message %s
+1) An internal error, while attempting to print an unavailable message
+2) The error message file is inaccessible or has other problems
+Unknown Signal %s
+1) An unknown signal has been caught
+2) 2 Nested signals
+line
+Warning:
+Fatal:
+Source not available
+Too many errors... goodbye.
+There is a limit of 30 errors before aborting.
+Error:
+reserved
+reserved
+Unknown Control Statement
+1) The line begins with a '#' and is not of the form:
+ # ""
+2) Please compile this program with the preprocessor enabled.
+Unknown character %s ignored
+The character is not part of the source character set.
+2.2.1
+Unknown control character \%s ignored
+The control character is not part of the source character set.
+2.2.1
+Illegal character %s in exponent
+1) Digits or sign expected after 'e' or 'E'.
+2) Digits are expected after sign in exponent.
+3.1.3.1
+Constant is out of range and may be truncated.
+The constant is too large to be accurately represented and may be
+truncated. The limits are in the system include file limits.h.
+2.2.4.2
+Constant is out of range for a 32-bit data type, but accepted as written.
+The constant is too large to fit in a 32-bit data type, but will be
+accurately represented in a wider data type. The value may be truncated,
+depending on its context. The limits are in the system include file
+limits.h.
+2.2.4.2
+Character constant size out of range
+1) No characters in a character constant.
+2) More than 4 bytes in a character constant.
+3.1.3.4
+Wide character constant size out of range
+1) No characters in the multibyte sequence (0 assumed).
+2) More than 1 byte in the multi-byte sequence (only the first byte was converted).
+3.1.3.4
+Invalid multibyte character
+4.10.7.2
+Newline in string or character constant
+1) Terminate your string or character constant with closing quotes.
+2) Put a backslash before the newline.
+3.1.3.4, 3.1.4
+Octal character escape too large: %s > %s
+1) Terminate end of octal sequence with a non-octal character.
+2) Select a character value within the limits.
+Value may be truncated
+3.1.3.4, 3.1.4
+Hex character escape too large: %s > %s
+1) Terminate end of hex sequence with a non-hex character.
+2) Select a character value within the limits.
+Value may be truncated
+3.1.3.4, 3.1.4
+Unexpected End-of-file
+1) Unterminated string or character constant
+2) Missing closing comment marker (*/)
+3) File system problems
+Unrecognized escape sequence in string \%s
+Recognized escape sequences are \a, \b, \f, \n, \r, \t, and \v.
+Character will be treated as un-escaped.
+3.9.2
+Illegal octal digit %s
+Octal constants, beginning with 0, must only have digits between 0 and 7,
+inclusive.
+3.1.3.2
+Unable to open temporary file for compiling %s
+1) TMPDIR environment variable is set to a directory that you have no
+ permissions for.
+2) The file system is full.
+3) System errors beyond the scope of the compiler.
+%s: Hangup
+%s: Interrupt
+%s: Quit (ASCII FS)
+%s: Illegal instruction (not reset when caught)
+%s: Trace trap (not reset when caught)
+%s: IOT instruction
+Also SIGABRT, used by abort, replace SIGIOT in the future
+%s: EMT instruction
+Also SIGXCPU, Exceeded CPU time limit
+%s: Floating point exception
+%s: Kill (cannot be caught or ignored)
+%s: Bus error
+%s: Segmentation violation
+%s: Bad argument to system call
+%s: Write on a pipe with no one to read it
+%s: Alarm clock
+%s: Software termination signal from kill
+%s: User defined signal 1
+%s: User defined signal 2
+%s: Death of a child
+Power-fail restart
+%s: Also SIGXFSZ, exceeded file size limit
+%s: Window change
+%s: Handset, line status change
+%s: Sendablestop signalnot from tty
+%s: Stop signal from tty
+%s: Pollable event occurred
+%s: Input/Output possible signal
+%s: Urgent condition on IO channel
+%s: Window size changes
+%s: Virtual time alarm
+%s: Profiling alarm
+%s: Continue a stopped process
+%s: To readers pgrp upon background tty read
+%s: Like TTIN for output if (tp->t_local<OSTOP)
+%s: Resource lost (eg, record-lock)
+'auto' and 'register' are not allowed in an external declaration
+3.7(10)
+must have function type
+3.7.1(30)
+Functions cannot return arrays
+3.7.1(33), 3.3.2.2
+Declaration list not allowed
+3.7.1(5)
+Too many input files %s
+The command line may contain only one file
+cpp internal error: input stack underflow
+cpp internal error: if stack underflow
+Cannot open the file %s
+No new-line character at the end of the file %s
+2.1.1.2(30)
+Fatal: Exceeded the limit of nesting level for #include file
+Fatal: Exceeded the limit of nesting level for #include file. This limit
+is 200.
+Fail to read the file %s
+Cannot write the file %s
+%s: %s: An if directive is not terminated properly in the file
+%s: %s: nested comment
+%s:%s: Illegal macro name %s; macro name shall be an identifier
+%s:%s: Illegal preprocessing token sequence
+3.8.3(35)
+%s:%s: Illegal macro parameter name
+%s:%s: Non-unique macro parameter name
+3.8.3(18)
+%s:%s: Missing ')' in parameter list for #define %s
+%s:%s: Missing ')' in macro instantiation
+%s:%s: Bad punctuator in the parameter list for #define %s
+%s:%s: Macro %s redefined.
+%s:%s: # operator should be followed by a macro argument name
+%s:%s: Badly formed constant expression%s
+3.4(9), 3.8
+%s:%s: Division by zero in #if or #elif
+3.8
+unknown command line option %s
+extraneous input/output file name %s
+%s: %s: Unterminated string or character constant
+A preprocessing string or character constant token was not
+terminated. Note that preprocessing directives are processed
+after the source file has been divided into preprocessing tokens.
+2.1.1.2(30) 3.1(18) 3.8
+%s: %s:
+%s: %s:
+%s: %s: Unterminated comment
+%s: %s: Unknown directive type %s
+%s: %s: #elif or #else after #else directive
+%s: %s: Bad identifier after the %s
+%s: %s: #%s accepts only one identifier as parameter
+3.8
+%s: %s: Bad identifier after the %s
+%s: %s: text following #%s violates the ANSI C standard.
+3.8
+%s: %s: Bad character %s occurs after the # directive.
+3.8
+%s: %s: the ## operator shall not be the %s token in the replacement list
+3.8.3.3
+%s: %s: the defined operator takes identifier as operand only.
+3.8.1
+%s: %s: Not in a conditional directive while using %s
+%s: %s: Illegal filename specification for #include
+%s: %s: Invalid file name %s for #include
+%s: %s: Cannot open file %s for #include
+%s: %s: Bad argument for #line command
+%s: %s: #error %s
+%s: %s: Tried to redefine predefined macro %s, attempt ignored
+3.8.7(22)
+%s: %s: Undefining predefined macro %s
+3.8.7(22)
+%s: %s: Undefined the ANSI standard library defined macro %s
+4.1.2.1(9)
+%s: %s: The number of arguments in the macro invocation does not match the definition
+%s: %s: Illegal character %s in preprocessor if
+%s: %s: Illegal character %s for number in preprocessor if
+%s: %s: No string is allowed in preprocessor if
+%s: %s: Not supported pragma %s
+%s: %s: Not supported #pragma format
+%s: %s: ANSI C does not allow #ident; %s
+%s: %s: Not supported #ident format
+This cpp extension accepts the following format:
+#ident "any string"
+%s: %s: Not supported #assert/#unassert format
+This cpp extension accepts the following format:
+#assert identifier
+#assert identifier ( pp-tokens )
+#unassert identifier
+#unassert identifier ( pp-tokens )
+%s: %s: Bad assertion predicate format
+The correct syntax for this cpp extension is:
+#assert identifier ( pp-token )
+%s: %s: directive is an upward-compatible ANSI C extension
+%s: This option requires an argument
+%s: %s: A macro has expanded recursively more than %s times. Further expansion will be disabled! Use command-line option: -Wp,-max_rec_depth=depth to recurse deeper.
+A status return from cpp to cfe
+Syntax Error
+The token read was unexpected.
+Syntax Error -- cannot backup
+The token read was unexpected.
+Yacc stack overflow
+The expression is too complicated to parse.
+Trailing comma in enumerator list
+The use of a trailing comma in an enumerator list is not standard C. There
+may be portability problems.
+3.5.2.2
+Empty declaration
+Empty declarations are invalid in standard C.
+3.5
+%s declared, but not referenced.
+redeclaration of '%s'; previous declaration at line %s in file '%s'
+Identifier redeclared in the same scope/block.
+3.1.2.3
+'%s' undefined; reoccurrences will not be reported.
+Non-function name referenced in function call.
+3.3.2.2(18)
+The number of arguments doesn't agree with the number in the declaration.
+3.3.2.2(5)
+'%s' section name longer than 8 characters. Name truncated.
+'%s' is already placed by pragma alloc_text.
+Cannot write ucode file while compiling %s
+1) The file system is full
+2) Permissions problem
+Must have corresponding formal argument for '%s'
+Parameter found in the declaration part, but not in the argument list.
+3.7.1(7)
+Non-prototype declaration is an obsolescent feature.
+The use of function definitions with separate parameter identifier
+and declaration lists (not prototype-format parameter type and
+identifier declarators) is an obsolescent feature.
+3.9.5
+Incompatible function declarations for %s
+For two function types to be compatible, both shall specify compatible
+return types. Moreover, the parameter type lists, if both are present,
+shall agree in the number of parameters and in use of the ellipsis
+terminator; corresponding parameters shall have compatible types. If
+one type has a parameter type list and the other type is specified by
+a function declarator that is not part of a function definition and
+contains an empty identifier list, the parameter list shall not have
+an ellipsis terminator and the type of each parameter shall be
+compatible with they type that results from application of the default
+argument promotions. If one type has a parameter type list and the
+other is specified by a function definition that contains a (possibly
+empty) identifier list, both shall agree in the number of parameters,
+and the type of each prototype parameter shall be compatible with the
+type that results from application of the default argument promotions
+to the type of the corresponding identifier. (For each parameter
+declared with function or array type, its type for these comparisons
+is the one that results from conversion to a pointer type. For each
+parameter declared with qualified type, its type for these comparisons
+is the unqualified version of its declared type.) There you have it!
+3.5.4.3(15)
+Incompatible function return type for this function.
+For two function types to be compatible, both shall specify compatible
+return types.
+3.5.4.3(15)
+The number of parameters for function is different from the previous declaration
+The parameter type lists, if both are present, shall agree in the
+number of parameters and in use of the ellipsis terminator.
+3.5.4.3(15)
+Incompatible type for the function parameter
+If both parameter type lists are present, corresponding
+parameters shall have compatible types.
+3.5.4.3(15)
+Function %s is redeclared with an incompatible argument type (after default argument promotion), which could lead to undefined run-time behaviour.
+The redeclaration could cause arguments at a call site to be passed
+inconsistently with what the function implementation expects, and
+parameters would therefore be accessed erroneously when executing the
+function body. Note that a float argument is promoted to a double
+when passed (potentially through fp registers) to an unprototyped
+function.
+3.5.4.3(15)
+prototype and non-prototype declaration found for %s, ellipsis terminator not allowed
+If one type has a parameter type list and the other type is specified
+by a function declarator that is not part of a function definition and
+contains an empty identifier list, the parameter list shall not have
+an ellipsis terminator and the type of each parameter shall be
+compatible with they type that results from application of the default
+argument promotions.
+3.5.4.3(15)
+prototype and non-prototype declaration found for %s, the type of this parameter is not compatible with the type after applying default argument promotion
+If one type has a parameter type list and the other type is specified
+by a function declarator that is not part of a function definition and
+contains an empty identifier list, the type of each parameter shall be
+compatible with the type that results from application of the default
+argument promotions.
+3.5.4.3(15)
+prototype declaration and non-prototype definition found for %s, the type of this parameter is not compatible with the type after applying default argument promotion
+If one type has a parameter type list and the other is specified by a
+function definition that contains a (possibly empty) identifier list,
+both shall agree in the number of parameters, and the type of each
+prototype parameter shall be compatible with the type that results
+from application of the default argument promotions to the type of the
+corresponding identifier.
+3.5.4.3(15)
+Empty declaration specifiers
+Standard C requires at least a storage class specifier, type specifier,
+or a type qualifier in declarations. 'extern int' assumed.
+3.5
+Can't write to the file %s
+1) The output file cannot be opened for writing.
+2) Out of file space.
+Duplicate '%s'
+typedef, extern, static, auto, register, const, volatile may not
+appear more than once in the same specifier list or qualifier list.
+Duplicate occurrence ignored.
+3.5.1(10) , 3.5.3(5)
+Null input
+There is nothing to compile.
+Illegal type combination
+3.5.2
+Missing ';' at end of structure / union member declaration
+In standard C, each member declaration must be terminated by a ';'. A
+terminating ';' is assumed.
+3.5.2.1
+Missing member name in structure / union
+In standard C, each member declaration have a member name. The missing
+member is assumed to not exist.
+3.5.2.1
+This variable is initialized twice.
+Neither 'const' or 'volatile' have any effect on function results.
+Qualifiers only apply to expressions designating an object that
+can be altered or examined.
+3.5.3(10)
+An integer constant expression is required here.
+The expression that defines the value of an enumeration constant
+shall be an integral constant expression that has a value
+representable as an int.
+3.5.2.2(28)
+(previous declaration of '%s' at line %s in file '%s')
+Must be an integer type greater than zero.
+The array size must be either a char, signed or unsigned integer or
+an enumerated type with a value greater than zero.
+3.5.4.2
+Array size cannot be a long long.
+Arrays with more than 2^32 elements are not yet supported.
+The array size must be either a char, signed or unsigned integer or
+an enumerated type with a value greater than zero.
+3.5.4.2
+bit-field '%s' width is not an integer constant
+The expression that specifies the width of a bit-field shall be an
+integral constant expression.
+3.5.2.1(15)
+bit-field '%s' width is negative
+The expression that specifies the width of a bit-field shall be
+non-negative.
+3.5.2.1(15)
+bit-field '%s' type required to be int, unsigned int, or signed int.
+A bit-field shall have type int, unsigned int, or signed int.
+3.5.2.1(30)
+bit-field %s's type not integer.
+Non-scalar type or pointer type to a non-object for increment or decrement operator.
+The operand of the prefix/postfix increment or decrement operator shall have scalar type; if it is of pointer type, it must point to an object.
+3.3.2.4(37), 3.3.3.1(25)
+Assign value to a function type.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.2.2.1(5)
+Assign value to an array.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Change value for variable of incomplete type.
+The operand of increment and decrement operator shall be a modifiable
+scalar lvalue. An assignment operator shall have a modifiable lvalue
+as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+The left-hand side of the '.' operator must be an addressable lvalue, when a bit-field is not contained within a unit of 32 bits alignment.
+This is a restriction in our implementation, which can be worked
+around by always accessing long long bit-fields indirectly (i.e.
+by means of the '->' operator).
+This expression is not an lvalue.
+3.2.2.1
+Modified an rvalue.
+3.2.2.1
+Change value for constant variable.
+The operand of increment and decrement operators shall be modifiable
+scalar lvalues. An assignment operator shall have a modifiable lvalue
+as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Change value for constant field of a struct or union.
+An assignment operator shall have a modifiable lvalue as its left operand.
+3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5)
+Dereferenced a non-pointer.
+The operand of the unary * operator shall have pointer type.
+3.3.3.2(39)
+The operand of the unary + or - operator shall have arithmetic type.
+3.3.3.3(6)
+The operand of the unary ~ operator shall have integral type.
+3.3.3.3(6)
+The operand of the unary ! operator shall have scalar type.
+3.3.3.3(6)
+Constants must have arithmetic type.
+3.1.3
+Bad type name for cast operator
+The type name for the cast operator should either be void or a
+qualified or unqualified scalar type.
+3.3.4(22)
+Improper cast of non-scalar type expression.
+The operand for the cast operator shall be of scalar type.
+3.3.4(23)
+Cast a pointer into a non-integral type.
+A pointer may be converted to an integral type.
+3.3.4(31)
+Cast a non-integral type into a pointer.
+An integral type may be converted to a pointer.
+3.3.4(31)
+Duplicate member '%s'
+Two members of a struct may not have the same name.
+3.1.2.2(7,25)
+Invalid constant expression.
+Constant expressions shall not contain assignment, increment, decrement,
+function-call, or comma operators, except when they are contained within
+the operand of the sizeof operator.
+3.4(9)
+Constant expressions must be derived from a constant value or a constant
+variable.
+3.4
+Dangerous operand of '&'.
+The operand of the unary & operator shall be either a function
+designator or an lvalue that designates an object that is not a
+bit-field and is not declared with the register storage-class
+specifier. This operand is NOT an lvalue, but we let it pass.
+Note that a segmentation error with possible core dump will result
+when the resulting address does not denote a valid (declared)
+storage location. This feature will be discontinued in future
+releases of the compiler!
+3.3.3.2(36)
+Unacceptable operand of '&'.
+The operand of the unary & operator shall be either a function
+designator or an lvalue that designates an object that is not a
+bit-field and is not declared with the register storage-class
+specifier.
+3.3.3.2(36)
+'&' before array or function; ignored
+Unacceptable operand of sizeof operator.
+The sizeof operator shall not be applied to an expression that has
+function type or an incomplete type, to the parenthesized name of such
+a type, or to an lvalue that designates a bit-field object.
+3.3.3.4
+Unacceptable operand of a multiplicative operator.
+Each of the operands of a multiplicative operator shall have arithmetic type.
+3.3.5(18)
+Unacceptable operand of the remainder operator
+Each of the operands of the remainder (%) operator shall have integral type.
+3.3.5(18)
+Unacceptable operand of '+'.
+For the + operator, either both operands shall have arithmetic type, or
+one operand shall be a pointer to an object type and the other shall
+have integral type.
+3.3.6(39)
+Unacceptable operand of '-'.
+For the subtraction operator, one of the following shall hold: both operands
+have arithmetic type; operands are pointers to qualified or unqualified
+versions of compatible object types; or the left operand is a pointer
+to an object type and the right operand has integral type.
+3.3.6(39)
+Unacceptable operand of shift operator.
+Each of the operands of bitwise shift operators shall have integral type.
+3.3.7(9)
+Unacceptable operand of relational operator.
+For relational operators, one of the following shall hold: both
+operands have arithmetic type; both operands are pointers to qualified
+or unqualified versions of compatible object types; or both operands
+are pointers to qualified or unqualified versions of compatible
+incomplete types.
+3.3.8(32)
+Unacceptable operand of == or !=
+For the == or != operator, one of the following shall hold: both operands
+are pointers to qualified or unqualified versions of compatible types; one
+operand is a pointer to an object or incomplete type and the other is a
+pointer to a qualified or unqualified version of void; or one operand is
+a pointer and the other is a null pointer constant.
+3.3.9(21)
+Unacceptable operand of &.
+Each of the operands shall have integral type.
+3.3.10(7)
+Unacceptable operand of ^.
+Each of the operands shall have integral type.
+3.3.11(18)
+Unacceptable operand of |.
+Each of the operands shall have integral type.
+3.3.12(30)
+Unacceptable operand of &&.
+Each of the operands shall have scalar type.
+3.3.13(7)
+Unacceptable operand of ||.
+Each of the operands shall have scalar type.
+3.3.14(20)
+Unacceptable operand of conditional operator.
+The first operand of conditional operator shall have scalar type. One
+of the following shall hold for the second and third operands:
+both operands have arithmetic type; both operands have compatible
+structure or union types; both operands have void type; both operands
+are pointers to qualified or unqualified versions of compatible types;
+one operand is a pointer and the other is a null pointer constant; or
+one operand is pointer to an object or incomplete type and the other
+is a pointer to a qualified or unqualified version of void.
+3.3.15
+Duplicate label '%s'
+A label name can only occur once in a function.
+3.1.2.1(25)
+Division by zero.
+3.3.5
+Subscripting a non-array.
+3.3.2.1
+Subscripting an array of incomplete type which is not an object type.
+The element of the array shall have an object type.
+3.3.2.1
+Should only subscript an array with an integral expression
+3.3.2.1
+Subscripting an unbounded array
+3.3.2.1
+Array index out of range
+3.3.2.1
+Selector requires struct/union pointer as left hand side
+In K&R mode the expression is implicitly converted to the '.' selector
+for a struct/union left-hand side.
+3.3.2.3
+Selector requires struct/union as left hand side
+In K&R mode the expression is implicitly converted to the '->' selector
+for a struct/union pointer left-hand side.
+3.3.2.3
+member of structure or union required
+3.3.2.3
+types have different qualifier specifications
+For two qualified types to be compatible, both shall have the
+identically qualified version of a compatible type; qualified
+and unqualified versions of a type are distinct types. For two
+types to be compatible their types must be the same.
+3.5.3(26)
+Incompatible array type due to different array size
+For two array types to be compatible, both shall have compatible element
+types; if both size specifiers are present, they shall have the
+same value.
+3.5.4.2(11)
+Incompatible array type due to incompatible element type
+For two array types to be compatible, both shall have compatible element
+types.
+3.5.4.2(11)
+Incompatible pointer type assignment
+The type pointed to by the left-hand side of simple assignment
+statement is incompatible with the type pointed to by the right-hand side.
+3.3.16.1, 3.5.4.1(21)
+Incompatible base type of pointer type
+K&R feature.
+Type %s of %s is incompatible with type %s of %s
+Incompatible types can be resolved by casting or by other means.
+3.3.16.1
+illegal combination of pointer and integer
+Assigning an integral expression to a pointer is a bad practice.
+Type for %s is incompatible with %s
+Incompatible types can be resolved by casting or by other means.
+3.1.2.6
+Bad operand type for += or -=
+3.3.16.2(26)
+A case or default label appears outside a switch statement
+A case or default label shall appear only in a switch statement.
+3.6.1
+The controlling expression of the if statement is not scalar type
+The controlling expression of an if statement shall have scalar type.
+3.6.4.1
+The controlling expression of switch statement is not integral type
+The controlling expression of an switch statement shall have integral type.
+3.6.4.2(20)
+The case label is not an integral constant expression
+The case label shall be an integral constant expression.
+3.6.4.2(22)
+Duplicate case label in the same switch statement
+No two of the case constant expressions in the same switch statement
+shall have the same value after conversion.
+3.6.4.2(22)
+More than one default label in the same switch statement
+There may be at most one default label in a switch statement.
+3.6.4.2(23)
+The controlling expression of the iteration statement is not scalar
+type
+The controlling expression of a iteration statement shall have scalar
+type.
+3.6.5.1
+label '%s' used, but not defined
+The identifier in a goto statement shall name a label located
+somewhere in the enclosing function.
+3.6.6.1
+A continue statement shall appear only in or as a loop body
+3.6.6.2
+A break statement shall appear only in or as a switch body or loop body
+3.6.6.3
+A return statement with an expression should not appear
+in a function '%s', whose return type is void
+3.6.6.4(24)
+A return statement without an expression appears in a
+function '%s', whose return type is not void
+If a return statement without an expression is executed, and the value
+of the function call is used by the caller, the behavior is undefined.
+3.6.6.4(33)
+Internal Error: statement stack underflow
+Long double not supported; double assumed.
+Long float not standard; double assumed.
+Only 'register' allowed in parameter declaration
+The only storage-class specifier that shall occur in a parameter
+declaration is 'register'; illegal storage class ignored.
+3.5.4.3(25)
+Name(s) without types in a function declaration
+An old-style function declaration is not allowed to have names
+in the parameter list; useless names ignored
+3.5.4.3(26)
+Functions cannot return functions
+3.7.1(33), 3.3.2.2
+Functions cannot return a non-object type
+3.3.2.2
+enum declaration must contain enum literals
+Although structs or unions may delay the declaration of their members,
+a similar construction with enum does not exist and is not necessary,
+as there can be no mutual dependencies between the declaration of an
+enumerated type and any other type.
+3.5.2.3(27)
+Register qualification has no effect for this type of object
+Register declarations for array, struct, and function types have
+no effect.
+3.5.1(16), 3.5.1(19)
+Functions cannot be declared 'register'
+The declaration of an identifier for a function that has block
+scope shall have no explicit storage-class specifier other than
+'extern'.
+3.5.1(19)
+'%s' cannot be initialized
+The type of the entity to be initialized shall be an object type
+or an array of unknown size.
+3.5.7(32)
+Cannot initialize 'extern' variable '%s' within a function
+If the declaration of an identifier has block scope, and the
+identifier has 'extern' or 'static' linkage, the declaration
+shall have no initializer for the identifier; initialization
+allowed anyway.
+3.5.7(35)
+initializing an 'extern' is an ANSI C extension
+conflicting declarations for '%s'
+'static' and 'extern' declarations conflict. Which is meant?
+3.1.2.2(15), 3.1.2.2(27)
+Too many initial values for '%s'
+3.5.7(1)
+incompatible types in initialization
+3.3.16(35)
+redefinition of '%s'; previous definition at line %s in file '%s'
+Identifier redeclared in the same scope/block.
+3.1.2.3
+bit-fields as members of a union are an ANSI C invention.
+storage size for '%s' isn't known
+type mismatch in initialization
+Missing braces in a union initialization or illegally formed
+initialization.
+3.5.7(5)
+union '%s' only allowed one initializer for the first member
+3.5.7(5)
+width of '%s' exceeds its type
+the specified bitfield width is too large to be contained within a
+bitfield type.
+structure has no member named '%s'
+This is allowed for compatibility with AT&T pcc-based compilers.
+Reference of an expression of void type or an incomplete type.
+3.2.2.1
+element size of an array shall not be zero
+3.2.2.5(25)
+invalid combination of type specifiers
+Although order is unimportant, not all type specifiers can occur together.
+3.5.2
+declaration must at least declare an identifier, tag, or the member of an enumeration
+3.5(16)
+at most one storage class may be given in the declaration
+Duplicate occurrence ignored.
+3.5.1(10)
+size of function's return type is zero
+The return type of a function must be void or an object type other than array.
+3.7.1(33)
+Expecting an integral return type from the main function
+identifier missing from parameter declaration
+Prototypes for function definitions require identifiers in parameter
+declarations.
+3.7.1(4)
+only 'register' allowed for storage class for parameters
+The declarations in the declaration list shall contain no storage class
+other than 'register', and no initializations.
+3.7.1(10)
+parameters declarations can not have initializations
+3.7.1(10)
+only one instance of 'void' allowed in the parameter list
+'void' must occur by itself (specifying that the function has no parameters).
+3.5.4.3(1)
+%s must have function type
+1) An argument list must be explicitly present in the declarator; it cannot
+ be inherited from a typedef (3.5.4.3).
+2) The declarator is not a function.
+3.7.1(30)
+Illegal hexadecimal constant
+You have no digits after the 0x or 0X. 0x0 assumed.
+3.1.3.2
+value overflows its type in this context. Value is set to be '%s'!
+3.2.1.4
+value is outside range representable for type '%s'
+missing member name
+K&R mode permits a missing member name; otherwise, only bitfields can omit
+the member name.
+3.5.2.1(10)
+useless keyword or type name in declaration
+Type was ignored.
+'%s' declared within and is limited to this function prototype
+Possible program error, since parameter type checking will always fail
+unless the type declaration is visible to the caller.
+3.1.2.1(35)
+Extra spaces within operator, %s assumed
+In ANSI C, the compound assignment operator cannot have embedded
+white space characters.
+3.1.5
+missing size for array '%s'
+Incomplete types permitted for identifiers with internal or
+external linkage, but not automatic linkage.
+3.1.2.5(10)
+can't jump into (from outside of) the body of a 'try' or into either type of handler
+'%s' missing, please #include excpt.h
+excpt.h required to declare exception statements, intrinsics or compiler
+runtime names.
+local function declarations cannot be 'static'
+A function declaration can only contain the storage-class 'static'
+if it is at file scope. Declaration made 'extern'.
+3.5.1(19)
+static function '%s' declared and referenced, but not defined.
+If an identifier declared with internal linkage is used in an
+expression (other than as a part of the operand of a sizeof
+operator), there shall be exactly one external definition for
+the identifier in the translation unit.
+3.7(12)
+pragma argument '%s' must be declared prior to being used in a pragma
+Pragma name ignored.
+Pragma not supported
+'%s' not enabled as intrinsic
+It may have already appeared in a function pragma, or never occurred in
+an intrinsic pragma.
+'%s' is already enabled as an intrinsic
+weak definition for '%s' is later redefined; pragma weak ignored.
+definition of primary name '%s' not found; pragma weak ignored.
+definition of secondary name '%s' not found; pragma weak ignored.
+primary name '%s' is declared as a common or external, and is not defined
+with initial value within this file; pragma weak ignored.
+useless '%s' storage class ignored
+array of functions not allowed
+The element type must be an object type representing a region
+of data storage which can represent values.
+3.1.2.5(23)
+array of voids not allowed
+The element type must be an object type representing a region
+of data storage which can represent values.
+3.1.2.5(23)
+argument for pragma pack must be an integer constant; pragma ignored
+'%s' has wrong tag type.
+Identifier redeclared in the same scope/block.
+3.1.2.3
+missing dimension bound
+For multidimensional arrays, the constant bounds of the array may be
+omitted only for the first member of the sequence.
+3.1.2.5(23)
+Internal error in parameters to function substr; loc: '%s'; len: '%s'.
+Internal error in parameters to function insertstr; indx: '%s'.
+Internal error in function get_tag_name; input is a non-tagged type.
+Internal error in function gen_type_str -- not a type tree '%s'
+Cannot open file '%s'
+Prototype should be moved after tag or a typedef declaration.
+Please look for comments in the extracted header file.
+The extracted header file includes prototypes for static functions,
+which should be removed, if you wish to include the header in a source file
+other than the originator.
+ANSI C requires formal parameter before "..."
+This extension is meant to be used for compatibility with varargs.h
+3.5.4.3(35)
+syntax error: "&..." invalid
+extension used to access "..." formal arguments.
+function '%s' initialized like a variable
+The type of entity to be initialized shall be an object type or an
+array of unknown size.
+3.5.7(31)
+initializer not an array aggregate
+The initializer for an object that has aggregate type shall be a
+brace-enclosed list of initializers for the members of the aggregate,
+written in increasing subscript or member order.
+3.5.7(20)
+'%s' type is incomplete; cannot initialize
+Was the struct ever defined?
+3.5.7.(31)
+'%s' is not standard ANSI.
+This keyword/type is not defined in strict ANSI mode.
+3.1.1
+not a legal asm string
+The first operand of an asm string should be, after argument substitution,
+a legal assembly string.
+The -float option will be ignored in ANSI mode.
+The -float option is ignored, since otherwise program semantics would
+violate the ANSI standard. In particular, fp constants are always
+'double' with ANSI-C, while with -float the type of fp constants will
+depend on the context and may be 'float'.
+ANSI C support unavailable with C compiler bundled with RISC/os
+The C compiler bundled with RISC/os does not support ANSI C. ANSI
+C support requires a separate license.
+Ignored invalid warning number(s) in -woff option, %s%s !
+Warning numbers must be in the range %s to %s.
+The set of warning numbers in cfe is disjoint from the set of warning numbers
+in accom, since accom warnings cannot be mapped one-to-one to cfe warnings.
+'%s' not handled as an intrinsic due to incompatible argument types .
+'__unalign' only qualifies pointers
+'__unalign' indicates the object pointed at by pointer is unaligned (e.g.,
+int * __unalign p). This is an extension to ANSI C and like 'volatile'
+and 'const' can follow the '*' in pointer declarations, but unlike both
+cannot qualify a base type.
+index expression is an anachronism
+ANSI C++ doesn't support array index expressions in delete.
+5.3.4
+member cannot be of function or incomplete type.
+3.5.2.1(12)
+Illegal lint option, '%s', is ignored.
+cannot open header message buffer file
+cannot write header message buffer file
+cannot read header message buffer file
+cannot seek in header message buffer file
+struct/union/enum '%s' is used, but not defined
+static '%s' unused
+nonportable character comparison (chars may be signed or unsigned)
+redundant comparison of unsigned with constant expression
+redundant statement, control flow cannot reach this statement
+'%s' may be used before set
+function parameter '%s' is not used in function '%s'
+'%s' can be const qualified, since it is not set within its lifetime.
+'%s' is not used in function '%s'
+'%s' set but unused in function '%s'
+control may fall through %s statement
+function '%s' has return(e); and return;
+function '%s' may return random value to place of invocation %s
+label without goto: '%s'
+only %s bits of '%s' constant (type '%s') are explicitly given
+explicit conversion from '%s' to '%s' %s
+implicit conversion from '%s' to '%s' %s
+'%s' may be indistinguishable from '%s' due to internal name truncation
+Promoted formal parameter and promoted argument have incompatible types
+No prototype for the definition of '%s' %s
+References to '%s' are substituted by its literal initializer
+ (as included in %s)
+==============
+unsupported language linkage
+string-literal specifies an unsupported linkage
+7.4(1)
+No prototype for the call to %s
+To achieve better type-checking, there should be a full prototype for
+the function being called.
+3.5.4.3
+'inline' only applies to function declarations
+leave statment can occur only within try body
+Microsoft extension
+Use of a Microsoft extension detected without usage of the
+compiler option -msft.
+No parameter mentioned
+A file with no declarations or definitions is accepted as an extension to ANSI C
+The translation unit must contain at least one external definition.
+3.7
+Incompatible signed and unsigned version of a type
+Yacc initialization error
+Internal error: yacc cannot initialize itself.
+The cfe option %s may not be in future releases. We suggest that you not use this option!
+Incompatible char and unsigned char versions of a type
+Lshift with undefined behaviour.
+Lshift with a negative right operand, or a right operand that is greater
+than or equal to the width in bits of the promoted left operand, results
+in undefined behaviour.
+3.3.7(11)
+useless type name in declaration, possibly a semicolon is missing.
+Type was ignored.
+constant initializer expression is invalid (refers to automatic variables).
+All the expressions in an initializer for an object that has static storage
+duration or in the initializer list for an object that has aggregate or
+union type shall be constant expressions. Otherwise, unexpected results
+may occur.
+3.5.7(32) and 3.4
+invalid explicit or implicit conversion of an address constant to an integral value in a constant initializing expression.
+An address constant in a constant initializing expression can neither
+initialize a bit-field nor be directly or indirectly converted to an
+integral type of size different from an address type.
+6.4
diff --git a/ido/ido7.1_recomp/ugen b/ido/ido7.1_recomp/ugen
new file mode 100755
index 00000000..e8e87563
Binary files /dev/null and b/ido/ido7.1_recomp/ugen differ
diff --git a/ido/ido7.1_recomp/ujoin b/ido/ido7.1_recomp/ujoin
new file mode 100755
index 00000000..98ba6065
Binary files /dev/null and b/ido/ido7.1_recomp/ujoin differ
diff --git a/ido/ido7.1_recomp/uld b/ido/ido7.1_recomp/uld
new file mode 100755
index 00000000..38833f5b
Binary files /dev/null and b/ido/ido7.1_recomp/uld differ
diff --git a/ido/ido7.1_recomp/umerge b/ido/ido7.1_recomp/umerge
new file mode 100755
index 00000000..5b78e92e
Binary files /dev/null and b/ido/ido7.1_recomp/umerge differ
diff --git a/ido/ido7.1_recomp/uopt b/ido/ido7.1_recomp/uopt
new file mode 100755
index 00000000..fd93d2dc
Binary files /dev/null and b/ido/ido7.1_recomp/uopt differ
diff --git a/ido/ido7.1_recomp/usplit b/ido/ido7.1_recomp/usplit
new file mode 100755
index 00000000..e6a69ef8
Binary files /dev/null and b/ido/ido7.1_recomp/usplit differ
diff --git a/include/2.0L/PR/PRimage.h b/include/2.0L/PR/PRimage.h
new file mode 100755
index 00000000..7bab1ad9
--- /dev/null
+++ b/include/2.0L/PR/PRimage.h
@@ -0,0 +1,125 @@
+/**************************************************************************
+ *
+ * $Revision: 1.4 $
+ * $Date: 1997/11/26 00:30:50 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/PRimage.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __GL_IMAGE_H__
+#define __GL_IMAGE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*
+ * Defines for image files . . . .
+ *
+ * Paul Haeberli - 1984
+ * Look in /usr/people/4Dgifts/iristools/imgtools for example code!
+ *
+ */
+
+
+#define IMAGIC 0732
+
+/* colormap of images */
+#define CM_NORMAL 0 /* file contains rows of values which
+ * are either RGB values (zsize == 3)
+ * or greyramp values (zsize == 1) */
+#define CM_DITHERED 1
+#define CM_SCREEN 2 /* file contains data which is a screen
+ * image; getrow returns buffer which
+ * can be displayed directly with
+ * writepixels */
+#define CM_COLORMAP 3 /* a colormap file */
+
+#define TYPEMASK 0xff00
+#define BPPMASK 0x00ff
+#define ITYPE_VERBATIM 0x0000
+#define ITYPE_RLE 0x0100
+#define ISRLE(type) (((type) & 0xff00) == ITYPE_RLE)
+#define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM)
+#define BPP(type) ((type) & BPPMASK)
+#define RLE(bpp) (ITYPE_RLE | (bpp))
+#define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp))
+#define IBUFSIZE(pixels) (((pixels)+((pixels)>>6))<<2)
+#define RLE_NOP 0x00
+
+#define ierror(p) (((p)->flags&_IOERR)!=0)
+#define ifileno(p) ((p)->file)
+#define getpix(p) (--(p)->cnt>=0 ? *(p)->ptr++ : ifilbuf(p))
+#define putpix(p,x) (--(p)->cnt>=0 \
+ ? ((int)(*(p)->ptr++=(unsigned)(x))) \
+ : iflsbuf(p,(unsigned)(x)))
+
+typedef struct {
+ unsigned short imagic; /* stuff saved on disk . . */
+ unsigned short type;
+ unsigned short dim;
+ unsigned short xsize;
+ unsigned short ysize;
+ unsigned short zsize;
+ unsigned long min;
+ unsigned long max;
+ unsigned long wastebytes;
+ char name[80];
+ unsigned long colormap;
+
+ long file; /* stuff used in core only */
+ unsigned short flags;
+ short dorev;
+ short x;
+ short y;
+ short z;
+ short cnt;
+ unsigned short *ptr;
+ unsigned short *base;
+ unsigned short *tmpbuf;
+ unsigned long offset;
+ unsigned long rleend; /* for rle images */
+ unsigned long *rowstart; /* for rle images */
+ long *rowsize; /* for rle images */
+} IMAGE;
+
+IMAGE *icreate();
+/*
+ * IMAGE *iopen(char *file, char *mode, unsigned int type, unsigned int dim,
+ * unsigned int xsize, unsigned int ysize, unsigned int zsize);
+ * IMAGE *fiopen(int f, char *mode, unsigned int type, unsigned int dim,
+ * unsigned int xsize, unsigned int ysize, unsigned int zsize);
+ *
+ * ...while iopen and fiopen can take an extended set of parameters, the
+ * last five are optional, so a more correct prototype would be:
+ *
+ */
+IMAGE *iopen(char *file, char *mode, ...);
+IMAGE *fiopen(int f, char *mode, ...);
+
+/*
+ *
+ * unsigned short *ibufalloc(IMAGE *image);
+ * int ifilbuf(IMAGE *image);
+ * int iflush(IMAGE *image);
+ * unsigned int iflsbuf(IMAGE *image, unsigned int c);
+ * void isetname(IMAGE *image, char *name);
+ * void isetcolormap(IMAGE *image, int colormap);
+ */
+
+int iclose(IMAGE *image);
+int putrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z);
+int getrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z);
+
+/*
+IMAGE *iopen();
+IMAGE *icreate();
+*/
+
+unsigned short *ibufalloc();
+
+#define IMAGEDEF /* for backwards compatibility */
+#ifdef __cplusplus
+}
+#endif
+#endif /* !__GL_IMAGE_H__ */
diff --git a/include/2.0L/PR/R4300.h b/include/2.0L/PR/R4300.h
new file mode 100755
index 00000000..932694d3
--- /dev/null
+++ b/include/2.0L/PR/R4300.h
@@ -0,0 +1,453 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.13 $
+ * $Date: 1997/02/11 08:15:34 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __R4300_H__
+#define __R4300_H__
+
+#include
+
+/*
+ * Segment base addresses and sizes
+ */
+#define KUBASE 0
+#define KUSIZE 0x80000000
+#define K0BASE 0x80000000
+#define K0SIZE 0x20000000
+#define K1BASE 0xA0000000
+#define K1SIZE 0x20000000
+#define K2BASE 0xC0000000
+#define K2SIZE 0x20000000
+
+/*
+ * Exception vectors
+ */
+#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */
+#define UT_VEC K0BASE /* utlbmiss vector */
+#define R_VEC (K1BASE+0x1fc00000) /* reset vector */
+#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */
+#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */
+#define E_VEC (K0BASE+0x180) /* Gen. exception vector */
+
+/*
+ * Address conversion macros
+ */
+#ifdef _LANGUAGE_ASSEMBLY
+
+#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */
+#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */
+#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */
+#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */
+#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */
+#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */
+#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */
+
+#else /* _LANGUAGE_C */
+
+#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */
+#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */
+#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */
+#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */
+#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */
+#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */
+#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+/*
+ * Address predicates
+ */
+#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE)
+#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE)
+#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE)
+#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE)
+#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE)
+#define IS_KUSEG(x) ((u32)(x) < K0BASE)
+
+/*
+ * TLB size constants
+ */
+
+#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */
+
+#define TLBHI_VPN2MASK 0xffffe000
+#define TLBHI_VPN2SHIFT 13
+#define TLBHI_PIDMASK 0xff
+#define TLBHI_PIDSHIFT 0
+#define TLBHI_NPID 255 /* 255 to fit in 8 bits */
+
+#define TLBLO_PFNMASK 0x3fffffc0
+#define TLBLO_PFNSHIFT 6
+#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */
+#define TLBLO_CACHSHIFT 3
+#define TLBLO_UNCACHED 0x10 /* not cached */
+#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */
+#define TLBLO_EXLWR 0x28 /* Exclusive write */
+#define TLBLO_D 0x4 /* writeable */
+#define TLBLO_V 0x2 /* valid bit */
+#define TLBLO_G 0x1 /* global access bit */
+
+#define TLBINX_PROBE 0x80000000
+#define TLBINX_INXMASK 0x3f
+#define TLBINX_INXSHIFT 0
+
+#define TLBRAND_RANDMASK 0x3f
+#define TLBRAND_RANDSHIFT 0
+
+#define TLBWIRED_WIREDMASK 0x3f
+
+#define TLBCTXT_BASEMASK 0xff800000
+#define TLBCTXT_BASESHIFT 23
+#define TLBCTXT_BASEBITS 9
+
+#define TLBCTXT_VPNMASK 0x7ffff0
+#define TLBCTXT_VPNSHIFT 4
+
+#define TLBPGMASK_4K 0x0
+#define TLBPGMASK_16K 0x6000
+#define TLBPGMASK_64K 0x1e000
+
+/*
+ * Status register
+ */
+#define SR_CUMASK 0xf0000000 /* coproc usable bits */
+
+#define SR_CU3 0x80000000 /* Coprocessor 3 usable */
+#define SR_CU2 0x40000000 /* Coprocessor 2 usable */
+#define SR_CU1 0x20000000 /* Coprocessor 1 usable */
+#define SR_CU0 0x10000000 /* Coprocessor 0 usable */
+#define SR_RP 0x08000000 /* Reduced power (quarter speed) */
+#define SR_FR 0x04000000 /* MIPS III FP register mode */
+#define SR_RE 0x02000000 /* Reverse endian */
+#define SR_ITS 0x01000000 /* Instruction trace support */
+#define SR_BEV 0x00400000 /* Use boot exception vectors */
+#define SR_TS 0x00200000 /* TLB shutdown */
+#define SR_SR 0x00100000 /* Soft reset occured */
+#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */
+#define SR_CE 0x00020000 /* Create ECC */
+#define SR_DE 0x00010000 /* ECC of parity does not cause error */
+
+/*
+ * Interrupt enable bits
+ * (NOTE: bits set to 1 enable the corresponding level interrupt)
+ */
+#define SR_IMASK 0x0000ff00 /* Interrupt mask */
+#define SR_IMASK8 0x00000000 /* mask level 8 */
+#define SR_IMASK7 0x00008000 /* mask level 7 */
+#define SR_IMASK6 0x0000c000 /* mask level 6 */
+#define SR_IMASK5 0x0000e000 /* mask level 5 */
+#define SR_IMASK4 0x0000f000 /* mask level 4 */
+#define SR_IMASK3 0x0000f800 /* mask level 3 */
+#define SR_IMASK2 0x0000fc00 /* mask level 2 */
+#define SR_IMASK1 0x0000fe00 /* mask level 1 */
+#define SR_IMASK0 0x0000ff00 /* mask level 0 */
+
+#define SR_IBIT8 0x00008000 /* bit level 8 */
+#define SR_IBIT7 0x00004000 /* bit level 7 */
+#define SR_IBIT6 0x00002000 /* bit level 6 */
+#define SR_IBIT5 0x00001000 /* bit level 5 */
+#define SR_IBIT4 0x00000800 /* bit level 4 */
+#define SR_IBIT3 0x00000400 /* bit level 3 */
+#define SR_IBIT2 0x00000200 /* bit level 2 */
+#define SR_IBIT1 0x00000100 /* bit level 1 */
+
+#define SR_IMASKSHIFT 8
+
+#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */
+#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */
+#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */
+#define SR_KSU_MASK 0x00000018 /* mode mask */
+#define SR_KSU_USR 0x00000010 /* user mode */
+#define SR_KSU_SUP 0x00000008 /* supervisor mode */
+#define SR_KSU_KER 0x00000000 /* kernel mode */
+#define SR_ERL 0x00000004 /* Error level, 1=>cache error */
+#define SR_EXL 0x00000002 /* Exception level, 1=>exception */
+#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */
+
+/*
+ * Cause Register
+ */
+#define CAUSE_BD 0x80000000 /* Branch delay slot */
+#define CAUSE_CEMASK 0x30000000 /* coprocessor error */
+#define CAUSE_CESHIFT 28
+
+/* Interrupt pending bits */
+#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */
+#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */
+#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */
+#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */
+#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */
+#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */
+#define CAUSE_SW2 0x00000200 /* Software level 2 pending */
+#define CAUSE_SW1 0x00000100 /* Software level 1 pending */
+
+#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */
+#define CAUSE_IPSHIFT 8
+
+#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */
+
+#define CAUSE_EXCSHIFT 2
+
+/* Cause register exception codes */
+
+#define EXC_CODE(x) ((x)<<2)
+
+/* Hardware exception codes */
+#define EXC_INT EXC_CODE(0) /* interrupt */
+#define EXC_MOD EXC_CODE(1) /* TLB mod */
+#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */
+#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */
+#define EXC_RADE EXC_CODE(4) /* Read Address Error */
+#define EXC_WADE EXC_CODE(5) /* Write Address Error */
+#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */
+#define EXC_DBE EXC_CODE(7) /* Data Bus Error */
+#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */
+#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */
+#define EXC_II EXC_CODE(10) /* Illegal Instruction */
+#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */
+#define EXC_OV EXC_CODE(12) /* OVerflow */
+#define EXC_TRAP EXC_CODE(13) /* Trap exception */
+#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */
+#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */
+#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */
+#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */
+
+/* C0_PRID Defines */
+#define C0_IMPMASK 0xff00
+#define C0_IMPSHIFT 8
+#define C0_REVMASK 0xff
+#define C0_MAJREVMASK 0xf0
+#define C0_MAJREVSHIFT 4
+#define C0_MINREVMASK 0xf
+
+/*
+ * Coprocessor 0 operations
+ */
+#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */
+#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */
+#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */
+#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */
+#define C0_RFE 0x10 /* restore for exception */
+
+/*
+ * 'cache' instruction definitions
+ */
+
+/* Target cache */
+#define CACH_PI 0x0 /* specifies primary inst. cache */
+#define CACH_PD 0x1 /* primary data cache */
+#define CACH_SI 0x2 /* secondary instruction cache */
+#define CACH_SD 0x3 /* secondary data cache */
+
+/* Cache operations */
+#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */
+#define C_IWBINV 0x0 /* index writeback inval (d, sd) */
+#define C_ILT 0x4 /* index load tag (all) */
+#define C_IST 0x8 /* index store tag (all) */
+#define C_CDX 0xc /* create dirty exclusive (d, sd) */
+#define C_HINV 0x10 /* hit invalidate (all) */
+#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */
+#define C_FILL 0x14 /* fill (i) */
+#define C_HWB 0x18 /* hit writeback (i, d, sd) */
+#define C_HSV 0x1c /* hit set virt. (si, sd) */
+
+/*
+ * Cache size definitions
+ */
+#define ICACHE_SIZE 0x4000 /* 16K */
+#define ICACHE_LINESIZE 32 /* 8 words */
+#define ICACHE_LINEMASK (ICACHE_LINESIZE-1)
+
+#define DCACHE_SIZE 0x2000 /* 8K */
+#define DCACHE_LINESIZE 16 /* 4 words */
+#define DCACHE_LINEMASK (DCACHE_LINESIZE-1)
+
+/*
+ * C0_CONFIG register definitions
+ */
+#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */
+#define CONFIG_EC 0x70000000 /* System Clock ratio */
+#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */
+#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */
+#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */
+#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */
+#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */
+#define CONFIG_SB 0x00c00000 /* Secondary cache block size */
+
+#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */
+#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */
+#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */
+#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */
+#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/
+#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */
+#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */
+#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */
+
+#define CONFIG_IC 0x00000e00 /* Primary Icache size */
+#define CONFIG_DC 0x000001c0 /* Primary Dcache size */
+#define CONFIG_IB 0x00000020 /* Icache block size */
+#define CONFIG_DB 0x00000010 /* Dcache block size */
+#define CONFIG_CU 0x00000008 /* Update on Store-conditional */
+#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */
+
+#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */
+#define CONFIG_NONCOHRNT 0x00000003
+#define CONFIG_COHRNT_EXLWR 0x00000005
+#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */
+#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */
+#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */
+#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */
+
+/*
+ * C0_TAGLO definitions for setting/getting cache states and physaddr bits
+ */
+#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */
+#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */
+#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */
+#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */
+#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */
+#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */
+#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */
+#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */
+
+#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */
+#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */
+#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */
+#define PINVALID 0x0000 /* invalid --> 000 == state 0 */
+#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */
+#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */
+#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */
+
+/*
+ * C0_CACHE_ERR definitions.
+ */
+#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */
+#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */
+#define CACHERR_ED 0x20000000 /* 1: data error */
+#define CACHERR_ET 0x10000000 /* 1: tag error */
+#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/
+#define CACHERR_EE 0x04000000 /* error on SysAD bus */
+#define CACHERR_EB 0x02000000 /* complicated, see spec. */
+#define CACHERR_EI 0x01000000 /* complicated, see spec. */
+#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */
+#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */
+#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */
+
+/* R4000 family supports hardware watchpoints:
+ * C0_WATCHLO:
+ * bits 31..3 are bits 31..3 of physaddr to watch
+ * bit 2: reserved; must be written as 0.
+ * bit 1: when set causes a watchpoint trap on load accesses to paddr.
+ * bit 0: when set traps on stores to paddr;
+ * C0_WATCHHI
+ * bits 31..4 are reserved and must be written as zeros.
+ * bits 3..0 are bits 35..32 of the physaddr to watch
+ */
+#define WATCHLO_WTRAP 0x00000001
+#define WATCHLO_RTRAP 0x00000002
+#define WATCHLO_ADDRMASK 0xfffffff8
+#define WATCHLO_VALIDMASK 0xfffffffb
+#define WATCHHI_VALIDMASK 0x0000000f
+
+/*
+ * Coprocessor 0 registers
+ */
+#ifdef _LANGUAGE_ASSEMBLY
+#define C0_INX $0
+#define C0_RAND $1
+#define C0_ENTRYLO0 $2
+#define C0_ENTRYLO1 $3
+#define C0_CONTEXT $4
+#define C0_PAGEMASK $5 /* page mask */
+#define C0_WIRED $6 /* # wired entries in tlb */
+#define C0_BADVADDR $8
+#define C0_COUNT $9 /* free-running counter */
+#define C0_ENTRYHI $10
+#define C0_SR $12
+#define C0_CAUSE $13
+#define C0_EPC $14
+#define C0_PRID $15 /* revision identifier */
+#define C0_COMPARE $11 /* counter comparison reg. */
+#define C0_CONFIG $16 /* hardware configuration */
+#define C0_LLADDR $17 /* load linked address */
+#define C0_WATCHLO $18 /* watchpoint */
+#define C0_WATCHHI $19 /* watchpoint */
+#define C0_ECC $26 /* S-cache ECC and primary parity */
+#define C0_CACHE_ERR $27 /* cache error status */
+#define C0_TAGLO $28 /* cache operations */
+#define C0_TAGHI $29 /* cache operations */
+#define C0_ERROR_EPC $30 /* ECC error prg. counter */
+
+# else /* ! _LANGUAGE_ASSEMBLY */
+
+#define C0_INX 0
+#define C0_RAND 1
+#define C0_ENTRYLO0 2
+#define C0_ENTRYLO1 3
+#define C0_CONTEXT 4
+#define C0_PAGEMASK 5 /* page mask */
+#define C0_WIRED 6 /* # wired entries in tlb */
+#define C0_BADVADDR 8
+#define C0_COUNT 9 /* free-running counter */
+#define C0_ENTRYHI 10
+#define C0_SR 12
+#define C0_CAUSE 13
+#define C0_EPC 14
+#define C0_PRID 15 /* revision identifier */
+#define C0_COMPARE 11 /* counter comparison reg. */
+#define C0_CONFIG 16 /* hardware configuration */
+#define C0_LLADDR 17 /* load linked address */
+#define C0_WATCHLO 18 /* watchpoint */
+#define C0_WATCHHI 19 /* watchpoint */
+#define C0_ECC 26 /* S-cache ECC and primary parity */
+#define C0_CACHE_ERR 27 /* cache error status */
+#define C0_TAGLO 28 /* cache operations */
+#define C0_TAGHI 29 /* cache operations */
+#define C0_ERROR_EPC 30 /* ECC error prg. counter */
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+/*
+ * floating-point status register
+ */
+#define FPCSR_FS 0x01000000 /* flush denorm to zero */
+#define FPCSR_C 0x00800000 /* condition bit */
+#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */
+#define FPCSR_CV 0x00010000 /* cause: invalid operation */
+#define FPCSR_CZ 0x00008000 /* cause: division by zero */
+#define FPCSR_CO 0x00004000 /* cause: overflow */
+#define FPCSR_CU 0x00002000 /* cause: underflow */
+#define FPCSR_CI 0x00001000 /* cause: inexact operation */
+#define FPCSR_EV 0x00000800 /* enable: invalid operation */
+#define FPCSR_EZ 0x00000400 /* enable: division by zero */
+#define FPCSR_EO 0x00000200 /* enable: overflow */
+#define FPCSR_EU 0x00000100 /* enable: underflow */
+#define FPCSR_EI 0x00000080 /* enable: inexact operation */
+#define FPCSR_FV 0x00000040 /* flag: invalid operation */
+#define FPCSR_FZ 0x00000020 /* flag: division by zero */
+#define FPCSR_FO 0x00000010 /* flag: overflow */
+#define FPCSR_FU 0x00000008 /* flag: underflow */
+#define FPCSR_FI 0x00000004 /* flag: inexact operation */
+#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */
+#define FPCSR_RM_RN 0x00000000 /* round to nearest */
+#define FPCSR_RM_RZ 0x00000001 /* round to zero */
+#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */
+#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */
+
+#endif /* __R4300_H */
diff --git a/include/2.0L/PR/abi.h b/include/2.0L/PR/abi.h
new file mode 100755
index 00000000..2102bc87
--- /dev/null
+++ b/include/2.0L/PR/abi.h
@@ -0,0 +1,410 @@
+#ifndef _ABI_H_
+#define _ABI_H_
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.32 $
+ * $Date: 1997/02/11 08:16:37 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/abi.h,v $
+ *
+ **************************************************************************/
+
+/*
+ * Header file for the Audio Binary Interface.
+ * This is included in the Media Binary Interface file
+ * mbi.h.
+ *
+ * This file follows the framework used for graphics.
+ *
+ */
+
+/* Audio commands: */
+#define A_SPNOOP 0
+#define A_ADPCM 1
+#define A_CLEARBUFF 2
+#define A_ENVMIXER 3
+#define A_LOADBUFF 4
+#define A_RESAMPLE 5
+#define A_SAVEBUFF 6
+#define A_SEGMENT 7
+#define A_SETBUFF 8
+#define A_SETVOL 9
+#define A_DMEMMOVE 10
+#define A_LOADADPCM 11
+#define A_MIXER 12
+#define A_INTERLEAVE 13
+#define A_POLEF 14
+#define A_SETLOOP 15
+
+#define ACMD_SIZE 32
+/*
+ * Audio flags
+ */
+
+#define A_INIT 0x01
+#define A_CONTINUE 0x00
+#define A_LOOP 0x02
+#define A_OUT 0x02
+#define A_LEFT 0x02
+#define A_RIGHT 0x00
+#define A_VOL 0x04
+#define A_RATE 0x00
+#define A_AUX 0x08
+#define A_NOAUX 0x00
+#define A_MAIN 0x00
+#define A_MIX 0x10
+
+/*
+ * BEGIN C-specific section: (typedef's)
+ */
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/*
+ * Data Structures.
+ */
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int gain:16;
+ unsigned int addr;
+} Aadpcm;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int gain:16;
+ unsigned int addr;
+} Apolef;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int pad1:16;
+ unsigned int addr;
+} Aenvelope;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:8;
+ unsigned int dmem:16;
+ unsigned int pad2:16;
+ unsigned int count:16;
+} Aclearbuff;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:8;
+ unsigned int pad2:16;
+ unsigned int inL:16;
+ unsigned int inR:16;
+} Ainterleave;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:24;
+ unsigned int addr;
+} Aloadbuff;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int pad1:16;
+ unsigned int addr;
+} Aenvmixer;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int gain:16;
+ unsigned int dmemi:16;
+ unsigned int dmemo:16;
+} Amixer;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int dmem2:16;
+ unsigned int addr;
+} Apan;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int pitch:16;
+ unsigned int addr;
+} Aresample;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int pad1:16;
+ unsigned int addr;
+} Areverb;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:24;
+ unsigned int addr;
+} Asavebuff;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:24;
+ unsigned int pad2:2;
+ unsigned int number:4;
+ unsigned int base:24;
+} Asegment;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int dmemin:16;
+ unsigned int dmemout:16;
+ unsigned int count:16;
+} Asetbuff;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int flags:8;
+ unsigned int vol:16;
+ unsigned int voltgt:16;
+ unsigned int volrate:16;
+} Asetvol;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:8;
+ unsigned int dmemin:16;
+ unsigned int dmemout:16;
+ unsigned int count:16;
+} Admemmove;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:8;
+ unsigned int count:16;
+ unsigned int addr;
+} Aloadadpcm;
+
+typedef struct {
+ unsigned int cmd:8;
+ unsigned int pad1:8;
+ unsigned int pad2:16;
+ unsigned int addr;
+} Asetloop;
+
+/*
+ * Generic Acmd Packet
+ */
+
+typedef struct {
+ unsigned int w0;
+ unsigned int w1;
+} Awords;
+
+typedef union {
+ Awords words;
+ Aadpcm adpcm;
+ Apolef polef;
+ Aclearbuff clearbuff;
+ Aenvelope envelope;
+ Ainterleave interleave;
+ Aloadbuff loadbuff;
+ Aenvmixer envmixer;
+ Aresample resample;
+ Areverb reverb;
+ Asavebuff savebuff;
+ Asegment segment;
+ Asetbuff setbuff;
+ Asetvol setvol;
+ Admemmove dmemmove;
+ Aloadadpcm loadadpcm;
+ Amixer mixer;
+ Asetloop setloop;
+ long long int force_union_align; /* dummy, force alignment */
+} Acmd;
+
+/*
+ * ADPCM State
+ */
+#define ADPCMVSIZE 8
+#define ADPCMFSIZE 16
+typedef short ADPCM_STATE[ADPCMFSIZE];
+
+/*
+ * Pole filter state
+ */
+typedef short POLEF_STATE[4];
+
+/*
+ * Resampler state
+ */
+typedef short RESAMPLE_STATE[16];
+
+/*
+ * Resampler constants
+ */
+#define UNITY_PITCH 0x8000
+#define MAX_RATIO 1.99996 /* within .03 cents of +1 octave */
+
+/*
+ * Enveloper/Mixer state
+ */
+typedef short ENVMIX_STATE[40];
+
+/*
+ * Macros to assemble the audio command list
+ */
+
+#define aADPCMdec(pkt, f, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aPoleFilter(pkt, f, g, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(g, 0, 16)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aClearBuffer(pkt, d, c) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \
+ _a->words.w1 = (unsigned int)(c); \
+}
+
+#define aEnvMixer(pkt, f, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aInterleave(pkt, l, r) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \
+ _a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \
+}
+
+#define aLoadBuffer(pkt, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aMix(pkt, f, g, i, o) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(g, 0, 16)); \
+ _a->words.w1 = _SHIFTL(i,16, 16) | _SHIFTL(o, 0, 16); \
+}
+
+#define aPan(pkt, f, d, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(d, 0, 16)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aResample(pkt, f, p, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\
+ _SHIFTL(p, 0, 16)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aSaveBuffer(pkt, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define aSegment(pkt, s, b) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_SEGMENT, 24, 8); \
+ _a->words.w1 = _SHIFTL(s, 24, 8) | _SHIFTL(b, 0, 24); \
+}
+
+#define aSetBuffer(pkt, f, i, o, c) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(i, 0, 16)); \
+ _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \
+}
+
+#define aSetVolume(pkt, f, v, t, r) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \
+ _SHIFTL(v, 0, 16)); \
+ _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \
+}
+
+#define aSetLoop(pkt, a) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ _a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \
+ _a->words.w1 = (unsigned int)(a); \
+}
+
+#define aDMEMMove(pkt, i, o, c) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_DMEMMOVE, 24, 8) | _SHIFTL(i, 0, 24); \
+ _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \
+}
+
+#define aLoadADPCM(pkt, c, d) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \
+ _a->words.w1 = (unsigned int) d; \
+}
+
+#endif /* _LANGUAGE_C */
+
+#endif /* !_ABI_H_ */
+
+
+
diff --git a/include/2.0L/PR/gbi.h b/include/2.0L/PR/gbi.h
new file mode 100755
index 00000000..7c7ffd29
--- /dev/null
+++ b/include/2.0L/PR/gbi.h
@@ -0,0 +1,4378 @@
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+/**************************************************************************
+ *
+ * $Revision: 1.128 $
+ * $Date: 1997/11/26 00:30:51 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/gbi.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _GBI_H_
+#define _GBI_H_
+
+/*
+ * To use the F3DEX ucodes, define F3DEX_GBI before include this file.
+ *
+ * #define F3DEX_GBI
+ * #include
+ *
+ * or
+ *
+ * cc -c -DF3DEX_GBI -I.... foo.c
+ *
+ */
+
+/**************************************************************************
+ *
+ * Graphics Binary Interface
+ *
+ **************************************************************************/
+
+/*
+ * Graphics Commands, 'xxx' parts may be generated from ucode
+ *
+ * The command format is
+ *
+ * |00xxxxxx| = DMA 0,..,127
+ * |10xxxxxx| = Immediate Mode -65,..,-128
+ * |11xxxxxx| = RDP cmds -1,..,-64
+ *
+ * Note: in order for the RSP microcode to process RDP commands opaquely,
+ * we need to further identify those RDP commands that need DRAM address
+ * "fixup". To do this, we have the dummy command G_RDP_ADDR_FIXUP, and
+ * all |RDP commands| less than this are commands with embedded DRAM
+ * addresses. Further, the format of these commands should be similar so
+ * only one fixup routine is needed.
+ *
+ * Further explanation:
+ * The names of the commands are somewhat misleading. Here is clarification:
+ *
+ * - a 'DMA' type command has a pointer to additional data and
+ * causes a DMA transfer to bring that into DMEM.
+ *
+ * - an 'Immediate' type command isn't really 'immediate', in the
+ * traditional sense. This just means that the entire command fits
+ * in the 64-bit word, and the ucode can execute it 'immediately'
+ * without additional memory transfers.
+ *
+ * - an 'RDP' command is identified as such because the RDP
+ * commands can be passed-thru the RSP and sent to the RDP
+ * directly. One further confusing thing, is that some 'DP'
+ * macros below actually generate immediate commands, not
+ * not direct DP commands.
+ *
+ * IMPLEMENTATION NOTE:
+ * There is another group of RDP commands that includes the triangle commands
+ * generated by the RSP code. These are the raw commands the rasterizer
+ * hardware chews on, with slope info, etc. They will follow the RDP
+ * ordering...
+ *
+ * IMPLEMENTATION NOTE:
+ * The RDP hardware has some of these bit patterns wired up. If the hardware
+ * changes, we must adjust this table, likewise we can't change/add things
+ * once the hardware is frozen. (actually, the RDP hardware only looks at
+ * the lower 6 bits of the command byte)
+ *
+ */
+
+#ifdef F3DEX_GBI_2x
+#define G_NOOP 0x00
+#define G_RDPHALF_2 0xf1
+#define G_SETOTHERMODE_H 0xe3
+#define G_SETOTHERMODE_L 0xe2
+#define G_RDPHALF_1 0xe1
+#define G_SPNOOP 0xe0
+#define G_ENDDL 0xdf
+#define G_DL 0xde
+#define G_LOAD_UCODE 0xdd
+#define G_MOVEMEM 0xdc
+#define G_MOVEWORD 0xdb
+#define G_MTX 0xda
+#define G_GEOMETRYMODE 0xd9
+#define G_POPMTX 0xd8
+#define G_TEXTURE 0xd7
+#define G_SUBMODULE 0xd6
+
+#define G_VTX 0x01
+#define G_MODIFYVTX 0x02
+#define G_CULLDL 0x03
+#define G_BRANCH_Z 0x04
+#define G_TRI1 0x05
+#define G_TRI2 0x06
+#define G_LINE3D 0x07
+#else /* F3DEX_GBI_2 */
+
+/* DMA commands: */
+#define G_SPNOOP 0 /* handle 0 gracefully */
+#define G_MTX 1
+#define G_RESERVED0 2 /* not implemeted */
+#define G_MOVEMEM 3 /* move a block of memory (up to 4 words) to dmem */
+#define G_VTX 4
+#define G_RESERVED1 5 /* not implemeted */
+#define G_DL 6
+#define G_RESERVED2 7 /* not implemeted */
+#define G_RESERVED3 8 /* not implemeted */
+#define G_SPRITE2D_BASE 9 /* sprite command */
+
+/* IMMEDIATE commands: */
+#define G_IMMFIRST -65
+#define G_TRI1 (G_IMMFIRST-0)
+#define G_CULLDL (G_IMMFIRST-1)
+#define G_POPMTX (G_IMMFIRST-2)
+#define G_MOVEWORD (G_IMMFIRST-3)
+#define G_TEXTURE (G_IMMFIRST-4)
+#define G_SETOTHERMODE_H (G_IMMFIRST-5)
+#define G_SETOTHERMODE_L (G_IMMFIRST-6)
+#define G_ENDDL (G_IMMFIRST-7)
+#define G_SETGEOMETRYMODE (G_IMMFIRST-8)
+#define G_CLEARGEOMETRYMODE (G_IMMFIRST-9)
+#define G_LINE3D (G_IMMFIRST-10)
+#define G_RDPHALF_1 (G_IMMFIRST-11)
+#define G_RDPHALF_2 (G_IMMFIRST-12)
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+# define G_MODIFYVTX (G_IMMFIRST-13)
+# define G_TRI2 (G_IMMFIRST-14)
+# define G_BRANCH_Z (G_IMMFIRST-15)
+# define G_LOAD_UCODE (G_IMMFIRST-16)
+#else
+# define G_RDPHALF_CONT (G_IMMFIRST-13)
+#endif
+
+/* We are overloading 2 of the immediate commands
+ to keep the byte alignment of dmem the same */
+
+#define G_SPRITE2D_SCALEFLIP (G_IMMFIRST-1)
+#define G_SPRITE2D_DRAW (G_IMMFIRST-2)
+
+/* RDP commands: */
+#define G_NOOP 0xc0 /* 0 */
+
+#endif /* F3DEX_GBI_2 */
+
+/* RDP commands: */
+#define G_SETCIMG 0xff /* -1 */
+#define G_SETZIMG 0xfe /* -2 */
+#define G_SETTIMG 0xfd /* -3 */
+#define G_SETCOMBINE 0xfc /* -4 */
+#define G_SETENVCOLOR 0xfb /* -5 */
+#define G_SETPRIMCOLOR 0xfa /* -6 */
+#define G_SETBLENDCOLOR 0xf9 /* -7 */
+#define G_SETFOGCOLOR 0xf8 /* -8 */
+#define G_SETFILLCOLOR 0xf7 /* -9 */
+#define G_FILLRECT 0xf6 /* -10 */
+#define G_SETTILE 0xf5 /* -11 */
+#define G_LOADTILE 0xf4 /* -12 */
+#define G_LOADBLOCK 0xf3 /* -13 */
+#define G_SETTILESIZE 0xf2 /* -14 */
+#define G_LOADTLUT 0xf0 /* -16 */
+#define G_RDPSETOTHERMODE 0xef /* -17 */
+#define G_SETPRIMDEPTH 0xee /* -18 */
+#define G_SETSCISSOR 0xed /* -19 */
+#define G_SETCONVERT 0xec /* -20 */
+#define G_SETKEYR 0xeb /* -21 */
+#define G_SETKEYGB 0xea /* -22 */
+#define G_RDPFULLSYNC 0xe9 /* -23 */
+#define G_RDPTILESYNC 0xe8 /* -24 */
+#define G_RDPPIPESYNC 0xe7 /* -25 */
+#define G_RDPLOADSYNC 0xe6 /* -26 */
+#define G_TEXRECTFLIP 0xe5 /* -27 */
+#define G_TEXRECT 0xe4 /* -28 */
+
+
+/*
+ * The following commands are the "generated" RDP commands; the user
+ * never sees them, the RSP microcode generates them.
+ *
+ * The layout of the bits is magical, to save work in the ucode.
+ * These id's are -56, -52, -54, -50, -55, -51, -53, -49, ...
+ * edge, shade, texture, zbuff bits: estz
+ */
+#define G_TRI_FILL 0xc8 /* fill triangle: 11001000 */
+#define G_TRI_SHADE 0xcc /* shade triangle: 11001100 */
+#define G_TRI_TXTR 0xca /* texture triangle: 11001010 */
+#define G_TRI_SHADE_TXTR 0xce /* shade, texture triangle: 11001110 */
+#define G_TRI_FILL_ZBUFF 0xc9 /* fill, zbuff triangle: 11001001 */
+#define G_TRI_SHADE_ZBUFF 0xcd /* shade, zbuff triangle: 11001101 */
+#define G_TRI_TXTR_ZBUFF 0xcb /* texture, zbuff triangle: 11001011 */
+#define G_TRI_SHADE_TXTR_ZBUFF 0xcf /* shade, txtr, zbuff trngl: 11001111 */
+
+/*
+ * A TRI_FILL triangle is just the edges. You need to set the DP
+ * to use primcolor, in order to see anything. (it is NOT a triangle
+ * that gets rendered in 'fill mode'. Triangles can't be rendered
+ * in 'fill mode')
+ *
+ * A TRI_SHADE is a gouraud triangle that has colors interpolated.
+ * Flat-shaded triangles (from the software) are still gouraud shaded,
+ * it's just the colors are all the same and the deltas are 0.
+ *
+ * Other triangle types, and combinations are more obvious.
+ */
+
+/* masks to build RDP triangle commands: */
+#define G_RDP_TRI_FILL_MASK 0x08
+#define G_RDP_TRI_SHADE_MASK 0x04
+#define G_RDP_TRI_TXTR_MASK 0x02
+#define G_RDP_TRI_ZBUFF_MASK 0x01
+
+/*
+ * HACK:
+ * This is a dreadful hack. For version 1.0 hardware, there are still
+ * some 'bowtie' hangs. This parameter can be increased to avoid
+ * the hangs. Every increase of 4 chops one scanline off of every
+ * triangle. Values of 4,8,12 should be sufficient to avoid any
+ * bowtie hang.
+ *
+ * Change this value, then recompile ALL of your program (including static
+ * display lists!)
+ *
+ * THIS WILL BE REMOVED FOR HARDWARE VERSION 2.0!
+ */
+#define BOWTIE_VAL 0
+
+
+/* gets added to RDP command, in order to test for addres fixup: */
+#define G_RDP_ADDR_FIXUP 3 /* |RDP cmds| <= this, do addr fixup */
+#ifdef _LANGUAGE_ASSEMBLY
+#define G_RDP_TEXRECT_CHECK ((-1*G_TEXRECTFLIP)& 0xff)
+#endif
+
+/* macros for command parsing: */
+#define GDMACMD(x) (x)
+#define GIMMCMD(x) (G_IMMFIRST-(x))
+#define GRDPCMD(x) (0xff-(x))
+
+#define G_DMACMDSIZ 128
+#define G_IMMCMDSIZ 64
+#define G_RDPCMDSIZ 64
+
+/*
+ * Coordinate shift values, number of bits of fraction
+ */
+#define G_TEXTURE_IMAGE_FRAC 2
+#define G_TEXTURE_SCALE_FRAC 16
+#define G_SCALE_FRAC 8
+#define G_ROTATE_FRAC 16
+
+/*
+ * Parameters to graphics commands
+ */
+
+/*
+ * Data packing macros
+ */
+
+/*
+ * Maximum z-buffer value, used to initialize the z-buffer.
+ * Note : this number is NOT the viewport z-scale constant.
+ * See the comment next to G_MAXZ for more info.
+ */
+#define G_MAXFBZ 0x3fff /* 3b exp, 11b mantissa */
+
+#define GPACK_RGBA5551(r, g, b, a) ((((r)<<8) & 0xf800) | \
+ (((g)<<3) & 0x7c0) | \
+ (((b)>>2) & 0x3e) | ((a) & 0x1))
+#define GPACK_ZDZ(z, dz) ((z) << 2 | (dz))
+
+/*
+ * G_MTX: parameter flags
+ */
+#ifdef F3DEX_GBI_2x
+# define G_MTX_MODELVIEW 0x00 /* matrix types */
+# define G_MTX_PROJECTION 0x04
+# define G_MTX_MUL 0x00 /* concat or load */
+# define G_MTX_LOAD 0x02
+# define G_MTX_NOPUSH 0x00 /* push or not */
+# define G_MTX_PUSH 0x01
+#else /* F3DEX_GBI_2 */
+# define G_MTX_MODELVIEW 0x00 /* matrix types */
+# define G_MTX_PROJECTION 0x01
+# define G_MTX_MUL 0x00 /* concat or load */
+# define G_MTX_LOAD 0x02
+# define G_MTX_NOPUSH 0x00 /* push or not */
+# define G_MTX_PUSH 0x04
+#endif /* F3DEX_GBI_2 */
+
+/*
+ * flags for G_SETGEOMETRYMODE
+ * (this rendering state is maintained in RSP)
+ *
+ * DO NOT USE THE LOW 8 BITS OF GEOMETRYMODE:
+ * The weird bit-ordering is for the micro-code: the lower byte
+ * can be OR'd in with G_TRI_SHADE (11001100) to construct
+ * the triangle command directly. Don't break it...
+ *
+ * DO NOT USE THE HIGH 8 BITS OF GEOMETRYMODE:
+ * The high byte is OR'd with 0x703 to form the clip code mask.
+ * If it is set to 0x04, this will cause near clipping to occur.
+ * If it is zero, near clipping will not occur.
+ *
+ * Further explanation:
+ * G_SHADE is necessary in order to see the color that you passed
+ * down with the vertex. If G_SHADE isn't set, you need to set the DP
+ * appropriately and use primcolor to see anything.
+ *
+ * G_SHADING_SMOOTH enabled means use all 3 colors of the triangle.
+ * If it is not set, then do 'flat shading', where only one vertex color
+ * is used (and all 3 vertices are set to that same color by the ucode)
+ * See the man page for gSP1Triangle().
+ *
+ */
+#define G_ZBUFFER 0x00000001
+#define G_TEXTURE_ENABLE 0x00000002 /* Microcode use only */
+#define G_SHADE 0x00000004 /* enable Gouraud interp */
+/* rest of low byte reserved for setup ucode */
+#define G_SHADING_SMOOTH 0x00000200 /* flat or smooth shaded */
+#define G_CULL_FRONT 0x00001000
+#define G_CULL_BACK 0x00002000
+#define G_CULL_BOTH 0x00003000 /* To make code cleaner */
+#define G_FOG 0x00010000
+#define G_LIGHTING 0x00020000
+#define G_TEXTURE_GEN 0x00040000
+#define G_TEXTURE_GEN_LINEAR 0x00080000
+#define G_LOD 0x00100000 /* NOT IMPLEMENTED */
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+# define G_CLIPPING 0x00800000
+#else
+# define G_CLIPPING 0x00000000
+#endif
+
+#ifdef _LANGUAGE_ASSEMBLY
+#define G_FOG_H (G_FOG/0x10000)
+#define G_LIGHTING_H (G_LIGHTING/0x10000)
+#define G_TEXTURE_GEN_H (G_TEXTURE_GEN/0x10000)
+#define G_TEXTURE_GEN_LINEAR_H (G_TEXTURE_GEN_LINEAR/0x10000)
+#define G_LOD_H (G_LOD/0x10000) /* NOT IMPLEMENTED */
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+# define G_CLIPPING_H (G_CLIPPING/0x10000)
+#endif
+#endif
+
+/* Need these defined for Sprite Microcode */
+#ifdef _LANGUAGE_ASSEMBLY
+#define G_TX_LOADTILE 7
+#define G_TX_RENDERTILE 0
+
+#define G_TX_NOMIRROR 0
+#define G_TX_WRAP 0
+#define G_TX_MIRROR 0x1
+#define G_TX_CLAMP 0x2
+#define G_TX_NOMASK 0
+#define G_TX_NOLOD 0
+#endif
+
+/*
+ * G_SETIMG fmt: set image formats
+ */
+#define G_IM_FMT_RGBA 0
+#define G_IM_FMT_YUV 1
+#define G_IM_FMT_CI 2
+#define G_IM_FMT_IA 3
+#define G_IM_FMT_I 4
+
+/*
+ * G_SETIMG siz: set image pixel size
+ */
+#define G_IM_SIZ_4b 0
+#define G_IM_SIZ_8b 1
+#define G_IM_SIZ_16b 2
+#define G_IM_SIZ_32b 3
+
+#define G_IM_SIZ_4b_BYTES 0
+#define G_IM_SIZ_4b_TILE_BYTES G_IM_SIZ_4b_BYTES
+#define G_IM_SIZ_4b_LINE_BYTES G_IM_SIZ_4b_BYTES
+
+#define G_IM_SIZ_8b_BYTES 1
+#define G_IM_SIZ_8b_TILE_BYTES G_IM_SIZ_8b_BYTES
+#define G_IM_SIZ_8b_LINE_BYTES G_IM_SIZ_8b_BYTES
+
+#define G_IM_SIZ_16b_BYTES 2
+#define G_IM_SIZ_16b_TILE_BYTES G_IM_SIZ_16b_BYTES
+#define G_IM_SIZ_16b_LINE_BYTES G_IM_SIZ_16b_BYTES
+
+#define G_IM_SIZ_32b_BYTES 4
+#define G_IM_SIZ_32b_TILE_BYTES 2
+#define G_IM_SIZ_32b_LINE_BYTES 2
+
+#define G_IM_SIZ_4b_LOAD_BLOCK G_IM_SIZ_16b
+#define G_IM_SIZ_8b_LOAD_BLOCK G_IM_SIZ_16b
+#define G_IM_SIZ_16b_LOAD_BLOCK G_IM_SIZ_16b
+#define G_IM_SIZ_32b_LOAD_BLOCK G_IM_SIZ_32b
+
+#define G_IM_SIZ_4b_SHIFT 2
+#define G_IM_SIZ_8b_SHIFT 1
+#define G_IM_SIZ_16b_SHIFT 0
+#define G_IM_SIZ_32b_SHIFT 0
+
+#define G_IM_SIZ_4b_INCR 3
+#define G_IM_SIZ_8b_INCR 1
+#define G_IM_SIZ_16b_INCR 0
+#define G_IM_SIZ_32b_INCR 0
+
+/*
+ * G_SETCOMBINE: color combine modes
+ */
+/* Color combiner constants: */
+#define G_CCMUX_COMBINED 0
+#define G_CCMUX_TEXEL0 1
+#define G_CCMUX_TEXEL1 2
+#define G_CCMUX_PRIMITIVE 3
+#define G_CCMUX_SHADE 4
+#define G_CCMUX_ENVIRONMENT 5
+#define G_CCMUX_CENTER 6
+#define G_CCMUX_SCALE 6
+#define G_CCMUX_COMBINED_ALPHA 7
+#define G_CCMUX_TEXEL0_ALPHA 8
+#define G_CCMUX_TEXEL1_ALPHA 9
+#define G_CCMUX_PRIMITIVE_ALPHA 10
+#define G_CCMUX_SHADE_ALPHA 11
+#define G_CCMUX_ENV_ALPHA 12
+#define G_CCMUX_LOD_FRACTION 13
+#define G_CCMUX_PRIM_LOD_FRAC 14
+#define G_CCMUX_NOISE 7
+#define G_CCMUX_K4 7
+#define G_CCMUX_K5 15
+#define G_CCMUX_1 6
+#define G_CCMUX_0 31
+
+/* Alpha combiner constants: */
+#define G_ACMUX_COMBINED 0
+#define G_ACMUX_TEXEL0 1
+#define G_ACMUX_TEXEL1 2
+#define G_ACMUX_PRIMITIVE 3
+#define G_ACMUX_SHADE 4
+#define G_ACMUX_ENVIRONMENT 5
+#define G_ACMUX_LOD_FRACTION 0
+#define G_ACMUX_PRIM_LOD_FRAC 6
+#define G_ACMUX_1 6
+#define G_ACMUX_0 7
+
+/* typical CC cycle 1 modes */
+#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE
+#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE
+#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE
+#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0
+#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0
+#define G_CC_MODULATERGB G_CC_MODULATEI
+#define G_CC_MODULATERGBA G_CC_MODULATEIA
+#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA
+#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
+#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0
+#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0
+#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM
+#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM
+#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM
+#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE
+#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0
+#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
+#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0
+#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE
+#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_ADDRGB 1, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
+#define G_CC_ADDRGBDECALA 1, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
+#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
+#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE
+#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0
+#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0
+#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0
+
+/* oddball modes */
+#define _G_CC_BLENDPE ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, SHADE, 0
+#define _G_CC_BLENDPEDECALA ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0
+#define _G_CC_TWOCOLORTEX PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
+/* used for 1-cycle sparse mip-maps, primitive color has color of lowest LOD */
+#define _G_CC_SPARSEST PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0
+#define G_CC_TEMPLERP TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0
+
+/* typical CC cycle 1 modes, usually followed by other cycle 2 modes */
+#define G_CC_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0
+#define G_CC_INTERFERENCE TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0
+
+/*
+ * One-cycle color convert operation
+ */
+#define G_CC_1CYUV2RGB TEXEL0, K4, K5, TEXEL0, 0, 0, 0, SHADE
+
+/*
+ * NOTE: YUV2RGB expects TF step1 color conversion to occur in 2nd clock.
+ * Therefore, CC looks for step1 results in TEXEL1
+ */
+#define G_CC_YUV2RGB TEXEL1, K4, K5, TEXEL1, 0, 0, 0, 0
+
+/* typical CC cycle 2 modes */
+#define G_CC_PASS2 0, 0, 0, COMBINED, 0, 0, 0, COMBINED
+#define G_CC_MODULATEI2 COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE
+#define G_CC_MODULATEIA2 COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0
+#define G_CC_MODULATERGB2 G_CC_MODULATEI2
+#define G_CC_MODULATERGBA2 G_CC_MODULATEIA2
+#define G_CC_MODULATEI_PRIM2 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
+#define G_CC_MODULATEIA_PRIM2 COMBINED, 0, PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0
+#define G_CC_MODULATERGB_PRIM2 G_CC_MODULATEI_PRIM2
+#define G_CC_MODULATERGBA_PRIM2 G_CC_MODULATEIA_PRIM2
+#define G_CC_DECALRGB2 0, 0, 0, COMBINED, 0, 0, 0, SHADE
+/*
+ * ?
+#define G_CC_DECALRGBA2 COMBINED, SHADE, COMBINED_ALPHA, SHADE, 0, 0, 0, SHADE
+*/
+#define G_CC_BLENDI2 ENVIRONMENT, SHADE, COMBINED, SHADE, 0, 0, 0, SHADE
+#define G_CC_BLENDIA2 ENVIRONMENT, SHADE, COMBINED, SHADE, COMBINED, 0, SHADE, 0
+#define G_CC_CHROMA_KEY2 TEXEL0, CENTER, SCALE, 0, 0, 0, 0, 0
+#define G_CC_HILITERGB2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, SHADE
+#define G_CC_HILITERGBA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, ENVIRONMENT, COMBINED, TEXEL0, COMBINED
+#define G_CC_HILITERGBDECALA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, TEXEL0
+#define G_CC_HILITERGBPASSA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, COMBINED
+
+/*
+ * G_SETOTHERMODE_L sft: shift count
+ */
+#define G_MDSFT_ALPHACOMPARE 0
+#define G_MDSFT_ZSRCSEL 2
+#define G_MDSFT_RENDERMODE 3
+#define G_MDSFT_BLENDER 16
+
+/*
+ * G_SETOTHERMODE_H sft: shift count
+ */
+#define G_MDSFT_BLENDMASK 0 /* unsupported */
+#define G_MDSFT_ALPHADITHER 4
+#define G_MDSFT_RGBDITHER 6
+
+#define G_MDSFT_COMBKEY 8
+#define G_MDSFT_TEXTCONV 9
+#define G_MDSFT_TEXTFILT 12
+#define G_MDSFT_TEXTLUT 14
+#define G_MDSFT_TEXTLOD 16
+#define G_MDSFT_TEXTDETAIL 17
+#define G_MDSFT_TEXTPERSP 19
+#define G_MDSFT_CYCLETYPE 20
+#define G_MDSFT_COLORDITHER 22 /* unsupported in HW 2.0 */
+#define G_MDSFT_PIPELINE 23
+
+/* G_SETOTHERMODE_H gPipelineMode */
+#define G_PM_1PRIMITIVE (1 << G_MDSFT_PIPELINE)
+#define G_PM_NPRIMITIVE (0 << G_MDSFT_PIPELINE)
+
+/* G_SETOTHERMODE_H gSetCycleType */
+#define G_CYC_1CYCLE (0 << G_MDSFT_CYCLETYPE)
+#define G_CYC_2CYCLE (1 << G_MDSFT_CYCLETYPE)
+#define G_CYC_COPY (2 << G_MDSFT_CYCLETYPE)
+#define G_CYC_FILL (3 << G_MDSFT_CYCLETYPE)
+
+/* G_SETOTHERMODE_H gSetTexturePersp */
+#define G_TP_NONE (0 << G_MDSFT_TEXTPERSP)
+#define G_TP_PERSP (1 << G_MDSFT_TEXTPERSP)
+
+/* G_SETOTHERMODE_H gSetTextureDetail */
+#define G_TD_CLAMP (0 << G_MDSFT_TEXTDETAIL)
+#define G_TD_SHARPEN (1 << G_MDSFT_TEXTDETAIL)
+#define G_TD_DETAIL (2 << G_MDSFT_TEXTDETAIL)
+
+/* G_SETOTHERMODE_H gSetTextureLOD */
+#define G_TL_TILE (0 << G_MDSFT_TEXTLOD)
+#define G_TL_LOD (1 << G_MDSFT_TEXTLOD)
+
+/* G_SETOTHERMODE_H gSetTextureLUT */
+#define G_TT_NONE (0 << G_MDSFT_TEXTLUT)
+#define G_TT_RGBA16 (2 << G_MDSFT_TEXTLUT)
+#define G_TT_IA16 (3 << G_MDSFT_TEXTLUT)
+
+/* G_SETOTHERMODE_H gSetTextureFilter */
+#define G_TF_POINT (0 << G_MDSFT_TEXTFILT)
+#define G_TF_AVERAGE (3 << G_MDSFT_TEXTFILT)
+#define G_TF_BILERP (2 << G_MDSFT_TEXTFILT)
+
+/* G_SETOTHERMODE_H gSetTextureConvert */
+#define G_TC_CONV (0 << G_MDSFT_TEXTCONV)
+#define G_TC_FILTCONV (5 << G_MDSFT_TEXTCONV)
+#define G_TC_FILT (6 << G_MDSFT_TEXTCONV)
+
+/* G_SETOTHERMODE_H gSetCombineKey */
+#define G_CK_NONE (0 << G_MDSFT_COMBKEY)
+#define G_CK_KEY (1 << G_MDSFT_COMBKEY)
+
+/* G_SETOTHERMODE_H gSetColorDither */
+#define G_CD_MAGICSQ (0 << G_MDSFT_RGBDITHER)
+#define G_CD_BAYER (1 << G_MDSFT_RGBDITHER)
+#define G_CD_NOISE (2 << G_MDSFT_RGBDITHER)
+
+#ifndef _HW_VERSION_1
+#define G_CD_DISABLE (3 << G_MDSFT_RGBDITHER)
+#define G_CD_ENABLE G_CD_NOISE /* HW 1.0 compatibility mode */
+#else
+#define G_CD_ENABLE (1 << G_MDSFT_COLORDITHER)
+#define G_CD_DISABLE (0 << G_MDSFT_COLORDITHER)
+#endif
+
+/* G_SETOTHERMODE_H gSetAlphaDither */
+#define G_AD_PATTERN (0 << G_MDSFT_ALPHADITHER)
+#define G_AD_NOTPATTERN (1 << G_MDSFT_ALPHADITHER)
+#define G_AD_NOISE (2 << G_MDSFT_ALPHADITHER)
+#define G_AD_DISABLE (3 << G_MDSFT_ALPHADITHER)
+
+/* G_SETOTHERMODE_L gSetAlphaCompare */
+#define G_AC_NONE (0 << G_MDSFT_ALPHACOMPARE)
+#define G_AC_THRESHOLD (1 << G_MDSFT_ALPHACOMPARE)
+#define G_AC_DITHER (3 << G_MDSFT_ALPHACOMPARE)
+
+/* G_SETOTHERMODE_L gSetDepthSource */
+#define G_ZS_PIXEL (0 << G_MDSFT_ZSRCSEL)
+#define G_ZS_PRIM (1 << G_MDSFT_ZSRCSEL)
+
+/* G_SETOTHERMODE_L gSetRenderMode */
+#define AA_EN 0x8
+#define Z_CMP 0x10
+#define Z_UPD 0x20
+#define IM_RD 0x40
+#define CLR_ON_CVG 0x80
+#define CVG_DST_CLAMP 0
+#define CVG_DST_WRAP 0x100
+#define CVG_DST_FULL 0x200
+#define CVG_DST_SAVE 0x300
+#define ZMODE_OPA 0
+#define ZMODE_INTER 0x400
+#define ZMODE_XLU 0x800
+#define ZMODE_DEC 0xc00
+#define CVG_X_ALPHA 0x1000
+#define ALPHA_CVG_SEL 0x2000
+#define FORCE_BL 0x4000
+#define TEX_EDGE 0x0000 /* used to be 0x8000 */
+
+#define G_BL_CLR_IN 0
+#define G_BL_CLR_MEM 1
+#define G_BL_CLR_BL 2
+#define G_BL_CLR_FOG 3
+#define G_BL_1MA 0
+#define G_BL_A_MEM 1
+#define G_BL_A_IN 0
+#define G_BL_A_FOG 1
+#define G_BL_A_SHADE 2
+#define G_BL_1 2
+#define G_BL_0 3
+
+#define GBL_c1(m1a, m1b, m2a, m2b) \
+ (m1a) << 30 | (m1b) << 26 | (m2a) << 22 | (m2b) << 18
+#define GBL_c2(m1a, m1b, m2a, m2b) \
+ (m1a) << 28 | (m1b) << 24 | (m2a) << 20 | (m2b) << 16
+
+#define RM_AA_ZB_OPA_SURF(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_RA_ZB_OPA_SURF(clk) \
+ AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_XLU_SURF(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \
+ FORCE_BL | ZMODE_XLU | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_OPA_DECAL(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ALPHA_CVG_SEL | \
+ ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_RA_ZB_OPA_DECAL(clk) \
+ AA_EN | Z_CMP | CVG_DST_WRAP | ALPHA_CVG_SEL | \
+ ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_XLU_DECAL(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \
+ FORCE_BL | ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_OPA_INTER(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ ALPHA_CVG_SEL | ZMODE_INTER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_RA_ZB_OPA_INTER(clk) \
+ AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \
+ ALPHA_CVG_SEL | ZMODE_INTER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_XLU_INTER(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \
+ FORCE_BL | ZMODE_INTER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_XLU_LINE(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \
+ ALPHA_CVG_SEL | FORCE_BL | ZMODE_XLU | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_DEC_LINE(clk) \
+ AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | CVG_X_ALPHA | \
+ ALPHA_CVG_SEL | FORCE_BL | ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_TEX_EDGE(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_TEX_INTER(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_INTER | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_SUB_SURF(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_ZB_PCL_SURF(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | G_AC_DITHER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_OPA_TERR(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_TEX_TERR(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_ZB_SUB_TERR(clk) \
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+
+#define RM_AA_OPA_SURF(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_RA_OPA_SURF(clk) \
+ AA_EN | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_XLU_SURF(clk) \
+ AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | \
+ ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_XLU_LINE(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \
+ ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_DEC_LINE(clk) \
+ AA_EN | IM_RD | CVG_DST_FULL | CVG_X_ALPHA | \
+ ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_TEX_EDGE(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_SUB_SURF(clk) \
+ AA_EN | IM_RD | CVG_DST_FULL | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_AA_PCL_SURF(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | G_AC_DITHER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_OPA_TERR(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_TEX_TERR(clk) \
+ AA_EN | IM_RD | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_AA_SUB_TERR(clk) \
+ AA_EN | IM_RD | CVG_DST_FULL | \
+ ZMODE_OPA | ALPHA_CVG_SEL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+
+#define RM_ZB_OPA_SURF(clk) \
+ Z_CMP | Z_UPD | CVG_DST_FULL | ALPHA_CVG_SEL | \
+ ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_ZB_XLU_SURF(clk) \
+ Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_XLU | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_ZB_OPA_DECAL(clk) \
+ Z_CMP | CVG_DST_FULL | ALPHA_CVG_SEL | ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)
+
+#define RM_ZB_XLU_DECAL(clk) \
+ Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_ZB_CLD_SURF(clk) \
+ Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_XLU | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_ZB_OVL_SURF(clk) \
+ Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_DEC | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_ZB_PCL_SURF(clk) \
+ Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | \
+ G_AC_DITHER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+
+#define RM_OPA_SURF(clk) \
+ CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+#define RM_XLU_SURF(clk) \
+ IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_TEX_EDGE(clk) \
+ CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL |\
+ ZMODE_OPA | TEX_EDGE | AA_EN | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+#define RM_CLD_SURF(clk) \
+ IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define RM_PCL_SURF(clk) \
+ CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \
+ G_AC_DITHER | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+#define RM_ADD(clk) \
+ IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1)
+
+#define RM_NOOP(clk) \
+ GBL_c##clk(0, 0, 0, 0)
+
+#define RM_VISCVG(clk) \
+ IM_RD | FORCE_BL | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM)
+
+/* for rendering to an 8-bit framebuffer */
+#define RM_OPA_CI(clk) \
+ CVG_DST_CLAMP | ZMODE_OPA | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+
+
+#define G_RM_AA_ZB_OPA_SURF RM_AA_ZB_OPA_SURF(1)
+#define G_RM_AA_ZB_OPA_SURF2 RM_AA_ZB_OPA_SURF(2)
+#define G_RM_AA_ZB_XLU_SURF RM_AA_ZB_XLU_SURF(1)
+#define G_RM_AA_ZB_XLU_SURF2 RM_AA_ZB_XLU_SURF(2)
+#define G_RM_AA_ZB_OPA_DECAL RM_AA_ZB_OPA_DECAL(1)
+#define G_RM_AA_ZB_OPA_DECAL2 RM_AA_ZB_OPA_DECAL(2)
+#define G_RM_AA_ZB_XLU_DECAL RM_AA_ZB_XLU_DECAL(1)
+#define G_RM_AA_ZB_XLU_DECAL2 RM_AA_ZB_XLU_DECAL(2)
+#define G_RM_AA_ZB_OPA_INTER RM_AA_ZB_OPA_INTER(1)
+#define G_RM_AA_ZB_OPA_INTER2 RM_AA_ZB_OPA_INTER(2)
+#define G_RM_AA_ZB_XLU_INTER RM_AA_ZB_XLU_INTER(1)
+#define G_RM_AA_ZB_XLU_INTER2 RM_AA_ZB_XLU_INTER(2)
+#define G_RM_AA_ZB_XLU_LINE RM_AA_ZB_XLU_LINE(1)
+#define G_RM_AA_ZB_XLU_LINE2 RM_AA_ZB_XLU_LINE(2)
+#define G_RM_AA_ZB_DEC_LINE RM_AA_ZB_DEC_LINE(1)
+#define G_RM_AA_ZB_DEC_LINE2 RM_AA_ZB_DEC_LINE(2)
+#define G_RM_AA_ZB_TEX_EDGE RM_AA_ZB_TEX_EDGE(1)
+#define G_RM_AA_ZB_TEX_EDGE2 RM_AA_ZB_TEX_EDGE(2)
+#define G_RM_AA_ZB_TEX_INTER RM_AA_ZB_TEX_INTER(1)
+#define G_RM_AA_ZB_TEX_INTER2 RM_AA_ZB_TEX_INTER(2)
+#define G_RM_AA_ZB_SUB_SURF RM_AA_ZB_SUB_SURF(1)
+#define G_RM_AA_ZB_SUB_SURF2 RM_AA_ZB_SUB_SURF(2)
+#define G_RM_AA_ZB_PCL_SURF RM_AA_ZB_PCL_SURF(1)
+#define G_RM_AA_ZB_PCL_SURF2 RM_AA_ZB_PCL_SURF(2)
+#define G_RM_AA_ZB_OPA_TERR RM_AA_ZB_OPA_TERR(1)
+#define G_RM_AA_ZB_OPA_TERR2 RM_AA_ZB_OPA_TERR(2)
+#define G_RM_AA_ZB_TEX_TERR RM_AA_ZB_TEX_TERR(1)
+#define G_RM_AA_ZB_TEX_TERR2 RM_AA_ZB_TEX_TERR(2)
+#define G_RM_AA_ZB_SUB_TERR RM_AA_ZB_SUB_TERR(1)
+#define G_RM_AA_ZB_SUB_TERR2 RM_AA_ZB_SUB_TERR(2)
+
+#define G_RM_RA_ZB_OPA_SURF RM_RA_ZB_OPA_SURF(1)
+#define G_RM_RA_ZB_OPA_SURF2 RM_RA_ZB_OPA_SURF(2)
+#define G_RM_RA_ZB_OPA_DECAL RM_RA_ZB_OPA_DECAL(1)
+#define G_RM_RA_ZB_OPA_DECAL2 RM_RA_ZB_OPA_DECAL(2)
+#define G_RM_RA_ZB_OPA_INTER RM_RA_ZB_OPA_INTER(1)
+#define G_RM_RA_ZB_OPA_INTER2 RM_RA_ZB_OPA_INTER(2)
+
+#define G_RM_AA_OPA_SURF RM_AA_OPA_SURF(1)
+#define G_RM_AA_OPA_SURF2 RM_AA_OPA_SURF(2)
+#define G_RM_AA_XLU_SURF RM_AA_XLU_SURF(1)
+#define G_RM_AA_XLU_SURF2 RM_AA_XLU_SURF(2)
+#define G_RM_AA_XLU_LINE RM_AA_XLU_LINE(1)
+#define G_RM_AA_XLU_LINE2 RM_AA_XLU_LINE(2)
+#define G_RM_AA_DEC_LINE RM_AA_DEC_LINE(1)
+#define G_RM_AA_DEC_LINE2 RM_AA_DEC_LINE(2)
+#define G_RM_AA_TEX_EDGE RM_AA_TEX_EDGE(1)
+#define G_RM_AA_TEX_EDGE2 RM_AA_TEX_EDGE(2)
+#define G_RM_AA_SUB_SURF RM_AA_SUB_SURF(1)
+#define G_RM_AA_SUB_SURF2 RM_AA_SUB_SURF(2)
+#define G_RM_AA_PCL_SURF RM_AA_PCL_SURF(1)
+#define G_RM_AA_PCL_SURF2 RM_AA_PCL_SURF(2)
+#define G_RM_AA_OPA_TERR RM_AA_OPA_TERR(1)
+#define G_RM_AA_OPA_TERR2 RM_AA_OPA_TERR(2)
+#define G_RM_AA_TEX_TERR RM_AA_TEX_TERR(1)
+#define G_RM_AA_TEX_TERR2 RM_AA_TEX_TERR(2)
+#define G_RM_AA_SUB_TERR RM_AA_SUB_TERR(1)
+#define G_RM_AA_SUB_TERR2 RM_AA_SUB_TERR(2)
+
+#define G_RM_RA_OPA_SURF RM_RA_OPA_SURF(1)
+#define G_RM_RA_OPA_SURF2 RM_RA_OPA_SURF(2)
+
+#define G_RM_ZB_OPA_SURF RM_ZB_OPA_SURF(1)
+#define G_RM_ZB_OPA_SURF2 RM_ZB_OPA_SURF(2)
+#define G_RM_ZB_XLU_SURF RM_ZB_XLU_SURF(1)
+#define G_RM_ZB_XLU_SURF2 RM_ZB_XLU_SURF(2)
+#define G_RM_ZB_OPA_DECAL RM_ZB_OPA_DECAL(1)
+#define G_RM_ZB_OPA_DECAL2 RM_ZB_OPA_DECAL(2)
+#define G_RM_ZB_XLU_DECAL RM_ZB_XLU_DECAL(1)
+#define G_RM_ZB_XLU_DECAL2 RM_ZB_XLU_DECAL(2)
+#define G_RM_ZB_CLD_SURF RM_ZB_CLD_SURF(1)
+#define G_RM_ZB_CLD_SURF2 RM_ZB_CLD_SURF(2)
+#define G_RM_ZB_OVL_SURF RM_ZB_OVL_SURF(1)
+#define G_RM_ZB_OVL_SURF2 RM_ZB_OVL_SURF(2)
+#define G_RM_ZB_PCL_SURF RM_ZB_PCL_SURF(1)
+#define G_RM_ZB_PCL_SURF2 RM_ZB_PCL_SURF(2)
+
+#define G_RM_OPA_SURF RM_OPA_SURF(1)
+#define G_RM_OPA_SURF2 RM_OPA_SURF(2)
+#define G_RM_XLU_SURF RM_XLU_SURF(1)
+#define G_RM_XLU_SURF2 RM_XLU_SURF(2)
+#define G_RM_CLD_SURF RM_CLD_SURF(1)
+#define G_RM_CLD_SURF2 RM_CLD_SURF(2)
+#define G_RM_TEX_EDGE RM_TEX_EDGE(1)
+#define G_RM_TEX_EDGE2 RM_TEX_EDGE(2)
+#define G_RM_PCL_SURF RM_PCL_SURF(1)
+#define G_RM_PCL_SURF2 RM_PCL_SURF(2)
+#define G_RM_ADD RM_ADD(1)
+#define G_RM_ADD2 RM_ADD(2)
+#define G_RM_NOOP RM_NOOP(1)
+#define G_RM_NOOP2 RM_NOOP(2)
+#define G_RM_VISCVG RM_VISCVG(1)
+#define G_RM_VISCVG2 RM_VISCVG(2)
+#define G_RM_OPA_CI RM_OPA_CI(1)
+#define G_RM_OPA_CI2 RM_OPA_CI(2)
+
+
+#define G_RM_FOG_SHADE_A GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA)
+#define G_RM_FOG_PRIM_A GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA)
+#define G_RM_PASS GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
+
+/*
+ * G_SETCONVERT: K0-5
+ */
+#define G_CV_K0 175
+#define G_CV_K1 -43
+#define G_CV_K2 -89
+#define G_CV_K3 222
+#define G_CV_K4 114
+#define G_CV_K5 42
+
+/*
+ * G_SETSCISSOR: interlace mode
+ */
+#define G_SC_NON_INTERLACE 0
+#define G_SC_ODD_INTERLACE 3
+#define G_SC_EVEN_INTERLACE 2
+
+/* flags to inhibit pushing of the display list (on branch) */
+#define G_DL_PUSH 0x00
+#define G_DL_NOPUSH 0x01
+
+/*
+ * BEGIN C-specific section: (typedef's)
+ */
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/*
+ * Data Structures
+ *
+ * NOTE:
+ * The DMA transfer hardware requires 64-bit aligned, 64-bit multiple-
+ * sized transfers. This important hardware optimization is unfortunately
+ * reflected in the programming interface, with some structures
+ * padded and alignment enforced.
+ *
+ * Since structures are aligned to the boundary of the "worst-case"
+ * element, we can't depend on the C compiler to align things
+ * properly.
+ *
+ * 64-bit structure alignment is enforced by wrapping structures with
+ * unions that contain a dummy "long long int". Why this works is
+ * explained in the ANSI C Spec, or on page 186 of the second edition
+ * of K&R, "The C Programming Language".
+ *
+ * The price we pay for this is a little awkwardness referencing the
+ * structures through the union. There is no memory penalty, since
+ * all the structures are at least 64-bits the dummy alignment field
+ * does not increase the size of the union.
+ *
+ * Static initialization of these union structures works because
+ * the ANSI C spec states that static initialization for unions
+ * works by using the first union element. We put the dummy alignment
+ * field last for this reason.
+ *
+ * (it's possible a newer 64-bit compiler from MIPS might make this
+ * easier with a flag, but we can't wait for it...)
+ *
+ */
+
+/*
+ * Vertex (set up for use with colors)
+ */
+typedef struct {
+ short ob[3]; /* x, y, z */
+ unsigned short flag;
+ short tc[2]; /* texture coord */
+ unsigned char cn[4]; /* color & alpha */
+} Vtx_t;
+
+/*
+ * Vertex (set up for use with normals)
+ */
+typedef struct {
+ short ob[3]; /* x, y, z */
+ unsigned short flag;
+ short tc[2]; /* texture coord */
+ signed char n[3]; /* normal */
+ unsigned char a; /* alpha */
+} Vtx_tn;
+
+typedef union {
+ Vtx_t v; /* Use this one for colors */
+ Vtx_tn n; /* Use this one for normals */
+ long long int force_structure_alignment;
+} Vtx;
+
+/*
+ * Sprite structure
+ */
+
+typedef struct {
+ void *SourceImagePointer;
+ void *TlutPointer;
+ short Stride;
+ short SubImageWidth;
+ short SubImageHeight;
+ char SourceImageType;
+ char SourceImageBitSize;
+ short SourceImageOffsetS;
+ short SourceImageOffsetT;
+ /* 20 bytes for above */
+
+ /* padding to bring structure size to 64 bit allignment */
+ char dummy[4];
+
+} uSprite_t;
+
+typedef union {
+ uSprite_t s;
+
+ /* Need to make sure this is 64 bit aligned */
+ long long int force_structure_allignment[3];
+} uSprite;
+
+/*
+ * Triangle face
+ */
+typedef struct {
+ unsigned char flag;
+ unsigned char v[3];
+} Tri;
+
+/*
+ * 4x4 matrix, fixed point s15.16 format.
+ * First 8 words are integer portion of the 4x4 matrix
+ * Last 8 words are the fraction portion of the 4x4 matrix
+ */
+typedef long Mtx_t[4][4];
+
+typedef union {
+ Mtx_t m;
+ long long int force_structure_alignment;
+} Mtx;
+
+/*
+ * Viewport
+ */
+
+/*
+ *
+ * This magic value is the maximum INTEGER z-range of the hardware
+ * (there are also 16-bits of fraction, which are introduced during
+ * any transformations). This is not just a good idea, it's the law.
+ * Feeding the hardware eventual z-coordinates (after any transforms
+ * or scaling) bigger than this, will not work.
+ *
+ * This number is DIFFERENT than G_MAXFBZ, which is the maximum value
+ * you want to use to initialize the z-buffer.
+ *
+ * The reason these are different is mildly interesting, but too long
+ * to explain here. It is basically the result of optimizations in the
+ * hardware. A more generic API might hide this detail from the users,
+ * but we don't have the ucode to do that...
+ *
+ */
+#define G_MAXZ 0x03ff /* 10 bits of integer screen-Z precision */
+
+/*
+ * The viewport structure elements have 2 bits of fraction, necessary
+ * to accomodate the sub-pixel positioning scaling for the hardware.
+ * This can also be exploited to handle odd-sized viewports.
+ *
+ * Accounting for these fractional bits, using the default projection
+ * and viewing matrices, the viewport structure is initialized thusly:
+ *
+ * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0,
+ * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0,
+ */
+typedef struct {
+ short vscale[4]; /* scale, 2 bits fraction */
+ short vtrans[4]; /* translate, 2 bits fraction */
+ /* both the above arrays are padded to 64-bit boundary */
+} Vp_t;
+
+typedef union {
+ Vp_t vp;
+ long long int force_structure_alignment;
+} Vp;
+
+/*
+ * MOVEMEM indices
+ *
+ * Each of these indexes an entry in a dmem table
+ * which points to a 1-4 word block of dmem in
+ * which to store a 1-4 word DMA.
+ *
+ */
+#ifdef F3DEX_GBI_2x
+/* 0,2,4,6 are reserved by G_MTX */
+# define G_MV_VIEWPORT 8
+# define G_MV_LIGHT 10
+# define G_MV_POINT 12
+# define G_MV_MATRIX 14 /* NOTE: this is in moveword table */
+# define G_MVO_LOOKATX (0*24)
+# define G_MVO_LOOKATY (1*24)
+# define G_MVO_L0 (2*24)
+# define G_MVO_L1 (3*24)
+# define G_MVO_L2 (4*24)
+# define G_MVO_L3 (5*24)
+# define G_MVO_L4 (6*24)
+# define G_MVO_L5 (7*24)
+# define G_MVO_L6 (8*24)
+# define G_MVO_L7 (9*24)
+#else /* F3DEX_GBI_2 */
+# define G_MV_VIEWPORT 0x80
+# define G_MV_LOOKATY 0x82
+# define G_MV_LOOKATX 0x84
+# define G_MV_L0 0x86
+# define G_MV_L1 0x88
+# define G_MV_L2 0x8a
+# define G_MV_L3 0x8c
+# define G_MV_L4 0x8e
+# define G_MV_L5 0x90
+# define G_MV_L6 0x92
+# define G_MV_L7 0x94
+# define G_MV_TXTATT 0x96
+# define G_MV_MATRIX_1 0x9e /* NOTE: this is in moveword table */
+# define G_MV_MATRIX_2 0x98
+# define G_MV_MATRIX_3 0x9a
+# define G_MV_MATRIX_4 0x9c
+#endif /* F3DEX_GBI_2 */
+
+/*
+ * MOVEWORD indices
+ *
+ * Each of these indexes an entry in a dmem table
+ * which points to a word in dmem in dmem where
+ * an immediate word will be stored.
+ *
+ */
+#define G_MW_MATRIX 0x00 /* NOTE: also used by movemem */
+#define G_MW_NUMLIGHT 0x02
+#define G_MW_CLIP 0x04
+#define G_MW_SEGMENT 0x06
+#define G_MW_FOG 0x08
+#define G_MW_LIGHTCOL 0x0a
+#ifdef F3DEX_GBI_2x
+# define G_MW_FORCEMTX 0x0c
+#else /* F3DEX_GBI_2 */
+# define G_MW_POINTS 0x0c
+#endif /* F3DEX_GBI_2 */
+#define G_MW_PERSPNORM 0x0e
+
+/*
+ * These are offsets from the address in the dmem table
+ */
+#define G_MWO_NUMLIGHT 0x00
+#define G_MWO_CLIP_RNX 0x04
+#define G_MWO_CLIP_RNY 0x0c
+#define G_MWO_CLIP_RPX 0x14
+#define G_MWO_CLIP_RPY 0x1c
+#define G_MWO_SEGMENT_0 0x00
+#define G_MWO_SEGMENT_1 0x01
+#define G_MWO_SEGMENT_2 0x02
+#define G_MWO_SEGMENT_3 0x03
+#define G_MWO_SEGMENT_4 0x04
+#define G_MWO_SEGMENT_5 0x05
+#define G_MWO_SEGMENT_6 0x06
+#define G_MWO_SEGMENT_7 0x07
+#define G_MWO_SEGMENT_8 0x08
+#define G_MWO_SEGMENT_9 0x09
+#define G_MWO_SEGMENT_A 0x0a
+#define G_MWO_SEGMENT_B 0x0b
+#define G_MWO_SEGMENT_C 0x0c
+#define G_MWO_SEGMENT_D 0x0d
+#define G_MWO_SEGMENT_E 0x0e
+#define G_MWO_SEGMENT_F 0x0f
+#define G_MWO_FOG 0x00
+#define G_MWO_aLIGHT_1 0x00
+#define G_MWO_bLIGHT_1 0x04
+#define G_MWO_aLIGHT_2 0x20
+#define G_MWO_bLIGHT_2 0x24
+#define G_MWO_aLIGHT_3 0x40
+#define G_MWO_bLIGHT_3 0x44
+#define G_MWO_aLIGHT_4 0x60
+#define G_MWO_bLIGHT_4 0x64
+#define G_MWO_aLIGHT_5 0x80
+#define G_MWO_bLIGHT_5 0x84
+#define G_MWO_aLIGHT_6 0xa0
+#define G_MWO_bLIGHT_6 0xa4
+#define G_MWO_aLIGHT_7 0xc0
+#define G_MWO_bLIGHT_7 0xc4
+#define G_MWO_aLIGHT_8 0xe0
+#define G_MWO_bLIGHT_8 0xe4
+#define G_MWO_MATRIX_XX_XY_I 0x00
+#define G_MWO_MATRIX_XZ_XW_I 0x04
+#define G_MWO_MATRIX_YX_YY_I 0x08
+#define G_MWO_MATRIX_YZ_YW_I 0x0c
+#define G_MWO_MATRIX_ZX_ZY_I 0x10
+#define G_MWO_MATRIX_ZZ_ZW_I 0x14
+#define G_MWO_MATRIX_WX_WY_I 0x18
+#define G_MWO_MATRIX_WZ_WW_I 0x1c
+#define G_MWO_MATRIX_XX_XY_F 0x20
+#define G_MWO_MATRIX_XZ_XW_F 0x24
+#define G_MWO_MATRIX_YX_YY_F 0x28
+#define G_MWO_MATRIX_YZ_YW_F 0x2c
+#define G_MWO_MATRIX_ZX_ZY_F 0x30
+#define G_MWO_MATRIX_ZZ_ZW_F 0x34
+#define G_MWO_MATRIX_WX_WY_F 0x38
+#define G_MWO_MATRIX_WZ_WW_F 0x3c
+#define G_MWO_POINT_RGBA 0x10
+#define G_MWO_POINT_ST 0x14
+#define G_MWO_POINT_XYSCREEN 0x18
+#define G_MWO_POINT_ZSCREEN 0x1c
+
+/*
+ * Light structure.
+ *
+ * Note: only directional (infinite) lights are currently supported.
+ *
+ * Note: the weird order is for the DMEM alignment benefit of
+ * the microcode.
+ *
+ */
+
+typedef struct {
+ unsigned char col[3]; /* diffuse light value (rgba) */
+ char pad1;
+ unsigned char colc[3]; /* copy of diffuse light value (rgba) */
+ char pad2;
+ signed char dir[3]; /* direction of light (normalized) */
+ char pad3;
+} Light_t;
+
+typedef struct {
+ unsigned char col[3]; /* ambient light value (rgba) */
+ char pad1;
+ unsigned char colc[3]; /* copy of ambient light value (rgba) */
+ char pad2;
+} Ambient_t;
+
+typedef struct {
+ int x1,y1,x2,y2; /* texture offsets for highlight 1/2 */
+} Hilite_t;
+
+typedef union {
+ Light_t l;
+ long long int force_structure_alignment[2];
+} Light;
+
+typedef union {
+ Ambient_t l;
+ long long int force_structure_alignment[1];
+} Ambient;
+
+typedef struct {
+ Ambient a;
+ Light l[7];
+} Lightsn;
+
+typedef struct {
+ Ambient a;
+ Light l[1];
+} Lights0;
+
+typedef struct {
+ Ambient a;
+ Light l[1];
+} Lights1;
+
+typedef struct {
+ Ambient a;
+ Light l[2];
+} Lights2;
+
+typedef struct {
+ Ambient a;
+ Light l[3];
+} Lights3;
+
+typedef struct {
+ Ambient a;
+ Light l[4];
+} Lights4;
+
+typedef struct {
+ Ambient a;
+ Light l[5];
+} Lights5;
+
+typedef struct {
+ Ambient a;
+ Light l[6];
+} Lights6;
+
+typedef struct {
+ Ambient a;
+ Light l[7];
+} Lights7;
+
+typedef struct {
+ Light l[2];
+} LookAt;
+
+typedef union {
+ Hilite_t h;
+ long int force_structure_alignment[4];
+} Hilite;
+
+#define gdSPDefLights0(ar,ag,ab) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ { 0, 0, 0},0,{ 0, 0, 0},0,{ 0, 0, 0},0}}} }
+#define gdSPDefLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}} }
+#define gdSPDefLights2(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}} }
+#define gdSPDefLights3(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
+ {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}} }
+#define gdSPDefLights4(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
+ {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
+ {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}} }
+#define gdSPDefLights5(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
+ {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
+ {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
+ {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}} }
+
+
+#define gdSPDefLights6(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
+ {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
+ {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
+ {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \
+ {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}} }
+
+
+#define gdSPDefLights7(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6,r7,g7,b7,x7,y7,z7) \
+ { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
+ {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
+ {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
+ {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
+ {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
+ {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \
+ {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}, \
+ {{ {r7,g7,b7},0,{r7,g7,b7},0,{x7,y7,z7},0}}} }
+
+
+#define gdSPDefLookAt(rightx,righty,rightz,upx,upy,upz) \
+ { {{ {{0,0,0},0,{0,0,0},0,{rightx,righty,rightz},0}}, \
+ { {{0,0x80,0},0,{0,0x80,0},0,{upx,upy,upz},0}}} }
+
+/*
+ * Graphics DMA Packet
+ */
+typedef struct {
+ int cmd:8;
+ unsigned int par:8;
+ unsigned int len:16;
+ unsigned int addr;
+} Gdma;
+
+/*
+ * Graphics Immediate Mode Packet types
+ */
+typedef struct {
+ int cmd:8;
+ int pad:24;
+ Tri tri;
+} Gtri;
+
+typedef struct {
+ int cmd:8;
+ int pad1:24;
+ int pad2:24;
+ unsigned char param:8;
+} Gpopmtx;
+
+/*
+ * typedef struct {
+ * int cmd:8;
+ * int pad0:24;
+ * int pad1:4;
+ * int number:4;
+ * int base:24;
+ * } Gsegment;
+ */
+typedef struct {
+ int cmd:8;
+ int pad0:8;
+ int mw_index:8;
+ int number:8;
+ int pad1:8;
+ int base:24;
+} Gsegment;
+
+typedef struct {
+ int cmd:8;
+ int pad0:8;
+ int sft:8;
+ int len:8;
+ unsigned int data:32;
+} GsetothermodeL;
+
+typedef struct {
+ int cmd:8;
+ int pad0:8;
+ int sft:8;
+ int len:8;
+ unsigned int data:32;
+} GsetothermodeH;
+
+typedef struct {
+ unsigned char cmd;
+ unsigned char lodscale;
+ unsigned char tile;
+ unsigned char on;
+ unsigned short s;
+ unsigned short t;
+} Gtexture;
+
+typedef struct {
+ int cmd:8;
+ int pad:24;
+ Tri line;
+} Gline3D;
+
+typedef struct {
+ int cmd:8;
+ int pad1:24;
+ short int pad2;
+ short int scale;
+} Gperspnorm;
+
+
+/*
+ * RDP Packet types
+ */
+typedef struct {
+ int cmd:8;
+ unsigned int fmt:3;
+ unsigned int siz:2;
+ unsigned int pad:7;
+ unsigned int wd:12; /* really only 10 bits, extra */
+ unsigned int dram; /* to account for 1024 */
+} Gsetimg;
+
+typedef struct {
+ int cmd:8;
+ unsigned int muxs0:24;
+ unsigned int muxs1:32;
+} Gsetcombine;
+
+typedef struct {
+ int cmd:8;
+ unsigned char pad;
+ unsigned char prim_min_level;
+ unsigned char prim_level;
+ unsigned long color;
+} Gsetcolor;
+
+typedef struct {
+ int cmd:8;
+ int x0:10;
+ int x0frac:2;
+ int y0:10;
+ int y0frac:2;
+ unsigned int pad:8;
+ int x1:10;
+ int x1frac:2;
+ int y1:10;
+ int y1frac:2;
+} Gfillrect;
+
+typedef struct {
+ int cmd:8;
+ unsigned int fmt:3;
+ unsigned int siz:2;
+ unsigned int pad0:1;
+ unsigned int line:9;
+ unsigned int tmem:9;
+ unsigned int pad1:5;
+ unsigned int tile:3;
+ unsigned int palette:4;
+ unsigned int ct:1;
+ unsigned int mt:1;
+ unsigned int maskt:4;
+ unsigned int shiftt:4;
+ unsigned int cs:1;
+ unsigned int ms:1;
+ unsigned int masks:4;
+ unsigned int shifts:4;
+} Gsettile;
+
+typedef struct {
+ int cmd:8;
+ unsigned int sl:12;
+ unsigned int tl:12;
+ int pad:5;
+ unsigned int tile:3;
+ unsigned int sh:12;
+ unsigned int th:12;
+} Gloadtile;
+
+typedef Gloadtile Gloadblock;
+
+typedef Gloadtile Gsettilesize;
+
+typedef Gloadtile Gloadtlut;
+
+typedef struct {
+ unsigned int cmd:8; /* command */
+ unsigned int xl:12; /* X coordinate of upper left */
+ unsigned int yl:12; /* Y coordinate of upper left */
+ unsigned int pad1:5; /* Padding */
+ unsigned int tile:3; /* Tile descriptor index */
+ unsigned int xh:12; /* X coordinate of lower right */
+ unsigned int yh:12; /* Y coordinate of lower right */
+ unsigned int s:16; /* S texture coord at top left */
+ unsigned int t:16; /* T texture coord at top left */
+ unsigned int dsdx:16;/* Change in S per change in X */
+ unsigned int dtdy:16;/* Change in T per change in Y */
+} Gtexrect;
+
+#define MakeTexRect(xh,yh,flip,tile,xl,yl,s,t,dsdx,dtdy) \
+ G_TEXRECT, xh, yh, 0, flip, 0, tile, xl, yl, s, t, dsdx, dtdy
+
+/*
+ * Textured rectangles are 128 bits not 64 bits
+ */
+typedef struct {
+ unsigned long w0;
+ unsigned long w1;
+ unsigned long w2;
+ unsigned long w3;
+} TexRect;
+
+/*
+ * Generic Gfx Packet
+ */
+typedef struct {
+ unsigned int w0;
+ unsigned int w1;
+} Gwords;
+
+/*
+ * This union is the fundamental type of the display list.
+ * It is, by law, exactly 64 bits in size.
+ */
+typedef union {
+ Gwords words;
+ Gdma dma;
+ Gtri tri;
+ Gline3D line;
+ Gpopmtx popmtx;
+ Gsegment segment;
+ GsetothermodeH setothermodeH;
+ GsetothermodeL setothermodeL;
+ Gtexture texture;
+ Gperspnorm perspnorm;
+ Gsetimg setimg;
+ Gsetcombine setcombine;
+ Gsetcolor setcolor;
+ Gfillrect fillrect; /* use for setscissor also */
+ Gsettile settile;
+ Gloadtile loadtile; /* use for loadblock also, th is dxt */
+ Gsettilesize settilesize;
+ Gloadtlut loadtlut;
+ long long int force_structure_alignment;
+} Gfx;
+
+/*
+ * Macros to assemble the graphics display list
+ */
+
+/*
+ * DMA macros
+ */
+#define gDma0p(pkt, c, s, l) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \
+ _g->words.w1 = (unsigned int)(s); \
+}
+
+#define gsDma0p(c, s, l) \
+{ \
+ _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (unsigned int)(s) \
+}
+
+#define gDma1p(pkt, c, s, l, p) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
+ _SHIFTL((l), 0, 16)); \
+ _g->words.w1 = (unsigned int)(s); \
+}
+
+#define gsDma1p(c, s, l, p) \
+{ \
+ (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
+ _SHIFTL((l), 0, 16)), \
+ (unsigned int)(s) \
+}
+
+#define gDma2p(pkt, c, adrs, len, idx, ofs) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL((ofs)/8,16,8)| \
+ _SHIFTL(((len)-1)/8,8,8)|_SHIFTL((idx),0,8)); \
+ _g->words.w1 = (unsigned int)(adrs); \
+}
+#define gsDma2p(c, adrs, len, idx, ofs) \
+{ \
+ (_SHIFTL((c),24,8)|_SHIFTL((ofs)/8,16,8)| \
+ _SHIFTL(((len)-1)/8,8,8)|_SHIFTL((idx),0,8)), \
+ (unsigned int)(adrs) \
+}
+
+#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0)
+#define gsSPNoOp() gsDma0p(G_SPNOOP, 0, 0)
+
+#ifdef F3DEX_GBI_2x
+# define gSPMatrix(pkt, m, p) \
+ gDma2p((pkt),G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0)
+# define gsSPMatrix(m, p) \
+ gsDma2p( G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0)
+#else /* F3DEX_GBI_2 */
+# define gSPMatrix(pkt, m, p) gDma1p(pkt, G_MTX, m, sizeof(Mtx), p)
+# define gsSPMatrix(m, p) gsDma1p(G_MTX, m, sizeof(Mtx), p)
+#endif /* F3DEX_GBI_2 */
+
+/*
+ * F3DEX_GBI: G_VTX GBI format was changed to support 64 vertice.
+ *
+ * +--------+--------+------+---------------+
+ * G_VTX | cmd:8 | v0:8 | n:6 | length:10 |
+ * +-+---+--+--------+------+---------------+
+ * | |seg| address |
+ * +-+---+----------------------------------+
+ */
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+# define gSPVertex(pkt, v, n, v0) \
+ gDma1p(pkt, G_VTX, v, ((n)<<10)|(sizeof(Vtx)*(n)-1), (v0)*2)
+# define gsSPVertex(v, n, v0) \
+ gsDma1p(G_VTX, v, ((n)<<10)|(sizeof(Vtx)*(n)-1), (v0)*2)
+#else
+# define gSPVertex(pkt, v, n, v0) \
+ gDma1p(pkt, G_VTX, v, sizeof(Vtx)*(n),((n)-1)<<4|(v0))
+# define gsSPVertex(v, n, v0) \
+ gsDma1p(G_VTX, v, sizeof(Vtx)*(n), ((n)-1)<<4|(v0))
+#endif
+
+
+#ifdef F3DEX_GBI_2x
+# define gSPViewport(pkt, v) gDma2p(pkt,G_MOVEMEM,v,sizeof(Vp),G_MV_VIEWPORT,0)
+# define gsSPViewport(v) gsDma2p( G_MOVEMEM,v,sizeof(Vp),G_MV_VIEWPORT,0)
+#else /* F3DEX_GBI_2 */
+# define gSPViewport(pkt,v) gDma1p(pkt,G_MOVEMEM,(v),sizeof(Vp),G_MV_VIEWPORT)
+# define gsSPViewport(v) gsDma1p( G_MOVEMEM,(v),sizeof(Vp),G_MV_VIEWPORT)
+#endif /* F3DEX_GBI_2 */
+
+#define gSPDisplayList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_PUSH)
+#define gsSPDisplayList( dl) gsDma1p( G_DL,dl,0,G_DL_PUSH)
+
+#define gSPBranchList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_NOPUSH)
+#define gsSPBranchList( dl) gsDma1p( G_DL,dl,0,G_DL_NOPUSH)
+
+#define gSPSprite2DBase(pkt, s) gDma1p(pkt, G_SPRITE2D_BASE, s, sizeof(uSprite), 0)
+#define gsSPSprite2DBase(s) gsDma1p(G_SPRITE2D_BASE, s, sizeof(uSprite), 0)
+
+/*
+ * RSP short command (no DMA required) macros
+ */
+#define gImmp0(pkt, c) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL((c), 24, 8); \
+}
+
+#define gsImmp0(c) \
+{ \
+ _SHIFTL((c), 24, 8) \
+}
+
+#define gImmp1(pkt, c, p0) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL((c), 24, 8); \
+ _g->words.w1 = (unsigned int)(p0); \
+}
+
+#define gsImmp1(c, p0) \
+{ \
+ _SHIFTL((c), 24, 8), (unsigned int)(p0) \
+}
+
+#define gImmp2(pkt, c, p0, p1) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL((c), 24, 8); \
+ _g->words.w1 = _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8); \
+}
+
+#define gsImmp2(c, p0, p1) \
+{ \
+ _SHIFTL((c), 24, 8), _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8)\
+}
+
+#define gImmp3(pkt, c, p0, p1, p2) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL((c), 24, 8); \
+ _g->words.w1 = (_SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8) | \
+ _SHIFTL((p2), 0, 8)); \
+}
+
+#define gsImmp3(c, p0, p1, p2) \
+{ \
+ _SHIFTL((c), 24, 8), (_SHIFTL((p0), 16, 16) | \
+ _SHIFTL((p1), 8, 8) | _SHIFTL((p2), 0, 8))\
+}
+
+#define gImmp21(pkt, c, p0, p1, dat) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \
+ _SHIFTL((p1), 0, 8)); \
+ _g->words.w1 = (unsigned int) (dat); \
+}
+
+#define gsImmp21(c, p0, p1, dat) \
+{ \
+ _SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8),\
+ (unsigned int) (dat) \
+}
+
+#ifdef F3DEX_GBI_2x
+#define gMoveWd(pkt, index, offset, data) \
+ gDma1p((pkt), G_MOVEWORD, data, offset, index)
+#define gsMoveWd( index, offset, data) \
+ gsDma1p( G_MOVEWORD, data, offset, index)
+#else /* F3DEX_GBI_2 */
+#define gMoveWd(pkt, index, offset, data) \
+ gImmp21((pkt), G_MOVEWORD, offset, index, data)
+#define gsMoveWd( index, offset, data) \
+ gsImmp21( G_MOVEWORD, offset, index, data)
+#endif /* F3DEX_GBI_2 */
+
+/* Sprite immediate macros, there is also a sprite dma macro above */
+
+#define gSPSprite2DScaleFlip(pkt, sx, sy, fx, fy) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \
+ _SHIFTL((fx), 8, 8) | \
+ _SHIFTL((fy), 0, 8)); \
+ _g->words.w1 = (_SHIFTL((sx), 16, 16) | \
+ _SHIFTL((sy), 0, 16)); \
+}
+
+#define gsSPSprite2DScaleFlip(sx, sy, fx, fy) \
+{ \
+ (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \
+ _SHIFTL((fx), 8, 8) | \
+ _SHIFTL((fy), 0, 8)), \
+ (_SHIFTL((sx), 16, 16) | \
+ _SHIFTL((sy), 0, 16)) \
+}
+
+#define gSPSprite2DDraw(pkt, px, py) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)); \
+ _g->words.w1 = (_SHIFTL((px), 16, 16) | \
+ _SHIFTL((py), 0, 16)); \
+}
+
+#define gsSPSprite2DDraw(px, py) \
+{ \
+ (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)), \
+ (_SHIFTL((px), 16, 16) | \
+ _SHIFTL((py), 0, 16)) \
+}
+
+
+/*
+ * Note: the SP1Triangle() and line macros multiply the vertex indices
+ * by 10, this is an optimization for the microcode.
+ */
+#if (defined(F3DLP_GBI)||defined(F3DEX_GBI))
+# define __gsSP1Triangle_w1(v0, v1, v2) \
+ (_SHIFTL((v0)*2,16,8)|_SHIFTL((v1)*2,8,8)|_SHIFTL((v2)*2,0,8))
+# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \
+ (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \
+ ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v0): \
+ __gsSP1Triangle_w1(v2, v0, v1))
+# define __gsSPLine3D_w1(v0, v1, wd) \
+ (_SHIFTL((v0)*2,16,8)|_SHIFT((v1)*2,8,8)|_SHIFT((wd),0,8))
+# define __gsSPLine3D_w1f(v0, v1, wd, flag) \
+ (((flag) == 0) ? __gsSPLine3D_w1(v0, v1, wd): \
+ __gsSPLine3D_w1(v1, v0, wd))
+#else
+# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \
+ (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \
+ _SHIFTL((v1)*10, 8,8)|_SHIFTL((v2)*10, 0,8))
+# define __gsSPLine3D_w1f(v0, v1, wd, flag) \
+ (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \
+ _SHIFTL((v1)*10, 8,8)|_SHIFTL((wd), 0,8))
+#endif
+
+/***
+ *** 1 Triangle
+ ***/
+#define gSP1Triangle(pkt, v0, v1, v2, flag) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_TRI1, 24, 8); \
+ _g->words.w1 = __gsSP1Triangle_w1f(v0, v1, v2, flag); \
+}
+
+#define gsSP1Triangle(v0, v1, v2, flag) \
+{ \
+ _SHIFTL(G_TRI1, 24, 8), \
+ __gsSP1Triangle_w1f(v0, v1, v2, flag) \
+}
+
+/***
+ *** Line
+ ***/
+#define gSPLine3D(pkt, v0, v1, flag) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \
+ _g->words.w1 = __gsSPLine3D_w1f(v0, v1, 0, flag); \
+}
+
+#define gsSPLine3D(v0, v1, flag) \
+{ \
+ _SHIFTL(G_LINE3D, 24, 8), \
+ __gsSPLine3D_w1f(v0, v1, 0, flag) \
+}
+
+/***
+ *** LineW
+ ***/
+/* these macros are the same as SPLine3D, except they have an
+ * additional parameter for width. The width is added to the "minimum"
+ * thickness, which is 1.5 pixels. The units for width are in
+ * half-pixel units, so a width of 1 translates to (.5 + 1.5) or
+ * a 2.0 pixels wide line.
+ */
+#define gSPLineW3D(pkt, v0, v1, wd, flag) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \
+ _g->words.w1 = __gsSPLine3D_w1f(v0, v1, wd, flag); \
+}
+
+#define gsSPLineW3D(v0, v1, wd, flag) \
+{ \
+ _SHIFTL(G_LINE3D, 24, 8), \
+ __gsSPLine3D_w1f(v0, v1, wd, flag) \
+}
+
+#if (defined(F3DLP_GBI)||defined(F3DEX_GBI))
+/***
+ *** 2 Triangles
+ ***/
+#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \
+ __gsSP1Triangle_w1f(v00, v01, v02, flag0)); \
+ _g->words.w1 = __gsSP1Triangle_w1f(v10, v11, v12, flag1); \
+}
+
+#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \
+{ \
+ (_SHIFTL(G_TRI2, 24, 8)| \
+ __gsSP1Triangle_w1f(v00, v01, v02, flag0)), \
+ __gsSP1Triangle_w1f(v10, v11, v12, flag1) \
+}
+
+/***
+ *** 1 Quadrangle
+ ***/
+#define __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag) \
+ (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \
+ ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v3): \
+ ((flag) == 2) ? __gsSP1Triangle_w1(v2, v3, v0): \
+ __gsSP1Triangle_w1(v3, v0, v1))
+
+#define __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \
+ (((flag) == 0) ? __gsSP1Triangle_w1(v0, v2, v3): \
+ ((flag) == 1) ? __gsSP1Triangle_w1(v1, v3, v0): \
+ ((flag) == 2) ? __gsSP1Triangle_w1(v2, v0, v1): \
+ __gsSP1Triangle_w1(v3, v1, v2))
+
+#define gSP1Quadrangle(pkt, v0, v1, v2, v3, flag) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \
+ __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)); \
+ _g->words.w1 = __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag); \
+}
+
+#define gsSP1Quadrangle(v0, v1, v2, v3, flag) \
+{ \
+ (_SHIFTL(G_TRI2, 24, 8)| \
+ __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)), \
+ __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \
+}
+#endif /* F3DEX_GBI/F3DLP_GBI */
+
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+#define gSPCullDisplayList(pkt,vstart,vend) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \
+ _SHIFTL((vstart)*2, 0, 16); \
+ _g->words.w1 = _SHIFTL((vend)*2, 0, 16); \
+}
+
+#define gsSPCullDisplayList(vstart,vend) \
+{ \
+ _SHIFTL(G_CULLDL, 24, 8) | _SHIFTL((vstart)*2, 0, 16), \
+ _SHIFTL((vend)*2, 0, 16) \
+}
+
+#else
+#define gSPCullDisplayList(pkt,vstart,vend) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \
+ ((0x0f & (vstart))*40); \
+ _g->words.w1 = (unsigned int)((0x0f & ((vend)+1))*40); \
+}
+
+#define gsSPCullDisplayList(vstart,vend) \
+{ \
+ _SHIFTL(G_CULLDL, 24, 8) | ((0x0f & (vstart))*40), \
+ ((0x0f & ((vend)+1))*40) \
+}
+#endif
+
+#define gSPSegment(pkt, segment, base) \
+ gMoveWd(pkt, G_MW_SEGMENT, (segment)*4, base)
+#define gsSPSegment(segment, base) \
+ gsMoveWd( G_MW_SEGMENT, (segment)*4, base)
+
+/*
+ * Clipping Macros
+ */
+#define FR_NEG_FRUSTRATIO_1 0x00000001
+#define FR_POS_FRUSTRATIO_1 0x0000ffff
+#define FR_NEG_FRUSTRATIO_2 0x00000002
+#define FR_POS_FRUSTRATIO_2 0x0000fffe
+#define FR_NEG_FRUSTRATIO_3 0x00000003
+#define FR_POS_FRUSTRATIO_3 0x0000fffd
+#define FR_NEG_FRUSTRATIO_4 0x00000004
+#define FR_POS_FRUSTRATIO_4 0x0000fffc
+#define FR_NEG_FRUSTRATIO_5 0x00000005
+#define FR_POS_FRUSTRATIO_5 0x0000fffb
+#define FR_NEG_FRUSTRATIO_6 0x00000006
+#define FR_POS_FRUSTRATIO_6 0x0000fffa
+/*
+ * r should be one of: FRUSTRATIO_1, FRUSTRATIO_2, FRUSTRATIO_3, ... FRUSTRATIO_6
+ */
+#define gSPClipRatio(pkt, r) \
+{ \
+ gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r); \
+ gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r); \
+ gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r); \
+ gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r); \
+}
+
+#define gsSPClipRatio(r) \
+ gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r), \
+ gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r), \
+ gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r), \
+ gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r)
+
+/*
+ * Insert values into Matrix
+ *
+ * where = element of matrix (byte offset)
+ * num = new element (32 bit value replacing 2 int or 2 frac matrix
+ * componants
+ */
+#ifdef F3DEX_GBI_2x
+//ERROR!! gSPInsertMatrix is no longer supported.
+#else
+#define gSPInsertMatrix(pkt, where, num) \
+ gMoveWd(pkt, G_MW_MATRIX, where, num)
+#define gsSPInsertMatrix(where, num) \
+ gsMoveWd(G_MW_MATRIX, where, num)
+#endif
+
+/*
+ * Load new matrix directly
+ *
+ * mptr = pointer to matrix
+ */
+#ifdef F3DEX_GBI_2x
+#define gSPForceMatrix(pkt, mptr) \
+{ gDma2p((pkt),G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0); \
+ gMoveWd((pkt), G_MW_FORCEMTX,0,0x00010000); \
+}
+#define gsSPForceMatrix(mptr) \
+ gsDma2p(G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0), \
+ gsMoveWd(G_MW_FORCEMTX,0,0x00010000)
+
+#else /* F3DEX_GBI_2 */
+#define gSPForceMatrix(pkt, mptr) \
+{ \
+ gDma1p(pkt, G_MOVEMEM, mptr, 16, G_MV_MATRIX_1); \
+ gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2); \
+ gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3); \
+ gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4); \
+}
+#define gsSPForceMatrix(mptr) \
+ gsDma1p( G_MOVEMEM, mptr, 16, G_MV_MATRIX_1), \
+ gsDma1p( G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2), \
+ gsDma1p( G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3), \
+ gsDma1p( G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4)
+#endif /* F3DEX_GBI_2 */
+
+/*
+ * Insert values into Points
+ *
+ * point = point number 0-15
+ * where = which element of point to modify (byte offset into point)
+ * num = new value (32 bit)
+ */
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+# define gSPModifyVertex(pkt, vtx, where, val) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL(G_MODIFYVTX,24,8)| \
+ _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16)); \
+ _g->words.w1 = (unsigned int)(val); \
+}
+# define gsSPModifyVertex(vtx, where, val) \
+{ \
+ _SHIFTL(G_MODIFYVTX,24,8)| \
+ _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16), \
+ (unsigned int)(val) \
+}
+#else
+# define gSPModifyVertex(pkt, vtx, where, val) \
+ gMoveWd(pkt, G_MW_POINTS, (vtx)*40+(where), val)
+# define gsSPModifyVertex(vtx, where, val) \
+ gsMoveWd(G_MW_POINTS, (vtx)*40+(where), val)
+#endif
+
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
+/*
+ * gSPBranchLessZ Branch DL if (vtx.z) less than or equal (zval).
+ *
+ * dl = DL branch to
+ * vtx = Vertex
+ * zval = Screen depth
+ * near = Near plane
+ * far = Far plane
+ * flag = G_BZ_PERSP or G_BZ_ORTHO
+ */
+
+#define G_BZ_PERSP 0
+#define G_BZ_ORTHO 1
+
+#define G_DEPTOZSrg(zval, near, far, flag, zmin, zmax) \
+(((unsigned int)FTOFIX32(((flag) == G_BZ_PERSP ? \
+ (1.0f-(float)(near)/(float)(zval)) / \
+ (1.0f-(float)(near)/(float)(far )) : \
+ ((float)(zval) - (float)(near)) / \
+ ((float)(far ) - (float)(near))))) * \
+ (((int)((zmax) - (zmin)))&~1) + (int)FTOFIX32(zmin))
+
+#define G_DEPTOZS(zval, near, far, flag) \
+ G_DEPTOZSrg(zval, near, far, flag, 0, G_MAXZ)
+
+#define gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, zmin, zmax) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
+ _g->words.w1 = (unsigned int)(dl); \
+ _g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \
+ _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \
+ _g->words.w1 = G_DEPTOZSrg(zval, near, far, flag, zmin, zmax); \
+}
+
+#define gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, zmin, zmax) \
+{ _SHIFTL(G_RDPHALF_1,24,8), \
+ (unsigned int)(dl), }, \
+{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
+ G_DEPTOZSrg(zval, near, far, flag, zmin, zmax), }
+
+#define gSPBranchLessZ(pkt, dl, vtx, zval, near, far, flag) \
+ gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, 0, G_MAXZ)
+#define gsSPBranchLessZ(dl, vtx, zval, near, far, flag) \
+ gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, 0, G_MAXZ)
+
+/*
+ * gSPBranchLessZraw Branch DL if (vtx.z) less than or equal (raw zval).
+ *
+ * dl = DL branch to
+ * vtx = Vertex
+ * zval = Raw value of screen depth
+ */
+#define gSPBranchLessZraw(pkt, dl, vtx, zval) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
+ _g->words.w1 = (unsigned int)(dl); \
+ _g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \
+ _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \
+ _g->words.w1 = (unsigned int)(zval); \
+}
+
+#define gsSPBranchLessZraw(dl, vtx, zval) \
+{ _SHIFTL(G_RDPHALF_1,24,8), \
+ (unsigned int)(dl), }, \
+{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
+ (unsigned int)(zval), }
+
+/*
+ * gSPLoadUcode RSP loads specified ucode.
+ *
+ * uc_start = ucode text section start
+ * uc_dstart = ucode data section start
+ */
+#define gSPLoadUcodeEx(pkt, uc_start, uc_dstart, uc_dsize) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
+ _g->words.w1 = (unsigned int)(uc_dstart); \
+ _g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL(G_LOAD_UCODE,24,8)| \
+ _SHIFTL((int)(uc_dsize)-1,0,16)); \
+ _g->words.w1 = (unsigned int)(uc_start); \
+}
+
+#define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \
+{ _SHIFTL(G_RDPHALF_1,24,8), \
+ (unsigned int)(uc_dstart), }, \
+{ _SHIFTL(G_LOAD_UCODE,24,8)| \
+ _SHIFTL((int)(uc_dsize)-1,0,16), \
+ (unsigned int)(uc_start), }
+
+#define gSPLoadUcode(pkt, uc_start, uc_dstart) \
+ gSPLoadUcodeEx((pkt), (uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
+#define gsSPLoadUcode(uc_start, uc_dstart) \
+ gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
+
+#define gSPLoadUcodeL(pkt, ucode) \
+ gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(#ucode##TextStart), \
+ OS_K0_TO_PHYSICAL(#ucode##DataStart))
+#define gsSPLoadUcodeL(ucode) \
+ gsSPLoadUcode(OS_K0_TO_PHYSICAL(#ucode##TextStart), \
+ OS_K0_TO_PHYSICAL(#ucode##DataStart))
+#endif
+
+/*
+ * Lighting Macros
+ */
+#ifdef F3DEX_GBI_2x
+# define NUML(n) ((n)*24)
+#else
+# define NUML(n) (((n)+1)*32 + 0x80000000)
+#endif
+#define NUMLIGHTS_0 1
+#define NUMLIGHTS_1 1
+#define NUMLIGHTS_2 2
+#define NUMLIGHTS_3 3
+#define NUMLIGHTS_4 4
+#define NUMLIGHTS_5 5
+#define NUMLIGHTS_6 6
+#define NUMLIGHTS_7 7
+/*
+ * n should be one of: NUMLIGHTS_0, NUMLIGHTS_1, ..., NUMLIGHTS_7
+ * NOTE: in addition to the number of directional lights specified,
+ * there is always 1 ambient light
+ */
+#define gSPNumLights(pkt, n) \
+ gMoveWd(pkt, G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n))
+#define gsSPNumLights(n) \
+ gsMoveWd( G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n))
+
+#define LIGHT_1 1
+#define LIGHT_2 2
+#define LIGHT_3 3
+#define LIGHT_4 4
+#define LIGHT_5 5
+#define LIGHT_6 6
+#define LIGHT_7 7
+#define LIGHT_8 8
+/*
+ * l should point to a Light struct
+ * n should be one of: LIGHT_1, LIGHT_2, ..., LIGHT_8
+ * NOTE: the highest numbered light is always the ambient light (eg if there are
+ * 3 directional lights defined: gsSPNumLights(NUMLIGHTS_3), then lights
+ * LIGHT_1 through LIGHT_3 will be the directional lights and light
+ * LIGHT_4 will be the ambient light.
+ */
+#ifdef F3DEX_GBI_2x
+# define gSPLight(pkt, l, n) \
+ gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*3+3)
+# define gsSPLight(l, n) \
+ gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*3+3)
+#else /* F3DEX_GBI_2 */
+# define gSPLight(pkt, l, n) \
+ gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0)
+# define gsSPLight(l, n) \
+ gsDma1p( G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0)
+#endif /* F3DEX_GBI_2 */
+
+/*
+ * gSPLightColor changes color of light without recalculating light direction
+ * col is a 32 bit word with r,g,b,a (alpha is ignored)
+ * n should be one of LIGHT_1, LIGHT_2, ..., LIGHT_8
+ */
+#define gSPLightColor(pkt, n, col) \
+{ \
+ gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_a##n, col); \
+ gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_b##n, col); \
+}
+#define gsSPLightColor(n, col) \
+ gsMoveWd(G_MW_LIGHTCOL, G_MWO_a##n, col), \
+ gsMoveWd(G_MW_LIGHTCOL, G_MWO_b##n, col)
+
+/* These macros use a structure "name" which is init'd with the gdSPDefLights macros*/
+
+#define gSPSetLights0(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_0); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.a,2); \
+}
+#define gsSPSetLights0(name) \
+ gsSPNumLights(NUMLIGHTS_0), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.a,2)
+
+#define gSPSetLights1(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_1); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.a,2); \
+}
+#define gsSPSetLights1(name) \
+ gsSPNumLights(NUMLIGHTS_1), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.a,2)
+
+#define gSPSetLights2(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_2); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.a,3); \
+}
+#define gsSPSetLights2(name) \
+ gsSPNumLights(NUMLIGHTS_2), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.a,3)
+
+#define gSPSetLights3(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_3); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.l[2],3); \
+ gSPLight(pkt,&name.a,4); \
+}
+#define gsSPSetLights3(name) \
+ gsSPNumLights(NUMLIGHTS_3), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.l[2],3), \
+ gsSPLight(&name.a,4)
+
+#define gSPSetLights4(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_4); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.l[2],3); \
+ gSPLight(pkt,&name.l[3],4); \
+ gSPLight(pkt,&name.a,5); \
+}
+#define gsSPSetLights4(name) \
+ gsSPNumLights(NUMLIGHTS_4), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.l[2],3), \
+ gsSPLight(&name.l[3],4), \
+ gsSPLight(&name.a,5)
+
+#define gSPSetLights5(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_5); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.l[2],3); \
+ gSPLight(pkt,&name.l[3],4); \
+ gSPLight(pkt,&name.l[4],5); \
+ gSPLight(pkt,&name.a,6); \
+}
+
+#define gsSPSetLights5(name) \
+ gsSPNumLights(NUMLIGHTS_5), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.l[2],3), \
+ gsSPLight(&name.l[3],4), \
+ gsSPLight(&name.l[4],5), \
+ gsSPLight(&name.a,6)
+
+#define gSPSetLights6(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_6); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.l[2],3); \
+ gSPLight(pkt,&name.l[3],4); \
+ gSPLight(pkt,&name.l[4],5); \
+ gSPLight(pkt,&name.l[5],6); \
+ gSPLight(pkt,&name.a,7); \
+}
+
+#define gsSPSetLights6(name) \
+ gsSPNumLights(NUMLIGHTS_6), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.l[2],3), \
+ gsSPLight(&name.l[3],4), \
+ gsSPLight(&name.l[4],5), \
+ gsSPLight(&name.l[5],6), \
+ gsSPLight(&name.a,7)
+
+#define gSPSetLights7(pkt,name) \
+{ \
+ gSPNumLights(pkt,NUMLIGHTS_7); \
+ gSPLight(pkt,&name.l[0],1); \
+ gSPLight(pkt,&name.l[1],2); \
+ gSPLight(pkt,&name.l[2],3); \
+ gSPLight(pkt,&name.l[3],4); \
+ gSPLight(pkt,&name.l[4],5); \
+ gSPLight(pkt,&name.l[5],6); \
+ gSPLight(pkt,&name.l[6],7); \
+ gSPLight(pkt,&name.a,8); \
+}
+
+#define gsSPSetLights7(name) \
+ gsSPNumLights(NUMLIGHTS_7), \
+ gsSPLight(&name.l[0],1), \
+ gsSPLight(&name.l[1],2), \
+ gsSPLight(&name.l[2],3), \
+ gsSPLight(&name.l[3],4), \
+ gsSPLight(&name.l[4],5), \
+ gsSPLight(&name.l[5],6), \
+ gsSPLight(&name.l[6],7), \
+ gsSPLight(&name.a,8)
+
+/*
+ * Reflection/Hiliting Macros
+ */
+#ifdef F3DEX_GBI_2
+# define gSPLookAtX(pkt, l) \
+ gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LOOKATX,0)
+# define gsSPLookAtX(l) \
+ gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LOOKATX,0)
+# define gSPLookAtY(pkt, l) \
+ gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LOOKATY,0)
+# define gsSPLookAtY(l) \
+ gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LOOKATY,0)
+#else /* F3DEX_GBI_2 */
+# define gSPLookAtX(pkt, l) \
+ gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX)
+# define gsSPLookAtX(l) \
+ gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX)
+# define gSPLookAtY(pkt, l) \
+ gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY)
+# define gsSPLookAtY(l) \
+ gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY)
+#endif /* F3DEX_GBI_2 */
+
+#define gSPLookAt(pkt, la) \
+{ \
+ gSPLookAtX(pkt,la) \
+ gSPLookAtY(pkt,(char *)(la)+16) \
+}
+#define gsSPLookAt(la) \
+ gsSPLookAtX(la), \
+ gsSPLookAtY((char *)(la)+16)
+
+#define gDPSetHilite1Tile(pkt, tile, hilite, width, height) \
+ gDPSetTileSize(pkt, tile, (hilite)->h.x1 & 0xfff, (hilite)->h.y1 & 0xfff, \
+ ((((width)-1)*4)+(hilite)->h.x1) & 0xfff, ((((height)-1)*4)+(hilite)->h.y1) & 0xfff)
+#define gsDPSetHilite1Tile(tile, hilite, width, height) \
+ gsDPSetTileSize(tile, (hilite)->h.x1 & 0xfff, (hilite)->h.y1 & 0xfff, \
+ ((((width)-1)*4)+(hilite)->h.x1) & 0xfff, ((((height)-1)*4)+(hilite)->h.y1) & 0xfff)
+
+#define gDPSetHilite2Tile(pkt, tile, hilite, width, height) \
+ gDPSetTileSize(pkt, tile, (hilite)->h.x2 & 0xfff, (hilite)->h.y2 & 0xfff, \
+ ((((width)-1)*4)+(hilite)->h.x2) & 0xfff, ((((height)-1)*4)+(hilite)->h.y2) & 0xfff)
+#define gsDPSetHilite2Tile(tile, hilite, width, height) \
+ gsDPSetTileSize(tile, (hilite)->h.x2 & 0xfff, (hilite)->h.y2 & 0xfff, \
+ ((((width)-1)*4)+(hilite)->h.x2) & 0xfff, ((((height)-1)*4)+(hilite)->h.y2) & 0xfff)
+
+/*
+ * FOG macros
+ * fm = z multiplier
+ * fo = z offset
+ * FOG FORMULA: alpha(fog) = (eyespace z) * fm + fo CLAMPED 0 to 255
+ * note: (eyespace z) ranges -1 to 1
+ *
+ * Alternate method of setting fog:
+ * min, max: range 0 to 1000: 0=nearplane, 1000=farplane
+ * min is where fog begins (usually less than max and often 0)
+ * max is where fog is thickest (usually 1000)
+ *
+ */
+#define gSPFogFactor(pkt, fm, fo) \
+ gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \
+ (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16)))
+
+#define gsSPFogFactor(fm, fo) \
+ gsMoveWd(G_MW_FOG, G_MWO_FOG, \
+ (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16)))
+
+#define gSPFogPosition(pkt, min, max) \
+ gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \
+ (_SHIFTL((128000/((max)-(min))),16,16) | \
+ _SHIFTL(((500-(min))*256/((max)-(min))),0,16)))
+
+#define gsSPFogPosition(min, max) \
+ gsMoveWd(G_MW_FOG, G_MWO_FOG, \
+ (_SHIFTL((128000/((max)-(min))),16,16) | \
+ _SHIFTL(((500-(min))*256/((max)-(min))),0,16)))
+
+/*
+ * Macros to turn texture on/off
+ */
+#define gSPTexture(pkt, s, t, level, tile, on) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TEXTURE, 24, 8) | \
+ _SHIFTL(BOWTIE_VAL, 16, 8) | \
+ _SHIFTL(level, 11, 3) | _SHIFTL(tile, 8, 3) | \
+ _SHIFTL(on, 0, 8)); \
+ _g->words.w1 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \
+}
+
+#define gsSPTexture(s, t, level, tile, on) \
+{ \
+ (_SHIFTL(G_TEXTURE, 24, 8) | _SHIFTL(BOWTIE_VAL, 16, 8) | \
+ _SHIFTL(level, 11, 3) | _SHIFTL(tile, 8, 3) | _SHIFTL(on, 0, 8)),\
+ (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)) \
+}
+
+/*
+ * Different version of SPTexture macro, has an additional parameter
+ * which is currently reserved in the microcode.
+ */
+#define gSPTextureL(pkt, s, t, level, xparam, tile, on) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TEXTURE, 24, 8) | \
+ _SHIFTL(xparam, 16, 8) | \
+ _SHIFTL(level, 11, 3) | _SHIFTL(tile, 8, 3) | \
+ _SHIFTL(on, 0, 8)); \
+ _g->words.w1 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \
+}
+
+#define gsSPTextureL(s, t, level, xparam, tile, on) \
+{ \
+ (_SHIFTL(G_TEXTURE, 24, 8) | _SHIFTL(xparam, 16, 8) | \
+ _SHIFTL(level, 11, 3) | _SHIFTL(tile, 8, 3) | _SHIFTL(on, 0, 8)),\
+ (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)) \
+}
+
+
+#define gSPPerspNormalize(pkt, s) \
+ gMoveWd(pkt, G_MW_PERSPNORM, 0, (s))
+#define gsSPPerspNormalize(s) \
+ gsMoveWd( G_MW_PERSPNORM, 0, (s))
+
+#ifdef F3DEX_GBI_2x
+# define gSPPopMatrixN(pkt, n, num) gDma2p((pkt),G_POPMTX,(num)*64,64,2,0)
+# define gsSPPopMatrixN(n, num) gsDma2p( G_POPMTX,(num)*64,64,2,0)
+# define gSPPopMatrix(pkt, n) gSPPopMatrixN((pkt), (n), 1)
+# define gsSPPopMatrix(n) gsSPPopMatrixN( (n), 1)
+#else /* F3DEX_GBI_2 */
+# define gSPPopMatrix(pkt, n) gImmp1(pkt, G_POPMTX, n)
+# define gsSPPopMatrix(n) gsImmp1( G_POPMTX, n)
+#endif /* F3DEX_GBI_2 */
+
+#define gSPEndDisplayList(pkt) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_ENDDL, 24, 8); \
+ _g->words.w1 = 0; \
+}
+
+#define gsSPEndDisplayList() \
+{ \
+ _SHIFTL(G_ENDDL, 24, 8), 0 \
+}
+
+#ifdef F3DEX_GBI_2x
+/*
+ * One gSPGeometryMode(pkt,c,s) GBI is equal to these two GBIs.
+ *
+ * gSPClearGeometryMode(pkt,c)
+ * gSPSetGeometryMode(pkt,s)
+ *
+ * gSPLoadGeometryMode(pkt, word) sets GeometryMode directly.
+ */
+#define gSPGeometryMode(pkt, c, s) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = _SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24);\
+ _g->words.w1 = (u32)(s); \
+}
+
+#define gsSPGeometryMode(c, s) \
+{ \
+ (_SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24)),(u32)(s) \
+}
+#define gSPSetGeometryMode(pkt, word) gSPGeometryMode((pkt),0,(word))
+#define gsSPSetGeometryMode(word) gsSPGeometryMode(0,(word))
+#define gSPClearGeometryMode(pkt, word) gSPGeometryMode((pkt),(word),0)
+#define gsSPClearGeometryMode(word) gsSPGeometryMode((word),0)
+#define gSPLoadGeometryMode(pkt, word) gSPGeometryMode((pkt),-1,(word))
+#define gsSPLoadGeometryMode(pkt, word) gsSPGeometryMode(-1,(word))
+
+#else /* F3DEX_GBI_2 */
+#define gSPSetGeometryMode(pkt, word) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_SETGEOMETRYMODE, 24, 8); \
+ _g->words.w1 = (unsigned int)(word); \
+}
+
+#define gsSPSetGeometryMode(word) \
+{ \
+ _SHIFTL(G_SETGEOMETRYMODE, 24, 8), (unsigned int)(word) \
+}
+
+#define gSPClearGeometryMode(pkt, word) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8); \
+ _g->words.w1 = (unsigned int)(word); \
+}
+
+#define gsSPClearGeometryMode(word) \
+{ \
+ _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (unsigned int)(word) \
+}
+#endif /* F3DEX_GBI_2 */
+
+#ifdef F3DEX_GBI_2x
+#define gSPSetOtherMode(pkt, cmd, sft, len, data) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ _g->words.w0 = (_SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)| \
+ _SHIFTL((len)-1,0,8)); \
+ _g->words.w1 = (unsigned int)(data); \
+}
+
+#define gsSPSetOtherMode(cmd, sft, len, data) \
+{ \
+ _SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)|_SHIFTL((len)-1,0,8), \
+ (unsigned int)(data) \
+}
+#else
+#define gSPSetOtherMode(pkt, cmd, sft, len, data) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | \
+ _SHIFTL(len, 0, 8)); \
+ _g->words.w1 = (unsigned int)(data); \
+}
+
+#define gsSPSetOtherMode(cmd, sft, len, data) \
+{ \
+ _SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), \
+ (unsigned int)(data) \
+}
+#endif
+
+/*
+ * RDP setothermode register commands - register shadowed in RSP
+ */
+#define gDPPipelineMode(pkt, mode) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode)
+#define gsDPPipelineMode(mode) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode)
+
+#define gDPSetCycleType(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type)
+#define gsDPSetCycleType(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type)
+
+#define gDPSetTexturePersp(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type)
+#define gsDPSetTexturePersp(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type)
+
+#define gDPSetTextureDetail(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type)
+#define gsDPSetTextureDetail(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type)
+
+#define gDPSetTextureLOD(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type)
+#define gsDPSetTextureLOD(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type)
+
+#define gDPSetTextureLUT(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type)
+#define gsDPSetTextureLUT(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type)
+
+#define gDPSetTextureFilter(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type)
+#define gsDPSetTextureFilter(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type)
+
+#define gDPSetTextureConvert(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type)
+#define gsDPSetTextureConvert(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type)
+
+#define gDPSetCombineKey(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type)
+#define gsDPSetCombineKey(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type)
+
+#ifndef _HW_VERSION_1
+#define gDPSetColorDither(pkt, mode) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode)
+#define gsDPSetColorDither(mode) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode)
+#else
+#define gDPSetColorDither(pkt, mode) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode)
+#define gsDPSetColorDither(mode) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode)
+#endif
+
+#ifndef _HW_VERSION_1
+#define gDPSetAlphaDither(pkt, mode) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode)
+#define gsDPSetAlphaDither(mode) \
+ gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode)
+#endif
+
+/* 'blendmask' is not supported anymore.
+ * The bits are reserved for future use.
+ * Fri May 26 13:45:55 PDT 1995
+ */
+#define gDPSetBlendMask(pkt, mask) gDPNoOp(pkt)
+#define gsDPSetBlendMask(mask) gsDPNoOp()
+
+#define gDPSetAlphaCompare(pkt, type) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type)
+#define gsDPSetAlphaCompare(type) \
+ gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type)
+
+#define gDPSetDepthSource(pkt, src) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src)
+#define gsDPSetDepthSource(src) \
+ gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src)
+
+#define gDPSetRenderMode(pkt, c0, c1) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \
+ (c0) | (c1))
+#define gsDPSetRenderMode(c0, c1) \
+ gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \
+ (c0) | (c1))
+
+#define gSetImage(pkt, cmd, fmt, siz, width, i) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
+ _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \
+ _g->words.w1 = (unsigned int)(i); \
+}
+
+#define gsSetImage(cmd, fmt, siz, width, i) \
+{ \
+ _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
+ _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \
+ (unsigned int)(i) \
+}
+
+#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i)
+#define gsDPSetColorImage(f, s, w, i) gsSetImage(G_SETCIMG, f, s, w, i)
+
+
+/* use these for new code */
+#define gDPSetDepthImage(pkt, i) gSetImage(pkt, G_SETZIMG, 0, 0, 1, i)
+#define gsDPSetDepthImage(i) gsSetImage(G_SETZIMG, 0, 0, 1, i)
+/* kept for compatibility */
+#define gDPSetMaskImage(pkt, i) gDPSetDepthImage(pkt, i)
+#define gsDPSetMaskImage(i) gsDPSetDepthImage(i)
+
+#define gDPSetTextureImage(pkt, f, s, w, i) gSetImage(pkt, G_SETTIMG, f, s, w, i)
+#define gsDPSetTextureImage(f, s, w, i) gsSetImage(G_SETTIMG, f, s, w, i)
+
+/*
+ * RDP macros
+ */
+
+#define gDPSetCombine(pkt, muxs0, muxs1) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24);\
+ _g->words.w1 = (unsigned int)(muxs1); \
+}
+
+#define gsDPSetCombine(muxs0, muxs1) \
+{ \
+ _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \
+ (unsigned int)(muxs1) \
+}
+
+#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \
+ (_SHIFTL((saRGB0), 20, 4) | _SHIFTL((mRGB0), 15, 5) | \
+ _SHIFTL((saA0), 12, 3) | _SHIFTL((mA0), 9, 3))
+
+#define GCCc1w0(saRGB1, mRGB1) \
+ (_SHIFTL((saRGB1), 5, 4) | _SHIFTL((mRGB1), 0, 5))
+
+#define GCCc0w1(sbRGB0, aRGB0, sbA0, aA0) \
+ (_SHIFTL((sbRGB0), 28, 4) | _SHIFTL((aRGB0), 15, 3) | \
+ _SHIFTL((sbA0), 12, 3) | _SHIFTL((aA0), 9, 3))
+
+#define GCCc1w1(sbRGB1, saA1, mA1, aRGB1, sbA1, aA1) \
+ (_SHIFTL((sbRGB1), 24, 4) | _SHIFTL((saA1), 21, 3) | \
+ _SHIFTL((mA1), 18, 3) | _SHIFTL((aRGB1), 6, 3) | \
+ _SHIFTL((sbA1), 3, 3) | _SHIFTL((aA1), 0, 3))
+
+#define gDPSetCombineLERP(pkt, a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \
+ a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | \
+ _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \
+ G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \
+ GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), \
+ 0, 24); \
+ _g->words.w1 = (unsigned int)(GCCc0w1(G_CCMUX_##b0, \
+ G_CCMUX_##d0, \
+ G_ACMUX_##Ab0, \
+ G_ACMUX_##Ad0) | \
+ GCCc1w1(G_CCMUX_##b1, \
+ G_ACMUX_##Aa1, \
+ G_ACMUX_##Ac1, \
+ G_CCMUX_##d1, \
+ G_ACMUX_##Ab1, \
+ G_ACMUX_##Ad1)); \
+}
+
+#define gsDPSetCombineLERP(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \
+ a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \
+{ \
+ _SHIFTL(G_SETCOMBINE, 24, 8) | \
+ _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \
+ G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \
+ GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), 0, 24), \
+ (unsigned int)(GCCc0w1(G_CCMUX_##b0, G_CCMUX_##d0, \
+ G_ACMUX_##Ab0, G_ACMUX_##Ad0) | \
+ GCCc1w1(G_CCMUX_##b1, G_ACMUX_##Aa1, \
+ G_ACMUX_##Ac1, G_CCMUX_##d1, \
+ G_ACMUX_##Ab1, G_ACMUX_##Ad1)) \
+}
+
+/*
+ * SetCombineMode macros are NOT redunant. It allow the C preprocessor
+ * to substitute single parameter which includes commas in the token and
+ * rescan for higher parameter count macro substitution.
+ *
+ * eg. gsDPSetCombineMode(G_CC_MODULATE, G_CC_MODULATE) turns into
+ * gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0,
+ * TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0)
+ */
+
+#define gDPSetCombineMode(pkt, a, b) gDPSetCombineLERP(pkt, a, b)
+#define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b)
+
+#define gDPSetColor(pkt, c, d) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(c, 24, 8); \
+ _g->words.w1 = (unsigned int)(d); \
+}
+
+#define gsDPSetColor(c, d) \
+{ \
+ _SHIFTL(c, 24, 8), (unsigned int)(d) \
+}
+
+#define DPRGBColor(pkt, cmd, r, g, b, a) \
+ gDPSetColor(pkt, cmd, \
+ (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \
+ _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)))
+#define sDPRGBColor(cmd, r, g, b, a) \
+ gsDPSetColor(cmd, \
+ (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \
+ _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)))
+
+#define gDPSetEnvColor(pkt, r, g, b, a) \
+ DPRGBColor(pkt, G_SETENVCOLOR, r,g,b,a)
+#define gsDPSetEnvColor(r, g, b, a) \
+ sDPRGBColor(G_SETENVCOLOR, r,g,b,a)
+#define gDPSetBlendColor(pkt, r, g, b, a) \
+ DPRGBColor(pkt, G_SETBLENDCOLOR, r,g,b,a)
+#define gsDPSetBlendColor(r, g, b, a) \
+ sDPRGBColor(G_SETBLENDCOLOR, r,g,b,a)
+#define gDPSetFogColor(pkt, r, g, b, a) \
+ DPRGBColor(pkt, G_SETFOGCOLOR, r,g,b,a)
+#define gsDPSetFogColor(r, g, b, a) \
+ sDPRGBColor(G_SETFOGCOLOR, r,g,b,a)
+#define gDPSetFillColor(pkt, d) \
+ gDPSetColor(pkt, G_SETFILLCOLOR, (d))
+#define gsDPSetFillColor(d) \
+ gsDPSetColor(G_SETFILLCOLOR, (d))
+
+#define gDPSetPrimDepth(pkt, z, dz) \
+ gDPSetColor(pkt, G_SETPRIMDEPTH, \
+ _SHIFTL(z, 16, 16) | _SHIFTL(dz, 0, 16))
+#define gsDPSetPrimDepth(z, dz) \
+ gsDPSetColor(G_SETPRIMDEPTH, _SHIFTL(z, 16, 16) | \
+ _SHIFTL(dz, 0, 16))
+
+#define gDPSetPrimColor(pkt, m, l, r, g, b, a) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \
+ _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
+ _g->words.w1 = (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \
+ _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)); \
+}
+
+#define gsDPSetPrimColor(m, l, r, g, b, a) \
+{ \
+ (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | \
+ _SHIFTL(l, 0, 8)), \
+ (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | \
+ _SHIFTL(a, 0, 8)) \
+}
+
+/*
+ * gDPSetOtherMode (This is for expert user.)
+ *
+ * This command makes all othermode parameters set.
+ * Do not use this command in the same DL with another g*SPSetOtherMode DLs.
+ *
+ * [Usage]
+ * gDPSetOtherMode(pkt, modeA, modeB)
+ *
+ * 'modeA' is described all parameters of GroupA GBI command.
+ * 'modeB' is also described all parameters of GroupB GBI command.
+ *
+ * GroupA:
+ * gDPPipelineMode, gDPSetCycleType, gSPSetTexturePersp,
+ * gDPSetTextureDetail, gDPSetTextureLOD, gDPSetTextureLUT,
+ * gDPSetTextureFilter, gDPSetTextureConvert, gDPSetCombineKey,
+ * gDPSetColorDither, gDPSetAlphaDither
+ *
+ * GroupB:
+ * gDPSetAlphaCompare, gDPSetDepthSource, gDPSetRenderMode
+ *
+ * Use 'OR' operation to get modeA and modeB.
+ *
+ * modeA = G_PM_* | G_CYC_* | G_TP_* | G_TD_* | G_TL_* | G_TT_* | G_TF_*
+ * G_TC_* | G_CK_* | G_CD_* | G_AD_*;
+ *
+ * modeB = G_AC_* | G_ZS_* | G_RM_* | G_RM_*2;
+ */
+#define gDPSetOtherMode(pkt, mode0, mode1) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24);\
+ _g->words.w1 = (unsigned int)(mode1); \
+}
+
+#define gsDPSetOtherMode(mode0, mode1) \
+{ \
+ _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24), \
+ (unsigned int)(mode1) \
+}
+
+/*
+ * Texturing macros
+ */
+
+/* These are also defined defined above for Sprite Microcode */
+
+#define G_TX_LOADTILE 7
+#define G_TX_RENDERTILE 0
+
+#define G_TX_NOMIRROR 0
+#define G_TX_WRAP 0
+#define G_TX_MIRROR 0x1
+#define G_TX_CLAMP 0x2
+#define G_TX_NOMASK 0
+#define G_TX_NOLOD 0
+
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+/*
+ * Dxt is the inverse of the number of 64-bit words in a line of
+ * the texture being loaded using the load_block command. If
+ * there are any 1's to the right of the 11th fractional bit,
+ * dxt should be rounded up. The following macros accomplish
+ * this. The 4b macros are a special case since 4-bit textures
+ * are loaded as 8-bit textures. Dxt is fixed point 1.11. RJM
+ */
+#define G_TX_DXT_FRAC 11
+
+/*
+ * For RCP 2.0, the maximum number of texels that can be loaded
+ * using a load_block command is 2048. In order to load the total
+ * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b,
+ * then change the tile to the proper texel size after the load.
+ * The g*DPLoadTextureBlock macros already do this, so this change
+ * will be transparent if you use these macros. If you use
+ * the g*DPLoadBlock macros directly, you will need to handle this
+ * tile manipulation yourself. RJM.
+ */
+#ifdef _HW_VERSION_1
+#define G_TX_LDBLK_MAX_TXL 4095
+#else
+#define G_TX_LDBLK_MAX_TXL 2047
+#endif /* _HW_VERSION_1 */
+
+#define TXL2WORDS(txls, b_txl) MAX(1, ((txls)*(b_txl)/8))
+#define CALC_DXT(width, b_txl) \
+ (((1 << G_TX_DXT_FRAC) + TXL2WORDS(width, b_txl) - 1) / \
+ TXL2WORDS(width, b_txl))
+
+#define TXL2WORDS_4b(txls) MAX(1, ((txls)/16))
+#define CALC_DXT_4b(width) \
+ (((1 << G_TX_DXT_FRAC) + TXL2WORDS_4b(width) - 1) / \
+ TXL2WORDS_4b(width))
+
+#define gDPLoadTileGeneric(pkt, c, tile, uls, ult, lrs, lrt) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | \
+ _SHIFTL(ult, 0, 12); \
+ _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | \
+ _SHIFTL(lrt, 0, 12); \
+}
+
+#define gsDPLoadTileGeneric(c, tile, uls, ult, lrs, lrt) \
+{ \
+ _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \
+ _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12)\
+}
+
+#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt) \
+ gDPLoadTileGeneric(pkt, G_SETTILESIZE, t, uls, ult, lrs, lrt)
+#define gsDPSetTileSize(t, uls, ult, lrs, lrt) \
+ gsDPLoadTileGeneric(G_SETTILESIZE, t, uls, ult, lrs, lrt)
+#define gDPLoadTile(pkt, t, uls, ult, lrs, lrt) \
+ gDPLoadTileGeneric(pkt, G_LOADTILE, t, uls, ult, lrs, lrt)
+#define gsDPLoadTile(t, uls, ult, lrs, lrt) \
+ gsDPLoadTileGeneric(G_LOADTILE, t, uls, ult, lrs, lrt)
+
+#define gDPSetTile(pkt, fmt, siz, line, tmem, tile, palette, cmt, \
+ maskt, shiftt, cms, masks, shifts) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) |\
+ _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | \
+ _SHIFTL(tmem, 0, 9); \
+ _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \
+ _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \
+ _SHIFTL(shiftt, 10, 4) |_SHIFTL(cms, 8, 2) | \
+ _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4); \
+}
+
+#define gsDPSetTile(fmt, siz, line, tmem, tile, palette, cmt, \
+ maskt, shiftt, cms, masks, shifts) \
+{ \
+ (_SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) | \
+ _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | _SHIFTL(tmem, 0, 9)),\
+ (_SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \
+ _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \
+ _SHIFTL(shiftt, 10, 4) | _SHIFTL(cms, 8, 2) | \
+ _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4)) \
+}
+
+/*
+ * For RCP 2.0, the maximum number of texels that can be loaded
+ * using a load_block command is 2048. In order to load the total
+ * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b,
+ * then change the tile to the proper texel size after the load.
+ * The g*DPLoadTextureBlock macros already do this, so this change
+ * will be transparent if you use these macros. If you use
+ * the g*DPLoadBlock macros directly, you will need to handle this
+ * tile manipulation yourself. RJM.
+ */
+#define gDPLoadBlock(pkt, tile, uls, ult, lrs, dxt) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_LOADBLOCK, 24, 8) | \
+ _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(tile, 24, 3) | \
+ _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) |\
+ _SHIFTL(dxt, 0, 12)); \
+}
+
+#define gsDPLoadBlock(tile, uls, ult, lrs, dxt) \
+{ \
+ (_SHIFTL(G_LOADBLOCK, 24, 8) | _SHIFTL(uls, 12, 12) | \
+ _SHIFTL(ult, 0, 12)), \
+ (_SHIFTL(tile, 24, 3) | \
+ _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) | \
+ _SHIFTL(dxt, 0, 12)) \
+}
+
+#define gDPLoadTLUTCmd(pkt, tile, count) \
+{ \
+ Gfx *_g = (Gfx *)pkt; \
+ \
+ _g->words.w0 = _SHIFTL(G_LOADTLUT, 24, 8); \
+ _g->words.w1 = _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10);\
+}
+
+#define gsDPLoadTLUTCmd(tile, count) \
+{ \
+ _SHIFTL(G_LOADTLUT, 24, 8), \
+ _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10) \
+}
+
+#define gDPLoadTextureBlock(pkt, timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \
+ CALC_DXT(width, siz##_BYTES)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((width) * siz##_LINE_BYTES)+7)>>3, 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+#define gDPLoadTextureBlockYuv(pkt, timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \
+ CALC_DXT(width, siz##_BYTES)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((width) * 1)+7)>>3, 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/* Load fix rww 27jun95 */
+/* The S at the end means odd lines are already word Swapped */
+
+#define gDPLoadTextureBlockS(pkt, timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((width) * siz##_LINE_BYTES)+7)>>3, 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * Allow tmem address and render tile to be specified.
+ * The S at the end means odd lines are already word Swapped
+ */
+#define gDPLoadMultiBlockS(pkt, timg, tmem, rtile, fmt, siz, width, \
+ height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((width) * siz##_LINE_BYTES)+7)>>3, tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+
+#define gDPLoadTextureBlockYuvS(pkt, timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((width) * 1)+7)>>3, 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * allows tmem address to be specified
+ */
+#define _gDPLoadTextureBlock(pkt, timg, tmem, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \
+ 0, cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \
+ tmem, G_TX_RENDERTILE, pal, cmt, \
+ maskt, shiftt, cms, masks, shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * allows tmem address and render tile to be specified
+ */
+#define _gDPLoadTextureBlockTile(pkt, timg, tmem, rtile, fmt, siz, width, \
+ height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \
+ tmem, rtile, pal, cmt, \
+ maskt, shiftt, cms, masks, shifts); \
+ gDPSetTileSize(pkt, rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * allows tmem address and render tile to be specified
+ */
+#define gDPLoadMultiBlock(pkt, timg, tmem, rtile, fmt, siz, width, \
+ height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
+ gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \
+ tmem, rtile, pal, cmt, \
+ maskt, shiftt, cms, masks, shifts); \
+ gDPSetTileSize(pkt, rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+#define gsDPLoadTextureBlock(timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \
+ masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+/* Here is the static form of the pre-swapped texture block loading */
+/* See gDPLoadTextureBlockS() for reference. Basically, just don't
+ calculate DxT, use 0 */
+
+#define gsDPLoadTextureBlockS(timg, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0 , \
+ cmt, maskt,shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+/*
+ * Allow tmem address to be specified
+ */
+#define _gsDPLoadTextureBlock(timg, tmem, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, \
+ ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+
+/*
+ * Allow tmem address and render_tile to be specified
+ */
+#define _gsDPLoadTextureBlockTile(timg, tmem, rtile, fmt, siz, width, \
+ height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, \
+ ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+
+/*
+ * Allow tmem address and render_tile to be specified, useful when loading
+ * mutilple tiles at a time.
+ */
+#define gsDPLoadMultiBlock(timg, tmem, rtile, fmt, siz, width, \
+ height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \
+ 0 , cmt, maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \
+ CALC_DXT(width, siz##_BYTES)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, \
+ ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+/*
+ * Allows tmem and render tile to be specified. Useful when loading
+ * several tiles at a time.
+ *
+ * Here is the static form of the pre-swapped texture block loading
+ * See gDPLoadTextureBlockS() for reference. Basically, just don't
+ * calculate DxT, use 0
+ */
+
+#define gsDPLoadMultiBlockS(timg, tmem, rtile, fmt, siz, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
+ gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0 , \
+ cmt, maskt,shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
+ (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), tmem,\
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+
+#define gDPLoadTextureBlock_4b(pkt, timg, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/* Load fix rww 27jun95 */
+/* The S at the end means odd lines are already word Swapped */
+
+#define gDPLoadTextureBlock_4bS(pkt, timg, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height)+3)>>2)-1, 0 ); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * 4-bit load block. Useful when loading multiple tiles
+ */
+#define gDPLoadMultiBlock_4b(pkt, timg, tmem, rtile, fmt, width, height,\
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+/*
+ * 4-bit load block. Allows tmem and render tile to be specified. Useful when
+ * loading multiple tiles. The S means odd lines are already word swapped.
+ */
+#define gDPLoadMultiBlock_4bS(pkt, timg, tmem, rtile, fmt, width, height,\
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height)+3)>>2)-1, 0 ); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+
+#define _gDPLoadTextureBlock_4b(pkt, timg, tmem, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \
+ cmt, maskt, shiftt, cms, masks, shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
+ (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC) \
+}
+
+#define gsDPLoadTextureBlock_4b(timg, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \
+ maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+#define gsDPLoadTextureBlock_4bS(timg, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \
+ maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+/*
+ * 4-bit load block. Allows tmem address and render tile to be specified.
+ * Useful when loading multiple tiles.
+ */
+#define gsDPLoadMultiBlock_4b(timg, tmem, rtile, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \
+ maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+
+/*
+ * 4-bit load block. Allows tmem address and render tile to be specified.
+ * Useful when loading multiple tiles. S means odd lines are already swapped.
+ */
+#define gsDPLoadMultiBlock_4bS(timg, tmem, rtile, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \
+ maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+
+/*
+ * Allows tmem address to be specified
+ */
+#define _gsDPLoadTextureBlock_4b(timg, tmem, fmt, width, height, \
+ pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ \
+ gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \
+ maskt, shiftt, cms, masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \
+ CALC_DXT_4b(width)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \
+ ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
+ ((height)-1) << G_TEXTURE_IMAGE_FRAC)
+
+#ifndef _HW_VERSION_1
+
+#define gDPLoadTextureTile(pkt, timg, fmt, siz, width, height, \
+ uls, ult, lrs, lrt, pal, \
+ cms, cmt, masks, maskt, shifts, shiftt) \
+{ \
+ gDPSetTextureImage(pkt, fmt, siz, width, timg); \
+ gDPSetTile(pkt, fmt, siz, \
+ (((((lrs)-(uls)+1) * siz##_TILE_BYTES)+7)>>3), 0, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadTile( pkt, G_TX_LOADTILE, \
+ (uls)<>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, \
+ (uls)<>3), tmem, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadTile( pkt, G_TX_LOADTILE, \
+ (uls)<>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, rtile, \
+ (uls)<>3), 0, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadTile( G_TX_LOADTILE, \
+ (uls)<>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks,\
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, \
+ (uls)<>3), \
+ tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \
+ masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadTile( G_TX_LOADTILE, \
+ (uls)<>3), \
+ tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, \
+ (uls)<>1), timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \
+ (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadTile( pkt, G_TX_LOADTILE, \
+ (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (ult)<<(G_TEXTURE_IMAGE_FRAC), \
+ (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \
+ (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, \
+ masks, shifts); \
+ gDPSetTileSize(pkt, G_TX_RENDERTILE, \
+ (uls)<>1), timg); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \
+ (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPLoadSync(pkt); \
+ gDPLoadTile( pkt, G_TX_LOADTILE, \
+ (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (ult)<<(G_TEXTURE_IMAGE_FRAC), \
+ (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \
+ gDPPipeSync(pkt); \
+ gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \
+ (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \
+ rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts); \
+ gDPSetTileSize(pkt, rtile, \
+ (uls)<>1), timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \
+ G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadTile( G_TX_LOADTILE, \
+ (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (ult)<<(G_TEXTURE_IMAGE_FRAC), \
+ (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \
+ G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(G_TX_RENDERTILE, \
+ (uls)<>1), timg), \
+ gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), \
+ tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \
+ masks, shifts), \
+ gsDPLoadSync(), \
+ gsDPLoadTile( G_TX_LOADTILE, \
+ (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (ult)<<(G_TEXTURE_IMAGE_FRAC), \
+ (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \
+ (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \
+ gsDPPipeSync(), \
+ gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), \
+ tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \
+ shifts), \
+ gsDPSetTileSize(rtile, \
+ (uls)<words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \
+ _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \
+ _SHIFTL((int)((float)(uly)*4.0F), 0, 12); \
+ _g->words.w1 = _SHIFTL(mode, 24, 2) | \
+ _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \
+ _SHIFTL((int)((float)(lry)*4.0F), 0, 12); \
+}
+
+
+#define gDPSetScissorFrac(pkt, mode, ulx, uly, lrx, lry) \
+{ \
+ Gfx *_g = (Gfx *)pkt; \
+ \
+ _g->words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \
+ _SHIFTL((int)((ulx)), 12, 12) | \
+ _SHIFTL((int)((uly)), 0, 12); \
+ _g->words.w1 = _SHIFTL(mode, 24, 2) | \
+ _SHIFTL((int)((lrx)), 12, 12) | \
+ _SHIFTL((int)((lry)), 0, 12); \
+}
+
+#define gsDPSetScissor(mode, ulx, uly, lrx, lry) \
+{ \
+ _SHIFTL(G_SETSCISSOR, 24, 8) | \
+ _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \
+ _SHIFTL((int)((float)(uly)*4.0F), 0, 12), \
+ _SHIFTL(mode, 24, 2) | \
+ _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \
+ _SHIFTL((int)((float)(lry)*4.0F), 0, 12) \
+}
+
+#define gsDPSetScissorFrac(mode, ulx, uly, lrx, lry) \
+{ \
+ _SHIFTL(G_SETSCISSOR, 24, 8) | \
+ _SHIFTL((int)((ulx)), 12, 12) | \
+ _SHIFTL((int)((uly)), 0, 12), \
+ _SHIFTL(mode, 24, 2) | \
+ _SHIFTL((int)(lrx), 12, 12) | \
+ _SHIFTL((int)(lry), 0, 12) \
+}
+
+/* Fraction never used in fill */
+#define gDPFillRectangle(pkt, ulx, uly, lrx, lry) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \
+ _SHIFTL((lrx), 14, 10) | _SHIFTL((lry), 2, 10));\
+ _g->words.w1 = (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10));\
+}
+
+#define gsDPFillRectangle(ulx, uly, lrx, lry) \
+{ \
+ (_SHIFTL(G_FILLRECT, 24, 8) | _SHIFTL((lrx), 14, 10) | \
+ _SHIFTL((lry), 2, 10)), \
+ (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10)) \
+}
+
+/* like gDPFillRectangle but accepts negative arguments */
+#define gDPScisFillRectangle(pkt, ulx, uly, lrx, lry) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \
+ _SHIFTL(MAX((lrx),0), 14, 10) | \
+ _SHIFTL(MAX((lry),0), 2, 10)); \
+ _g->words.w1 = (_SHIFTL(MAX((ulx),0), 14, 10) | \
+ _SHIFTL(MAX((uly),0), 2, 10)); \
+}
+
+#define gDPSetConvert(pkt, k0, k1, k2, k3, k4, k5) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SETCONVERT, 24, 8) | \
+ _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | \
+ _SHIFTR(k2, 5, 4)); \
+ _g->words.w1 = (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | \
+ _SHIFTL(k4, 9, 9) | _SHIFTL(k5, 0, 9)); \
+}
+
+#define gsDPSetConvert(k0, k1, k2, k3, k4, k5) \
+{ \
+ (_SHIFTL(G_SETCONVERT, 24, 8) | \
+ _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | _SHIFTL(k2, 5, 4)), \
+ (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | _SHIFTL(k4, 9, 9) | \
+ _SHIFTL(k5, 0, 9)) \
+}
+
+#define gDPSetKeyR(pkt, cR, sR, wR) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_SETKEYR, 24, 8); \
+ _g->words.w1 = (_SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | \
+ _SHIFTL(sR, 0, 8)); \
+}
+
+#define gsDPSetKeyR(cR, sR, wR) \
+{ \
+ _SHIFTL(G_SETKEYR, 24, 8), \
+ _SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | _SHIFTL(sR, 0, 8) \
+}
+
+#define gDPSetKeyGB(pkt, cG, sG, wG, cB, sB, wB) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SETKEYGB, 24, 8) | \
+ _SHIFTL(wG, 12, 12) | _SHIFTL(wB, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | \
+ _SHIFTL(cB, 8, 8) | _SHIFTL(sB, 0, 8)); \
+}
+
+#define gsDPSetKeyGB(cG, sG, wG, cB, sB, wB) \
+{ \
+ (_SHIFTL(G_SETKEYGB, 24, 8) | _SHIFTL(wG, 12, 12) | \
+ _SHIFTL(wB, 0, 12)), \
+ (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | _SHIFTL(cB, 8, 8) | \
+ _SHIFTL(sB, 0, 8)) \
+}
+
+#define gDPNoParam(pkt, cmd) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(cmd, 24, 8); \
+ _g->words.w1 = 0; \
+}
+
+#define gsDPNoParam(cmd) \
+{ \
+ _SHIFTL(cmd, 24, 8), 0 \
+}
+
+#define gDPParam(pkt, cmd, param) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(cmd, 24, 8); \
+ _g->words.w1 = (param); \
+}
+
+#define gsDPParam(cmd, param) \
+{ \
+ _SHIFTL(cmd, 24, 8), (param) \
+}
+
+/* Notice that textured rectangles are 128-bit commands, therefore
+ * gsDPTextureRectangle() should not be used in display lists
+ * under normal circumstances (use gsSPTextureRectangle()).
+ * That is also why there is no gDPTextureRectangle() macros.
+ */
+#define gsDPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+{ \
+ (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)), \
+ (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \
+}, \
+{ \
+ _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \
+ _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \
+}
+
+#define gDPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ if (pkt); \
+ _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
+ _SHIFTL(yl, 0, 12)); \
+ _g ++; \
+ _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \
+ _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \
+}
+
+#define gsDPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+{ \
+ (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)), \
+ (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \
+}, \
+{ \
+ _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \
+ _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \
+}
+
+#define gDPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ if (pkt); \
+ _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
+ _SHIFTL(yl, 0, 12)); \
+ _g ++; \
+ _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \
+ _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \
+}
+
+#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+ (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\
+ (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \
+ gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
+ gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
+
+#define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
+ _SHIFTL(yl, 0, 12)); \
+ gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \
+ gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\
+}
+
+/* like gSPTextureRectangle but accepts negative position arguments */
+#define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \
+ _SHIFTL(MAX((s16)(xh),0), 12, 12) | \
+ _SHIFTL(MAX((s16)(yh),0), 0, 12)); \
+ _g->words.w1 = (_SHIFTL((tile), 24, 3) | \
+ _SHIFTL(MAX((s16)(xl),0), 12, 12) | \
+ _SHIFTL(MAX((s16)(yl),0), 0, 12)); \
+ gImmp1(pkt, G_RDPHALF_1, \
+ (_SHIFTL(((s) - \
+ (((s16)(xl) < 0) ? \
+ (((s16)(dsdx) < 0) ? \
+ (MAX((((s16)(xl)*(s16)(dsdx))>>7),0)) : \
+ (MIN((((s16)(xl)*(s16)(dsdx))>>7),0))) : 0)), \
+ 16, 16) | \
+ _SHIFTL(((t) - \
+ (((yl) < 0) ? \
+ (((s16)(dtdy) < 0) ? \
+ (MAX((((s16)(yl)*(s16)(dtdy))>>7),0)) : \
+ (MIN((((s16)(yl)*(s16)(dtdy))>>7),0))) : 0)), \
+ 0, 16))); \
+ gImmp1(pkt, G_RDPHALF_2, (_SHIFTL((dsdx), 16, 16) | \
+ _SHIFTL((dtdy), 0, 16))); \
+}
+
+#define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+ (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \
+ _SHIFTL(yh, 0, 12)), \
+ (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \
+ gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
+ gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
+
+#define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) |\
+ _SHIFTL(yh, 0, 12)); \
+ _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
+ _SHIFTL(yl, 0, 12)); \
+ gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \
+ gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \
+}
+
+#define gsDPWord(wordhi, wordlo) \
+ gsImmp1(G_RDPHALF_1, (unsigned int)(wordhi)), \
+ gsImmp1(G_RDPHALF_2, (unsigned int)(wordlo))
+
+#define gDPWord(pkt, wordhi, wordlo) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ gImmp1(pkt, G_RDPHALF_1, (unsigned int)(wordhi)); \
+ gImmp1(pkt, G_RDPHALF_2, (unsigned int)(wordlo)); \
+}
+
+#define gDPFullSync(pkt) gDPNoParam(pkt, G_RDPFULLSYNC)
+#define gsDPFullSync() gsDPNoParam(G_RDPFULLSYNC)
+#define gDPTileSync(pkt) gDPNoParam(pkt, G_RDPTILESYNC)
+#define gsDPTileSync() gsDPNoParam(G_RDPTILESYNC)
+#define gDPPipeSync(pkt) gDPNoParam(pkt, G_RDPPIPESYNC)
+#define gsDPPipeSync() gsDPNoParam(G_RDPPIPESYNC)
+#define gDPLoadSync(pkt) gDPNoParam(pkt, G_RDPLOADSYNC)
+#define gsDPLoadSync() gsDPNoParam(G_RDPLOADSYNC)
+#define gDPNoOp(pkt) gDPNoParam(pkt, G_NOOP)
+#define gsDPNoOp() gsDPNoParam(G_NOOP)
+#define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag)
+#define gsDPNoOpTag(tag) gsDPParam(G_NOOP, tag)
+
+#endif /* _LANGUAGE_C */
+
+
+#endif /* _GBI_H_ */
diff --git a/include/2.0L/PR/gs2dex.h b/include/2.0L/PR/gs2dex.h
new file mode 100755
index 00000000..7e2b2c6a
--- /dev/null
+++ b/include/2.0L/PR/gs2dex.h
@@ -0,0 +1,364 @@
+/*---------------------------------------------------------------------
+ Copyright (C) 1997, Nintendo.
+
+ File gs2dex.h
+ Coded by Yoshitaka Yasumoto. Jul 31, 1997.
+ Modified by
+ Comments Header file for S2DEX ucode.
+
+ $Id: gs2dex.h,v 1.15 1997/10/17 08:19:07 yasu Exp $
+ ---------------------------------------------------------------------*/
+
+#ifndef _GS2DEX_H_
+#define _GS2DEX_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+/*===========================================================================*
+ * Macro
+ *===========================================================================*/
+#define GS_CALC_DXT(line) (((1<< G_TX_DXT_FRAC)-1)/(line)+1)
+#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz)))
+#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz)))
+
+/*===========================================================================*
+ * Data structures for S2DEX microcode
+ *===========================================================================*/
+
+/*---------------------------------------------------------------------------*
+ * Background
+ *---------------------------------------------------------------------------*/
+#define G_BGLT_LOADBLOCK 0x0033
+#define G_BGLT_LOADTILE 0xfff4
+
+#define G_BG_FLAG_FLIPS 0x01
+#define G_BG_FLAG_FLIPT 0x10
+
+/* Non scalable background plane */
+typedef struct {
+ u16 imageX; /* The x-coordinate of the upper-left position of the texture. (u11.5)*/
+ u16 imageW; /* The width of the texture. (u10.2)*/
+ s16 frameX; /* The upper-left position of the transferred frame. (s10.2)*/
+ u16 frameW; /* The width of the transferred frame. (u10.2)*/
+
+ u16 imageY; /* The y-coordinate of the upper-left position of the texture. (u11.5)*/
+ u16 imageH; /* The height of the texture. (u10.2)*/
+ s16 frameY; /* The upper-left position of the transferred frame. (s10.2)*/
+ u16 frameH; /* The height of the transferred frame. (u10.2)*/
+
+ u64 *imagePtr; /* The texture source address on DRAM. */
+ u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */
+ u8 imageFmt; /* The format of the texel. G_IM_FMT_* */
+ u8 imageSiz; /* The size of the texel G_IM_SIZ_* */
+ u16 imagePal; /* The pallet number. */
+ u16 imageFlip; /* The right & left inversion of the image. Inverted by G_BG_FLAG_FLIPS*/
+
+ /* Because the following are set in the initialization routine guS2DInitBg(), the user doesn't
+ have to set it.*/
+ u16 tmemW; /* The TMEM width and Work size of the frame 1 line.
+ At LoadBlock, GS_PIX2TMEM(imageW/4,imageSiz)
+ At LoadTile GS_PIX2TMEM(frameW/4,imageSiz)+1 */
+ u16 tmemH; /* The height of TMEM loadable at a time. (s13.2) The 4 times value.
+ When the normal texture, 512/tmemW*4
+ When the CI texture, 256/tmemW*4 */
+ u16 tmemLoadSH; /* The SH value
+ At LoadBlock, tmemSize/2-1
+ At LoadTile, tmemW*16-1 */
+ u16 tmemLoadTH; /* The TH value or the Stride value
+ At LoadBlock, GS_CALC_DXT(tmemW)
+ At LoadTile, tmemH-1 */
+ u16 tmemSizeW; /* The skip value of imagePtr for image 1-line.
+ At LoadBlock, tmemW*2
+ At LoadTile, GS_PIX2TMEM(imageW/4,imageSiz)*2 */
+ u16 tmemSize; /* The skip value of imagePtr for 1-loading.
+ = tmemSizeW*tmemH */
+} uObjBg_t; /* 40 bytes */
+
+/* Scalable background plane */
+typedef struct {
+ u16 imageX; /* The x-coordinate of the upper-left position of the texture. (u11.5)*/
+ u16 imageW; /* The width of the texture. (u10.2)*/
+ s16 frameX; /* The upper-left position of the transferred frame. (s10.2)*/
+ u16 frameW; /* The width of the transferred frame. (u10.2)*/
+
+ u16 imageY; /* The y-coordinate of the upper-left position of the texture. (u11.5)*/
+ u16 imageH; /* The height of the texture. (u10.2)*/
+ s16 frameY; /* The upper-left position of the transferred frame. (s10.2)*/
+ u16 frameH; /* The height of the transferred frame. (u10.2)*/
+
+ u64 *imagePtr; /* The texture source address on DRAM. */
+ u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */
+ u8 imageFmt; /* The format of the texel. G_IM_FMT_* */
+ u8 imageSiz; /* The size of the texel G_IM_SIZ_* */
+ u16 imagePal; /* The pallet number. */
+ u16 imageFlip; /* The right & left inversion of the image. Inverted by G_BG_FLAG_FLIPS*/
+
+ u16 scaleW; /* The scale value of the X-direction. (u5.10)*/
+ u16 scaleH; /* The scale value of the Y-direction. (u5.10)*/
+ s32 imageYorig; /* The start point of drawing on the image. (s20.5)*/
+
+ u8 padding[4];
+
+} uObjScaleBg_t; /* 40 bytes */
+
+typedef union {
+ uObjBg_t b;
+ uObjScaleBg_t s;
+ long long int force_structure_alignment;
+} uObjBg;
+
+/*---------------------------------------------------------------------------*
+ * 2D Objects
+ *---------------------------------------------------------------------------*/
+#define G_OBJ_FLAG_FLIPS 1<<0 /* The inversion to the S-direction. */
+#define G_OBJ_FLAG_FLIPT 1<<4 /* The inversion to the T-direction. */
+
+typedef struct {
+ s16 objX; /* The x-coordinate of the upper-left end. s10.2 OBJ */
+ u16 scaleW; /* Scaling of the u5.10 width direction. */
+ u16 imageW; /* The width of the u10.5 texture. (The length of the S-direction.) */
+ u16 paddingX; /* Unused. Always 0. */
+ s16 objY; /* The y-coordinate of the s10.2 OBJ upper-left end. */
+ u16 scaleH; /* Scaling of the u5.10 height direction. */
+ u16 imageH; /* The height of the u10.5 texture. (The length of the T-direction.)*/
+ u16 paddingY; /* Unused. Always 0. */
+ u16 imageStride; /* The folding width of the texel. (In units of 64bit word.) */
+ u16 imageAdrs; /* The texture header position in TMEM. (In units of 64bit word.) */
+ u8 imageFmt; /* The format of the texel. G_IM_FMT_* */
+ u8 imageSiz; /* The size of the texel. G_IM_SIZ_* */
+ u8 imagePal; /*The pallet number. 0-7 */
+ u8 imageFlags; /* The display flag. G_OBJ_FLAG_FLIP* */
+} uObjSprite_t; /* 24 bytes */
+
+typedef union {
+ uObjSprite_t s;
+ long long int force_structure_alignment;
+} uObjSprite;
+
+/*---------------------------------------------------------------------------*
+ * 2D Matrix
+ *---------------------------------------------------------------------------*/
+typedef struct {
+ s32 A, B, C, D; /* s15.16 */
+ s16 X, Y; /* s10.2 */
+ u16 BaseScaleX; /* u5.10 */
+ u16 BaseScaleY; /* u5.10 */
+} uObjMtx_t; /* 24 bytes */
+
+typedef union {
+ uObjMtx_t m;
+ long long int force_structure_alignment;
+} uObjMtx;
+
+typedef struct {
+ s16 X, Y; /* s10.2 */
+ u16 BaseScaleX; /* u5.10 */
+ u16 BaseScaleY; /* u5.10 */
+} uObjSubMtx_t; /* 8 bytes */
+
+typedef union {
+ uObjSubMtx_t m;
+ long long int force_structure_alignment;
+} uObjSubMtx;
+
+/*---------------------------------------------------------------------------*
+ * Loading into TMEM
+ *---------------------------------------------------------------------------*/
+#define G_OBJLT_TXTRBLOCK 0x00001033
+#define G_OBJLT_TXTRTILE 0x00fc1034
+#define G_OBJLT_TLUT 0x00000030
+
+#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1)
+#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz))))
+
+typedef struct {
+ u32 type; /* G_OBJLT_TXTRBLOCK divided into types. */
+ u64 *image; /* The texture source address on DRAM. */
+ u16 tmem; /* The transferred TMEM word address. (8byteWORD) */
+ u16 tsize; /* The Texture size. Specified by the macro GS_TB_TSIZE(). */
+ u16 tline; /* The width of the Texture 1-line. Specified by the macro GS_TB_TLINE()*/
+ u16 sid; /* STATE ID Multipled by 4. Either one of 0,4,8 and 12. */
+ u32 flag; /* STATE flag */
+ u32 mask; /* STATE mask */
+} uObjTxtrBlock_t; /* 24 bytes */
+
+#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1)
+#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1)
+
+typedef struct {
+ u32 type; /* G_OBJLT_TXTRTILE divided into types. */
+ u64 *image; /* The texture source address on DRAM. */
+ u16 tmem; /* The loaded texture source address on DRAM. (8byteWORD) */
+ u16 twidth; /* The width of the Texture. Specified by the macro GS_TT_TWIDTH() */
+ u16 theight; /* The height of the Texture. Specified by the macro GS_TT_THEIGHT()*/
+ u16 sid; /* STATE ID Multiplied by 4. Either one of 0,4,8 and 12. */
+ u32 flag; /* STATE flag */
+ u32 mask; /* STATE mask */
+} uObjTxtrTile_t; /* 24 bytes */
+
+#define GS_PAL_HEAD(head) ((head)+256)
+#define GS_PAL_NUM(num) ((num)-1)
+
+typedef struct {
+ u32 type; /* G_OBJLT_TLUT divided into types. */
+ u64 *image; /* the texture source address on DRAM. */
+ u16 phead; /* The pallet number of the load header. Between 256 and 511. */
+ u16 pnum; /* The loading pallet number -1. */
+ u16 zero; /* Assign 0 all the time. */
+ u16 sid; /* STATE ID Multiplied by 4. Either one of 0,4,8 and 12. */
+ u32 flag; /* STATE flag */
+ u32 mask; /* STATE mask */
+} uObjTxtrTLUT_t; /* 24 bytes */
+
+typedef union {
+ uObjTxtrBlock_t block;
+ uObjTxtrTile_t tile;
+ uObjTxtrTLUT_t tlut;
+ long long int force_structure_alignment;
+} uObjTxtr;
+
+/*---------------------------------------------------------------------------*
+ * Loading into TMEM & 2D Objects
+ *---------------------------------------------------------------------------*/
+typedef struct {
+ uObjTxtr txtr;
+ uObjSprite sprite;
+} uObjTxSprite; /* 48 bytes */
+
+/*===========================================================================*
+ * GBI Commands for S2DEX microcode
+ *===========================================================================*/
+/* GBI Header */
+#define G_BG_1CYC 0x01
+#define G_BG_COPY 0x02
+#define G_OBJ_RECTANGLE 0x03
+#define G_OBJ_SPRITE 0x04
+#define G_OBJ_MOVEMEM 0x05
+#define G_SELECT_DL 0xb0
+#define G_OBJ_RENDERMODE 0xb1
+#define G_OBJ_RECTANGLE_R 0xb2
+#define G_OBJ_LOADTXTR 0xc1
+#define G_OBJ_LDTX_SPRITE 0xc2
+#define G_OBJ_LDTX_RECT 0xc3
+#define G_OBJ_LDTX_RECT_R 0xc4
+#define G_RDPHALF_0 0xe4
+
+
+/*---------------------------------------------------------------------------*
+ * Background wrapped screen
+ *---------------------------------------------------------------------------*/
+#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt),(m),(mptr),0)
+#define gsSPBgRectangle(m, mptr) gsDma0p( (m),(mptr),0)
+#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr))
+#define gsSPBgRectCopy(mptr) gsSPBgRectangle( G_BG_COPY, (mptr))
+#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr))
+#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle( G_BG_1CYC, (mptr))
+
+/*---------------------------------------------------------------------------*
+ * 2D Objects
+ *---------------------------------------------------------------------------*/
+#define gSPObjSprite(pkt, mptr) gDma0p((pkt),G_OBJ_SPRITE, (mptr),0)
+#define gsSPObjSprite(mptr) gsDma0p( G_OBJ_SPRITE, (mptr),0)
+#define gSPObjRectangle(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE, (mptr),0)
+#define gsSPObjRectangle(mptr) gsDma0p( G_OBJ_RECTANGLE, (mptr),0)
+#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE_R,(mptr),0)
+#define gsSPObjRectangleR(mptr) gsDma0p( G_OBJ_RECTANGLE_R,(mptr),0)
+
+/*---------------------------------------------------------------------------*
+ * 2D Matrix
+ *---------------------------------------------------------------------------*/
+#define gSPObjMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),0,23)
+#define gsSPObjMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),0,23)
+#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),2, 7)
+#define gsSPObjSubMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),2, 7)
+
+/*---------------------------------------------------------------------------*
+ * Loading into TMEM
+ *---------------------------------------------------------------------------*/
+#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt),G_OBJ_LOADTXTR, (tptr),23)
+#define gsSPObjLoadTxtr(tptr) gsDma0p( G_OBJ_LOADTXTR, (tptr),23)
+#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_SPRITE,(tptr),47)
+#define gsSPObjLoadTxSprite(tptr) gsDma0p( G_OBJ_LDTX_SPRITE,(tptr),47)
+#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT, (tptr),47)
+#define gsSPObjLoadTxRect(tptr) gsDma0p( G_OBJ_LDTX_RECT, (tptr),47)
+#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT_R,(tptr),47)
+#define gsSPObjLoadTxRectR(tptr) gsDma0p( G_OBJ_LDTX_RECT_R,(tptr),47)
+
+/*---------------------------------------------------------------------------*
+ * Select Display List
+ *---------------------------------------------------------------------------*/
+#define gSPSelectDL(pkt, mptr, sid, flag, mask) \
+{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
+ gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); }
+#define gsSPSelectDL(mptr, sid, flag, mask) \
+{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
+ gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); }
+#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \
+{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
+ gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); }
+#define gsSPSelectBranchDL(mptr, sid, flag, mask) \
+{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
+ gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); }
+
+/*---------------------------------------------------------------------------*
+ * Set general status
+ *---------------------------------------------------------------------------*/
+#define G_MW_GENSTAT 0x08 /* Note that it is the same value of G_MW_FOG. */
+
+#define gSPSetStatus(pkt, sid, val) \
+ gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))
+#define gsSPSetStatus(sid, val) \
+ gsMoveWd( G_MW_GENSTAT, (sid), (val))
+
+/*---------------------------------------------------------------------------*
+ * Set Object Render Mode
+ *---------------------------------------------------------------------------*/
+#define G_OBJRM_NOTXCLAMP 0x01
+#define G_OBJRM_XLU 0x02 /* Ignored */
+#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */
+#define G_OBJRM_BILERP 0x08
+#define G_OBJRM_SHRINKSIZE_1 0x10
+#define G_OBJRM_SHRINKSIZE_2 0x20
+#define G_OBJRM_WIDEN 0x40
+
+#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode))
+#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode))
+
+/*===========================================================================*
+ * Render Mode Macro
+ *===========================================================================*/
+#define RM_RA_SPRITE(clk) \
+ AA_EN | CVG_DST_CLAMP | \
+ CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
+ GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
+
+#define G_RM_SPRITE G_RM_OPA_SURF
+#define G_RM_SPRITE2 G_RM_OPA_SURF2
+#define G_RM_RA_SPRITE RM_RA_SPRITE(1)
+#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2)
+#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR
+#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2
+#define G_RM_XLU_SPRITE G_RM_XLU_SURF
+#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2
+#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF
+#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2
+
+/*===========================================================================*
+ * External functions
+ *===========================================================================*/
+extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[];
+extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[];
+extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[];
+extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[];
+extern void guS2DInitBg(uObjBg *);
+extern void guS2DEmuSetScissor(u32, u32, u32, u32, u8);
+extern void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *);
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+#endif /* _GS2DEX_H_ */
+
+/*======== End of gs2dex.h ========*/
diff --git a/include/2.0L/PR/gt.h b/include/2.0L/PR/gt.h
new file mode 100755
index 00000000..07fa2bcf
--- /dev/null
+++ b/include/2.0L/PR/gt.h
@@ -0,0 +1,363 @@
+
+/*
+ * Copyright 1995, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ *
+ * UNPUBLISHED -- Rights reserved under the copyright laws of the United
+ * States. Use of a copyright notice is precautionary only and does not
+ * imply publication or disclosure.
+ *
+ * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
+ * in similar or successor clauses in the FAR, or the DOD or NASA FAR
+ * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
+ * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
+ *
+ * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
+ * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
+ * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
+ * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
+ * GRAPHICS, INC.
+ *
+ */
+
+/*
+ * File: gt.h
+ * Creator: hsa@sgi.com
+ * Create Date: Thu Oct 12 15:48:14 PDT 1995
+ *
+ * This file defines the GBI for the TURBO 3D graphics microcode.
+ * The turbo microcode is a special FEATURE-LIMITED microcode designed
+ * for specific applications. It is not for general use.
+ *
+ * (see XXX for more information)
+ *
+ */
+
+/**************************************************************************
+ *
+ * $Revision: 1.14 $
+ * $Date: 1997/02/11 08:22:47 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/gt.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _GT_H_
+#define _GT_H_
+
+/* this file should be #included AFTER gbi.h */
+
+#include "sptask.h"
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif /* _LANGUAGE_C_PLUS_PLUS */
+
+/* the following #defines seem out of order, but we need them
+ * for the microcode.
+ */
+
+/*
+ * object state field: rendState
+ *
+ * This flag word is built up out of the bits from a
+ * subset of the G_SETGEOMETRYMODE flags from gbi.h.
+ *
+ * When each of these bits is '1', the comments below explain
+ * the effect on the triangles.
+ */
+#define GT_ZBUFFER G_ZBUFFER
+#define GT_TEXTURE G_TEXTURE_ENABLE /* texture ON */
+#define GT_CULL_BACK G_CULL_BACK /* reject backfaces */
+#define GT_SHADING_SMOOTH G_SHADING_SMOOTH /* smooth shade ON */
+
+/*
+ * object state field: textureState
+ *
+ * The lower 3 bits of this flag word contain the texture tile number
+ * to be used. All triangles of an object are rendered with the same
+ * texture tile.
+ */
+
+/*
+ * object state field: flag
+ *
+ * This is a group of what would be pad bits. We use them for some
+ * flag bits.
+ */
+#define GT_FLAG_NOMTX 0x01 /* don't load the matrix */
+#define GT_FLAG_NO_XFM 0x02 /* load vtx, use verbatim */
+#define GT_FLAG_XFM_ONLY 0x04 /* xform vtx, write to *TriN */
+
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/* turbo 3D ucode: */
+extern long long int gspTurbo3DTextStart[], gspTurbo3DTextEnd[];
+extern long long int gspTurbo3DDataStart[], gspTurbo3DDataEnd[];
+extern long long int gspTurbo3D_dramTextStart[], gspTurbo3D_dramTextEnd[];
+extern long long int gspTurbo3D_dramDataStart[], gspTurbo3D_dramDataEnd[];
+extern long long int gspTurbo3D_fifoTextStart[], gspTurbo3D_fifoTextEnd[];
+extern long long int gspTurbo3D_fifoDataStart[], gspTurbo3D_fifoDataEnd[];
+
+/*
+ * This is the global state structure. It's definition carefully
+ * matches the ucode, so if this structure changes, you must also change
+ * the ucode.
+ */
+typedef struct {
+ u16 perspNorm; /* persp normalization */
+ u16 pad0;
+ u32 flag;
+ Gfx rdpOthermode;
+ u32 segBases[16]; /* table of segment base addrs (SEE NOTE!) */
+ Vp viewport; /* the viewport to use */
+ Gfx *rdpCmds; /* block of RDP data, process if !NULL
+ * block terminated by gDPEndDisplayList()
+ * (This is a segment address)
+ */
+} gtGlobState_t;
+
+/* NOTE:
+ * Although there are 16 segment table entries, the first one (segment 0)
+ * is reserved for physical memory mapping. You should not segment 0
+ * to anything other than 0x0.
+ */
+
+typedef union {
+ gtGlobState_t sp;
+ long long int force_structure_alignment;
+} gtGlobState;
+
+
+/*
+ * This is the 'state' structure associated with each object
+ * to be rendered. It's definition carefully matches the
+ * ucode, so if this structure changes, you must also change
+ * the gtoff.c tool and the ucode.
+ */
+typedef struct {
+ u32 renderState; /* render state */
+ u32 textureState; /* texture state */
+ u8 vtxCount; /* how many verts? */
+ u8 vtxV0; /* where to load verts? */
+ u8 triCount; /* how many tris? */
+ u8 flag;
+ Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
+ Gfx rdpOthermode;
+ Mtx transform; /* the transform matrix to use */
+} gtState_t;
+
+typedef union {
+ gtState_t sp;
+ long long int force_structure_alignment;
+} gtState;
+
+/* gtStateLite : same as gtState, but no matrix (see flags below) */
+/* this structure must be identical to gtState! (bad) */
+typedef struct {
+ u32 renderState; /* render state */
+ u32 textureState; /* texture state */
+ u8 vtxCount; /* how many verts? */
+ u8 vtxV0; /* where to load verts? */
+ u8 triCount; /* how many tris? */
+ u8 flag;
+ Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
+ Gfx rdpOthermode;
+} gtStateL_t;
+
+typedef union {
+ gtStateL_t sp;
+ long long int force_structure_alignment;
+} gtStateL;
+
+/*
+ * The vertex list for the turbo display list uses the
+ * Vtx struct in gbi.h
+ *
+ */
+
+
+/*
+ * This structure represents a single triangle, part of the
+ * triangle list of the object to be rendered.
+ *
+ * NOTE: The triangle list MUST be aligned to an 8-byte boundary.
+ * Since this structure is only 4 bytes, we are REQUIRING that
+ * this structure only be used as an array of triangles, and we
+ * depend on the MIPS C compiler (which always aligns arrays to
+ * 8-byte boundaries). THIS IS DANGEROUS!!!!
+ *
+ */
+typedef struct {
+ u8 v0, v1, v2, flag; /* flag is which one for flat shade */
+} gtTriN;
+
+
+/*
+ * This structure represents the transformed points. It is the format
+ * of the points written out when GT_FLAG_XFM_ONLY is set, as well as
+ * the format expected when GT_FLAG_NO_XFM is used.
+ *
+ * NOTE: The size and layout of these points is very similar to Vtx,
+ * except the screen coordinates overwrite the x,y,z,pad fields.
+ * (we could consider adding to the Vtx union, but we want to keep
+ * turbo stuff out of gbi.h)
+ *
+ * NOTE: The z is a special format. It can be used to compare vertices
+ * for sorting, but it should not be used for other purposes. If modified,
+ * the z-buffer hardware might not understand the data.
+ *
+ */
+typedef struct {
+ short int xscrn; /* x,y screen coordinates are SSSS10.2 */
+ short int yscrn;
+ int zscrn; /* z screen is S15.16 */
+
+ short int s; /* transformed texture coord, S10.5 */
+ short int t;
+
+ u8 r; /* color (or normal) */
+ u8 g;
+ u8 b;
+ u8 a;
+} gtVtxOut_t;
+
+/* see "Data Structure" comment in gbi.h for information about why
+ * we use this union.
+ */
+typedef union {
+ gtVtxOut_t v;
+ long long int force_structure_alignment;
+} gtVtxOut;
+
+
+
+/*
+ * state field: rdpOthermode
+ *
+ * This is one of the trickier state fields. The turbo interface
+ * requires the RDP othermode command to be cached by the host,
+ * therefore we provide a different interface in libultra to help cache
+ * this in the gt state (this word is just bits, you could pack them
+ * on your own).
+ *
+ * gtStateSetOthermode() accomplishs this, taking as arguments
+ * the state, one of the following mode enums, and a piece of data
+ * (othermode parameters from gbi.h).
+ *
+ * By definition, the othermode word from the gt state structure is sent
+ * to the RDP *before* any RDP commands from the rdpCmds[] field. The
+ * othermode is *always* sent.
+ *
+ * Stated another way, NONE of the gbi RDP othermode commands equivalent
+ * to those listed here are allowed in the rdpCmd[] field of the
+ * gt state structure.
+ *
+ * Notice also that many of these commands do not make sense for
+ * the turbo ucode (they control features not supported, like mip-mapping).
+ * They are only included here for completeness.
+ *
+ */
+typedef enum {
+ GT_CLEAR, /* special gt mode, clears othermode state */
+ GT_ALPHACOMPARE,
+ GT_ZSRCSEL,
+ GT_RENDERMODE,
+ GT_ALPHADITHER,
+ GT_RGBDITHER,
+ GT_COMBKEY,
+ GT_TEXTCONV,
+ GT_TEXTFILT,
+ GT_TEXTLUT,
+ GT_TEXTLOD,
+ GT_TEXTDETAIL,
+ GT_TEXTPERSP,
+ GT_CYCLETYPE,
+ GT_PIPELINE
+} gtStateOthermode_t;
+
+/*
+ * This call builds up an othermode command word. The 'mode' is one of
+ * the above modes, the 'data' field comes from gbi.h, it is the data
+ * field for the equivalent gbi setothermode macro.
+ */
+extern void gtStateSetOthermode(Gfx *om, gtStateOthermode_t mode, int data);
+
+/*
+ * This call dumps a turbo display list for use with gbi2mem and RSPSIM
+ */
+#define GT_DUMPTURBO_HANGAFTER 64
+#define GT_DUMPTURBO_NOTEXTURES 128
+extern void gtDumpTurbo(OSTask *tp,u8 flags);
+
+/*
+ * Special macros to init othermode words to all 0's, a good default
+ * value.
+ */
+#define gDPClearOtherMode(pkt) \
+{ \
+ Gfx *_g = (Gfx *)(pkt); \
+ \
+ _g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE, 24, 8); \
+ _g->words.w1 = 0x0; \
+}
+
+#define gsDPClearOtherMode() \
+{ \
+ _SHIFTL(G_RDPSETOTHERMODE, 24, 8), 0x0 \
+}
+
+/*
+ * Special macros to end DP blocks (see above). These commands
+ * generate all 0's, which the turbo ucode looks for. They *aren't*
+ * real DP commands!
+ */
+#define gDPEndDisplayList(pkt) gSPNoOp(pkt)
+#define gsDPEndDisplayList() gsSPNoOp()
+
+/*
+ * This structure is a turbo 'object', the turbo display list is
+ * simply a list of these.
+ *
+ * NOTE: All pointers are segment addresses
+ *
+ * NOTE: If (statep->flag & GT_FLAG_XFM_ONLY), the trip field is
+ * interpreted as a pointer to gtVtxOut[] that can be used to store
+ * the transformed points. (statep->triCount should be 0, else bad
+ * things could happen...)
+ *
+ * NOTE: If (statep->flag & GT_FLAG_NO_XFM), the vtxp field is
+ * interpreted as a pointer to gtVtxOut[] that can be used to load
+ * pre-transformed points.
+ *
+ */
+typedef struct {
+ gtGlobState *gstatep; /* global state, usually NULL */
+ gtState *statep; /* if this is NULL, end object processing */
+ Vtx *vtxp; /* if this is NULL, use points in buffer */
+ gtTriN *trip; /* if this is NULL, use tris in buffer */
+} gtGfx_t;
+
+typedef union {
+ gtGfx_t obj;
+ long long int force_structure_alignment;
+} gtGfx;
+
+
+#endif /* _LANGUAGE_C */
+
+#ifdef _LANGUAGE_ASSEMBLY
+#include
+#endif /* _LANGUAGE_ASSEMBLY */
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif /* _LANGUAGE_C_PLUS_PLUS */
+
+#ifdef _LANGUAGE_MAKEROM
+#endif /* _LANGUAGE_MAKEROM */
+
+#endif /* _GT_H_ */
diff --git a/include/2.0L/PR/gu.h b/include/2.0L/PR/gu.h
new file mode 100755
index 00000000..3063e7b0
--- /dev/null
+++ b/include/2.0L/PR/gu.h
@@ -0,0 +1,266 @@
+#ifndef _GU_H_
+#define _GU_H_
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.46 $
+ * $Date: 1997/11/26 00:30:53 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/gu.h,v $
+ *
+ **************************************************************************/
+
+#include
+#include
+#include
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#define M_PI 3.14159265358979323846
+#define M_DTOR (3.14159265358979323846/180.0)
+
+#define FTOFIX32(x) (long)((x) * (float)0x00010000)
+#define FIX32TOF(x) ((float)(x) * (1.0f / (float)0x00010000))
+#define FTOFRAC8(x) ((int) MIN(((x) * (128.0f)), 127.0f) & 0xff)
+
+#define FILTER_WRAP 0
+#define FILTER_CLAMP 1
+
+#define RAND(x) (guRandom()%x) /* random number between 0 to x */
+
+/*
+ * Data Structures
+ */
+typedef struct {
+ unsigned char *base;
+ int fmt, siz;
+ int xsize, ysize;
+ int lsize;
+ /* current tile info */
+ int addr;
+ int w, h;
+ int s, t;
+} Image;
+
+typedef struct {
+ float col[3];
+ float pos[3];
+ float a1, a2; /* actual color = col/(a1*dist + a2) */
+} PositionalLight;
+
+
+/*
+ * Function Prototypes
+ */
+
+extern int guLoadTextureBlockMipMap(Gfx **glist, unsigned char *tbuf, Image *im,
+ unsigned char startTile, unsigned char pal, unsigned char cms,
+ unsigned char cmt, unsigned char masks, unsigned char maskt,
+ unsigned char shifts, unsigned char shiftt, unsigned char cfs,
+ unsigned char cft);
+
+extern int guGetDPLoadTextureTileSz (int ult, int lrt);
+extern void guDPLoadTextureTile (Gfx *glistp, void *timg,
+ int texl_fmt, int texl_size,
+ int img_width, int img_height,
+ int uls, int ult, int lrs, int lrt,
+ int palette,
+ int cms, int cmt,
+ int masks, int maskt,
+ int shifts, int shiftt);
+
+
+/*
+ * matrix operations:
+ *
+ * The 'F' version is floating point, in case the application wants
+ * to do matrix manipulations and convert to fixed-point at the last
+ * minute.
+ */
+extern void guMtxIdent(Mtx *m);
+extern void guMtxIdentF(float mf[4][4]);
+extern void guOrtho(Mtx *m, float l, float r, float b, float t,
+ float n, float f, float scale);
+extern void guOrthoF(float mf[4][4], float l, float r, float b, float t,
+ float n, float f, float scale);
+extern void guFrustum(Mtx *m, float l, float r, float b, float t,
+ float n, float f, float scale);
+extern void guFrustumF(float mf[4][4], float l, float r, float b, float t,
+ float n, float f, float scale);
+extern void guPerspective(Mtx *m, u16 *perspNorm, float fovy,
+ float aspect, float near, float far, float scale);
+extern void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy,
+ float aspect, float near, float far, float scale);
+extern void guLookAt(Mtx *m,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp);
+extern void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp);
+extern void guLookAtReflect(Mtx *m, LookAt *l,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp);
+extern void guLookAtReflectF(float mf[4][4], LookAt *l,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp);
+extern void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp,
+ float xl1, float yl1, float zl1,
+ float xl2, float yl2, float zl2,
+ int twidth, int theight);
+extern void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp,
+ float xl1, float yl1, float zl1,
+ float xl2, float yl2, float zl2,
+ int twidth, int theight);
+extern void guLookAtStereo(Mtx *m,
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp,
+ float eyedist);
+extern void guLookAtStereoF(float mf[4][4],
+ float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp,
+ float eyedist);
+extern void guRotate(Mtx *m, float a, float x, float y, float z);
+extern void guRotateF(float mf[4][4], float a, float x, float y, float z);
+extern void guRotateRPY(Mtx *m, float r, float p, float y);
+extern void guRotateRPYF(float mf[4][4], float r, float p, float h);
+extern void guAlign(Mtx *m, float a, float x, float y, float z);
+extern void guAlignF(float mf[4][4], float a, float x, float y, float z);
+extern void guScale(Mtx *m, float x, float y, float z);
+extern void guScaleF(float mf[4][4], float x, float y, float z);
+extern void guTranslate(Mtx *m, float x, float y, float z);
+extern void guTranslateF(float mf[4][4], float x, float y, float z);
+extern void guPosition(Mtx *m, float r, float p, float h, float s,
+ float x, float y, float z);
+extern void guPositionF(float mf[4][4], float r, float p, float h, float s,
+ float x, float y, float z);
+extern void guMtxF2L(float mf[4][4], Mtx *m);
+extern void guMtxL2F(float mf[4][4], Mtx *m);
+extern void guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
+extern void guMtxCatL(Mtx *m, Mtx *n, Mtx *res);
+extern void guMtxXFMF(float mf[4][4], float x, float y, float z,
+ float *ox, float *oy, float *oz);
+extern void guMtxXFML(Mtx *m, float x, float y, float z,
+ float *ox, float *oy, float *oz);
+
+/* vector utility: */
+extern void guNormalize(float *x, float *y, float *z);
+
+/* light utilities: */
+void guPosLight(PositionalLight *pl, Light *l,
+ float xOb, float yOb, float zOb);
+void guPosLightHilite(PositionalLight *pl1, PositionalLight *pl2,
+ Light *l1, Light *l2,
+ LookAt *l, Hilite *h,
+ float xEye, float yEye, float zEye,
+ float xOb, float yOb, float zOb,
+ float xUp, float yUp, float zUp,
+ int twidth, int theight);
+extern int guRandom(void);
+
+/*
+ * Math functions
+ */
+extern float sinf(float angle);
+extern float cosf(float angle);
+extern signed short sins (unsigned short angle);
+extern signed short coss (unsigned short angle);
+extern float sqrtf(float value);
+
+/*
+ * Dump routines for low-level display lists
+ */
+/* flag values for guParseRdpDL() */
+#define GU_PARSERDP_VERBOSE 1
+#define GU_PARSERDP_PRAREA 2
+#define GU_PARSERDP_PRHISTO 4
+#define GU_PARSERDP_DUMPONLY 32 /* doesn't need to be same as */
+ /* GU_PARSEGBI_DUMPOLNY, but this */
+ /* allows app to use interchangeably */
+
+extern void guParseRdpDL(u64 *rdp_dl, u64 nbytes, u8 flags);
+extern void guParseString(char *StringPointer, u64 nbytes);
+
+/*
+ * NO LONGER SUPPORTED,
+ * use guParseRdpDL with GU_PARSERDP_DUMPONLY flags
+ */
+/* extern void guDumpRawRdpDL(u64 *rdp_dl, u64 nbytes); */
+
+/* flag values for guBlinkRdpDL() */
+#define GU_BLINKRDP_HILITE 1
+#define GU_BLINKRDP_EXTRACT 2
+
+extern void
+guBlinkRdpDL(u64 *rdp_dl_in, u64 nbytes_in,
+ u64 *rdp_dl_out, u64 *nbytes_out,
+ u32 x, u32 y, u32 radius,
+ u8 red, u8 green, u8 blue,
+ u8 flags);
+
+/* flag values for guParseGbiDL() */
+#define GU_PARSEGBI_ROWMAJOR 1
+#define GU_PARSEGBI_NONEST 2
+#define GU_PARSEGBI_FLTMTX 4
+#define GU_PARSEGBI_SHOWDMA 8
+#define GU_PARSEGBI_ALLMTX 16
+#define GU_PARSEGBI_DUMPONLY 32
+/*
+#define GU_PARSEGBI_HANGAFTER 64
+#define GU_PARSEGBI_NOTEXTURES 128
+*/
+extern void guParseGbiDL(u64 *gbi_dl, u32 nbytes, u8 flags);
+extern void guDumpGbiDL(OSTask *tp,u8 flags);
+
+#define GU_PARSE_GBI_TYPE 1
+#define GU_PARSE_RDP_TYPE 2
+#define GU_PARSE_READY 3
+#define GU_PARSE_MEM_BLOCK 4
+#define GU_PARSE_ABI_TYPE 5
+#define GU_PARSE_STRING_TYPE 6
+
+typedef struct {
+ int dataSize;
+ int dlType;
+ int flags;
+ u32 paddr;
+} guDLPrintCB;
+
+void guSprite2DInit(uSprite *SpritePointer,
+ void *SourceImagePointer,
+ void *TlutPointer,
+ int Stride,
+ int SubImageWidth,
+ int SubImageHeight,
+ int SourceImageType,
+ int SourceImageBitSize,
+ int SourceImageOffsetS,
+ int SourceImageOffsetT);
+
+#endif /* !_GU_H_ */
diff --git a/include/2.0L/PR/libaudio.h b/include/2.0L/PR/libaudio.h
new file mode 100755
index 00000000..55f22c84
--- /dev/null
+++ b/include/2.0L/PR/libaudio.h
@@ -0,0 +1,947 @@
+/*====================================================================
+ * libaudio.h
+ *
+ * Copyright 1993, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * $Revision: 1.173 $
+ * $Date: 1997/12/01 12:42:21 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/libaudio.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __LIB_AUDIO__
+#define __LIB_AUDIO__
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+#include
+
+/***********************************************************************
+ * misc defines
+ ***********************************************************************/
+#ifndef _EMULATOR
+# ifdef AUD_PROFILE
+
+#define PROFILE_AUD(num, cnt, max, min) \
+{ \
+ u32 currCnt = osGetCount(); \
+ currCnt -= lastCnt[cnt_index]; \
+ cnt_index--; \
+ cnt += currCnt; \
+ num++; \
+ \
+ if ( currCnt > max ) max = currCnt; \
+ if ( currCnt < min ) min = currCnt; \
+}
+
+# endif /* AUD_PROFILE */
+#endif /* EMULATOR */
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define AL_FX_BUFFER_SIZE 8192
+#define AL_FRAME_INIT -1
+#define AL_USEC_PER_FRAME 16000
+#define AL_MAX_PRIORITY 127
+#define AL_GAIN_CHANGE_TIME 1000
+
+typedef s32 ALMicroTime;
+typedef u8 ALPan;
+
+#define AL_PAN_CENTER 64
+#define AL_PAN_LEFT 0
+#define AL_PAN_RIGHT 127
+#define AL_VOL_FULL 127
+#define AL_KEY_MIN 0
+#define AL_KEY_MAX 127
+#define AL_DEFAULT_FXMIX 0
+#define AL_SUSTAIN 63
+
+/***********************************************************************
+ * Error handling
+ ***********************************************************************/
+
+#ifdef _DEBUG
+#define ALFailIf(condition, error) \
+ if (condition) { \
+ __osError(error, 0); \
+ return; }
+
+#else
+#define ALFailIf(condition, error) \
+ if (condition) { \
+ return; }
+#endif
+
+#ifdef _DEBUG
+#define ALFlagFailIf(condition, flag, error) \
+ if (condition) { \
+ if(flag) __osError(error, 0); \
+ return; }
+
+#else
+#define ALFlagFailIf(condition, flag, error) \
+ if (condition) { \
+ return; }
+#endif
+
+/***********************************************************************
+ * Audio Library global routines
+ ***********************************************************************/
+typedef struct ALLink_s {
+ struct ALLink_s *next;
+ struct ALLink_s *prev;
+} ALLink;
+
+void alUnlink(ALLink *element);
+void alLink(ALLink *element, ALLink *after);
+
+typedef s32 (*ALDMAproc)(s32 addr, s32 len, void *state);
+typedef ALDMAproc (*ALDMANew)(void *state);
+
+void alCopy(void *src, void *dest, s32 len);
+
+typedef struct {
+ u8 *base;
+ u8 *cur;
+ s32 len;
+ s32 count;
+} ALHeap;
+
+#define AL_HEAP_DEBUG 1
+#define AL_HEAP_MAGIC 0x20736a73
+#define AL_HEAP_INIT 0
+
+void alHeapInit(ALHeap *hp, u8 *base, s32 len);
+void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size);
+s32 alHeapCheck(ALHeap *hp);
+
+#ifdef _DEBUG
+#define alHeapAlloc(hp, elem ,size) alHeapDBAlloc((u8 *) __FILE__,__LINE__,(hp),(elem),(size))
+#else
+#define alHeapAlloc(hp, elem ,size) alHeapDBAlloc(0, 0,(hp),(elem),(size))
+#endif
+
+/***********************************************************************
+ * FX Stuff
+ ***********************************************************************/
+#define AL_FX_NONE 0
+#define AL_FX_SMALLROOM 1
+#define AL_FX_BIGROOM 2
+#define AL_FX_CHORUS 3
+#define AL_FX_FLANGE 4
+#define AL_FX_ECHO 5
+#define AL_FX_CUSTOM 6
+
+typedef u8 ALFxId;
+typedef void *ALFxRef;
+
+/***********************************************************************
+ * data structures for sound banks
+ ***********************************************************************/
+
+#define AL_BANK_VERSION 0x4231 /* 'B1' */
+
+/* Possible wavetable types */
+enum {AL_ADPCM_WAVE = 0,
+ AL_RAW16_WAVE};
+
+typedef struct {
+ s32 order;
+ s32 npredictors;
+ s16 book[1]; /* Actually variable size. Must be 8-byte aligned */
+} ALADPCMBook;
+
+typedef struct {
+ u32 start;
+ u32 end;
+ u32 count;
+ ADPCM_STATE state;
+} ALADPCMloop;
+
+typedef struct {
+ u32 start;
+ u32 end;
+ u32 count;
+} ALRawLoop;
+
+typedef struct {
+ ALMicroTime attackTime;
+ ALMicroTime decayTime;
+ ALMicroTime releaseTime;
+ u8 attackVolume;
+ u8 decayVolume;
+} ALEnvelope;
+
+typedef struct {
+ u8 velocityMin;
+ u8 velocityMax;
+ u8 keyMin;
+ u8 keyMax;
+ u8 keyBase;
+ s8 detune;
+} ALKeyMap;
+
+typedef struct {
+ ALADPCMloop *loop;
+ ALADPCMBook *book;
+} ALADPCMWaveInfo;
+
+typedef struct {
+ ALRawLoop *loop;
+} ALRAWWaveInfo;
+
+typedef struct ALWaveTable_s {
+ u8 *base; /* ptr to start of wave data */
+ s32 len; /* length of data in bytes */
+ u8 type; /* compression type */
+ u8 flags; /* offset/address flags */
+ union {
+ ALADPCMWaveInfo adpcmWave;
+ ALRAWWaveInfo rawWave;
+ } waveInfo;
+} ALWaveTable;
+
+typedef struct ALSound_s {
+ ALEnvelope *envelope;
+ ALKeyMap *keyMap;
+ ALWaveTable *wavetable; /* offset to wavetable struct */
+ ALPan samplePan;
+ u8 sampleVolume;
+ u8 flags;
+} ALSound;
+
+typedef struct {
+ u8 volume; /* overall volume for this instrument */
+ ALPan pan; /* 0 = hard left, 127 = hard right */
+ u8 priority; /* voice priority for this instrument */
+ u8 flags;
+ u8 tremType; /* the type of tremelo osc. to use */
+ u8 tremRate; /* the rate of the tremelo osc. */
+ u8 tremDepth; /* the depth of the tremelo osc */
+ u8 tremDelay; /* the delay for the tremelo osc */
+ u8 vibType; /* the type of tremelo osc. to use */
+ u8 vibRate; /* the rate of the tremelo osc. */
+ u8 vibDepth; /* the depth of the tremelo osc */
+ u8 vibDelay; /* the delay for the tremelo osc */
+ s16 bendRange; /* pitch bend range in cents */
+ s16 soundCount; /* number of sounds in this array */
+ ALSound *soundArray[1];
+} ALInstrument;
+
+typedef struct ALBank_s {
+ s16 instCount; /* number of programs in this bank */
+ u8 flags;
+ u8 pad;
+ s32 sampleRate; /* e.g. 44100, 22050, etc... */
+ ALInstrument *percussion; /* default percussion for GM */
+ ALInstrument *instArray[1]; /* ARRAY of instruments */
+} ALBank;
+
+typedef struct { /* Note: sizeof won't be correct */
+ s16 revision; /* format revision of this file */
+ s16 bankCount; /* number of banks */
+ ALBank *bankArray[1]; /* ARRAY of bank offsets */
+} ALBankFile;
+
+void alBnkfNew(ALBankFile *f, u8 *table);
+
+/***********************************************************************
+ * Sequence Files
+ ***********************************************************************/
+#define AL_SEQBANK_VERSION 'S1'
+
+typedef struct {
+ u8 *offset;
+ s32 len;
+} ALSeqData;
+
+typedef struct { /* Note: sizeof won't be correct */
+ s16 revision; /* format revision of this file */
+ s16 seqCount; /* number of sequences */
+ ALSeqData seqArray[1]; /* ARRAY of sequence info */
+} ALSeqFile;
+
+void alSeqFileNew(ALSeqFile *f, u8 *base);
+
+/***********************************************************************
+ * Synthesis driver stuff
+ ***********************************************************************/
+typedef ALMicroTime (*ALVoiceHandler)(void *);
+
+typedef struct {
+ s32 maxVVoices; /* obsolete */
+ s32 maxPVoices;
+ s32 maxUpdates;
+ s32 maxFXbusses;
+ void *dmaproc;
+ ALHeap *heap;
+ s32 outputRate; /* output sample rate */
+ ALFxId fxType;
+ s32 *params;
+} ALSynConfig;
+
+typedef struct ALPlayer_s {
+ struct ALPlayer_s *next;
+ void *clientData; /* storage for client callback */
+ ALVoiceHandler handler; /* voice handler for player */
+ ALMicroTime callTime; /* usec requested callback */
+ s32 samplesLeft; /* usec remaining to callback */
+} ALPlayer;
+
+typedef struct ALVoice_s {
+ ALLink node;
+ struct PVoice_s *pvoice;
+ ALWaveTable *table;
+ void *clientPrivate;
+ s16 state;
+ s16 priority;
+ s16 fxBus;
+ s16 unityPitch;
+} ALVoice;
+
+typedef struct ALVoiceConfig_s {
+ s16 priority; /* voice priority */
+ s16 fxBus; /* bus assignment */
+ u8 unityPitch; /* unity pitch flag */
+} ALVoiceConfig;
+
+typedef struct {
+ ALPlayer *head; /* client list head */
+ ALLink pFreeList; /* list of free physical voices */
+ ALLink pAllocList; /* list of allocated physical voices */
+ ALLink pLameList; /* list of voices ready to be freed */
+ s32 paramSamples;
+ s32 curSamples; /* samples from start of game */
+ ALDMANew dma;
+ ALHeap *heap;
+
+ struct ALParam_s *paramList;
+
+ struct ALMainBus_s *mainBus;
+ struct ALAuxBus_s *auxBus; /* ptr to array of aux bus structs */
+ struct ALFilter_s *outputFilter; /* last filter in the filter chain */
+
+ s32 numPVoices;
+ s32 maxAuxBusses;
+ s32 outputRate; /* output sample rate */
+ s32 maxOutSamples; /* Maximum samples rsp can generate
+ at one time at output rate */
+} ALSynth;
+
+void alSynNew(ALSynth *s, ALSynConfig *config);
+void alSynDelete(ALSynth *s);
+
+void alSynAddPlayer(ALSynth *s, ALPlayer *client);
+void alSynRemovePlayer(ALSynth *s, ALPlayer *client);
+
+s32 alSynAllocVoice(ALSynth *s, ALVoice *v, ALVoiceConfig *vc);
+void alSynFreeVoice(ALSynth *s, ALVoice *voice);
+
+void alSynStartVoice(ALSynth *s, ALVoice *voice, ALWaveTable *w);
+void alSynStartVoiceParams(ALSynth *s, ALVoice *voice, ALWaveTable *w,
+ f32 pitch, s16 vol, ALPan pan, u8 fxmix,
+ ALMicroTime t);
+void alSynStopVoice(ALSynth *s, ALVoice *voice);
+
+void alSynSetVol(ALSynth *s, ALVoice *v, s16 vol, ALMicroTime delta);
+void alSynSetPitch(ALSynth *s, ALVoice *voice, f32 ratio);
+void alSynSetPan(ALSynth *s, ALVoice *voice, ALPan pan);
+void alSynSetFXMix(ALSynth *s, ALVoice *voice, u8 fxmix);
+void alSynSetPriority(ALSynth *s, ALVoice *voice, s16 priority);
+s16 alSynGetPriority(ALSynth *s, ALVoice *voice);
+
+ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, ALSynConfig *c, ALHeap *hp);
+ALFxRef alSynGetFXRef(ALSynth *s, s16 bus, s16 index);
+void alSynFreeFX(ALSynth *s, ALFxRef *fx);
+void alSynSetFXParam(ALSynth *s, ALFxRef fx, s16 paramID, void *param);
+
+/***********************************************************************
+ * Audio Library (AL) stuff
+ ***********************************************************************/
+typedef struct {
+ ALSynth drvr;
+} ALGlobals;
+
+extern ALGlobals *alGlobals;
+
+void alInit(ALGlobals *glob, ALSynConfig *c);
+void alClose(ALGlobals *glob);
+
+Acmd *alAudioFrame(Acmd *cmdList, s32 *cmdLen, s16 *outBuf, s32 outLen);
+
+/***********************************************************************
+ * Sequence Player stuff
+ ***********************************************************************/
+
+/*
+ * Play states
+ */
+#define AL_STOPPED 0
+#define AL_PLAYING 1
+#define AL_STOPPING 2
+
+#define AL_DEFAULT_PRIORITY 5
+#define AL_DEFAULT_VOICE 0
+#define AL_MAX_CHANNELS 16
+
+/*
+ * Audio Library event type definitions
+ */
+enum ALMsg {
+ AL_SEQ_REF_EVT, /* Reference to a pending event in the sequence. */
+ AL_SEQ_MIDI_EVT,
+ AL_SEQP_MIDI_EVT,
+ AL_TEMPO_EVT,
+ AL_SEQ_END_EVT,
+ AL_NOTE_END_EVT,
+ AL_SEQP_ENV_EVT,
+ AL_SEQP_META_EVT,
+ AL_SEQP_PROG_EVT,
+ AL_SEQP_API_EVT,
+ AL_SEQP_VOL_EVT,
+ AL_SEQP_LOOP_EVT,
+ AL_SEQP_PRIORITY_EVT,
+ AL_SEQP_SEQ_EVT,
+ AL_SEQP_BANK_EVT,
+ AL_SEQP_PLAY_EVT,
+ AL_SEQP_STOP_EVT,
+ AL_SEQP_STOPPING_EVT,
+ AL_TRACK_END,
+ AL_CSP_LOOPSTART,
+ AL_CSP_LOOPEND,
+ AL_CSP_NOTEOFF_EVT,
+ AL_TREM_OSC_EVT,
+ AL_VIB_OSC_EVT
+};
+
+/*
+ * Midi event definitions
+ */
+#define AL_EVTQ_END 0x7fffffff
+
+enum AL_MIDIstatus {
+ /* For distinguishing channel number from status */
+ AL_MIDI_ChannelMask = 0x0F,
+ AL_MIDI_StatusMask = 0xF0,
+
+ /* Channel voice messages */
+ AL_MIDI_ChannelVoice = 0x80,
+ AL_MIDI_NoteOff = 0x80,
+ AL_MIDI_NoteOn = 0x90,
+ AL_MIDI_PolyKeyPressure = 0xA0,
+ AL_MIDI_ControlChange = 0xB0,
+ AL_MIDI_ChannelModeSelect = 0xB0,
+ AL_MIDI_ProgramChange = 0xC0,
+ AL_MIDI_ChannelPressure = 0xD0,
+ AL_MIDI_PitchBendChange = 0xE0,
+
+ /* System messages */
+ AL_MIDI_SysEx = 0xF0, /* System Exclusive */
+
+ /* System common */
+ AL_MIDI_SystemCommon = 0xF1,
+ AL_MIDI_TimeCodeQuarterFrame = 0xF1,
+ AL_MIDI_SongPositionPointer = 0xF2,
+ AL_MIDI_SongSelect = 0xF3,
+ AL_MIDI_Undefined1 = 0xF4,
+ AL_MIDI_Undefined2 = 0xF5,
+ AL_MIDI_TuneRequest = 0xF6,
+ AL_MIDI_EOX = 0xF7, /* End of System Exclusive */
+
+ /* System real time */
+ AL_MIDI_SystemRealTime = 0xF8,
+ AL_MIDI_TimingClock = 0xF8,
+ AL_MIDI_Undefined3 = 0xF9,
+ AL_MIDI_Start = 0xFA,
+ AL_MIDI_Continue = 0xFB,
+ AL_MIDI_Stop = 0xFC,
+ AL_MIDI_Undefined4 = 0xFD,
+ AL_MIDI_ActiveSensing = 0xFE,
+ AL_MIDI_SystemReset = 0xFF,
+ AL_MIDI_Meta = 0xFF /* MIDI Files only */
+};
+
+enum AL_MIDIctrl {
+ AL_MIDI_VOLUME_CTRL = 0x07,
+ AL_MIDI_PAN_CTRL = 0x0A,
+ AL_MIDI_PRIORITY_CTRL = 0x10, /* use general purpose controller for priority */
+ AL_MIDI_FX_CTRL_0 = 0x14,
+ AL_MIDI_FX_CTRL_1 = 0x15,
+ AL_MIDI_FX_CTRL_2 = 0x16,
+ AL_MIDI_FX_CTRL_3 = 0x17,
+ AL_MIDI_FX_CTRL_4 = 0x18,
+ AL_MIDI_FX_CTRL_5 = 0x19,
+ AL_MIDI_FX_CTRL_6 = 0x1A,
+ AL_MIDI_FX_CTRL_7 = 0x1B,
+ AL_MIDI_FX_CTRL_8 = 0x1C,
+ AL_MIDI_FX_CTRL_9 = 0x1D,
+ AL_MIDI_SUSTAIN_CTRL = 0x40,
+ AL_MIDI_FX1_CTRL = 0x5B,
+ AL_MIDI_FX3_CTRL = 0x5D
+};
+
+enum AL_MIDImeta {
+ AL_MIDI_META_TEMPO = 0x51,
+ AL_MIDI_META_EOT = 0x2f
+};
+
+
+#define AL_CMIDI_BLOCK_CODE 0xFE
+#define AL_CMIDI_LOOPSTART_CODE 0x2E
+#define AL_CMIDI_LOOPEND_CODE 0x2D
+#define AL_CMIDI_CNTRL_LOOPSTART 102
+#define AL_CMIDI_CNTRL_LOOPEND 103
+#define AL_CMIDI_CNTRL_LOOPCOUNT_SM 104
+#define AL_CMIDI_CNTRL_LOOPCOUNT_BIG 105
+
+typedef struct {
+ u8 *curPtr; /* ptr to the next event */
+ s32 lastTicks; /* sequence clock ticks (used by alSeqSetLoc) */
+ s32 curTicks; /* sequence clock ticks of next event (used by loop end test) */
+ s16 lastStatus; /* the last status msg */
+} ALSeqMarker;
+
+typedef struct {
+ s32 ticks; /* MIDI, Tempo and End events must start with ticks */
+ u8 status;
+ u8 byte1;
+ u8 byte2;
+ u32 duration;
+} ALMIDIEvent;
+
+typedef struct {
+ s32 ticks;
+ u8 status;
+ u8 type;
+ u8 len;
+ u8 byte1;
+ u8 byte2;
+ u8 byte3;
+} ALTempoEvent;
+
+typedef struct {
+ s32 ticks;
+ u8 status;
+ u8 type;
+ u8 len;
+} ALEndEvent;
+
+typedef struct {
+ struct ALVoice_s *voice;
+} ALNoteEvent;
+
+typedef struct {
+ struct ALVoice_s *voice;
+ ALMicroTime delta;
+ u8 vol;
+} ALVolumeEvent;
+
+typedef struct {
+ s16 vol;
+} ALSeqpVolEvent;
+
+typedef struct {
+ ALSeqMarker *start;
+ ALSeqMarker *end;
+ s32 count;
+} ALSeqpLoopEvent;
+
+typedef struct {
+ u8 chan;
+ u8 priority;
+} ALSeqpPriorityEvent;
+
+typedef struct {
+ void *seq; /* pointer to a seq (could be an ALSeq or an ALCSeq). */
+} ALSeqpSeqEvent;
+
+typedef struct {
+ ALBank *bank;
+} ALSeqpBankEvent;
+
+typedef struct {
+ struct ALVoiceState_s *vs;
+ void *oscState;
+ u8 chan;
+} ALOscEvent;
+
+typedef struct {
+ s16 type;
+ union {
+ ALMIDIEvent midi;
+ ALTempoEvent tempo;
+ ALEndEvent end;
+ ALNoteEvent note;
+ ALVolumeEvent vol;
+ ALSeqpLoopEvent loop;
+ ALSeqpVolEvent spvol;
+ ALSeqpPriorityEvent sppriority;
+ ALSeqpSeqEvent spseq;
+ ALSeqpBankEvent spbank;
+ ALOscEvent osc;
+ } msg;
+} ALEvent;
+
+typedef struct {
+ ALLink node;
+ ALMicroTime delta;
+ ALEvent evt;
+} ALEventListItem;
+
+typedef struct {
+ ALLink freeList;
+ ALLink allocList;
+ s32 eventCount;
+} ALEventQueue;
+
+void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items,
+ s32 itemCount);
+ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt);
+void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt,
+ ALMicroTime delta);
+void alEvtqFlush(ALEventQueue *evtq);
+void alEvtqFlushType(ALEventQueue *evtq, s16 type);
+
+
+#define AL_PHASE_ATTACK 0
+#define AL_PHASE_NOTEON 0
+#define AL_PHASE_DECAY 1
+#define AL_PHASE_SUSTAIN 2
+#define AL_PHASE_RELEASE 3
+#define AL_PHASE_SUSTREL 4
+
+typedef struct ALVoiceState_s {
+ struct ALVoiceState_s *next;/* MUST be first */
+ ALVoice voice;
+ ALSound *sound;
+ ALMicroTime envEndTime; /* time of envelope segment end */
+ f32 pitch; /* currect pitch ratio */
+ f32 vibrato; /* current value of the vibrato */
+ u8 envGain; /* current envelope gain */
+ u8 channel; /* channel assignment */
+ u8 key; /* note on key number */
+ u8 velocity; /* note on velocity */
+ u8 envPhase; /* what envelope phase */
+ u8 phase;
+ u8 tremelo; /* current value of the tremelo */
+ u8 flags; /* bit 0 tremelo flag
+ bit 1 vibrato flag */
+} ALVoiceState;
+
+typedef struct {
+ ALInstrument *instrument; /* instrument assigned to this chan */
+ s16 bendRange; /* pitch bend range in cents */
+ ALFxId fxId; /* type of fx assigned to this chan */
+ ALPan pan; /* overall pan for this chan */
+ u8 priority; /* priority for this chan */
+ u8 vol; /* current volume for this chan */
+ u8 fxmix; /* current fx mix for this chan */
+ u8 sustain; /* current sustain pedal state */
+ f32 pitchBend; /* current pitch bend val in cents */
+} ALChanState;
+
+typedef struct ALSeq_s {
+ u8 *base; /* ptr to start of sequence file */
+ u8 *trackStart; /* ptr to first MIDI event */
+ u8 *curPtr; /* ptr to next event to read */
+ s32 lastTicks; /* MIDI ticks for last event */
+ s32 len; /* length of sequence in bytes */
+ f32 qnpt; /* qrter notes / tick (1/division) */
+ s16 division; /* ticks per quarter note */
+ s16 lastStatus; /* for running status */
+} ALSeq;
+
+typedef struct {
+ u32 trackOffset[16];
+ u32 division;
+} ALCMidiHdr;
+
+typedef struct ALCSeq_s {
+ ALCMidiHdr *base; /* ptr to start of sequence file */
+ u32 validTracks; /* set of flags, showing valid tracks */
+ f32 qnpt; /* qrter notes / tick (1/division) */
+ u32 lastTicks; /* keep track of ticks incase app wants */
+ u32 lastDeltaTicks; /* number of delta ticks of last event */
+ u32 deltaFlag; /* flag: set if delta's not subtracted */
+ u8 *curLoc[16]; /* ptr to current track location, */
+ /* may point to next event, or may point */
+ /* to a backup code */
+ u8 *curBUPtr[16]; /* ptr to next event if in backup mode */
+ u8 curBULen[16]; /* if > 0, then in backup mode */
+ u8 lastStatus[16]; /* for running status */
+ u32 evtDeltaTicks[16]; /* delta time to next event */
+} ALCSeq;
+
+typedef struct {
+ u32 validTracks;
+ s32 lastTicks;
+ u32 lastDeltaTicks;
+ u8 *curLoc[16];
+ u8 *curBUPtr[16];
+ u8 curBULen[16];
+ u8 lastStatus[16];
+ u32 evtDeltaTicks[16];
+} ALCSeqMarker;
+
+#define NO_SOUND_ERR_MASK 0x01
+#define NOTE_OFF_ERR_MASK 0x02
+#define NO_VOICE_ERR_MASK 0x04
+
+typedef struct {
+ s32 maxVoices; /* max number of voices to alloc */
+ s32 maxEvents; /* max internal events to support */
+ u8 maxChannels; /* max MIDI channels to support (16)*/
+ u8 debugFlags; /* control which error get reported */
+ ALHeap *heap; /* ptr to initialized heap */
+ void *initOsc;
+ void *updateOsc;
+ void *stopOsc;
+} ALSeqpConfig;
+
+typedef ALMicroTime (*ALOscInit)(void **oscState,f32 *initVal, u8 oscType,
+ u8 oscRate, u8 oscDepth, u8 oscDelay);
+typedef ALMicroTime (*ALOscUpdate)(void *oscState, f32 *updateVal);
+typedef void (*ALOscStop)(void *oscState);
+
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ ALSynth *drvr; /* reference to the client driver */
+ ALSeq *target; /* current sequence */
+ ALMicroTime curTime;
+ ALBank *bank; /* current ALBank */
+ s32 uspt; /* microseconds per tick */
+ s32 nextDelta; /* microseconds to next callback */
+ s32 state;
+ u16 chanMask; /* active channels */
+ s16 vol; /* overall sequence volume */
+ u8 maxChannels; /* number of MIDI channels */
+ u8 debugFlags; /* control which error get reported */
+ ALEvent nextEvent;
+ ALEventQueue evtq;
+ ALMicroTime frameTime;
+ ALChanState *chanState; /* 16 channels for MIDI */
+ ALVoiceState *vAllocHead; /* list head for allocated voices */
+ ALVoiceState *vAllocTail; /* list tail for allocated voices */
+ ALVoiceState *vFreeList; /* list of free voice state structs */
+ ALOscInit initOsc;
+ ALOscUpdate updateOsc;
+ ALOscStop stopOsc;
+ ALSeqMarker *loopStart;
+ ALSeqMarker *loopEnd;
+ s32 loopCount; /* -1 = loop forever, 0 = no loop */
+} ALSeqPlayer;
+
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ ALSynth *drvr; /* reference to the client driver */
+ ALCSeq *target; /* current sequence */
+ ALMicroTime curTime;
+ ALBank *bank; /* current ALBank */
+ s32 uspt; /* microseconds per tick */
+ s32 nextDelta; /* microseconds to next callback */
+ s32 state;
+ u16 chanMask; /* active channels */
+ s16 vol; /* overall sequence volume */
+ u8 maxChannels; /* number of MIDI channels */
+ u8 debugFlags; /* control which error get reported */
+ ALEvent nextEvent;
+ ALEventQueue evtq;
+ ALMicroTime frameTime;
+ ALChanState *chanState; /* 16 channels for MIDI */
+ ALVoiceState *vAllocHead; /* list head for allocated voices */
+ ALVoiceState *vAllocTail; /* list tail for allocated voices */
+ ALVoiceState *vFreeList; /* list of free voice state structs */
+ ALOscInit initOsc;
+ ALOscUpdate updateOsc;
+ ALOscStop stopOsc;
+} ALCSPlayer;
+
+/*
+ * Sequence data representation routines
+ */
+void alSeqNew(ALSeq *seq, u8 *ptr, s32 len);
+void alSeqNextEvent(ALSeq *seq, ALEvent *event);
+s32 alSeqGetTicks(ALSeq *seq);
+f32 alSeqTicksToSec(ALSeq *seq, s32 ticks, u32 tempo);
+u32 alSeqSecToTicks(ALSeq *seq, f32 sec, u32 tempo);
+void alSeqNewMarker(ALSeq *seq, ALSeqMarker *m, u32 ticks);
+void alSeqSetLoc(ALSeq *seq, ALSeqMarker *marker);
+void alSeqGetLoc(ALSeq *seq, ALSeqMarker *marker);
+/*
+ * Compact Sequence data representation routines
+ */
+void alCSeqNew(ALCSeq *seq, u8 *ptr);
+void alCSeqNextEvent(ALCSeq *seq,ALEvent *evt);
+s32 alCSeqGetTicks(ALCSeq *seq);
+f32 alCSeqTicksToSec(ALCSeq *seq, s32 ticks, u32 tempo);
+u32 alCSeqSecToTicks(ALCSeq *seq, f32 sec, u32 tempo);
+void alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks);
+void alCSeqSetLoc(ALCSeq *seq, ALCSeqMarker *marker);
+void alCSeqGetLoc(ALCSeq *seq, ALCSeqMarker *marker);
+
+/*
+ * Sequence Player routines
+ */
+f32 alCents2Ratio(s32 cents);
+
+void alSeqpNew(ALSeqPlayer *seqp, ALSeqpConfig *config);
+void alSeqpDelete(ALSeqPlayer *seqp);
+void alSeqpSetSeq(ALSeqPlayer *seqp, ALSeq *seq);
+ALSeq *alSeqpGetSeq(ALSeqPlayer *seqp);
+void alSeqpPlay(ALSeqPlayer *seqp);
+void alSeqpStop(ALSeqPlayer *seqp);
+s32 alSeqpGetState(ALSeqPlayer *seqp);
+void alSeqpSetBank(ALSeqPlayer *seqp, ALBank *b);
+void alSeqpSetTempo(ALSeqPlayer *seqp, s32 tempo);
+s32 alSeqpGetTempo(ALSeqPlayer *seqp);
+s16 alSeqpGetVol(ALSeqPlayer *seqp); /* Master volume control */
+void alSeqpSetVol(ALSeqPlayer *seqp, s16 vol);
+void alSeqpLoop(ALSeqPlayer *seqp, ALSeqMarker *start, ALSeqMarker *end, s32 count);
+
+void alSeqpSetChlProgram(ALSeqPlayer *seqp, u8 chan, u8 prog);
+s32 alSeqpGetChlProgram(ALSeqPlayer *seqp, u8 chan);
+void alSeqpSetChlFXMix(ALSeqPlayer *seqp, u8 chan, u8 fxmix);
+u8 alSeqpGetChlFXMix(ALSeqPlayer *seqp, u8 chan);
+void alSeqpSetChlVol(ALSeqPlayer *seqp, u8 chan, u8 vol);
+u8 alSeqpGetChlVol(ALSeqPlayer *seqp, u8 chan);
+void alSeqpSetChlPan(ALSeqPlayer *seqp, u8 chan, ALPan pan);
+ALPan alSeqpGetChlPan(ALSeqPlayer *seqp, u8 chan);
+void alSeqpSetChlPriority(ALSeqPlayer *seqp, u8 chan, u8 priority);
+u8 alSeqpGetChlPriority(ALSeqPlayer *seqp, u8 chan);
+void alSeqpSendMidi(ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2);
+
+
+/* Maintain backwards compatibility with old routine names. */
+#define alSeqpSetProgram alSeqpSetChlProgram
+#define alSeqpGetProgram alSeqpGetChlProgram
+#define alSeqpSetFXMix alSeqpSetChlFXMix
+#define alSeqpGetFXMix alSeqpGetChlFXMix
+#define alSeqpSetPan alSeqpSetChlPan
+#define alSeqpGetPan alSeqpGetChlPan
+#define alSeqpSetChannelPriority alSeqpSetChlPriority
+#define alSeqpGetChannelPriority alSeqpGetChlPriority
+
+
+
+/*
+ * Compressed Sequence Player routines
+ */
+void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config);
+void alCSPDelete(ALCSPlayer *seqp);
+void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq);
+ALCSeq *alCSPGetSeq(ALCSPlayer *seqp);
+void alCSPPlay(ALCSPlayer *seqp);
+void alCSPStop(ALCSPlayer *seqp);
+s32 alCSPGetState(ALCSPlayer *seqp);
+void alCSPSetBank(ALCSPlayer *seqp, ALBank *b);
+void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo);
+s32 alCSPGetTempo(ALCSPlayer *seqp);
+s16 alCSPGetVol(ALCSPlayer *seqp);
+void alCSPSetVol(ALCSPlayer *seqp, s16 vol);
+
+void alCSPSetChlProgram(ALCSPlayer *seqp, u8 chan, u8 prog);
+s32 alCSPGetChlProgram(ALCSPlayer *seqp, u8 chan);
+void alCSPSetChlFXMix(ALCSPlayer *seqp, u8 chan, u8 fxmix);
+u8 alCSPGetChlFXMix(ALCSPlayer *seqp, u8 chan);
+void alCSPSetChlPan(ALCSPlayer *seqp, u8 chan, ALPan pan);
+ALPan alCSPGetChlPan(ALCSPlayer *seqp, u8 chan);
+void alCSPSetChlVol(ALCSPlayer *seqp, u8 chan, u8 vol);
+u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan);
+void alCSPSetChlPriority(ALCSPlayer *seqp, u8 chan, u8 priority);
+u8 alCSPGetChlPriority(ALCSPlayer *seqp, u8 chan);
+void alCSPSendMidi(ALCSPlayer *seqp, s32 ticks, u8 status,
+ u8 byte1, u8 byte2);
+
+
+/* Maintain backwards compatibility with old routine names. */
+#define alCSPSetProgram alCSPSetChlProgram
+#define alCSPGetProgram alCSPGetChlProgram
+#define alCSPSetFXMix alCSPSetChlFXMix
+#define alCSPGetFXMix alCSPGetChlFXMix
+#define alCSPSetPan alCSPSetChlPan
+#define alCSPGetPan alCSPGetChlPan
+#define alCSPSetChannelPriority alCSPSetChlPriority
+#define alCSPGetChannelPriority alCSPGetChlPriority
+
+
+
+/***********************************************************************
+ * Sound Player stuff
+ ***********************************************************************/
+
+typedef struct {
+ s32 maxSounds;
+ s32 maxEvents;
+ ALHeap *heap;
+} ALSndpConfig;
+
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ ALEventQueue evtq;
+ ALEvent nextEvent;
+ ALSynth *drvr; /* reference to the client driver */
+ s32 target;
+ void *sndState;
+ s32 maxSounds;
+ ALMicroTime frameTime;
+ ALMicroTime nextDelta; /* microseconds to next callback */
+ ALMicroTime curTime;
+} ALSndPlayer;
+
+typedef s16 ALSndId;
+
+void alSndpNew(ALSndPlayer *sndp, ALSndpConfig *c);
+void alSndpDelete(ALSndPlayer *sndp);
+
+ALSndId alSndpAllocate(ALSndPlayer *sndp, ALSound *sound);
+void alSndpDeallocate(ALSndPlayer *sndp, ALSndId id);
+
+void alSndpSetSound(ALSndPlayer *sndp, ALSndId id);
+ALSndId alSndpGetSound(ALSndPlayer *sndp);
+
+void alSndpPlay(ALSndPlayer *sndp);
+void alSndpPlayAt(ALSndPlayer *sndp, ALMicroTime delta);
+void alSndpStop(ALSndPlayer *sndp);
+
+void alSndpSetVol(ALSndPlayer *sndp, s16 vol);
+void alSndpSetPitch(ALSndPlayer *sndp, f32 pitch);
+void alSndpSetPan(ALSndPlayer *sndp, ALPan pan);
+void alSndpSetPriority(ALSndPlayer *sndp, ALSndId id, u8 priority);
+
+void alSndpSetFXMix(ALSndPlayer *sndp, u8 mix);
+s32 alSndpGetState(ALSndPlayer *sndp);
+
+#ifndef _FINALROM
+void alParseAbiCL(Acmd *cmdList, u32 nbytes);
+#endif
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !__LIB_AUDIO__ */
+
+
+
diff --git a/include/2.0L/PR/mbi.h b/include/2.0L/PR/mbi.h
new file mode 100755
index 00000000..9956ef20
--- /dev/null
+++ b/include/2.0L/PR/mbi.h
@@ -0,0 +1,98 @@
+#ifndef _MBI_H_
+#define _MBI_H_
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.135 $
+ * $Date: 1997/11/26 00:30:54 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/mbi.h,v $
+ *
+ **************************************************************************/
+
+/*
+ * Header file for the Media Binary Interface
+ *
+ * NOTE: This file is included by the RSP microcode, so any C-specific
+ * constructs must be bracketed by #ifdef _LANGUAGE_C
+ *
+ */
+
+
+/*
+ * the SHIFT macros are used to build display list commands, inserting
+ * bit-fields into a 32-bit word. They take a value, a shift amount,
+ * and a width.
+ *
+ * For the left shift, the lower bits of the value are masked,
+ * then shifted left.
+ *
+ * For the right shift, the value is shifted right, then the lower bits
+ * are masked.
+ *
+ * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment)
+ *
+ */
+#define _SHIFTL(v, s, w) \
+ ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s)))
+#define _SHIFTR(v, s, w) \
+ ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))
+
+#define _SHIFT _SHIFTL /* old, for compatibility only */
+
+#define G_ON (1)
+#define G_OFF (0)
+
+/**************************************************************************
+ *
+ * Graphics Binary Interface
+ *
+ **************************************************************************/
+
+#include
+
+/**************************************************************************
+ *
+ * Audio Binary Interface
+ *
+ **************************************************************************/
+
+#include
+
+/**************************************************************************
+ *
+ * Task list
+ *
+ **************************************************************************/
+
+#define M_GFXTASK 1
+#define M_AUDTASK 2
+#define M_VIDTASK 3
+
+/**************************************************************************
+ *
+ * Segment macros and definitions
+ *
+ **************************************************************************/
+
+#define NUM_SEGMENTS (16)
+#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff)
+#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28)
+#define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* !_MBI_H_ */
diff --git a/include/2.0L/PR/n_abi.h b/include/2.0L/PR/n_abi.h
new file mode 100644
index 00000000..fc9c135c
--- /dev/null
+++ b/include/2.0L/PR/n_abi.h
@@ -0,0 +1,122 @@
+/*====================================================================
+ *
+ * Copyright 1993, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+#ifndef __N_ABI__
+#define __N_ABI__
+
+/*
+ * BEGIN C-specific section: (typedef's)
+ */
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+
+/*
+ * Macros to assemble the audio command list
+ */
+
+#define n_aADPCMdec(pkt, s, f, c, a, d) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(s, 0, 24)); \
+ _a->words.w1 = (_SHIFTL(f, 28, 4) | _SHIFTL(c, 16, 12) | \
+ _SHIFTL(a, 12, 4) | _SHIFTL(d, 0, 12)); \
+}
+
+#define n_aPoleFilter(pkt, f, g, t, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(g, 0, 16)); \
+ _a->words.w1 = (_SHIFTL(t, 24, 8) | \
+ _SHIFTL((unsigned int)(s), 0, 24)); \
+}
+
+#define n_aEnvMixer(pkt, f, t, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8) |\
+ _SHIFTL(t, 0, 16)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define n_aInterleave(pkt) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \
+}
+
+#define n_aLoadBuffer(pkt, c, d, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_LOADBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\
+ _SHIFTL(d, 0, 12)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define n_aResample(pkt, s, f, p, i, o) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(s, 0, 24));\
+ _a->words.w1 = (_SHIFTL(f, 30, 2) | _SHIFTL(p, 14, 16) | \
+ _SHIFTL(i, 2, 12) | _SHIFTL(o, 0, 2)); \
+}
+
+#define n_aSaveBuffer(pkt, c, d, s) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_SAVEBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\
+ _SHIFTL(d, 0, 12)); \
+ _a->words.w1 = (unsigned int)(s); \
+}
+
+#define n_aSetVolume(pkt, f, v, t, r) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 8) | \
+ _SHIFTL(v, 0, 16)); \
+ _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \
+}
+
+#define n_aLoadADPCM(pkt, c, d) \
+{ \
+ Acmd *_a = (Acmd *)pkt; \
+ \
+ _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \
+ _a->words.w1 = (unsigned int) d; \
+}
+
+#endif /* _LANGUAGE_C */
+
+#endif /* __N_ABI__ */
+
+
+
+
+
+
+
diff --git a/include/2.0L/PR/n_libaudio.h b/include/2.0L/PR/n_libaudio.h
new file mode 100644
index 00000000..fb3d33ee
--- /dev/null
+++ b/include/2.0L/PR/n_libaudio.h
@@ -0,0 +1,386 @@
+/*====================================================================
+ *
+ * Copyright 1993, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+#ifndef __N_LIBAUDIO__
+#define __N_LIBAUDIO__
+
+#include
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+#include
+
+
+/*
+ * Synthesis driver stuff
+ */
+typedef struct N_ALVoice_s {
+ ALLink node;
+ struct N_PVoice_s *pvoice;
+ ALWaveTable *table;
+ void *clientPrivate;
+ s16 state;
+ s16 priority;
+ s16 fxBus;
+ s16 unityPitch;
+} N_ALVoice;
+
+typedef struct N_ALAuxBus_s{
+ u8 unk0[0x48];
+}N_ALAuxBus;
+
+typedef struct N_ALParam_s {
+ struct N_ALParam_s *next;
+ s32 delta;
+ s16 type;
+ union {
+ f32 f;
+ s32 i;
+ } data;
+ union {
+ f32 f;
+ s32 i;
+ } moredata;
+ union {
+ f32 f;
+ s32 i;
+ } stillmoredata;
+ union {
+ f32 f;
+ s32 i;
+ } yetstillmoredata;
+ union {
+ f32 f;
+ s32 i;
+ } yetstillevenmoredata;
+ union {
+ f32 f;
+ s32 i;
+ } willthedataeverend;
+} N_ALParam;
+
+typedef struct {
+ ALPlayer *head; /* client list head */
+ //ALPlayer *n_seqp1; /* for fade in / fade out */
+ //ALPlayer *n_seqp2;
+ //ALPlayer *n_sndp;
+
+ ALLink pFreeList; /* list of free physical voices */
+ ALLink pAllocList; /* list of allocated physical voices */
+ ALLink pLameList; /* list of voices ready to be freed */
+ s32 paramSamples;
+ s32 curSamples; /* samples from start of game */
+ ALDMANew dma;
+ ALHeap *heap;
+ struct N_ALParam_s *paramList;
+ struct N_ALMainBus_s *mainBus;
+ struct N_ALAuxBus_s *auxBus;
+ s32 numPVoices;
+ s32 maxAuxBusses;
+ s32 outputRate;
+ s32 maxOutSamples;
+ s32 sv_dramout;
+ s32 sv_first;
+} N_ALSynth;
+
+
+void n_alSynAddPlayer(ALPlayer *client);
+void n_alSynAddSndPlayer(ALPlayer *client);
+void n_alSynAddSeqPlayer(ALPlayer *client);
+
+ALFxRef n_alSynAllocFX( s16 bus,ALSynConfig *c, ALHeap *hp);
+s32 n_alSynAllocVoice( N_ALVoice *voice, ALVoiceConfig *vc);
+
+
+void n_alSynFreeVoice(N_ALVoice *voice);
+ALFxRef n_alSynGetFXRef( s16 bus, s16 index);
+s16 n_alSynGetPriority( N_ALVoice *voice);
+void n_alSynRemovePlayer( ALPlayer *client);
+void n_alSynSetFXMix(N_ALVoice *v, u8 fxmix);
+void n_alSynSetFXParam(ALFxRef fx, s16 paramID, void *param);
+void n_alSynFreeFX(ALFxRef *fx);
+void n_alSynSetPan(N_ALVoice *v, u8 pan);
+void n_alSynSetPitch( N_ALVoice *v, f32 pitch);
+void n_alSynSetPriority( N_ALVoice *voice, s16 priority);
+void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t);
+void n_alSynStartVoice(N_ALVoice *v, ALWaveTable *table);
+void n_alSynStartVoiceParams(N_ALVoice *v, ALWaveTable *w,f32 pitch, s16 vol,
+ ALPan pan, u8 fxmix, ALMicroTime t);
+void n_alSynStopVoice( N_ALVoice *v);
+
+void n_alSynNew(ALSynConfig *c);
+void n_alSynDelete(void);
+
+
+/*
+ * Audio Library (AL) stuff
+ */
+typedef struct {
+ N_ALSynth drvr;
+} N_ALGlobals;
+
+extern N_ALGlobals *n_alGlobals;
+extern N_ALSynth *n_syn;
+
+void n_alInit(N_ALGlobals *g, ALSynConfig *c);
+void n_alClose(N_ALGlobals *glob);
+Acmd *n_alAudioFrame(Acmd *cmdList, s32 *cmdLen,
+ s16 *outBuf, s32 outLen);
+
+
+/*
+ * Sequence Player stuff
+ */
+typedef struct {
+ struct N_ALVoice_s *voice;
+} N_ALNoteEvent;
+
+
+typedef struct {
+ struct N_ALVoice_s *voice;
+ ALMicroTime delta;
+ u8 vol;
+} N_ALVolumeEvent;
+
+
+typedef struct {
+ struct N_ALVoiceState_s *vs;
+ void *oscState;
+ u8 chan;
+} N_ALOscEvent;
+
+
+typedef struct {
+ s16 type;
+ union {
+ ALMIDIEvent midi;
+ ALTempoEvent tempo;
+ ALEndEvent end;
+ N_ALNoteEvent note;
+ N_ALVolumeEvent vol;
+ ALSeqpLoopEvent loop;
+ ALSeqpVolEvent spvol;
+ ALSeqpPriorityEvent sppriority;
+ ALSeqpSeqEvent spseq;
+ ALSeqpBankEvent spbank;
+ N_ALOscEvent osc;
+ } msg;
+} N_ALEvent;
+
+
+typedef struct {
+ ALLink node;
+ ALMicroTime delta;
+ N_ALEvent evt;
+} N_ALEventListItem;
+
+void n_alEvtqNew(ALEventQueue *evtq, N_ALEventListItem *items, s32 itemCount);
+ALMicroTime n_alEvtqNextEvent(ALEventQueue *evtq, N_ALEvent *evt);
+void n_alEvtqPostEvent(ALEventQueue *evtq, N_ALEvent *evt, ALMicroTime delta, s32 foo);
+void n_alEvtqFlushType(ALEventQueue *evtq, s16 type);
+
+
+typedef struct N_ALVoiceState_s {
+ struct N_ALVoiceState_s *next;/* MUST be first */
+ N_ALVoice voice;
+ ALSound *sound;
+ ALMicroTime envEndTime; /* time of envelope segment end */
+ f32 pitch; /* currect pitch ratio */
+ f32 vibrato; /* current value of the vibrato */
+ u8 envGain; /* current envelope gain */
+ u8 channel; /* channel assignment */
+ u8 key; /* note on key number */
+ u8 velocity; /* note on velocity */
+ u8 envPhase; /* what envelope phase */
+ u8 phase;
+ u8 tremelo; /* current value of the tremelo */
+ u8 flags; /* bit 0 tremelo flag
+ bit 1 vibrato flag */
+} N_ALVoiceState;
+
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ N_ALSynth *drvr; /* reference to the client driver */
+ ALSeq *target; /* current sequence */
+ ALMicroTime curTime;
+ ALBank *bank; /* current ALBank */
+ s32 uspt; /* microseconds per tick */
+ s32 nextDelta; /* microseconds to next callback */
+ s32 state;
+ u16 chanMask; /* active channels */
+ s16 vol; /* overall sequence volume */
+ u8 maxChannels; /* number of MIDI channels */
+ u8 debugFlags; /* control which error get reported */
+ N_ALEvent nextEvent;
+ ALEventQueue evtq;
+ ALMicroTime frameTime;
+ ALChanState *chanState; /* 16 channels for MIDI */
+ N_ALVoiceState *vAllocHead; /* list head for allocated voices */
+ N_ALVoiceState *vAllocTail; /* list tail for allocated voices */
+ N_ALVoiceState *vFreeList; /* list of free voice state structs */
+ ALOscInit initOsc;
+ ALOscUpdate updateOsc;
+ ALOscStop stopOsc;
+ ALSeqMarker *loopStart;
+ ALSeqMarker *loopEnd;
+ s32 loopCount; /* -1 = loop forever, 0 = no loop */
+} N_ALSeqPlayer;
+
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ N_ALSynth *drvr; /* reference to the client driver */
+ ALCSeq *target; /* current sequence */
+ ALMicroTime curTime;
+ ALBank *bank; /* current ALBank */
+ s32 uspt; /* microseconds per tick */
+ s32 nextDelta; /* microseconds to next callback */
+ s32 state;
+ u16 chanMask; /* active channels */
+ s16 vol; /* overall sequence volume */
+ u8 maxChannels; /* number of MIDI channels */
+ u8 debugFlags; /* control which error get reported */
+ N_ALEvent nextEvent;
+ ALEventQueue evtq;
+ ALMicroTime frameTime;
+ ALChanState *chanState; /* 16 channels for MIDI */
+ N_ALVoiceState *vAllocHead; /* list head for allocated voices */
+ N_ALVoiceState *vAllocTail; /* list tail for allocated voices */
+ N_ALVoiceState *vFreeList; /* list of free voice state structs */
+ ALOscInit initOsc;
+ ALOscUpdate updateOsc;
+ ALOscStop stopOsc;
+} N_ALCSPlayer;
+
+
+/*
+ * Sequence data representation routines
+ */
+void n_alSeqNextEvent(ALSeq *seq, N_ALEvent *event);
+void n_alSeqNewMarker(ALSeq *seq, ALSeqMarker *m, u32 ticks);
+
+void n_alCSeqNew(ALCSeq *seq, u8 *ptr);
+void n_alCSeqNextEvent(ALCSeq *seq, N_ALEvent *evt);
+void n_alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks);
+
+
+/*
+ * Sequence Player routines
+ */
+void n_alSeqpNew(N_ALSeqPlayer *seqp, ALSeqpConfig *config);
+void n_alSeqpDelete(N_ALSeqPlayer *seqp);
+u8 n_alSeqpGetChlVol(N_ALSeqPlayer *seqp, u8 chan);
+u8 n_alSeqpGetChlFXMix(N_ALSeqPlayer *seqp, u8 chan);
+ALPan n_alSeqpGetChlPan(N_ALSeqPlayer *seqp, u8 chan);
+u8 n_alSeqpGetChlPriority(N_ALSeqPlayer *seqp, u8 chan);
+s32 n_alSeqpGetChlProgram(N_ALSeqPlayer *seqp, u8 chan);
+ALSeq *n_alSeqpGetSeq(N_ALSeqPlayer *seqp);
+s32 n_alSeqpGetState(N_ALSeqPlayer *seqp);
+s32 n_alSeqpGetTempo(N_ALSeqPlayer *seqp);
+s16 n_alSeqpGetVol(N_ALSeqPlayer *seqp); /* Master volume control */
+void n_alSeqpPlay(N_ALSeqPlayer *seqp);
+void n_alSeqpSendMidi(N_ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2);
+void n_alSeqpSetBank(N_ALSeqPlayer *seqp, ALBank *b);
+void n_alSeqpSetChlVol(N_ALSeqPlayer *seqp, u8 chan, u8 vol);
+void n_alSeqpSetChlFXMix(N_ALSeqPlayer *seqp, u8 chan, u8 fxmix);
+void n_alSeqpSetChlPan(N_ALSeqPlayer *seqp, u8 chan, ALPan pan);
+void n_alSeqpSetChlPriority(N_ALSeqPlayer *seqp, u8 chan, u8 priority);
+void n_alSeqpSetChlProgram(N_ALSeqPlayer *seqp, u8 chan, u8 prog);
+void n_alSeqpSetSeq(N_ALSeqPlayer *seqp, ALSeq *seq);
+void n_alSeqpSetTempo(N_ALSeqPlayer *seqp, s32 tempo);
+void n_alSeqpSetVol(N_ALSeqPlayer *seqp, s16 vol);
+void n_alSeqpStop(N_ALSeqPlayer *seqp);
+void n_alSeqpLoop(N_ALSeqPlayer *seqp, ALSeqMarker *start, ALSeqMarker *end, s32 count);
+
+
+/*
+ * Compressed Sequence Player routines
+ */
+void n_alCSPNew(N_ALCSPlayer *seqp, ALSeqpConfig *config);
+void n_alCSPDelete(N_ALCSPlayer *seqp);
+u8 n_alCSPGetChlVol(N_ALCSPlayer *seqp, u8 chan);
+u8 n_alCSPGetChlFXMix(N_ALCSPlayer *seqp, u8 chan);
+ALPan n_alCSPGetChlPan(N_ALCSPlayer *seqp, u8 chan);
+u8 n_alCSPGetChlPriority(N_ALCSPlayer *seqp, u8 chan);
+s32 n_alCSPGetChlProgram(N_ALCSPlayer *seqp, u8 chan);
+ALCSeq *n_alCSPGetSeq(N_ALCSPlayer *seqp);
+s32 n_alCSPGetState(N_ALCSPlayer *seqp);
+s32 n_alCSPGetTempo(N_ALCSPlayer *seqp);
+s16 n_alCSPGetVol(N_ALCSPlayer *seqp);
+void n_alCSPPlay(N_ALCSPlayer *seqp);
+void n_alCSPSendMidi(N_ALCSPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2);
+void n_alCSPSetBank(N_ALCSPlayer *seqp, ALBank *b);
+void n_alCSPSetChlVol(N_ALCSPlayer *seqp, u8 chan, u8 vol);
+void n_alCSPSetChlFXMix(N_ALCSPlayer *seqp, u8 chan, u8 fxmix);
+void n_alCSPSetChlPan(N_ALCSPlayer *seqp, u8 chan, ALPan pan);
+void n_alCSPSetChlPriority(N_ALCSPlayer *seqp, u8 chan, u8 priority);
+void n_alCSPSetChlProgram(N_ALCSPlayer *seqp, u8 chan, u8 prog);
+void n_alCSPSetSeq(N_ALCSPlayer *seqp, ALCSeq *seq);
+void n_(N_ALCSPlayer *seqp, s32 tempo);
+void n_alCSPSetVol(N_ALCSPlayer *seqp, s16 vol);
+void n_alCSPStop(N_ALCSPlayer *seqp);
+
+
+/*
+ * Sound Player stuff
+ */
+typedef struct {
+ ALPlayer node; /* note: must be first in structure */
+ ALEventQueue evtq;
+ N_ALEvent nextEvent;
+ N_ALSynth *drvr; /* reference to the client driver */
+ s32 target;
+ void *sndState;
+ s32 maxSounds;
+ ALMicroTime frameTime;
+ ALMicroTime nextDelta; /* microseconds to next callback */
+ ALMicroTime curTime;
+} N_ALSndPlayer;
+
+void n_alSndpNew(N_ALSndPlayer *sndp, ALSndpConfig *c);
+void n_alSndpDelete(void);
+ALSndId n_alSndpAllocate(ALSound *sound);
+void n_alSndpDeallocate(ALSndId id);
+s32 n_alSndpGetState(void);
+void n_alSndpPlay(void);
+void n_alSndpPlayAt(ALMicroTime delta);
+void n_alSndpSetFXMix(u8 mix);
+void n_alSndpSetPan(ALPan pan);
+void n_alSndpSetPitch(f32 pitch);
+void n_alSndpSetPriority(ALSndId id, u8 priority);
+void n_alSndpSetVol(s16 vol);
+void n_alSndpStop(void);
+ALSndId n_alSndpGetSound(void);
+void n_alSndpSetSound(ALSndId id);
+
+
+/*
+ * for n_audio micro code
+ */
+extern long long int n_aspMainTextStart[], n_aspMainTextEnd[];
+extern long long int n_aspMainDataStart[], n_aspMainDataEnd[];
+
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* __N_LIBAUDIO__ */
diff --git a/include/2.0L/PR/n_libaudio_s_to_n.h b/include/2.0L/PR/n_libaudio_s_to_n.h
new file mode 100644
index 00000000..5726c771
--- /dev/null
+++ b/include/2.0L/PR/n_libaudio_s_to_n.h
@@ -0,0 +1,120 @@
+#define ALVoice N_ALVoice
+#define ALSynth N_ALSynth
+#define ALGlobals n_alGlobals
+
+#define n_alSynAddPlayer( a, b) n_alSynAddPlayer( b)
+#define alSynAllocFX( a, b, c, d) n_alSynAllocFX( b, c, d)
+#define alSynAllocVoice( a, b, c) n_alSynAllocVoice( b, c)
+#define alSynDelete( a) n_alSynDelete()
+#define alSynFreeVoice( a, b) n_alSynFreeVoice( b)
+#define alSynGetFXRef( a, b, c) n_alSynGetFXRef( b, c)
+#define alSynGetPriority( a, b) n_alSynGetPriority( b)
+#define alSynRemovePlayer( a, b) n_alSynRemovePlayer( b)
+#define alSynSetFXMix( a, b, c) n_alSynSetFXMix( b, c)
+#define alSynSetFXParam( a, b, c, d) n_alSynSetFXParam( b, c, d)
+#define alSynFreeFX( a, b) n_alSynFreeFX( b)
+#define alSynSetPan( a, b, c) n_alSynSetPan( b, c)
+#define alSynSetPitch( a, b, c) n_alSynSetPitch( b, c)
+#define alSynSetPriority( a, b, c) n_alSynSetPriority( b, c)
+#define alSynSetVol( a, b, c, d) n_alSynSetVol( b, c, d)
+#define alSynStartVoice( a, b, c) n_alSynStartVoice( b, c)
+#define n_alSynStartVoiceParams( a, b, c, d, e, f, g, h) \
+ n_n_alSynStartVoiceParams( b, c, d, e, f, g, h)
+#define alSynStopVoice( a, b) n_alSynStopVoice( b)
+#define alSynNew( a, b) n_alSynNew( b)
+
+#define alInit n_alInit
+#define alClose n_alClose
+#define alAudioFrame n_alAudioFrame
+
+#define ALVoiceState N_ALVoiceState
+#define ALSeqPlayer N_ALSeqPlayer
+#define ALCSPlayer N_ALCSPlayer
+
+#define alSeqNextEvent n_alSeqNextEvent
+#define alSeqNewMarker n_alSeqNewMarker
+
+#define alCSeqNew n_alCSeqNew
+#define alCSeqNextEvent n_alCSeqNextEvent
+#define alCSeqNewMarker n_alCSeqNewMarker
+
+#define alSeqpNew n_alSeqpNew
+#define alSeqpDelete n_alSeqpDelete
+#define alSeqpGetChlVol n_alSeqpGetChlVol
+#define alSeqpGetChlFXMix n_alSeqpGetChlFXMix
+#define alSeqpGetChlPan n_alSeqpGetChlPan
+#define alSeqpGetChlPriority n_alSeqpGetChlPriority
+#define alSeqpGetChlProgram n_alSeqpGetChlProgram
+#define alSeqpGetSeq n_alSeqpGetSeq
+#define alSeqpGetState n_alSeqpGetState
+#define alSeqpGetTempo n_alSeqpGetTempo
+#define alSeqpGetVol n_alSeqpGetVol
+#define alSeqpPlay n_alSeqpPlay
+#define alSeqpSendMidi n_alSeqpSendMidi
+#define alSeqpSetBank n_alSeqpSetBank
+#define alSeqpSetChlVol n_alSeqpSetChlVol
+#define alSeqpSetChlFXMix n_alSeqpSetChlFXMix
+#define alSeqpSetChlPan n_alSeqpSetChlPan
+#define alSeqpSetChlPriority n_alSeqpSetChlPriority
+#define alSeqpSetChlProgram n_alSeqpSetChlProgram
+#define alSeqpSetSeq n_alSeqpSetSeq
+#define alSeqpSetTempo n_alSeqpSetTempo
+#define alSeqpSetVol n_alSeqpSetVol
+#define alSeqpStop n_alSeqpStop
+#define alSeqpLoop n_alSeqpLoop
+
+#define alCSPNew n_alCSPNew
+#define alCSPDelete n_alCSPDelete
+#define alCSPGetChlVol n_alCSPGetChlVol
+#define alCSPGetChlFXMix n_alCSPGetChlFXMix
+#define alCSPGetChlPan n_alCSPGetChlPan
+#define alCSPGetChlPriority n_alCSPGetChlPriority
+#define alCSPGetChlProgram n_alCSPGetChlProgram
+#define alCSPGetSeq n_alCSPGetSeq
+#define alCSPGetState n_alCSPGetState
+#define alCSPGetTempo n_alCSPGetTempo
+#define alCSPGetVol n_alCSPGetVol
+#define alCSPPlay n_alCSPPlay
+#define alCSPSendMidi n_alCSPSendMidi
+#define alCSPSetBank n_alCSPSetBank
+#define alCSPSetChlVol n_alCSPSetChlVol
+#define alCSPSetChlFXMix n_alCSPSetChlFXMix
+#define alCSPSetChlPan n_alCSPSetChlPan
+#define alCSPSetChlPriority n_alCSPSetChlPriority
+#define alCSPSetChlProgram n_alCSPSetChlProgram
+#define alCSPSetSeq n_alCSPSetSeq
+#define n_
+#define alCSPSetVol n_alCSPSetVol
+#define alCSPStop n_alCSPStop
+
+#define ALSoundState N_ALSoundState
+#define ALSndpEvent N_ALSndpEvent
+#define ALSndPlayer N_ALSndPlayer
+
+#define alSndpNew( a, b) n_alSndpNew( a, b)
+#define alSndpDelete( a) n_alSndpDelete()
+#define alSndpAllocate( a, b) n_alSndpAllocate( b)
+#define alSndpDeallocate( a, b) n_alSndpDeallocate( b)
+#define alSndpGetState( a) n_alSndpGetState()
+#define alSndpPlay( a) n_alSndpPlay()
+#define alSndpPlayAt( a, b) n_alSndpPlayAt( b)
+#define alSndpSetFXMix( a, b) n_alSndpSetFXMix( b)
+#define alSndpSetPan( a, b) n_alSndpSetPan( b)
+#define alSndpSetPitch( a, b) n_alSndpSetPitch( b)
+#define alSndpSetPriority( a, b, c) n_alSndpSetPriority( b, c)
+#define alSndpSetVol( a, b) n_alSndpSetVol( b)
+#define alSndpStop( a) n_alSndpStop()
+#define alSndpGetSound( a) n_alSndpGetSound()
+#define alSndpSetSound( a, b) n_alSndpSetSound( b)
+
+#define alEvtqNew n_alEvtqNew
+#define alEvtqNextEvent n_alEvtqNextEvent
+#define alEvtqPostEvent n_alEvtqPostEvent
+#define alEvtqFlushType n_alEvtqFlushType
+#define alEvtqPrintEvtQueue n_alEvtqPrintEvtQueue
+#define alEvtqPrintAllocEvts n_alEvtqPrintAllocEvts
+
+
+
+
+
diff --git a/include/2.0L/PR/os.h b/include/2.0L/PR/os.h
new file mode 100755
index 00000000..353b5b2e
--- /dev/null
+++ b/include/2.0L/PR/os.h
@@ -0,0 +1,1000 @@
+
+/*====================================================================
+ * os.h
+ *
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * $Revision: 1.149 $
+ * $Date: 1997/12/15 04:30:52 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/os.h,v $
+ *
+ **************************************************************************/
+
+
+#ifndef _OS_H_
+#define _OS_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/**************************************************************************
+ *
+ * Type definitions
+ *
+ */
+
+typedef s32 OSPri;
+typedef s32 OSId;
+typedef union { struct { f32 f_odd; f32 f_even; } f; f64 d; } __OSfp;
+
+typedef struct {
+ u64 at, v0, v1, a0, a1, a2, a3;
+ u64 t0, t1, t2, t3, t4, t5, t6, t7;
+ u64 s0, s1, s2, s3, s4, s5, s6, s7;
+ u64 t8, t9, gp, sp, s8, ra;
+ u64 lo, hi;
+ u32 sr, pc, cause, badvaddr, rcp;
+ u32 fpcsr;
+ __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14;
+ __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30;
+} __OSThreadContext;
+
+typedef struct OSThread_s {
+ struct OSThread_s *next; /* run/mesg queue link */
+ OSPri priority; /* run/mesg queue priority */
+ struct OSThread_s **queue; /* queue thread is on */
+ struct OSThread_s *tlnext; /* all threads queue link */
+ u16 state; /* OS_STATE_* */
+ u16 flags; /* flags for rmon */
+ OSId id; /* id for debugging */
+ int fp; /* thread has used fp unit */
+ __OSThreadContext context; /* register/interrupt mask */
+} OSThread;
+
+typedef u32 OSEvent;
+typedef u32 OSIntMask;
+typedef u32 OSPageMask;
+typedef u32 OSHWIntr;
+
+/*
+ * Structure for message
+ */
+typedef void * OSMesg;
+
+/*
+ * Structure for message queue
+ */
+typedef struct OSMesgQueue_s {
+ OSThread *mtqueue; /* Queue to store threads blocked
+ on empty mailboxes (receive) */
+ OSThread *fullqueue; /* Queue to store threads blocked
+ on full mailboxes (send) */
+ s32 validCount; /* Contains number of valid message */
+ s32 first; /* Points to first valid message */
+ s32 msgCount; /* Contains total # of messages */
+ OSMesg *msg; /* Points to message buffer array */
+} OSMesgQueue;
+
+/*
+ * Structure for Enhanced PI interface
+ */
+
+/*
+ * OSTranxInfo is set up for Leo Disk DMA. This info will be maintained
+ * by exception handler. This is how the PIMGR and the ISR communicate.
+ */
+
+typedef struct {
+ u32 errStatus; /* error status */
+ void *dramAddr; /* RDRAM buffer address (DMA) */
+ void *C2Addr; /* C2 buffer address */
+ u32 sectorSize; /* size of transfering sector */
+ u32 C1ErrNum; /* total # of C1 errors */
+ u32 C1ErrSector[4]; /* error sectors */
+} __OSBlockInfo;
+
+typedef struct {
+ u32 cmdType; /* for disk only */
+ u16 transferMode; /* Block, Track, or sector? */
+ u16 blockNum; /* which block is transfering */
+ s32 sectorNum; /* which sector is transfering */
+ u32 devAddr; /* Device buffer address */
+ u32 bmCtlShadow; /* asic bm_ctl(510) register shadow ram */
+ u32 seqCtlShadow; /* asic seq_ctl(518) register shadow ram */
+ __OSBlockInfo block[2]; /* bolck transfer info */
+} __OSTranxInfo;
+
+
+typedef struct OSPiHandle_s {
+ struct OSPiHandle_s *next; /* point to next handle on the table */
+ u8 type; /* DEVICE_TYPE_BULK for disk */
+ u8 latency; /* domain latency */
+ u8 pageSize; /* domain page size */
+ u8 relDuration; /* domain release duration */
+ u8 pulse; /* domain pulse width */
+ u8 domain; /* which domain */
+ u32 baseAddress; /* Domain address */
+ u32 speed; /* for roms only */
+ /* The following are "private" elements" */
+ __OSTranxInfo transferInfo; /* for disk only */
+} OSPiHandle;
+
+typedef struct {
+ u8 type;
+ u32 address;
+} OSPiInfo;
+
+/*
+ * Structure for I/O message block
+ */
+typedef struct {
+ u16 type; /* Message type */
+ u8 pri; /* Message priority (High or Normal) */
+ u8 status; /* Return status */
+ OSMesgQueue *retQueue; /* Return message queue to notify I/O
+ * completion */
+} OSIoMesgHdr;
+
+typedef struct {
+ OSIoMesgHdr hdr; /* Message header */
+ void * dramAddr; /* RDRAM buffer address (DMA) */
+ u32 devAddr; /* Device buffer address (DMA) */
+ u32 size; /* DMA transfer size in bytes */
+ OSPiHandle *piHandle; /* PI device handle */
+} OSIoMesg;
+
+/*
+ * Structure for device manager block
+ */
+typedef struct {
+ s32 active; /* Status flag */
+ OSThread *thread; /* Calling thread */
+ OSMesgQueue *cmdQueue; /* Command queue */
+ OSMesgQueue *evtQueue; /* Event queue */
+ OSMesgQueue *acsQueue; /* Access queue */
+ /* Raw DMA routine */
+ s32 (*dma)(s32, u32, void *, u32);
+ s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
+} OSDevMgr;
+
+
+/*
+ * Structure to store VI register values that remain the same between 2 fields
+ */
+typedef struct {
+ u32 ctrl;
+ u32 width;
+ u32 burst;
+ u32 vSync;
+ u32 hSync;
+ u32 leap;
+ u32 hStart;
+ u32 xScale;
+ u32 vCurrent;
+} OSViCommonRegs;
+
+
+/*
+ * Structure to store VI register values that change between fields
+ */
+typedef struct {
+ u32 origin;
+ u32 yScale;
+ u32 vStart;
+ u32 vBurst;
+ u32 vIntr;
+} OSViFieldRegs;
+
+
+/*
+ * Structure for VI mode
+ */
+typedef struct {
+ u8 type; /* Mode type */
+ OSViCommonRegs comRegs; /* Common registers for both fields */
+ OSViFieldRegs fldRegs[2]; /* Registers for Field 1 & 2 */
+} OSViMode;
+
+/*
+ * Structure for time value
+ */
+typedef u64 OSTime;
+
+/*
+ * Structure for interval timer
+ */
+typedef struct OSTimer_s {
+ struct OSTimer_s *next; /* point to next timer in list */
+ struct OSTimer_s *prev; /* point to previous timer in list */
+ OSTime interval; /* duration set by user */
+ OSTime value; /* time remaining before */
+ /* timer fires */
+ OSMesgQueue *mq; /* Message Queue */
+ OSMesg msg; /* Message to send */
+} OSTimer;
+
+/*
+ * Structure for controllers
+ */
+
+typedef struct {
+ u16 type; /* Controller Type */
+ u8 status; /* Controller status */
+ u8 errno;
+}OSContStatus;
+
+typedef struct {
+ u16 button;
+ s8 stick_x; /* -80 <= stick_x <= 80 */
+ s8 stick_y; /* -80 <= stick_y <= 80 */
+ u8 errno;
+} OSContPad;
+
+typedef struct {
+ void *address; /* Ram pad Address: 11 bits */
+ u8 databuffer[32]; /* address of the data buffer */
+ u8 addressCrc; /* CRC code for address */
+ u8 dataCrc; /* CRC code for data */
+ u8 errno;
+} OSContRamIo;
+
+/*
+ * Structure for file system
+ */
+
+
+
+typedef struct {
+ int status;
+ OSMesgQueue *queue;
+ int channel;
+ u8 id[32];
+ u8 label[32];
+ int version;
+ int dir_size;
+ int inode_table; /* block location */
+ int minode_table; /* mirrioring inode_table */
+ int dir_table; /* block location */
+ int inode_start_page; /* page # */
+ u8 banks;
+ u8 activebank;
+} OSPfs;
+
+
+typedef struct {
+ u32 file_size; /* bytes */
+ u32 game_code;
+ u16 company_code;
+ char ext_name[4];
+ char game_name[16];
+} OSPfsState;
+
+/*
+ * Structure for Profiler
+ */
+typedef struct {
+ u16 *histo_base; /* histogram base */
+ u32 histo_size; /* histogram size */
+ u32 *text_start; /* start of text segment */
+ u32 *text_end; /* end of text segment */
+} OSProf;
+
+#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
+
+/**************************************************************************
+ *
+ * Global definitions
+ *
+ */
+
+/* Thread states */
+
+#define OS_STATE_STOPPED 1
+#define OS_STATE_RUNNABLE 2
+#define OS_STATE_RUNNING 4
+#define OS_STATE_WAITING 8
+
+/* Events */
+#ifdef _FINALROM
+#define OS_NUM_EVENTS 15
+#else
+#define OS_NUM_EVENTS 23
+#endif
+
+#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */
+#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */
+#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */
+#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */
+#define OS_EVENT_SP 4 /* SP task done interrupt */
+#define OS_EVENT_SI 5 /* SI (controller) interrupt */
+#define OS_EVENT_AI 6 /* AI interrupt */
+#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */
+#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */
+#define OS_EVENT_DP 9 /* DP full sync interrupt */
+#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */
+#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */
+#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */
+#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */
+#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */
+#ifndef _FINALROM
+#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */
+#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */
+#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */
+#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */
+#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */
+#define OS_EVENT_RDB_DBG_DONE 20
+#define OS_EVENT_RDB_FLUSH_PROF 21
+#define OS_EVENT_RDB_ACK_PROF 22
+#endif
+
+/* Flags for debugging purpose */
+
+#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */
+#define OS_FLAG_FAULT 2 /* CPU fault has occurred */
+
+/* Interrupt masks */
+
+#define OS_IM_NONE 0x00000001
+#define OS_IM_SW1 0x00000501
+#define OS_IM_SW2 0x00000601
+#define OS_IM_CART 0x00000c01
+#define OS_IM_PRENMI 0x00001401
+#define OS_IM_RDBWRITE 0x00002401
+#define OS_IM_RDBREAD 0x00004401
+#define OS_IM_COUNTER 0x00008401
+#define OS_IM_CPU 0x0000ff01
+#define OS_IM_SP 0x00010401
+#define OS_IM_SI 0x00020401
+#define OS_IM_AI 0x00040401
+#define OS_IM_VI 0x00080401
+#define OS_IM_PI 0x00100401
+#define OS_IM_DP 0x00200401
+#define OS_IM_ALL 0x003fff01
+#define RCP_IMASK 0x003f0000
+#define RCP_IMASKSHIFT 16
+
+/* Recommended thread priorities for the system threads */
+
+#define OS_PRIORITY_MAX 255
+#define OS_PRIORITY_VIMGR 254
+#define OS_PRIORITY_RMON 250
+#define OS_PRIORITY_RMONSPIN 200
+#define OS_PRIORITY_PIMGR 150
+#define OS_PRIORITY_SIMGR 140
+#define OS_PRIORITY_APPMAX 127
+#define OS_PRIORITY_IDLE 0 /* Must be 0 */
+
+
+/* Flags to turn blocking on/off when sending/receiving message */
+
+#define OS_MESG_NOBLOCK 0
+#define OS_MESG_BLOCK 1
+
+/* Flags to indicate direction of data transfer */
+
+#define OS_READ 0 /* device -> RDRAM */
+#define OS_WRITE 1 /* device <- RDRAM */
+#define OS_OTHERS 2 /* for Leo disk only */
+
+/*
+ * I/O message types
+ */
+#define OS_MESG_TYPE_BASE (10)
+#define OS_MESG_TYPE_LOOPBACK (OS_MESG_TYPE_BASE+0)
+#define OS_MESG_TYPE_DMAREAD (OS_MESG_TYPE_BASE+1)
+#define OS_MESG_TYPE_DMAWRITE (OS_MESG_TYPE_BASE+2)
+#define OS_MESG_TYPE_VRETRACE (OS_MESG_TYPE_BASE+3)
+#define OS_MESG_TYPE_COUNTER (OS_MESG_TYPE_BASE+4)
+#define OS_MESG_TYPE_EDMAREAD (OS_MESG_TYPE_BASE+5)
+#define OS_MESG_TYPE_EDMAWRITE (OS_MESG_TYPE_BASE+6)
+
+/*
+ * I/O message priority
+ */
+#define OS_MESG_PRI_NORMAL 0
+#define OS_MESG_PRI_HIGH 1
+
+/*
+ * Page size argument for TLB routines
+ */
+#define OS_PM_4K 0x0000000
+#define OS_PM_16K 0x0006000
+#define OS_PM_64K 0x001e000
+#define OS_PM_256K 0x007e000
+#define OS_PM_1M 0x01fe000
+#define OS_PM_4M 0x07fe000
+#define OS_PM_16M 0x1ffe000
+
+/*
+ * Stack size for I/O device managers: PIM (PI Manager), VIM (VI Manager),
+ * SIM (SI Manager)
+ *
+ */
+#define OS_PIM_STACKSIZE 4096
+#define OS_VIM_STACKSIZE 4096
+#define OS_SIM_STACKSIZE 4096
+
+#define OS_MIN_STACKSIZE 72
+
+/*
+ * Values for osTvType
+ */
+#define OS_TV_PAL 0
+#define OS_TV_NTSC 1
+#define OS_TV_MPAL 2
+
+/*
+ * Video Interface (VI) mode type
+ */
+#define OS_VI_NTSC_LPN1 0 /* NTSC */
+#define OS_VI_NTSC_LPF1 1
+#define OS_VI_NTSC_LAN1 2
+#define OS_VI_NTSC_LAF1 3
+#define OS_VI_NTSC_LPN2 4
+#define OS_VI_NTSC_LPF2 5
+#define OS_VI_NTSC_LAN2 6
+#define OS_VI_NTSC_LAF2 7
+#define OS_VI_NTSC_HPN1 8
+#define OS_VI_NTSC_HPF1 9
+#define OS_VI_NTSC_HAN1 10
+#define OS_VI_NTSC_HAF1 11
+#define OS_VI_NTSC_HPN2 12
+#define OS_VI_NTSC_HPF2 13
+
+#define OS_VI_PAL_LPN1 14 /* PAL */
+#define OS_VI_PAL_LPF1 15
+#define OS_VI_PAL_LAN1 16
+#define OS_VI_PAL_LAF1 17
+#define OS_VI_PAL_LPN2 18
+#define OS_VI_PAL_LPF2 19
+#define OS_VI_PAL_LAN2 20
+#define OS_VI_PAL_LAF2 21
+#define OS_VI_PAL_HPN1 22
+#define OS_VI_PAL_HPF1 23
+#define OS_VI_PAL_HAN1 24
+#define OS_VI_PAL_HAF1 25
+#define OS_VI_PAL_HPN2 26
+#define OS_VI_PAL_HPF2 27
+
+#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */
+#define OS_VI_MPAL_LPF1 29
+#define OS_VI_MPAL_LAN1 30
+#define OS_VI_MPAL_LAF1 31
+#define OS_VI_MPAL_LPN2 32
+#define OS_VI_MPAL_LPF2 33
+#define OS_VI_MPAL_LAN2 34
+#define OS_VI_MPAL_LAF2 35
+#define OS_VI_MPAL_HPN1 36
+#define OS_VI_MPAL_HPF1 37
+#define OS_VI_MPAL_HAN1 38
+#define OS_VI_MPAL_HAF1 39
+#define OS_VI_MPAL_HPN2 40
+#define OS_VI_MPAL_HPF2 41
+
+/*
+ * Video Interface (VI) special features
+ */
+#define OS_VI_GAMMA_ON 0x0001
+#define OS_VI_GAMMA_OFF 0x0002
+#define OS_VI_GAMMA_DITHER_ON 0x0004
+#define OS_VI_GAMMA_DITHER_OFF 0x0008
+#define OS_VI_DIVOT_ON 0x0010
+#define OS_VI_DIVOT_OFF 0x0020
+#define OS_VI_DITHER_FILTER_ON 0x0040
+#define OS_VI_DITHER_FILTER_OFF 0x0080
+
+/*
+ * Video Interface (VI) mode attribute bit
+ */
+#define OS_VI_BIT_NONINTERLACE 0x0001 /* lo-res */
+#define OS_VI_BIT_INTERLACE 0x0002 /* lo-res */
+#define OS_VI_BIT_NORMALINTERLACE 0x0004 /* hi-res */
+#define OS_VI_BIT_DEFLICKINTERLACE 0x0008 /* hi-res */
+#define OS_VI_BIT_ANTIALIAS 0x0010
+#define OS_VI_BIT_POINTSAMPLE 0x0020
+#define OS_VI_BIT_16PIXEL 0x0040
+#define OS_VI_BIT_32PIXEL 0x0080
+#define OS_VI_BIT_LORES 0x0100
+#define OS_VI_BIT_HIRES 0x0200
+#define OS_VI_BIT_NTSC 0x0400
+#define OS_VI_BIT_PAL 0x0800
+
+/*
+ * Leo Disk
+ */
+
+/* transfer mode */
+
+#define LEO_BLOCK_MODE 1
+#define LEO_TRACK_MODE 2
+#define LEO_SECTOR_MODE 3
+
+/*
+ * Controllers number
+ */
+
+#ifndef _HW_VERSION_1
+#define MAXCONTROLLERS 4
+#else
+#define MAXCONTROLLERS 6
+#endif
+
+/* controller errors */
+#define CONT_NO_RESPONSE_ERROR 0x8
+#define CONT_OVERRUN_ERROR 0x4
+#ifdef _HW_VERSION_1
+#define CONT_FRAME_ERROR 0x2
+#define CONT_COLLISION_ERROR 0x1
+#endif
+
+/* Controller type */
+
+#define CONT_ABSOLUTE 0x0001
+#define CONT_RELATIVE 0x0002
+#define CONT_JOYPORT 0x0004
+#define CONT_EEPROM 0x8000
+#define CONT_EEP16K 0x4000
+#define CONT_TYPE_MASK 0x1f07
+#define CONT_TYPE_NORMAL 0x0005
+#define CONT_TYPE_MOUSE 0x0002
+
+/* Controller status */
+
+#define CONT_CARD_ON 0x01
+#define CONT_CARD_PULL 0x02
+#define CONT_ADDR_CRC_ER 0x04
+#define CONT_EEPROM_BUSY 0x80
+
+/* EEPROM TYPE */
+
+#define EEPROM_TYPE_4K 0x01
+#define EEPROM_TYPE_16K 0x02
+
+/* Buttons */
+
+#define CONT_A 0x8000
+#define CONT_B 0x4000
+#define CONT_G 0x2000
+#define CONT_START 0x1000
+#define CONT_UP 0x0800
+#define CONT_DOWN 0x0400
+#define CONT_LEFT 0x0200
+#define CONT_RIGHT 0x0100
+#define CONT_L 0x0020
+#define CONT_R 0x0010
+#define CONT_E 0x0008
+#define CONT_D 0x0004
+#define CONT_C 0x0002
+#define CONT_F 0x0001
+
+/* Nintendo's official button names */
+
+#define A_BUTTON CONT_A
+#define B_BUTTON CONT_B
+#define L_TRIG CONT_L
+#define R_TRIG CONT_R
+#define Z_TRIG CONT_G
+#define START_BUTTON CONT_START
+#define U_JPAD CONT_UP
+#define L_JPAD CONT_LEFT
+#define R_JPAD CONT_RIGHT
+#define D_JPAD CONT_DOWN
+#define U_CBUTTONS CONT_E
+#define L_CBUTTONS CONT_C
+#define R_CBUTTONS CONT_F
+#define D_CBUTTONS CONT_D
+
+/* File System size */
+#define OS_PFS_VERSION 0x0200
+#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8)
+#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255)
+
+#define PFS_FILE_NAME_LEN 16
+#define PFS_FILE_EXT_LEN 4
+#define BLOCKSIZE 32 /* bytes */
+#define PFS_ONE_PAGE 8 /* blocks */
+#define PFS_MAX_BANKS 62
+
+/* File System flag */
+
+#define PFS_READ 0
+#define PFS_WRITE 1
+#define PFS_CREATE 2
+
+/* File System status */
+#define PFS_INITIALIZED 0x1
+#define PFS_CORRUPTED 0x2 /* File system was corrupted */
+
+/* File System error number */
+
+#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */
+#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a */
+ /* different one */
+#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker */
+#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR
+#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/
+#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/
+#define PFS_DATA_FULL 7 /* no free pages on ram pack */
+#define PFS_DIR_FULL 8 /* no free directories on ram pack*/
+#define PFS_ERR_EXIST 9 /* file exists */
+#define PFS_ERR_ID_FATAL 10 /* dead ram pack */
+#define PFS_ERR_DEVICE 11 /* wrong device type*/
+
+/* definition for EEPROM */
+
+#define EEPROM_MAXBLOCKS 64
+#define EEP16K_MAXBLOCKS 256
+#define EEPROM_BLOCK_SIZE 8
+
+/*
+ * PI/EPI
+ */
+#define PI_DOMAIN1 0
+#define PI_DOMAIN2 1
+
+/*
+ * Profiler constants
+ */
+#define PROF_MIN_INTERVAL 50 /* microseconds */
+
+/*
+ * Boot addresses
+ */
+#define BOOT_ADDRESS_ULTRA 0x80000400
+#define BOOT_ADDRESS_COSIM 0x80002000
+#define BOOT_ADDRESS_EMU 0x20010000
+#define BOOT_ADDRESS_INDY 0x88100000
+
+/*
+ * Size of buffer the retains contents after NMI
+ */
+#define OS_APP_NMI_BUFSIZE 64
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/**************************************************************************
+ *
+ * Macro definitions
+ *
+ */
+
+/* PARTNER-N64 */
+#ifdef PTN64
+#define osReadHost osReadHost_pt
+#define osWriteHost osWriteHost_pt
+#endif
+
+/* Get count of valid messages in queue */
+#define MQ_GET_COUNT(mq) ((mq)->validCount)
+
+/* Figure out if message queue is empty or full */
+#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0)
+#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount)
+
+/*
+ * CPU counter increments at 3/4 of bus clock rate:
+ *
+ * Bus Clock Proc Clock Counter (1/2 Proc Clock)
+ * --------- ---------- ------------------------
+ * 62.5 Mhz 93.75 Mhz 46.875 Mhz
+ */
+extern u64 osClockRate;
+
+#define OS_CLOCK_RATE 62500000LL
+#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
+#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
+#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
+#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
+#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
+
+/**************************************************************************
+ *
+ * Extern variables
+ *
+ */
+extern OSViMode osViModeTable[]; /* Global VI mode table */
+
+extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */
+extern OSViMode osViModeNtscLpf1;
+extern OSViMode osViModeNtscLan1;
+extern OSViMode osViModeNtscLaf1;
+extern OSViMode osViModeNtscLpn2;
+extern OSViMode osViModeNtscLpf2;
+extern OSViMode osViModeNtscLan2;
+extern OSViMode osViModeNtscLaf2;
+extern OSViMode osViModeNtscHpn1;
+extern OSViMode osViModeNtscHpf1;
+extern OSViMode osViModeNtscHan1;
+extern OSViMode osViModeNtscHaf1;
+extern OSViMode osViModeNtscHpn2;
+extern OSViMode osViModeNtscHpf2;
+
+extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */
+extern OSViMode osViModePalLpf1;
+extern OSViMode osViModePalLan1;
+extern OSViMode osViModePalLaf1;
+extern OSViMode osViModePalLpn2;
+extern OSViMode osViModePalLpf2;
+extern OSViMode osViModePalLan2;
+extern OSViMode osViModePalLaf2;
+extern OSViMode osViModePalHpn1;
+extern OSViMode osViModePalHpf1;
+extern OSViMode osViModePalHan1;
+extern OSViMode osViModePalHaf1;
+extern OSViMode osViModePalHpn2;
+extern OSViMode osViModePalHpf2;
+
+extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */
+extern OSViMode osViModeMpalLpf1;
+extern OSViMode osViModeMpalLan1;
+extern OSViMode osViModeMpalLaf1;
+extern OSViMode osViModeMpalLpn2;
+extern OSViMode osViModeMpalLpf2;
+extern OSViMode osViModeMpalLan2;
+extern OSViMode osViModeMpalLaf2;
+extern OSViMode osViModeMpalHpn1;
+extern OSViMode osViModeMpalHpf1;
+extern OSViMode osViModeMpalHan1;
+extern OSViMode osViModeMpalHaf1;
+extern OSViMode osViModeMpalHpn2;
+extern OSViMode osViModeMpalHpf2;
+
+extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */
+extern void *osRomBase; /* Rom base address of the game image */
+extern s32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */
+extern s32 osResetType; /* 0 = cold reset, 1 = NMI */
+extern s32 osCicId;
+extern s32 osVersion;
+extern u32 osMemSize; /* Memory Size */
+extern s32 osAppNMIBuffer[];
+
+extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */
+extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */
+extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/
+
+
+
+/**************************************************************************
+ *
+ * Function prototypes
+ *
+ */
+
+/* Thread operations */
+
+extern void osCreateThread(OSThread *, OSId, void (*)(void *),
+ void *, void *, OSPri);
+extern void osDestroyThread(OSThread *);
+extern void osYieldThread(void);
+extern void osStartThread(OSThread *);
+extern void osStopThread(OSThread *);
+extern OSId osGetThreadId(OSThread *);
+extern void osSetThreadPri(OSThread *, OSPri);
+extern OSPri osGetThreadPri(OSThread *);
+
+/* Message operations */
+
+extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
+extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
+extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
+extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
+
+/* Event operations */
+
+extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
+
+/* Interrupt operations */
+
+extern OSIntMask osGetIntMask(void);
+extern OSIntMask osSetIntMask(OSIntMask);
+
+/* RDB port operations */
+
+extern void osInitRdb(u8 *sendBuf, u32 sendSize);
+
+/* Cache operations and macros */
+
+extern void osInvalDCache(void *, s32);
+extern void osInvalICache(void *, s32);
+extern void osWritebackDCache(void *, s32);
+extern void osWritebackDCacheAll(void);
+
+#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10))
+#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10))
+
+/* TLB management routines */
+
+extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
+extern void osMapTLBRdb(void);
+extern void osUnmapTLB(s32);
+extern void osUnmapTLBAll(void);
+extern void osSetTLBASID(s32);
+
+/* Address translation routines and macros */
+
+extern u32 osVirtualToPhysical(void *);
+extern void * osPhysicalToVirtual(u32);
+
+#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
+#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
+
+#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
+#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000))
+
+/* I/O operations */
+
+/* Audio interface (Ai) */
+extern u32 osAiGetStatus(void);
+extern u32 osAiGetLength(void);
+extern s32 osAiSetFrequency(u32);
+extern s32 osAiSetNextBuffer(void *, u32);
+
+/* Display processor interface (Dp) */
+extern u32 osDpGetStatus(void);
+extern void osDpSetStatus(u32);
+extern void osDpGetCounters(u32 *);
+extern s32 osDpSetNextBuffer(void *, u64);
+
+/* Peripheral interface (Pi) */
+extern u32 osPiGetStatus(void);
+extern s32 osPiGetDeviceType(void);
+extern s32 osPiRawWriteIo(u32, u32);
+extern s32 osPiRawReadIo(u32, u32 *);
+extern s32 osPiRawStartDma(s32, u32, void *, u32);
+extern s32 osPiWriteIo(u32, u32);
+extern s32 osPiReadIo(u32, u32 *);
+extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32,
+ OSMesgQueue *);
+extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32);
+
+/* Video interface (Vi) */
+extern u32 osViGetStatus(void);
+extern u32 osViGetCurrentMode(void);
+extern u32 osViGetCurrentLine(void);
+extern u32 osViGetCurrentField(void);
+extern void *osViGetCurrentFramebuffer(void);
+extern void *osViGetNextFramebuffer(void);
+extern void osViSetXScale(f32);
+extern void osViSetYScale(f32);
+extern void osViSetSpecialFeatures(u32);
+extern void osViSetMode(OSViMode *);
+extern void osViSetEvent(OSMesgQueue *, OSMesg, u32);
+extern void osViSwapBuffer(void *);
+extern void osViBlack(u8);
+extern void osViFade(u8, u16);
+extern void osViRepeatLine(u8);
+extern void osCreateViManager(OSPri);
+
+/* Timer interface */
+
+extern OSTime osGetTime(void);
+extern void osSetTime(OSTime);
+extern int osSetTimer(OSTimer *, OSTime, OSTime,
+ OSMesgQueue *, OSMesg);
+extern int osStopTimer(OSTimer *);
+
+/* Controller interface */
+
+extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *);
+extern s32 osContReset(OSMesgQueue *, OSContStatus *);
+extern s32 osContStartQuery(OSMesgQueue *);
+extern s32 osContStartReadData(OSMesgQueue *);
+#ifndef _HW_VERSION_1
+extern s32 osContSetCh(u8);
+#endif
+extern void osContGetQuery(OSContStatus *);
+extern void osContGetReadData(OSContPad *);
+
+/* file system interface */
+
+extern s32 osPfsInitPak(OSMesgQueue *, OSPfs *, int);
+extern s32 osPfsRepairId(OSPfs *);
+extern s32 osPfsInit(OSMesgQueue *, OSPfs *, int);
+extern s32 osPfsReFormat(OSPfs *, OSMesgQueue *, int);
+extern s32 osPfsChecker(OSPfs *);
+extern s32 osPfsAllocateFile(OSPfs *, u16, u32, u8 *, u8 *, int, s32 *);
+extern s32 osPfsFindFile(OSPfs *, u16, u32, u8 *, u8 *, s32 *);
+extern s32 osPfsDeleteFile(OSPfs *, u16, u32, u8 *, u8 *);
+extern s32 osPfsReadWriteFile(OSPfs *, s32, u8, int, int, u8 *);
+extern s32 osPfsFileState(OSPfs *, s32, OSPfsState *);
+extern s32 osPfsGetLabel(OSPfs *, u8 *, int *);
+extern s32 osPfsSetLabel(OSPfs *, u8 *);
+extern s32 osPfsIsPlug(OSMesgQueue *, u8 *);
+extern s32 osPfsFreeBlocks(OSPfs *, s32 *);
+extern s32 osPfsNumFiles(OSPfs *, s32 *, s32 *);
+
+/* EEPROM interface */
+
+extern s32 osEepromProbe(OSMesgQueue *);
+extern s32 osEepromRead(OSMesgQueue *, u8, u8 *);
+extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *);
+extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int);
+extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int);
+
+/* MOTOR interface */
+
+extern s32 osMotorInit(OSMesgQueue *, OSPfs *, int);
+extern s32 osMotorStop(OSPfs *);
+extern s32 osMotorStart(OSPfs *);
+
+/* Enhanced PI interface */
+
+extern OSPiHandle *osCartRomInit(void);
+extern OSPiHandle *osLeoDiskInit(void);
+extern OSPiHandle *osDriveRomInit(void);
+
+extern s32 osEPiDeviceType(OSPiHandle *, OSPiInfo *);
+extern s32 osEPiRawWriteIo(OSPiHandle *, u32 , u32);
+extern s32 osEPiRawReadIo(OSPiHandle *, u32 , u32 *);
+extern s32 osEPiRawStartDma(OSPiHandle *, s32 , u32 , void *, u32 );
+extern s32 osEPiRawWriteIo(OSPiHandle *, u32 , u32 );
+extern s32 osEPiReadIo(OSPiHandle *, u32 , u32 *);
+extern s32 osEPiStartDma(OSPiHandle *, OSIoMesg *, s32);
+extern s32 osEPiLinkHandle(OSPiHandle *);
+
+/* Profiler Interface */
+
+extern void osProfileInit(OSProf *, u32 profcnt);
+extern void osProfileStart(u32);
+extern void osProfileFlush(void);
+extern void osProfileStop(void);
+
+/* Game <> Host data transfer functions */
+
+extern s32 osTestHost(void);
+extern void osReadHost(void *, u32);
+extern void osWriteHost(void *, u32);
+extern void osAckRamromRead(void);
+extern void osAckRamromWrite(void);
+
+
+/* byte string operations */
+
+extern void bcopy(const void *, void *, int);
+extern int bcmp(const void *, const void *, int);
+extern void bzero(void *, int);
+
+/* Miscellaneous operations */
+
+extern void osInitialize(void);
+extern u32 osGetCount(void);
+extern void osExit(void);
+extern u32 osGetMemSize(void);
+
+/* Printf */
+
+extern int sprintf(char *s, const char *fmt, ...);
+extern void osSyncPrintf(const char *fmt, ...);
+extern void osAsyncPrintf(const char *fmt, ...);
+extern int osSyncGetChars(char *buf);
+extern int osAsyncGetChars(char *buf);
+
+#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !_OS_H */
diff --git a/include/2.0L/PR/os_internal.h b/include/2.0L/PR/os_internal.h
new file mode 100755
index 00000000..bef19ce6
--- /dev/null
+++ b/include/2.0L/PR/os_internal.h
@@ -0,0 +1,118 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.18 $
+ * $Date: 1997/02/11 08:26:14 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/os_internal.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _OS_INTERNAL_H_
+#define _OS_INTERNAL_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/* Routines to get/fetch coprocessor 0 registers */
+
+extern u32 __osGetCause(void);
+extern void __osSetCause(u32);
+extern u32 __osGetCompare(void);
+extern void __osSetCompare(u32);
+extern u32 __osGetConfig(void);
+extern void __osSetConfig(u32);
+extern void __osSetCount(u32);
+extern u32 __osGetSR(void);
+extern void __osSetSR(u32);
+extern u32 __osDisableInt(void);
+extern void __osRestoreInt(u32);
+
+/* Routines to get/set floating-point control and status register */
+extern u32 __osSetFpcCsr(u32);
+extern u32 __osGetFpcCsr(void);
+
+/* Routine for HW interrupt "handler" */
+extern void __osSetHWIntrRoutine(OSHWIntr, s32 (*handler)(void));
+
+/* Routine for global interrupt mask */
+extern void __osSetGlobalIntMask(OSHWIntr);
+extern void __osResetGlobalIntMask(OSHWIntr);
+
+/* Routine for global interrupt mask */
+extern s32 __osLeoInterrupt(void);
+
+/* Routines for fetch TLB info */
+
+extern u32 __osGetTLBASID(void);
+extern u32 __osGetTLBPageMask(s32);
+extern u32 __osGetTLBHi(s32);
+extern u32 __osGetTLBLo0(s32);
+extern u32 __osGetTLBLo1(s32);
+
+/* Serial interface (Si) */
+
+extern u32 __osSiGetStatus(void);
+extern s32 __osSiRawWriteIo(u32, u32);
+extern s32 __osSiRawReadIo(u32, u32 *);
+extern s32 __osSiRawStartDma(s32, void *);
+
+/* Signal processor interface (Sp) */
+
+extern u32 __osSpGetStatus(void);
+extern void __osSpSetStatus(u32);
+extern s32 __osSpSetPc(u32);
+extern s32 __osSiRawWriteIo(u32, u32);
+extern s32 __osSpRawReadIo(u32, u32 *);
+extern s32 __osSpRawStartDma(s32, u32, void *, u32);
+
+/* Error handling */
+
+extern void __osError(s16, s16, ...);
+extern OSThread * __osGetCurrFaultedThread(void);
+extern OSThread * __osGetNextFaultedThread(OSThread *);
+
+/* Development board functions */
+
+extern void __osGIOInit(s32);
+extern void __osGIOInterrupt(s32);
+extern void __osGIORawInterrupt(s32);
+
+/* For debugger use */
+
+extern OSThread * __osGetActiveQueue(void);
+
+/* Debug port */
+extern void __osSyncPutChars(int, int, const char *);
+extern int __osSyncGetChars(char *);
+extern void __osAsyncPutChars(int, int, const char *);
+extern int __osAsyncGetChars(char *);
+extern int __osAtomicInc(unsigned int *p);
+extern int __osAtomicDec(unsigned int *p);
+
+/* routine for rdb port */
+extern u32 __osRdbSend(u8 *buf, u32 size, u32 type);
+
+
+#endif /* _LANGUAGE_C */
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !_OS_INTERNAL_H */
diff --git a/include/2.0L/PR/ramrom.h b/include/2.0L/PR/ramrom.h
new file mode 100755
index 00000000..397b6760
--- /dev/null
+++ b/include/2.0L/PR/ramrom.h
@@ -0,0 +1,113 @@
+#ifndef _RAMROM_H
+#define _RAMROM_H
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.20 $
+ * $Date: 1997/02/11 08:26:47 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ramrom.h,v $
+ *
+ **************************************************************************/
+
+/*
+ * Defines for the GIO card in the Nintendo Development Station
+ *
+ * The RAM on the GIO card acts as ROM for the game
+ * Interrupts available between the game and the Indy host
+ *
+ * The last part of the ramrom is used for communication between
+ * game and host. There are 6 4K buffers defined:
+ * log, printf, rmon to indy, rmon from indy, app to indy, app from indy
+ * The last 8 bytes of the buffer are used in the emulator environment
+ */
+
+#define RAMROM_SIZE (0x1000000)
+
+#define RAMROM_BUF_SIZE (4096)
+#define RAMROM_MSG_SIZE (RAMROM_BUF_SIZE*6)
+#define RAMROM_MSG_ADDR (RAMROM_SIZE - RAMROM_MSG_SIZE)
+#define RAMROM_MSG_HDR_SIZE (3*sizeof(long))
+#define RAMROM_USER_DATA_SIZE (RAMROM_MSG_SIZE-RAMROM_MSG_HDR_SIZE)
+
+#define RAMROM_APP_READ_ADDR (RAMROM_MSG_ADDR + (0*RAMROM_BUF_SIZE))
+#define RAMROM_APP_WRITE_ADDR (RAMROM_MSG_ADDR + (1*RAMROM_BUF_SIZE))
+#define RAMROM_RMON_READ_ADDR (RAMROM_MSG_ADDR + (2*RAMROM_BUF_SIZE))
+#define RAMROM_RMON_WRITE_ADDR (RAMROM_MSG_ADDR + (3*RAMROM_BUF_SIZE))
+#define RAMROM_PRINTF_ADDR (RAMROM_MSG_ADDR + (4*RAMROM_BUF_SIZE))
+#define RAMROM_LOG_ADDR (RAMROM_MSG_ADDR + (5*RAMROM_BUF_SIZE))
+
+/*#define RAMROM_GIO_INTERRUPT (RAMROM_MSG_ADDR + RAMROM_MSG_SIZE - 4)*/
+
+/*
+ * For the initial round of PIF bringup, we will load in a bootstrap loader
+ * 0x400 bytes into the ramrom, and the rom will be loaded at 0x2000
+ */
+#ifndef _HW_VERSION_1
+#define RAMROM_BOOTSTRAP_OFFSET 0x40
+#define RAMROM_GAME_OFFSET 0x1000
+#define RAMROM_FONTDATA_OFFSET 0xb70
+#define RAMROM_FONTDATA_SIZE 1152
+#else
+#define RAMROM_BOOTSTRAP_OFFSET 0x400
+#define RAMROM_GAME_OFFSET 0x2000
+#endif
+#define RAMROM_CLOCKRATE_OFFSET 0x4
+#define RAMROM_CLOCKRATE_MASK 0xfffffff0
+#define RAMROM_BOOTADDR_OFFSET 0x8
+#define RAMROM_RELEASE_OFFSET 0xc
+/*
+ * Second version of the PIF jumps to location 0x1000, and we'll put a jump to
+ * location 0x400 into the ramrom (for backwards compatibility).
+ */
+#define RAMROM_PIF2BOOTSTRAP_OFFSET 0x1000
+
+typedef struct {
+ long type;
+ long length; /* in bytes of userdata */
+ long magic;
+ char userdata[RAMROM_USER_DATA_SIZE];
+} RamRomBuffer;
+
+/*
+ * Interrupt values (must fit in 6 bits!)
+ * values are used for both request & response
+ * Transactions initiated by the host start with HOST
+ * and those initiated by the target start with GAME.
+ */
+
+#define HOST_PIACCESS_REQ 1
+#define HOST_DBG_CMD_READY 2
+#define GAME_DBG_DATA_SEND 3
+#define HOST_DBG_DATA_ACK 4
+#define GAME_PRINTF_SEND 5
+#define HOST_PRINTF_ACK 6
+#define GAME_LOG_SEND 7
+#define HOST_LOG_ACK 8
+#define HOST_APP_CMD_READY 9
+#define GAME_APP_DATA_READY 10
+#define HOST_PROF_REQ 11
+#define GAME_PROF_SEND 12
+#define HOST_PROF_ACK 13
+#define GAME_FAULT_SEND 14
+#define HOST_FAULT_ACK 15
+#define GAME_EXIT 16
+#define HOST_DATA_ACK 17
+
+#ifdef _EMULATOR
+void __RamRomInit(int key, void *romaddr);
+void __RamRomDestroy(int key);
+#endif /* _EMULATOR */
+
+#endif /* !_RAMROM_H */
diff --git a/include/2.0L/PR/rcp.h b/include/2.0L/PR/rcp.h
new file mode 100755
index 00000000..3795ff72
--- /dev/null
+++ b/include/2.0L/PR/rcp.h
@@ -0,0 +1,882 @@
+#ifndef _RCP_H_
+#define _RCP_H_
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * File: rcp.h
+ *
+ * This file contains register and bit definitions for RCP memory map.
+ * $Revision: 1.20 $
+ * $Date: 1997/07/23 08:35:21 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/rcp.h,v $
+ *
+ **************************************************************************/
+
+#include
+#include
+
+/**********************************************************************
+ *
+ * Here is a quick overview of the RCP memory map:
+ *
+
+0x0000_0000 .. 0x03ef_ffff RDRAM memory
+0x03f0_0000 .. 0x03ff_ffff RDRAM registers
+
+ RCP registers (see below)
+0x0400_0000 .. 0x040f_ffff SP registers
+0x0410_0000 .. 0x041f_ffff DP command registers
+0x0420_0000 .. 0x042f_ffff DP span registers
+0x0430_0000 .. 0x043f_ffff MI registers
+0x0440_0000 .. 0x044f_ffff VI registers
+0x0450_0000 .. 0x045f_ffff AI registers
+0x0460_0000 .. 0x046f_ffff PI registers
+0x0470_0000 .. 0x047f_ffff RI registers
+0x0480_0000 .. 0x048f_ffff SI registers
+0x0490_0000 .. 0x04ff_ffff unused
+
+0x0500_0000 .. 0x05ff_ffff cartridge domain 2
+0x0600_0000 .. 0x07ff_ffff cartridge domain 1
+0x0800_0000 .. 0x0fff_ffff cartridge domain 2
+0x1000_0000 .. 0x1fbf_ffff cartridge domain 1
+
+0x1fc0_0000 .. 0x1fc0_07bf PIF Boot Rom (1984 bytes)
+0x1fc0_07c0 .. 0x1fc0_07ff PIF (JoyChannel) RAM (64 bytes)
+0x1fc0_0800 .. 0x1fcf_ffff Reserved
+0x1fd0_0000 .. 0x7fff_ffff cartridge domain 1
+0x8000_0000 .. 0xffff_ffff external SysAD device
+
+The Indy development board use cartridge domain 1:
+0x1000_0000 .. 0x10ff_ffff RAMROM
+0x1800_0000 .. 0x1800_0003 GIO interrupt (6 bits valid in 4 bytes)
+0x1800_0400 .. 0x1800_0403 GIO sync (6 bits valid in 4 bytes)
+0x1800_0800 .. 0x1800_0803 CART interrupt (6 bits valid in 4 bytes)
+
+
+
+**************************************************************************/
+
+
+/*************************************************************************
+ * RDRAM Memory (Assumes that maximum size is 4 MB)
+ */
+#define RDRAM_0_START 0x00000000
+#define RDRAM_0_END 0x001FFFFF
+#define RDRAM_1_START 0x00200000
+#define RDRAM_1_END 0x003FFFFF
+
+#define RDRAM_START RDRAM_0_START
+#define RDRAM_END RDRAM_1_END
+
+
+/*************************************************************************
+ * Address predicates
+ */
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#define IS_RDRAM(x) ((unsigned)(x) >= RDRAM_START && \
+ (unsigned)(x) < RDRAM_END)
+#endif
+
+
+/*************************************************************************
+ * RDRAM Registers (0x03f0_0000 .. 0x03ff_ffff)
+ */
+#define RDRAM_BASE_REG 0x03F00000
+
+#define RDRAM_CONFIG_REG (RDRAM_BASE_REG+0x00)
+#define RDRAM_DEVICE_TYPE_REG (RDRAM_BASE_REG+0x00)
+#define RDRAM_DEVICE_ID_REG (RDRAM_BASE_REG+0x04)
+#define RDRAM_DELAY_REG (RDRAM_BASE_REG+0x08)
+#define RDRAM_MODE_REG (RDRAM_BASE_REG+0x0c)
+#define RDRAM_REF_INTERVAL_REG (RDRAM_BASE_REG+0x10)
+#define RDRAM_REF_ROW_REG (RDRAM_BASE_REG+0x14)
+#define RDRAM_RAS_INTERVAL_REG (RDRAM_BASE_REG+0x18)
+#define RDRAM_MIN_INTERVAL_REG (RDRAM_BASE_REG+0x1c)
+#define RDRAM_ADDR_SELECT_REG (RDRAM_BASE_REG+0x20)
+#define RDRAM_DEVICE_MANUF_REG (RDRAM_BASE_REG+0x24)
+
+#define RDRAM_0_DEVICE_ID 0
+#define RDRAM_1_DEVICE_ID 1
+
+#define RDRAM_RESET_MODE 0
+#define RDRAM_ACTIVE_MODE 1
+#define RDRAM_STANDBY_MODE 2
+
+#define RDRAM_LENGTH (2*512*2048)
+#define RDRAM_0_BASE_ADDRESS (RDRAM_0_DEVICE_ID*RDRAM_LENGTH)
+#define RDRAM_1_BASE_ADDRESS (RDRAM_1_DEVICE_ID*RDRAM_LENGTH)
+
+#define RDRAM_0_CONFIG 0x00000
+#define RDRAM_1_CONFIG 0x00400
+#define RDRAM_GLOBAL_CONFIG 0x80000
+
+
+/*************************************************************************
+ * PIF Physical memory map (total size = 2 KB)
+ *
+ * Size Description Mode
+ * 1FC007FF +-------+-----------------+-----+
+ * | 64 B | JoyChannel RAM | R/W |
+ * 1FC007C0 +-------+-----------------+-----+
+ * |1984 B | Boot ROM | * | * = Reserved
+ * 1FC00000 +-------+-----------------+-----+
+ *
+ */
+#define PIF_ROM_START 0x1FC00000
+#define PIF_ROM_END 0x1FC007BF
+#define PIF_RAM_START 0x1FC007C0
+#define PIF_RAM_END 0x1FC007FF
+
+
+/*************************************************************************
+ * Controller channel
+ * Each game controller channel has 4 error bits that are defined in bit 6-7 of
+ * the Rx and Tx data size area bytes. Programmers need to clear these bits
+ * when setting the Tx/Rx size area values for a channel
+ */
+#define CHNL_ERR_NORESP 0x80 /* Bit 7 (Rx): No response error */
+#define CHNL_ERR_OVERRUN 0x40 /* Bit 6 (Rx): Overrun error */
+#define CHNL_ERR_FRAME 0x80 /* Bit 7 (Tx): Frame error */
+#define CHNL_ERR_COLLISION 0x40 /* Bit 6 (Tx): Collision error */
+
+#define CHNL_ERR_MASK 0xC0 /* Bit 6-7: channel errors */
+
+
+/*************************************************************************
+ * External device info
+ */
+#define DEVICE_TYPE_CART 0 /* ROM cartridge */
+#define DEVICE_TYPE_BULK 1 /* ROM bulk */
+#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */
+#define DEVICE_TYPE_SRAM 3 /* SRAM */
+
+/*************************************************************************
+ * SP Memory
+ */
+#define SP_DMEM_START 0x04000000 /* read/write */
+#define SP_DMEM_END 0x04000FFF
+#define SP_IMEM_START 0x04001000 /* read/write */
+#define SP_IMEM_END 0x04001FFF
+
+/*************************************************************************
+ * SP CP0 Registers
+ */
+
+#define SP_BASE_REG 0x04040000
+
+/* SP memory address (R/W): [11:0] DMEM/IMEM address; [12] 0=DMEM,1=IMEM */
+#define SP_MEM_ADDR_REG (SP_BASE_REG+0x00) /* Master */
+
+/* SP DRAM DMA address (R/W): [23:0] RDRAM address */
+#define SP_DRAM_ADDR_REG (SP_BASE_REG+0x04) /* Slave */
+
+/* SP read DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */
+/* direction: I/DMEM <- RDRAM */
+#define SP_RD_LEN_REG (SP_BASE_REG+0x08) /* R/W: read len */
+
+/* SP write DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */
+/* direction: I/DMEM -> RDRAM */
+#define SP_WR_LEN_REG (SP_BASE_REG+0x0C) /* R/W: write len */
+
+/* SP status (R/W): [14:0] valid bits; see below for write/read mode */
+#define SP_STATUS_REG (SP_BASE_REG+0x10)
+
+/* SP DMA full (R): [0] valid bit; dma full */
+#define SP_DMA_FULL_REG (SP_BASE_REG+0x14)
+
+/* SP DMA busy (R): [0] valid bit; dma busy */
+#define SP_DMA_BUSY_REG (SP_BASE_REG+0x18)
+
+/* SP semaphore (R/W): Read: [0] semaphore flag (set on read) */
+/* Write: [] clear semaphore flag */
+#define SP_SEMAPHORE_REG (SP_BASE_REG+0x1C)
+
+/* SP PC (R/W): [11:0] program counter */
+#define SP_PC_REG 0x04080000
+
+/* SP MEM address: bit 12 specifies if address is IMEM or DMEM */
+#define SP_DMA_DMEM 0x0000 /* Bit 12: 0=DMEM, 1=IMEM */
+#define SP_DMA_IMEM 0x1000 /* Bit 12: 0=DMEM, 1=IMEM */
+
+/*
+ * Values to clear/set bit in status reg (SP_STATUS_REG - write)
+ */
+#define SP_CLR_HALT 0x00001 /* Bit 0: clear halt */
+#define SP_SET_HALT 0x00002 /* Bit 1: set halt */
+#define SP_CLR_BROKE 0x00004 /* Bit 2: clear broke */
+#define SP_CLR_INTR 0x00008 /* Bit 3: clear intr */
+#define SP_SET_INTR 0x00010 /* Bit 4: set intr */
+#define SP_CLR_SSTEP 0x00020 /* Bit 5: clear sstep */
+#define SP_SET_SSTEP 0x00040 /* Bit 6: set sstep */
+#define SP_CLR_INTR_BREAK 0x00080 /* Bit 7: clear intr on break */
+#define SP_SET_INTR_BREAK 0x00100 /* Bit 8: set intr on break */
+#define SP_CLR_SIG0 0x00200 /* Bit 9: clear signal 0 */
+#define SP_SET_SIG0 0x00400 /* Bit 10: set signal 0 */
+#define SP_CLR_SIG1 0x00800 /* Bit 11: clear signal 1 */
+#define SP_SET_SIG1 0x01000 /* Bit 12: set signal 1 */
+#define SP_CLR_SIG2 0x02000 /* Bit 13: clear signal 2 */
+#define SP_SET_SIG2 0x04000 /* Bit 14: set signal 2 */
+#define SP_CLR_SIG3 0x08000 /* Bit 15: clear signal 3 */
+#define SP_SET_SIG3 0x10000 /* Bit 16: set signal 3 */
+#define SP_CLR_SIG4 0x20000 /* Bit 17: clear signal 4 */
+#define SP_SET_SIG4 0x40000 /* Bit 18: set signal 4 */
+#define SP_CLR_SIG5 0x80000 /* Bit 19: clear signal 5 */
+#define SP_SET_SIG5 0x100000 /* Bit 20: set signal 5 */
+#define SP_CLR_SIG6 0x200000 /* Bit 21: clear signal 6 */
+#define SP_SET_SIG6 0x400000 /* Bit 22: set signal 6 */
+#define SP_CLR_SIG7 0x800000 /* Bit 23: clear signal 7 */
+#define SP_SET_SIG7 0x1000000 /* Bit 24: set signal 7 */
+
+/*
+ * Patterns to interpret status reg (SP_STATUS_REG - read)
+ */
+#define SP_STATUS_HALT 0x001 /* Bit 0: halt */
+#define SP_STATUS_BROKE 0x002 /* Bit 1: broke */
+#define SP_STATUS_DMA_BUSY 0x004 /* Bit 2: dma busy */
+#define SP_STATUS_DMA_FULL 0x008 /* Bit 3: dma full */
+#define SP_STATUS_IO_FULL 0x010 /* Bit 4: io full */
+#define SP_STATUS_SSTEP 0x020 /* Bit 5: single step */
+#define SP_STATUS_INTR_BREAK 0x040 /* Bit 6: interrupt on break */
+#define SP_STATUS_SIG0 0x080 /* Bit 7: signal 0 set */
+#define SP_STATUS_SIG1 0x100 /* Bit 8: signal 1 set */
+#define SP_STATUS_SIG2 0x200 /* Bit 9: signal 2 set */
+#define SP_STATUS_SIG3 0x400 /* Bit 10: signal 3 set */
+#define SP_STATUS_SIG4 0x800 /* Bit 11: signal 4 set */
+#define SP_STATUS_SIG5 0x1000 /* Bit 12: signal 5 set */
+#define SP_STATUS_SIG6 0x2000 /* Bit 13: signal 6 set */
+#define SP_STATUS_SIG7 0x4000 /* Bit 14: signal 7 set */
+
+/*
+ * Use of SIG bits
+ */
+#define SP_CLR_YIELD SP_CLR_SIG0
+#define SP_SET_YIELD SP_SET_SIG0
+#define SP_STATUS_YIELD SP_STATUS_SIG0
+#define SP_CLR_YIELDED SP_CLR_SIG1
+#define SP_SET_YIELDED SP_SET_SIG1
+#define SP_STATUS_YIELDED SP_STATUS_SIG1
+#define SP_CLR_TASKDONE SP_CLR_SIG2
+#define SP_SET_TASKDONE SP_SET_SIG2
+#define SP_STATUS_TASKDONE SP_STATUS_SIG2
+#define SP_CLR_RSPSIGNAL SP_CLR_SIG3
+#define SP_SET_RSPSIGNAL SP_SET_SIG3
+#define SP_STATUS_RSPSIGNAL SP_STATUS_SIG3
+#define SP_CLR_CPUSIGNAL SP_CLR_SIG4
+#define SP_SET_CPUSIGNAL SP_SET_SIG4
+#define SP_STATUS_CPUSIGNAL SP_STATUS_SIG4
+
+/* SP IMEM BIST REG (R/W): [6:0] BIST status bits; see below for detail */
+#define SP_IBIST_REG 0x04080004
+
+/*
+ * Patterns to interpret status reg (SP_BIST_REG - write)
+ */
+#define SP_IBIST_CHECK 0x01 /* Bit 0: BIST check */
+#define SP_IBIST_GO 0x02 /* Bit 1: BIST go */
+#define SP_IBIST_CLEAR 0x04 /* Bit 2: BIST clear */
+
+/*
+ * Patterns to interpret status reg (SP_BIST_REG - read)
+ */
+/* First 2 bits are same as in write mode:
+ * Bit 0: BIST check; Bit 1: BIST go
+ */
+#define SP_IBIST_DONE 0x04 /* Bit 2: BIST done */
+#define SP_IBIST_FAILED 0x78 /* Bit [6:3]: BIST fail */
+
+
+/*************************************************************************
+ * DP Command Registers
+ */
+#define DPC_BASE_REG 0x04100000
+
+/* DP CMD DMA start (R/W): [23:0] DMEM/RDRAM start address */
+#define DPC_START_REG (DPC_BASE_REG+0x00)
+
+/* DP CMD DMA end (R/W): [23:0] DMEM/RDRAM end address */
+#define DPC_END_REG (DPC_BASE_REG+0x04)
+
+/* DP CMD DMA end (R): [23:0] DMEM/RDRAM current address */
+#define DPC_CURRENT_REG (DPC_BASE_REG+0x08)
+
+/* DP CMD status (R/W): [9:0] valid bits - see below for definitions */
+#define DPC_STATUS_REG (DPC_BASE_REG+0x0C)
+
+/* DP clock counter (R): [23:0] clock counter */
+#define DPC_CLOCK_REG (DPC_BASE_REG+0x10)
+
+/* DP buffer busy counter (R): [23:0] clock counter */
+#define DPC_BUFBUSY_REG (DPC_BASE_REG+0x14)
+
+/* DP pipe busy counter (R): [23:0] clock counter */
+#define DPC_PIPEBUSY_REG (DPC_BASE_REG+0x18)
+
+/* DP TMEM load counter (R): [23:0] clock counter */
+#define DPC_TMEM_REG (DPC_BASE_REG+0x1C)
+
+/*
+ * Values to clear/set bit in status reg (DPC_STATUS_REG - write)
+ */
+#define DPC_CLR_XBUS_DMEM_DMA 0x0001 /* Bit 0: clear xbus_dmem_dma */
+#define DPC_SET_XBUS_DMEM_DMA 0x0002 /* Bit 1: set xbus_dmem_dma */
+#define DPC_CLR_FREEZE 0x0004 /* Bit 2: clear freeze */
+#define DPC_SET_FREEZE 0x0008 /* Bit 3: set freeze */
+#define DPC_CLR_FLUSH 0x0010 /* Bit 4: clear flush */
+#define DPC_SET_FLUSH 0x0020 /* Bit 5: set flush */
+#define DPC_CLR_TMEM_CTR 0x0040 /* Bit 6: clear tmem ctr */
+#define DPC_CLR_PIPE_CTR 0x0080 /* Bit 7: clear pipe ctr */
+#define DPC_CLR_CMD_CTR 0x0100 /* Bit 8: clear cmd ctr */
+#define DPC_CLR_CLOCK_CTR 0x0200 /* Bit 9: clear clock ctr */
+
+/*
+ * Patterns to interpret status reg (DPC_STATUS_REG - read)
+ */
+#define DPC_STATUS_XBUS_DMEM_DMA 0x001 /* Bit 0: xbus_dmem_dma */
+#define DPC_STATUS_FREEZE 0x002 /* Bit 1: freeze */
+#define DPC_STATUS_FLUSH 0x004 /* Bit 2: flush */
+/*#define DPC_STATUS_FROZEN 0x008*/ /* Bit 3: frozen */
+#define DPC_STATUS_START_GCLK 0x008 /* Bit 3: start gclk */
+#define DPC_STATUS_TMEM_BUSY 0x010 /* Bit 4: tmem busy */
+#define DPC_STATUS_PIPE_BUSY 0x020 /* Bit 5: pipe busy */
+#define DPC_STATUS_CMD_BUSY 0x040 /* Bit 6: cmd busy */
+#define DPC_STATUS_CBUF_READY 0x080 /* Bit 7: cbuf ready */
+#define DPC_STATUS_DMA_BUSY 0x100 /* Bit 8: dma busy */
+#define DPC_STATUS_END_VALID 0x200 /* Bit 9: end valid */
+#define DPC_STATUS_START_VALID 0x400 /* Bit 10: start valid */
+
+
+/*************************************************************************
+ * DP Span Registers
+ */
+#define DPS_BASE_REG 0x04200000
+
+/* DP tmem bist (R/W): [10:0] BIST status bits; see below for detail */
+#define DPS_TBIST_REG (DPS_BASE_REG+0x00)
+
+/* DP span test mode (R/W): [0] Span buffer test access enable */
+#define DPS_TEST_MODE_REG (DPS_BASE_REG+0x04)
+
+/* DP span buffer test address (R/W): [6:0] bits; see below for detail */
+#define DPS_BUFTEST_ADDR_REG (DPS_BASE_REG+0x08)
+
+/* DP span buffer test data (R/W): [31:0] span buffer data */
+#define DPS_BUFTEST_DATA_REG (DPS_BASE_REG+0x0C)
+
+/*
+ * Patterns to interpret status reg (DPS_TMEM_BIST_REG - write)
+ */
+#define DPS_TBIST_CHECK 0x01 /* Bit 0: BIST check */
+#define DPS_TBIST_GO 0x02 /* Bit 1: BIST go */
+#define DPS_TBIST_CLEAR 0x04 /* Bit 2: BIST clear */
+
+/*
+ * Patterns to interpret status reg (DPS_TMEM_BIST_REG - read)
+ */
+/* First 2 bits are same as in write mode:
+ * Bit 0: BIST check; Bit 1: BIST go
+ */
+#define DPS_TBIST_DONE 0x004 /* Bit 2: BIST done */
+#define DPS_TBIST_FAILED 0x7F8 /* Bit [10:3]: BIST fail */
+
+
+/*************************************************************************
+ * MIPS Interface (MI) Registers
+ */
+#define MI_BASE_REG 0x04300000
+
+/*
+ * MI init mode (W): [6:0] init length, [7] clear init mode, [8] set init mode
+ * [9/10] clear/set ebus test mode, [11] clear DP interrupt
+ * (R): [6:0] init length, [7] init mode, [8] ebus test mode
+ */
+#define MI_INIT_MODE_REG (MI_BASE_REG+0x00)
+#define MI_MODE_REG MI_INIT_MODE_REG
+
+/*
+ * Values to clear/set bit in mode reg (MI_MODE_REG - write)
+ */
+#define MI_CLR_INIT 0x0080 /* Bit 7: clear init mode */
+#define MI_SET_INIT 0x0100 /* Bit 8: set init mode */
+#define MI_CLR_EBUS 0x0200 /* Bit 9: clear ebus test */
+#define MI_SET_EBUS 0x0400 /* Bit 10: set ebus test mode */
+#define MI_CLR_DP_INTR 0x0800 /* Bit 11: clear dp interrupt */
+#define MI_CLR_RDRAM 0x1000 /* Bit 12: clear RDRAM reg */
+#define MI_SET_RDRAM 0x2000 /* Bit 13: set RDRAM reg mode */
+
+/*
+ * Patterns to interpret mode reg (MI_MODE_REG - read)
+ */
+#define MI_MODE_INIT 0x0080 /* Bit 7: init mode */
+#define MI_MODE_EBUS 0x0100 /* Bit 8: ebus test mode */
+#define MI_MODE_RDRAM 0x0200 /* Bit 9: RDRAM reg mode */
+
+/* MI version (R): [7:0] io, [15:8] rac, [23:16] rdp, [31:24] rsp */
+#define MI_VERSION_REG (MI_BASE_REG+0x04)
+#define MI_NOOP_REG MI_VERSION_REG
+
+/* MI interrupt (R): [5:0] valid bits - see below for bit patterns */
+#define MI_INTR_REG (MI_BASE_REG+0x08)
+
+/*
+ * MI interrupt mask (W): [11:0] valid bits - see below for bit patterns
+ * (R): [5:0] valid bits - see below for bit patterns
+ */
+#define MI_INTR_MASK_REG (MI_BASE_REG+0x0C)
+
+/*
+ * The following are values to check for interrupt setting (MI_INTR_REG)
+ */
+#define MI_INTR_SP 0x01 /* Bit 0: SP intr */
+#define MI_INTR_SI 0x02 /* Bit 1: SI intr */
+#define MI_INTR_AI 0x04 /* Bit 2: AI intr */
+#define MI_INTR_VI 0x08 /* Bit 3: VI intr */
+#define MI_INTR_PI 0x10 /* Bit 4: PI intr */
+#define MI_INTR_DP 0x20 /* Bit 5: DP intr */
+
+/*
+ * The following are values to clear/set various interrupt bit mask
+ * They can be ORed together to manipulate multiple bits
+ * (MI_INTR_MASK_REG - write)
+ */
+#define MI_INTR_MASK_CLR_SP 0x0001 /* Bit 0: clear SP mask */
+#define MI_INTR_MASK_SET_SP 0x0002 /* Bit 1: set SP mask */
+#define MI_INTR_MASK_CLR_SI 0x0004 /* Bit 2: clear SI mask */
+#define MI_INTR_MASK_SET_SI 0x0008 /* Bit 3: set SI mask */
+#define MI_INTR_MASK_CLR_AI 0x0010 /* Bit 4: clear AI mask */
+#define MI_INTR_MASK_SET_AI 0x0020 /* Bit 5: set AI mask */
+#define MI_INTR_MASK_CLR_VI 0x0040 /* Bit 6: clear VI mask */
+#define MI_INTR_MASK_SET_VI 0x0080 /* Bit 7: set VI mask */
+#define MI_INTR_MASK_CLR_PI 0x0100 /* Bit 8: clear PI mask */
+#define MI_INTR_MASK_SET_PI 0x0200 /* Bit 9: set PI mask */
+#define MI_INTR_MASK_CLR_DP 0x0400 /* Bit 10: clear DP mask */
+#define MI_INTR_MASK_SET_DP 0x0800 /* Bit 11: set DP mask */
+
+/*
+ * The following are values to check for interrupt mask setting
+ * (MI_INTR_MASK_REG - read)
+ */
+#define MI_INTR_MASK_SP 0x01 /* Bit 0: SP intr mask */
+#define MI_INTR_MASK_SI 0x02 /* Bit 1: SI intr mask */
+#define MI_INTR_MASK_AI 0x04 /* Bit 2: AI intr mask */
+#define MI_INTR_MASK_VI 0x08 /* Bit 3: VI intr mask */
+#define MI_INTR_MASK_PI 0x10 /* Bit 4: PI intr mask */
+#define MI_INTR_MASK_DP 0x20 /* Bit 5: DP intr mask */
+
+
+/*************************************************************************
+ * Video Interface (VI) Registers
+ */
+#define VI_BASE_REG 0x04400000
+
+/* VI status/control (R/W): [15-0] valid bits:
+ * [1:0] = type[1:0] (pixel size)
+ * 0: blank (no data, no sync)
+ * 1: reserved
+ * 2: 5/5/5/3 ("16" bit)
+ * 3: 8/8/8/8 (32 bit)
+ * [2] = gamma_dither_enable (normally on, unless "special effect")
+ * [3] = gamma_enable (normally on, unless MPEG/JPEG)
+ * [4] = divot_enable (normally on if antialiased, unless decal lines)
+ * [5] = reserved - always off
+ * [6] = serrate (always on if interlaced, off if not)
+ * [7] = reserved - diagnostics only
+ * [9:8] = anti-alias (aa) mode[1:0]
+ * 0: aa & resamp (always fetch extra lines)
+ * 1: aa & resamp (fetch extra lines if needed)
+ * 2: resamp only (treat as all fully covered)
+ * 3: neither (replicate pixels, no interpolate)
+ * [11] = reserved - diagnostics only
+ * [15:12] = reserved
+ *
+ */
+#define VI_STATUS_REG (VI_BASE_REG+0x00)
+#define VI_CONTROL_REG VI_STATUS_REG
+
+/* VI origin (R/W): [23:0] frame buffer origin in bytes */
+#define VI_ORIGIN_REG (VI_BASE_REG+0x04)
+#define VI_DRAM_ADDR_REG VI_ORIGIN_REG
+
+/* VI width (R/W): [11:0] frame buffer line width in pixels */
+#define VI_WIDTH_REG (VI_BASE_REG+0x08)
+#define VI_H_WIDTH_REG VI_WIDTH_REG
+
+/* VI vertical intr (R/W): [9:0] interrupt when current half-line = V_INTR */
+#define VI_INTR_REG (VI_BASE_REG+0x0C)
+#define VI_V_INTR_REG VI_INTR_REG
+
+/*
+ * VI current vertical line (R/W): [9:0] current half line, sampled once per
+ * line (the lsb of V_CURRENT is constant within a field, and in
+ * interlaced modes gives the field number - which is constant for non-
+ * interlaced modes)
+ * - Any write to this register will clear interrupt line
+ */
+#define VI_CURRENT_REG (VI_BASE_REG+0x10)
+#define VI_V_CURRENT_LINE_REG VI_CURRENT_REG
+
+/*
+ * VI video timing (R/W): [ 7: 0] horizontal sync width in pixels,
+ * [15: 8] color burst width in pixels,
+ * [19:16] vertical sync width in half lines,
+ * [29:20] start of color burst in pixels from h-sync
+ */
+#define VI_BURST_REG (VI_BASE_REG+0x14)
+#define VI_TIMING_REG VI_BURST_REG
+
+/* VI vertical sync (R/W): [9:0] number of half-lines per field */
+#define VI_V_SYNC_REG (VI_BASE_REG+0x18)
+
+/* VI horizontal sync (R/W): [11: 0] total duration of a line in 1/4 pixel
+ * [20:16] a 5-bit leap pattern used for PAL only
+ * (h_sync_period)
+ */
+#define VI_H_SYNC_REG (VI_BASE_REG+0x1C)
+
+/*
+ * VI horizontal sync leap (R/W): [11: 0] identical to h_sync_period
+ * [27:16] identical to h_sync_period
+ */
+#define VI_LEAP_REG (VI_BASE_REG+0x20)
+#define VI_H_SYNC_LEAP_REG VI_LEAP_REG
+
+/*
+ * VI horizontal video (R/W): [ 9: 0] end of active video in screen pixels
+ * : [25:16] start of active video in screen pixels
+ */
+#define VI_H_START_REG (VI_BASE_REG+0x24)
+#define VI_H_VIDEO_REG VI_H_START_REG
+
+/*
+ * VI vertical video (R/W): [ 9: 0] end of active video in screen half-lines
+ * : [25:16] start of active video in screen half-lines
+ */
+#define VI_V_START_REG (VI_BASE_REG+0x28)
+#define VI_V_VIDEO_REG VI_V_START_REG
+
+/*
+ * VI vertical burst (R/W): [ 9: 0] end of color burst enable in half-lines
+ * : [25:16] start of color burst enable in half-lines
+ */
+#define VI_V_BURST_REG (VI_BASE_REG+0x2C)
+
+/* VI x-scale (R/W): [11: 0] 1/horizontal scale up factor (2.10 format)
+ * [27:16] horizontal subpixel offset (2.10 format)
+ */
+#define VI_X_SCALE_REG (VI_BASE_REG+0x30)
+
+/* VI y-scale (R/W): [11: 0] 1/vertical scale up factor (2.10 format)
+ * [27:16] vertical subpixel offset (2.10 format)
+ */
+#define VI_Y_SCALE_REG (VI_BASE_REG+0x34)
+
+/*
+ * Patterns to interpret VI_CONTROL_REG
+ */
+#define VI_CTRL_TYPE_16 0x00002 /* Bit [1:0] pixel size: 16 bit */
+#define VI_CTRL_TYPE_32 0x00003 /* Bit [1:0] pixel size: 32 bit */
+#define VI_CTRL_GAMMA_DITHER_ON 0x00004 /* Bit 2: default = on */
+#define VI_CTRL_GAMMA_ON 0x00008 /* Bit 3: default = on */
+#define VI_CTRL_DIVOT_ON 0x00010 /* Bit 4: default = on */
+#define VI_CTRL_SERRATE_ON 0x00040 /* Bit 6: on if interlaced */
+#define VI_CTRL_ANTIALIAS_MASK 0x00300 /* Bit [9:8] anti-alias mode */
+#define VI_CTRL_DITHER_FILTER_ON 0x10000 /* Bit 16: dither-filter mode */
+
+/*
+ * Possible video clocks (NTSC or PAL)
+ */
+#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */
+#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */
+#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */
+
+
+/*************************************************************************
+ * Audio Interface (AI) Registers
+ *
+ * The address and length registers are double buffered; that is, they
+ * can be written twice before becoming full.
+ * The address must be written before the length.
+ */
+#define AI_BASE_REG 0x04500000
+
+/* AI DRAM address (W): [23:0] starting RDRAM address (8B-aligned) */
+#define AI_DRAM_ADDR_REG (AI_BASE_REG+0x00) /* R0: DRAM address */
+
+/* AI length (R/W): [14:0] transfer length (v1.0) - Bottom 3 bits are ignored */
+/* [17:0] transfer length (v2.0) - Bottom 3 bits are ignored */
+#define AI_LEN_REG (AI_BASE_REG+0x04) /* R1: Length */
+
+/* AI control (W): [0] DMA enable - if LSB == 1, DMA is enabled */
+#define AI_CONTROL_REG (AI_BASE_REG+0x08) /* R2: DMA Control */
+
+/*
+ * AI status (R): [31]/[0] ai_full (addr & len buffer full), [30] ai_busy
+ * Note that a 1->0 transition in ai_full will set interrupt
+ * (W): clear audio interrupt
+ */
+#define AI_STATUS_REG (AI_BASE_REG+0x0C) /* R3: Status */
+
+/*
+ * AI DAC sample period register (W): [13:0] dac rate
+ * - vid_clock/(dperiod + 1) is the DAC sample rate
+ * - (dperiod + 1) >= 66 * (aclockhp + 1) must be true
+ */
+#define AI_DACRATE_REG (AI_BASE_REG+0x10) /* R4: DAC rate 14-lsb*/
+
+/*
+ * AI bit rate (W): [3:0] bit rate (abus clock half period register - aclockhp)
+ * - vid_clock/(2 * (aclockhp + 1)) is the DAC clock rate
+ * - The abus clock stops if aclockhp is zero
+ */
+#define AI_BITRATE_REG (AI_BASE_REG+0x14) /* R5: Bit rate 4-lsb */
+
+/* Value for control register */
+#define AI_CONTROL_DMA_ON 0x01 /* LSB = 1: DMA enable*/
+#define AI_CONTROL_DMA_OFF 0x00 /* LSB = 1: DMA enable*/
+
+/* Value for status register */
+#define AI_STATUS_FIFO_FULL 0x80000000 /* Bit 31: full */
+#define AI_STATUS_DMA_BUSY 0x40000000 /* Bit 30: busy */
+
+/* DAC rate = video clock / audio frequency
+ * - DAC rate >= (66 * Bit rate) must be true
+ */
+#define AI_MAX_DAC_RATE 16384 /* 14-bit+1 */
+#define AI_MIN_DAC_RATE 132
+
+/* Bit rate <= (DAC rate / 66) */
+#define AI_MAX_BIT_RATE 16 /* 4-bit+1 */
+#define AI_MIN_BIT_RATE 2
+
+/*
+ * Maximum and minimum values for audio frequency based on video clocks
+ * max frequency = (video clock / min dac rate)
+ * min frequency = (video clock / max dac rate)
+ */
+#define AI_NTSC_MAX_FREQ 368000 /* 368 KHz */
+#define AI_NTSC_MIN_FREQ 3000 /* 3 KHz ~ 2971 Hz */
+
+#define AI_PAL_MAX_FREQ 376000 /* 376 KHz */
+#define AI_PAL_MIN_FREQ 3050 /* 3 KHz ~ 3031 Hz */
+
+#define AI_MPAL_MAX_FREQ 368000 /* 368 KHz */
+#define AI_MPAL_MIN_FREQ 3000 /* 3 KHz ~ 2968 Hz */
+
+
+/*************************************************************************
+ * Peripheral Interface (PI) Registers
+ */
+#define PI_BASE_REG 0x04600000
+
+/* PI DRAM address (R/W): [23:0] starting RDRAM address */
+#define PI_DRAM_ADDR_REG (PI_BASE_REG+0x00) /* DRAM address */
+
+/* PI pbus (cartridge) address (R/W): [31:0] starting AD16 address */
+#define PI_CART_ADDR_REG (PI_BASE_REG+0x04)
+
+/* PI read length (R/W): [23:0] read data length */
+#define PI_RD_LEN_REG (PI_BASE_REG+0x08)
+
+/* PI write length (R/W): [23:0] write data length */
+#define PI_WR_LEN_REG (PI_BASE_REG+0x0C)
+
+/*
+ * PI status (R): [0] DMA busy, [1] IO busy, [2], error
+ * (W): [0] reset controller (and abort current op), [1] clear intr
+ */
+#define PI_STATUS_REG (PI_BASE_REG+0x10)
+
+/* PI dom1 latency (R/W): [7:0] domain 1 device latency */
+#define PI_BSD_DOM1_LAT_REG (PI_BASE_REG+0x14)
+
+/* PI dom1 pulse width (R/W): [7:0] domain 1 device R/W strobe pulse width */
+#define PI_BSD_DOM1_PWD_REG (PI_BASE_REG+0x18)
+
+/* PI dom1 page size (R/W): [3:0] domain 1 device page size */
+#define PI_BSD_DOM1_PGS_REG (PI_BASE_REG+0x1C) /* page size */
+
+/* PI dom1 release (R/W): [1:0] domain 1 device R/W release duration */
+#define PI_BSD_DOM1_RLS_REG (PI_BASE_REG+0x20)
+
+/* PI dom2 latency (R/W): [7:0] domain 2 device latency */
+#define PI_BSD_DOM2_LAT_REG (PI_BASE_REG+0x24) /* Domain 2 latency */
+
+/* PI dom2 pulse width (R/W): [7:0] domain 2 device R/W strobe pulse width */
+#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28) /* pulse width */
+
+/* PI dom2 page size (R/W): [3:0] domain 2 device page size */
+#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C) /* page size */
+
+/* PI dom2 release (R/W): [1:0] domain 2 device R/W release duration */
+#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30) /* release duration */
+
+#define PI_DOMAIN1_REG PI_BSD_DOM1_LAT_REG
+#define PI_DOMAIN2_REG PI_BSD_DOM2_LAT_REG
+
+#define PI_DOM_LAT_OFS 0x00
+#define PI_DOM_PWD_OFS 0x04
+#define PI_DOM_PGS_OFS 0x08
+#define PI_DOM_RLS_OFS 0x0C
+
+/*
+ * PI status register has 3 bits active when read from (PI_STATUS_REG - read)
+ * Bit 0: DMA busy - set when DMA is in progress
+ * Bit 1: IO busy - set when IO is in progress
+ * Bit 2: Error - set when CPU issues IO request while DMA is busy
+ */
+#define PI_STATUS_ERROR 0x04
+#define PI_STATUS_IO_BUSY 0x02
+#define PI_STATUS_DMA_BUSY 0x01
+
+/* PI status register has 2 bits active when written to:
+ * Bit 0: When set, reset PIC
+ * Bit 1: When set, clear interrupt flag
+ * The values of the two bits can be ORed together to both reset PIC and
+ * clear interrupt at the same time.
+ *
+ * Note:
+ * - The PIC does generate an interrupt at the end of each DMA. CPU
+ * needs to clear the interrupt flag explicitly (from an interrupt
+ * handler) by writing into the STATUS register with bit 1 set.
+ *
+ * - When a DMA completes, the interrupt flag is set. CPU can issue
+ * another request even while the interrupt flag is set (as long as
+ * PIC is idle). However, it is the CPU's responsibility for
+ * maintaining accurate correspondence between DMA completions and
+ * interrupts.
+ *
+ * - When PIC is reset, if PIC happens to be busy, an interrupt will
+ * be generated as PIC returns to idle. Otherwise, no interrupt will
+ * be generated and PIC remains idle.
+ */
+/*
+ * Values to clear interrupt/reset PIC (PI_STATUS_REG - write)
+ */
+#define PI_STATUS_RESET 0x01
+#define PI_SET_RESET PI_STATUS_RESET
+
+#define PI_STATUS_CLR_INTR 0x02
+#define PI_CLR_INTR PI_STATUS_CLR_INTR
+
+#define PI_DMA_BUFFER_SIZE 128
+
+#define PI_DOM1_ADDR1 0x06000000 /* to 0x07FFFFFF */
+#define PI_DOM1_ADDR2 0x10000000 /* to 0x1FBFFFFF */
+#define PI_DOM1_ADDR3 0x1FD00000 /* to 0x7FFFFFFF */
+#define PI_DOM2_ADDR1 0x05000000 /* to 0x05FFFFFF */
+#define PI_DOM2_ADDR2 0x08000000 /* to 0x0FFFFFFF */
+
+
+/*************************************************************************
+ * RDRAM Interface (RI) Registers
+ */
+#define RI_BASE_REG 0x04700000
+
+/* RI mode (R/W): [1:0] operating mode, [2] stop T active, [3] stop R active */
+#define RI_MODE_REG (RI_BASE_REG+0x00)
+
+/* RI config (R/W): [5:0] current control input, [6] current control enable */
+#define RI_CONFIG_REG (RI_BASE_REG+0x04)
+
+/* RI current load (W): [] any write updates current control register */
+#define RI_CURRENT_LOAD_REG (RI_BASE_REG+0x08)
+
+/* RI select (R/W): [2:0] receive select, [2:0] transmit select */
+#define RI_SELECT_REG (RI_BASE_REG+0x0C)
+
+/* RI refresh (R/W): [7:0] clean refresh delay, [15:8] dirty refresh delay,
+ * [16] refresh bank, [17] refresh enable
+ * [18] refresh optimize
+ */
+#define RI_REFRESH_REG (RI_BASE_REG+0x10)
+#define RI_COUNT_REG RI_REFRESH_REG
+
+/* RI latency (R/W): [3:0] DMA latency/overlap */
+#define RI_LATENCY_REG (RI_BASE_REG+0x14)
+
+/* RI error (R): [0] nack error, [1] ack error */
+#define RI_RERROR_REG (RI_BASE_REG+0x18)
+
+/* RI error (W): [] any write clears all error bits */
+#define RI_WERROR_REG (RI_BASE_REG+0x1C)
+
+
+/*************************************************************************
+ * Serial Interface (SI) Registers
+ */
+#define SI_BASE_REG 0x04800000
+
+/* SI DRAM address (R/W): [23:0] starting RDRAM address */
+#define SI_DRAM_ADDR_REG (SI_BASE_REG+0x00) /* R0: DRAM address */
+
+/* SI address read 64B (W): [] any write causes a 64B DMA write */
+#define SI_PIF_ADDR_RD64B_REG (SI_BASE_REG+0x04) /* R1: 64B PIF->DRAM */
+
+/* Address SI_BASE_REG + (0x08, 0x0c, 0x14) are reserved */
+
+/* SI address write 64B (W): [] any write causes a 64B DMA read */
+#define SI_PIF_ADDR_WR64B_REG (SI_BASE_REG+0x10) /* R4: 64B DRAM->PIF */
+
+/*
+ * SI status (W): [] any write clears interrupt
+ * (R): [0] DMA busy, [1] IO read busy, [2] reserved
+ * [3] DMA error, [12] interrupt
+ */
+#define SI_STATUS_REG (SI_BASE_REG+0x18) /* R6: Status */
+
+/* SI status register has the following bits active:
+ * 0: DMA busy - set when DMA is in progress
+ * 1: IO busy - set when IO access is in progress
+ * 3: DMA error - set when there are overlapping DMA requests
+ * 12: Interrupt - Interrupt set
+ */
+#define SI_STATUS_DMA_BUSY 0x0001
+#define SI_STATUS_RD_BUSY 0x0002
+#define SI_STATUS_DMA_ERROR 0x0008
+#define SI_STATUS_INTERRUPT 0x1000
+
+/*************************************************************************
+ * Development Board GIO Control Registers
+ */
+
+#define GIO_BASE_REG 0x18000000
+
+/* Game to Host Interrupt */
+#define GIO_GIO_INTR_REG (GIO_BASE_REG+0x000)
+
+/* Game to Host SYNC */
+#define GIO_GIO_SYNC_REG (GIO_BASE_REG+0x400)
+
+/* Host to Game Interrupt */
+#define GIO_CART_INTR_REG (GIO_BASE_REG+0x800)
+
+
+/*************************************************************************
+ * Common macros
+ */
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr))
+#define IO_WRITE(addr,data) (*(vu32 *)PHYS_TO_K1(addr)=(u32)(data))
+#define RCP_STAT_PRINT \
+ rmonPrintf("current=%x start=%x end=%x dpstat=%x spstat=%x\n", \
+ IO_READ(DPC_CURRENT_REG), \
+ IO_READ(DPC_START_REG), \
+ IO_READ(DPC_END_REG), \
+ IO_READ(DPC_STATUS_REG), \
+ IO_READ(SP_STATUS_REG))
+
+#endif
+
+#endif /* _RCP_H_ */
+
diff --git a/include/2.0L/PR/rdb.h b/include/2.0L/PR/rdb.h
new file mode 100755
index 00000000..c5c3159b
--- /dev/null
+++ b/include/2.0L/PR/rdb.h
@@ -0,0 +1,93 @@
+
+/**************************************************************************
+ *
+ * $Revision: 1.6 $
+ * $Date: 1997/02/11 08:29:31 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/rdb.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _RDB_H
+#define _RDB_H
+
+/* U64 side address */
+#define RDB_BASE_REG 0xc0000000
+#define RDB_WRITE_INTR_REG (RDB_BASE_REG + 0x8)
+#define RDB_READ_INTR_REG (RDB_BASE_REG + 0xc)
+#define RDB_BASE_VIRTUAL_ADDR 0x80000000
+
+/* packet type Have six bits, so can have up to 63 types */
+#define RDB_TYPE_INVALID 0
+#define RDB_TYPE_GtoH_PRINT 1
+#define RDB_TYPE_GtoH_FAULT 2
+#define RDB_TYPE_GtoH_LOG_CT 3
+#define RDB_TYPE_GtoH_LOG 4
+#define RDB_TYPE_GtoH_READY_FOR_DATA 5
+#define RDB_TYPE_GtoH_DATA_CT 6
+#define RDB_TYPE_GtoH_DATA 7
+#define RDB_TYPE_GtoH_DEBUG 8
+#define RDB_TYPE_GtoH_RAMROM 9
+#define RDB_TYPE_GtoH_DEBUG_DONE 10
+#define RDB_TYPE_GtoH_DEBUG_READY 11
+#define RDB_TYPE_GtoH_KDEBUG 12
+#define RDB_TYPE_GtoH_PROF_DATA 22
+
+
+#define RDB_TYPE_HtoG_LOG_DONE 13
+#define RDB_TYPE_HtoG_DEBUG 14
+#define RDB_TYPE_HtoG_DEBUG_CT 15
+#define RDB_TYPE_HtoG_DATA 16
+#define RDB_TYPE_HtoG_DATA_DONE 17
+#define RDB_TYPE_HtoG_REQ_RAMROM 18
+#define RDB_TYPE_HtoG_FREE_RAMROM 19
+#define RDB_TYPE_HtoG_KDEBUG 20
+#define RDB_TYPE_HtoG_PROF_SIGNAL 21
+
+
+#define RDB_PROF_ACK_SIG 1
+#define RDB_PROF_FLUSH_SIG 2
+#define PROF_BLOCK_SIZE 2048
+
+#define RDB_LOG_MAX_BLOCK_SIZE 0x8000
+#define RDB_DATA_MAX_BLOCK_SIZE 0x8000
+
+
+/* GIO side address */
+#define GIO_RDB_BASE_REG 0xbf480000
+#define GIO_RDB_WRITE_INTR_REG (GIO_RDB_BASE_REG + 0x8)
+#define GIO_RDB_READ_INTR_REG (GIO_RDB_BASE_REG + 0xc)
+
+/* minor device number */
+#define GIO_RDB_PRINT_MINOR 1
+#define GIO_RDB_DEBUG_MINOR 2
+
+/* interrupt bit */
+#define GIO_RDB_WRITE_INTR_BIT 0x80000000
+#define GIO_RDB_READ_INTR_BIT 0x40000000
+
+/* debug command */
+#define DEBUG_COMMAND_NULL 0
+#define DEBUG_COMMAND_MEMORY 1
+#define DEBUG_COMMAND_REGISTER 2
+#define DEBUG_COMMAND_INVALID 255
+
+/* debug state */
+#define DEBUG_STATE_NULL 0
+#define DEBUG_STATE_RECEIVE 1
+#define DEBUG_STATE_INVALID 255
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/* Structure for debug port */
+typedef struct {
+ unsigned type : 6; /* 0: invalid, 1: print, 2: debug */
+ unsigned length : 2; /* 1, 2, or 3 */
+ char buf[3]; /* character buffer */
+} rdbPacket;
+
+extern unsigned int __osRdbWriteOK;
+extern unsigned int __osRdbSendMessage;
+
+#endif /* _LANGUAGE_C */
+
+#endif /* !_RDB_H */
diff --git a/include/2.0L/PR/region.h b/include/2.0L/PR/region.h
new file mode 100755
index 00000000..9f8bb7f1
--- /dev/null
+++ b/include/2.0L/PR/region.h
@@ -0,0 +1,123 @@
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * Module: region.h
+ *
+ * $Revision: 1.8 $
+ * $Date: 1997/11/26 00:30:56 $
+ * $Author: mitu $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/region.h,v $
+ *
+ * Description:
+ * This file contains macros and structure definitions for the region
+ * library.
+ *
+ **************************************************************************/
+
+
+#ifndef _REGION_H_
+#define _REGION_H_
+
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+
+/***************************************
+ *
+ * Global defines
+ *
+ */
+ /* Alignment sizes */
+#define ALIGNSZ (sizeof(long long)) /* 8 bytes */
+#define ALIGNOFFST (ALIGNSZ-1)
+
+ /* size for storing index to free buffer */
+#define BUF_CTRL_SIZE ALIGNSZ
+
+ /* Max bufcount = 32K */
+#define MAX_BUFCOUNT 0x8000
+ /* code for last free buffer */
+#define BUF_FREE_WO_NEXT 0x8000
+
+/*
+ * Global defines for alignment size (default is 8-byte alignment)
+ */
+#define OS_RG_ALIGN_2B 2 /* 2 bytes = 16-bit alignment */
+#define OS_RG_ALIGN_4B 4 /* 4 bytes = 32-bit alignment */
+#define OS_RG_ALIGN_8B 8 /* 8 bytes = 64-bit alignment */
+#define OS_RG_ALIGN_16B 16 /* 16 bytes = 128-bit alignment */
+
+#define OS_RG_ALIGN_DEFAULT OS_RG_ALIGN_8B
+
+
+/***************************************
+ *
+ * Macro definitions
+ *
+ */
+
+/* Perform alignment on input 's' */
+#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1))
+
+
+/***************************************
+ *
+ * Typedefs & structure definitions
+ *
+ */
+/*
+ * Structure for region header/control area
+ */
+typedef struct _Region_s {
+ u8 *r_startBufferAddress; /* start address to data buffer */
+ u8 *r_endAddress; /* end address of region */
+ s32 r_bufferSize; /* size of buffers for this region */
+ s32 r_bufferCount; /* up to 32K entries; MSB is used for
+ setting end-of-list/used */
+ u16 r_freeList; /* point to array index of first
+ available memory buffer */
+ u16 r_alignSize; /* alignment size (# of bytes) */
+} OSRegion;
+
+/*
+ * Macro to simplify accessing region header structure
+ */
+#define RP(x) rp->r_##x
+
+
+/***************************************
+ *
+ * Function prototypes
+ *
+ */
+extern void *osCreateRegion(void *, u32, u32, u32);
+extern void *osMalloc(void *);
+extern void osFree(void *, void *);
+extern s32 osGetRegionBufCount(void *);
+extern s32 osGetRegionBufSize(void *);
+
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+
+#endif /* _REGION_H_ */
+
+
diff --git a/include/2.0L/PR/rmon.h b/include/2.0L/PR/rmon.h
new file mode 100755
index 00000000..ea826d17
--- /dev/null
+++ b/include/2.0L/PR/rmon.h
@@ -0,0 +1,39 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.6 $
+ * $Date: 1997/02/11 08:30:08 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/rmon.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _RMON_H_
+#define _RMON_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+#define RMON_DBG_BUF_SIZE 2048
+#define RMON_STACKSIZE 0x1000
+
+extern void rmonMain( void * );
+extern void rmonPrintf( const char *, ... );
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !_OS_H */
diff --git a/include/2.0L/PR/sched.h b/include/2.0L/PR/sched.h
new file mode 100755
index 00000000..9addae7d
--- /dev/null
+++ b/include/2.0L/PR/sched.h
@@ -0,0 +1,115 @@
+/*====================================================================
+ * sched.h
+ *
+ * Synopsis:
+ *
+ * Copyright 1993, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * $Revision: 1.7 $
+ * $Date: 1997/02/11 08:32:02 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/sched.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __sched__
+#define __sched__
+
+#include
+
+#define OS_SC_STACKSIZE 0x2000
+
+#define OS_SC_RETRACE_MSG 1
+#define OS_SC_DONE_MSG 2
+#define OS_SC_RDP_DONE_MSG 3
+#define OS_SC_PRE_NMI_MSG 4
+#define OS_SC_LAST_MSG 4 /* this should have highest number */
+#define OS_SC_MAX_MESGS 8
+
+typedef struct {
+ short type;
+ char misc[30];
+} OSScMsg;
+
+typedef struct OSScTask_s {
+ struct OSScTask_s *next; /* note: this must be first */
+ u32 state;
+ u32 flags;
+ void *framebuffer; /* used by graphics tasks */
+
+ OSTask list;
+ OSMesgQueue *msgQ;
+ OSMesg msg;
+#ifndef _FINALROM /* all #ifdef items should */
+ OSTime startTime; /* remain at the end!!, or */
+ OSTime totalTime; /* possible conflict if */
+#endif /* FINALROM library used with */
+} OSScTask; /* non FINALROM code */
+
+/*
+ * OSScTask flags:
+ */
+#define OS_SC_NEEDS_RDP 0x0001 /* uses the RDP */
+#define OS_SC_NEEDS_RSP 0x0002 /* uses the RSP */
+#define OS_SC_DRAM_DLIST 0x0004 /* SP & DP communicate through DRAM */
+#define OS_SC_PARALLEL_TASK 0x0010 /* must be first gfx task on list */
+#define OS_SC_LAST_TASK 0x0020 /* last task in queue for frame */
+#define OS_SC_SWAPBUFFER 0x0040 /* swapbuffers when gfx task done */
+
+#define OS_SC_RCP_MASK 0x0003 /* mask for needs bits */
+#define OS_SC_TYPE_MASK 0x0007 /* complete type mask */
+/*
+ * OSScClient:
+ *
+ * Data structure used by threads that wish to communicate to the
+ * scheduling thread
+ *
+ */
+typedef struct SCClient_s {
+ struct SCClient_s *next; /* next client in the list */
+ OSMesgQueue *msgQ; /* where to send the frame msg */
+} OSScClient;
+
+typedef struct {
+ OSScMsg retraceMsg;
+ OSScMsg prenmiMsg;
+ OSMesgQueue interruptQ;
+ OSMesg intBuf[OS_SC_MAX_MESGS];
+ OSMesgQueue cmdQ;
+ OSMesg cmdMsgBuf[OS_SC_MAX_MESGS];
+ OSThread thread;
+ OSScClient *clientList;
+ OSScTask *audioListHead;
+ OSScTask *gfxListHead;
+ OSScTask *audioListTail;
+ OSScTask *gfxListTail;
+ OSScTask *curRSPTask;
+ OSScTask *curRDPTask;
+ u32 frameCount;
+ s32 doAudio;
+} OSSched;
+
+void osCreateScheduler(OSSched *s, void *stack, OSPri priority,
+ u8 mode, u8 numFields);
+void osScAddClient(OSSched *s, OSScClient *c, OSMesgQueue *msgQ);
+void osScRemoveClient(OSSched *s, OSScClient *c);
+OSMesgQueue *osScGetCmdQ(OSSched *s);
+
+#endif
+
diff --git a/include/2.0L/PR/sp.h b/include/2.0L/PR/sp.h
new file mode 100755
index 00000000..24f11a1d
--- /dev/null
+++ b/include/2.0L/PR/sp.h
@@ -0,0 +1,177 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * Sprite library include file
+ *
+ * $Revision: 1.15 $
+ * $Date: 1997/02/11 08:33:02 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/sp.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _SP_H_
+#define _SP_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+#include
+
+struct bitmap {
+ s16 width; /* Size across to draw in texels */
+ /* Done if width = 0 */
+
+ s16 width_img; /* Size across of bitmap in texels */
+ /* Done if width = 0 */
+
+ s16 s; /* Horizontal offset into bitmap */
+ /* if (s > width), then load only! */
+
+ s16 t; /* Vertical offset into base */
+
+ void *buf; /* Pointer to bitmap data */
+ /* Don't re-load if new buf */
+ /* is the same as the old one */
+ /* Skip if NULL */
+
+ s16 actualHeight; /* True Height of this bitmap piece */
+
+ s16 LUToffset; /* LUT base index */
+};
+
+typedef struct bitmap Bitmap;
+
+struct sprite {
+ s16 x,y; /* Target position */
+
+ s16 width, height; /* Target size */
+
+ f32 scalex, scaley; /* Texel to Pixel scale factor */
+
+ s16 expx, expy; /* Explosion spacing */
+
+ u16 attr; /* Attribute Flags */
+ s16 zdepth; /* Z Depth */
+
+ u8 red; /* Red component */
+ u8 green; /* Green component */
+ u8 blue; /* Blue component */
+ u8 alpha; /* Alpha component */
+
+ s16 startTLUT; /* Lookup Table Entry Starting index */
+ s16 nTLUT; /* Total number of Lookup Table Entries */
+
+ int *LUT; /* Pointer to Lookup Table */
+
+ s16 istart; /* Starting bitmap index */
+ s16 istep; /* Bitmaps index step (see SP_INCY) */
+ /* if 0, then variable width bitmaps */
+
+ s16 nbitmaps; /* Total number of bitmaps */
+ s16 ndisplist; /* Total number of display-list words */
+
+ s16 bmheight; /* Bitmap Texel height (Used) */
+ s16 bmHreal; /* Bitmap Texel height (Real) */
+ u8 bmfmt; /* Bitmap Format */
+ u8 bmsiz; /* Bitmap Texel Size */
+
+ Bitmap *bitmap; /* Pointer to first bitmap */
+
+ Gfx *rsp_dl; /* Pointer to RSP display list */
+
+ Gfx *rsp_dl_next; /* Pointer to next RSP display entry */
+
+ s16 frac_s, /* Fractional Texture offsets */
+ frac_t; /* These have 5 fraction bits */
+};
+
+typedef struct sprite Sprite;
+
+/*
+ * DANGER!
+ * This is bad programming. Where the *heck* do these numbers come
+ * from?
+ *
+ * They are obviously 'maximums' from the sprite library, but since
+ * the sprite library is built on top of gbi.h, which includes macros
+ * that decode into multiple macros, etc., it is nearly impossible to
+ * know what these maximums should be.
+ *
+ * Worse, there are some gbi macros (texture alignment mostly) that
+ * decode into *many* macros, so if we choose that as a maximum, we
+ * are wasting TONS of space...
+ *
+ * These numbers work for "reasonable" sprite library usage, and
+ * there is an assert() in the library to detect when they aren't
+ * enough. (use the debug version)
+ */
+#define DL_BM_OVERHEAD (12)
+#define DL_SPRITE_OVERHEAD (24)
+
+#define NUM_DL(nb) ((nb)*DL_BM_OVERHEAD +DL_SPRITE_OVERHEAD)
+
+/*
+ * Misc constants
+ */
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/*
+ * For sprite->attr
+ */
+
+#define SP_TRANSPARENT 0x00000001
+#define SP_CUTOUT 0x00000002
+#define SP_HIDDEN 0x00000004
+#define SP_Z 0x00000008
+#define SP_SCALE 0x00000010
+#define SP_FASTCOPY 0x00000020
+#define SP_OVERLAP 0x00000040
+#define SP_TEXSHIFT 0x00000080
+#define SP_FRACPOS 0x00000100
+#define SP_TEXSHUF 0x00000200
+#define SP_EXTERN 0x00000400
+
+/*
+ * Function prototypes
+ */
+
+void spSetAttribute (Sprite *sp, s32 attr);
+void spClearAttribute (Sprite *sp, s32 attr);
+void spMove (Sprite *sp, s32 x, s32 y);
+void spScale (Sprite *sp, f32 sx, f32 sy);
+void spSetZ (Sprite *sp, s32 z );
+void spColor (Sprite *sp, u8 red, u8 green, u8 blue, u8 alpha);
+Gfx *spDraw (Sprite *sp);
+void spInit( Gfx **glistp );
+void spScissor( s32 xmin, s32 xmax, s32 ymin, s32 ymax );
+void spFinish( Gfx **glistp );
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* _SP_H_ */
diff --git a/include/2.0L/PR/sptask.h b/include/2.0L/PR/sptask.h
new file mode 100755
index 00000000..603d92e0
--- /dev/null
+++ b/include/2.0L/PR/sptask.h
@@ -0,0 +1,201 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.8 $
+ * $Date: 1997/11/10 10:48:35 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/sptask.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _SPTASK_H_
+#define _SPTASK_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/**************************************************************************
+ *
+ * Type definitions
+ *
+ */
+
+/*
+ * Task List Structure.
+ *
+ * Things an app might pass to the SP via the task list.
+ * Not every task ucode would need/use every field, but
+ *
+ * - type (audio, gfx, video, ...)
+ * - flags
+ * - wait for DP to drain before running new task
+ * - SEE BIT DEFINITIONS UNDER "Task Flags field"
+ * - pointer to boot ucode
+ * - size of boot ucode
+ * - pointer to ucode
+ * - size of ucode
+ * - pointer to initial DMEM data
+ * - size of initial DMEM data
+ * - pointer to DRAM stack
+ * - size of DRAM stack (max)
+ * - pointer to output buffer
+ * - pointer to store output buffer length
+ * - generic data pointer (for display list, etc.)
+ * - generic data length (for display list, etc.)
+ * - pointer to buffer where to store saved DMEM (in yield case)
+ * - size of buffer to store saved DMEM.
+ *
+ * IMPORTANT!!! Watch alignment issues.
+ *
+ * IMPORTANT!!! Watch data cache issues. The RCP may write data into the
+ * dram_stack, output_buff, output_buff_size, and the yield_data_ptr areas.
+ * These buffers should be cache aligned and use the entire line (16 bytes) to
+ * avoid corruption by writebacks by the CPU (cache tearing).
+ *
+ * IMPORTANT!!! all addresses are virtual addresses. Library does
+ * any necessary translation.
+ *
+ */
+typedef struct {
+ u32 type;
+ u32 flags;
+
+ u64 *ucode_boot;
+ u32 ucode_boot_size;
+
+ u64 *ucode;
+ u32 ucode_size;
+
+ u64 *ucode_data;
+ u32 ucode_data_size;
+
+ u64 *dram_stack;
+ u32 dram_stack_size;
+
+ u64 *output_buff;
+ u64 *output_buff_size;
+
+ u64 *data_ptr;
+ u32 data_size;
+
+ u64 *yield_data_ptr;
+ u32 yield_data_size;
+
+} OSTask_t;
+
+typedef union {
+ OSTask_t t;
+ long long int force_structure_alignment;
+} OSTask;
+
+typedef u32 OSYieldResult;
+
+#endif /* _LANGUAGE_C */
+
+#ifdef _LANGUAGE_ASSEMBLY
+
+/*
+ * For the RSP ucode:
+ * offsets into the task structure
+ */
+
+#include
+
+#endif
+
+/*
+ * Task Flags field
+ */
+#define OS_TASK_YIELDED 0x0001
+#define OS_TASK_DP_WAIT 0x0002
+#define OS_TASK_LOADABLE 0x0004
+#define OS_TASK_SP_ONLY 0x0008
+#define OS_TASK_USR0 0x0010
+#define OS_TASK_USR1 0x0020
+#define OS_TASK_USR2 0x0040
+#define OS_TASK_USR3 0x0080
+
+/*
+ * Size of Yield buffer. The taskHdrPtr->t.yield_data_ptr must point to a
+ * buffer of this size. (The size is in bytes). ONLY If the task will NEVER
+ * yield it may be a null pointer. The buffer must be aligned to a 64 bit
+ * boundary. The taskHdrPtr->t.yield_data_ptr must be set to point to the
+ * buffer BEFORE the task is started.
+ */
+#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)|| defined(F3DEX2_GBI))
+#define OS_YIELD_DATA_SIZE 0xc00
+#else
+#define OS_YIELD_DATA_SIZE 0x900
+#endif
+#define OS_YIELD_AUDIO_SIZE 0x400
+
+/**************************************************************************
+ *
+ * Global definitions
+ *
+ */
+
+
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/**************************************************************************
+ *
+ * Macro definitions
+ *
+ */
+
+/*
+ * this macro simulates atomic action.
+ */
+#define osSpTaskStart(tp) \
+ { \
+ osSpTaskLoad((tp)); \
+ osSpTaskStartGo((tp)); \
+ }
+
+
+/**************************************************************************
+ *
+ * Extern variables
+ *
+ */
+
+
+/**************************************************************************
+ *
+ * Function prototypes
+ *
+ */
+
+/*
+ * break this up into two steps for debugging.
+ */
+extern void osSpTaskLoad(OSTask *tp);
+extern void osSpTaskStartGo(OSTask *tp);
+
+extern void osSpTaskYield(void);
+extern OSYieldResult osSpTaskYielded(OSTask *tp);
+
+#endif /* _LANGUAGE_C */
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !_SPTASK_H */
diff --git a/include/2.0L/PR/ucode.h b/include/2.0L/PR/ucode.h
new file mode 100755
index 00000000..1025d2f9
--- /dev/null
+++ b/include/2.0L/PR/ucode.h
@@ -0,0 +1,186 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.13 $
+ * $Date: 1997/11/07 04:55:12 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ucode.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _UCODE_H_
+#define _UCODE_H_
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/**************************************************************************
+ *
+ * Macro definitions
+ *
+ */
+
+/*
+ * This is the recommended size of the SP DRAM stack area, used
+ * by the graphics ucode. This stack is used primarily for the
+ * matrix stack, so it needs to be AT LEAST (10 * 64bytes) in size.
+ */
+#define SP_DRAM_STACK_SIZE8 (1024)
+#define SP_DRAM_STACK_SIZE64 (SP_DRAM_STACK_SIZE8 >> 3)
+
+/*
+ * This is the size of the IMEM, which is also the size of the
+ * graphics microcode. (other ucode might be less)
+ * This value is used in apps to tell the OS how much ucode to
+ * load.
+ */
+#define SP_UCODE_SIZE 4096
+
+/*
+ * This is 1/2 the size of DMEM, which is the maximum amount of
+ * initialized DMEM data any of the ucode tasks need to start up.
+ * This value is dependent on all of the task ucodes, and is therefore
+ * fixed per release.
+ */
+#define SP_UCODE_DATA_SIZE 2048
+
+
+/**************************************************************************
+ *
+ * Extern variables
+ *
+ */
+
+/*
+ * Symbols generated by "rsp2elf", included by "makerom" that indicate
+ * the location and size of the SP microcode objects. The ucode objects
+ * are loaded as part of the codesegment (arbitrary, could do other
+ * ways)
+ *
+ */
+
+/* standard boot ucode: */
+extern long long int rspbootTextStart[], rspbootTextEnd[];
+
+/* standard 3D ucode: */
+extern long long int gspFast3DTextStart[], gspFast3DTextEnd[];
+extern long long int gspFast3DDataStart[], gspFast3DDataEnd[];
+
+/* 3D ucode with output to DRAM: */
+extern long long int gspFast3D_dramTextStart[], gspFast3D_dramTextEnd[];
+extern long long int gspFast3D_dramDataStart[], gspFast3D_dramDataEnd[];
+
+/* 3D ucode with output through DRAM FIFO to RDP: */
+extern long long int gspFast3D_fifoTextStart[], gspFast3D_fifoTextEnd[];
+extern long long int gspFast3D_fifoDataStart[], gspFast3D_fifoDataEnd[];
+
+/* 3D ucode without nearclip: */
+extern long long int gspF3DNoNTextStart[], gspF3DNoNTextEnd[];
+extern long long int gspF3DNoNDataStart[], gspF3DNoNDataEnd[];
+
+/* 3D ucode without nearclip with output to DRAM: */
+extern long long int gspF3DNoN_dramTextStart[];
+extern long long int gspF3DNoN_dramTextEnd[];
+extern long long int gspF3DNoN_dramDataStart[];
+extern long long int gspF3DNoN_dramDataEnd[];
+
+/* 3D ucode without nearclip with output through DRAM FIFO to RDP: */
+extern long long int gspF3DNoN_fifoTextStart[];
+extern long long int gspF3DNoN_fifoTextEnd[];
+extern long long int gspF3DNoN_fifoDataStart[];
+extern long long int gspF3DNoN_fifoDataEnd[];
+
+/* 3D line ucode: */
+extern long long int gspLine3DTextStart[], gspLine3DTextEnd[];
+extern long long int gspLine3DDataStart[], gspLine3DDataEnd[];
+
+/* 3D line ucode with output to DRAM: */
+extern long long int gspLine3D_dramTextStart[], gspLine3D_dramTextEnd[];
+extern long long int gspLine3D_dramDataStart[], gspLine3D_dramDataEnd[];
+
+/* 3D line ucode with output through DRAM FIFO to RDP: */
+extern long long int gspLine3D_fifoTextStart[], gspLine3D_fifoTextEnd[];
+extern long long int gspLine3D_fifoDataStart[], gspLine3D_fifoDataEnd[];
+
+/* 2D sprite ucode: */
+extern long long int gspSprite2DTextStart[], gspSprite2DTextEnd[];
+extern long long int gspSprite2DDataStart[], gspSprite2DDataEnd[];
+
+/* 2D sprite ucode with output to DRAM: */
+extern long long int gspSprite2D_dramTextStart[], gspSprite2D_dramTextEnd[];
+extern long long int gspSprite2D_dramDataStart[], gspSprite2D_dramDataEnd[];
+
+/* 2D sprite ucode with output through DRAM FIFO to RDP: */
+extern long long int gspSprite2D_fifoTextStart[], gspSprite2D_fifoTextEnd[];
+extern long long int gspSprite2D_fifoDataStart[], gspSprite2D_fifoDataEnd[];
+
+/* basic audio ucode: */
+extern long long int aspMainTextStart[], aspMainTextEnd[];
+extern long long int aspMainDataStart[], aspMainDataEnd[];
+
+/*========== F3DEX/F3DLX/F3DLP/L3DEX ==========*/
+/* FIFO version only */
+extern long long int gspF3DEX_fifoTextStart[], gspF3DEX_fifoTextEnd[];
+extern long long int gspF3DEX_fifoDataStart[], gspF3DEX_fifoDataEnd[];
+extern long long int gspF3DEX_NoN_fifoTextStart[], gspF3DEX_NoN_fifoTextEnd[];
+extern long long int gspF3DEX_NoN_fifoDataStart[], gspF3DEX_NoN_fifoDataEnd[];
+
+extern long long int gspF3DLX_fifoTextStart[], gspF3DLX_fifoTextEnd[];
+extern long long int gspF3DLX_fifoDataStart[], gspF3DLX_fifoDataEnd[];
+extern long long int gspF3DLX_NoN_fifoTextStart[], gspF3DLX_NoN_fifoTextEnd[];
+extern long long int gspF3DLX_NoN_fifoDataStart[], gspF3DLX_NoN_fifoDataEnd[];
+extern long long int gspF3DLX_Rej_fifoTextStart[], gspF3DLX_Rej_fifoTextEnd[];
+extern long long int gspF3DLX_Rej_fifoDataStart[], gspF3DLX_Rej_fifoDataEnd[];
+
+extern long long int gspF3DLP_Rej_fifoTextStart[], gspF3DLP_Rej_fifoTextEnd[];
+extern long long int gspF3DLP_Rej_fifoDataStart[], gspF3DLP_Rej_fifoDataEnd[];
+extern long long int gspL3DEX_fifoTextStart[], gspL3DEX_fifoTextEnd[];
+extern long long int gspL3DEX_fifoDataStart[], gspL3DEX_fifoDataEnd[];
+
+/*========== F3DEX2/F3DLX2/F3DLP2/L3DEX2 ==========*/
+/* FIFO version only */
+extern long long int gspF3DEX2_fifoTextStart[], gspF3DEX2_fifoTextEnd[];
+extern long long int gspF3DEX2_fifoDataStart[], gspF3DEX2_fifoDataEnd[];
+extern long long int gspF3DEX2_NoN_fifoTextStart[],gspF3DEX2_NoN_fifoTextEnd[];
+extern long long int gspF3DEX2_NoN_fifoDataStart[],gspF3DEX2_NoN_fifoDataEnd[];
+
+extern long long int gspF3DLX2_fifoTextStart[], gspF3DLX2_fifoTextEnd[];
+extern long long int gspF3DLX2_fifoDataStart[], gspF3DLX2_fifoDataEnd[];
+extern long long int gspF3DLX2_NoN_fifoTextStart[],gspF3DLX2_NoN_fifoTextEnd[];
+extern long long int gspF3DLX2_NoN_fifoDataStart[],gspF3DLX2_NoN_fifoDataEnd[];
+extern long long int gspF3DLX2_Rej_fifoTextStart[],gspF3DLX2_Rej_fifoTextEnd[];
+extern long long int gspF3DLX2_Rej_fifoDataStart[],gspF3DLX2_Rej_fifoDataEnd[];
+
+extern long long int gspF3DLP2_Rej_fifoTextStart[],gspF3DLP2_Rej_fifoTextEnd[];
+extern long long int gspF3DLP2_Rej_fifoDataStart[],gspF3DLP2_Rej_fifoDataEnd[];
+extern long long int gspL3DEX2_fifoTextStart[], gspL3DEX2_fifoTextEnd[];
+extern long long int gspL3DEX2_fifoDataStart[], gspL3DEX2_fifoDataEnd[];
+
+/**************************************************************************
+ *
+ * Function prototypes
+ *
+ */
+
+#endif /* _LANGUAGE_C */
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* !_UCODE_H */
diff --git a/include/2.0L/PR/ultraerror.h b/include/2.0L/PR/ultraerror.h
new file mode 100755
index 00000000..ef470ba7
--- /dev/null
+++ b/include/2.0L/PR/ultraerror.h
@@ -0,0 +1,165 @@
+/*====================================================================
+ * ultraerror.h
+ *
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * $Revision: 1.23 $
+ * $Date: 1997/02/11 08:38:08 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ultraerror.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __ULTRAERROR_H__
+#define __ULTRAERROR_H__
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#define OS_ERROR_FMT "/usr/lib/PR/error.fmt"
+#define OS_ERROR_MAGIC 0x6b617479
+
+/* OS error codes */
+
+#define ERR_OSCREATETHREAD_SP 1
+#define ERR_OSCREATETHREAD_PRI 2
+#define ERR_OSSTARTTHREAD 3
+#define ERR_OSSETTHREADPRI 4
+#define ERR_OSCREATEMESGQUEUE 5
+#define ERR_OSSENDMESG 6
+#define ERR_OSJAMMESG 7
+#define ERR_OSRECVMESG 8
+#define ERR_OSSETEVENTMESG 9
+#define ERR_OSMAPTLB_INDEX 10
+#define ERR_OSMAPTLB_ASID 11
+#define ERR_OSUNMAPTLB 12
+#define ERR_OSSETTLBASID 13
+#define ERR_OSAISETFREQUENCY 14
+#define ERR_OSAISETNEXTBUFFER_ADDR 15
+#define ERR_OSAISETNEXTBUFFER_SIZE 16
+#define ERR_OSDPSETNEXTBUFFER_ADDR 17
+#define ERR_OSDPSETNEXTBUFFER_SIZE 18
+#define ERR_OSPIRAWREADIO 19
+#define ERR_OSPIRAWWRITEIO 20
+#define ERR_OSPIRAWSTARTDMA_DIR 21
+#define ERR_OSPIRAWSTARTDMA_DEVADDR 22
+#define ERR_OSPIRAWSTARTDMA_ADDR 23
+#define ERR_OSPIRAWSTARTDMA_SIZE 24
+#define ERR_OSPIRAWSTARTDMA_RANGE 25
+#define ERR_OSPIREADIO 26
+#define ERR_OSPIWRITEIO 27
+#define ERR_OSPISTARTDMA_PIMGR 28
+#define ERR_OSPISTARTDMA_PRI 29
+#define ERR_OSPISTARTDMA_DIR 30
+#define ERR_OSPISTARTDMA_DEVADDR 31
+#define ERR_OSPISTARTDMA_ADDR 32
+#define ERR_OSPISTARTDMA_SIZE 33
+#define ERR_OSPISTARTDMA_RANGE 34
+#define ERR_OSCREATEPIMANAGER 35
+#define ERR_OSVIGETCURRENTMODE 36
+#define ERR_OSVIGETCURRENTFRAMEBUFFER 37
+#define ERR_OSVIGETNEXTFRAMEBUFFER 38
+#define ERR_OSVISETXSCALE_VALUE 39
+#define ERR_OSVISETXSCALE_VIMGR 40
+#define ERR_OSVISETYSCALE_VALUE 41
+#define ERR_OSVISETYSCALE_VIMGR 42
+#define ERR_OSVISETSPECIAL_VALUE 43
+#define ERR_OSVISETSPECIAL_VIMGR 44
+#define ERR_OSVISETMODE 45
+#define ERR_OSVISETEVENT 46
+#define ERR_OSVISWAPBUFFER_ADDR 47
+#define ERR_OSVISWAPBUFFER_VIMGR 48
+#define ERR_OSCREATEVIMANAGER 49
+#define ERR_OSCREATEREGION_ALIGN 50
+#define ERR_OSCREATEREGION_SIZE 51
+#define ERR_OSMALLOC 52
+#define ERR_OSFREE_REGION 53
+#define ERR_OSFREE_ADDR 54
+#define ERR_OSGETREGIONBUFCOUNT 55
+#define ERR_OSGETREGIONBUFSIZE 56
+#define ERR_OSSPTASKLOAD_DRAM 57
+#define ERR_OSSPTASKLOAD_OUT 58
+#define ERR_OSSPTASKLOAD_OUTSIZE 59
+#define ERR_OSSPTASKLOAD_YIELD 60
+#define ERR_OSPROFILEINIT_STR 61
+#define ERR_OSPROFILEINIT_CNT 62
+#define ERR_OSPROFILEINIT_ALN 63
+#define ERR_OSPROFILEINIT_ORD 64
+#define ERR_OSPROFILEINIT_SIZ 65
+#define ERR_OSPROFILESTART_TIME 66
+#define ERR_OSPROFILESTART_FLAG 67
+#define ERR_OSPROFILESTOP_FLAG 68
+#define ERR_OSPROFILESTOP_TIMER 69
+#define ERR_OSREADHOST_ADDR 70
+#define ERR_OSREADHOST_SIZE 71
+#define ERR_OSWRITEHOST_ADDR 72
+#define ERR_OSWRITEHOST_SIZE 73
+#define ERR_OSGETTIME 74
+#define ERR_OSSETTIME 75
+#define ERR_OSSETTIMER 76
+#define ERR_OSSTOPTIMER 77
+#define ERR_ALSEQP_NO_SOUND 100
+#define ERR_ALSEQP_NO_VOICE 101
+#define ERR_ALSEQP_MAP_VOICE 102
+#define ERR_ALSEQP_OFF_VOICE 103
+#define ERR_ALSEQP_POLY_VOICE 104
+#define ERR_ALSNDP_NO_VOICE 105
+#define ERR_ALSYN_NO_UPDATE 106
+#define ERR_ALSNDPDEALLOCATE 107
+#define ERR_ALSNDPDELETE 108
+#define ERR_ALSNDPPLAY 109
+#define ERR_ALSNDPSETSOUND 110
+#define ERR_ALSNDPSETPRIORITY 111
+#define ERR_ALSNDPSETPAR 112
+#define ERR_ALBNKFNEW 113
+#define ERR_ALSEQNOTMIDI 114
+#define ERR_ALSEQNOTMIDI0 115
+#define ERR_ALSEQNUMTRACKS 116
+#define ERR_ALSEQTIME 117
+#define ERR_ALSEQTRACKHDR 118
+#define ERR_ALSEQSYSEX 119
+#define ERR_ALSEQMETA 120
+#define ERR_ALSEQPINVALIDPROG 121
+#define ERR_ALSEQPUNKNOWNMIDI 122
+#define ERR_ALSEQPUNMAP 123
+#define ERR_ALEVENTNOFREE 124
+#define ERR_ALHEAPNOFREE 125
+#define ERR_ALHEAPCORRUPT 126
+#define ERR_ALHEAPFIRSTBLOCK 127
+#define ERR_ALCSEQZEROSTATUS 128
+#define ERR_ALCSEQZEROVEL 129
+#define ERR_ALCSPVNOTFREE 130
+#define ERR_ALSEQOVERRUN 131
+#define ERR_OSAISETNEXTBUFFER_ENDADDR 132
+#define ERR_ALMODDELAYOVERFLOW 133
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+typedef void (*OSErrorHandler)(s16, s16, ...);
+
+OSErrorHandler osSetErrorHandler(OSErrorHandler);
+#endif
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif /* __ULTRAERROR_H__ */
diff --git a/include/2.0L/PR/ultralog.h b/include/2.0L/PR/ultralog.h
new file mode 100755
index 00000000..9f37359c
--- /dev/null
+++ b/include/2.0L/PR/ultralog.h
@@ -0,0 +1,74 @@
+/*====================================================================
+ * ultralog.h
+ *
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * $Revision: 1.6 $
+ * $Date: 1997/02/11 08:39:05 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ultralog.h,v $
+ *
+ **************************************************************************/
+
+#ifndef __log__
+#define __log__
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+extern "C" {
+#endif
+
+#include
+
+#define OS_LOG_MAX_ARGS 16
+#define OS_LOG_MAGIC 0x20736a73
+#define OS_LOG_FLOAT(x) (*(int *) &(x))
+#define OS_LOG_VERSION 1
+
+typedef struct {
+ u32 magic; /* log identifier */
+ u32 len; /* length of log data + log structure */
+ u32 *base; /* starting addr array */
+ s32 startCount; /* read offset from dataBase */
+ s32 writeOffset; /* write offset from dataBase */
+} OSLog;
+
+typedef struct {
+ u32 magic;
+ u32 timeStamp;
+ u16 argCount;
+ u16 eventID;
+} OSLogItem;
+
+typedef struct {
+ u32 magic; /* log identifier */
+ u32 version; /* 1 */
+} OSLogFileHdr;
+
+void osCreateLog(OSLog *log, u32 *base, s32 len);
+void osLogEvent(OSLog *log, s16 code, s16 numArgs, ...);
+void osFlushLog(OSLog *log);
+u32 osLogFloat(f32);
+
+extern void osDelay(int count);
+
+#ifdef _LANGUAGE_C_PLUS_PLUS
+}
+#endif
+
+#endif
diff --git a/include/2.0L/PR/ultratypes.h b/include/2.0L/PR/ultratypes.h
new file mode 100755
index 00000000..58fef8bd
--- /dev/null
+++ b/include/2.0L/PR/ultratypes.h
@@ -0,0 +1,90 @@
+#ifndef _ULTRATYPES_H_
+#define _ULTRATYPES_H_
+
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+
+/*************************************************************************
+ *
+ * File: ultratypes.h
+ *
+ * This file contains various types used in Ultra64 interfaces.
+ *
+ * $Revision: 1.6 $
+ * $Date: 1997/12/17 04:02:06 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ultratypes.h,v $
+ *
+ **************************************************************************/
+
+
+
+/**********************************************************************
+ * General data types for R4300
+ */
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+typedef unsigned char u8; /* unsigned 8-bit */
+typedef unsigned short u16; /* unsigned 16-bit */
+typedef unsigned long u32; /* unsigned 32-bit */
+typedef unsigned long long u64; /* unsigned 64-bit */
+
+typedef signed char s8; /* signed 8-bit */
+typedef short s16; /* signed 16-bit */
+typedef long s32; /* signed 32-bit */
+typedef long long s64; /* signed 64-bit */
+
+typedef volatile unsigned char vu8; /* unsigned 8-bit */
+typedef volatile unsigned short vu16; /* unsigned 16-bit */
+typedef volatile unsigned long vu32; /* unsigned 32-bit */
+typedef volatile unsigned long long vu64; /* unsigned 64-bit */
+
+typedef volatile signed char vs8; /* signed 8-bit */
+typedef volatile short vs16; /* signed 16-bit */
+typedef volatile long vs32; /* signed 32-bit */
+typedef volatile long long vs64; /* signed 64-bit */
+
+typedef float f32; /* single prec floating point */
+typedef double f64; /* double prec floating point */
+
+#if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEF)
+#define _SIZE_T
+#define _SIZE_T_DEF /* exeGCC size_t define label */
+#if (_MIPS_SZLONG == 32)
+typedef unsigned int size_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef unsigned long size_t;
+#endif
+#endif
+
+#endif /* _LANGUAGE_C */
+
+
+/*************************************************************************
+ * Common definitions
+ */
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _ULTRATYPES_H_ */
+
diff --git a/include/2.0L/PR/uportals.h b/include/2.0L/PR/uportals.h
new file mode 100755
index 00000000..28a1466f
--- /dev/null
+++ b/include/2.0L/PR/uportals.h
@@ -0,0 +1,134 @@
+/*====================================================================
+ * uportals.h
+ *
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+/**************************************************************************
+ *
+ * uportals.h - header file for the ultraportals library
+ *
+ * $Revision: 1.12 $
+ * $Date: 1997/02/11 08:40:49 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/uportals.h,v $
+ *
+ **************************************************************************/
+
+
+
+#ifndef __ULTRAPORTALS_H__
+#define __ULTRAPORTALS_H__
+
+#include
+#include "matrix.h"
+#include "vector.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef ENABLEPORTALS
+#define ENABLEPORTALS
+#endif
+
+#define UP_MAXPVERTS 16 /* max number of portal verts */
+#define UP_MAXCELLS 50 /* max number of cells */
+#define UP_CELLNL 32 /* max length of cell names */
+#define UP_OBNL 32 /* max length of obejct names */
+
+typedef struct
+{
+ vec3 min, max; /* min and max pts of the box */
+} upBox;
+
+typedef struct _upPortalData * _portalptr;
+typedef struct _upCellData * _cellptr;
+typedef struct _upObjectData * _objectptr;
+
+typedef struct _upPortalData
+{
+ int numverts; /* number of verts in the portal*/
+ _cellptr attached_cell; /* cell on the 'other side' */
+ vec3 verts[UP_MAXPVERTS]; /* the actual vertices */
+#ifdef MVTVIEW
+ int mvt_id; /* if has mvt, this is the id */
+#endif
+} upPortalData;
+
+typedef struct _upCellData
+{
+ int numportals; /* number of portals */
+ int numobjects; /* number of objects */
+ int rendered; /* last frame number rendered */
+ _portalptr *portals; /* array for the actual portals */
+ _objectptr *objects; /* array for 'detail' objects */
+ upBox bbox; /* bounding box of the cell */
+ Gfx *dlist; /* associated display list */
+ char name[UP_CELLNL]; /* name of the cell */
+ float eyeheight; /* height to constrain eyept to */
+ int zone; /* current zone number */
+} upCellData;
+
+typedef struct _upObjectData
+{
+ int rendered; /* last frame number rendered */
+ upBox bbox; /* bounding box for the object */
+ Gfx *dlist; /* associated display list */
+ char name[UP_OBNL]; /* name of the object */
+} upObjectData;
+
+typedef struct
+{
+ int numcells; /* how many cells are there? */
+ upCellData cells[UP_MAXCELLS]; /* the actual cells */
+ Gfx *rootdlist; /* display list for all cells */
+ vec2 portalmin, portalmax; /* XY bbox used by upCheckCells */
+ float near, far; /* near, far clipping planes */
+ FMatrix viewmat; /* viewing matrix (world->eye) */
+ FMatrix projmat; /* proj matrix (eye->screen) */
+ FMatrix compmat; /* view * proj (world->screen) */
+ int portaldepth; /* depth of the portal stack */
+ int framecount; /* current frame number */
+} upLocateData;
+
+/*
+ * Functions:
+ */
+extern void upInit(); /* generated automatically by flt2walk */
+extern Gfx *upAddVisibleCells(Gfx * glistp, vec3 eyept);
+extern void upTogglePortalBounds();
+extern void upToggleScissorBox();
+
+/*
+ * Globals:
+ */
+extern upLocateData upLocator; /* also extern by test_portals.h */
+
+/*
+ * Macros:
+ */
+#define UP_HUGEVAL 3.40282347e+37
+#define PT_IN_BOX(p,box) ((p)[0] > (box).min[0] && (p)[0] < (box).max[0] &&\
+ (p)[1] > (box).min[1] && (p)[1] < (box).max[1] &&\
+ (p)[2] > (box).min[2] && (p)[2] < (box).max[2])
+
+
+#ifdef __Cplusplus
+}
+#endif
+
+#endif
diff --git a/include/2.0L/assert.h b/include/2.0L/assert.h
new file mode 100755
index 00000000..a3736e37
--- /dev/null
+++ b/include/2.0L/assert.h
@@ -0,0 +1,54 @@
+#ifndef __ASSERT_H__
+#define __ASSERT_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**************************************************************************
+ * *
+ * Copyright (C) 1984, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+/* Copyright (c) 1984 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ident "$Revision: 1.17 $"
+
+/* ANSI C Notes:
+ *
+ * - THE IDENTIFIERS APPEARING OUTSIDE OF #ifdef __EXTENSIONS__ IN THIS
+ * standard header ARE SPECIFIED BY ANSI! CONFORMANCE WILL BE ALTERED
+ * IF ANY NEW IDENTIFIERS ARE ADDED TO THIS AREA UNLESS THEY ARE IN ANSI's
+ * RESERVED NAMESPACE. (i.e., unless they are prefixed by __[a-z] or
+ * _[A-Z]. For external objects, identifiers with the prefix _[a-z]
+ * are also reserved.)
+ */
+
+#ifdef NDEBUG
+#undef assert
+#define assert(EX) ((void)0)
+
+#else
+
+extern void __assert(const char *, const char *, int);
+#ifdef __ANSI_CPP__
+#define assert(EX) ((EX)?((void)0):__assert( # EX , __FILE__, __LINE__))
+#else
+#define assert(EX) ((EX)?((void)0):__assert("EX", __FILE__, __LINE__))
+#endif
+#endif /* NDEBUG */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__ASSERT_H__ */
diff --git a/include/2.0L/bstring.h b/include/2.0L/bstring.h
new file mode 100755
index 00000000..4ed25959
--- /dev/null
+++ b/include/2.0L/bstring.h
@@ -0,0 +1,36 @@
+#ifndef __BSTRING_H__
+#define __BSTRING_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * bstring(3C) -- byte string operations
+ *
+ * Copyright 1990, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+ * the contents of this file may not be disclosed to third parties, copied or
+ * duplicated in any form, in whole or in part, without the prior written
+ * permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+ * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+ * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
+ * rights reserved under the Copyright Laws of the United States.
+ */
+
+#ident "$Revision: 1.4 $"
+
+extern void bcopy(const void *, void *, int);
+extern int bcmp(const void *, const void *, int);
+extern void bzero(void *, int);
+extern void blkclr(void *, int);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !__BSTRING_H__ */
diff --git a/include/2.0L/make/PRdefs b/include/2.0L/make/PRdefs
new file mode 100755
index 00000000..f5456a7a
--- /dev/null
+++ b/include/2.0L/make/PRdefs
@@ -0,0 +1,85 @@
+#
+# Commondefs for Project Reality source tree
+#
+# Makefiles which include this should first define PRDEPTH to be the relative
+# path from their parent directory.
+
+include $(ROOT)/usr/include/make/commondefs
+
+#
+# Use $(MAKE) $(MAKEARGS) instead of $(MAKEF) so that make -n works
+# This gets around the fact that $(MAKE) works and $(MAKEF) does not.
+# MAKEARGS is based directly on $(MAKEF) in commondefs.
+#
+MAKEARGS = VCFLAGS="$(VCFLAGS)" VFFLAGS="$(VFFLAGS)" \
+ VPFLAGS="$(VPFLAGS)" VMKDEPFLAGS="$(VMKDEPFLAGS)"
+
+# make sure 'default' does not hit these rules
+defaultrule: default
+
+#
+# Compile tree for RCP 1.0 or RCP 2.0
+#
+#GCDEFS = $(HW_FLAGS)
+#GCDEFS = $(HW_FLAGS) -B -Wab,-r4300_mul
+#ifdef __GCC__
+GCDEFS =
+#else
+GCDEFS = $(HW_FLAGS) -Wab,-r4300_mul
+#endif
+
+#
+# VCS compiler options
+#
+VCSOPTS = $(GVCSOPTS) $(LVCSOPTS) $(VVCSOPTS)
+GVCSOPTS = +acc -V -M -Mupdate -Mmakep=pmake \
+ -CC "-mips2 -Wab,-big_got -Wab,-dwalign" -lgl -limage \
+ -P $(PRDEPTH)/rdpsim/pli/pli.tab $(ROOT)/usr/lib/PR/libpli.a
+
+SHELL = /bin/sh
+
+FLT2C = $(ROOT)/usr/sbin/flt2c
+IC = $(ROOT)/usr/sbin/ic
+#ifdef __GCC__
+MAKEROM = $(GCCDIR)/mipse/bin/mild
+#else
+MAKEROM = $(ROOT)/usr/sbin/makerom
+#endif
+MIDIPARSE = $(ROOT)/usr/sbin/midiparse
+MIDICVT = $(ROOT)/usr/sbin/midicvt
+MIDICOMP = $(ROOT)/usr/sbin/midicomp
+SBC = $(ROOT)/usr/sbin/sbc
+NLD = $(ROOT)/usr/sbin/nld
+RGB2C = $(ROOT)/usr/sbin/rgb2c
+MKSPRITE = $(ROOT)/usr/sbin/mksprite
+MKISPRITE = $(ROOT)/usr/sbin/mkisprite
+TABLEDESIGN = $(ROOT)/usr/sbin/tabledesign
+VADPCM_ENC = $(ROOT)/usr/sbin/vadpcm_enc
+RSPASM = $(ROOT)/usr/sbin/rspasm
+BUILDTASK = $(ROOT)/usr/sbin/buildtask
+RSP2ELF = $(ROOT)/usr/sbin/rsp2elf
+
+DATA2RDRAM = $(PRDEPTH)/tools/data/data2rdram
+RDRAM2DATA = $(PRDEPTH)/tools/data/rdram2data
+TMEMFMT = $(PRDEPTH)/tools/tmemfmt/tmemfmt
+
+ECS2VL = $(PRDEPTH)/rdpsim/tools/ecs2vl
+ECSGEN = $(PRDEPTH)/rdpsim/tools/ecs_gen
+MERRG = $(PRDEPTH)/rdpsim/tools/merrg
+RMVCOM = $(PRDEPTH)/rdpsim/tools/remove_comments
+TAB2VMEM= $(PRDEPTH)/rdpsim/tools/tab2vmem
+TAB2WVS = $(PRDEPTH)/rdpsim/tools/tab2wvs
+VSIG = $(PRDEPTH)/rdpsim/tools/vsig
+XNET = $(PRDEPTH)/rdpsim/tools/xnet
+
+ASYIN = /ecad/ecs/ecs_2.4/bin/asyin
+MAKEINI = /ecad/ecs/ecs_2.4/bin/makeini
+
+VCSDIR = /ecad/vcs/vcs_2.2/sgi
+VCS = $(VCSDIR)/bin/vcs
+
+LOG_RESULT = \
+ @echo -n "!!! $(*:T) of" `basename \`pwd\``": "; \
+ grep "number of errors" $*.out
+
+LOG_ERROR = $(LOG_RESULT)
diff --git a/include/2.0L/regdef.h b/include/2.0L/regdef.h
new file mode 100755
index 00000000..34c27193
--- /dev/null
+++ b/include/2.0L/regdef.h
@@ -0,0 +1,45 @@
+#ifndef __REGDEF_H__
+#define __REGDEF_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+*
+* Copyright 1992, Silicon Graphics, Inc.
+* All Rights Reserved.
+*
+* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+* the contents of this file may not be disclosed to third parties, copied or
+* duplicated in any form, in whole or in part, without the prior written
+* permission of Silicon Graphics, Inc.
+*
+* RESTRICTED RIGHTS LEGEND:
+* Use, duplication or disclosure by the Government is subject to restrictions
+* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
+* rights reserved under the Copyright Laws of the United States.
+*/
+/* ------------------------------------------------------------------ */
+/* | Copyright Unpublished, MIPS Computer Systems, Inc. All Rights | */
+/* | Reserved. This software contains proprietary and confidential | */
+/* | information of MIPS and its suppliers. Use, disclosure or | */
+/* | reproduction is prohibited without the prior express written | */
+/* | consent of MIPS. | */
+/* ------------------------------------------------------------------ */
+#ident "$Revision: 1.9 $"
+/* regdef.h 1.2 */
+
+/*
+ * Mips register definitions.
+ */
+
+#ifdef mips
+#include
+/*#include */
+#endif /* mips */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !__REGDEF_H__ */
diff --git a/include/2.0L/sgidefs.h b/include/2.0L/sgidefs.h
new file mode 100755
index 00000000..bee627b8
--- /dev/null
+++ b/include/2.0L/sgidefs.h
@@ -0,0 +1,189 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1991-1992 Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+#ifndef __SGIDEFS_H__
+#define __SGIDEFS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ident "$Revision: 1.5 $"
+
+/*
+ * sgidefs.h - SGI/MIPS basic software generation system constants & types
+ *
+ * This file MUST be includable in any language
+ * and in the 'C' case must be ANSI compliant
+ * In particular this means NO long long ...
+ *
+ * Constants and types defined here are to support
+ * multi-isa (instruction set architecture) coding
+ *
+ * Each catagory has a define that the compilation system will set
+ * based on the environment the compile is initiated in. Programs
+ * can test the define using the manifest constants defined here.
+ * (e.g. #if (_MIPS_FPSET == 16) )
+ */
+
+/*
+ * Floating Point register set
+ * Define:
+ * _MIPS_FPSET
+ * Can take on the values 16 or 32
+ */
+
+/*
+ * Instruction Set Architecture
+ * Define:
+ * _MIPS_ISA
+ */
+#define _MIPS_ISA_MIPS1 1 /* R2/3K */
+#define _MIPS_ISA_MIPS2 2 /* R4K/6K */
+#define _MIPS_ISA_MIPS3 3 /* R4K */
+#define _MIPS_ISA_MIPS4 4 /* TFP */
+
+/*
+ * Subprogram Interface Model
+ * Define:
+ * _MIPS_SIM
+ */
+#define _MIPS_SIM_ABI32 1 /* MIPS MSIG calling convention */
+#define _MIPS_SIM_NABI32 2 /* MIPS new 32-bit abi */
+ /* NABI32 is 64bit calling convention but 32bit type sizes) */
+#define _MIPS_SIM_ABI64 3 /* MIPS 64 calling convention */
+
+/*
+ * Data Types Sizes (C and C++)
+ * Defines:
+ * _MIPS_SZINT
+ * _MIPS_SZLONG
+ * _MIPS_SZPTR
+ *
+ * These can take on the values: 32, 64, 128
+ */
+
+/*
+ * Compilation Environments
+ * various compilers may offer a set of different compilation environments
+ * each one will pre-define the above defines appropriately.
+ * The MIPS ABI environment will pre-define the following:
+ * (cc -systype=XXX)
+ *
+ * -D_MIPS_FPSET=16 -D_MIPS_ISA=_MIPS_ISA_MIPS1
+ * -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZINT=32
+ * -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32
+ *
+ * The new MIPS 32-bit ABI environment will pre-define the following
+ * (cc -systype=XXX)
+ * -D_MIPS_FPSET=32 -D_MIPS_ISA=_MIPS_ISA_MIPS3
+ * -D_MIPS_SIM=_MIPS_SIM_NABI32 -D_MIPS_SZINT=32
+ * -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32
+ *
+ * The MIPS 64 bit environment will pre-define the following
+ * (cc -systype=XXX)
+ * -D_MIPS_FPSET=32 -D_MIPS_ISA=_MIPS_ISA_MIPS3
+ * -D_MIPS_SIM=_MIPS_SIM_ABI64 -D_MIPS_SZINT=32
+ * -D_MIPS_SZLONG=64 -D_MIPS_SZPTR=64
+ *
+ */
+
+/*
+ * Language Specific
+ * Type __psint_t - a pointer sized int - this can be used:
+ * a) when casting a pointer so can perform e.g. a bit operation
+ * b) as a return code for functions incorrectly typed as int but
+ * return a pointer.
+ * User level code can also use the ANSI std ptrdiff_t, defined in stddef.h
+ * in place of __psint_t
+ * Type __scint_t - a 'scaling' int - used when in fact one wants an 'int'
+ * that scales when moving to say 64 bit. (e.g. byte counts, bit lens)
+ */
+
+#if (defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS))
+
+/*
+ * assumes int is 32 -
+ * otherwise there must be some other compiler basic type
+ */
+#if (_MIPS_SZINT != 32)
+#ifdef _MIPS_SZINT
+ERROR -- the macro "_MIPS_SZINT" is set to _MIPS_SZINT -- should be 32
+#else
+ERROR -- the macro "_MIPS_SZINT" is unset (currently, must be set to 32)
+#endif
+#endif
+
+typedef int __int32_t;
+typedef unsigned __uint32_t;
+
+#if (_MIPS_SZLONG == 64)
+
+typedef long __int64_t;
+typedef unsigned long __uint64_t;
+
+#else
+
+#if defined(_LONGLONG)
+
+typedef long long __int64_t;
+typedef unsigned long long __uint64_t;
+
+#else
+
+typedef struct {
+ int hi32;
+ int lo32;
+} __int64_t;
+typedef struct {
+ unsigned int hi32;
+ unsigned int lo32;
+} __uint64_t;
+
+#endif /* _LONGLONG */
+
+#endif /* _MIPS_SZLONG */
+
+#if (_MIPS_SZPTR == 32)
+typedef __int32_t __psint_t;
+typedef __uint32_t __psunsigned_t;
+#endif
+
+#if (_MIPS_SZPTR == 64)
+typedef __int64_t __psint_t;
+typedef __uint64_t __psunsigned_t;
+#endif
+
+/*
+ * If any fundamental type is 64 bit, then set the scaling type
+ * to 64 bit
+ */
+#if (_MIPS_SZPTR == 64) || (_MIPS_SZLONG == 64) || (_MIPS_SZINT == 64)
+
+/* there exists some large fundamental type */
+typedef __int64_t __scint_t;
+typedef __uint64_t __scunsigned_t;
+
+#else
+
+/* a 32 bit world */
+typedef __int32_t __scint_t;
+typedef __uint32_t __scunsigned_t;
+
+#endif
+
+#endif /* C || C++ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__SGIDEFS_H__ */
diff --git a/include/2.0L/stdarg.h b/include/2.0L/stdarg.h
new file mode 100755
index 00000000..a5d0b13f
--- /dev/null
+++ b/include/2.0L/stdarg.h
@@ -0,0 +1,42 @@
+#ifndef STDARG_H
+#define STDARG_H
+
+// When not building with IDO, use the builtin vaarg macros for portability.
+#ifndef __sgi
+#define va_list __builtin_va_list
+#define va_start __builtin_va_start
+#define va_arg __builtin_va_arg
+#define va_end __builtin_va_end
+#else
+
+typedef char *va_list;
+#define _FP 1
+#define _INT 0
+#define _STRUCT 2
+
+#define _VA_FP_SAVE_AREA 0x10
+#define _VA_ALIGN(p, a) (((unsigned int)(((char *)p) + ((a) > 4 ? (a) : 4) - 1)) & -((a) > 4 ? (a) : 4))
+#define va_start(vp, parmN) (vp = ((va_list)&parmN + sizeof(parmN)))
+
+#define __va_stack_arg(list, mode) \
+ ( \
+ ((list) = (char *)_VA_ALIGN(list, __builtin_alignof(mode)) + \
+ _VA_ALIGN(sizeof(mode), 4)), \
+ (((char *)list) - (_VA_ALIGN(sizeof(mode), 4) - sizeof(mode))))
+
+#define __va_double_arg(list, mode) \
+ ( \
+ (((long)list & 0x1) /* 1 byte aligned? */ \
+ ? (list = (char *)((long)list + 7), (char *)((long)list - 6 - _VA_FP_SAVE_AREA)) \
+ : (((long)list & 0x2) /* 2 byte aligned? */ \
+ ? (list = (char *)((long)list + 10), (char *)((long)list - 24 - _VA_FP_SAVE_AREA)) \
+ : __va_stack_arg(list, mode))))
+
+#define va_arg(list, mode) ((mode *)(((__builtin_classof(mode) == _FP && \
+ __builtin_alignof(mode) == sizeof(double)) \
+ ? __va_double_arg(list, mode) \
+ : __va_stack_arg(list, mode))))[-1]
+#define va_end(__list)
+
+#endif
+#endif
diff --git a/include/2.0L/stdlib.h b/include/2.0L/stdlib.h
new file mode 100755
index 00000000..ee1f1407
--- /dev/null
+++ b/include/2.0L/stdlib.h
@@ -0,0 +1,21 @@
+#ifndef __STDLIB_H__
+#define __STDLIB_H__
+
+#ifndef NULL
+#define NULL 0
+#endif
+typedef struct lldiv_t
+{
+ long long quot;
+ long long rem;
+} lldiv_t;
+
+typedef struct ldiv_t
+{
+ long quot;
+ long rem;
+} ldiv_t;
+
+lldiv_t lldiv(long long num, long long denom);
+ldiv_t ldiv(long num, long denom);
+#endif /* !__STDLIB_H__ */
diff --git a/include/2.0L/string.h b/include/2.0L/string.h
new file mode 100755
index 00000000..9c809db0
--- /dev/null
+++ b/include/2.0L/string.h
@@ -0,0 +1,55 @@
+#ifndef __STRING_H__
+#define __STRING_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ident "$Revision: 1.23 $"
+/*
+*
+* Copyright 1992, Silicon Graphics, Inc.
+* All Rights Reserved.
+*
+* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+* the contents of this file may not be disclosed to third parties, copied or
+* duplicated in any form, in whole or in part, without the prior written
+* permission of Silicon Graphics, Inc.
+*
+* RESTRICTED RIGHTS LEGEND:
+* Use, duplication or disclosure by the Government is subject to restrictions
+* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
+* rights reserved under the Copyright Laws of the United States.
+*/
+/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
+/* Copyright (c) 1988 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#define _SIZE_T
+#if (_MIPS_SZLONG == 32)
+typedef unsigned int size_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef unsigned long size_t;
+#endif
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+extern void *memcpy(void *, const void *, size_t);
+extern char *strchr(const char *, int);
+extern size_t strlen(const char *);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !__STRING_H__ */
diff --git a/include/2.0L/sys/asm.h b/include/2.0L/sys/asm.h
new file mode 100755
index 00000000..74e85571
--- /dev/null
+++ b/include/2.0L/sys/asm.h
@@ -0,0 +1,704 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1990, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+/*
+ * Copyright 1985 by MIPS Computer Systems, Inc.
+ */
+#ifndef __SYS_ASM_H__
+#define __SYS_ASM_H__
+
+#ident "$Revision: 3.33 $"
+
+#include "sgidefs.h"
+
+/*
+ * asm.h -- cpp definitions for assembler files
+ */
+
+/*
+ * Notes on putting entry pt and frame info into symbol table for debuggers
+ *
+ * .ent name,lex-level # name is entry pt, lex-level is 0 for c
+ * name: # actual entry point
+ * .frame fp,framesize,saved_pc_reg
+ * # fp -- register which is pointer to base
+ * # of previous frame, debuggers are special
+ * # cased if "sp" to add "framesize"
+ * # (sp is usually used)
+ * # framesize -- size of frame
+ * # the expression:
+ * # new_sp + framesize == old_sp
+ * # should be true
+ * # saved_pc_reg -- either a register which
+ * # contains callers pc or $0, if $0
+ * # saved pc is assumed to be in
+ * # (fp)+framesize-4
+ *
+ * Notes regarding multiple entry points:
+ * LEAF is used when including the profiling header is appropriate
+ * XLEAF is used when the profiling header is in appropriate (e.g.
+ * when a entry point is known by multiple names, the profiling call
+ * should appear only once.) The correct ordering of ENTRY/XENTRY in this
+ * case is:
+ * LEAF(copyseg) # declare globl and emit profiling code
+ * XLEAF(copypage) # declare globl and alternate entry
+ */
+/*
+ * LEAF -- declare leaf routine
+ */
+#define LEAF(x) \
+ .globl x; \
+ .ent x,0; \
+x:; \
+ .frame sp,0,ra
+
+/*
+ * XLEAF -- declare alternate entry to leaf routine
+ */
+#define XLEAF(x) \
+ .globl x; \
+ .aent x,0; \
+x:
+
+/*
+ * VECTOR -- declare exception routine entry
+ */
+#if _K32U32
+#define VECTOR(x, regmask) \
+ .globl x; \
+ .ent x,0; \
+x:; \
+ .frame sp,EF_SIZE,$0; \
+ .mask +(regmask)|M_EXCFRM,-(EF_SIZE-(EF_RA))
+#else
+#define VECTOR(x, regmask) \
+ .globl x; \
+ .ent x,0; \
+x:; \
+ .frame sp,EF_SIZE,$0; \
+ .mask +(regmask)|M_EXCFRM,-(EF_SIZE-(EF_RA+4))
+#endif
+
+/*
+ * NESTED -- declare nested routine entry point
+ */
+#define NESTED(x, fsize, rpc) \
+ .globl x; \
+ .ent x,0; \
+x:; \
+ .frame sp,fsize, rpc
+
+/*
+ * XNESTED -- declare alternate entry point to nested routine
+ */
+#define XNESTED(x) \
+ .globl x; \
+ .aent x,0; \
+x:
+
+/*
+ * END -- mark end of procedure
+ */
+#define END(proc) \
+ .end proc
+
+/*
+ * IMPORT -- import external symbol
+ */
+#define IMPORT(sym, size) \
+ .extern sym,size
+
+/*
+ * ABS -- declare absolute symbol
+ */
+#define ABS(x, y) \
+ .globl x; \
+x = y
+
+/*
+ * EXPORT -- export definition of symbol
+ */
+#define EXPORT(x) \
+ .globl x; \
+x:
+
+/*
+ * BSS -- allocate space in bss
+ */
+#define BSS(x,y) \
+ .comm x,y
+
+/*
+ * LBSS -- allocate static space in bss
+ */
+#define LBSS(x,y) \
+ .lcomm x,y
+
+/*
+ * Macros for writing PIC asm code
+ */
+#ifdef PIC
+#define PICOPT .option pic2
+
+/*
+ * Set gp when at 1st instruction
+ */
+#define SETUP_GP \
+ .set noreorder; \
+ .cpload t9; \
+ .set reorder
+
+/*
+ * Set gp when not at 1st instruction
+ */
+#define SETUP_GPX(r) \
+ .set noreorder; \
+ move r, ra; /* save old ra */ \
+ bal 10f; /* find addr of cpload */\
+ nop; \
+10: \
+ .cpload ra; \
+ move ra, r; \
+ .set reorder;
+
+#define SAVE_GP(x) \
+ .cprestore x; /* save gp trigger t9/jalr conversion */
+
+#else /* PIC */
+
+#define PICOPT
+#define SETUP_GP
+#define SETUP_GPX(r)
+#define SAVE_GP(x)
+
+#endif /* PIC */
+
+/*
+ * Stack Frame Definitions
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#define NARGSAVE 4 /* space for 4 arg regs must be allocated */
+#define ALSZ 7 /* align on 8 byte boundary */
+#define ALMASK ~7
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_ABI64)
+#define NARGSAVE 0 /* no caller responsibilities */
+#define ALSZ 15 /* align on 16 byte boundary */
+#define ALMASK ~0xf
+#endif
+
+#if _KERNEL
+/* Round the size of a stack frame to fit compiler conventions. */
+#define FRAMESZ(size) (((size)+ALSZ) & ALMASK)
+#endif
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2)
+#define SZREG 4
+#endif
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
+#define SZREG 8
+#endif
+
+/*
+ * The following macros reserve the usage of the local label '9'
+ * By convention the caller should put the return addr in a2
+ * so that the stack backtrace can trace from a leaf
+ */
+#if defined(STANDALONE) || defined(LOCORE)
+#define PANIC(msg) \
+ sw zero,waittime; \
+ la a0,9f; \
+ jal panic; \
+ MSG(msg)
+
+#define PRINTF(msg) \
+ la a0,9f; \
+ jal printf; \
+ MSG(msg)
+
+#else /* the kernel */
+#define PANIC(msg) \
+ li a0,CE_PANIC; \
+ la a1,9f; \
+ jal cmn_err; \
+ MSG(msg)
+
+#define SPPANIC(msg) \
+ /* make sure a good frame */\
+ lw sp,VPDA_LBOOTSTACK(zero); \
+ li a0,CE_PANIC; \
+ la a1,9f; \
+ jal cmn_err; \
+ MSG(msg)
+
+#define ASMASSFAIL(msg) \
+ la a0,9f; \
+ la a1,lmsg; \
+ move a2,zero; \
+ j assfail; \
+ MSG(msg)
+
+#define PRINTF(msg) \
+ la a0,9f; \
+ jal dprintf; \
+ MSG(msg)
+
+#endif /* defined(STANDALONE) || defined(LOCORE) */
+
+#define MSG(msg) \
+ .data; \
+9: .asciiz msg; \
+ .text
+
+#define SYSMAP(mname, vname, page, len) \
+ .globl mname; \
+mname: \
+ .space len*4; \
+ .globl vname; \
+vname = ((page)*NBPG)
+
+#if !defined(_MIPSEB) && !defined(_MIPSEL)
+ .error Must define either _MIPSEB or _MIPSEL
+#endif
+#if defined(_MIPSEB) && defined(_MIPSEL)
+ .error Only one of _MIPSEB and _MIPSEL may be defined
+#endif
+
+/*
+ * The following macros deal with the coprocessor 0 scheduling
+ * hazards, which are different for the R3000 and R4000.
+ * The first digit in the name refers to the number
+ * of NOPs in the R2000/R3000 case, while the second digit
+ * refers to the number of NOPs in the R4000 case.
+ * NOTE: For now use R4000 values for TFP too. This at least
+ * lets us make the kernel.
+ */
+#if R4000
+#define NOP_0_1 nop
+#define NOP_0_2 nop; nop
+#define NOP_0_3 nop; nop; nop
+#define NOP_0_4 nop; nop; nop; nop
+#define NOP_1_0
+#define NOP_1_1 nop
+#define NOP_1_2 nop; nop
+#define NOP_1_3 nop; nop; nop
+#define NOP_1_4 nop; nop; nop; nop
+#endif
+
+#if TFP
+#define NOP_0_1
+#define NOP_0_2
+#define NOP_0_3
+#define NOP_0_4
+#define NOP_1_0
+#define NOP_1_1 NOP_SSNOP
+#define NOP_1_2 NOP_SSNOP
+#define NOP_1_3 NOP_SSNOP
+#define NOP_1_4 NOP_SSNOP
+/* TFP has the following kinds of nops:
+ *
+ * NOP_NOP regular old nop -- takes a dispatch slot, but another
+ * integer instruction could be issued with it. But since
+ * TFP has only one shifter, two consecutive NOP_NOPs would
+ * go in separate cycles
+ * NOP_SSNOP nop which breaks superscalar dispatch. Will be the last
+ * instruction issued in a cycle. Instruction following
+ * will be first instruction issued in next cycle.
+ * NOP_NADA more than one of these can be scheduled per cycle
+ * since it does not use the shifter
+ */
+#define NOP_NOP sll zero,zero,0
+#define NOP_SSNOP sll zero,zero,1
+#define NOP_NADA addu zero,zero,zero
+/*
+ * The following hazards are intended to be the maximum needed so that we
+ * do not have to worry about the instructions which follow. You may make
+ * use of the actual restrictions in order to optimize the code.
+ *
+ * Theoretically, NOP_MFC1_HAZ and NOP_MTC1_HAZ should not be needed but they
+ * are here just in case.
+ *
+ * NOP_MFC0_HAZ hazard after loading from C0
+ * NOP_MTC0_HAZ hazard after storing to C0
+ * NOP_ERET_HAZ hazard before eret after storing C0 registers
+ * NOP_COM_HAZ hazard following a COM operation -- TLBW, TLBR, etc.
+ * NOP_MFC1_HAZ hazard after loading from C1
+ * NOP_MTC1_HAZ hazard after storing to C1
+ *
+ * Actual restrictions:
+ * MFC0
+ * - two dmfc0 should not be executed in same cycle
+ * - a dmfc0 should not be issued in cycle following a dmtc0
+ * MTC0
+ * - in cycle after dmtc0 VAddr a COM will not correctly execute
+ * - in cycle after dmtc0 status a COM will not correctly execute
+ * - in same cycle as dmtc0 TLBSet a COM will not correctly execute
+ * - integer store should not be execute in same cycle as dmtc0 VAddr
+ * - two dmtc0 should not be executed in the same cycle
+ * - a dmfc0 should not be issued in cycle following a dmtc0
+ *
+ * - there should be three SSNOPs following a MTC0 which
+ * is enabling/disabling interrupts in the SR before new mask is
+ * effective
+ * - there should be three SSNOPs between a MTC0 which enables a CU
+ * field (like the FP) before issuing an instruction which uses the
+ * the FP.
+ * COM
+ * - 2 cycles after a COM a memory instruction will not execute properly
+ * - a TLBR/DCTR followed by a dmfc0 of EntryHi/EntryLo/DCache should
+ * leave two cycles between TLBR and dmfc0
+ *
+ * Additional restriction found executing kernel on RTL simulator:
+ *--------------------------------------------------------------------------
+ * jr r31
+ * dmtc0 r2,sr
+ * The jr happens to jump to 0x801b9204. However, the jal didn't store the
+ * proper value (pc + 8) into r31.
+ * The reason for this behavior is that mtc0's require an internal bus
+ * (MiscBus to be specific), in the W cycle. However, the jal also requires
+ * the MiscBus in its E cycle. Thus, the mux select lines for selecting
+ * the data to go into the GPR was incorrect.
+ * To make sure something like this won't occur again, it's probably a good
+ * idea not to have mtc0's in the delay slot, unless you are sure that the
+ * target quadword of instructions won't cause this internal bus collision.
+ *--------------------------------------------------------------------------
+ */
+#define NOP_MFC0_HAZ NOP_SSNOP
+#define NOP_MTC0_HAZ NOP_SSNOP; NOP_SSNOP; NOP_SSNOP; NOP_SSNOP
+#define NOP_ERET_HAZ
+#define NOP_COM_HAZ NOP_SSNOP; NOP_SSNOP; NOP_SSNOP; NOP_SSNOP
+/*
+ * The NOP_MFC1_HAZ and NOP_MTC1_HAZ are here only due to paranoia.
+ * I am also defining DMFC1 and DMTC1 which use these macros (in ip21prom.h).
+ * All this will exist until there is established confidence in FPU.
+ */
+#define NOP_MFC1_HAZ NOP_SSNOP; NOP_SSNOP; NOP_SSNOP; NOP_SSNOP
+#define NOP_MTC1_HAZ NOP_SSNOP; NOP_SSNOP; NOP_SSNOP; NOP_SSNOP
+#endif
+
+#if R3000
+#define NOP_0_1
+#define NOP_0_2
+#define NOP_0_3
+#define NOP_0_4
+#define NOP_1_0 nop
+#define NOP_1_1 nop
+#define NOP_1_2 nop
+#define NOP_1_3 nop
+#define NOP_1_4 nop
+#endif
+
+/*
+ * register mask bit definitions
+ */
+#define M_EXCFRM 0x00000001
+#define M_AT 0x00000002
+#define M_V0 0x00000004
+#define M_V1 0x00000008
+#define M_A0 0x00000010
+#define M_A1 0x00000020
+#define M_A2 0x00000040
+#define M_A3 0x00000080
+#define M_T0 0x00000100
+#define M_T1 0x00000200
+#define M_T2 0x00000400
+#define M_T3 0x00000800
+#define M_T4 0x00001000
+#define M_T5 0x00002000
+#define M_T6 0x00004000
+#define M_T7 0x00008000
+#define M_S0 0x00010000
+#define M_S1 0x00020000
+#define M_S2 0x00040000
+#define M_S3 0x00080000
+#define M_S4 0x00100000
+#define M_S5 0x00200000
+#define M_S6 0x00400000
+#define M_S7 0x00800000
+#define M_T8 0x01000000
+#define M_T9 0x02000000
+#define M_K0 0x04000000
+#define M_K1 0x08000000
+#define M_GP 0x10000000
+#define M_SP 0x20000000
+#define M_FP 0x40000000
+#define M_RA 0x80000000
+
+
+/*
+ * Macros for dealing with 64/32 bit asm files
+ */
+
+/*
+ * Basic register save and restore
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2)
+#define REG_L lw
+#define REG_S sw
+#endif
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
+#define REG_L ld
+#define REG_S sd
+#endif
+
+#if (_MIPS_SZINT == 32)
+#define INT_L lw
+#define INT_S sw
+#define INT_LLEFT lwl /* load left */
+#define INT_SLEFT swl /* store left */
+#define INT_LRIGHT lwr /* load right */
+#define INT_SRIGHT swr /* store right */
+#define INT_ADD add
+#define INT_ADDI addi
+#define INT_ADDIU addiu
+#define INT_ADDU addu
+#define INT_SUB sub
+#define INT_SUBI subi
+#define INT_SUBIU subiu
+#define INT_SUBU subu
+#define INT_SLL sll
+#define INT_SRL srl
+#define INT_SRA sra
+#define INT_SLLV sllv
+#define INT_SRLV srlv
+#define INT_SRAV srav
+#define INT_LL ll
+#define INT_SC sc
+#endif /* _MIPS_SZINT == 32 */
+
+#if (_MIPS_SZINT == 64)
+#define INT_L ld
+#define INT_S sd
+#define INT_LLEFT ldl /* load left */
+#define INT_SLEFT sdl /* store left */
+#define INT_LRIGHT ldr /* load right */
+#define INT_SRIGHT sdr /* store right */
+#define INT_ADD dadd
+#define INT_ADDI daddi
+#define INT_ADDIU daddiu
+#define INT_ADDU daddu
+#define INT_SUB dsub
+#define INT_SUBI dsubi
+#define INT_SUBIU dsubiu
+#define INT_SUBU dsubu
+#define INT_SLL dsll
+#define INT_SRL dsrl
+#define INT_SRA dsra
+#define INT_SLLV dsllv
+#define INT_SRLV dsrlv
+#define INT_SRAV dsrav
+#define INT_LL lld
+#define INT_SC scd
+#endif /* _MIPS_SZINT == 64 */
+
+#if (_MIPS_SZLONG == 32)
+#define LONG_L lw
+#define LONG_S sw
+#define LONG_LLEFT lwl /* load left */
+#define LONG_SLEFT swl /* store left */
+#define LONG_LRIGHT lwr /* load right */
+#define LONG_SRIGHT swr /* store right */
+#define LONG_ADD add
+#define LONG_ADDI addi
+#define LONG_ADDIU addiu
+#define LONG_ADDU addu
+#define LONG_SUB sub
+#define LONG_SUBI subi
+#define LONG_SUBIU subiu
+#define LONG_SUBU subu
+#define LONG_SLL sll
+#define LONG_SRL srl
+#define LONG_SRA sra
+#define LONG_SLLV sllv
+#define LONG_SRLV srlv
+#define LONG_SRAV srav
+#define LONG_LL ll
+#define LONG_SC sc
+#endif /* _MIPS_SZLONG == 32 */
+
+#if (_MIPS_SZLONG == 64)
+#define LONG_L ld
+#define LONG_S sd
+#define LONG_LLEFT ldl /* load left */
+#define LONG_SLEFT sdl /* store left */
+#define LONG_LRIGHT ldr /* load right */
+#define LONG_SRIGHT sdr /* store right */
+#define LONG_ADD dadd
+#define LONG_ADDI daddi
+#define LONG_ADDIU daddiu
+#define LONG_ADDU daddu
+#define LONG_SUB dsub
+#define LONG_SUBI dsubi
+#define LONG_SUBIU dsubiu
+#define LONG_SUBU dsubu
+#define LONG_SLL dsll
+#define LONG_SRL dsrl
+#define LONG_SRA dsra
+#define LONG_SLLV dsllv
+#define LONG_SRLV dsrlv
+#define LONG_SRAV dsrav
+#define LONG_LL lld
+#define LONG_SC scd
+#endif /* _MIPS_SZLONG == 64 */
+
+#if (_MIPS_SZPTR == 32)
+#define PTR_L lw
+#define PTR_S sw
+#define PTR_LLEFT lwl /* load left */
+#define PTR_SLEFT swl /* store left */
+#define PTR_LRIGHT lwr /* load right */
+#define PTR_SRIGHT swr /* store right */
+#define PTR_ADD add
+#define PTR_ADDI addi
+#define PTR_ADDIU addiu
+#define PTR_ADDU addu
+#define PTR_SUB sub
+#define PTR_SUBI subi
+#define PTR_SUBIU subiu
+#define PTR_SUBU subu
+#define PTR_SLL sll
+#define PTR_SRL srl
+#define PTR_SRA sra
+#define PTR_SLLV sllv
+#define PTR_SRLV srlv
+#define PTR_SRAV srav
+#define PTR_LL ll
+#define PTR_SC sc
+
+#define PTR_WORD .word /* psuedo-op to reserve space for a ptr */
+#define PTR_SCALESHIFT 2
+
+#define LI li
+#define LA la
+#endif /* _MIPS_SZPTR == 32 */
+
+#if (_MIPS_SZPTR == 64)
+#define PTR_L ld
+#define PTR_S sd
+#define PTR_LLEFT ldl /* load left */
+#define PTR_SLEFT sdl /* store left */
+#define PTR_LRIGHT ldr /* load right */
+#define PTR_SRIGHT sdr /* store right */
+#define PTR_ADD dadd
+#define PTR_ADDI daddi
+#define PTR_ADDIU daddiu
+#define PTR_ADDU daddu
+#define PTR_SUB dsub
+#define PTR_SUBI dsubi
+#define PTR_SUBIU dsubiu
+#define PTR_SUBU dsubu
+#define PTR_SLL dsll
+#define PTR_SRL dsrl
+#define PTR_SRA dsra
+#define PTR_SLLV dsllv
+#define PTR_SRLV dsrlv
+#define PTR_SRAV dsrav
+#define PTR_LL lld
+#define PTR_SC scd
+
+#define PTR_WORD .dword /* psuedo-op to reserve space for a ptr */
+#define PTR_SCALESHIFT 3
+
+#define LI dli
+#define LA dla
+#endif /* _MIPS_SZPTR == 64 */
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2)
+#define MFC0 mfc0
+#define MTC0 mtc0
+#endif
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
+#define MFC0 dmfc0
+#define MTC0 dmtc0
+#endif
+#if TFP
+#define DMTC0(r,c) dmtc0 r,c; \
+ NOP_MTC0_HAZ
+#define DMFC0(c,r) dmfc0 c,r; \
+ NOP_MFC0_HAZ
+#if _K32U32 || _K32U64
+ # This code only works for SABLE
+ # We need to avoid a tlbmiss on the PC address (our pseudo-K0 space)
+ # because such a fault destroys values loaded into BADVADDR,
+ # TLBHI, etc.
+#define SABLE_GOTO_KP64(reg1,reg2) \
+ lui reg2,0xa000; \
+ dsll reg2,32; \
+ la reg1,1f; \
+ dsll reg1,35; \
+ dsrl reg1,35; \
+ dadd reg1,reg2; \
+ NOP_SSNOP; \
+ j reg1; \
+ NOP_SSNOP; \
+ NOP_SSNOP; \
+1: NOP_SSNOP \
+ # Now we're executing in Kernel Physical (KP) space
+#else
+#define SABLE_GOTO_KP64(reg1,reg2)
+#endif /* !_K32U32 && ! _K32U64 */
+
+#endif /* TFP */
+#if R3000 || R4000
+/* These macros let us replace existing mtc0/mfc0 instructions with macros
+ * that have no additional overhead for non-TFP machines but have the required
+ * number of scheduling NOPS for TFP.
+ */
+#define DMTC0(r,c) mtc0 r,c
+#define DMFC0(c,r) mfc0 c,r
+#define SABLE_GOTO_KP64(reg1,reg2)
+#endif /* R3000 || R4000 */
+
+#if TFP_TLBCACHE_WAR
+/*
+ * This problem occurs when there is an I-Cache miss within two cycles of
+ * a valid tlb or dct (data cache tag) instruction. If the previous contents
+ * of the I-Cache contained a store instruction, the data cache can be
+ * corrupted.
+ *
+ * This problem can be worked around by putting all tlb/dct instructions on a
+ * 16-byte boundary. And, the three instructions that follow the tlb/dct
+ * must be ssnops (super-scalar no-ops). This guarantees that for the two
+ * cycles following the tlb/dct instruction, there can only be noops in the
+ * pipeline.
+ */
+#define TLB_READ .align 4; \
+ c0 C0_READ; \
+ NOP_SSNOP; \
+ NOP_SSNOP; \
+ NOP_SSNOP
+#define TLB_WRITER .align 4; \
+ c0 C0_WRITER; \
+ NOP_SSNOP; \
+ NOP_SSNOP; \
+ NOP_SSNOP
+#define TLB_PROBE .align 4; \
+ c0 C0_PROBE; \
+ NOP_SSNOP; \
+ NOP_SSNOP; \
+ NOP_SSNOP
+#else /* !TFP_TLBCACHE_WAR */
+#if TFP
+#define TLB_READ c0 C0_READ; \
+ NOP_COM_HAZ
+#define TLB_WRITER c0 C0_WRITER; \
+ NOP_COM_HAZ
+#define TLB_PROBE c0 C0_PROBE; \
+ NOP_COM_HAZ
+#else
+#define TLB_READ c0 C0_READ
+#define TLB_WRITER c0 C0_WRITER
+#endif
+#endif /* !TFP_TLBCACHE_WAR */
+#endif /* __SYS_ASM_H__ */
diff --git a/include/2.0L/sys/regdef.h b/include/2.0L/sys/regdef.h
new file mode 100755
index 00000000..8d319a2b
--- /dev/null
+++ b/include/2.0L/sys/regdef.h
@@ -0,0 +1,104 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1990-1992, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+/*
+ * Copyright 1985 by MIPS Computer Systems, Inc.
+ */
+#ifndef __SYS_REGDEF_H__
+#define __SYS_REGDEF_H__
+
+#ident "$Revision: 3.7 $"
+
+#include "sgidefs.h"
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#define zero $0 /* wired zero */
+#define AT $at /* assembler temp */
+#define v0 $2 /* return value */
+#define v1 $3
+#define a0 $4 /* argument registers */
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#define t0 $8 /* caller saved */
+#define t1 $9
+#define t2 $10
+#define t3 $11
+#define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */
+#define ta0 $12 /* caller saved in 32 bit - arg regs in 64 bit */
+#define t5 $13
+#define ta1 $13
+#define t6 $14
+#define ta2 $14
+#define t7 $15
+#define ta3 $15
+#define s0 $16 /* callee saved */
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24 /* code generator */
+#define t9 $25
+#define jp $25 /* PIC jump register */
+#define k0 $26 /* kernel temporary */
+#define k1 $27
+#define gp $28 /* global pointer */
+#define sp $29 /* stack pointer */
+#define fp $30 /* frame pointer */
+#define s8 $30 /* calle saved */
+#define ra $31 /* return address */
+#endif
+
+#if (_MIPS_SIM == _MIPS_SIM_ABI64)
+#define zero $0 /* wired zero */
+#define AT $at /* assembler temp */
+#define v0 $2 /* return value - caller saved */
+#define v1 $3
+#define a0 $4 /* argument registers */
+#define a1 $5
+#define a2 $6
+#define a3 $7
+#define a4 $8 /* arg reg 64 bit; caller saved in 32 bit */
+#define ta0 $8
+#define a5 $9
+#define ta1 $9
+#define a6 $10
+#define ta2 $10
+#define a7 $11
+#define ta3 $11
+#define t0 $12 /* caller saved */
+#define t1 $13
+#define t2 $14
+#define t3 $15
+#define s0 $16 /* callee saved */
+#define s1 $17
+#define s2 $18
+#define s3 $19
+#define s4 $20
+#define s5 $21
+#define s6 $22
+#define s7 $23
+#define t8 $24 /* caller saved */
+#define t9 $25 /* callee address for PIC/temp */
+#define jp $25 /* PIC jump register */
+#define k0 $26 /* kernel temporary */
+#define k1 $27
+#define gp $28 /* global pointer - caller saved for PIC */
+#define sp $29 /* stack pointer */
+#define fp $30 /* frame pointer */
+#define s8 $30 /* callee saved */
+#define ra $31 /* return address */
+#endif
+
+#endif /* __SYS_REGDEF_H__ */
diff --git a/include/2.0L/sys/u64driver.h b/include/2.0L/sys/u64driver.h
new file mode 100755
index 00000000..db4fe336
--- /dev/null
+++ b/include/2.0L/sys/u64driver.h
@@ -0,0 +1,131 @@
+#ifndef __SYS_U64DRIVER_H__
+#define __SYS_U64DRIVER_H__
+
+/*
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+ * the contents of this file may not be disclosed to third parties, copied or
+ * duplicated in any form, in whole or in part, without the prior written
+ * permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+ * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+ * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
+ * rights reserved under the Copyright Laws of the United States.
+ *
+ */
+
+#include
+#include
+#include "u64gio.h"
+
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+
+#define U64_MINOR_PRINT 1
+#define U64_MINOR_DEBUG 2
+#define U64_MINOR_LOGGING 3
+#define U64_MINOR_DATA 4
+#define U64_MINOR_FAULT 5
+#define U64_MINOR_KDEBUG 6
+#define U64_MINOR_PROFILE 7
+#define NUMBER_MINORS 8 /* don't use minor zero , but must count 0-7 */
+
+#define U64_MINOR_PRINT_BUF_SIZE 0x80000 /* buffer used by incoming printf data */
+#define U64_MINOR_DEBUG_BUF_SIZE 0x4000
+#define U64_MINOR_LOGGING_BUF_SIZE RDB_LOG_MAX_BLOCK_SIZE /* buffer used by incoming logging data */
+#define U64_MINOR_DATA_BUF_SIZE RDB_DATA_MAX_BLOCK_SIZE /* buffer used by incoming data */
+#define U64_MINOR_FAULT_BUF_SIZE 1024 /* buffer used for incoming fault data */
+#define U64_MINOR_KDEBUG_BUF_SIZE 1024 /* buffer used for incoming kdebug data */
+#define U64_MINOR_PROFILE_BUF_SIZE 2048 /* buffer used for incoming profile data */
+#define U64_MINOR_PROFILE_SEND_BUF_SIZE 16 /* only send one byte messages */
+#define U64_INTERNAL_WRITE_BUF_SIZE 0x8000 /* buffer used to store packets waiting to go out */
+
+
+
+#define u64_increment_Qptr(x) { ((x) = ((x) + 1) & 0xff) ; }
+
+
+typedef struct {
+ sema_t minor_sema; /* used to allow only one app to open the minor */
+ sema_t read_sema; /* used to block while waiting for data */
+ sema_t write_sema; /* only allow one entry to write at a time */
+ int read_count; /* the number of bytes waiting to be read */
+ int write_count; /* the number of bytes waiting to be written */
+ int read_cur_write;
+ int write_cur_write;
+ int read_cur_read;
+ int write_cur_read;
+ unsigned char *read_buf;
+ unsigned char *write_buf;
+ int read_buf_size; /* measured in unsigned char's */
+ int write_buf_size; /* measured in unsigned char's */
+ int incoming_ct; /* used by minors that receive data from game */
+ /* indicates how many bytes left in block */
+ /* before signaling game that transfer is done */
+ /* used by logging and game to host data stuff */
+ int message; /* when not zero, send this message to game to */
+ /* indicate that data or log data has been read */
+ struct pollhead *phead;
+} u64_minor;
+
+/*
+ * Our private one-per-board data structure
+ * The user can't get at any of this
+ */
+struct u64_data {
+
+ volatile struct u64_board *board;
+ unsigned char *memaddr; /* 16/32 bit access R/W */
+
+ /*
+ * Only one client may be in the kernel at a time; this semaphore is used
+ * to prevent multiple clients from overrunning each other's interactions
+ * with the hardware.
+ */
+ sema_t ioctl_sema;
+
+ /*
+ * The ramrom_sema is used by the driver so that it can arbitrate for the
+ * control of ramrom with the game, and sleep while waiting for the game
+ * to respond.
+ */
+ sema_t ramrom_sema;
+
+ /*
+ * Allocate a megabyte buffer which we can use when reading/writing data
+ * to or from the board (we can't copyin/copyout directly from the user's
+ * buffer, because those routines use 64 bit transfers).
+ */
+ unsigned int *oneMeg;
+
+ union {
+ u64_write_arg_t u64_write; /* WRITE, SAFE_WRITE */
+ u64_read_arg_t u64_read; /* READ, SAFE_READ */
+ } args;
+
+ /* rdb port */
+ unsigned int *write_buf;
+ unsigned int write_buf_cur_write;
+ unsigned int write_buf_cur_read;
+ unsigned int write_buf_ct; /* number of packets waiting for transmission */
+ unsigned int write_buf_size; /* measured in rdbPackets */
+ sema_t write_buf_sema;
+ u64_minor minors[NUMBER_MINORS];
+
+};
+
+#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
+
+#endif /* __SYS_U64DRIVER_H__ */
+
+
+
+
+
+
diff --git a/include/2.0L/sys/u64gio.h b/include/2.0L/sys/u64gio.h
new file mode 100755
index 00000000..106a9ccd
--- /dev/null
+++ b/include/2.0L/sys/u64gio.h
@@ -0,0 +1,110 @@
+#ifndef __SYS_U64GIO_H__
+#define __SYS_U64GIO_H__
+
+/*
+ * Copyright 1995, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+ * the contents of this file may not be disclosed to third parties, copied or
+ * duplicated in any form, in whole or in part, without the prior written
+ * permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+ * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+ * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
+ * rights reserved under the Copyright Laws of the United States.
+ *
+ */
+
+#define DEV_U64 "/dev/u64"
+#define DEV_U64_PRINT "/dev/u64_print"
+#define DEV_U64_DEBUG "/dev/u64_debug"
+#define DEV_U64_LOG "/dev/u64_logging"
+#define DEV_U64_DATA "/dev/u64_data"
+#define DEV_U64_FAULT "/dev/u64_fault"
+#define DEV_U64_KDEBUG "/dev/u64_kdebug"
+#define DEV_U64_PROFILE "/dev/u64_profile"
+/*
+ * ioctls
+ */
+#define U64IOC ('u'<<24|'6'<<16)
+#define U64IOCTL(x) (U64IOC|x)
+
+#define U64_RESET U64IOCTL(1) /* arg: 0 - deassert, 1 - assert */
+#define U64_WRITE U64IOCTL(2)
+#define U64_READ U64IOCTL(3)
+#define U64_SAFE_WRITE U64IOCTL(4)
+#define U64_SAFE_READ U64IOCTL(5)
+#define U64_LISTEN U64IOCTL(6) /* arg is register value for listen */
+#define U64_SIGNAL U64IOCTL(7) /* arg is register value for signal */
+
+#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+
+/* structure for WRITE & SAFE_WRITE*/
+typedef struct u64_write_arg {
+ void *buffer;
+ long ramrom_addr;
+ int nbytes;
+} u64_write_arg_t;
+
+/* structure for READ & SAFE_READ */
+typedef struct u64_read_arg {
+ void *buffer;
+ long ramrom_addr;
+ int nbytes;
+} u64_read_arg_t;
+
+/* NOTE: if game is in reset, don't interrupt the game */
+
+struct u64_board {
+ volatile unsigned int product_id_reg; /* bf400000, read only */
+ unsigned char fill_0[0x3fc];
+ volatile unsigned int reset_control; /* bf400400, write only */
+ unsigned char fill_1[0x3fc];
+ volatile unsigned int cart_interrupt; /* bf400800, read/write */
+ unsigned char fill_3[0x1fc];
+ volatile unsigned int dram_page_cntrl;/* bf400a00, read/write */
+ unsigned char fill_2[0x1fc];
+ volatile unsigned int gio_interrupt; /* bf400c00, read only */
+ unsigned char fill_4[0x1fc];
+ volatile unsigned int gio_sync; /* bf400e00, read only */
+};
+
+#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
+
+/*
+ * _U64_PRODUCT_ID_REG - GIO bus Product ID register
+ */
+#define _U64_PRODUCT_ID_MASK 0x0000007f
+#define _U64_PRODUCT_ID_VALUE 0x00000015
+
+/*
+ * reset control register has two bits defined
+ */
+#define _U64_RESET_CONTROL_NMI 0x4
+#define _U64_RESET_CONTROL_RESET 0x2
+
+/*
+ * Only look at the least significant 5 bits of the sync and interrupt
+ * registers. Future revs of the firmware may provide more.
+ */
+
+#define _U64_REGMASK 0x1f
+
+/*
+ * 16MB available, one meg at a time, selected by the 4 bit
+ * dram_page_cntrl register setting.
+ */
+#define U64_MEM_SIZE 0x100000
+
+/*
+ * Declare size of gio-addressable memory to mmap, and provide the base
+ * physical address so that clients who want to mmap() may do so.
+ */
+#define U64_GIOBUS_SIZE 0x200000 /* 2 MB */
+#define U64_GIOBUS_BASE 0x1f400000
+
+#endif /* __SYS_U64GIO_H__ */
diff --git a/include/2.0L/tinymon.h b/include/2.0L/tinymon.h
new file mode 100755
index 00000000..5856d4f6
--- /dev/null
+++ b/include/2.0L/tinymon.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 1995, Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
+ * the contents of this file may not be disclosed to third parties, copied
+ * or duplicated in any form, in whole or in part, without the prior written
+ * permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
+ * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
+ * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished
+ * rights reserved under the Copyright Laws of the United States.
+ *
+ * Module: tinymon.h: constants for use with the tinymon family of debug servers
+ */
+
+#define GIO_BASE_REG_UPPER 0x1800
+#define GIO_BASE_REG_UPPER_K1 0xb800
+#define GIO_INTR_REG_OFFSET 0x0
+#define GIO_SYNC_REG_OFFSET 0x400
+#define CART_INTR_REG_OFFSET 0x800
+
+#define RAMROM_BASE_UPPER 0x1000
+#define RAMROM_BASE_UPPER_K1 0xb000
+
+/*
+ * jal will or in the upper four bits of 0xb0000000 whenever we invoke these
+ * routines.
+ */
+#define PIFMON_WRITE_ADDR 0xfc00030
+
+#define PI_BASE_REG_UPPER 0x0460
+#define PI_BASE_REG_UPPER_K1 0xa460
+#define PI_STATUS_REG_OFFSET 0x10
+
+/*
+ * PI status register has 3 bits active when read from (PI_STATUS_REG - read)
+ * Bit 0: DMA busy - set when DMA is in progress
+ * Bit 1: IO busy - set when IO is in progress
+ * Bit 2: Error - set when R4300 issues IO request while DMA is busy
+ */
+#define PI_STATUS_ERROR 0x04
+#define PI_STATUS_IO_BUSY 0x02
+#define PI_STATUS_DMA_BUSY 0x01
+
+/*
+ * Host to R4300 protocol definitions.
+ *
+ * Host writes DG_RAMROM_REQUEST, DG_RAMROM_CMD_READY to the cartridge
+ * interrupt register (which the R4300 can poll),
+ *
+ * R4300 writes DG_RAMROM_GRANT, DG_RAMROM_CMD_DONE to the gio sync register
+ * (which the host can poll).
+ */
+
+#define DG_CARTREG_MASK 0x3f
+
+#define DG_RAMROM_REQUEST 1
+#define DG_RAMROM_GRANT 2
+#define DG_RAMROM_CMD_READY 3
+#define DG_RAMROM_CMD_DONE 4
+
+#define DG_TINYMON_READ_OP 1
+#define DG_TINYMON_WRITE_OP 2
+#define DG_TINYMON_DMA_READ_OP 3
+#define DG_TINYMON_DMA_WRITE_OP 4
diff --git a/include/2.0L/ultra64.h b/include/2.0L/ultra64.h
new file mode 100755
index 00000000..93c34164
--- /dev/null
+++ b/include/2.0L/ultra64.h
@@ -0,0 +1,41 @@
+
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ *************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.10 $
+ * $Date: 1997/02/11 08:37:33 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ultra64.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _ULTRA64_H_
+#define _ULTRA64_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/include/2.0L/ultrahost.h b/include/2.0L/ultrahost.h
new file mode 100755
index 00000000..25c772ae
--- /dev/null
+++ b/include/2.0L/ultrahost.h
@@ -0,0 +1,58 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1995, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ *************************************************************************/
+
+/**************************************************************************
+ *
+ * $Revision: 1.8 $
+ * $Date: 1997/07/02 02:35:06 $
+ * $Source: /disk6/Master/cvsmdev2/PR/include/ultrahost.h,v $
+ *
+ **************************************************************************/
+
+#ifndef _ULTRAHOST_H_
+#define _ULTRAHOST_H_
+
+#ifdef PTN64 /* { */
+
+#define execl execl_pt
+
+#define uhOpenGame uhOpenGame_pt
+#define uhCloseGame uhCloseGame_pt
+
+#define uhReadGame uhReadGame_pt
+#define uhWriteGame uhWriteGame_pt
+#define uhReadRamrom uhReadRamrom_pt
+#define uhWriteRamrom uhWriteRamrom_pt
+#define uhPartnerCmd uhPartnerCmd_pt
+#define uhGload uhGload_pt
+
+int uhPartnerCmd(int,char *);
+int uhGload(int,char *);
+
+#endif /* } */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+int uhOpenGame(const char *);
+int uhCloseGame(int);
+
+int uhReadGame(int, void *, int);
+int uhWriteGame(int, void *, int);
+int uhWriteRamrom(int, void *, void*, int);
+int uhReadRamrom(int, void *, void*, int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ULTRAHOST */
diff --git a/include/arcade_int.h b/include/arcade_int.h
new file mode 100644
index 00000000..a95ee707
--- /dev/null
+++ b/include/arcade_int.h
@@ -0,0 +1,362 @@
+#ifndef ARCADE_INTERNAL_H
+#define ARCADE_INTERNAL_H
+
+#include
+#include "functions.h"
+#include "variables.h"
+
+enum ARCADE_OBJ_E {
+ ARCADE_OBJ_01_BARREL = 1,
+ ARCADE_OBJ_02_FLAME_ENEMY,
+ ARCADE_OBJ_03_SPRING,
+ ARCADE_OBJ_04_PIE,
+ ARCADE_OBJ_05_BONUS_ITEM,
+ ARCADE_OBJ_06_HAMMER,
+ ARCADE_OBJ_07_HAMMER_PARTICLES,
+ ARCADE_OBJ_08_DK_HOW_HIGH,
+ ARCADE_OBJ_09_NAME_SELECT_CURSOR,
+ ARCADE_OBJ_0A_BARREL_STACK,
+ ARCADE_OBJ_0B_RIVET,
+ ARCADE_OBJ_0C_MOVING_LADDER,
+ ARCADE_OBJ_0D_JUMPMAN,
+ ARCADE_OBJ_0E_BONUS_OSD,
+ ARCADE_OBJ_0F_100M_COMPLETE_PARTICLE,
+ ARCADE_OBJ_10_OIL_DRUM,
+ ARCADE_OBJ_11_ELEVATOR_CRANK,
+ ARCADE_OBJ_12_PULLEY,
+ ARCADE_OBJ_13_OIL_DRUM_FLAMES,
+ ARCADE_OBJ_14_POINTS_TEXT,
+ ARCADE_OBJ_15_DK_TITLE,
+ ARCADE_OBJ_16_DK_25M,
+ ARCADE_OBJ_17_DK_100M,
+ ARCADE_OBJ_18_DK_75M,
+ ARCADE_OBJ_19_DK_50M,
+ ARCADE_OBJ_1A_PAULINE_BOTTOM,
+ ARCADE_OBJ_1B_PAULINE_TOP,
+ //ARCADE_OBJ_1C
+ ARCADE_OBJ_1D_HELP_TEXT = 0x1D,
+ ARCADE_OBJ_1E_NINTENDO_COIN
+};
+
+typedef struct {
+ uSprite sprite[2]; //array size unknown
+ u8 pad30[0x750];
+} ArcadeStruct3; //size(0x780)
+
+typedef struct arcade_struct_1 {
+ f32 x_position; // x position at 0x0
+ f32 y_position; // y position at 0x4
+ f32 x_velocity; // x velocity at 0x8
+ f32 y_velocity; // y velocity at 0xC
+ f32 unk10; // lifetime?
+ s32 *unk14; // imageDataPointer
+ u8 unk18; // object_type
+ u8 unk19; // state?
+ u8 unk1A;
+ u8 unk1B;
+ u8 unk1C;
+ u8 unk1D;
+ u8 unk1E; // height
+ u8 unk1F; // width
+} ArcadeStruct1;
+
+typedef struct {
+ u16 r:5;
+ u16 g:5;
+ u16 b:5;
+ u16 a:1;
+} rgba5551;
+
+typedef struct {
+ u8 pad0[0xC];
+} ArcadeStruct4;
+
+void func_8002549C(void);
+void func_80024D90(void);
+void func_800259D0(Gfx **arg0);
+void func_80026680(Gfx **arg0);
+void func_800268AC(Gfx **arg0);
+void func_80029968(void);
+s32 func_80029ACC(s32 arg0, s32 arg1);
+void func_80029CD0(s32 arg0, s32 arg1);
+void func_80029EFC(s32 arg0, s32 arg1);
+s32 func_8002A264(s32 arg0, s32 arg1);
+s32 func_8002A408(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5);
+void func_8002B2C0(Gfx **arg0);
+
+void func_800303B8(u8);
+void func_80030734(u8);
+void arcade_rivet_update(u8);
+void func_80030A04(u8);
+void func_80030CEC(u8);
+void arcade_pie_update(u8);
+
+void func_80030FEC(void);
+void func_800313B8(void);
+
+void func_8060C648(u8 arg0, u32 arg1, u8 arg2, u32 fileIndex, s32 arg4);
+u32 func_8060C6B8(u8 arg0, u32 arg1, u8 arg2, u32 arg3);
+void func_8060DEA8(void);
+void func_80737638(void * arg0, enum sfx_e arg1, u32 arg2 , u32 arg3, f32 arg4, u32 arg5, u32 arg6);
+
+/* rom */
+extern Gfx **D_1000040;
+extern Gfx **D_1000090;
+
+/*.data */ //0x8032220 = 0xE220
+
+extern u8 D_80032228; // imageData
+// these are likely the same struct
+extern u8 D_80032B48;
+extern u8 D_80032B90;
+extern u8 D_80032BD8;
+extern u8 D_80032C20;
+extern u8 D_80032DF8;
+extern u8 D_80032E80; // imageData
+extern u8 D_80032F68; // imageData
+extern u8 D_800335D8;
+extern u8 D_80033C48;
+extern u8 D_80034360; // imageData
+extern u8 D_80034568;
+extern u8 D_80034610; // imageData //barrel
+extern u8 D_80034818[];
+extern u8 D_80034A20[];
+extern u8 D_80034C28[];
+extern u8 D_80034E30[];
+extern u8 D_80035038[];
+extern u8 D_80035240[];
+extern u8 D_80035448[];
+extern u8 D_80035650[];
+extern u8 D_80035898[];
+extern u8 D_80035AE0[];
+extern u8 D_80035CE8[];
+extern u8 D_80037130; // imageData
+extern u8 D_80037338; // imageData
+extern u8 D_80037580; // imageData
+extern s32 D_80037B98; // sprite?
+extern s32 D_80037DA0; // sprite?
+extern s32 D_80037FA8; // sprite?
+extern u8 D_800381B0; // imageData
+extern s32 D_800383B8; // sprite?
+extern s32 D_800385C0; // sprite?
+extern s32 D_800387C8; // sprite?
+extern u8 D_80038BD8[];
+extern u8 D_80038DE0; // imageData
+extern u8 D_80038FE8;
+extern u8 D_800391F0;
+extern u8 D_800393F8; // imageData
+extern u8 D_80039640;
+extern u8 D_80039888;
+extern u8 D_800389D0;
+extern u8 D_80039AD0;
+extern s32 D_80039D18; // sprite
+extern s32 D_80039F60; // sprite
+extern s32 D_8003A1A8; // sprite
+extern s32 D_8003A3F0; // sprite
+extern u8 D_8003A638; // imageData
+extern u8 D_8003A840; // imageData
+extern u8 D_8003AA48; // imageData
+extern u8 D_8003AC50; // imageData
+extern u8 D_8003AE58; // nintendo coin sprite
+extern u8 D_8003B180[];
+extern rgba5551 D_8003DA90[8][8]; // image data
+extern u8 D_8003DB18;
+extern u8 D_8003DD60;
+extern u8 D_8003E438;
+extern u8 D_8003E680[];
+extern u8 D_8003E868[];
+extern u8 D_8003E9F0;
+extern u8 D_8003F9B8; // imageData
+extern s32 D_80040540; // sprite? // donkey kong sprite
+extern s32 D_80041508;
+extern s32 D_800424D0; // imageData
+extern u8 D_80044460;
+extern u8 D_80045428;
+
+extern s32 D_80047C24; // reload_arcade_level
+extern s32 D_8004A308[];
+extern u8 D_8004A338[];
+extern u8 D_8004A358[];
+extern u8 D_8004A378[];
+
+extern s32 D_8004A318[8];
+extern ArcadeStruct1 arcade_jumpman_obj_template = { 96.0f, 247.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_0D_JUMPMAN, 0, 3, 0, 0, 0, 0x10, 0x12};
+extern ArcadeStruct1 arcade_barrel_obj_template = { 64.0f, 79.0f, 1.0f, 0.0f, 0.0f, &D_80034610, ARCADE_OBJ_01_BARREL, 0, 0, 0, 0, 0, 0x10, 0x0F};
+extern ArcadeStruct1 arcade_flame_enemy_obj_template = { 76.0f, 230.0f, 1.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_02_FLAME_ENEMY, 2, 0, 0, 0, 0, 0x10, 0x11};
+extern ArcadeStruct1 arcade_oil_drum_flame_obj_template = { 64.0f, 216.0f, 1.0f, 0.0f, 0.0f, &D_80032228, ARCADE_OBJ_13_OIL_DRUM_FLAMES, 2, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_spring_obj_template = { -24.0f, 81.0f, 2.0f, -3.5f, 0.0f, NULL, ARCADE_OBJ_03_SPRING, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_bonus_osd_obj_template = { 219.0f, 38.0f, 2.0f, -3.5f, 0.0f, &D_80032F68, ARCADE_OBJ_0E_BONUS_OSD, 0, 0, 0, 0, 0, 0x2B, 0x13};
+extern ArcadeStruct1 arcade_oil_drum_obj_template = { 64.0f, 231.0f, 0.0f, 0.0f, 0.0f, &D_80037338, ARCADE_OBJ_10_OIL_DRUM, 0, 0, 0, 0, 0, 0x10, 0x11};
+extern ArcadeStruct1 arcade_elevator_obj_template = { 80.0f, 88.0f, 0.0f, 0.0f, 0.0f, &D_80037580, ARCADE_OBJ_11_ELEVATOR_CRANK, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_pulley_obj_template = { 48.0f, 84.0f, 0.0f, 0.0f, 0.0f, &D_80037B98, ARCADE_OBJ_12_PULLEY, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_pauline_top_obj_template = { 136.0f, 26.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_1B_PAULINE_TOP, 0, 0, 0, 0, 0, 0x10, 0x11};
+extern ArcadeStruct1 arcade_pauline_bottom_obj_template = { 136.0f, 42.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_1A_PAULINE_BOTTOM, 0, 0, 0, 0, 0, 0x10, 0x11};
+extern ArcadeStruct1 arcade_nintendo_coin_obj_template = { 136.0f, 42.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_1E_NINTENDO_COIN, 0, 0, 0, 0, 0, 0x14, 0x14};
+extern ArcadeStruct1 arcade_help_text_obj_template = { 152.0f, 33.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_1D_HELP_TEXT, 0, 0, 0, 0, 0, 0x18, 0x0A};
+extern ArcadeStruct1 arcade_dk_title_obj_template = { 148.0f, 200.0f, 0.0f, 0.0f, 0.0f, NULL, ARCADE_OBJ_15_DK_TITLE, 0, 0, 0, 0, 0, 0x30, 0x29};
+extern ArcadeStruct1 arcade_dk_25m_obj_template = { 68.0f, 38.0f, 0.0f, 0.0f, 0.0f, &D_80040540, ARCADE_OBJ_16_DK_25M, 0xC, 0, 0, 1, 0, 0x30, 0x29};
+extern ArcadeStruct1 arcade_dk_100m_obj_template = { 136.0f, 53.0f, 0.0f, 0.0f, 0.0f, &D_80040540, ARCADE_OBJ_17_DK_100M, 2, 0, 0, 0, 0, 0x30, 0x29};
+extern ArcadeStruct1 arcade_dk_75m_obj_template = { 68.0f, 42.0f, 0.0f, 0.0f, 0.0f, &D_80040540, ARCADE_OBJ_18_DK_75M, 2, 0, 0, 0, 0, 0x30, 0x29};
+extern ArcadeStruct1 arcade_dk_50m_obj_template = { 68.0f, 42.0f, 1.0f, 0.0f, 0.0f, &D_80040540, ARCADE_OBJ_19_DK_50M, 2, 0, 0, 0, 0, 0x30, 0x29};
+extern ArcadeStruct1 arcade_dk_how_high_obj_template = { 138.0f, 198.0f, 0.0f, 0.0f, 0.0f, &D_8003F9B8, ARCADE_OBJ_08_DK_HOW_HIGH, 0, 0, 0, 0, 0, 0x2E, 0x20};
+extern ArcadeStruct1 arcade_points_text_obj_template = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, &D_800381B0, ARCADE_OBJ_14_POINTS_TEXT, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_bonus_item_obj_template = { 180.0f, 247.0f, 0.0f, 0.0f, 0.0f, &D_80038DE0, ARCADE_OBJ_05_BONUS_ITEM, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_hammer_obj_template = { 220.0f, 200.0f, 0.0f, 0.0f, 0.0f, &D_800393F8, ARCADE_OBJ_06_HAMMER, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_rivet_obj_template = { 108.0f, 208.0f, 0.0f, 0.0f, 0.0f, &D_80032E80, ARCADE_OBJ_0B_RIVET, 0, 0, 0, 1, 0, 0x08, 0x09};
+extern ArcadeStruct1 arcade_moving_ladder_obj_template = { 60.0f, 97.0f, 0.0f, 0.0f, 0.0f, &D_8003A638, ARCADE_OBJ_0C_MOVING_LADDER, 0, 0, 0, 0xF4, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_name_select_cursor_obj_template = { 60.0f, 97.0f, 0.0f, 0.0f, 0.0f, &D_8003A840, ARCADE_OBJ_09_NAME_SELECT_CURSOR, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 D_8004A6B8 = { 60.0f, 97.0f, 0.0f, 0.0f, 0.0f, &D_80034360, 0x1C, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_pie_obj_template = { 60.0f, 207.0f, 0.0f, 0.0f, 0.0f, &D_8003AA48, ARCADE_OBJ_04_PIE, 0, 0, 0, 3, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_100m_complete_particle_obj_template = { 160.0f, 214.0f, 0.0f, 0.0f, 0.0f, &D_8003AC50, ARCADE_OBJ_0F_100M_COMPLETE_PARTICLE, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern ArcadeStruct1 arcade_barrel_stack_obj_template = { 58.0f, 83.0f, 0.0f, 0.0f, 0.0f, &D_80037130, ARCADE_OBJ_0A_BARREL_STACK, 0, 0, 0, 0, 0, 0x10, 0x10};
+extern u32 D_8004A738 = 1; // rng
+extern u8 D_8004A73C = 0;
+extern u8 D_8004A740 = 0; // arcade_is_in_nintendo_coin_mode
+extern u8 D_8004A744;
+extern s32 arcade_current_score = 3700; //0x8004A748
+extern s32 arcade_saved_high_scores[5] = {
+ 7650, 6100, 5950, 5050, 4300
+}; //0x8004A74C
+
+extern s32 D_8004A760 = 7650;
+extern u8 D_8004A764 = 0;
+extern s8 D_8004A768 = 0;
+extern u8 D_8004A76C = 0;
+extern u8 D_8004A770 = 0;
+extern u8 D_8004A774[3] = {' ',' ',' '};
+extern u8 arcade_saved_high_score_initials[5][3] = {
+ {' ',' ',' '},
+ {' ',' ',' '},
+ {' ',' ',' '},
+ {' ',' ',' '},
+ {' ',' ',' '}
+}; //0x8004A778
+extern u8 D_8004A788[4];
+extern s32 D_8004A78C = 1;
+extern s32 D_8004A790 = 0;
+extern u8 D_8004A794 = 0x20;
+extern s32 D_8004A798[0xC];
+
+extern u8 D_8004A81C[8][2]; // 50m rivet positions
+extern u8 D_8004A82C[5][3] = {
+ {'1','S','T'},
+ {'2','N','D'},
+ {'3','R','D'},
+ {'4','T','H'},
+ {'5','T','H'},
+};
+extern s32 D_8004A83C = 0;
+
+/*.rodata 0x8004A840*/
+extern char D_8004A840[] = "NAME %.3s";
+extern char D_8004A84C[] = "---";
+extern char D_8004A850[] = "REGI TIME <%02d>";
+extern char D_8004A864[] = "YOUR NAME WAS";
+extern char D_8004A874[] = "REGISTERED";
+extern char D_8004A880[] = "NAME REGISTRATION";
+extern char D_8004A894[] = "A B C D E F G H I J";
+extern char D_8004A8A8[] = "K L M N O P Q R S T";
+extern char D_8004A8BC[] = "U V W X Y Z . -";
+extern char D_8004A8CC[] = "ba";
+extern char D_8004A8D0[] = "%.3s";
+extern char D_8004A8D8[] = "%.3s %06d %.3s";
+extern char D_8004A8EC[] = "CREDIT 00";
+extern char D_8004A8F8[] = "1UP";
+extern char D_8004A8FC[] = "HIGH SCORE";
+extern char D_8004A908[] = "L=%02d";
+extern char D_8004A910[] = "%06d %06d";
+extern char D_8004A920[] = "GAME OVER";
+extern char D_8004A92C[] = "RETURN";
+extern u8 D_8004A934;
+extern u8 D_8004A944;
+extern u8 D_8004A954;
+extern u8 D_8004A95C;
+extern u8 D_8004A974;
+extern u8 D_8004A97C;
+extern u8 D_8004A984;
+extern u8 D_8004A98C;
+extern u8 D_8004A994;
+extern u8 D_8004A9A0;
+extern u8 D_8004A9B0;
+extern u8 D_8004A9BC;
+extern u8 D_8004A9D0;
+extern u8 D_8004A9DC;
+/*jmp_tbl D_8004A9EC[6]*/
+
+extern f32 D_8004AA18;
+extern f64 D_8004AA98;
+extern f64 D_8004AAA0;
+extern f64 D_8004AAA8;
+extern f64 D_8004AAB0;
+extern f64 D_8004AB28;
+extern f64 D_8004AB30;
+extern f32 D_8004AB38;
+
+extern f32 D_8004AB78;
+extern f32 D_8004AB7C;
+
+/* .bss 0x804AC00 */
+extern ArcadeStruct3 D_8004AC00[];
+extern uSprite D_8004BB00[2];
+extern uSprite D_8004BB30[2];
+extern uSprite D_8004BB60[2];
+extern uSprite D_8004BB90[2];
+extern uSprite D_8004BBC0[2];
+extern uSprite D_8004BBF0[];
+extern f32 D_8004BC88[6][3];
+extern ArcadeStruct1 D_8004BCD0[0x50];
+extern void *D_8004C6D0;
+extern s32 D_8004C6D4;
+extern s16 D_8004C6D6;
+extern s32 D_8004C6D8;
+extern s32 D_8004C6DC; // arcade_internal_timer
+extern s32 D_8004C6E0;
+extern D_8004C6E4;
+extern D_8004C6EC;
+extern s32 D_8004C6E8;
+extern s32 D_8004C6F0;
+extern s32 D_8004C6F4;
+extern s32 D_8004C6F8;
+extern s32 D_8004C6FC;
+extern s32 D_8004C704;
+extern u32 D_8004C708;
+extern s32 D_8004C70C;
+extern s32 D_8004C710;
+extern s32 arcade_next_sfx; //0x8004C714
+extern u8 D_8004C718;
+extern u8 D_8004C719;
+extern u8 D_8004C71A;
+extern u8 arcade_lives_internal; //0x8004C71B
+extern u8 arcade_lives_visual; //0x8004C71C
+extern u8 arcade_game_state; //0x8004C71D
+extern s8 D_8004C71E;
+extern u8 D_8004C71F; // Index into D_8004BCD0[], arcade_jumpman_slot?
+extern u8 D_8004C720;
+extern u8 D_8004C721;
+extern u8 arcade_background_visual; //0x8004C722
+extern u8 D_8004C723;
+extern u8 D_8004C724;
+extern u8 D_8004C725;
+extern u8 D_8004C726;
+extern u8 D_8004C727;
+extern u8 D_8004C728;
+extern D_8004C72C;
+extern s16 D_8004C72E;
+extern D_8004C730;
+extern s16 D_8004C732;
+
+/* global_asm */
+extern u8 D_807444FC;
+extern Gfx *D_8076A050[];
+extern s32 D_8076A048;
+extern void *D_8076A080;
+extern s32 D_8076A088;
+extern s32 D_8076A08C;
+extern u8 D_8076A0B1;
+extern u8 D_80767CE8;
+extern f32 D_807FD888;
+extern u32 D_8076D1F8; // ??
+extern s32 D_80770DF8;
+extern GlobalASMStruct17 *D_807ECDE8;
+extern u8 *D_80746800;
+#endif /* ARCADE_INTERNAL_H */
diff --git a/include/controller.h b/include/controller.h
new file mode 100755
index 00000000..720928cd
--- /dev/null
+++ b/include/controller.h
@@ -0,0 +1,210 @@
+#ifndef _CONTROLLER_H
+#define _CONTROLLER_H
+#include
+#include
+
+//should go somewhere else but
+#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0])))
+#define CHNL_ERR(format) ((format.rxsize & CHNL_ERR_MASK) >> 4)
+
+
+typedef struct
+{
+ /* 0x0 */ u32 ramarray[15];
+ /* 0x3C */ u32 pifstatus;
+} OSPifRam;
+
+typedef struct
+{
+ /* 0x0 */ u8 dummy;
+ /* 0x1 */ u8 txsize;
+ /* 0x2 */ u8 rxsize;
+ /* 0x3 */ u8 cmd;
+ /* 0x4 */ u16 button;
+ /* 0x6 */ s8 stick_x;
+ /* 0x7 */ s8 stick_y;
+} __OSContReadFormat;
+
+typedef struct
+{
+ /* 0x0 */ u8 dummy;
+ /* 0x1 */ u8 txsize;
+ /* 0x2 */ u8 rxsize;
+ /* 0x3 */ u8 cmd;
+ /* 0x4 */ u8 typeh;
+ /* 0x5 */ u8 typel;
+ /* 0x6 */ u8 status;
+ /* 0x7 */ u8 dummy1;
+} __OSContRequesFormat;
+
+typedef struct
+{
+ /* 0x0 */ u8 txsize;
+ /* 0x1 */ u8 rxsize;
+ /* 0x2 */ u8 cmd;
+ /* 0x3 */ u8 typeh;
+ /* 0x4 */ u8 typel;
+ /* 0x5 */ u8 status;
+} __OSContRequesFormatShort;
+
+typedef struct
+{
+ /* 0x0 */ u8 dummy;
+ /* 0x1 */ u8 txsize;
+ /* 0x2 */ u8 rxsize;
+ /* 0x3 */ u8 cmd;
+ /* 0x4 */ u8 unk4;
+ /* 0x5 */ u8 unk5;
+ //u16 address;
+ /* 0x6 */ u8 data[BLOCKSIZE];
+ /* 0x26 */ u8 datacrc;
+} __OSContRamReadFormat;
+
+typedef union {
+ /* 0x0 */ struct
+ {
+ /* 0x0 */ u8 bank;
+ /* 0x1 */ u8 page;
+ } inode_t;
+ /* 0x0 */ u16 ipage;
+} __OSInodeUnit;
+
+typedef struct
+{
+ /* 0x0 */ u32 game_code;
+ /* 0x4 */ u16 company_code;
+ /* 0x6 */ __OSInodeUnit start_page;
+ /* 0x8 */ u8 status;
+ /* 0x9 */ s8 reserved;
+ /* 0xA */ u16 data_sum;
+ /* 0xC */ u8 ext_name[PFS_FILE_EXT_LEN];
+ /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN];
+} __OSDir;
+
+typedef struct
+{
+ /* 0x0 */ __OSInodeUnit inode_page[128];
+} __OSInode;
+
+typedef struct
+{
+ /* 0x0 */ u32 repaired;
+ /* 0x4 */ u32 random;
+ /* 0x8 */ u64 serial_mid;
+ /* 0x10 */ u64 serial_low;
+ /* 0x18 */ u16 deviceid;
+ /* 0x1A */ u8 banks;
+ /* 0x1B */ u8 version;
+ /* 0x1C */ u16 checksum;
+ /* 0x1E */ u16 inverted_checksum;
+} __OSPackId;
+
+typedef struct
+{
+ /* 0x0 */ u8 txsize;
+ /* 0x1 */ u8 rxsize;
+ /* 0x2 */ u8 cmd;
+ /* 0x3 */ u8 address;
+ /* 0x4 */ u8 data[EEPROM_BLOCK_SIZE];
+} __OSContEepromFormat;
+
+//from: http://en64.shoutwiki.com/wiki/SI_Registers_Detailed#CONT_CMD_Usage
+#define CONT_CMD_REQUEST_STATUS 0
+#define CONT_CMD_READ_BUTTON 1
+#define CONT_CMD_READ_MEMPACK 2
+#define CONT_CMD_WRITE_MEMPACK 3
+#define CONT_CMD_READ_EEPROM 4
+#define CONT_CMD_WRITE_EEPROM 5
+#define CONT_CMD_RESET 0xff
+
+#define CONT_CMD_REQUEST_STATUS_TX 1
+#define CONT_CMD_READ_BUTTON_TX 1
+#define CONT_CMD_READ_MEMPACK_TX 3
+#define CONT_CMD_WRITE_MEMPACK_TX 35
+#define CONT_CMD_READ_EEPROM_TX 2
+#define CONT_CMD_WRITE_EEPROM_TX 10
+#define CONT_CMD_RESET_TX 1
+
+#define CONT_CMD_REQUEST_STATUS_RX 3
+#define CONT_CMD_READ_BUTTON_RX 4
+#define CONT_CMD_READ_MEMPACK_RX 33
+#define CONT_CMD_WRITE_MEMPACK_RX 1
+#define CONT_CMD_READ_EEPROM_RX 8
+#define CONT_CMD_WRITE_EEPROM_RX 1
+#define CONT_CMD_RESET_RX 3
+
+#define CONT_CMD_NOP 0xff
+#define CONT_CMD_END 0xfe //indicates end of a command
+#define CONT_CMD_EXE 1 //set pif ram status byte to this to do a command
+
+#define DIR_STATUS_EMPTY 0
+#define DIR_STATUS_UNKNOWN 1
+#define DIR_STATUS_OCCUPIED 2
+
+
+typedef struct
+{
+ /* 0x0 */ __OSInode inode;
+ /* 0x100 */ u8 bank;
+ /* 0x101 */ u8 map[256];
+} __OSInodeCache;
+
+extern s32 __osEepStatus(OSMesgQueue *, OSContStatus *);
+u16 __osSumcalc(u8 *ptr, int length);
+s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum);
+s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid);
+s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp);
+s32 __osGetId(OSPfs *pfs);
+s32 __osCheckId(OSPfs *pfs);
+s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank);
+s32 __osPfsSelectBank(OSPfs *pfs);
+s32 __osPfsDeclearPage(OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page);
+s32 __osPfsReleasePages(OSPfs *pfs, __OSInode *inode, u8 start_page, u16 *sum, u8 bank, __OSInodeUnit *last_page, int flag);
+s32 __osBlockSum(OSPfs *pfs, u8 page_no, u16 *sum, u8 bank);
+s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer);
+s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force);
+void __osContGetInitData(u8 *pattern, OSContStatus *data);
+void __osPackRequestData(u8 cmd);
+void __osPfsRequestData(u8 cmd);
+void __osPfsGetInitData(u8* pattern, OSContStatus* data);
+u8 __osContAddressCrc(u16 addr);
+u8 __osContDataCrc(u8 *data);
+s32 __osPfsGetStatus(OSMesgQueue *queue, int channel);
+
+extern u8 __osContLastCmd;
+extern OSTimer __osEepromTimer;
+extern OSMesg __osEepromTimerMsg;
+extern OSMesgQueue __osEepromTimerQ;
+extern OSPifRam __osEepPifRam;
+extern OSPifRam __osContPifRam;
+extern OSPifRam __osPfsPifRam;
+extern u8 __osMaxControllers;
+
+//some version of this almost certainly existed since there's plenty of times where it's used right before a return 0
+#define ERRCK(fn) \
+ ret = fn; \
+ if (ret != 0) \
+ return ret;
+
+#define SET_ACTIVEBANK_TO_ZERO \
+ if (pfs->activebank != 0) \
+ { \
+ pfs->activebank = 0; \
+ ERRCK(__osPfsSelectBank(pfs)) \
+ }
+
+#define PFS_CHECK_ID \
+ if (__osCheckId(pfs) == PFS_ERR_NEW_PACK) \
+ return PFS_ERR_NEW_PACK;
+#endif
+
+#define PFS_CHECK_STATUS \
+ if ((pfs->status & PFS_INITIALIZED) == 0) \
+ return PFS_ERR_INVALID;
+
+#define PFS_GET_STATUS \
+ __osSiGetAccess(); \
+ ret = __osPfsGetStatus(queue, channel); \
+ __osSiRelAccess(); \
+ if (ret != 0) \
+ return ret;
diff --git a/include/enums.h b/include/enums.h
new file mode 100644
index 00000000..fab1f127
--- /dev/null
+++ b/include/enums.h
@@ -0,0 +1,620 @@
+#ifndef __ENUMS_H__
+#define __ENUMS_H__
+
+typedef enum game_mode_e {
+ GAME_MODE_NINTENDO_LOGO,
+ GAME_MODE_OPENING_CUTSCENE,
+ GAME_MODE_DK_RAP,
+ GAME_MODE_DK_TV,
+ GAME_MODE_UNKNOWN_4,
+ GAME_MODE_MAIN_MENU,
+ GAME_MODE_ADVENTURE,
+ GAME_MODE_QUIT_GAME,
+ GAME_MODE_UNKNOWN_8,
+ GAME_MODE_GAME_OVER,
+ GAME_MODE_END_SEQUENCE,
+ GAME_MODE_DK_THEATRE,
+ GAME_MODE_MYSTERY_MENU_MINIGAME,
+ GAME_MODE_SNIDES_BONUS_GAME,
+ GAME_MODE_END_SEQUENCE_DK_THEATRE
+} GameModes;
+
+typedef enum map_e {
+ MAP_TEST_MAP,
+ MAP_FUNKYS_STORE,
+ MAP_DK_ARCADE,
+ MAP_KROOL_BARREL_LANKY_MAZE,
+ MAP_JAPES_MOUNTAIN,
+ MAP_CRANKYS_LAB,
+ MAP_JAPES_MINECART,
+ MAP_JAPES,
+ MAP_JAPES_ARMY_DILLO,
+ MAP_JETPAC,
+ MAP_KREMLING_KOSH_VERY_EASY,
+ MAP_STEALTHY_SNOOP_NORMAL_NO_LOGO,
+ MAP_JAPES_SHELL,
+ MAP_JAPES_LANKY_CAVE,
+ MAP_AZTEC_BEETLE_RACE,
+ MAP_SNIDES_HQ,
+ MAP_AZTEC_TINY_TEMPLE,
+ MAP_HELM,
+ MAP_TEETERING_TURTLE_TROUBLE_VERY_EASY,
+ MAP_AZTEC_FIVE_DOOR_TEMPLE_DK,
+ MAP_AZTEC_LLAMA_TEMPLE,
+ MAP_AZTEC_FIVE_DOOR_TEMPLE_DIDDY,
+ MAP_AZTEC_FIVE_DOOR_TEMPLE_TINY,
+ MAP_AZTEC_FIVE_DOOR_TEMPLE_LANKY,
+ MAP_AZTEC_FIVE_DOOR_TEMPLE_CHUNKY,
+ MAP_CANDYS_MUSIC_SHOP,
+ MAP_FACTORY,
+ MAP_FACTORY_CAR_RACE,
+ MAP_HELM_LEVEL_INTROS_GAME_OVER,
+ MAP_FACTORY_POWER_SHED,
+ MAP_GALLEON,
+ MAP_GALLEON_KROOLS_SHIP,
+ MAP_BATTY_BARREL_BANDIT_EASY,
+ MAP_JAPES_CHUNKY_CAVE,
+ MAP_DK_ISLES_OVERWORLD,
+ MAP_KROOL_BARREL_DK_TARGET_GAME,
+ MAP_FACTORY_CRUSHER_ROOM,
+ MAP_JAPES_BARREL_BLAST,
+ MAP_AZTEC,
+ MAP_GALLEON_SEAL_RACE,
+ MAP_NINTENDO_LOGO,
+ MAP_AZTEC_BARREL_BLAST,
+ MAP_TROFF_N_SCOFF,
+ MAP_GALLEON_SHIPWRECK_DIDDY_LANKY_CHUNKY,
+ MAP_GALLEON_TREASURE_CHEST,
+ MAP_GALLEON_MERMAID,
+ MAP_GALLEON_SHIPWRECK_DK_TINY,
+ MAP_GALLEON_SHIPWRECK_LANKY_TINY,
+ MAP_FUNGI,
+ MAP_GALLEON_LIGHTHOUSE,
+ MAP_KROOL_BARREL_TINY_MUSHROOM_GAME,
+ MAP_GALLEON_MECHANICAL_FISH,
+ MAP_FUNGI_ANT_HILL,
+ MAP_BATTLE_ARENA_BEAVER_BRAWL,
+ MAP_GALLEON_BARREL_BLAST,
+ MAP_FUNGI_MINECART,
+ MAP_FUNGI_DIDDY_BARN,
+ MAP_FUNGI_DIDDY_ATTIC,
+ MAP_FUNGI_LANKY_ATTIC,
+ MAP_FUNGI_DK_BARN,
+ MAP_FUNGI_SPIDER,
+ MAP_FUNGI_FRONT_PART_OF_MILL,
+ MAP_FUNGI_REAR_PART_OF_MILL,
+ MAP_FUNGI_MUSHROOM_PUZZLE,
+ MAP_FUNGI_GIANT_MUSHROOM,
+ MAP_STEALTHY_SNOOP_NORMAL,
+ MAP_MAD_MAZE_MAUL_HARD,
+ MAP_STASH_SNATCH_NORMAL,
+ MAP_MAD_MAZE_MAUL_EASY,
+ MAP_MAD_MAZE_MAUL_NORMAL,
+ MAP_FUNGI_MUSHROOM_LEAP,
+ MAP_FUNGI_SHOOTING_GAME,
+ MAP_CAVES,
+ MAP_BATTLE_ARENA_KRITTER_KARNAGE,
+ MAP_STASH_SNATCH_EASY,
+ MAP_STASH_SNATCH_HARD,
+ MAP_DK_RAP,
+ MAP_MINECART_MAYHEM_EASY,
+ MAP_BUSY_BARREL_BARRAGE_EASY,
+ MAP_BUSY_BARREL_BARRAGE_NORMAL,
+ MAP_MAIN_MENU,
+ MAP_TITLE_SCREEN_NOT_FOR_RESALE_VERSION,
+ MAP_CAVES_BEETLE_RACE,
+ MAP_FUNGI_DOGADON,
+ MAP_CAVES_IGLOO_TINY,
+ MAP_CAVES_IGLOO_LANKY,
+ MAP_CAVES_IGLOO_DK,
+ MAP_CASTLE,
+ MAP_CASTLE_BALLROOM,
+ MAP_CAVES_ROTATING_ROOM,
+ MAP_CAVES_SHACK_CHUNKY,
+ MAP_CAVES_SHACK_DK,
+ MAP_CAVES_SHACK_DIDDY_MIDDLE_PART,
+ MAP_CAVES_SHACK_TINY,
+ MAP_CAVES_LANKY_HUT,
+ MAP_CAVES_IGLOO_CHUNKY,
+ MAP_SPLISH_SPLASH_SALVAGE_NORMAL,
+ MAP_KLUMSY,
+ MAP_CAVES_ICE_CASTLE,
+ MAP_SPEEDY_SWING_SORTIE_EASY,
+ MAP_CAVES_IGLOO_DIDDY,
+ MAP_KRAZY_KONG_KLAMOUR_EASY,
+ MAP_BIG_BUG_BASH_VERY_EASY,
+ MAP_SEARCHLIGHT_SEEK_VERY_EASY,
+ MAP_BEAVER_BOTHER_EASY,
+ MAP_CASTLE_TOWER,
+ MAP_CASTLE_MINECART,
+ MAP_KONG_BATTLE_BATTLE_ARENA,
+ MAP_CASTLE_CRYPT_LANKY_TINY,
+ MAP_KONG_BATTLE_ARENA_1,
+ MAP_FACTORY_BARREL_BLAST,
+ MAP_GALLEON_PUFFTOSS,
+ MAP_CASTLE_CRYPT_DK_DIDDY_CHUNKY,
+ MAP_CASTLE_MUSEUM,
+ MAP_CASTLE_LIBRARY,
+ MAP_KREMLING_KOSH_EASY,
+ MAP_KREMLING_KOSH_NORMAL,
+ MAP_KREMLING_KOSH_HARD,
+ MAP_TEETERING_TURTLE_TROUBLE_EASY,
+ MAP_TEETERING_TURTLE_TROUBLE_NORMAL,
+ MAP_TEETERING_TURTLE_TROUBLE_HARD,
+ MAP_BATTY_BARREL_BANDIT_EASY_2,
+ MAP_BATTY_BARREL_BANDIT_NORMAL,
+ MAP_BATTY_BARREL_BANDIT_HARD,
+ MAP_MAD_MAZE_MAUL_INSANE,
+ MAP_STASH_SNATCH_INSANE,
+ MAP_STEALTHY_SNOOP_VERY_EASY,
+ MAP_STEALTHY_SNOOP_EASY,
+ MAP_STEALTHY_SNOOP_HARD,
+ MAP_MINECART_MAYHEM_NORMAL,
+ MAP_MINECART_MAYHEM_HARD,
+ MAP_BUSY_BARREL_BARRAGE_HARD,
+ MAP_SPLISH_SPLASH_SALVAGE_HARD,
+ MAP_SPLISH_SPLASH_SALVAGE_EASY,
+ MAP_SPEEDY_SWING_SORTIE_NORMAL,
+ MAP_SPEEDY_SWING_SORTIE_HARD,
+ MAP_BEAVER_BOTHER_NORMAL,
+ MAP_BEAVER_BOTHER_HARD,
+ MAP_SEARCHLIGHT_SEEK_EASY,
+ MAP_SEARCHLIGHT_SEEK_NORMAL,
+ MAP_SEARCHLIGHT_SEEK_HARD,
+ MAP_KRAZY_KONG_KLAMOUR_NORMAL,
+ MAP_KRAZY_KONG_KLAMOUR_HARD,
+ MAP_KRAZY_KONG_KLAMOUR_INSANE,
+ MAP_PERIL_PATH_PANIC_VERY_EASY,
+ MAP_PERIL_PATH_PANIC_EASY,
+ MAP_PERIL_PATH_PANIC_NORMAL,
+ MAP_PERIL_PATH_PANIC_HARD,
+ MAP_BIG_BUG_BASH_EASY,
+ MAP_BIG_BUG_BASH_NORMAL,
+ MAP_BIG_BUG_BASH_HARD,
+ MAP_CASTLE_DUNGEON,
+ MAP_HELM_INTRO_STORY,
+ MAP_DK_ISLES_DK_THEATRE,
+ MAP_FACTORY_MAD_JACK,
+ MAP_BATTLE_ARENA_ARENA_AMBUSH,
+ MAP_BATTLE_ARENA_MORE_KRITTER_KARNAGE,
+ MAP_BATTLE_ARENA_FOREST_FRACAS,
+ MAP_BATTLE_ARENA_BISH_BASH_BRAWL,
+ MAP_BATTLE_ARENA_KAMIKAZE_KREMLINGS,
+ MAP_BATTLE_ARENA_PLINTH_PANIC,
+ MAP_BATTLE_ARENA_PINNACLE_PALAVER,
+ MAP_BATTLE_ARENA_SHOCKWAVE_SHOWDOWN,
+ MAP_CASTLE_BASEMENT,
+ MAP_CASTLE_TREE,
+ MAP_KROOL_BARREL_DIDDY_KREMLING_GAME,
+ MAP_CASTLE_CHUNKY_TOOLSHED,
+ MAP_CASTLE_TRASH_CAN,
+ MAP_CASTLE_GREENHOUSE,
+ MAP_JAPES_LOBBY,
+ MAP_HELM_LOBBY,
+ MAP_DK_HOUSE,
+ MAP_ROCK_INTRO_STORY,
+ MAP_AZTEC_LOBBY,
+ MAP_GALLEON_LOBBY,
+ MAP_FACTORY_LOBBY,
+ MAP_TRAINING_GROUNDS,
+ MAP_DIVE_BARREL,
+ MAP_FUNGI_LOBBY,
+ MAP_GALLEON_SUBMARINE,
+ MAP_ORANGE_BARREL,
+ MAP_BARREL_BARREL,
+ MAP_VINE_BARREL,
+ MAP_CASTLE_CRYPT,
+ MAP_ENGUARDE_ARENA,
+ MAP_CASTLE_CAR_RACE,
+ MAP_CAVES_BARREL_BLAST,
+ MAP_CASTLE_BARREL_BLAST,
+ MAP_FUNGI_BARREL_BLAST,
+ MAP_FAIRY_ISLAND,
+ MAP_KONG_BATTLE_ARENA_2,
+ MAP_RAMBI_ARENA,
+ MAP_KONG_BATTLE_ARENA_3,
+ MAP_CASTLE_LOBBY,
+ MAP_CAVES_LOBBY,
+ MAP_DK_ISLES_SNIDES_ROOM,
+ MAP_CAVES_ARMY_DILLO,
+ MAP_AZTEC_DOGADON,
+ MAP_TRAINING_GROUNDS_END_SEQUENCE,
+ MAP_CASTLE_KING_KUT_OUT,
+ MAP_CAVES_SHACK_DIDDY_UPPER_PART,
+ MAP_KROOL_BARREL_DIDDY_ROCKETBARREL_GAME,
+ MAP_KROOL_BARREL_LANKY_SHOOTING_GAME,
+ MAP_KROOL_FIGHT_DK_PHASE,
+ MAP_KROOL_FIGHT_DIDDY_PHASE,
+ MAP_KROOL_FIGHT_LANKY_PHASE,
+ MAP_KROOL_FIGHT_TINY_PHASE,
+ MAP_KROOL_FIGHT_CHUNKY_PHASE,
+ MAP_BLOOPERS_ENDING,
+ MAP_KROOL_BARREL_CHUNKY_HIDDEN_KREMLING_GAME,
+ MAP_KROOL_BARREL_TINY_PONY_TAIL_TWIRL_GAME,
+ MAP_KROOL_BARREL_CHUNKY_SHOOTING_GAME,
+ MAP_KROOL_BARREL_DK_RAMBI_GAME,
+ MAP_KLUMSY_ENDING,
+ MAP_KROOLS_SHOE,
+ MAP_KROOLS_ARENA
+} Maps;
+
+typedef enum actors_e {
+ ACTOR_UNKNOWN_0,
+ ACTOR_UNKNOWN_1,
+ ACTOR_DK,
+ ACTOR_DIDDY,
+ ACTOR_LANKY,
+ ACTOR_TINY,
+ ACTOR_CHUNKY,
+ ACTOR_KRUSHA,
+ ACTOR_RAMBI,
+ ACTOR_ENGUARDE,
+ ACTOR_UNKNOWN_10, // Always loaded, not sure what it is
+ ACTOR_UNKNOWN_11, // Always loaded, not sure what it is
+ ACTOR_LOADING_ZONE_CONTROLLER, // Always loaded
+ ACTOR_OBJECT_MODEL_2_CONTROLLER, // Always loaded
+ ACTOR_UNKNOWN_14, // Always loaded, not sure what it is
+ ACTOR_UNKNOWN_15, // Always loaded, not sure what it is
+ ACTOR_UNKNOWN_16,
+ ACTOR_CANNON_BARREL,
+ ACTOR_RAMBI_CRATE,
+ ACTOR_BARREL_DIDDY_5DI,
+ ACTOR_CAMERA_FOCUS_POINT, // Exists during some cutscenes
+ ACTOR_PUSHABLE_BOX, // Unused
+ ACTOR_BARREL_SPAWNER_UNUSED, // Unused
+ ACTOR_CANNON,
+ ACTOR_VULTURE_RACE_HOOP,
+ ACTOR_HUNKY_CHUNKY_BARREL,
+ ACTOR_TNT_BARREL,
+ ACTOR_TNT_BARREL_SPAWNER, // Army Dillo
+ ACTOR_BONUS_BARREL,
+ ACTOR_MINECART,
+ ACTOR_BOSS_PROJECTILE_FIREBALL,
+ ACTOR_CASTLE_BRIDGE,
+ ACTOR_SWINGING_LIGHT,
+ ACTOR_VINE_BROWN,
+ ACTOR_KREMLING_KOSH_CONTROLLER,
+ ACTOR_PROJECTILE_MELON,
+ ACTOR_PROJECTILE_PEANUT,
+ ACTOR_ROCKETBARREL_ON_KONG,
+ ACTOR_PROJECTILE_PINEAPPLE,
+ ACTOR_LARGE_BRIDGE, // Unused
+ ACTOR_MINI_MONKEY_BARREL,
+ ACTOR_PROJECTILE_ORANGE,
+ ACTOR_PROJECTILE_GRAPE,
+ ACTOR_PROJECTILE_FEATHER,
+ ACTOR_BOSS_PROJECTILE_LASER,
+ ACTOR_GOLDEN_BANANA, // Vulture, bonus barrels, probably some other places
+ ACTOR_TTT_GUN,
+ ACTOR_WATERMELON_SLICE,
+ ACTOR_PROJECTILE_COCONUTS,
+ ACTOR_ROCKETBARREL,
+ ACTOR_PROJECTILE_LIME,
+ ACTOR_AMMO_CRATE, // Dropped by Red Klaptrap
+ ACTOR_ORANGE_PICKUP, // Dropped by Klump & Purple Klaptrap
+ ACTOR_BANANA_COIN, // Dropped by "Diddy", otherwise unused?
+ ACTOR_DK_COIN, // Minecart
+ ACTOR_SMALL_EXPLOSION, // Seasick Chunky
+ ACTOR_ORANGSTAND_SPRINT_BARREL,
+ ACTOR_STRONG_KONG_BARREL,
+ ACTOR_SWINGING_LIGHT_2,
+ ACTOR_BOSS_PROJECTILE_FIREBALL_2,
+ ACTOR_BANAPORTER,
+ ACTOR_BOULDER,
+ ACTOR_MINECART_DK,
+ ACTOR_VASE_OVAL,
+ ACTOR_VASE_DOTS,
+ ACTOR_VASE_TRIANGLE,
+ ACTOR_VASE_PLUS,
+ ACTOR_CANNON_BALL,
+ ACTOR_UNKNOWN_68,
+ ACTOR_VINE, // Green
+ ACTOR_COUNTER, // Unused?
+ ACTOR_KREMLING_RED, // Lanky's Keyboard Game in R&D
+ ACTOR_BOSS_KEY,
+ ACTOR_GALLEON_CANNON, // Galleon Minigame
+ ACTOR_GALLEON_CANNON_BALL, // Galleon Minigame Projectile
+ ACTOR_BLUEPRINT_DIDDY,
+ ACTOR_BLUEPRINT_CHUNKY,
+ ACTOR_BLUEPRINT_LANKY,
+ ACTOR_BLUEPRINT_DK,
+ ACTOR_BLUEPRINT_TINY,
+ ACTOR_MINECART_CHUNKY,
+ ACTOR_BOSS_FIRE_SPAWNER, // TODO: Verify
+ ACTOR_BOULDER_DEBRIS, // Minecart
+ ACTOR_SPIDER_WEB, // Fungi miniBoss
+ ACTOR_STEEL_KEG_SPAWNER,
+ ACTOR_STEEL_KEG,
+ ACTOR_CROWN,
+ ACTOR_MINECART_BONUS,
+ ACTOR_UNKNOWN_88,
+ ACTOR_FIRE_UNUSED,
+ ACTOR_ICE_WALL,
+ ACTOR_BALLOON_DIDDY,
+ ACTOR_STALACTITE,
+ ACTOR_ROCK_DEBRIS, // Rotating, Unused?
+ ACTOR_CAR, // Unused?
+ ACTOR_PAUSE_MENU,
+ ACTOR_HUNKY_CHUNKY_BARREL_DOGADON,
+ ACTOR_TNT_BARREL_SPAWNER_DOGADON,
+ ACTOR_TAG_BARREL,
+ ACTOR_FIREBALL_GET_OUT, // Get Out
+ ACTOR_DIDDY_5DI_PAD_1,
+ ACTOR_DIDDY_5DI_PAD_2,
+ ACTOR_DIDDY_5DI_PAD_3,
+ ACTOR_DIDDY_5DI_PAD_4,
+ ACTOR_DIDDY_5DI_PAD_5,
+ ACTOR_DIDDY_5DI_PAD_6,
+ ACTOR_KONG_REFLECTION,
+ ACTOR_BONUS_BARREL_HELM,
+ ACTOR_UNKNOWN_108
+ /*
+ [109] = "Race Checkpoint",
+ [110] = "CB Bunch", // Unused? Doesn't seem to work, these are normally model 2
+ ACTOR_BALLOON_CHUNKY,
+ ACTOR_BALLOON_TINY,
+ ACTOR_BALLOON_LANKY,
+ ACTOR_BALLOON_DK,
+ [115] = "K. Lumsy's Cage", // TODO: Also rabbit race finish line?
+ [116] = "Chain",
+ [117] = "Beanstalk",
+ [118] = "Yellow ?", // Unused?
+ [119] = "CB Single (Blue)", // Unused? Doesn't seem to work, these are normally model 2
+ [120] = "CB Single (Yellow)", // Unused? Doesn't seem to work, these are normally model 2
+ [121] = "Crystal Coconut", // Unused? Doesn't seem to work, these are normally model 2
+ [122] = "DK Coin", // Multiplayer
+ [123] = "Kong Mirror", // Creepy Castle Museum
+ [124] = "Barrel Gun", // Peril Path Panic
+ [125] = "Barrel Gun", // Krazy Kong Klamour
+ [126] = "Fly Swatter",
+ [127] = "Searchlight", // Searchlight Seek
+ ACTOR_HEADPHONES,
+ [129] = "Enguarde Crate",
+ [130] = "Apple", // Fungi
+ [131] = "Worm", // Fungi
+ [132] = "Enguarde Crate (Unused?)",
+ [133] = "Barrel",
+ [134] = "Training Barrel",
+ [135] = "Boombox", // Treehouse
+ [136] = "Tag Barrel",
+ [137] = "Tag Barrel", // Troff'n'Scoff
+ ACTOR_B_LOCKER,
+ ACTOR_RAINBOW_COIN_PATCH,
+ ACTOR_RAINBOW_COIN,
+ ACTOR_UNKNOWN_141,
+ ACTOR_UNKNOWN_142,
+ ACTOR_UNKNOWN_143,
+ ACTOR_UNKNOWN_144,
+ [145] = "Cannon (Seasick Chunky)", // Internal name "Puffer cannon"
+ ACTOR_UNKNOWN_146,
+ [147] = "Balloon (Unused - K. Rool)", // Internal Name: K. Rool Banana Balloon, unsure of purpose. Can only be popped by Lanky
+ [148] = "Rope", // K. Rool's Arena
+ [149] = "Banana Barrel", // Lanky Phase
+ [150] = "Banana Barrel Spawner", // Lanky Phase, internal name "Skin barrel generator"
+ ACTOR_UNKNOWN_151,
+ ACTOR_UNKNOWN_152,
+ ACTOR_UNKNOWN_153,
+ ACTOR_UNKNOWN_154,
+ ACTOR_UNKNOWN_155,
+ ACTOR_WRINKLY,
+ ACTOR_UNKNOWN_157,
+ ACTOR_UNKNOWN_158,
+ ACTOR_UNKNOWN_159,
+ ACTOR_UNKNOWN_160,
+ ACTOR_UNKNOWN_161,
+ ACTOR_UNKNOWN_162,
+ [163] = "Banana Fairy (BFI)",
+ [164] = "Ice Tomato",
+ [165] = "Tag Barrel (King Kut Out)",
+ [166] = "King Kut Out Part",
+ [167] = "Cannon",
+ ACTOR_UNKNOWN_168,
+ [169] = "Pufftup", // Pufftoss Fight
+ [170] = "Damage Source", // K. Rool's Glove
+ [171] = "Orange", // Krusha's Gun
+ [173] = "Cutscene Controller",
+ ACTOR_UNKNOWN_174,
+ [175] = "Kaboom",
+ [176] = "Timer",
+ [177] = "Timer Controller", // Pufftoss Fight & Fac Beaver Bother Spawn Timer
+ [178] = "Beaver", // Blue
+ [179] = "Shockwave (Mad Jack)",
+ [180] = "Krash", // Minecart Club Guy
+ [181] = "Book", // Castle Library
+ [182] = "Klobber",
+ [183] = "Zinger",
+ [184] = "Snide",
+ [185] = "Army Dillo",
+ [186] = "Kremling", // Kremling Kosh
+ [187] = "Klump",
+ [188] = "Camera",
+ [189] = "Cranky",
+ [190] = "Funky",
+ [191] = "Candy",
+ [192] = "Beetle", // Race
+ [193] = "Mermaid",
+ [194] = "Vulture",
+ [195] = "Squawks",
+ [196] = "Cutscene DK",
+ [197] = "Cutscene Diddy",
+ [198] = "Cutscene Lanky",
+ [199] = "Cutscene Tiny",
+ [200] = "Cutscene Chunky",
+ [201] = "Llama",
+ [202] = "Fairy Picture",
+ [203] = "Padlock (T&S)",
+ [204] = "Mad Jack",
+ [205] = "Klaptrap", // Green
+ [206] = "Zinger",
+ [207] = "Vulture (Race)",
+ [208] = "Klaptrap (Purple)",
+ [209] = "Klaptrap (Red)",
+ [210] = "GETOUT Controller",
+ [211] = "Klaptrap (Skeleton)",
+ [212] = "Beaver (Gold)",
+ [213] = "Fire Column Spawner", // Japes Minecart
+ [214] = "Minecart (TNT)", // Minecart Mayhem
+ [215] = "Minecart (TNT)",
+ [216] = "Pufftoss",
+ ACTOR_UNKNOWN_217,
+ [218] = "Handle",
+ [219] = "Slot",
+ [220] = "Cannon (Seasick Chunky)",
+ [221] = "Light Piece", // Lanky Phase
+ [222] = "Banana Peel", // Lanky Phase
+ [223] = "Fireball Spawner", // Factory Crusher Room
+ [224] = "Mushroom Man",
+ ACTOR_UNKNOWN_225,
+ [226] = "Troff",
+ [227] = "K. Rool's Foot", // Including leftmost toe
+ [228] = "Bad Hit Detection Man",
+ [229] = "K. Rool's Toe", // Rightmost 3 toes
+ [230] = "Ruler",
+ [231] = "Toy Box",
+ [232] = "Text Overlay",
+ [233] = "Squawks",
+ [234] = "Scoff",
+ [235] = "Robo-Kremling",
+ [236] = "Dogadon",
+ ACTOR_UNKNOWN_237,
+ [238] = "Kremling",
+ [239] = "Bongos",
+ [240] = "Spotlight Fish",
+ [241] = "Kasplat (DK)",
+ [242] = "Kasplat (Diddy)",
+ [243] = "Kasplat (Lanky)",
+ [244] = "Kasplat (Tiny)",
+ [245] = "Kasplat (Chunky)",
+ [246] = "Mechanical Fish",
+ [247] = "Seal",
+ [248] = "Banana Fairy",
+ [249] = "Squawks with spotlight",
+ [250] = "Owl",
+ [251] = "Spider miniBoss",
+ [252] = "Rabbit", // Fungi
+ [253] = "Nintendo Logo",
+ [254] = "Cutscene Object", // For objects animated by Cutscenes
+ [255] = "Shockwave",
+ [256] = "Minigame Controller",
+ [257] = "Fire Breath Spawner", // Aztec Beetle Race
+ [258] = "Shockwave", // Boss
+ [259] = "Guard", // Stealthy Snoop
+ [260] = "Text Overlay", // K. Rool boss
+ [261] = "Robo-Zinger",
+ [262] = "Krossbones",
+ [263] = "Fire Shockwave (Dogadon)",
+ [264] = "Squawks",
+ [265] = "Light beam", // Boss bosss etc
+ [266] = "DK Rap Controller", // Handles the lyrics etc
+ [267] = "Shuri",
+ [268] = "Gimpfish",
+ [269] = "Mr. Dice",
+ [270] = "Sir Domino",
+ [271] = "Mr. Dice",
+ [272] = "Rabbit",
+ [273] = "Fireball (With Glasses)", // From Chunky 5DI
+ ACTOR_UNKNOWN_274,
+ [275] = "K. Lumsy",
+ [276] = "Spiderling",
+ [277] = "Squawks",
+ [278] = "Projectile", // Spider miniBoss
+ [279] = "Trap Bubble", // Spider miniBoss
+ [280] = "Spider Silk String", // Spider miniBoss
+ [281] = "K. Rool (DK Phase)",
+ [282] = "Retexturing Controller", // Beaver Bother
+ [283] = "Skeleton Head",
+ ACTOR_UNKNOWN_284,
+ [285] = "Bat",
+ [286] = "Giant Clam",
+ ACTOR_UNKNOWN_287,
+ [288] = "Tomato", // Fungi
+ [289] = "Kritter-in-a-Sheet",
+ [290] = "Pufftup",
+ [291] = "Kosha",
+ [292] = "K. Rool (Diddy Phase)",
+ [293] = "K. Rool (Lanky Phase)",
+ [294] = "K. Rool (Tiny Phase)",
+ [295] = "K. Rool (Chunky Phase)",
+ ACTOR_UNKNOWN_296,
+ [297] = "Battle Crown Controller",
+ ACTOR_UNKNOWN_298,
+ [299] = "Textbox",
+ [300] = "Snake", // Teetering Turtle Trouble
+ [301] = "Turtle", // Teetering Turtle Trouble
+ [302] = "Toy Car", // Player in the Factory Toy Car Race
+ [303] = "Toy Car",
+ [304] = "Camera", // Factory Toy Car Race
+ [305] = "Missile", // Car Race
+ ACTOR_UNKNOWN_306,
+ ACTOR_UNKNOWN_307,
+ [308] = "Seal",
+ [309] = "Kong Logo (Instrument)", // DK for DK, Star for Diddy, DK for Lanky, Flower for Tiny, DK for Chunky
+ [310] = "Spotlight", // Tag barrel, instrument etc.
+ [311] = "Race Checkpoint", // Seal race & Castle car race
+ [312] = "Minecart (TNT)",
+ [313] = "Idle Particle",
+ [314] = "Rareware Logo",
+ ACTOR_UNKNOWN_315,
+ [316] = "Kong (Tag Barrel)",
+ [317] = "Locked Kong (Tag Barrel)",
+ ACTOR_UNKNOWN_318,
+ [319] = "Propeller (Boat)",
+ [320] = "Potion", // Cranky Purchase
+ [321] = "Fairy (Refill)", // Refill Fairy
+ [322] = "Car", // Car Race
+ [323] = "Enemy Car", // Car Race, aka George
+ [324] = "Text Overlay Controller", // Candy's
+ [325] = "Shockwave", // Simian Slam
+ [326] = "Main Menu Controller",
+ [327] = "Kong", // Krazy Kong Klamour
+ [328] = "Klaptrap", // Peril Path Panic
+ [329] = "Fairy", // Peril Path Panic
+ [330] = "Bug", // Big Bug Bash
+ [331] = "Klaptrap", // Searchlight Seek
+ [332] = "Big Bug Bash Controller?", // TODO: Fly swatter?
+ [333] = "Barrel (Main Menu)",
+ [334] = "Padlock (K. Lumsy)",
+ [335] = "Snide's Menu",
+ [336] = "Training Barrel Controller",
+ [337] = "Multiplayer Model (Main Menu)",
+ [338] = "End Sequence Controller",
+ [339] = "Arena Controller", // Rambi/Enguarde
+ [340] = "Bug", // Trash Can
+ ACTOR_UNKNOWN_341,
+ [342] = "Try Again Dialog",
+ [343] = "Pause Menu", // Mystery menu bosses
+ */
+} Actors;
+
+typedef enum sfx_e{
+ SFX_0_SILENCE,
+
+ SFX_40_ARCADE_JUMPMAN_MOVING = 0x40,
+ SFX_41_ARCADE_JUMPMAN_JUMPING,
+ SFX_42_ARCADE_JUMPMAN_HIT,
+ SFX_43_ARCADE_SPRING_SPRINGING,
+ SFX_44_ARCADE_SPRING_FALL,
+ SFX_45_ARCADE_POINTS,
+ SFX_46_ARCADE_INTRO,
+
+ SFX_48_ARCADE_RUNNING_OUT_OF_TIME = 0x48,
+ SFX_49_ARCADE_HAMMER_MUSIC,
+
+ SFX_4B_ARCADE_HAMMER_ATTACK = 0x4b,
+ SFX_4C_ARCADE_PAULINE_SAVED_STAGE,
+ SFX_4D_ARCADE_25M,
+ SFX_4E_ARCADE_100M,
+ SFX_4F_ARCADE_50M,
+
+ SFX_53_ARCADE_DK_GRUNT = 0x53,
+ SFX_54_ARCADE_JUMPMAN_DEATH
+} SFX_E;
+
+// TODO: Maybe we should just define these with preprocessor macros, unless there's a way to make this enum explicitly u8
+typedef enum flagtype_e {
+ FLAG_TYPE_PERMANENT,
+ FLAG_TYPE_GLOBAL,
+ FLAG_TYPE_TEMPORARY
+} FlagTypes;
+
+#endif
diff --git a/include/functions.h b/include/functions.h
new file mode 100644
index 00000000..cf389995
--- /dev/null
+++ b/include/functions.h
@@ -0,0 +1,82 @@
+#ifndef __FUNCTIONS_H__
+#define __FUNCTIONS_H__
+
+#include "enums.h"
+#include "structs.h"
+
+/* your function prototype definitions go here */
+void *malloc(s32 size);
+s32 rand(void);
+void *memcpy(void *dest, void *src, u32 n);
+
+void *getPointerTableFile(s32 pointerTableIndex, s32 fileIndex, s32 arg2, s32 arg3);
+void loadExits(s32 map);
+void setFlag(s16 flagIndex, u8 newValue, u8 flagType); // TODO: Can we use the FlagTypes enum?
+u8 isFlagSet(s16 flagIndex, u8 flagType); // TODO: Can we use the FlagTypes enum?
+ExitData *getExitData(s32 exitIndex);
+
+// TODO: What do the params mean?
+void playCutscene(Actor*, s16, s32);
+void playSong(s32, f32);
+void playSound(s16, s16, f32, f32, s32, s32);
+
+// TODO: arg0 might be actionIndex
+u8 func_806EB0C0(s16 arg0, Actor *actor, u8 playerIndex);
+void func_8067B238(Actor *destination, Actor *source, f32 scale);
+
+void func_80684900(u8);
+void func_80614E78(Actor*, s32);
+void func_80629174(void);
+
+// TODO: Signatures are suspect
+s32 func_80659470(s32); // Returns index into object model2 array
+s32 func_80659544(s32);
+
+s32 func_805FF800(Maps *arg0, s32 *arg1);
+
+u16 func_806F8AD4(u8 arg0, u8 playerIndex);
+
+void func_80614EBC(Actor*, s32);
+
+u8 playerCanDive(void);
+u8 playerCanThrowOrange(void);
+
+u8 func_805FCA64(void); // getCutsceneBarState()
+u8 getLevelIndex(u8 map, u8 arg1);
+void func_805FF378(Maps nextMap, s32 nextExit);
+void func_805FF4D8(Maps map, s32 exit);
+void func_805FF5A0(Maps map);
+void func_805FFEF8(Maps map);
+
+void func_806F5378(void);
+s32 func_80600080(Maps map);
+f32 func_80612790(s16);
+void func_806782C0(Actor *arg0);
+
+u8 func_806E770C(void);
+
+void setIntroStoryPlaying(u8 arg0);
+u8 isIntroStoryPlaying(void);
+
+s32 func_80712798(void);
+int gameIsInDKTVMode(void);
+int gameIsInMysteryMenuMinigameMode(void);
+int gameIsInMainMenuMode(void);
+int gameIsInAdventureMode(void);
+int gameIsInDKTheatreMode(void);
+int gameIsInQuitGameMode(void);
+s32 func_80714CC0(void*, f32, f32, f32, f32);
+
+// countSetFlags(startIndex, length, flagType);
+s32 func_80731AA8(s32 startIndex, s32 length, u8 flagType);
+
+// TODO: Not 100% on return type
+u8 func_80671C0C(Actor*, s32, f32*, f32*, f32*);
+
+// TODO: Why can't this signature live here, causes some problems for arcade when uncommented
+// void func_8060C648(u8 arg0, u32 arg1, u8 arg2, u32 arg3, s32 arg4);
+
+// TODO: Where is the best place to put this so it's available everywhere and doesn't conflict with internal libultra/gu stuff?
+#define ABS(d) ((d) > 0) ? (d) : -(d)
+
+#endif
diff --git a/include/guint.h b/include/guint.h
new file mode 100755
index 00000000..fa97f865
--- /dev/null
+++ b/include/guint.h
@@ -0,0 +1,42 @@
+/**************************************************************************
+ * *
+ * Copyright (C) 1994, Silicon Graphics, Inc. *
+ * *
+ * These coded instructions, statements, and computer programs contain *
+ * unpublished proprietary information of Silicon Graphics, Inc., and *
+ * are protected by Federal copyright law. They may not be disclosed *
+ * to third parties or copied or duplicated in any form, in whole or *
+ * in part, without the prior written consent of Silicon Graphics, Inc. *
+ * *
+ **************************************************************************/
+
+#include
+#include
+
+typedef union
+{
+ struct
+ {
+ unsigned int hi;
+ unsigned int lo;
+ } word;
+
+ double d;
+} du;
+
+typedef union
+{
+ unsigned int i;
+ float f;
+} fu;
+
+#ifndef __GL_GL_H__
+
+typedef float Matrix[4][4];
+
+#endif
+
+#define ROUND(d) (int)(((d) >= 0.0) ? ((d) + 0.5) : ((d) - 0.5))
+#define ABS(d) ((d) > 0) ? (d) : -(d)
+
+extern float __libm_qnan_f;
diff --git a/include/macro.inc b/include/macro.inc
new file mode 100644
index 00000000..e54ad9a8
--- /dev/null
+++ b/include/macro.inc
@@ -0,0 +1,20 @@
+# Assembly Macros
+
+.set K0BASE, 0x80000000
+.set K1BASE, 0xA0000000
+.set K2BASE, 0xC0000000
+
+.macro glabel label
+ .global \label
+ .ent \label
+ .balign 4
+ \label:
+.endm
+
+.macro endlabel label
+ .end \label
+.endm
+
+.macro .word32 x
+ .word \x
+.endm
diff --git a/include/osint.h b/include/osint.h
new file mode 100644
index 00000000..82d78080
--- /dev/null
+++ b/include/osint.h
@@ -0,0 +1,48 @@
+#ifndef _OSINT_H
+#define _OSINT_H
+#include
+typedef struct __OSEventState
+{
+ OSMesgQueue *messageQueue;
+ OSMesg message;
+} __OSEventState;
+extern struct __osThreadTail
+{
+ OSThread *next;
+ OSPri priority;
+} __osThreadTail;
+
+//maybe should be in exceptasm.h?
+extern void __osEnqueueAndYield(OSThread **);
+extern void __osDequeueThread(OSThread **, OSThread *);
+extern void __osEnqueueThread(OSThread **, OSThread *);
+extern OSThread *__osPopThread(OSThread **);
+extern void __osDispatchThread(void);
+
+extern void __osSetTimerIntr(OSTime);
+extern OSTime __osInsertTimer(OSTimer *);
+extern void __osTimerInterrupt(void);
+extern u32 __osProbeTLB(void *);
+extern int __osSpDeviceBusy(void);
+
+extern OSThread *__osRunningThread;
+extern OSThread *__osActiveQueue;
+extern OSThread *__osFaultedThread;
+extern OSThread *__osRunQueue;
+
+extern OSTimer *__osTimerList;
+extern OSTimer __osBaseTimer;
+extern OSTime __osCurrentTime;
+extern u32 __osBaseCounter;
+extern u32 __osViIntrCount;
+extern u32 __osTimerCounter;
+
+extern __OSEventState __osEventStateTab[OS_NUM_EVENTS];
+
+
+//not sure if this should be here
+extern s32 osViClock;
+extern void __osTimerServicesInit(void);
+extern s32 __osAiDeviceBusy(void);
+extern int __osDpDeviceBusy(void);
+#endif
diff --git a/include/piint.h b/include/piint.h
new file mode 100644
index 00000000..b618cd3a
--- /dev/null
+++ b/include/piint.h
@@ -0,0 +1,145 @@
+#ifndef _PIINT_H
+#define _PIINT_H
+#include
+#include
+
+//https://github.com/LuigiBlood/64dd/wiki/Memory-Map
+
+#define LEO_BASE_REG 0x05000000
+
+#define LEO_CMD (LEO_BASE_REG + 0x508)
+#define LEO_STATUS (LEO_BASE_REG + 0x508)
+
+#define LEO_BM_CTL (LEO_BASE_REG + 0x510)
+#define LEO_BM_STATUS (LEO_BASE_REG + 0x510)
+
+#define LEO_SEQ_CTL (LEO_BASE_REG + 0x518)
+#define LEO_SEQ_STATUS (LEO_BASE_REG + 0x518)
+
+#define LEO_C2_BUFF (LEO_BASE_REG + 0x000) //C2 Sector Buffer
+#define LEO_SECTOR_BUFF (LEO_BASE_REG + 0x400) //Data Sector Buffer
+#define LEO_DATA (LEO_BASE_REG + 0x500) //Data
+#define LEO_MISC_REG (LEO_BASE_REG + 0x504) //Misc Register
+#define LEO_CUR_TK (LEO_BASE_REG + 0x50C) //Current Track
+#define LEO_ERR_SECTOR (LEO_BASE_REG + 0x514) //Sector Error Status
+#define LEO_CUR_SECTOR (LEO_BASE_REG + 0x51C) //Current Sector
+#define LEO_HARD_RESET (LEO_BASE_REG + 0x520) //Hard Reset
+#define LEO_C1_S0 (LEO_BASE_REG + 0x524) //C1
+#define LEO_HOST_SECBYTE (LEO_BASE_REG + 0x528) //Sector Size (in bytes)
+#define LEO_C1_S2 (LEO_BASE_REG + 0x52C) //C1
+#define LEO_SEC_BYTE (LEO_BASE_REG + 0x530) //Sectors per Block, Full Size
+#define LEO_C1_S4 (LEO_BASE_REG + 0x534) //C1
+#define LEO_C1_S6 (LEO_BASE_REG + 0x538) //C1
+#define LEO_CUR_ADDR (LEO_BASE_REG + 0x53C) //Current Address?
+#define LEO_ID_REG (LEO_BASE_REG + 0x540) //ID
+#define LEO_TEST_REG (LEO_BASE_REG + 0x544) //Test Read
+#define LEO_TEST_PIN_SEL (LEO_BASE_REG + 0x548) //Test Write
+#define LEO_RAM_ADDR (LEO_BASE_REG + 0x580) //Microsequencer RAM
+
+#define LEO_STATUS_PRESENCE_MASK 0xFFFF
+
+#define LEO_STATUS_DATA_REQUEST 0x40000000
+#define LEO_STATUS_C2_TRANSFER 0x10000000
+#define LEO_STATUS_BUFFER_MANAGER_ERROR 0x08000000
+#define LEO_STATUS_BUFFER_MANAGER_INTERRUPT 0x04000000
+#define LEO_STATUS_MECHANIC_INTERRUPT 0x02000000
+#define LEO_STATUS_DISK_PRESENT 0x01000000
+#define LEO_STATUS_BUSY_STATE 0x00800000
+#define LEO_STATUS_RESET_STATE 0x00400000
+#define LEO_STATUS_MOTOR_NOT_SPINNING 0x00100000
+#define LEO_STATUS_HEAD_RETRACTED 0x00080000
+#define LEO_STATUS_WRITE_PROTECT_ERROR 0x00040000
+#define LEO_STATUS_MECHANIC_ERROR 0x00020000
+#define LEO_STATUS_DISK_CHANGE 0x00010000
+
+#define LEO_STATUS_MODE_MASK (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)
+#define LEO_STATUS_MODE_SLEEP (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED)
+#define LEO_STATUS_MODE_STANDBY (LEO_STATUS_HEAD_RETRACTED)
+#define LEO_STATUS_MODE_ACTIVE 0
+
+#define LEO_CUR_TK_INDEX_LOCK 0x60000000
+
+#define LEO_BM_STATUS_RUNNING 0x80000000 //Running
+#define LEO_BM_STATUS_ERROR 0x04000000 //Error
+#define LEO_BM_STATUS_MICRO 0x02000000 //Micro Status?
+#define LEO_BM_STATUS_BLOCK 0x01000000 //Block Transfer
+#define LEO_BM_STATUS_C1CORRECTION 0x00800000 //C1 Correction
+#define LEO_BM_STATUS_C1DOUBLE 0x00400000 //C1 Double
+#define LEO_BM_STATUS_C1SINGLE 0x00200000 //C1 Single
+#define LEO_BM_STATUS_C1ERROR 0x00010000 //C1 Error
+
+#define LEO_BM_CTL_START 0x80000000 //Start Buffer Manager
+#define LEO_BM_CTL_MODE 0x40000000 //Buffer Manager Mode
+#define LEO_BM_CTL_IMASK 0x20000000 //BM Interrupt Mask
+#define LEO_BM_CTL_RESET 0x10000000 //Buffer Manager Reset
+#define LEO_BM_CTL_DISABLE_OR 0x08000000 //Disable OR Check?
+#define LEO_BM_CTL_DISABLE_C1 0x04000000 //Disable C1 Correction
+#define LEO_BM_CTL_BLOCK 0x02000000 //Block Transfer
+#define LEO_BM_CTL_CLR_MECHANIC_INTR 0x01000000 //Mechanic Interrupt Reset
+
+#define LEO_BM_CTL_CONTROL_MASK 0xFF000000
+#define LEO_BM_CTL_SECTOR_MASK 0x00FF0000
+#define LEO_BM_CTL_SECTOR_SHIFT 16
+
+#define LEO_CMD_TYPE_0 0 //TODO: name
+#define LEO_CMD_TYPE_1 1 //TODO: name
+#define LEO_CMD_TYPE_2 2 //TODO: name
+
+#define LEO_ERROR_GOOD 0
+#define LEO_ERROR_4 4 //maybe busy?
+#define LEO_ERROR_22 22 //
+#define LEO_ERROR_23 23 //unrecovered read error?
+#define LEO_ERROR_24 24 //no reference position found?
+#define LEO_ERROR_29 29 //
+
+extern OSDevMgr __osPiDevMgr;
+extern OSPiHandle *__osCurrentHandle[2];
+extern OSPiHandle CartRomHandle;
+extern OSPiHandle LeoDiskHandle;
+extern OSMesgQueue __osPiAccessQueue;
+extern u32 __osPiAccessQueueEnabled;
+
+int __osPiDeviceBusy(void);
+void __osDevMgrMain(void *);
+void __osPiCreateAccessQueue(void);
+void __osPiRelAccess(void);
+void __osPiGetAccess(void);
+OSMesgQueue *osPiGetCmdQueue(void);
+
+#define OS_RAMROM_STACKSIZE 1024
+
+#define WAIT_ON_IOBUSY(stat) \
+ stat = IO_READ(PI_STATUS_REG); \
+ while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \
+ stat = IO_READ(PI_STATUS_REG);
+
+#define UPDATE_REG(reg, var) \
+ if (cHandle->var != pihandle->var) \
+ IO_WRITE(reg, pihandle->var);
+
+#define EPI_SYNC(pihandle, stat, domain) \
+ \
+ WAIT_ON_IOBUSY(stat) \
+ \
+ domain = pihandle->domain; \
+ if (__osCurrentHandle[domain] != pihandle) \
+ { \
+ OSPiHandle *cHandle = __osCurrentHandle[domain]; \
+ if (domain == PI_DOMAIN1) \
+ { \
+ UPDATE_REG(PI_BSD_DOM1_LAT_REG, latency); \
+ UPDATE_REG(PI_BSD_DOM1_PGS_REG, pageSize); \
+ UPDATE_REG(PI_BSD_DOM1_RLS_REG, relDuration); \
+ UPDATE_REG(PI_BSD_DOM1_PWD_REG, pulse); \
+ } \
+ else \
+ { \
+ UPDATE_REG(PI_BSD_DOM2_LAT_REG, latency); \
+ UPDATE_REG(PI_BSD_DOM2_PGS_REG, pageSize); \
+ UPDATE_REG(PI_BSD_DOM2_RLS_REG, relDuration); \
+ UPDATE_REG(PI_BSD_DOM2_PWD_REG, pulse); \
+ } \
+ __osCurrentHandle[domain] = pihandle; \
+ }
+
+#endif
diff --git a/include/siint.h b/include/siint.h
new file mode 100755
index 00000000..45bf56bf
--- /dev/null
+++ b/include/siint.h
@@ -0,0 +1,10 @@
+#ifndef _SIINT_H
+#define _SIINT_H
+#include
+#include
+
+void __osSiGetAccess(void);
+void __osSiRelAccess(void);
+int __osSiDeviceBusy(void);
+void __osSiCreateAccessQueue(void);
+#endif
diff --git a/include/structs.h b/include/structs.h
new file mode 100644
index 00000000..a6275ea6
--- /dev/null
+++ b/include/structs.h
@@ -0,0 +1,1400 @@
+#ifndef __STRUCTS_H__
+#define __STRUCTS_H__
+
+/* your struct definitions go here */
+
+typedef struct character_progress {
+ u8 moves; // at 0x00
+ u8 simian_slam; // at 0x01
+ u8 weapon; // at 0x02, bitfield, xxxxxshw
+ u8 ammo_belt; // at 0x03, see ScriptHawk's Game.getMaxStandardAmmo() for formula
+ u8 instrument; // at 0x04, bitfield, xxxx321i
+ u8 unk5;
+ u16 coins; // at 0x06
+ u16 instrument_ammo; // at 0x08, also used as lives in multiplayer
+ u16 coloured_bananas[14]; // TODO: Better datatype?
+ u16 coloured_bananas_fed_to_tns[14]; // TODO: Better datatype?
+ u16 golden_bananas[14]; // TODO: Better datatype?
+} CharacterProgress;
+
+typedef struct PlayerProgress {
+ union {
+ CharacterProgress character_progress[6]; // 0x5E * 6 (5 Kongs + Krusha)
+ u8 character_progress_as_bytes[6][0x5E]; // Note: Can't use sizeof(CharacterProgress) because mips_to_c can't do struct maths yet
+ u16 character_progress_as_shorts[6][0x2F]; // Note: Can't use sizeof(CharacterProgress) because mips_to_c can't do struct maths yet
+ };
+ u8 unk234[0x2F0 - 0x234];
+ u16 standardAmmo; // 0x2F0
+ u16 homingAmmo; // 0x2F2
+ u16 oranges; // 0x2F4
+ u16 crystals; // 0x2F6 // Note: Multiplied by 150 compared to on screen counter
+ u16 film; // 0x2F8
+ u8 unk2FA;
+ s8 health; // 0x2FB
+ u8 melons; // 0x2FC
+ s8 unk2FD; // Something to do with health... hmm
+ s8 unk2FE[0x306 - 0x2FE];
+} PlayerProgress;
+
+typedef struct enemy_info {
+ u8 enemy_type; // at 0x00
+ u8 unk1;
+ u16 y_rotation; // at 0x02
+ s16 x_position; // at 0x04
+ s16 y_position; // at 0x06
+ s16 z_position; // at 0x08
+ u8 cutscene_model_index; // at 0x0A
+ u8 unkB;
+ u32 unkC;
+ u32 unk10;
+ u32 unk14;
+ u32 unk18;
+ u32 unk1C;
+ u32 unk20;
+ u16 unk24;
+ u16 unk26;
+ u16 unk28; // Used
+ s16 unk2A; // Used
+ u32 unk2C;
+ u32 unk30;
+ u32 unk34;
+ f32 unk38; // Used
+ f32 unk3C; // at 0x3C
+ s16 unk40; // Used
+ s16 unk42;
+ u8 unk44; // Used
+ u8 unk45;
+ u16 unk46; // Used
+} EnemyInfo;
+
+typedef struct ledge_info_8c LedgeInfo8C;
+
+struct ledge_info_8c {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ f32 unkC; // Used
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20;
+ s32 unk24;
+ LedgeInfo8C *next;
+};
+
+typedef struct ledge_info_90 LedgeInfo90;
+
+struct ledge_info_90 {
+ f32 unk0;
+ f32 unk4;
+ f32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ LedgeInfo90 *next;
+};
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20;
+ s32 unk24;
+ s32 unk28;
+ s32 unk2C;
+ s32 unk30;
+ s32 unk34;
+ s32 unk38;
+ s32 unk3C;
+ s32 unk40;
+ s32 unk44;
+ s32 unk48;
+ s32 unk4C;
+ s32 unk50;
+ s16 unk54;
+ s8 unk56;
+ s8 unk57;
+} LedgeInfo98;
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20;
+ s32 unk24;
+ s16 unk28;
+ s8 unk2A; // Used
+ s8 unk2B;
+} LedgeInfoA0;
+
+typedef struct ledge_info {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ f32 unk14;
+ f32 unk18;
+ f32 unk1C;
+ f32 unk20;
+ u8 unk24;
+ u8 unk25;
+ u8 unk26;
+ u8 unk27;
+ u32 unk28;
+ u32 unk2C;
+ u32 unk30;
+ u32 unk34;
+ u32 unk38;
+ u32 unk3C;
+ u32 unk40;
+ u32 unk44;
+ u16 unk48;
+ u16 unk4A;
+ u32 unk4C;
+ u32 unk50;
+ u32 unk54;
+ u32 unk58;
+ u32 unk5C;
+ u32 unk60;
+ u32 unk64;
+ u32 unk68;
+ u8 unk6C;
+ u8 unk6D;
+ u8 unk6E;
+ u8 unk6F;
+ u32 unk70;
+ u32 unk74;
+ u32 unk78;
+ s32 unk7C;
+ s32 unk80; // object_timer gets written here
+ s32 unk84;
+ s32 unk88; // object_timer gets written here
+ LedgeInfo8C *unk8C; // Linked List
+ LedgeInfo90 *unk90;
+ s32 unk94;
+ LedgeInfo98 *unk98; // Array
+ s32 unk9C;
+ LedgeInfoA0 *unkA0; // Array
+ s32 unkA4;
+ s32 unkA8;
+ u8 unkAC;
+} LedgeInfo;
+
+// TODO: What is this actually?
+typedef struct animation_state_unk0 {
+ s32 unk0;
+ f32 unk4; // Used
+ s32 unk8;
+ s32 unkC;
+ s16 unk10; // Used
+ s16 unk12;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20;
+ f32 unk24; // Used
+} AnimationStateUnk0;
+
+// See boss func_8002FB7C
+typedef struct animation_state_unk20 {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ f32 unk4;
+ f32 unk8;
+ f32 unkC;
+} AnimationStateUnk20;
+
+typedef struct actor_animation_state {
+ AnimationStateUnk0 *unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s16 unk10;
+ s16 unk12;
+ void *bone_array_1; // at 0x14, camera, update bone positions // TODO: Proper type
+ void *bone_array_2; // at 0x18, camera, update bone positions // TODO: Proper type
+ void *unk1C; // TODO: Used in func_80724CA4 and func_8068FF40, pretty easy match, array of 0x8 structs? // malloc(0x100) in func_80683158
+ AnimationStateUnk20 *unk20; // See boss func_8002FB7C
+ void *unk24;
+ s32 unk28;
+ s32 unk2C;
+ s32 unk30;
+ f32 scale_x; // at 0x34
+ f32 scale_y; // at 0x38
+ f32 scale_z; // at 0x3C
+ s32 unk40;
+ s32 unk44;
+ f32 unk48;
+ s32 unk4C;
+ s32 unk50;
+ s32 unk54;
+ s32 unk58;
+ s32 unk5C;
+ s32 unk60;
+ u16 unk64; // Used
+ u16 unk66;
+ s32 unk68;
+ s32 unk6C;
+ s32 unk70;
+ s32 unk74;
+ s32 unk78;
+ s32 unk7C;
+ s32 unk80;
+ s32 unk84;
+ s32 unk88;
+ s32 unk8C;
+ s32 unk90;
+ f32 animation_timer_1; // at 0x94
+ f32 animation_timer_2; // at 0x98
+ s32 unk9C;
+ s32 unk100;
+ f32 animation_timer_3; // at 0x104
+ f32 animation_timer_4; // at 0x108
+} ActorAnimationState;
+
+typedef struct actor_178 {
+ s16 unk0; // Used
+ s16 unk2;
+ u8 unk4;
+ u8 unk5;
+ u8 unk6;
+ u8 unk7;
+ u8 unk8;
+ u8 unk9;
+ u8 unkA;
+ u8 unkB;
+ u8 unkC;
+ u8 unkD;
+ u8 unkE;
+ u8 unkF[0x5];
+ u8 unk14;
+} Actor178;
+
+typedef struct boss_actor_178 {
+ s32 unk0; // Used
+} BossActor178;
+
+typedef struct race_actor_178 {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ f32 unk14;
+} RaceActor178;
+
+typedef struct actor_17C {
+ s32 unk0;
+ u8 unk4;
+ u8 unk5;
+ s16 unk6;
+ s16 unk8;
+} Actor17C;
+
+typedef struct actor_collision ActorCollision;
+typedef struct actor Actor;
+
+// TODO: What type is this actually?
+// D_807FBB70
+typedef struct {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ f32 unk4;
+ f32 unk8;
+ f32 unkC;
+ u8 pad10[0x14 - 0x10];
+ u8 unk14;
+ u8 unk15;
+ u8 unk16;
+ u8 unk17;
+ u8 unk18;
+ u8 unk19;
+ u8 unk1A;
+ u8 unk1B;
+ u8 unk1C;
+ u8 pad1D[0x24 - 0x1D];
+ u8 unk24;
+ u8 unk25;
+ u8 pad26[0x2C - 0x26];
+ u8 unk2C;
+ u8 pad2D[0x38 - 0x2D];
+ u8 unk38;
+ u8 unk39;
+ u8 pad3A[0x90 - 0x3A]; // TODO: Actor* at 0x7C? see func_8069A750
+ u8 unk90;
+ u8 unk91;
+ u8 pad92[0xD8 - 0x92];
+ f32 unkD8;
+ f32 unkDC; // TODO: Confirm datatype
+ f32 unkE0;
+ u8 unkE4;
+ u8 unkE5;
+ u8 unkE6;
+ u8 unkE7;
+ f32 unkE8;
+ s32 unkEC;
+ f32 unkF0;
+ f32 unkF4;
+ u8 padF8[0x1F8 - 0xF8];
+ s32 unk1F8;
+ Actor *unk1FC;
+ u8 unk200;
+ u8 unk201;
+ s16 unk202;
+ Actor *unk204;
+ u8 pad208[0x244 - 0x208];
+ s8 unk244;
+ s8 unk245;
+ s8 unk246;
+ s8 unk247;
+ u8 pad248[0x254 - 0x248];
+ u8 unk254; // Used
+ u8 unk255;
+ u8 unk256;
+ u8 unk257;
+ s32 unk258; // Used
+ s32 unk25C;
+ s32 unk260;
+ s32 unk264;
+ s32 unk268;
+ s32 unk26C;
+ s32 unk270;
+ s32 unk274;
+ s32 unk278;
+} GlobalASMStruct35;
+
+struct actor_collision {
+ u32 unk0; // Collision type?
+ u32 unk4;
+ Actor *collisionSource;
+ u32 unkC;
+ u32 unk10;
+ ActorCollision* next;
+ ActorCollision* prev;
+};
+
+typedef struct other_additional_actor_data {
+ s32 unk0;
+ s32 unk4;
+ s16 unk8;
+ s16 unkA;
+ f32 unkC;
+ f32 unk10;
+ f32 unk14;
+ s16 unk18;
+ s16 unk1A;
+ s32 unk1C;
+} OtherAdditionalActorData;
+
+typedef struct another_additional_actor_data {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s16 unk10;
+ u8 unk12;
+ u8 unk13; // Used in func_806925AC
+} AnotherAdditionalActorData;
+
+typedef struct race_additional_actor_data {
+ s16 unk0;
+ s16 unk2; // used
+ f32 unk4;
+ s16 unk8;
+ s16 unkA;
+ f32 unkC;
+ f32 unk10;
+ f32 unk14;
+ s16 unk18;
+ s16 unk1A;
+ u16 unk1C;
+ s8 unk1E;
+ s8 unk1F;
+ s32 unk20;
+ u8 unk24;
+ u8 unk25;
+ s8 unk26;
+ s8 unk27;
+ s8 unk28;
+ s8 unk29; // Used
+ s16 unk2A;
+ s32 unk2C;
+ s32 unk30;
+ u8 unk34;
+ u8 unk35;
+ u8 unk36;
+ u8 unk37;
+ s32 unk38;
+ u8 unk3C;
+ u8 unk3D;
+ u8 unk3E;
+ u8 unk3F;
+ s16 unk40;
+ u8 unk42; // Used
+ u8 unk43;
+ u8 unk44;
+ u8 unk45; // Used
+} RaceAdditionalActorData;
+
+typedef struct race_additional_actor_data2 {
+ u8 unk0; // Used
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 pad2[0x24 - 0x4];
+ u8 unk24;
+ u8 pad25[0x36 - 0x25];
+ u8 unk36; // Used
+} RaceAdditionalActorData2;
+
+typedef struct yaad5 {
+ f32 unk0; // Used
+ f32 unk4; // Used
+ u32 unk8;
+ u32 unkC;
+ Actor* unk10; // Used
+ s16 unk14; // Used
+ s16 unk16; // Used
+ u16 unk18;
+ s16 unk1A; // Used
+ s16 unk1C; // Used
+ s8 unk1E; // Used
+} YetAnotherAdditionalActorData5;
+
+
+typedef struct yet_another_additional_actor_data {
+ Actor *unk0;
+ u16 unk4;
+ u16 unk6;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s16 unk20;
+ s16 unk22;
+ f32 unk24;
+ s16 unk28;
+ s16 unk2A;
+ s32 unk2C;
+ s32 unk30;
+ s32 unk34;
+ s16 unk38;
+ s16 unk3A;
+ s32 unk3C;
+} YetAnotherAdditionalActorData;
+
+typedef struct yaad4 {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s16 unk10; // Used
+ s16 unk12; // Used
+ s16 unk14; // Used
+} YetAnotherAdditionalActorData4;
+
+typedef struct menu_additional_actor_data {
+ //u8 pad0[0x17];
+ f32 unk0;
+ f32 unk4;
+ f32 unk8;
+ s32 unkC;
+ s16 unk10;
+ s8 unk12;
+ s8 unk13;
+ s16 unk14;
+ s8 unk16;
+ s8 unk17;
+} MenuAdditionalActorData;
+
+typedef struct player_additional_actor_data {
+ s32 unk0; // TODO: May be s16 (see func_806CF580), but changing that causes some matching functions to break
+ f32 unk4;
+ s16 unk8; // Used
+ s16 unkA; // Used, Actor->y_rotation copied here
+ s16 unkC; // Used
+ s16 unkE; // Used
+ s16 unk10; // Used
+ s16 unk12; // Used
+ s16 unk14; // Used
+ s8 unk16;
+ s8 unk17; // Used, set to current file selection?
+ u16 unk18; // Used
+ u16 unk1A;
+ f32 unk1C; // Used
+ f32 unk20; // Used
+ s16 unk24; // Used
+ s16 unk26;
+ s16 unk28; // Used
+ s16 unk2A;
+ f32 unk2C; // Used
+ f32 unk30; // Used
+ f32 unk34; // Used
+ f32 unk38; // Used
+ s16 unk3C;
+ s16 unk3E; // Used
+ s16 unk40;
+ u8 unk42; // Used, related to distance from floor
+ u8 unk43;
+ u8 unk44;
+ u8 unk45; // Used, VehicleAdditionalActorData
+ u8 unk46;
+ u8 unk47;
+ s16 unk48; // Used
+ s16 unk4A;
+ s16 unk4C; // Used
+ s16 unk4E;
+ s16 unk50; // Used
+ s16 unk52;
+ f32 unk54;
+ s32 unk58; // Used, related to D_80767CC0
+ s32 unk5C;
+ s32 unk60;
+ s16 unk64; // Used
+ s16 unk66;
+ f32 unk68;
+ f32 unk6C; // Used
+ s16 unk70; // Used, y rotation?
+ s16 unk72;
+ s32 unk74;
+ s32 unk78;
+ s32 unk7C;
+ s32 unk80;
+ s32 unk84;
+ Actor* vehicle_actor_pointer; // Used
+ u8 unk8C; // Used
+ u8 unk8D; // Used
+ s16 unk8E;
+ s32 unk90;
+ f32 unk94; // Used
+ f32 unk98;
+ f32 unk9C; // Used
+ f32 unkA0; // Used
+ f32 unkA4; // Used
+ f32 unkA8; // Used
+ s32 unkAC; // Used // TODO: Float? Datatype conflicts in CEAEO.c
+ s16 unkB0;
+ s16 unkB2; // Used
+ s32 unkB4;
+ f32 unkB8; // Used
+ s16 unkBC; // Used
+ s16 unkBE;
+ s16 unkC0;
+ s16 unkC2; // Used
+ s32 unkC4;
+ s16 unkC8;
+ u8 unkCA; // Used
+ s8 unkCB;
+ s32 unkCC;
+ s32 unkD0;
+ s16 unkD4; // Used
+ s16 unkD6;
+ s32 unkD8;
+ Actor *unkDC; // Used
+ s32 unkE0;
+ s32 unkE4;
+ s32 unkE8;
+ u8 unkEC;
+ u8 unkED;
+ u8 unkEE;
+ u8 unkEF; // Used
+ u8 unkF0; // TODO: Might be float, see func_806ECAC4
+ u8 unkF1; // Used
+ u8 unkF2;
+ u8 unkF3; // Used
+ u8 unkF4;
+ u8 unkF5;
+ u8 unkF6; // Used
+ u8 unkF7;
+ s32 unkF8;
+ u8 unkFC; // Used
+ u8 unkFD;
+ u8 unkFE;
+ u8 unkFF;
+ s32 unk100;
+ Actor *unk104; // Used, Actor*?
+ f32 unk108; // Used
+ s8 unk10C; // Used
+ u8 unk10D;
+ u8 unk10E;
+ u8 unk10F;
+ s32 unk110;
+ s32 unk114;
+ s32 unk118;
+ u8 unk11C; // Used, VehicleAdditionalActorData?
+ u8 unk11D;
+ u8 unk11E;
+ u8 unk11F;
+ s32 unk120;
+ f32 unk124; // Used
+ s32 unk128;
+ s32 unk12C;
+ s32 unk130;
+ s32 unk134;
+ s32 unk138;
+ s32 unk13C;
+ s32 unk140;
+ s32 unk144;
+ s32 unk148;
+ s32 unk14C;
+ s32 unk150;
+ s32 unk154;
+ s32 unk158;
+ s32 unk15C;
+ s32 unk160;
+ s32 unk164;
+ s32 unk168;
+ s32 unk16C;
+ s32 unk170;
+ s32 unk174;
+ s32 unk178;
+ s32 unk17C;
+ s32 unk180;
+ s32 unk184;
+ s32 unk188;
+ s32 unk18C;
+ s32 unk190;
+ s32 unk194;
+ s32 unk198;
+ s16 unk19C; // Used
+ s16 unk19E; // Used
+ u16 unk1A0; // Used
+ u8 unk1A2;
+ u8 unk1A3; // Used
+ u8 unk1A4; // Used, playerIndex?
+ u8 unk1A5;
+ u8 unk1A6;
+ u8 unk1A7;
+ Actor *unk1A8;
+ Actor *unk1AC; // TODO: Is this correct?
+ s32 unk1B0;
+ s32 unk1B4;
+ s32 unk1B8;
+ f32 unk1BC; // Used
+ f32 unk1C0; // Used
+ f32 unk1C4; // Used
+ f32 unk1C8; // Used
+ f32 unk1CC; // Used
+ f32 unk1D0; // Used, y scale
+ f32 unk1D4; // Used, z scale
+ f32 unk1D8; // Used
+ f32 unk1DC; // Used
+ f32 unk1E0; // Used
+ s32 unk1E4;
+ s32 unk1E8;
+ s16 unk1EC;
+ s16 unk1EE; // Used
+ s32 unk1F0; // Used, bitfield // TODO: Proper bitfield syntax
+ s32 unk1F4;
+ s32 unk1F8;
+ u8 unk1FC; // Used
+ u8 unk1FD;
+ u16 unk1FE; // Used
+ s16 unk200; // Used
+ s16 unk202;
+ s32 unk204;
+ s32 unk208;
+ s32 unk20C;
+ s32 unk210;
+ s32 unk214;
+ s32 unk218;
+ s16 unk21C;
+ u16 unk21E; // Used
+ f32 unk220; // Used, x
+ f32 unk224; // Used, y
+ f32 unk228; // Used, z
+ f32 unk22C; // Used, x
+ f32 unk230; // Used, y
+ f32 unk234; // Used, z
+ f32 unk238; // Used
+ u16 unk23C; // Used
+ u8 unk23E;
+ u8 unk23F; // Used
+ s16 unk240;
+ u16 unk242; // Used
+ s16 unk244;
+ s8 unk246; // Used func_806CA26C
+ s8 unk247; // Used func_806CA26C
+ s8 unk248;
+ s8 unk249;
+ s8 unk24A;
+ s8 unk24B; // Used
+ u16 unk24C; // Used // TODO: s16? func_806CA1B4 uses this as u16
+ u16 unk24E; // Used // TODO: s16? func_806CA1B4 uses this as u16
+ s32 unk250;
+} PlayerAdditionalActorData;
+
+//f32 at unk8 doesn't match with what's in structs.h (s16)
+//for PlayerAdditionalActorData so making this struct
+typedef struct {
+ u8 pad0[0x8];
+ f32 unk8;
+} PaaD0;
+
+// Bonus func_800253E4
+typedef struct {
+ Actor* unk0;
+} BaaD2;
+
+typedef struct TempAAD {
+ s8 unk0;
+ u8 pad0[0x14 - 0x1];
+ s16 unk14;
+ s16 unk16;
+ s16 unk18;
+ s16 unk1A;
+ u8 pad1[0x24 - 0x1C];
+ s8 unk24;
+} TempAAD;
+
+// TODO: This appears to be a "texture renderer" according to ScriptHawk, needs a better name though. Linked list at Actor->unk158
+typedef struct global_asm_struct_60 GlobalASMStruct60;
+
+struct global_asm_struct_60 {
+ s32 *unk0; // Used
+ GlobalASMStruct60 *unk4; // Used? Might be wrong datatype, see func_80688638
+ s16 unk8;
+ s16 unkA; // Used
+ s16 unkC; // Used - Texture index?
+ s16 unkE;
+ f32 unk10; // Used
+ f32 unk14; // Used
+ s16 unk18; // Used
+ s16 unk1A; // Used
+ s16 unk1C; // Used
+ s16 unk1E; // Used
+ s8 unk20; // Used
+ s8 unk21; // Used
+ u8 unk22; // Used
+ u8 unk23;
+ GlobalASMStruct60 *next; // at 0x24
+};
+
+struct actor {
+ u32 *unk0; // Small header on top of DisplayList Pointer // TODO: Proper type
+ ActorAnimationState *animation_state;
+ u32 *unk8; // Current bone array Pointer // TODO: Proper type
+ s16 unkC;
+ s16 unkE;
+ u32 unk10;
+ u32 unk14;
+ u32 unk18;
+ u32 unk1C;
+ u32 unk20;
+ u32 unk24;
+ u32 unk28;
+ f32 unk2C;
+ u32 unk30;
+ u32 unk34;
+ u32 unk38;
+ u32 unk3C;
+ u32 unk40;
+ u32 unk44;
+ u32 unk48;
+ u32 unk4C;
+ u32 unk50;
+ u32 unk54;
+ u32 unk58;
+ u16 interactable; // Bitfield at 0x5C
+ u16 unk5E;
+ u32 object_properties_bitfield; // at 0x60
+ s32 unk64; // Another bitfield
+ u16 unk68;
+ u16 unk6A; // is_grounded?
+ u16 unk6C;
+ s16 unk6E;
+ u16 unk70;
+ u16 unk72;
+ u32 unk74;
+ u8 unk78;
+ u8 unk79;
+ u8 unk7A;
+ u8 unk7B;
+ f32 x_position; // at 0x7C
+ f32 y_position; // at 0x80
+ f32 z_position; // at 0x84
+ f32 unk88;
+ f32 unk8C;
+ f32 unk90;
+ f32 unk94;
+ f32 unk98;
+ f32 unk9C;
+ f32 unkA0;
+ f32 floor; // at 0xA4
+ f32 unkA8; // Used
+ f32 unkAC;
+ u32 unkB0;
+ f32 distance_from_floor; // at 0xB4
+ f32 unkB8; // at 0xB8 // velocity?
+ f32 unkBC; // at 0xBC
+ f32 y_velocity; // at 0xC0
+ f32 y_acceleration; // at 0xC4
+ f32 terminal_velocity; // at 0xC8
+ u8 unkCC; // Used
+ u8 unkCD;
+ u8 unkCE;
+ u8 unkCF;
+ u8 unkD0;
+ u8 unkD1; // Used
+ u8 unkD2;
+ u8 unkD3;
+ u32 unkD4;
+ s16 unkD8; // Used
+ s16 unkDA; // Used
+ s16 unkDC; // Used
+ s16 unkDE;
+ f32 unkE0;
+ s16 x_rotation; // at 0xE4
+ s16 y_rotation; // at 0xE6
+ s16 z_rotation; // at 0xE8
+ s16 unkEA;
+ s16 unkEC; // Something to do with shadow opacity
+ s16 unkEE; // TODO: Interacts with rotation, maybe a copy of it?
+ u16 unkF0;
+ s16 unkF2;
+ s16 unkF4;
+ s16 unkF6;
+ s16 unkF8;
+ u16 unkFA;
+ u8 unkFC;
+ u8 unkFD;
+ u8 unkFE;
+ u8 unkFF;
+ f32 unk100; // Used
+ f32 unk104; // Used
+ f32 unk108; // Used
+ s16 unk10C;
+ u8 unk10E; // Used
+ u8 unk10F;
+ u8 locked_to_pad; // at 0x110
+ u8 unk111;
+ u8 unk112;
+ u8 unk113;
+ u32 unk114;
+ u32 unk118;
+ Actor *unk11C;
+ f32 unk120;
+ u32 unk124;
+ s16 shadow_opacity; // at 0x128, max value 0xFF
+ s16 draw_distance; // at 0x12A
+ s16 unk12C; // Used
+ s16 unk12E;
+ u8 unk130; // Used
+ u8 unk131; // Used
+ s16 unk132; // Used
+ s16 health;
+ s16 unk136;
+ u32 unk138;
+ ActorCollision *collision_queue_pointer; // at 0x13C
+ LedgeInfo *ledge_info_pointer; // at 0x140
+ u8 noclip_byte; // at 0x144
+ u8 unk145;
+ u16 unk146; // used (0x147 hand state? 0x146 seems to be u16)
+ u32 unk148; // Used
+ u32 unk14C; // Used
+ void *unk150; // TODO: Floor Triangle Pointer
+ u8 control_state; // at 0x154
+ u8 control_state_progress; // at 0x155
+ u8 unk156;
+ u8 unk157;
+ GlobalASMStruct60 *unk158; // Texture renderer linked list
+ u8 unk15C;
+ u8 unk15D;
+ u8 unk15E;
+ u8 unk15F; // Used, set to 0x01, 0x06, 0x0B in some cases
+ f64 unk160; // TODO: Probably not correct
+ s16 unk168; // Used
+ u8 unk16A;
+ u8 unk16B;
+ u8 unk16C;
+ u8 unk16D;
+ u8 unk16E;
+ u8 unk16F;
+ u8 unk170;
+ u8 unk171;
+ u8 unk172;
+ u8 unk173;
+ union {
+ void *additional_actor_data; // For when you don't know which one it's using
+ OtherAdditionalActorData *OaaD;
+ AnotherAdditionalActorData *AaaD;
+ RaceAdditionalActorData *RaaD;
+ RaceAdditionalActorData2 *RaaD2;
+ YetAnotherAdditionalActorData *YaaD;
+ YetAnotherAdditionalActorData4 *YaaD4;
+ YetAnotherAdditionalActorData5 *YaaD5;
+ MenuAdditionalActorData *MaaD;
+ PlayerAdditionalActorData *PaaD;
+ PaaD0 *PaaD0; // TODO: Figure this out
+ BaaD2 *BaaD2; // TODO: Figure this out
+ TempAAD *TaaD; // TODO: Figure this out (race overlay)
+ void *additional_data_pointer; //legacy
+ };
+ union {
+ Actor178 *unk178;
+ RaceActor178 *race178;
+ BossActor178 *boss178;
+ };
+ union {
+ Actor17C *unk17C;
+ };
+};
+
+typedef struct {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3; // Used
+} CharacterChange294;
+
+typedef struct {
+ u8 does_player_exist; // bitfield? 0x00
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ Actor* player_pointer; // 0x04
+ u8 pad_unknown[0x208];
+ f32 look_at_eye_x; // 0x210 maybe an array?
+ f32 look_at_eye_y; // 0x214
+ f32 look_at_eye_z; // 0x218
+ f32 unk21C; // Used
+ f32 unk220; // Used
+ f32 unk224; // Used
+ f32 look_at_at_x; // 0x228 maybe an array?
+ f32 look_at_at_y; // 0x22C
+ f32 look_at_at_z; // 0x230
+ f32 unk234; // Used
+ f32 unk238; // Used
+ f32 unk23C; // Used
+ f32 look_at_up_x; // 0x240 maybe an array?
+ f32 look_at_up_y; // 0x244
+ f32 look_at_up_z; // 0x248;
+ s32 unk24C;
+ u8 pad_unknown2[0x270 - 0x250];
+ s16 unk270; // Used, related to map chunk "deload" value
+ s16 unk272; // Used, related to map chunk "deload" value
+ s16 unk274; // Used, related to map chunk "deload" value
+ s16 unk276; // Used, related to map chunk "deload" value
+ s16 unk278;
+ s16 unk27A;
+ f32 fov_y; // 0x27C
+ f32 unk280;
+ f32 near; // 0x284
+ f32 far; // 0x288
+ s32 unk28C;
+ u16 chunk; // 0x290
+ s16 unk292;
+ CharacterChange294 *unk294; // Used
+ s32 new_controller_inputs; // bitfield 0x298
+ s16 action_initiated; // 0x29C
+ s16 unk29E;
+ Actor* unk2A0;
+ s32 unk2A4;
+ s32 unk2A8; // Used
+ s32 unk2AC;
+ s32 unk2B0; // Used
+ u8 pad_unknown3[0x2C0 - 0x2B4];
+ u8 unk2C0; // Used
+ u8 unk2C1; // Used
+ u8 unk2C2; // Used
+ u8 unk2C3; // Used
+ s32 unk2C4;
+ s16 unk2C8; // Used
+ s16 unk2CA;
+ u8 pad_unknown4[0x2E2 - 0x2CC];
+ u16 unk2E2;
+ u8 unk2E4;
+ u8 unk2E5;
+ u8 unk2E6;
+ u8 unk2E7;
+ u8 unk2E8;
+ u8 unk2E9;
+ u8 unk2EA;
+ u8 unk2EB;
+ u8 unk2EC;
+ u8 unk2ED;
+ u8 unk2EE;
+ u8 unk2EF;
+} CharacterChange;
+
+typedef struct chunk_14 Chunk14;
+
+struct chunk_14 {
+ s32 unk0;
+ f32 unk4;
+ f32 unk8;
+ f32 unkC;
+ f32 unk10;
+ Chunk14 *next;
+ Chunk14 *next2;
+ s16 unk1C;
+ s16 unk1E;
+ s16 unk20;
+ u8 unk22; // Used
+ u8 unk23; // Used
+ u8 unk24; // Used
+};
+
+typedef struct {
+ s16 unk0;
+ s16 unk2;
+ s16 unk4;
+ s16 unk6;
+ s32 unk8;
+ s16 unkC;
+ s16 unkE;
+ s16 unk10;
+ u8 unk12;
+ u8 unk13;
+} Chunk78_7C;
+
+typedef struct {
+ u8 loaded;
+ u8 unk1; // used
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+ u8 visible; // 0x5 -- if 0x02 visible, else invisible
+ u8 unk6;
+ u8 unk7;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ Chunk14 *unk14;
+ s32 unk18;
+ Chunk14 *unk1C; // TODO: Same struct as unk14?
+ s32 unk20;
+ s32 unk24;
+ u8 pad8[0x68 - 0x28];
+ s32 deload1; // 0x68
+ s32 deload2; // 0x6C
+ s32 deload3; // 0x70
+ s32 deload4; // 0x74
+ Chunk78_7C *unk78; // First in array?
+ Chunk78_7C *unk7C; // Last in array?
+ s16 unk80; // Used
+ s16 unk82; // Used
+ s16 unk84; // Used
+ s16 unk86; // Used
+ u8 pad2[0x1C8 - 0x88]; // total size 0x1C8
+} Chunk;
+
+// func_80712944, func_8060AC34
+typedef struct global_asm_struct_12 {
+ u16 unk0;
+ s8 unk2;
+ s8 unk3;
+ s16 unk4;
+ u16 unk6;
+ s8 unk8;
+ s8 unk9;
+ u16 unkA;
+ u16 unkC;
+ s8 unkE;
+ s8 unkF;
+ u16 unk10;
+ u16 unk12;
+ s8 unk14;
+ s8 unk15;
+} GlobalASMStruct12;
+
+typedef struct {
+ u8 pad0[0x6 - 0x0];
+ s16 unk6;
+ u8 unk8;
+ u8 unk9;
+ u8 unkA; // Used // TODO: Type conflict with u16? s16?
+ u8 unkB;
+ u8 unkC; // Used
+ u8 unkD;
+ u8 unkE;
+ u8 unkF;
+ u8 unk10; // Used
+ u8 unk11;
+ u8 unk12;
+ u8 unk13; // Used
+} CharacterSpawner;
+
+typedef struct global_asm_struct_17 {
+ u16 unk0;
+ s8 unk2;
+ s8 unk3;
+} GlobalASMStruct17;
+
+typedef struct JetpacStruct {
+ f32 unk0;
+ f32 unk4;
+ f32 unk8;
+ f32 unkC;
+ u8 unk10;
+ u8 unk11;
+ u8 unk12;
+ u8 unk13;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20;
+ s32 unk24;
+ s32 unk28;
+ s32 unk2C;
+ s32 unk30;
+ s32 unk34;
+ s32 unk38;
+ u8 pad1[0x44 - 0x3C];
+ s32 unk44;
+ void (*unk48)();
+ s32 *unk4C;
+} JetpacStruct;
+
+typedef struct JetpacItem {
+ u8 unk0;
+} JetpacItem;
+
+typedef struct Competitor {
+ s32 level;
+ s32 current_score;
+ s32 lives;
+ s32 lives_consumed;
+ s32 unk10; //used
+ u8 pad0[0x114 - 0x14];
+ s32 unk114; //used
+ u8 pad2[0x144 - 0x118];
+ s32 unk_144;
+ JetpacItem next_item_pointer;
+ u8 unk14C[4];
+ float unk150;
+ u8 pad1[0x18C - 0x154];
+ void (*fun_ptr)(JetpacItem*);
+ void (*fun_ptr2)(JetpacItem*,u8);
+ //u8 unk_190[4];
+} Competitor;
+
+typedef struct JetpacPlayerStruct {
+ s32 unk0;
+ u8 header[0x1C - 0x4];
+ Competitor player[2];
+ s32 player_index;
+} JetpacPlayerStruct;
+
+typedef struct ActorSpawner ActorSpawner;
+
+struct ActorSpawner {
+ u16 actor_type; // At 0x0
+ u16 unk2;
+ f32 x_position; // At 0x4
+ f32 y_position; // At 0x8
+ f32 z_position; // At 0xC
+ f32 unk10;
+ f32 unk14;
+ f32 unk18;
+ s16 y_rotation; // At 0x1C
+ u16 unk1E;
+ u16 unk20;
+ u8 pad22[0x32 - 0x22];
+ s16 unk32;
+ u8 pad34[0x44 - 0x34];
+ Actor* tied_actor; // At 0x44
+ u8 unk48; // Used
+ u8 unk49;
+ s16 unk4A;
+ u8 unk4C; // Used
+ u8 unk4D;
+ s32 unk50; // TODO: Actor*?
+ f32 unk54;
+ s16 unk58;
+ s16 id; // At 0x5A
+ s32 (*unk5C)(s32); // At 0x5C
+ s32 (*drawing_code)(s32); // At 0x60
+ ActorSpawner* previous_spawner; // At 0x64
+ ActorSpawner* next_spawner; // At 0x68
+ u8 pad6C[0x80 - 0x6C];
+};
+
+// TODO: Use that clever tuple thing from BKomp
+typedef struct {
+ s16 coords_0[3]; // 0x0
+ s16 coords_1[3]; // 0x6
+ s16 coords_2[3]; // 0xC
+ s16 coords_3[3]; // 0x12
+ s16 coords_4[3]; // 0x18
+} EnemyAggressionBox;
+
+typedef struct {
+ s16 x_pos_0; // 0x0
+ s16 z_pos_0; // 0x2
+ s16 x_pos_1; // 0x4
+ s16 z_pos_1; // 0x6
+ EnemyAggressionBox *aggression_box_pointer; // = 0xC, -- u32
+} EnemyMovementBox;
+
+typedef struct {
+ u8 enemy_value; // 0x0
+ u8 unk1;
+ u16 y_rot; // 0x2
+ s16 x_pos; // 0x4
+ s16 y_pos; // 0x6
+ s16 z_pos; // 0x8
+ u8 cs_model; // 0xA
+ u8 unkB;
+ u8 max_idle_speed; // 0xC
+ u8 max_aggro_speed; // 0xD
+ u8 unkE;
+ u8 scale; // 0xF
+ u8 aggro; // 0x10
+ u8 unk11;
+ u8 something_spawn_state; // 0x12
+ u8 spawn_trigger; // 0x13
+ u8 respawn_timer_init; // 0x14 - Result is multiplied by 30 to get actual respawn timer
+ u8 unk15;
+ u8 unk16;
+ u8 unk17;
+ Actor *tied_actor; // 0x18
+ EnemyMovementBox *movement_box_pointer; // 0x1C
+ void *unk20; // 0x20
+ s16 respawn_time; // 0x24
+ s16 unk26;
+ s32 unk28;
+ f32 unk2C; // 0x2C initially written to 0.01
+ f32 unk30; // 0x30 initially written to 1
+ f32 animation_speed; // 0x34
+ u32 unk38; // 0x38 TODO: maybe float, based on alt enemy type
+ u32 unk3C;
+ s16 chunk; // 0x40
+ u8 spawn_state; // 0x42
+ u8 counter; // 0x43
+ u8 alternative_enemy_spawn; // 0x44
+
+ // 1000 0000 0000 0000 - ?
+ // 0100 0000 0000 0000 - ? Resets on Respawn
+ // 0010 0000 0000 0000 - ? Resets on Respawn
+ // 0001 0000 0000 0000 - ?
+
+ // 0000 1000 0000 0000 - ?
+ // 0000 0100 0000 0000 - ?
+ // 0000 0010 0000 0000 - ?
+ // 0000 0001 0000 0000 - ?
+
+ // 0000 0000 1000 0000 - ?
+ // 0000 0000 0100 0000 - Ignores instrument plays
+ // 0000 0000 0010 0000 - Ignores movement boundaries
+ // 0000 0000 0001 0000 - ?
+
+ // 0000 0000 0000 1000 - ? Reset on respawn
+ // 0000 0000 0000 0100 - ?
+ // 0000 0000 0000 0010 - Won't Respawn
+ // 0000 0000 0000 0001 - Spawned from respawn pending
+
+ // TODO: proper bitfield syntax
+ u16 properties_bitfield; // = 0x46 bitfield -- TODO: Document this, find where this comes from so we can display stuff pre-load
+} EnemySpawner; // 807FDC8C pointer to array of structs, count at 807FDC88
+
+typedef struct Struct807FDC90 Struct807FDC90;
+
+// Use this for D_807FDC90
+struct Struct807FDC90 {
+ Struct807FDC90 *unk0; // TODO: This type may not be correct
+ Actor *unk4;
+ s16 unk8;
+ s16 unkA;
+ s16 unkC; // Used
+ s16 unkE;
+ s32 unk10;
+ s32 unk14;
+ u16 unk18;
+ u16 unk1A;
+ u8 unk1C;
+ u8 unk1D;
+ u8 unk1E;
+ u8 unk1F;
+ u8 unk20;
+ u8 unk21;
+ u8 unk22;
+ u8 unk23;
+ u8 unk24;
+ u8 unk25;
+ u8 unk26;
+ u8 unk27;
+ s32 unk28;
+ s16 unk2C;
+ s16 unk2E; // TODO: This might not be correct
+ f32 unk30; // Used
+ u8 unk34;
+ u8 unk35; // Used
+ u8 unk36;
+ u8 unk37;
+ u8 unk38;
+};
+
+typedef struct ExitData {
+ s16 x_pos; // At 0x00
+ s16 y_pos; // At 0x02
+ s16 z_pos; // At 0x04
+ u8 angle; // At 0x06
+ u8 unk7; // At 0x07
+ u8 has_autowalk; // At 0x08
+ u8 size; // At 0x0A
+} ExitData;
+
+// From Practice ROM
+typedef struct spriteDisplay {
+ /* 0x000 */ s32 disappear;
+ /* 0x004 */ s8 unk_04[0x11];
+ /* 0x015 */ s8 unk_15;
+} spriteDisplay;
+
+typedef struct spriteControl {
+ /* 0x000 */ f32 movement_style;
+ /* 0x004 */ f32 pointer_offset_0x15;
+ /* 0x008 */ f32 xPos;
+ /* 0x00C */ f32 yPos;
+ /* 0x010 */ f32 scale;
+ /* 0x014 */ f32 unk_14;
+ /* 0x018 */ s32 unk_18;
+ /* 0x01C */ s32 unk_1C;
+} spriteControl;
+
+typedef struct otherSpriteControl {
+ /* 0x000 */ s8 unk_000[0x28];
+ /* 0x028 */ u8 left_stretch;
+ /* 0x029 */ u8 right_stretch;
+ /* 0x02A */ u8 up_stretch;
+ /* 0x02B */ u8 down_stretch;
+ /* 0x02C */ s8 unk_02C[0x340-0x2C];
+ /* 0x340 */ f32 xPos;
+ /* 0x344 */ f32 yPos;
+ /* 0x348 */ f32 unk_348;
+ /* 0x34C */ s8 unk_34C[4];
+ /* 0x350 */ s8 gif_update_frequency;
+ /* 0x351 */ s8 unk_351[0xB];
+ /* 0x35C */ spriteControl* gif_control_pointer;
+ /* 0x360 */ f32 xScale;
+ /* 0x364 */ f32 yScale;
+ /* 0x368 */ s8 unk_368[0x2];
+ /* 0x36A */ s8 transparency1;
+ /* 0x36B */ s8 transparency2;
+ /* 0x36C */ s8 transparency3;
+ /* 0x36D */ s8 transparency4;
+ /* 0x36E */ s8 unk_36E[0x384-0x36E];
+ /* 0x384 */ void* some_pointer;
+} otherSpriteControl;
+
+#endif
diff --git a/include/synthinternal.h b/include/synthinternal.h
new file mode 100644
index 00000000..6970dde0
--- /dev/null
+++ b/include/synthinternal.h
@@ -0,0 +1,335 @@
+/*====================================================================
+ * audioInternals.h
+ *
+ * Synopsis:
+ *
+ * Copyright 1993, Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
+ * Inc.; the contents of this file may not be disclosed to third
+ * parties, copied or duplicated in any form, in whole or in part,
+ * without the prior written permission of Silicon Graphics, Inc.
+ *
+ * RESTRICTED RIGHTS LEGEND:
+ * Use, duplication or disclosure by the Government is subject to
+ * restrictions as set forth in subdivision (c)(1)(ii) of the Rights
+ * in Technical Data and Computer Software clause at DFARS
+ * 252.227-7013, and/or in similar or successor clauses in the FAR,
+ * DOD or NASA FAR Supplement. Unpublished - rights reserved under the
+ * Copyright Laws of the United States.
+ *====================================================================*/
+
+#ifndef __audioInternals__
+#define __audioInternals__
+
+#include
+
+/*
+ * filter message ids
+ */
+enum {
+ AL_FILTER_FREE_VOICE,
+ AL_FILTER_SET_SOURCE,
+ AL_FILTER_ADD_SOURCE,
+ AL_FILTER_ADD_UPDATE,
+ AL_FILTER_RESET,
+ AL_FILTER_SET_WAVETABLE,
+/* AL_FILTER_SET_DMA_PROC,*/
+/* AL_FILTER_SKIP_LOOP,*/
+ AL_FILTER_SET_DRAM,
+ AL_FILTER_SET_PITCH,
+ AL_FILTER_SET_UNITY_PITCH,
+ AL_FILTER_START,
+/* AL_FILTER_SET_DECAY,*/
+/* AL_FILTER_SET_FC,*/
+ AL_FILTER_SET_STATE,
+ AL_FILTER_SET_VOLUME,
+ AL_FILTER_SET_PAN,
+ AL_FILTER_START_VOICE_ALT,
+ AL_FILTER_START_VOICE,
+ AL_FILTER_STOP_VOICE,
+ AL_FILTER_SET_FXAMT
+};
+
+#define AL_MAX_RSP_SAMPLES 0xB8
+
+/*
+ * buffer locations based on AL_MAX_RSP_SAMPLES
+ */
+#define AL_DECODER_IN 0
+#define AL_RESAMPLER_OUT 0
+#define AL_TEMP_0 0
+#define AL_DECODER_OUT 320
+#define AL_TEMP_1 320
+#define AL_TEMP_2 640
+#define AL_MAIN_L_OUT 1088
+#define AL_MAIN_R_OUT 1408
+#define AL_AUX_L_OUT 1728
+#define AL_AUX_R_OUT 2048
+
+/*
+ * filter types
+ */
+enum {
+ AL_ADPCM,
+ AL_RESAMPLE,
+ AL_BUFFER,
+ AL_SAVE,
+ AL_ENVMIX,
+ AL_FX,
+ AL_AUXBUS,
+ AL_MAINBUS
+};
+
+typedef struct ALParam_s {
+ struct ALParam_s *next;
+ s32 delta;
+ s16 type;
+ union {
+ f32 f;
+ s32 i;
+ } data;
+ union {
+ f32 f;
+ s32 i;
+ } moredata;
+ union {
+ f32 f;
+ s32 i;
+ } stillmoredata;
+ union {
+ f32 f;
+ s32 i;
+ } yetstillmoredata;
+} ALParam;
+
+typedef struct {
+ struct ALParam_s *next;
+ s32 delta;
+ s16 type;
+ s16 unity; /* disable resampler */
+ f32 pitch;
+ s16 volume;
+ ALPan pan;
+ u8 fxMix;
+ s32 samples;
+ struct ALWaveTable_s *wave;
+} ALStartParamAlt;
+
+typedef struct {
+ struct ALParam_s *next;
+ s32 delta;
+ s16 type;
+ s16 unity; /* disable resampler */
+ struct ALWaveTable_s *wave;
+} ALStartParam;
+
+typedef struct {
+ struct ALParam_s *next;
+ s32 delta;
+ s16 type;
+ struct PVoice_s *pvoice;
+} ALFreeParam;
+
+typedef Acmd *(*ALCmdHandler)(void *, s16 *, s32, s32, Acmd *);
+typedef s32 (*ALSetParam)(void *, s32, void *);
+
+typedef struct ALFilter_s {
+ struct ALFilter_s *source;
+ ALCmdHandler handler;
+ ALSetParam setParam;
+ s16 inp;
+ s16 outp;
+ s32 type;
+} ALFilter;
+
+void alFilterNew(ALFilter *f, ALCmdHandler h, ALSetParam s, s32 type);
+
+#define AL_MAX_ADPCM_STATES 3 /* Depends on number of subframes
+ * per frame and loop length
+ */
+typedef struct {
+ ALFilter filter;
+ ADPCM_STATE *state;
+ ADPCM_STATE *lstate;
+ ALRawLoop loop;
+ struct ALWaveTable_s *table;
+ s32 bookSize;
+ ALDMAproc dma;
+ void *dmaState;
+ s32 sample;
+ s32 lastsam;
+ s32 first;
+ s32 memin;
+} ALLoadFilter;
+
+void alLoadNew(ALLoadFilter *f, ALDMANew dma, ALHeap *hp);
+Acmd *alAdpcmPull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p);
+Acmd *alRaw16Pull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p);
+s32 alLoadParam(void *filter, s32 paramID, void *param);
+
+typedef struct ALResampler_s {
+ ALFilter filter;
+ RESAMPLE_STATE *state;
+ f32 ratio;
+ s32 upitch;
+ f32 delta;
+ s32 first;
+ ALParam *ctrlList;
+ ALParam *ctrlTail;
+ s32 motion;
+} ALResampler;
+
+typedef struct {
+ s16 fc;
+ s16 fgain;
+ union {
+ s16 fccoef[16];
+ s64 force_aligned;
+ } fcvec;
+ POLEF_STATE *fstate;
+ s32 first;
+} ALLowPass;
+
+typedef struct {
+ u32 input;
+ u32 output;
+ s16 ffcoef;
+ s16 fbcoef;
+ s16 gain;
+ f32 rsinc;
+ f32 rsval;
+ s32 rsdelta;
+ f32 rsgain;
+ ALLowPass *lp;
+ ALResampler *rs;
+} ALDelay;
+
+typedef s32 (*ALSetFXParam)(void *, s32, void *);
+typedef struct {
+ struct ALFilter_s filter;
+ s16 *base;
+ s16 *input;
+ u32 length;
+ ALDelay *delay;
+ u8 section_count;
+ ALSetFXParam paramHdl;
+} ALFx;
+
+void alFxNew(ALFx *r, ALSynConfig *c, ALHeap *hp);
+Acmd *alFxPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
+s32 alFxParam(void *filter, s32 paramID, void *param);
+s32 alFxParamHdl(void *filter, s32 paramID, void *param);
+
+#define AL_MAX_MAIN_BUS_SOURCES 1
+typedef struct ALMainBus_s {
+ ALFilter filter;
+ s32 sourceCount;
+ s32 maxSources;
+ ALFilter **sources;
+} ALMainBus;
+
+void alMainBusNew(ALMainBus *m, void *ptr, s32 len);
+Acmd *alMainBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
+s32 alMainBusParam(void *filter, s32 paramID, void *param);
+
+#define AL_MAX_AUX_BUS_SOURCES 8
+#define AL_MAX_AUX_BUS_FX 1
+typedef struct ALAuxBus_s {
+ ALFilter filter;
+ s32 sourceCount;
+ s32 maxSources;
+ ALFilter **sources;
+ ALFx fx[AL_MAX_AUX_BUS_FX];
+} ALAuxBus;
+
+void alAuxBusNew(ALAuxBus *m, void *ptr, s32 len);
+Acmd *alAuxBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
+s32 alAuxBusParam(void *filter, s32 paramID, void *param);
+
+void alResampleNew(ALResampler *r, ALHeap *hp);
+Acmd *alResamplePull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
+s32 alResampleParam(void *f, s32 paramID, void *param);
+
+typedef struct ALSave_s {
+ ALFilter filter;
+ s32 dramout;
+ s32 first;
+} ALSave;
+
+void alSaveNew(ALSave *r);
+Acmd *alSavePull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
+s32 alSaveParam(void *f, s32 paramID, void *param);
+
+typedef struct ALEnvMixer_s {
+ ALFilter filter;
+ ENVMIX_STATE *state;
+ s16 pan;
+ s16 volume;
+ s16 cvolL;
+ s16 cvolR;
+ s16 dryamt;
+ s16 wetamt;
+ u16 lratl;
+ s16 lratm;
+ s16 ltgt;
+ u16 rratl;
+ s16 rratm;
+ s16 rtgt;
+ s32 delta;
+ s32 segEnd;
+ s32 first;
+ ALParam *ctrlList;
+ ALParam *ctrlTail;
+ ALFilter **sources;
+ s32 motion;
+} ALEnvMixer;
+
+void alEnvmixerNew(ALEnvMixer *e, ALHeap *hp);
+Acmd *alEnvmixerPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
+s32 alEnvmixerParam(void *filter, s32 paramID, void *param);
+
+
+/*
+ * heap stuff
+ */
+typedef struct {
+ s32 magic; /* check structure integrety */
+ s32 size; /* size of this allocated block */
+ u8 *file; /* file that this alloc was called from */
+ s32 line; /* line that it was called from */
+ s32 count; /* heap call number */
+ s32 pad0;
+ s32 pad1;
+ s32 pad2; /* Make it 32 bytes */
+} HeapInfo;
+
+#define AL_CACHE_ALIGN 15
+
+/*
+ * synth stuff
+ */
+
+typedef struct PVoice_s {
+ ALLink node;
+ struct ALVoice_s *vvoice;
+ ALFilter *channelKnob;
+ ALLoadFilter decoder;
+ ALResampler resampler;
+ ALEnvMixer envmixer;
+ s32 offset;
+} PVoice;
+
+/*
+ * prototypes for private driver functions
+ */
+ALParam *__allocParam(void);
+void __freeParam(ALParam *param);
+void _freePVoice(ALSynth *drvr, PVoice *pvoice);
+void _collectPVoices(ALSynth *drvr);
+
+s32 _timeToSamples(ALSynth *ALSynth, s32 micros);
+ALMicroTime _samplesToTime(ALSynth *synth, s32 samples);
+
+#endif
diff --git a/include/variables.h b/include/variables.h
new file mode 100644
index 00000000..4b42daed
--- /dev/null
+++ b/include/variables.h
@@ -0,0 +1,297 @@
+extern s8 story_skip;
+extern s8 widescreen_enabled;
+extern PlayerAdditionalActorData *extra_player_info_pointer;
+extern Actor *current_actor_pointer;
+extern Actor *D_807FBB44;
+extern Actor *D_807FBB48;
+extern GlobalASMStruct35 D_807FBB70[];
+extern Actor *D_807FBD6C;
+extern Actor *D_807FDC94;
+extern EnemyInfo *D_807FDC98;
+extern u8 current_character_index[];
+extern CharacterChange *character_change_array;
+extern Actor *player_pointer;
+extern u8 cc_player_index; // index into character_change_array, current_character_index[]
+extern u8 cc_number_of_players;
+extern s32 global_properties_bitfield;
+extern Maps current_map;
+extern s32 current_exit;
+extern Maps next_map;
+extern s32 next_exit;
+extern u8 is_cutscene_active;
+extern u8 game_mode;
+extern u8 game_mode_copy;
+extern u16 newly_pressed_input;
+extern u16 newly_pressed_input_copy;
+extern Struct807FDC90 *D_807FDC90; // Array?
+extern CharacterSpawner *D_807FDC9C; // Character spawner array
+extern s32 object_timer;
+extern u8 is_autowalking;
+extern ActorSpawner *actor_spawner_pointer;
+extern PlayerProgress D_807FC950[4];
+extern u16 enemies_killed;
+extern Chunk *chunk_array_pointer;
+extern u8 current_file;
+
+extern s32 D_807FBB64; // shadow_display_bitfield, shockwave_bitfield, long_distance_actor_spawn
+
+extern u8 D_8076A0AB; // Map
+extern s16 D_807F6240[];
+
+typedef struct {
+ s32 unk0; // Used
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20; // Used
+} Struct807552E4;
+
+extern Struct807552E4 D_807552E4;
+
+typedef struct Struct807FD610 {
+ s32 unk0; // Timer that ticks up once per frame
+ f32 unk4; // Probably float
+ f32 unk8; // Probably float
+ f32 unkC; // Probably float
+ f32 unk10;
+ f32 unk14;
+ s32 unk18;
+ s32 unk1C;
+ s32 unk20; // Probably s16
+ s32 unk24; // Probably s16
+ s16 unk28; // Used
+ u16 unk2A; // Used, controller button bitfield
+ u16 unk2C; // Used, controller button bitfield
+ s8 unk2E; // Used
+ s8 unk2F; // Used
+ u8 unk30; // Used
+ u8 unk31;
+ s16 unk32;
+} Struct807FD610;
+
+extern Struct807FD610 D_807FD610[]; // Often indexed by cc_player_index
+extern OSPfs D_807F02D0[];
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ f32 unk8; // Used
+} GlobalASMStruct20_unk18;
+
+typedef struct {
+ u8 pad0[0x18];
+ GlobalASMStruct20_unk18 *unk18; // Used
+ s32 unk1C; // Used
+ s32 unk20;
+ s32 unk24;
+ s32 unk28; // Used
+ s32 unk2C;
+ u16 unk30; // Flags?
+} GlobalASMStruct20;
+extern GlobalASMStruct20 *D_8076BF20[];
+
+// TODO: What is this datatype?
+typedef struct Struct807FDCA0 {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ s32 unk14; // TODO: Pointer to an array of structs 0xA big? See boss func_8003392C
+ s32 unk18;
+ s32 unk1C;
+ s8 unk20;
+} Struct807FDCA0;
+extern Struct807FDCA0 *D_807FDCA0; // TODO: What is this datatype?
+
+typedef struct Struct807F0470 {
+ s32 unk0;
+ u8 unk4;
+ u8 unk5;
+ s16 unk6;
+ s32 unk8;
+ s32 unkC;
+ u16 unk10;
+ u8 unk12;
+ u8 unk13;
+} Struct807F0470;
+
+extern Struct807F0470 D_807F0470[];
+
+typedef struct {
+ Actor* unk0;
+ s32 unk4;
+} GlobalASMStruct53;
+
+extern GlobalASMStruct53 D_807FB930[];
+
+typedef struct global_asm_struct_58 GlobalASMStruct58;
+
+struct global_asm_struct_58 {
+ void *unk0; // used, at least 0x65 big (func_80661264, func_8065F5F0), not sure what datatype though
+ f32 unk4; // used
+ f32 unk8; // used
+ f32 unkC; // used
+ f32 unk10; // used
+ f32 unk14; // used
+ f32 unk18; // used
+ s32 unk1C;
+ s32 unk20;
+ s32 unk24;
+ s32 unk28;
+ s32 unk2C;
+ s32 unk30;
+ s32 unk34;
+ s32 unk38;
+ s32 unk3C;
+ s32 unk40;
+ s32 unk44;
+ s16 unk48;
+ s8 unk4A; // used
+ s8 unk4B; // used
+ s8 unk4C; // used
+ s8 unk4D;
+ s16 unk4E;
+ GlobalASMStruct58 *next; // used
+};
+
+extern GlobalASMStruct58 *D_807F93C0;
+
+// Array of structs 0x10 big
+// TODO: What are these actually?
+typedef struct Temp10Big {
+ s32 unk0;
+ s16 unk4;
+ s8 unk6;
+ s8 unk7;
+ s32 unk8;
+ s32 unkC;
+} Temp10Big;
+extern Temp10Big D_8075C410[];
+
+typedef struct DKTVExtraData {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s16 unkC;
+ u8 map;
+ u8 exit;
+} DKTVExtraData;
+
+extern DKTVExtraData D_807ECE20;
+
+typedef struct model_2_model_50_b8 Model2Model50_B8;
+
+struct model_2_model_50_b8 {
+ s32 unk0[4];
+ s32 unk10[4];
+ s32 unk20[4];
+ s32 unk30;
+ s32 unk34;
+ s16 unk38; // Used
+ s16 unk3A; // Used
+ s32 unk3C;
+ s32 unk40;
+ s32 unk44;
+ u8 unk48; // Used
+ u8 unk49; // used
+ u8 unk4A;
+ u8 unk4B;
+ s32 unk4C;
+ s32 unk50; // Used
+ s32 unk54; // Used
+ s32 unk58;
+ s32 unk5C;
+ s32 unk60[4];
+ s32 unk70[4];
+ s32 unk80[4];
+ s32 unk90[4];
+ s32 unkA0[4];
+ s32 unkB0[4];
+ s32 unkC0[4];
+ s32 unkD0;
+ Model2Model50_B8 *next; // unkD4
+};
+
+typedef struct {
+ s32 unk0[4];
+ s32 unk10[4];
+ s32 unk20[4];
+ s32 unk30[4];
+ s32 unk40;
+ s32 unk44;
+ s32 unk48;
+ s16 unk4C;
+ u8 unk4E; // Used
+ u8 unk4F; // Used
+ Model2Model50_B8 *unk50; // Used, pointer
+ s32 unk54;
+ s32 unk58;
+ s32 unk5C;
+ s32 unk60[4];
+ s32 unk70[4];
+ s32 unk80[4];
+ s32 unk90[4];
+ s32 unkA0[4];
+ s32 unkB0;
+ s32 unkB4;
+ Model2Model50_B8 *unkB8; // Used, pointer
+} Model2Model;
+
+typedef struct object_model2 {
+ f32 x_position; // at 0x00
+ f32 y_position; // at 0x04
+ f32 z_position; // at 0x08
+ f32 hitbox_scale; // at 0x0C
+ f32 x_rotation; // at 0x10
+ f32 y_rotation; // at 0x14
+ f32 z_rotation; // at 0x18
+ s32 unk1C;
+ Model2Model *model_pointer; // at 0x20
+ void *unk24; // labelled behavior_type_pointer in ScriptHawk
+ s32 unk28;
+ s32 unk2C;
+ s32 unk30;
+ s32 unk34;
+ s32 unk38;
+ s32 unk3C;
+ s32 unk40;
+ s32 unk44;
+ s32 unk48;
+ s32 unk4C;
+ s32 unk50;
+ s32 unk54;
+ s32 unk58;
+ s32 unk5C;
+ s32 unk60;
+ s32 unk64;
+ s32 unk68;
+ s32 unk6C;
+ s32 unk70;
+ s32 unk74;
+ void *unk78; // used in func_80650AD8, weird format
+ void *unk7C; // labelled behavior_pointer in ScriptHawk
+ s32 unk80;
+ s16 object_type; // at 0x84
+ s16 unk86;
+ s16 unk88;
+ s16 unk8A;
+ s32 unk8C; // bitfield, collectable state (u8)
+} ObjectModel2;
+
+extern ObjectModel2 *D_807F6000;
+
+extern u16 D_80744710[]; // = { // Permanent flag index lookup array
+// 26, // Key 1 Collected
+// 74, // key 2 Collected
+// 138, // Key 3 Collected
+// 168, // Key 4 Collected
+// 236, // Key 5 Collected
+// 292, // Key 6 Collected
+// 317, // Key 7 Collected
+// 380, // Key 8 Collected
+// }; // Permanent flag index lookup array
diff --git a/include/viint.h b/include/viint.h
new file mode 100755
index 00000000..2887afb3
--- /dev/null
+++ b/include/viint.h
@@ -0,0 +1,70 @@
+#ifndef _VIINT_H
+#define _VIINT_H
+#include
+
+#define OS_TV_TYPE_PAL 0
+#define OS_TV_TYPE_NTSC 1
+#define OS_TV_TYPE_MPAL 2
+
+//TODO: figure out what this is
+#define VI_STATE_01 0x01
+#define VI_STATE_XSCALE_UPDATED 0x02
+#define VI_STATE_YSCALE_UPDATED 0x04
+#define VI_STATE_08 0x08 //related to control regs changing
+#define VI_STATE_10 0x10 //swap buffer
+#define VI_STATE_BLACK 0x20 //probably related to a black screen
+#define VI_STATE_REPEATLINE 0x40 //repeat line?
+#define VI_STATE_FADE 0x80 //fade
+
+#define VI_CTRL_ANTIALIAS_MODE_3 0x00300 /* Bit [9:8] anti-alias mode */
+#define VI_CTRL_ANTIALIAS_MODE_2 0x00200 /* Bit [9:8] anti-alias mode */
+#define VI_CTRL_ANTIALIAS_MODE_1 0x00100 /* Bit [9:8] anti-alias mode */
+
+#define VI_SCALE_MASK 0xfff //see rcp scale_x/scale_y
+#define VI_2_10_FPART_MASK 0x3ff
+#define VI_SUBPIXEL_SH 0x10
+
+#define BURST(hsync_width, color_width, vsync_width, color_start) \
+ (hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20))
+#define WIDTH(v) v
+#define VSYNC(v) v
+#define HSYNC(duration, leap) (duration | (leap << 16))
+#define LEAP(upper, lower) ((upper << 16) | lower)
+#define START(start, end) ((start << 16) | end)
+
+#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1))
+
+#define F210(val) FTOFIX(val, 2, 10)
+#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16))
+
+#define VCURRENT(v) v //seemingly unused
+#define ORIGIN(v) v
+#define VINTR(v) v
+#define HSTART START
+
+typedef struct
+{
+ /* 0x0 */ f32 factor;
+ /* 0x4 */ u16 offset;
+ /* 0x8 */ u32 scale;
+} __OSViScale;
+
+typedef struct
+{
+ /* 0x0 */ u16 state;
+ /* 0x2 */ u16 retraceCount;
+ /* 0x4 */ void *framep;
+ /* 0x8 */ OSViMode *modep;
+ /* 0xC */ u32 control;
+ /* 0x10 */ OSMesgQueue *msgq;
+ /* 0x14 */ OSMesg msg;
+ /* 0x18 */ __OSViScale x;
+ /* 0x24 */ __OSViScale y;
+} __OSViContext;
+
+void __osViSwapContext(void);
+extern __OSViContext *__osViCurr;
+extern __OSViContext *__osViNext;
+__OSViContext *__osViGetCurrentContext(void);
+void __osViInit(void);
+#endif
diff --git a/progress/progress.arcade.csv b/progress/progress.arcade.csv
new file mode 100644
index 00000000..3cb5d00d
--- /dev/null
+++ b/progress/progress.arcade.csv
@@ -0,0 +1,99 @@
+version,section,function,length,matching
+us,.code,func_80030C70,124,yes
+us,.code,func_80024764,84,yes
+us,.code,func_8002451C,296,yes
+us,.code,arcade_nintendo_coin_update,316,yes
+us,.code,func_8002B390,1292,no
+us,.code,func_80029ACC,516,yes
+us,.code,arcade_pie_update,360,yes
+us,.code,func_8002AF2C,120,yes
+us,.code,func_80030FEC,500,yes
+us,.code,arcade_75m_setup,1792,yes
+us,.code,func_8002E3D4,780,no
+us,.code,func_800252D8,452,yes
+us,.code,func_8002F82C,1532,no
+us,.code,arcade_100m_setup,1460,yes
+us,.code,arcade_25m_setup,1328,yes
+us,.code,func_80030CEC,708,no
+us,.code,arcade_help_text_update,356,yes
+us,.code,func_8002628C,352,yes
+us,.code,func_800244E4,36,yes
+us,.code,func_80024320,236,yes
+us,.code,func_80029CD0,556,no
+us,.code,func_800319D4,2124,no
+us,.code,func_800263EC,300,yes
+us,.code,func_80027A38,1108,no
+us,.code,func_800255A8,76,yes
+us,.code,func_80029968,356,yes
+us,.code,func_80024508,20,yes
+us,.code,func_8002419C,388,yes
+us,.code,func_800268AC,1608,no
+us,.code,func_800246EC,120,yes
+us,.code,arcade_pauline_bottom_update,268,yes
+us,.code,arcade_bonus_item_update,260,yes
+us,.code,func_800247B8,56,yes
+us,.code,func_8002AFA4,796,yes
+us,.code,func_80024E84,852,yes
+us,.code,func_8002AC54,728,yes
+us,.code,arcade_rivet_update,388,yes
+us,.code,func_8002440C,216,yes
+us,.code,func_800247F0,56,yes
+us,.code,arcade_get_object_type_count,104,yes
+us,.code,func_800259D0,568,yes
+us,.code,__arcade_abs_w,24,yes
+us,.code,arcade_dk_50m_update,460,yes
+us,.code,func_8002A390,120,yes
+us,.code,func_8002B89C,4924,no
+us,.code,arcade_dk_title_update,692,yes
+us,.code,func_80027E8C,128,yes
+us,.code,func_8002D6FC,2652,no
+us,.code,func_8002A264,300,no
+us,.code,func_800251D8,104,yes
+us,.code,func_800311E0,472,no
+us,.code,func_80024CF8,152,yes
+us,.code,func_80030734,332,yes
+us,.code,func_80025C08,1096,yes
+us,.code,func_8002B2C0,184,yes
+us,.code,func_8002CBD8,396,yes
+us,.code,func_80026EF4,1516,no
+us,.code,func_80025240,100,yes
+us,.code,func_80029EFC,872,no
+us,.code,func_80024000,412,yes
+us,.code,func_8002EEB8,2420,no
+us,.code,func_800257D8,392,yes
+us,.code,func_80024C34,196,yes
+us,.code,func_80024644,48,yes
+us,.code,func_800255F4,484,yes
+us,.code,func_80025960,112,yes
+us,.code,arcade_barrel_stack_update,60,yes
+us,.code,func_80026518,360,yes
+us,.code,func_80026050,572,yes
+us,.code,func_80024A50,180,no
+us,.code,func_800274E0,264,no
+us,.code,func_8002E158,636,no
+us,.code,arcade_pulley_update,196,yes
+us,.code,func_8002549C,268,yes
+us,.code,func_80026680,556,yes
+us,.code,func_80030A04,260,no
+us,.code,func_8002A734,752,yes
+us,.code,func_800252A4,52,yes
+us,.code,func_80024828,56,yes
+us,.code,func_80024D90,244,yes
+us,.code,func_800275E8,1104,no
+us,.code,arcade_50m_setup,2168,yes
+us,.code,func_8003159C,940,yes
+us,.code,func_8002CD64,2456,no
+us,.code,func_8002AA24,560,yes
+us,.code,func_8002FE28,540,no
+us,.code,arcade_add_points_to_score,84,yes
+us,.code,arcade_hammer_update,892,yes
+us,.code,func_8002A474,704,yes
+us,.code,arcade_pauline_top_update,180,yes
+us,.code,func_80024940,272,no
+us,.code,func_80031948,140,yes
+us,.code,func_8002A408,108,no
+us,.code,func_800313B8,484,yes
+us,.code,func_80024B04,304,no
+us,.code,arcade_points_text_update,164,yes
+us,.code,func_80024860,120,yes
+us,.code,func_800246C8,36,yes
diff --git a/progress/progress.bonus.csv b/progress/progress.bonus.csv
new file mode 100644
index 00000000..8fe9b7c2
--- /dev/null
+++ b/progress/progress.bonus.csv
@@ -0,0 +1,48 @@
+version,section,function,length,matching
+us,.code,func_8002AED8,2632,no
+us,.code,func_80027308,52,yes
+us,.code,func_8002BF98,2388,no
+us,.code,func_8002563C,136,yes
+us,.code,func_8002881C,1568,no
+us,.code,func_800264E0,224,yes
+us,.code,func_80024E38,1128,no
+us,.code,func_80024D8C,172,no
+us,.code,func_8002BE44,340,no
+us,.code,func_8002D7E8,112,yes
+us,.code,func_800240F0,104,yes
+us,.code,func_800256C4,72,no
+us,.code,func_8002D2F0,1032,no
+us,.code,func_800277F8,1820,no
+us,.code,func_800284C0,392,no
+us,.code,func_80026CF0,1220,no
+us,.code,func_80028648,468,no
+us,.code,func_80025480,48,no
+us,.code,func_800271B4,340,no
+us,.code,func_8002CC08,1032,no
+us,.code,func_80024D3C,80,no
+us,.code,func_8002B920,1316,no
+us,.code,func_80024158,3044,no
+us,.code,func_8002A398,1804,no
+us,.code,func_8002AAA4,620,no
+us,.code,func_80028E3C,1320,no
+us,.code,func_800261B8,808,no
+us,.code,func_80029B9C,696,no
+us,.code,func_80029364,2104,no
+us,.code,func_8002733C,356,no
+us,.code,func_80024000,240,no
+us,.code,func_8002AD10,456,no
+us,.code,func_8002C8EC,796,no
+us,.code,func_800265C0,200,yes
+us,.code,func_8002D010,736,no
+us,.code,func_8002570C,2732,no
+us,.code,func_80026940,944,no
+us,.code,func_800253E4,156,yes
+us,.code,func_800274A0,168,yes
+us,.code,func_80029E54,444,no
+us,.code,func_80026690,688,no
+us,.code,func_800254B0,396,no
+us,.code,func_8002D6F8,240,no
+us,.code,func_800252A0,324,no
+us,.code,func_80027F14,1452,no
+us,.code,func_8002A010,904,no
+us,.code,func_80027548,688,no
diff --git a/progress/progress.boss.csv b/progress/progress.boss.csv
new file mode 100644
index 00000000..7af53e76
--- /dev/null
+++ b/progress/progress.boss.csv
@@ -0,0 +1,81 @@
+version,section,function,length,matching
+us,.code,func_8002920C,160,yes
+us,.code,func_80033AF0,7276,no
+us,.code,func_80033A80,112,yes
+us,.code,func_80028478,520,no
+us,.code,func_80029140,204,yes
+us,.code,func_8002C748,132,yes
+us,.code,func_800254D0,8864,no
+us,.code,func_8003340C,152,yes
+us,.code,func_8002531C,72,yes
+us,.code,func_80024EAC,252,yes
+us,.code,func_80024300,524,no
+us,.code,func_8002C5F4,340,yes
+us,.code,func_80027A30,376,no
+us,.code,func_80030C30,288,yes
+us,.code,func_8002E82C,396,yes
+us,.code,func_80030D50,264,yes
+us,.code,func_8002FEC0,180,yes
+us,.code,func_8002DCE0,156,yes
+us,.code,func_8002A5CC,748,yes
+us,.code,func_80024568,2372,no
+us,.code,func_80028878,2140,no
+us,.code,func_8002E9B8,92,yes
+us,.code,func_8002FC98,352,no
+us,.code,func_8002DD7C,136,yes
+us,.code,func_8003392C,172,no
+us,.code,func_8002EA7C,1668,no
+us,.code,func_8002DC60,128,yes
+us,.code,func_80031AA0,4200,no
+us,.code,func_8002C520,212,yes
+us,.code,func_8002FDF8,200,yes
+us,.code,func_80030888,152,no
+us,.code,func_8002EA14,104,yes
+us,.code,func_8002C964,2252,no
+us,.code,func_80028458,32,yes
+us,.code,func_8002FF74,2324,no
+us,.code,func_8002450C,24,no
+us,.code,func_800251A0,380,yes
+us,.code,func_800292B0,272,yes
+us,.code,func_80024FA8,504,yes
+us,.code,func_8002A8B8,116,yes
+us,.code,func_80030AE0,336,yes
+us,.code,func_80025364,72,yes
+us,.code,func_800336C0,196,yes
+us,.code,func_8002FC48,80,yes
+us,.code,func_80028818,8,yes
+us,.code,func_80030EC4,3036,no
+us,.code,func_800253AC,292,no
+us,.code,func_80032B08,1480,no
+us,.code,func_80029468,3544,no
+us,.code,func_80027840,180,no
+us,.code,func_800290D4,108,yes
+us,.code,func_800334A4,540,no
+us,.code,func_80024000,316,no
+us,.code,func_8002D230,2608,no
+us,.code,func_80027950,224,no
+us,.code,func_80030920,448,no
+us,.code,func_8002A92C,7156,no
+us,.code,func_80028820,88,yes
+us,.code,func_80030E58,108,yes
+us,.code,func_8002FB7C,204,yes
+us,.code,func_8002A41C,320,yes
+us,.code,func_800278F4,92,yes
+us,.code,func_80024524,68,no
+us,.code,func_8002E7A0,140,yes
+us,.code,func_8002A240,476,no
+us,.code,func_800330D0,828,no
+us,.code,func_8002A55C,112,yes
+us,.code,func_800293C0,168,yes
+us,.code,func_8002C8B4,176,yes
+us,.code,func_80027BA8,2224,no
+us,.code,func_8002C7CC,232,yes
+us,.code,func_800339D8,168,yes
+us,.code,func_8003575C,328,yes
+us,.code,func_800286B8,352,no
+us,.code,func_8002413C,452,no
+us,.code,func_8002DE04,2460,no
+us,.code,func_8002F100,2684,no
+us,.code,func_80033784,424,no
+us,.code,func_80028680,56,yes
+us,.code,func_80027770,208,no
diff --git a/progress/progress.dk64_boot.csv b/progress/progress.dk64_boot.csv
new file mode 100644
index 00000000..9caabf87
--- /dev/null
+++ b/progress/progress.dk64_boot.csv
@@ -0,0 +1,233 @@
+version,section,function,length,matching
+us,boot,func_80005A70,16,no
+us,boot,func_800058BC,92,no
+us,boot,osDestroyThread,260,yes
+us,boot,guSprite2DInit,80,no
+us,boot,func_8000102C,144,yes
+us,boot,osRecvMesg,312,yes
+us,boot,osGetThreadId,24,yes
+us,boot,osCreateViManager,384,no
+us,boot,func_80002F18,60,no
+us,boot,func_80002750,52,yes
+us,boot,__osContDataCrc,160,no
+us,boot,func_80002ECC,76,no
+us,boot,__osSetCompare,16,yes
+us,boot,guMtxL2F,184,no
+us,boot,__osPiCreateAccessQueue,80,no
+us,boot,func_800005A8,984,no
+us,boot,func_80007360,112,no
+us,boot,__osDispatchThread,396,yes
+us,boot,guTranslate,84,yes
+us,boot,func_80000D8C,188,yes
+us,boot,__osAiDeviceBusy,48,yes
+us,boot,osEepromLongRead,140,yes
+us,boot,func_80001700,1012,no
+us,boot,func_80002790,152,no
+us,boot,func_800022D4,288,no
+us,boot,func_80002724,44,no
+us,boot,__osPackRamWriteDataSafe,128,no
+us,boot,func_80005948,96,no
+us,boot,func_80005818,60,no
+us,boot,osDpGetStatus,12,yes
+us,boot,func_8000BE20,480,no
+us,boot,osEPiRawReadIo,352,no
+us,boot,__osEepStatus,428,no
+us,boot,guLookAtHiliteF,1848,no
+us,boot,osMotorStartStop,360,no
+us,boot,osViGetCurrentFramebuffer,64,yes
+us,boot,__osDevMgrMain,1168,no
+us,boot,guAlign,80,no
+us,boot,__osExceptionPreamble,16,yes
+us,boot,__osSpSetStatus,12,yes
+us,boot,func_80002D60,132,no
+us,boot,func_800075CC,28,no
+us,boot,func_800010C0,1600,no
+us,boot,func_800004F4,180,yes
+us,boot,func_800075E8,160,no
+us,boot,osSendMesg,332,yes
+us,boot,func_8000DB90,288,no
+us,boot,sqrtf,16,yes
+us,boot,__osPfsGetStatus,208,no
+us,boot,__osSetGlobalIntMask,76,yes
+us,boot,osUnmapTLBAll,80,yes
+us,boot,__osPiGetAccess,68,no
+us,boot,osSetThreadPri,224,yes
+us,boot,__osSpGetStatus,12,yes
+us,boot,memcpy,288,no
+us,boot,func_800024E0,196,yes
+us,boot,osMotorInit,348,yes
+us,boot,osVirtualToPhysical,124,yes
+us,boot,guMtxIdent,48,yes
+us,boot,osEepromRead,452,no
+us,boot,_MakeMotorData,268,no
+us,boot,func_80007754,52,no
+us,boot,osYieldThread,76,yes
+us,boot,osPiReadIo,64,yes
+us,boot,func_80002A64,88,no
+us,boot,func_80002ABC,80,no
+us,boot,__ull_to_f,28,no
+us,boot,osViSwapBuffer,80,yes
+us,boot,func_80005918,48,no
+us,boot,__osContRamWrite,592,no
+us,boot,func_80000980,80,yes
+us,boot,osEepromProbe,112,no
+us,boot,__osSetTimerIntr,116,yes
+us,boot,guOrthoF,340,yes
+us,boot,__osSetSR,16,yes
+us,boot,osStartThread,336,yes
+us,boot,guLookAtHilite,184,yes
+us,boot,func_800057B0,44,no
+us,boot,osSetIntMask,160,no
+us,boot,func_80007724,24,no
+us,boot,osGetCount,16,yes
+us,boot,osContInit,368,no
+us,boot,osPiStartDma,268,yes
+us,boot,__osSumcalc,116,no
+us,boot,func_80002E98,52,no
+us,boot,bzero,160,yes
+us,boot,__osInsertTimer,392,yes
+us,boot,__osEnqueueAndYield,256,yes
+us,boot,__osSpDeviceBusy,44,yes
+us,boot,cosf,368,no
+us,boot,osSpTaskYield,32,yes
+us,boot,guMtxCatF,360,yes
+us,boot,__osPopThread,16,yes
+us,boot,func_80000AA0,564,no
+us,boot,osGetTime,132,yes
+us,boot,osCreateMesgQueue,44,yes
+us,boot,guLookAt,120,yes
+us,boot,func_800025A4,384,no
+us,boot,__osSpRawStartDma,140,yes
+us,boot,guPerspective,88,yes
+us,boot,__osSiRawReadIo,80,yes
+us,boot,__osIdCheckSum,252,no
+us,boot,osViGetCurrentMode,72,yes
+us,boot,func_8000320C,4884,no
+us,boot,func_800057DC,60,no
+us,boot,guOrtho,104,yes
+us,boot,func_80002BB8,188,no
+us,boot,func_80005880,60,no
+us,boot,guNormalize,132,yes
+us,boot,__osRestoreInt,32,yes
+us,boot,__osViGetCurrentContext,12,yes
+us,boot,osSetTime,36,yes
+us,boot,osViSetMode,104,yes
+us,boot,__osPiRelAccess,44,no
+us,boot,func_80002DE4,180,no
+us,boot,osInitialize,704,no
+us,boot,func_800031E0,44,no
+us,boot,func_80002828,184,no
+us,boot,__osPackEepWriteData,172,no
+us,boot,osPfsIsPlug,416,no
+us,boot,send_mesg,232,yes
+us,boot,__osEnqueueThread,72,yes
+us,boot,osEPiRawWriteIo,352,no
+us,boot,guLookAtF,696,yes
+us,boot,guAlignF,448,no
+us,boot,__osTimerInterrupt,376,yes
+us,boot,osPiGetCmdQueue,40,yes
+us,boot,__osProbeTLB,192,yes
+us,boot,bcopy,784,yes
+us,boot,osPiRawReadIo,84,yes
+us,boot,func_80003120,192,no
+us,boot,osSpTaskYielded,128,yes
+us,boot,osGetThreadPri,24,yes
+us,boot,guTranslateF,72,yes
+us,boot,osInvalICache,128,yes
+us,boot,osSetEventMesg,104,yes
+us,boot,func_800023F4,236,no
+us,boot,guRotateF,404,no
+us,boot,guMtxCatL,88,yes
+us,boot,func_80002CE8,120,no
+us,boot,__osSiCreateAccessQueue,80,no
+us,boot,__osSiDeviceBusy,48,no
+us,boot,func_80005070,336,no
+us,boot,__osTimerServicesInit,140,no
+us,boot,func_80001AF4,340,no
+us,boot,__osPfsRequestOneChannel,196,no
+us,boot,__osSiRawWriteIo,76,yes
+us,boot,guRotate,92,no
+us,boot,osAiGetLength,12,yes
+us,boot,func_8000D7E0,212,no
+us,boot,osInvalDCache,176,yes
+us,boot,__osPfsGetOneChannelData,156,no
+us,boot,osJamMesg,336,yes
+us,boot,__osSpSetPc,52,yes
+us,boot,func_80007788,56,no
+us,boot,func_80001C48,360,no
+us,boot,osViGetNextFramebuffer,64,yes
+us,boot,guPosition,112,no
+us,boot,func_80000EEC,320,no
+us,boot,__osResetGlobalIntMask,96,no
+us,boot,__osException,1316,yes
+us,boot,__osContGetInitData,208,no
+us,boot,__osGetFpcCsr,16,yes
+us,boot,__osSiRawStartDma,176,no
+us,boot,guScale,72,yes
+us,boot,osAiSetNextBuffer,164,yes
+us,boot,__osDisableInt,32,yes
+us,boot,__osViInit,316,yes
+us,boot,func_80001DB0,1316,no
+us,boot,func_80000E48,164,no
+us,boot,__osPackRequestData,256,no
+us,boot,osPiRawStartDma,224,yes
+us,boot,func_800004B4,64,yes
+us,boot,osStopThread,192,yes
+us,boot,guMtxXFMF,160,yes
+us,boot,__osRepairPackId,848,no
+us,boot,func_80007688,156,no
+us,boot,func_800028E0,268,no
+us,boot,func_800073D0,132,yes
+us,boot,osPiGetStatus,12,yes
+us,boot,osSpTaskStartGo,64,yes
+us,boot,func_80000CD4,184,yes
+us,boot,sinf,448,no
+us,boot,__osPfsRequestData,208,no
+us,boot,func_80005A44,44,no
+us,boot,func_800029EC,68,no
+us,boot,func_800074E0,208,no
+us,boot,func_800009D0,88,yes
+us,boot,guMtxXFML,96,yes
+us,boot,func_80000450,100,yes
+us,boot,osSetTimer,212,yes
+us,boot,osMapTLBRdb,96,yes
+us,boot,func_80005854,44,no
+us,boot,__osGetId,428,no
+us,boot,osCreatePiManager,368,no
+us,boot,func_80000A30,112,no
+us,boot,func_8000D8B4,732,no
+us,boot,osCreateThread,336,no
+us,boot,func_800059A8,156,no
+us,boot,osViBlack,112,yes
+us,boot,func_80002C74,116,no
+us,boot,func_800055D0,156,yes
+us,boot,func_8000773C,24,no
+us,boot,__osPackEepReadData,140,no
+us,boot,osEepromWrite,376,no
+us,boot,func_80002F54,172,no
+us,boot,osWritebackDCache,128,yes
+us,boot,osDpSetStatus,12,yes
+us,boot,__osSetFpcCsr,16,yes
+us,boot,__osSiRelAccess,44,no
+us,boot,osSpTaskLoad,400,yes
+us,boot,osViSetSpecialFeatures,440,yes
+us,boot,__osGetSR,16,yes
+us,boot,guMtxIdentF,136,yes
+us,boot,func_80007454,140,no
+us,boot,__osPfsGetInitData,208,no
+us,boot,__osViSwapContext,768,no
+us,boot,viMgrMain,400,no
+us,boot,__osContRamReadData,560,no
+us,boot,guMtxF2L,256,yes
+us,boot,func_800056F0,112,no
+us,boot,guPerspectiveF,560,yes
+us,boot,func_80002B0C,172,no
+us,boot,__osSiGetAccess,68,no
+us,boot,guScaleF,84,yes
+us,boot,func_80002A30,52,no
+us,boot,__osCheckPackId,356,no
+us,boot,__osContAddressCrc,208,no
+us,boot,func_80000400,80,yes
+us,boot,osWriteBackDCacheAll,48,yes
+us,boot,__osDequeueThread,64,yes
+us,boot,guPositionF,432,no
diff --git a/progress/progress.global_asm.csv b/progress/progress.global_asm.csv
new file mode 100644
index 00000000..2c644807
--- /dev/null
+++ b/progress/progress.global_asm.csv
@@ -0,0 +1,3303 @@
+version,section,function,length,matching
+us,.code,func_80680908,232,yes
+us,.code,func_806C4414,1264,no
+us,.code,func_8072E5B0,76,yes
+us,.code,func_8069902C,32,yes
+us,.code,func_806436A4,60,yes
+us,.code,func_80688E68,60,yes
+us,.code,func_8071F2F8,200,no
+us,.code,func_806D3608,196,yes
+us,.code,func_80666290,204,yes
+us,.code,func_8071D0F0,368,no
+us,.code,func_8073726C,560,no
+us,.code,func_80651BC0,32,yes
+us,.code,func_8071B8EC,552,no
+us,.code,func_8060B430,108,no
+us,.code,func_8060042C,40,yes
+us,.code,func_8066EB40,16,yes
+us,.code,func_806EDFF8,52,yes
+us,.code,func_8067E764,32,yes
+us,.code,func_80738C6C,180,no
+us,.code,func_805FFFC8,124,yes
+us,.code,func_80652EBC,104,yes
+us,.code,func_80666AEC,12,yes
+us,.code,func_8066BF0C,228,yes
+us,.code,func_80643B24,232,no
+us,.code,func_806ED6B0,2376,no
+us,.code,func_806EB364,156,yes
+us,.code,func_806FA504,160,no
+us,.code,func_806679BC,2916,no
+us,.code,func_806F8CB0,76,yes
+us,.code,func_80679DC4,728,no
+us,.code,func_8068408C,160,yes
+us,.code,func_80724B5C,208,no
+us,.code,func_8073801C,100,no
+us,.code,func_80647170,168,no
+us,.code,func_80697184,160,yes
+us,.code,func_80658DAC,172,no
+us,.code,func_806B513C,416,yes
+us,.code,func_80610C74,344,no
+us,.code,func_8064C134,284,no
+us,.code,func_8067E4D4,60,yes
+us,.code,func_806458C8,412,no
+us,.code,func_8066A584,200,no
+us,.code,func_806688B8,132,no
+us,.code,func_8071B758,324,no
+us,.code,func_80646978,1100,no
+us,.code,func_807105D4,1740,no
+us,.code,func_806E8244,608,no
+us,.code,func_80687EE0,156,no
+us,.code,func_80663BE8,120,no
+us,.code,func_806BF218,1800,no
+us,.code,func_80712548,44,yes
+us,.code,func_80695BAC,1272,no
+us,.code,func_8060956C,1556,no
+us,.code,func_80738320,144,no
+us,.code,func_806EBA04,112,yes
+us,.code,n_alSynNew,1540,no
+us,.code,func_8066D4DC,1636,no
+us,.code,func_8062AC68,192,no
+us,.code,func_80675E3C,164,no
+us,.code,func_80712BD4,776,no
+us,.code,func_8060A900,188,yes
+us,.code,func_8065D964,48,yes
+us,.code,func_806E35D8,220,yes
+us,.code,func_806506E8,172,yes
+us,.code,func_807149B8,16,yes
+us,.code,func_80686CF8,328,no
+us,.code,func_806E6DE8,148,yes
+us,.code,func_8068581C,112,yes
+us,.code,func_805FD030,88,yes
+us,.code,func_806521F8,212,no
+us,.code,func_8063D1D8,176,yes
+us,.code,func_8063D494,16,yes
+us,.code,func_8063BBB0,784,no
+us,.code,func_80650BBC,108,no
+us,.code,func_80605314,108,no
+us,.code,func_806C1CCC,376,yes
+us,.code,func_8062D2AC,68,yes
+us,.code,func_80662110,72,yes
+us,.code,func_80687D50,400,no
+us,.code,func_80672F94,272,no
+us,.code,func_8065D244,16,yes
+us,.code,func_806B91E0,2768,no
+us,.code,func_806A6094,40,yes
+us,.code,func_806335B0,204,no
+us,.code,func_806F8004,364,yes
+us,.code,func_8066FC0C,352,no
+us,.code,func_8066A64C,272,no
+us,.code,func_806951B0,56,yes
+us,.code,func_8069D098,32,yes
+us,.code,func_806A7B4C,36,yes
+us,.code,func_8065C240,244,no
+us,.code,func_806C2D7C,120,yes
+us,.code,func_806C8DE0,120,no
+us,.code,func_806323C0,380,no
+us,.code,func_80698FEC,32,yes
+us,.code,func_806C55D8,8,yes
+us,.code,func_80689114,196,no
+us,.code,func_80714778,460,no
+us,.code,func_806B7830,904,no
+us,.code,func_8068EB3C,440,no
+us,.code,n_alSynDelete,28,yes
+us,.code,func_8071C004,584,no
+us,.code,func_80675380,248,no
+us,.code,func_80732DEC,292,no
+us,.code,func_8067B3F4,56,yes
+us,.code,func_8067BD08,32,yes
+us,.code,func_8060F208,76,no
+us,.code,func_807180F4,48,yes
+us,.code,func_8066DB40,500,no
+us,.code,func_80700088,548,no
+us,.code,func_80695B50,92,yes
+us,.code,func_80677FA8,108,no
+us,.code,func_806734E4,548,no
+us,.code,func_8063E0D4,1248,no
+us,.code,func_806E1BA4,404,no
+us,.code,func_806E93F8,112,yes
+us,.code,func_80719A0C,380,no
+us,.code,func_80668B28,264,no
+us,.code,func_80718124,100,yes
+us,.code,func_8073C820,176,no
+us,.code,func_806E1D38,284,yes
+us,.code,func_806547A8,644,no
+us,.code,func_8073E8A0,20,no
+us,.code,func_806A61D0,96,yes
+us,.code,func_80600950,12,yes
+us,.code,func_80711410,1344,no
+us,.code,func_806D1568,1088,no
+us,.code,func_806E9ACC,112,yes
+us,.code,func_806ACFFC,612,no
+us,.code,func_8060CBBC,1260,no
+us,.code,func_805FF158,16,yes
+us,.code,func_8067AE90,108,yes
+us,.code,func_8065FB04,96,yes
+us,.code,func_8063393C,224,no
+us,.code,func_80674E14,876,no
+us,.code,func_806F14BC,428,no
+us,.code,func_806C71D0,8,yes
+us,.code,func_8065EACC,40,yes
+us,.code,func_805FF018,24,yes
+us,.code,func_806EA2D8,92,yes
+us,.code,func_806CFF9C,436,no
+us,.code,func_8060C2C4,124,yes
+us,.code,func_806B83E4,712,no
+us,.code,func_806F9D8C,1048,no
+us,.code,func_805FF2F4,132,yes
+us,.code,func_806EE634,44,yes
+us,.code,func_8067BE30,284,no
+us,.code,func_807315D4,128,no
+us,.code,func_806BA240,1324,no
+us,.code,func_80601A10,688,no
+us,.code,func_806B3D18,140,yes
+us,.code,func_80632860,1456,no
+us,.code,func_80671E00,340,no
+us,.code,func_806449C0,88,yes
+us,.code,func_807138CC,476,no
+us,.code,func_8060D788,32,yes
+us,.code,func_807002AC,144,no
+us,.code,func_80738230,112,no
+us,.code,func_806FD094,1020,no
+us,.code,func_806E5044,472,yes
+us,.code,func_80737E30,8,yes
+us,.code,func_8060B84C,172,no
+us,.code,func_806EE1C4,168,yes
+us,.code,func_80684D98,648,no
+us,.code,func_8061116C,32,yes
+us,.code,func_80669C6C,72,yes
+us,.code,func_80676ED0,632,no
+us,.code,func_8066EE50,540,no
+us,.code,func_806F9608,100,no
+us,.code,func_806608FC,1084,no
+us,.code,func_806C71D8,8,yes
+us,.code,func_806E88AC,44,yes
+us,.code,func_806EA628,448,no
+us,.code,func_806ACC64,132,yes
+us,.code,func_806D24A8,60,yes
+us,.code,func_806AD9F4,996,yes
+us,.code,func_807095E4,684,no
+us,.code,func_806903BC,180,yes
+us,.code,func_806A63A8,96,yes
+us,.code,func_80653A70,256,yes
+us,.code,func_8069D2AC,172,yes
+us,.code,func_8065F4F4,252,no
+us,.code,areAllKeysTurnedIn,92,yes
+us,.code,func_80666A94,12,yes
+us,.code,func_806349FC,716,no
+us,.code,func_806E34D8,84,yes
+us,.code,func_806438B8,620,no
+us,.code,func_8066CCD8,248,no
+us,.code,func_806D5218,232,yes
+us,.code,func_8064F6C0,56,no
+us,.code,func_8065CE4C,364,no
+us,.code,func_80688A6C,452,no
+us,.code,func_806333F8,376,no
+us,.code,func_8064DE04,344,no
+us,.code,func_8065092C,108,no
+us,.code,func_806B9EB4,636,yes
+us,.code,func_8060193C,124,no
+us,.code,func_8069FDA0,1004,no
+us,.code,func_80652B04,196,yes
+us,.code,func_806E9BA8,308,no
+us,.code,func_8067E278,108,yes
+us,.code,func_806A018C,356,no
+us,.code,func_80726164,844,no
+us,.code,func_80684BB0,488,no
+us,.code,func_806E8AF0,56,yes
+us,.code,func_8060B700,80,yes
+us,.code,func_80704108,40,yes
+us,.code,func_807359A0,148,no
+us,.code,func_8066BD54,140,no
+us,.code,func_80663844,392,yes
+us,.code,func_80731D20,328,no
+us,.code,func_8069D0D8,32,yes
+us,.code,func_80664A38,632,no
+us,.code,func_806EE7F4,132,yes
+us,.code,func_806C7B00,52,yes
+us,.code,func_8064F308,80,yes
+us,.code,func_8063253C,16,yes
+us,.code,func_806FBB9C,152,yes
+us,.code,func_806627CC,108,yes
+us,.code,func_806A3B78,244,no
+us,.code,func_80642C78,444,no
+us,.code,func_80648C50,52,yes
+us,.code,func_80641F70,508,no
+us,.code,func_80629148,44,yes
+us,.code,func_806CF0D0,104,yes
+us,.code,func_80652F9C,64,yes
+us,.code,func_8067BCC8,32,yes
+us,.code,func_80647610,316,no
+us,.code,func_8073A7B8,260,no
+us,.code,func_8071B2EC,352,no
+us,.code,func_806E9CFC,32,yes
+us,.code,func_806EFD50,172,yes
+us,.code,func_80678814,8,yes
+us,.code,func_8060F54C,484,no
+us,.code,func_806F007C,64,yes
+us,.code,func_80725DC0,276,no
+us,.code,func_806FB714,412,no
+us,.code,func_80654418,444,no
+us,.code,func_8072B324,12,yes
+us,.code,func_8069E724,80,no
+us,.code,func_8062B3C4,180,no
+us,.code,func_80737B48,8,yes
+us,.code,func_80668E9C,1772,no
+us,.code,func_80604D70,724,no
+us,.code,func_806F544C,76,yes
+us,.code,func_805FEEB8,76,yes
+us,.code,func_80701CA0,1864,no
+us,.code,func_806A0F78,144,yes
+us,.code,func_80663A0C,116,yes
+us,.code,func_806809F0,4388,no
+us,.code,func_806D79E4,68,yes
+us,.code,func_805FF800,152,yes
+us,.code,func_806A7B04,36,yes
+us,.code,func_80659320,48,yes
+us,.code,func_8072B438,356,no
+us,.code,func_80704130,360,no
+us,.code,func_8070C2D8,696,no
+us,.code,func_80647B74,384,no
+us,.code,func_8071B24C,160,no
+us,.code,func_806D1420,328,yes
+us,.code,func_806D06A0,708,yes
+us,.code,func_80678F9C,116,no
+us,.code,func_8062F538,264,no
+us,.code,func_80630324,120,yes
+us,.code,func_80723380,52,yes
+us,.code,func_80705F5C,1116,no
+us,.code,func_80655CF8,216,no
+us,.code,func_806A62D4,116,yes
+us,.code,func_8066C610,484,no
+us,.code,func_806CD424,1140,no
+us,.code,func_8070AC74,688,no
+us,.code,func_80658134,452,no
+us,.code,func_80723284,52,yes
+us,.code,func_807024E0,3732,no
+us,.code,func_80652A08,252,yes
+us,.code,func_8064BCB0,124,yes
+us,.code,func_806DFF34,108,no
+us,.code,func_806BDEC8,468,yes
+us,.code,func_80654E84,360,no
+us,.code,func_8068C080,52,yes
+us,.code,func_8060A398,312,no
+us,.code,func_80682AB4,832,no
+us,.code,func_806921DC,804,no
+us,.code,func_8064EC04,92,no
+us,.code,func_806BD7B0,1404,no
+us,.code,func_80732444,140,no
+us,.code,func_80699914,68,yes
+us,.code,func_806E67D8,608,yes
+us,.code,func_806710E0,384,no
+us,.code,func_806AE588,2176,no
+us,.code,func_806FDAB8,52,yes
+us,.code,func_8072EE7C,256,no
+us,.code,func_806D374C,128,yes
+us,.code,func_80688638,168,no
+us,.code,func_80724C78,44,yes
+us,.code,func_80610350,1692,no
+us,.code,func_8064B9E0,276,no
+us,.code,func_806F0D68,736,no
+us,.code,func_8060C430,536,no
+us,.code,func_806C6B50,80,yes
+us,.code,func_80726DEC,116,no
+us,.code,func_8072E22C,132,yes
+us,.code,func_807324D0,100,no
+us,.code,func_8070D82C,148,no
+us,.code,func_80659110,128,yes
+us,.code,func_80676220,56,yes
+us,.code,func_80738118,88,no
+us,.code,func_806DED44,780,no
+us,.code,func_8060EC54,44,yes
+us,.code,func_8062BB2C,412,no
+us,.code,func_806A495C,552,no
+us,.code,func_80654BC0,268,no
+us,.code,func_806B3680,1456,no
+us,.code,func_806E4740,920,no
+us,.code,func_8060E930,40,yes
+us,.code,func_80737E38,8,yes
+us,.code,func_8063A38C,1212,no
+us,.code,func_806338B4,64,no
+us,.code,func_8063B8D8,728,no
+us,.code,func_806644B0,264,no
+us,.code,func_8063D9D0,112,no
+us,.code,func_806FDB8C,912,no
+us,.code,func_80665AAC,32,no
+us,.code,func_8068A764,32,no
+us,.code,func_8070B324,1224,no
+us,.code,func_8060BEA8,220,no
+us,.code,func_806FA1A4,864,no
+us,.code,func_8067BF84,820,no
+us,.code,func_806B1DD4,212,yes
+us,.code,func_806A2B08,24,yes
+us,.code,func_80664044,348,no
+us,.code,func_8071458C,108,yes
+us,.code,func_806D6F0C,88,yes
+us,.code,func_806CE928,540,no
+us,.code,func_80666AA0,12,yes
+us,.code,func_8062D094,56,yes
+us,.code,func_80669CB4,336,no
+us,.code,func_807195D4,480,no
+us,.code,func_8070CC54,56,yes
+us,.code,func_8072DAA4,196,yes
+us,.code,func_8065FD88,304,no
+us,.code,func_8072881C,308,no
+us,.code,func_806998F0,36,yes
+us,.code,func_8064C250,408,no
+us,.code,func_806D9184,32,yes
+us,.code,func_806EBF34,64,yes
+us,.code,func_8067BF4C,56,yes
+us,.code,func_8067DCC0,644,no
+us,.code,func_8064A194,196,no
+us,.code,func_80740100,1704,no
+us,.code,func_8070E8F0,2520,no
+us,.code,func_8070E8DC,16,yes
+us,.code,func_806DABE4,444,yes
+us,.code,func_806EC014,48,yes
+us,.code,func_8068ECF4,608,no
+us,.code,func_8067BC88,32,yes
+us,.code,func_8069904C,32,yes
+us,.code,func_8066AEE4,92,yes
+us,.code,func_806689F0,312,no
+us,.code,func_80636C00,312,no
+us,.code,func_8064B7C0,20,yes
+us,.code,func_805FF5A0,136,yes
+us,.code,func_806EE74C,108,yes
+us,.code,func_806A7518,232,yes
+us,.code,func_807383B0,60,no
+us,.code,func_807146A4,60,no
+us,.code,func_8073B9B0,176,no
+us,.code,func_80688EA4,64,yes
+us,.code,func_80688D20,232,no
+us,.code,func_806C498C,68,yes
+us,.code,func_806EA7E8,92,yes
+us,.code,func_80627B58,172,yes
+us,.code,func_80671528,724,no
+us,.code,func_806010A0,128,yes
+us,.code,func_806C13AC,368,no
+us,.code,func_8064B150,64,no
+us,.code,func_806D9D58,632,no
+us,.code,func_80712798,28,yes
+us,.code,func_80737C20,212,no
+us,.code,func_80685520,488,yes
+us,.code,func_8067ACC0,28,yes
+us,.code,func_80723C98,52,yes
+us,.code,func_8067B288,8,yes
+us,.code,func_8071375C,8,yes
+us,.code,func_8071268C,36,yes
+us,.code,func_806C4948,68,yes
+us,.code,func_8069DC80,192,no
+us,.code,func_8072E54C,100,no
+us,.code,func_806330C4,820,no
+us,.code,func_806641A0,548,no
+us,.code,func_80665E48,76,no
+us,.code,func_806645B8,100,no
+us,.code,func_80639FC0,972,no
+us,.code,func_8070CDD0,592,no
+us,.code,func_806E8F68,264,yes
+us,.code,func_806E6234,228,yes
+us,.code,func_80662AB4,220,no
+us,.code,func_80657974,828,no
+us,.code,func_80652374,300,no
+us,.code,func_80666AF8,656,no
+us,.code,func_806DA7EC,176,yes
+us,.code,func_8060A7C0,320,no
+us,.code,func_806D9AD4,644,no
+us,.code,func_806C49D0,244,yes
+us,.code,func_806D6F64,308,no
+us,.code,func_806E9DE0,236,no
+us,.code,func_8069DA54,444,no
+us,.code,func_805FF188,40,yes
+us,.code,func_806E2DE8,132,yes
+us,.code,func_806D0150,92,yes
+us,.code,func_8062AD28,1132,no
+us,.code,func_806C7240,8,yes
+us,.code,func_80715E94,4220,no
+us,.code,func_80654A2C,404,no
+us,.code,func_8060F254,760,no
+us,.code,func_8071338C,172,no
+us,.code,func_8070B05C,684,no
+us,.code,func_806686F4,236,no
+us,.code,func_80712944,252,no
+us,.code,func_806F6204,848,no
+us,.code,func_8063039C,40,yes
+us,.code,func_806C9D20,92,yes
+us,.code,func_806E98F8,108,yes
+us,.code,func_80677D58,36,yes
+us,.code,func_806348B4,84,no
+us,.code,func_806AD84C,352,yes
+us,.code,func_806951E8,1340,no
+us,.code,func_8068B8FC,52,no
+us,.code,func_806DF050,336,yes
+us,.code,func_8071D260,44,no
+us,.code,func_8060E430,120,yes
+us,.code,func_8062B194,140,yes
+us,.code,func_8069B010,1004,no
+us,.code,func_806FDA8C,44,yes
+us,.code,func_806F1048,160,yes
+us,.code,func_80723484,1104,no
+us,.code,func_8068086C,156,yes
+us,.code,func_8060866C,96,yes
+us,.code,func_8064F1C4,76,yes
+us,.code,func_8066B5C8,44,yes
+us,.code,func_80690F30,1664,no
+us,.code,func_807278C0,152,no
+us,.code,func_80665AE4,308,no
+us,.code,func_80676C10,84,no
+us,.code,func_8066E6C8,100,yes
+us,.code,func_80659190,12,yes
+us,.code,func_8066EAEC,84,no
+us,.code,func_8064F404,64,yes
+us,.code,func_806EFA3C,272,no
+us,.code,func_8063CA7C,96,yes
+us,.code,func_8060EE60,880,no
+us,.code,func_80690470,144,no
+us,.code,func_8068A10C,12,yes
+us,.code,func_806FB914,580,no
+us,.code,func_80690BE8,120,yes
+us,.code,func_8063C248,96,yes
+us,.code,func_8070C89C,88,yes
+us,.code,func_806A1F28,60,yes
+us,.code,func_80657508,100,yes
+us,.code,func_806E8E00,120,yes
+us,.code,func_806C7248,8,yes
+us,.code,func_806E5E68,64,yes
+us,.code,func_80672CBC,424,no
+us,.code,func_8066F4AC,928,no
+us,.code,func_8064DF5C,536,no
+us,.code,func_806F0930,184,yes
+us,.code,func_8064A804,704,no
+us,.code,func_8066A988,648,no
+us,.code,func_806C9F00,68,yes
+us,.code,func_806A2B20,24,yes
+us,.code,func_8070E2AC,160,no
+us,.code,func_8068450C,32,yes
+us,.code,func_8064BFD0,356,no
+us,.code,func_806EE700,76,yes
+us,.code,func_80674B90,644,no
+us,.code,func_807130D4,148,yes
+us,.code,func_80650D04,136,no
+us,.code,func_8063C2A8,128,no
+us,.code,func_80689EA4,64,yes
+us,.code,func_80676B38,56,yes
+us,.code,func_806E04E0,372,yes
+us,.code,func_80707980,2524,no
+us,.code,func_806858E8,156,no
+us,.code,func_806B11C0,208,yes
+us,.code,func_8072ECFC,148,no
+us,.code,func_8068EF54,2008,no
+us,.code,func_8068842C,52,yes
+us,.code,func_80677ED0,216,no
+us,.code,func_806D3D5C,136,yes
+us,.code,func_806A3E9C,1000,no
+us,.code,func_806C8E58,144,no
+us,.code,func_8071F444,540,no
+us,.code,func_80732B3C,580,no
+us,.code,func_8064431C,200,no
+us,.code,func_80692500,32,yes
+us,.code,func_8070D464,260,no
+us,.code,func_80674688,132,no
+us,.code,func_806634A4,240,no
+us,.code,func_80665C18,456,no
+us,.code,func_806DC3A4,108,yes
+us,.code,func_806BE674,124,yes
+us,.code,func_806FD7A8,236,no
+us,.code,func_806E9ECC,192,no
+us,.code,func_806FD8E0,112,no
+us,.code,func_8066CDD0,40,yes
+us,.code,func_806E5E60,8,yes
+us,.code,func_806621D0,508,no
+us,.code,func_8069B3FC,1120,no
+us,.code,func_807273A8,388,no
+us,.code,func_8068ABE0,412,no
+us,.code,func_806E52D0,440,no
+us,.code,func_806E8B28,124,yes
+us,.code,func_80608528,180,no
+us,.code,func_806877C8,68,yes
+us,.code,func_8073CAC0,468,no
+us,.code,func_806663F8,36,yes
+us,.code,func_8073198C,76,no
+us,.code,func_806AD9AC,72,yes
+us,.code,func_8065756C,100,yes
+us,.code,func_806F9B64,364,no
+us,.code,func_80702464,124,no
+us,.code,func_806836D0,944,no
+us,.code,func_806767E0,44,yes
+us,.code,func_8060B750,116,yes
+us,.code,func_80731B60,40,yes
+us,.code,func_8067ACDC,216,yes
+us,.code,func_80729B00,876,no
+us,.code,func_80645614,236,yes
+us,.code,func_806D0EBC,452,yes
+us,.code,func_806E61D0,100,no
+us,.code,func_8065E0CC,88,yes
+us,.code,func_8072E7DC,140,no
+us,.code,func_80672680,92,yes
+us,.code,func_80636074,240,no
+us,.code,func_806767B4,44,yes
+us,.code,func_806D9FD0,848,no
+us,.code,func_806FBEF0,1600,no
+us,.code,func_806C71B8,8,yes
+us,.code,func_8066E2C0,780,no
+us,.code,func_806E4C6C,168,no
+us,.code,func_8066D250,164,no
+us,.code,func_80658C10,188,no
+us,.code,func_80659620,80,yes
+us,.code,func_8065E040,140,yes
+us,.code,func_8065EFF0,324,no
+us,.code,func_806ABA6C,300,no
+us,.code,func_80692588,36,yes
+us,.code,func_8073F328,740,no
+us,.code,func_806F142C,112,yes
+us,.code,func_8063CE64,168,yes
+us,.code,func_80728300,1308,no
+us,.code,func_8066ACA4,252,no
+us,.code,func_806419F8,128,no
+us,.code,func_8060A9BC,72,no
+us,.code,func_806A4DDC,920,no
+us,.code,func_8069E040,72,yes
+us,.code,func_8064216C,152,yes
+us,.code,func_80635588,84,yes
+us,.code,func_80653684,384,yes
+us,.code,func_80687474,120,yes
+us,.code,func_806D2C54,88,yes
+us,.code,func_80636380,188,no
+us,.code,func_8062D0CC,220,no
+us,.code,func_806019B8,88,no
+us,.code,func_806F9CD0,188,no
+us,.code,func_80676A0C,100,no
+us,.code,func_806E41B4,56,yes
+us,.code,func_8065E81C,552,no
+us,.code,func_80697988,868,no
+us,.code,func_8062F318,16,yes
+us,.code,func_8063A848,124,no
+us,.code,func_806E380C,32,yes
+us,.code,func_806AD260,748,no
+us,.code,func_806D28E4,32,yes
+us,.code,func_806DF494,268,no
+us,.code,func_805FE634,232,no
+us,.code,func_80652BC8,492,yes
+us,.code,func_806E2FE8,88,yes
+us,.code,func_8064BD2C,300,no
+us,.code,func_80712F10,184,yes
+us,.code,func_806F37BC,176,no
+us,.code,func_80674884,472,no
+us,.code,func_8072334C,52,yes
+us,.code,func_8072B330,264,yes
+us,.code,func_806F7FD0,52,yes
+us,.code,func_806B4904,84,yes
+us,.code,func_806FFEAC,176,no
+us,.code,func_806CEC04,608,no
+us,.code,func_806D3224,156,no
+us,.code,func_80697CEC,1076,no
+us,.code,func_8061159C,12,yes
+us,.code,func_80715270,1532,no
+us,.code,func_806F00BC,144,yes
+us,.code,func_806CC8B8,56,yes
+us,.code,func_806E2E6C,60,yes
+us,.code,func_806EAE04,92,yes
+us,.code,func_8071509C,468,no
+us,.code,func_80738BA0,8,yes
+us,.code,func_806CEFBC,276,no
+us,.code,func_8073749C,324,no
+us,.code,func_80650998,108,no
+us,.code,func_806A0310,32,yes
+us,.code,func_8073B750,224,no
+us,.code,func_8071EDEC,184,no
+us,.code,func_8062F388,24,yes
+us,.code,func_8067E348,136,yes
+us,.code,func_806E0050,44,yes
+us,.code,func_806C28B8,428,no
+us,.code,func_80673A94,228,no
+us,.code,func_806A05D4,40,yes
+us,.code,func_8064BF58,120,yes
+us,.code,func_806D2DC4,216,no
+us,.code,func_8066EA64,44,yes
+us,.code,func_8062BAE4,72,yes
+us,.code,func_806D5834,432,no
+us,.code,func_806013A0,72,yes
+us,.code,func_806D0A84,864,no
+us,.code,func_806D9134,80,yes
+us,.code,func_8072A714,200,yes
+us,.code,func_8072A7DC,144,yes
+us,.code,func_8063DB3C,156,yes
+us,.code,func_8070E808,192,no
+us,.code,func_806D03BC,76,yes
+us,.code,func_806EFC38,280,yes
+us,.code,func_80602E6C,1236,no
+us,.code,func_806B5A90,2384,no
+us,.code,func_80689F2C,84,no
+us,.code,func_806AFB58,1940,no
+us,.code,func_806E5D60,248,yes
+us,.code,func_806A02F0,32,yes
+us,.code,func_80654380,152,no
+us,.code,func_8070A220,1576,no
+us,.code,func_8070CD14,48,yes
+us,.code,func_806AB808,612,no
+us,.code,func_80667174,12,yes
+us,.code,func_8064F028,412,yes
+us,.code,func_806D7704,372,no
+us,.code,func_80678428,48,yes
+us,.code,func_8062FBC8,840,no
+us,.code,func_80649BF0,388,no
+us,.code,func_806D3FA0,112,yes
+us,.code,func_806ECAC4,272,no
+us,.code,func_80738BA8,8,yes
+us,.code,func_80725B38,108,no
+us,.code,func_806EAFEC,8,yes
+us,.code,func_80738470,384,no
+us,.code,func_806F1378,8,yes
+us,.code,func_80610DCC,184,no
+us,.code,func_8070D8C0,104,no
+us,.code,func_80643274,224,no
+us,.code,func_80680774,248,yes
+us,.code,func_8064FB64,1404,no
+us,.code,func_806C7C94,172,no
+us,.code,func_8070CB2C,120,yes
+us,.code,func_80659350,120,no
+us,.code,func_80688460,44,yes
+us,.code,func_806018B4,32,yes
+us,.code,playSong,204,no
+us,.code,func_806761EC,28,yes
+us,.code,func_8067E3D0,108,yes
+us,.code,func_806E64D0,236,yes
+us,.code,func_806487C4,1164,no
+us,.code,func_80681E18,1252,no
+us,.code,func_806F54E0,960,no
+us,.code,func_806CC14C,68,yes
+us,.code,func_806F9518,176,no
+us,.code,func_806FF32C,44,yes
+us,.code,func_8064D418,1128,no
+us,.code,func_8068A4C8,64,yes
+us,.code,func_80663040,76,yes
+us,.code,func_80706F90,1916,no
+us,.code,func_8073AD50,828,no
+us,.code,func_80672AFC,32,yes
+us,.code,func_806C4AC4,968,no
+us,.code,func_8060E7EC,224,yes
+us,.code,func_80657CB0,372,no
+us,.code,func_80684A00,432,yes
+us,.code,func_806874EC,732,no
+us,.code,func_8060FA5C,72,no
+us,.code,func_80714944,12,yes
+us,.code,func_8068A24C,88,yes
+us,.code,func_806E9388,112,yes
+us,.code,func_80653B70,16,yes
+us,.code,func_806D8A64,164,yes
+us,.code,func_8062E608,116,yes
+us,.code,func_806612B4,76,yes
+us,.code,func_8071E028,232,no
+us,.code,func_806D2CAC,140,yes
+us,.code,func_8060E980,168,yes
+us,.code,func_80611690,80,no
+us,.code,func_806EA8FC,92,yes
+us,.code,func_806D1DEC,164,yes
+us,.code,func_80730E18,536,no
+us,.code,func_8066BECC,64,yes
+us,.code,func_80636D38,452,no
+us,.code,func_806FAB20,324,no
+us,.code,func_80672C70,76,yes
+us,.code,func_806D3AC8,32,yes
+us,.code,func_806DE9F4,176,yes
+us,.code,func_80717DB4,360,no
+us,.code,func_805FF938,116,yes
+us,.code,func_806F0B34,228,yes
+us,.code,func_806F9470,60,yes
+us,.code,func_8068A1B8,20,yes
+us,.code,func_8065F678,748,no
+us,.code,func_806A2E30,2244,no
+us,.code,func_8065A648,12,yes
+us,.code,func_80714A68,52,yes
+us,.code,func_8068D8C8,276,no
+us,.code,func_8064F804,72,yes
+us,.code,func_8073B640,112,no
+us,.code,func_8073CF00,176,no
+us,.code,func_80662B90,1200,no
+us,.code,func_806D281C,200,yes
+us,.code,func_806F4F50,376,no
+us,.code,func_806EBDC4,200,yes
+us,.code,func_80664CB0,112,no
+us,.code,func_807102AC,308,no
+us,.code,func_806D332C,392,no
+us,.code,func_8071498C,12,yes
+us,.code,func_8071DC90,920,no
+us,.code,func_805FF628,56,yes
+us,.code,func_80724308,720,no
+us,.code,func_80685390,400,no
+us,.code,func_806CEE64,116,yes
+us,.code,func_8066BA2C,140,no
+us,.code,func_8060151C,196,yes
+us,.code,func_806022DC,56,no
+us,.code,func_8071E3EC,1144,no
+us,.code,func_8063524C,540,no
+us,.code,func_8062CEA8,492,no
+us,.code,func_80737A74,40,no
+us,.code,func_806C7BAC,100,yes
+us,.code,func_8072EE0C,112,no
+us,.code,func_806CA26C,64,yes
+us,.code,func_8064DB98,620,no
+us,.code,func_806A92B4,3560,no
+us,.code,func_80674150,368,no
+us,.code,func_806ACF10,236,no
+us,.code,func_806DECD4,112,yes
+us,.code,func_806F0624,128,yes
+us,.code,func_8071AF30,636,no
+us,.code,func_806CBE90,636,yes
+us,.code,func_80735A50,80,no
+us,.code,func_806EE454,336,yes
+us,.code,func_80605044,720,no
+us,.code,func_806ADFE0,720,no
+us,.code,func_8063EA14,4148,no
+us,.code,func_806E6B98,592,no
+us,.code,func_8060BF84,832,no
+us,.code,func_8064B900,224,yes
+us,.code,func_806EB5C8,272,no
+us,.code,func_806496B0,1344,no
+us,.code,func_806A664C,1896,no
+us,.code,func_806017E8,96,yes
+us,.code,func_8070C9E8,68,yes
+us,.code,func_8070D654,132,no
+us,.code,func_806A5FA4,96,yes
+us,.code,func_806ECF1C,128,yes
+us,.code,func_806D3DE4,444,yes
+us,.code,func_806D4758,452,no
+us,.code,func_806765E8,168,yes
+us,.code,func_806ECF9C,180,yes
+us,.code,func_80728950,96,yes
+us,.code,func_806C9EA0,48,yes
+us,.code,func_806EC044,356,yes
+us,.code,func_80687C48,128,yes
+us,.code,func_80724D28,136,no
+us,.code,func_8073CC94,316,no
+us,.code,func_806907F0,36,yes
+us,.code,func_806766E0,80,yes
+us,.code,func_80705B14,28,yes
+us,.code,func_8064CC80,188,no
+us,.code,func_80678E14,88,yes
+us,.code,func_8060E128,128,no
+us,.code,func_807145F8,16,yes
+us,.code,func_8064F450,624,no
+us,.code,func_80666AC4,28,yes
+us,.code,func_8064B2AC,196,no
+us,.code,func_806FA5A4,512,no
+us,.code,gameIsInQuitGameMode,84,yes
+us,.code,func_806E0694,84,yes
+us,.code,func_8063B4A4,28,yes
+us,.code,func_806592B4,108,no
+us,.code,func_806F2754,748,no
+us,.code,func_806368F0,340,no
+us,.code,func_807319D8,44,yes
+us,.code,func_80690500,696,no
+us,.code,func_806F6E58,132,yes
+us,.code,func_80678CC8,272,no
+us,.code,func_806D4010,556,yes
+us,.code,func_8072F230,632,no
+us,.code,func_80689BAC,116,yes
+us,.code,func_8069EF50,208,yes
+us,.code,func_80735DBC,4604,no
+us,.code,func_807381D8,88,no
+us,.code,func_806787EC,8,yes
+us,.code,func_806F8CFC,92,yes
+us,.code,func_806AC07C,2572,no
+us,.code,func_806307CC,196,yes
+us,.code,func_806C7210,8,yes
+us,.code,func_806E84C0,56,yes
+us,.code,func_8062C29C,1792,no
+us,.code,func_806443E4,1500,no
+us,.code,func_8066BDE0,64,yes
+us,.code,func_80651BE0,76,no
+us,.code,func_80610A88,252,no
+us,.code,func_806D6558,1100,no
+us,.code,func_80630300,36,yes
+us,.code,func_8063C3C0,88,yes
+us,.code,func_806FFC04,680,no
+us,.code,func_806F3190,1488,no
+us,.code,func_8072FDD4,140,no
+us,.code,func_80600174,460,no
+us,.code,func_806F5EB4,120,no
+us,.code,func_80683A80,88,no
+us,.code,func_806F1AE0,120,yes
+us,.code,func_80675D70,96,no
+us,.code,func_806E78F8,8,yes
+us,.code,func_807124B8,108,yes
+us,.code,func_8073A98C,232,no
+us,.code,func_80642500,252,no
+us,.code,func_80701C90,16,yes
+us,.code,func_80704960,412,no
+us,.code,func_8062BA0C,104,yes
+us,.code,func_806791DC,16,yes
+us,.code,func_8060C758,216,no
+us,.code,func_806A3DA0,252,no
+us,.code,func_80637B6C,5968,no
+us,.code,func_806EC1A8,292,yes
+us,.code,func_806CC10C,64,yes
+us,.code,func_8071CDE0,784,no
+us,.code,getPointerTableFile,812,no
+us,.code,func_8073DA30,1312,no
+us,.code,func_80611614,116,no
+us,.code,func_806015E0,152,yes
+us,.code,func_80661AB4,208,no
+us,.code,func_8068848C,44,yes
+us,.code,func_806D7E88,192,yes
+us,.code,func_80602104,64,no
+us,.code,func_8070C808,148,no
+us,.code,func_80634EDC,56,yes
+us,.code,func_80740F48,296,no
+us,.code,func_8072B608,404,no
+us,.code,func_8071A674,572,no
+us,.code,func_80723CCC,700,no
+us,.code,func_806C7218,8,yes
+us,.code,func_806844EC,32,yes
+us,.code,func_80735CF4,200,no
+us,.code,func_8068E7B4,508,no
+us,.code,func_8071495C,16,yes
+us,.code,func_806C9DE0,48,yes
+us,.code,func_806EE26C,76,yes
+us,.code,func_8069329C,464,no
+us,.code,func_80712524,36,yes
+us,.code,func_80632084,828,no
+us,.code,func_8067C6DC,32,yes
+us,.code,func_806C8984,924,no
+us,.code,func_8064BAF4,88,no
+us,.code,func_8066F400,172,yes
+us,.code,func_80708DA4,1440,no
+us,.code,func_806787F4,8,yes
+us,.code,func_8070F2C8,52,yes
+us,.code,func_806FAC64,132,yes
+us,.code,func_806F79E0,1520,no
+us,.code,func_806F3760,92,yes
+us,.code,func_8068EA38,260,no
+us,.code,func_8073B5D0,112,no
+us,.code,func_8070DA74,264,no
+us,.code,func_80635214,56,no
+us,.code,func_8072FA14,688,no
+us,.code,func_80735624,576,no
+us,.code,func_80631B80,12,yes
+us,.code,func_8060AA04,84,no
+us,.code,func_8062B8E4,296,no
+us,.code,func_80676308,48,yes
+us,.code,func_806A370C,1132,no
+us,.code,func_8066BAB8,140,no
+us,.code,func_8070DED4,984,no
+us,.code,func_80676CB0,80,no
+us,.code,func_80653F68,60,yes
+us,.code,func_8065A6F8,16,yes
+us,.code,func_80673708,456,no
+us,.code,func_8068A404,196,no
+us,.code,func_806E0454,140,yes
+us,.code,func_80688C30,84,yes
+us,.code,func_806B6600,856,no
+us,.code,func_8064C9F8,324,no
+us,.code,func_8061118C,48,no
+us,.code,func_8063DA78,148,no
+us,.code,func_806B42A8,1476,no
+us,.code,func_8066DD34,1256,no
+us,.code,playerCanThrowOrange,292,yes
+us,.code,func_8071F1D0,296,no
+us,.code,func_80714670,52,yes
+us,.code,func_8066FD6C,156,no
+us,.code,func_806A6348,96,yes
+us,.code,func_806CA5F8,3908,no
+us,.code,func_80732730,196,no
+us,.code,func_806782C0,40,yes
+us,.code,func_8064D880,248,no
+us,.code,func_80673324,448,no
+us,.code,func_80672A70,140,yes
+us,.code,func_806CCC54,2000,no
+us,.code,func_8060C724,52,yes
+us,.code,func_80652FDC,476,no
+us,.code,func_806EF830,276,yes
+us,.code,func_807245F0,644,no
+us,.code,func_807280C8,196,no
+us,.code,func_8071C9E8,1016,no
+us,.code,func_806B52DC,480,yes
+us,.code,func_80686340,80,yes
+us,.code,func_8062BF24,668,no
+us,.code,func_80724DB0,152,no
+us,.code,func_80712574,168,no
+us,.code,func_805FBC5C,424,no
+us,.code,func_80665F24,144,no
+us,.code,func_806CFE30,76,yes
+us,.code,func_806F5FA0,72,yes
+us,.code,func_80641A78,136,yes
+us,.code,func_8062D26C,64,no
+us,.code,func_8062B660,480,no
+us,.code,func_806BB874,2060,no
+us,.code,func_806D428C,792,yes
+us,.code,func_806BA93C,2544,no
+us,.code,func_80665E94,144,yes
+us,.code,func_80714C08,184,yes
+us,.code,func_806A7B28,36,yes
+us,.code,func_806EA5CC,52,yes
+us,.code,func_8060D768,32,yes
+us,.code,func_8067443C,108,no
+us,.code,func_8060AB48,224,no
+us,.code,func_80661398,80,yes
+us,.code,func_8071F078,344,no
+us,.code,func_80629190,12,yes
+us,.code,func_8068DC54,2080,no
+us,.code,func_806D266C,108,yes
+us,.code,func_8068B830,116,no
+us,.code,func_80708C24,384,no
+us,.code,func_806317D4,496,no
+us,.code,func_807255A8,1424,no
+us,.code,func_806362C4,188,no
+us,.code,func_80673A40,84,no
+us,.code,func_806625D0,72,yes
+us,.code,func_8073E8C0,2340,no
+us,.code,func_806594C8,124,yes
+us,.code,func_8072C870,168,yes
+us,.code,func_8060BCA0,520,no
+us,.code,func_806FD9A0,20,yes
+us,.code,func_80672E6C,32,yes
+us,.code,func_8070D07C,644,no
+us,.code,func_806D57F0,68,yes
+us,.code,func_80665548,16,yes
+us,.code,func_806B3DA4,100,yes
+us,.code,func_8064E48C,108,no
+us,.code,func_806B48B8,76,yes
+us,.code,func_8064D978,544,no
+us,.code,func_80645F40,280,no
+us,.code,func_80724CA4,132,no
+us,.code,func_8073C948,120,no
+us,.code,func_80676A70,72,yes
+us,.code,func_806B3E7C,192,yes
+us,.code,func_80713270,108,yes
+us,.code,func_8071C818,252,no
+us,.code,func_80737E50,64,no
+us,.code,func_80658930,472,no
+us,.code,func_8060FAE4,1292,no
+us,.code,func_8060D7A8,1172,yes
+us,.code,func_8070DCA4,116,no
+us,.code,func_80670C5C,680,no
+us,.code,func_806F1768,240,no
+us,.code,func_80737B2C,28,no
+us,.code,func_80665FB4,220,no
+us,.code,func_80673B78,188,no
+us,.code,func_806D0378,68,yes
+us,.code,func_806D61B8,928,no
+us,.code,func_8072707C,68,yes
+us,.code,func_80732924,8,yes
+us,.code,func_8071910C,1224,no
+us,.code,func_8067457C,268,no
+us,.code,func_8065A570,216,yes
+us,.code,func_806C71B0,8,yes
+us,.code,func_80689F80,108,yes
+us,.code,func_8064F2F0,24,yes
+us,.code,func_8071BE04,512,no
+us,.code,func_8060F1D0,56,yes
+us,.code,func_8060DEA8,32,yes
+us,.code,func_80688CC4,48,no
+us,.code,func_805FF4D8,108,yes
+us,.code,func_806E9070,284,no
+us,.code,func_806526E0,176,yes
+us,.code,func_80668C30,620,no
+us,.code,func_806291A8,12,yes
+us,.code,func_806E341C,188,no
+us,.code,func_8065214C,172,no
+us,.code,func_806E007C,252,yes
+us,.code,func_806CFE7C,40,yes
+us,.code,func_8073A690,296,no
+us,.code,func_8064F6F8,268,no
+us,.code,func_80710174,312,no
+us,.code,func_806F09F0,324,no
+us,.code,func_806E8E78,140,yes
+us,.code,func_8066A08C,1272,no
+us,.code,func_80676338,228,no
+us,.code,func_8072EC94,104,no
+us,.code,func_80676788,44,yes
+us,.code,func_80634D64,172,yes
+us,.code,func_806533C4,284,no
+us,.code,func_80712EDC,52,yes
+us,.code,func_806C9974,364,no
+us,.code,func_8067B2A8,8,yes
+us,.code,func_80672630,80,yes
+us,.code,func_806A36F4,8,yes
+us,.code,func_8071A440,564,no
+us,.code,func_80647CF4,136,yes
+us,.code,func_8060B8F8,112,yes
+us,.code,func_8066AC10,148,no
+us,.code,func_806E1864,8,yes
+us,.code,func_806DB0C4,744,no
+us,.code,func_80738BB0,8,yes
+us,.code,func_806F70A8,84,yes
+us,.code,func_80738E58,576,no
+us,.code,func_806FDF54,292,no
+us,.code,func_806F18F4,156,no
+us,.code,func_806B0770,216,no
+us,.code,func_806B86AC,460,no
+us,.code,func_806F5A48,488,no
+us,.code,func_80724E48,1888,no
+us,.code,func_8068C2F8,88,yes
+us,.code,func_80661440,68,yes
+us,.code,func_806FB488,8,yes
+us,.code,func_8069E5B8,168,yes
+us,.code,func_806C9C1C,100,yes
+us,.code,func_806B8B20,188,yes
+us,.code,func_80709464,96,yes
+us,.code,func_8063C450,88,yes
+us,.code,func_806B4958,88,yes
+us,.code,func_8067BC68,32,yes
+us,.code,func_8069D0B8,32,yes
+us,.code,func_806C1300,172,yes
+us,.code,func_806EB544,132,yes
+us,.code,func_8064B798,40,no
+us,.code,func_807127F4,60,yes
+us,.code,func_8064C814,484,no
+us,.code,func_8066164C,12,yes
+us,.code,func_806DF280,272,yes
+us,.code,func_806D1E90,152,yes
+us,.code,func_806355DC,540,no
+us,.code,func_806CC5DC,92,yes
+us,.code,func_80679334,348,no
+us,.code,func_8069D078,32,yes
+us,.code,func_806E63B8,280,yes
+us,.code,func_8073AA74,140,no
+us,.code,func_806BF920,364,no
+us,.code,func_805FD088,4880,no
+us,.code,func_80687FC8,788,no
+us,.code,func_80699284,1604,no
+us,.code,func_8069B85C,172,no
+us,.code,func_80733B88,172,no
+us,.code,func_806A615C,116,yes
+us,.code,func_806D4C7C,360,no
+us,.code,func_806907E0,16,yes
+us,.code,func_806FB480,8,yes
+us,.code,func_80603340,272,no
+us,.code,func_80688CF4,44,no
+us,.code,func_8062D1A8,56,yes
+us,.code,func_806B7EA0,1348,no
+us,.code,func_8068D264,1636,no
+us,.code,func_806C151C,204,yes
+us,.code,func_80737F38,8,yes
+us,.code,func_80676208,24,yes
+us,.code,func_80739098,500,no
+us,.code,func_80601484,152,yes
+us,.code,func_806109EC,156,no
+us,.code,func_80652858,292,yes
+us,.code,func_8072FE60,604,no
+us,.code,func_80738BB8,180,no
+us,.code,func_806E7568,240,yes
+us,.code,func_806B3420,608,yes
+us,.code,func_80641DA0,456,no
+us,.code,func_8062E898,800,no
+us,.code,func_8068DAF4,176,no
+us,.code,func_8070CD8C,68,yes
+us,.code,func_8060A4D0,48,yes
+us,.code,func_806D205C,392,no
+us,.code,func_806FF01C,296,no
+us,.code,func_80715E38,92,yes
+us,.code,func_80657F14,236,no
+us,.code,func_806C15E8,88,yes
+us,.code,func_806898A8,80,yes
+us,.code,isIntroStoryPlaying,12,yes
+us,.code,func_80718BF4,1304,no
+us,.code,func_8066C904,84,no
+us,.code,func_80708BB8,108,yes
+us,.code,func_8068F72C,2068,no
+us,.code,func_80602488,16,yes
+us,.code,func_806C9F74,100,yes
+us,.code,func_80679200,144,no
+us,.code,func_806E7658,180,yes
+us,.code,func_807370A4,244,no
+us,.code,func_8073A130,372,no
+us,.code,func_806A2A10,248,no
+us,.code,func_806726DC,532,yes
+us,.code,func_806DF390,64,yes
+us,.code,func_806F22A8,1196,no
+us,.code,func_8060E958,40,yes
+us,.code,func_8064409C,640,no
+us,.code,func_8072E868,552,no
+us,.code,func_806F5F2C,116,yes
+us,.code,func_807289E8,4284,no
+us,.code,func_8066E5F8,52,yes
+us,.code,func_806EB2B8,172,yes
+us,.code,func_806F5D80,120,yes
+us,.code,func_8060EC80,236,no
+us,.code,func_806D3B48,128,yes
+us,.code,func_806F0344,128,yes
+us,.code,func_8063E6B4,120,no
+us,.code,func_80686A5C,668,no
+us,.code,func_80653804,620,no
+us,.code,func_806011A0,52,yes
+us,.code,func_806DAADC,264,yes
+us,.code,func_806ED244,476,no
+us,.code,func_80634D14,80,yes
+us,.code,func_80678824,120,no
+us,.code,func_806F58A0,424,no
+us,.code,func_8072F8D4,320,yes
+us,.code,func_80669E04,648,no
+us,.code,func_806E03C8,140,yes
+us,.code,func_806DADA0,444,yes
+us,.code,func_8071A038,428,no
+us,.code,func_8062FF10,1008,no
+us,.code,func_806852C4,204,yes
+us,.code,func_80687F7C,76,yes
+us,.code,func_8063367C,192,no
+us,.code,func_805FB5C4,396,no
+us,.code,func_80717F1C,356,no
+us,.code,func_80633D30,144,no
+us,.code,func_8073C8D0,120,no
+us,.code,func_80666428,1632,no
+us,.code,func_806AA09C,616,no
+us,.code,func_806EBC60,144,yes
+us,.code,func_8066D2F4,488,no
+us,.code,func_807383EC,8,yes
+us,.code,func_806E8DB4,76,yes
+us,.code,func_806A8158,4044,no
+us,.code,func_806A80C0,152,yes
+us,.code,func_8066E8E4,172,no
+us,.code,func_8066CB88,336,no
+us,.code,func_807040E0,40,yes
+us,.code,func_8070E8C8,20,yes
+us,.code,func_8065051C,48,yes
+us,.code,func_805FE71C,152,no
+us,.code,func_806C9658,108,yes
+us,.code,func_8060FFF0,84,no
+us,.code,func_8067B2A0,8,yes
+us,.code,func_806AFA60,248,no
+us,.code,func_807329AC,400,no
+us,.code,func_806DB08C,56,yes
+us,.code,__n_freeParam,44,yes
+us,.code,func_80676280,64,yes
+us,.code,func_8068A508,604,no
+us,.code,func_805FF670,400,no
+us,.code,func_80732894,144,no
+us,.code,func_8060B140,752,no
+us,.code,func_80737E9C,8,yes
+us,.code,func_80601780,52,yes
+us,.code,func_806614D0,80,yes
+us,.code,func_806896F0,32,yes
+us,.code,func_806E2F3C,172,yes
+us,.code,func_807266E8,92,yes
+us,.code,func_8060B7F0,92,yes
+us,.code,func_806CD898,84,yes
+us,.code,func_806EB8CC,152,yes
+us,.code,func_807407A8,744,no
+us,.code,func_806C7260,8,yes
+us,.code,func_8073F60C,528,no
+us,.code,func_80714998,16,yes
+us,.code,func_806F73A0,1600,no
+us,.code,func_80714A38,32,yes
+us,.code,func_806623D4,72,yes
+us,.code,func_80732158,296,no
+us,.code,func_806F4EBC,148,yes
+us,.code,func_806AB4EC,796,no
+us,.code,func_80646770,520,no
+us,.code,func_80688370,44,yes
+us,.code,func_80627EA8,92,yes
+us,.code,func_8067E69C,40,yes
+us,.code,func_80669650,80,no
+us,.code,func_80688FC0,164,no
+us,.code,func_8067A99C,84,yes
+us,.code,func_806E3D14,300,yes
+us,.code,func_806E56EC,1344,no
+us,.code,func_806FAFE4,564,no
+us,.code,func_8060A670,48,yes
+us,.code,func_806ACCE8,552,yes
+us,.code,func_806C7268,8,yes
+us,.code,func_806F3DC8,68,yes
+us,.code,func_8068B80C,16,yes
+us,.code,func_80690094,252,yes
+us,.code,func_80732064,56,no
+us,.code,func_806C1E44,1064,no
+us,.code,func_8065F49C,88,yes
+us,.code,func_8072827C,132,no
+us,.code,func_8064384C,108,yes
+us,.code,func_80627A00,344,no
+us,.code,func_806E6EE0,148,yes
+us,.code,func_8067A7EC,120,yes
+us,.code,func_806C6BA0,40,yes
+us,.code,func_80714B84,132,yes
+us,.code,func_8067BA3C,64,yes
+us,.code,func_8070E750,184,no
+us,.code,func_8073FD90,880,no
+us,.code,func_8062E1F8,444,no
+us,.code,func_8072B79C,48,no
+us,.code,func_8068C350,80,yes
+us,.code,func_806C9E40,48,yes
+us,.code,func_80661F0C,508,no
+us,.code,func_8062F3A0,128,no
+us,.code,func_8063CF3C,668,no
+us,.code,func_8067E2E4,100,yes
+us,.code,func_8068839C,44,yes
+us,.code,func_806EA0A4,348,yes
+us,.code,func_806615BC,144,yes
+us,.code,func_8069E210,640,no
+us,.code,func_8062EFA0,176,no
+us,.code,func_806CDD24,1104,no
+us,.code,func_80649F64,92,yes
+us,.code,func_8061130C,64,no
+us,.code,func_806883F4,56,yes
+us,.code,func_807248B0,228,no
+us,.code,func_80630588,328,yes
+us,.code,func_80717B64,388,no
+us,.code,func_80634CC8,76,yes
+us,.code,func_806FFF88,256,no
+us,.code,func_806A921C,152,no
+us,.code,func_80717760,180,no
+us,.code,func_80650B50,108,no
+us,.code,func_8068412C,960,yes
+us,.code,func_807138A4,40,yes
+us,.code,func_806485A0,548,no
+us,.code,func_8062D620,1236,no
+us,.code,func_806417BC,184,no
+us,.code,func_806769A8,100,no
+us,.code,gameIsInDKTheatreMode,52,yes
+us,.code,func_806E14DC,340,yes
+us,.code,func_80739FE0,144,no
+us,.code,func_8064B3F8,180,no
+us,.code,func_80643C0C,812,no
+us,.code,func_8070C27C,92,no
+us,.code,func_80636A8C,92,yes
+us,.code,func_806F5270,264,no
+us,.code,func_80671880,492,no
+us,.code,func_8064911C,216,no
+us,.code,func_806B7BB8,188,yes
+us,.code,func_80660070,1200,no
+us,.code,gameIsInSnidesBonusGameMode,52,yes
+us,.code,func_806F3E0C,1820,no
+us,.code,func_80651904,608,no
+us,.code,func_8071720C,504,no
+us,.code,func_8061138C,124,yes
+us,.code,func_806970CC,184,no
+us,.code,func_806DA3E4,244,no
+us,.code,func_8062D3E4,48,yes
+us,.code,func_80714464,84,yes
+us,.code,func_8070E34C,508,no
+us,.code,func_806E3E40,884,no
+us,.code,func_8064BE80,216,no
+us,.code,func_8062DAF4,124,no
+us,.code,func_80714D08,916,no
+us,.code,func_8073BA60,176,no
+us,.code,func_8062B478,440,yes
+us,.code,func_80652E58,100,yes
+us,.code,func_806E84F8,84,yes
+us,.code,func_8062E3B4,404,no
+us,.code,func_806C4EE0,124,yes
+us,.code,func_806EB744,392,yes
+us,.code,func_806E4AD8,404,no
+us,.code,func_8066C2B4,24,yes
+us,.code,func_806E1334,424,yes
+us,.code,func_806E8BA4,88,yes
+us,.code,func_806CFF1C,128,yes
+us,.code,func_80636A44,72,yes
+us,.code,func_8066308C,1048,no
+us,.code,func_806A736C,428,yes
+us,.code,func_806BC080,100,yes
+us,.code,func_8066EB50,164,yes
+us,.code,func_80735864,244,no
+us,.code,func_806C3F10,1176,no
+us,.code,func_806BE09C,1496,no
+us,.code,func_806E0D40,620,no
+us,.code,func_806F46B0,160,no
+us,.code,func_806574B8,80,no
+us,.code,func_80660830,204,no
+us,.code,func_8073E63C,256,no
+us,.code,func_8071E864,448,no
+us,.code,func_806D10D0,64,yes
+us,.code,func_80600044,60,yes
+us,.code,func_806D2BB0,32,yes
+us,.code,func_8066A75C,216,no
+us,.code,func_8063DA40,56,yes
+us,.code,func_80654FEC,620,no
+us,.code,func_806500E0,1084,no
+us,.code,func_806CC190,244,yes
+us,.code,func_806ABB98,252,no
+us,.code,func_80737990,188,no
+us,.code,func_806303C4,452,yes
+us,.code,func_80601258,52,yes
+us,.code,func_806ABE3C,524,no
+us,.code,func_80731A04,164,yes
+us,.code,func_80602C0C,96,yes
+us,.code,func_80688EE4,144,yes
+us,.code,func_8063CB40,804,no
+us,.code,func_806D19A8,440,yes
+us,.code,func_805FF0C8,80,yes
+us,.code,func_80636784,364,no
+us,.code,func_80668520,192,no
+us,.code,func_8068C0B4,120,yes
+us,.code,func_80689A80,144,yes
+us,.code,func_80651708,508,no
+us,.code,getFlagBlockAddress,340,no
+us,.code,func_806D7510,500,no
+us,.code,func_80689EE4,72,yes
+us,.code,func_80729EB0,1440,no
+us,.code,func_80732D80,44,no
+us,.code,func_807149A8,16,yes
+us,.code,func_8062B86C,56,yes
+us,.code,func_8071BB14,364,no
+us,.code,func_805FFEF8,208,yes
+us,.code,func_80645A64,312,no
+us,.code,func_806EB0C0,184,yes
+us,.code,func_8065D994,1708,no
+us,.code,func_80658BD0,64,no
+us,.code,func_80641BCC,204,no
+us,.code,func_8060AC7C,1172,no
+us,.code,func_807382A0,128,no
+us,.code,func_806A5F44,96,yes
+us,.code,func_806F4528,392,no
+us,.code,func_8068452C,32,yes
+us,.code,func_806C9AE0,316,no
+us,.code,func_8071EEE0,252,no
+us,.code,func_806D3B08,32,yes
+us,.code,func_80635114,256,no
+us,.code,func_8068A350,80,yes
+us,.code,func_807327F4,160,no
+us,.code,func_8070A934,832,no
+us,.code,func_8073B08C,324,no
+us,.code,func_806C8D2C,180,yes
+us,.code,func_80728004,196,no
+us,.code,func_8062CA0C,100,yes
+us,.code,func_8065D254,1808,no
+us,.code,func_80714060,632,no
+us,.code,func_807289B0,56,yes
+us,.code,func_8069E490,80,yes
+us,.code,func_80636014,96,yes
+us,.code,func_80611844,8,yes
+us,.code,func_806742C0,112,no
+us,.code,func_8060A60C,40,yes
+us,.code,func_8063254C,228,no
+us,.code,func_8065BE74,164,no
+us,.code,func_806E0FAC,904,no
+us,.code,func_8066BE20,172,yes
+us,.code,func_806EFDFC,312,yes
+us,.code,func_806E352C,172,yes
+us,.code,func_80631BCC,84,yes
+us,.code,func_806364C4,268,no
+us,.code,func_80658CCC,224,no
+us,.code,func_806F2FC0,464,no
+us,.code,func_806D25CC,160,yes
+us,.code,func_8065CDB0,156,no
+us,.code,func_8072752C,332,no
+us,.code,func_806B50F4,72,yes
+us,.code,func_80722E48,420,no
+us,.code,func_806C90C4,512,yes
+us,.code,func_806E7C70,388,no
+us,.code,func_8070DC40,100,no
+us,.code,func_806A6468,268,no
+us,.code,func_806F386C,228,no
+us,.code,func_8065D170,60,no
+us,.code,func_80692520,32,yes
+us,.code,func_806C7C10,132,yes
+us,.code,func_806D5CCC,1260,yes
+us,.code,func_8064E4F8,100,no
+us,.code,func_806D1278,84,yes
+us,.code,func_80732F10,624,no
+us,.code,func_806EB6D8,108,yes
+us,.code,func_80654CCC,440,no
+us,.code,func_806EACEC,280,yes
+us,.code,func_806FBB58,68,yes
+us,.code,func_80692E50,1100,no
+us,.code,func_80727678,584,no
+us,.code,func_806D2AA0,240,yes
+us,.code,func_806F1C04,684,no
+us,.code,func_80643440,612,no
+us,.code,func_8066E664,100,yes
+us,.code,func_80661658,72,yes
+us,.code,func_80602430,44,no
+us,.code,func_806944BC,1164,no
+us,.code,func_806CC638,624,no
+us,.code,func_8064A258,1452,no
+us,.code,func_8067ADB4,88,yes
+us,.code,func_806CE7A0,392,no
+us,.code,func_806D09E8,108,yes
+us,.code,func_806588E0,80,yes
+us,.code,func_8060E8EC,68,yes
+us,.code,func_80659600,16,yes
+us,.code,func_806850D0,320,no
+us,.code,func_80649E00,52,yes
+us,.code,func_8071D28C,816,no
+us,.code,func_80610B84,84,no
+us,.code,func_8060DC3C,620,no
+us,.code,func_806B88B8,616,no
+us,.code,func_806BE6F0,460,no
+us,.code,func_8073202C,56,no
+us,.code,func_8067AF44,48,yes
+us,.code,func_806E17F4,112,yes
+us,.code,func_8070C210,108,yes
+us,.code,func_806B6DB0,2116,no
+us,.code,func_8070D3CC,152,no
+us,.code,func_80695724,1068,no
+us,.code,func_806C71E0,8,yes
+us,.code,func_80732DAC,64,no
+us,.code,func_8067A170,108,no
+us,.code,func_8060CB74,40,yes
+us,.code,func_80636164,172,no
+us,.code,func_8065054C,164,yes
+us,.code,func_806C4E8C,40,yes
+us,.code,func_806F4DC0,180,no
+us,.code,func_80738170,104,no
+us,.code,func_80678DD8,60,yes
+us,.code,func_806D1110,236,yes
+us,.code,func_8068780C,1084,no
+us,.code,func_806A57C0,168,no
+us,.code,func_806F01D8,96,yes
+us,.code,func_806C9E10,48,yes
+us,.code,func_80652790,200,yes
+us,.code,func_806DA89C,176,yes
+us,.code,func_806D1270,8,yes
+us,.code,func_806F69A8,1200,no
+us,.code,func_807313BC,84,yes
+us,.code,func_8073BB10,356,no
+us,.code,func_806AC048,52,yes
+us,.code,func_80732280,212,no
+us,.code,func_80737028,124,no
+us,.code,func_806C7D40,932,no
+us,.code,func_8072A86C,180,no
+us,.code,func_8068C2EC,12,yes
+us,.code,func_8062A274,212,yes
+us,.code,func_806B63E0,44,yes
+us,.code,func_8067BDB8,64,yes
+us,.code,func_807035C4,652,no
+us,.code,func_80685210,180,yes
+us,.code,func_8067A864,164,yes
+us,.code,func_8069FA40,864,no
+us,.code,n_alClose,76,yes
+us,.code,func_806C9304,224,no
+us,.code,func_806422D8,208,yes
+us,.code,func_806C80E4,248,yes
+us,.code,func_8066E62C,56,yes
+us,.code,func_8066B5F4,360,no
+us,.code,func_8060F960,252,no
+us,.code,func_8068C12C,224,yes
+us,.code,func_80661BF0,580,no
+us,.code,func_8068A2FC,80,yes
+us,.code,func_806BC1AC,48,yes
+us,.code,func_806D87FC,616,no
+us,.code,func_80666A88,12,yes
+us,.code,func_806E9468,280,yes
+us,.code,func_8062BA74,112,no
+us,.code,func_806A5174,1612,no
+us,.code,func_806C71E8,8,yes
+us,.code,func_8062B630,48,no
+us,.code,func_806623CC,8,yes
+us,.code,func_806B0354,1052,no
+us,.code,func_80671260,388,no
+us,.code,func_806C93E4,80,yes
+us,.code,func_80713764,320,no
+us,.code,func_80708574,88,yes
+us,.code,func_8065E634,488,no
+us,.code,func_806D6B00,1036,yes
+us,.code,func_806789E4,288,no
+us,.code,func_80633DC0,2472,no
+us,.code,func_8060B4D4,136,no
+us,.code,func_8066B8C8,92,no
+us,.code,func_8070D380,76,yes
+us,.code,func_806A1008,180,no
+us,.code,func_8065FEB8,440,no
+us,.code,func_805FE7B4,72,no
+us,.code,func_806C9F44,48,yes
+us,.code,func_8073F81C,132,no
+us,.code,func_80675C70,256,no
+us,.code,func_806BE8BC,2396,no
+us,.code,func_80672BD4,92,yes
+us,.code,func_8064B868,152,yes
+us,.code,func_80609B80,1584,no
+us,.code,func_806725E4,76,yes
+us,.code,func_80675234,160,no
+us,.code,func_8064EB9C,104,no
+us,.code,func_80678804,8,yes
+us,.code,func_8062DBDC,1124,no
+us,.code,func_806A0B74,1028,no
+us,.code,func_80610E84,356,no
+us,.code,func_8060B6CC,52,yes
+us,.code,func_806F006C,8,yes
+us,.code,func_80642BF0,136,yes
+us,.code,func_806EC708,248,yes
+us,.code,func_807132DC,176,no
+us,.code,func_8070DB9C,164,no
+us,.code,func_8067A1DC,1216,no
+us,.code,func_806A7EF0,384,no
+us,.code,func_8063A968,2876,no
+us,.code,func_806D2330,72,yes
+us,.code,func_8067ACB4,12,yes
+us,.code,func_806F07CC,172,yes
+us,.code,func_806A4284,1752,no
+us,.code,func_806E225C,2244,no
+us,.code,func_8071C48C,404,no
+us,.code,func_8070D300,116,yes
+us,.code,func_806011D4,16,yes
+us,.code,func_80666F04,196,yes
+us,.code,func_806C27DC,220,yes
+us,.code,func_806D36CC,128,yes
+us,.code,func_806B75F4,40,yes
+us,.code,func_80639CD0,588,no
+us,.code,func_8064B574,48,yes
+us,.code,func_806886E0,608,no
+us,.code,func_80713438,380,no
+us,.code,func_80631C3C,336,no
+us,.code,func_80660520,784,no
+us,.code,func_80714A08,32,yes
+us,.code,func_8070CAB4,120,yes
+us,.code,func_8064D0C4,292,no
+us,.code,func_806891D8,120,yes
+us,.code,func_806A7B70,36,yes
+us,.code,func_806B54BC,1492,no
+us,.code,func_80659574,60,no
+us,.code,func_806534E0,420,no
+us,.code,func_80724994,140,no
+us,.code,func_8064AB1C,268,no
+us,.code,func_8068B81C,20,yes
+us,.code,func_8066E5CC,44,yes
+us,.code,func_806C8F8C,312,no
+us,.code,func_80648000,620,no
+us,.code,func_806CF2EC,172,no
+us,.code,func_806BFA8C,296,no
+us,.code,func_80675DD0,108,no
+us,.code,func_8069084C,228,no
+us,.code,func_80655DD0,3528,no
+us,.code,func_80649FC0,448,no
+us,.code,func_80630890,736,no
+us,.code,func_806B1EE8,32,yes
+us,.code,func_806A10BC,112,no
+us,.code,func_805FC98C,216,no
+us,.code,func_8065F614,100,yes
+us,.code,func_806EBDAC,24,yes
+us,.code,func_8060B110,48,no
+us,.code,func_80636210,180,no
+us,.code,func_8064C3E8,348,no
+us,.code,func_8072D9D4,140,yes
+us,.code,func_806DAF5C,304,yes
+us,.code,func_806B13B4,2500,no
+us,.code,func_80666D88,380,no
+us,.code,func_8063495C,160,no
+us,.code,func_806CB53C,2312,yes
+us,.code,func_807245D8,24,yes
+us,.code,func_80601CF0,52,yes
+us,.code,func_806EE2B8,412,yes
+us,.code,func_806D2744,64,yes
+us,.code,func_80636AE8,104,no
+us,.code,alSeqpSetSeq,76,yes
+us,.code,func_806B3F90,516,no
+us,.code,_n_freePVoice,64,yes
+us,.code,func_8063D990,64,no
+us,.code,func_806E65BC,540,no
+us,.code,func_806D3AE8,32,yes
+us,.code,func_80655AD0,288,no
+us,.code,func_80698120,3788,no
+us,.code,func_80645C04,272,yes
+us,.code,func_80697230,1740,no
+us,.code,func_806111BC,60,yes
+us,.code,func_80725ED4,656,no
+us,.code,func_8065A660,152,yes
+us,.code,getLevelIndex,152,yes
+us,.code,func_80703374,592,no
+us,.code,func_806531B8,524,no
+us,.code,func_8060B7C4,12,yes
+us,.code,func_80737630,8,yes
+us,.code,func_80648C84,1176,no
+us,.code,func_8073F1E4,324,no
+us,.code,func_80610268,168,no
+us,.code,func_8071C620,504,no
+us,.code,func_80715B30,776,no
+us,.code,func_8065EA44,84,yes
+us,.code,func_806ECA74,80,yes
+us,.code,func_80655410,1728,no
+us,.code,func_806C5FEC,476,no
+us,.code,func_8064E65C,1004,no
+us,.code,func_806713E4,324,no
+us,.code,func_80717D84,48,no
+us,.code,func_80688540,68,yes
+us,.code,func_807135B4,424,no
+us,.code,func_8066BFF0,236,no
+us,.code,func_8062A348,168,yes
+us,.code,func_8071ABDC,852,no
+us,.code,func_80723428,92,yes
+us,.code,func_806A7BB8,36,yes
+us,.code,func_8071BC80,388,no
+us,.code,func_806EB964,160,yes
+us,.code,func_8070B7EC,2580,no
+us,.code,func_806FB8B0,100,no
+us,.code,func_806CFD68,64,yes
+us,.code,func_807380CC,76,no
+us,.code,func_806D22A0,32,yes
+us,.code,func_806392BC,1576,no
+us,.code,func_80663594,556,no
+us,.code,func_80662158,40,yes
+us,.code,func_8065776C,520,no
+us,.code,func_806436E0,364,no
+us,.code,func_806E1F8C,256,yes
+us,.code,func_8072E1A4,136,yes
+us,.code,func_806A1580,808,no
+us,.code,func_80729E6C,68,yes
+us,.code,func_80678050,624,no
+us,.code,func_80632E10,100,no
+us,.code,func_806CA540,184,yes
+us,.code,func_8073B6B0,160,no
+us,.code,func_80690930,248,no
+us,.code,func_80737638,748,no
+us,.code,func_806EAE60,268,yes
+us,.code,func_8066B75C,80,no
+us,.code,func_80724874,60,no
+us,.code,func_8062A774,92,yes
+us,.code,func_80676730,44,yes
+us,.code,func_80646DC4,836,no
+us,.code,func_8073928C,148,no
+us,.code,func_806A2B90,672,no
+us,.code,func_8065D008,244,no
+us,.code,func_8066785C,352,no
+us,.code,func_8060C340,240,yes
+us,.code,func_8060E574,240,yes
+us,.code,func_807232EC,52,yes
+us,.code,func_806307AC,32,yes
+us,.code,func_80673D48,660,no
+us,.code,func_806BDD90,312,no
+us,.code,func_8064C644,196,no
+us,.code,func_80735958,72,no
+us,.code,func_806D32C0,108,yes
+us,.code,func_8070C590,632,no
+us,.code,func_8063D2E4,388,no
+us,.code,func_8065919C,280,no
+us,.code,func_8070D568,236,no
+us,.code,func_806C7230,8,yes
+us,.code,func_8064EE08,544,no
+us,.code,func_80713EA8,8,yes
+us,.code,func_806978FC,140,no
+us,.code,func_80611160,12,yes
+us,.code,func_806E7088,20,yes
+us,.code,func_8068FF40,280,no
+us,.code,func_8064BE58,40,yes
+us,.code,func_80673C34,276,no
+us,.code,func_806FD950,80,no
+us,.code,func_806F8DC4,240,yes
+us,.code,func_80666AAC,12,yes
+us,.code,func_8071A8B0,556,no
+us,.code,func_806846B4,412,yes
+us,.code,func_80674A5C,128,no
+us,.code,func_806CCB0C,136,yes
+us,.code,func_806EBCF0,188,yes
+us,.code,func_8067E724,64,yes
+us,.code,func_80600D50,848,no
+us,.code,func_80678F64,56,yes
+us,.code,func_8072A450,708,no
+us,.code,func_8069346C,2644,no
+us,.code,func_80730408,1764,no
+us,.code,func_805FF118,64,yes
+us,.code,func_806D1B60,476,yes
+us,.code,func_807311C4,216,no
+us,.code,func_806D26D8,108,yes
+us,.code,func_8063B758,384,no
+us,.code,func_8068B930,132,no
+us,.code,func_806DE264,1740,no
+us,.code,func_806E4580,180,yes
+us,.code,func_80691830,256,yes
+us,.code,func_8061032C,36,no
+us,.code,func_8067C6FC,32,yes
+us,.code,func_806F8D58,108,yes
+us,.code,func_8068588C,92,yes
+us,.code,func_80650AD8,120,no
+us,.code,func_806E4634,268,yes
+us,.code,func_8069D424,1292,no
+us,.code,func_8073CA04,188,no
+us,.code,func_806F3DB0,24,yes
+us,.code,func_806A5868,1016,no
+us,.code,func_806E7B48,296,yes
+us,.code,func_80690814,56,yes
+us,.code,func_80723020,612,no
+us,.code,func_806BC1E0,3512,no
+us,.code,func_8062BCC8,232,no
+us,.code,_n_timeToSamplesNoRound,100,yes
+us,.code,func_806744A8,212,no
+us,.code,func_80688514,44,yes
+us,.code,func_8071F758,396,no
+us,.code,func_806D9924,28,yes
+us,.code,func_806F03C4,608,no
+us,.code,func_806EFF34,312,yes
+us,.code,func_80678530,164,yes
+us,.code,func_806C7238,8,yes
+us,.code,func_806E1A50,340,yes
+us,.code,func_80684550,104,yes
+us,.code,func_8066B9F4,56,yes
+us,.code,func_806D12CC,340,yes
+us,.code,func_8063FA48,7388,no
+us,.code,func_8068A830,40,yes
+us,.code,func_80719B88,120,no
+us,.code,func_806CC948,40,yes
+us,.code,func_8071EFDC,88,no
+us,.code,func_807318AC,176,no
+us,.code,func_8063CF0C,48,yes
+us,.code,func_80658E8C,644,no
+us,.code,func_80631EB8,160,no
+us,.code,func_8060EE58,8,yes
+us,.code,func_806E9964,248,yes
+us,.code,func_80647834,480,no
+us,.code,func_80712B80,84,yes
+us,.code,func_806418E8,180,no
+us,.code,func_806C81DC,68,yes
+us,.code,func_8064C544,256,no
+us,.code,func_80675478,304,no
+us,.code,func_8070CC8C,56,yes
+us,.code,func_8062BDB0,372,no
+us,.code,func_8070C8F4,156,yes
+us,.code,func_806755A8,616,no
+us,.code,func_806E5EA8,44,yes
+us,.code,func_806D7A28,976,no
+us,.code,func_806CA2AC,56,yes
+us,.code,func_80731B88,408,no
+us,.code,func_8067641C,188,no
+us,.code,func_80731AA8,116,yes
+us,.code,func_806DDAB0,1972,no
+us,.code,func_806582F8,532,no
+us,.code,func_80667180,312,no
+us,.code,func_80693EC0,1532,no
+us,.code,func_806D0DE4,216,no
+us,.code,func_806EACBC,48,yes
+us,.code,func_806B1F08,32,yes
+us,.code,func_80712FC8,192,yes
+us,.code,func_8070C200,16,no
+us,.code,func_806F1EB0,1016,no
+us,.code,func_806B7660,68,yes
+us,.code,func_80601224,52,yes
+us,.code,func_80733A88,256,no
+us,.code,func_80641B00,204,no
+us,.code,func_806F3BEC,452,no
+us,.code,func_8070943C,40,yes
+us,.code,func_8067E43C,152,no
+us,.code,func_80639968,668,no
+us,.code,func_805FBFF4,700,no
+us,.code,func_80731784,120,no
+us,.code,func_806FA7A4,24,yes
+us,.code,func_806025AC,40,yes
+us,.code,func_806E527C,84,no
+us,.code,func_806A1ABC,8,yes
+us,.code,func_8060E1A8,180,yes
+us,.code,func_80649E34,304,no
+us,.code,func_80735A34,16,no
+us,.code,func_805FFE50,168,yes
+us,.code,func_806FCC88,1036,no
+us,.code,func_8062E67C,540,no
+us,.code,func_806CFC90,216,yes
+us,.code,func_8067AF74,168,yes
+us,.code,func_806357F8,240,no
+us,.code,func_8073AB00,584,no
+us,.code,func_8066EBF4,120,yes
+us,.code,func_806D8FCC,360,yes
+us,.code,func_806FBC34,296,no
+us,.code,func_8068B8A4,88,no
+us,.code,func_806BB400,516,no
+us,.code,func_806CFDA8,68,yes
+us,.code,func_8067AE58,56,yes
+us,.code,func_806A60E4,40,yes
+us,.code,func_80669A6C,380,no
+us,.code,func_806F2EDC,228,no
+us,.code,func_80652F24,120,yes
+us,.code,func_807271F4,436,no
+us,.code,func_806CA0E8,204,yes
+us,.code,func_8060C648,112,yes
+us,.code,func_806D72D4,572,no
+us,.code,func_806E8A8C,100,yes
+us,.code,func_806C9434,412,yes
+us,.code,alEvtqFlushType,208,yes
+us,.code,func_80714A9C,232,yes
+us,.code,func_8068DBA4,176,no
+us,.code,func_8070033C,848,no
+us,.code,func_8066C7F4,188,no
+us,.code,func_80611594,8,yes
+us,.code,func_806782E8,212,yes
+us,.code,func_8072D714,648,no
+us,.code,func_8072DCF4,284,no
+us,.code,func_806425FC,332,no
+us,.code,func_806B6C88,296,yes
+us,.code,func_8066B7AC,72,yes
+us,.code,func_8071E110,184,no
+us,.code,func_8062E040,440,no
+us,.code,func_80682E38,532,no
+us,.code,func_8067B290,8,yes
+us,.code,func_806A081C,72,yes
+us,.code,func_8066BC00,92,no
+us,.code,getEEPROMSaveSlot,68,yes
+us,.code,func_806B02EC,104,yes
+us,.code,func_8063DC58,528,no
+us,.code,func_80662618,436,no
+us,.code,func_80647A14,352,no
+us,.code,func_8072B59C,108,yes
+us,.code,func_8068A2AC,88,yes
+us,.code,getExitData,364,yes
+us,.code,func_8071497C,16,yes
+us,.code,func_8065C990,1040,no
+us,.code,func_8068613C,516,no
+us,.code,func_806E384C,692,no
+us,.code,func_806AD7AC,160,yes
+us,.code,func_806F4778,1528,no
+us,.code,func_806DEAA4,560,no
+us,.code,func_80696574,1272,no
+us,.code,func_806E8F04,100,yes
+us,.code,func_80709890,572,no
+us,.code,func_806685E0,276,no
+us,.code,func_80726744,1592,no
+us,.code,func_8064FA7C,232,no
+us,.code,func_8060D0A8,164,yes
+us,.code,func_805FF544,92,yes
+us,.code,func_8066E854,144,yes
+us,.code,func_806D7878,364,yes
+us,.code,func_80650C28,112,no
+us,.code,func_806D1F28,308,yes
+us,.code,func_80647108,104,yes
+us,.code,func_806D8B08,1220,no
+us,.code,func_8064AC28,1264,no
+us,.code,func_8070CC1C,56,yes
+us,.code,func_8060FAA4,64,yes
+us,.code,func_8073C040,1476,no
+us,.code,func_8073E460,476,no
+us,.code,func_8066F250,36,yes
+us,.code,func_806F7378,40,yes
+us,.code,func_80669BE8,132,yes
+us,.code,func_80704B20,4084,no
+us,.code,func_806728F0,384,yes
+us,.code,func_8060E4D0,164,yes
+us,.code,func_806EAA44,92,yes
+us,.code,func_806593C8,168,no
+us,.code,func_8071D5BC,456,no
+us,.code,func_806508B4,120,no
+us,.code,func_8064F954,40,yes
+us,.code,func_807270C0,212,yes
+us,.code,func_807189BC,568,no
+us,.code,func_80715908,308,no
+us,.code,func_806D423C,80,yes
+us,.code,func_80627F04,4676,no
+us,.code,func_80656B98,704,no
+us,.code,func_806358E8,1544,no
+us,.code,func_8069A614,316,no
+us,.code,func_80711950,640,no
+us,.code,func_8060DEC8,608,yes
+us,.code,func_80669830,256,no
+us,.code,func_806EE7B8,60,yes
+us,.code,func_8069D058,32,yes
+us,.code,func_8060AA58,224,no
+us,.code,func_80717D4C,56,no
+us,.code,func_806E2ECC,112,yes
+us,.code,func_80659610,16,yes
+us,.code,func_806EB194,292,yes
+us,.code,func_805FC668,804,no
+us,.code,func_806F5C30,180,yes
+us,.code,func_80704298,428,no
+us,.code,func_806EA460,264,yes
+us,.code,func_806EBF74,92,yes
+us,.code,func_806EBB44,140,yes
+us,.code,func_8065F964,416,no
+us,.code,func_80719C00,756,no
+us,.code,func_806D7170,200,yes
+us,.code,func_806E1E54,312,yes
+us,.code,func_80673240,104,no
+us,.code,func_8067A69C,112,yes
+us,.code,func_80690190,556,no
+us,.code,func_8060AC28,12,yes
+us,.code,func_80709344,248,yes
+us,.code,func_8067DF44,820,no
+us,.code,func_806C61C8,872,no
+us,.code,func_806B761C,68,yes
+us,.code,func_8070F5CC,1164,no
+us,.code,func_8067B01C,228,no
+us,.code,func_8065D1AC,152,no
+us,.code,func_806FE078,3384,no
+us,.code,func_806EAB44,328,yes
+us,.code,func_8071B520,568,no
+us,.code,func_806EC3BC,240,yes
+us,.code,func_8062D414,524,no
+us,.code,func_806D0A54,48,yes
+us,.code,func_806CC364,632,no
+us,.code,func_8067AA58,96,yes
+us,.code,func_806EE994,200,yes
+us,.code,func_80718380,372,no
+us,.code,func_8063D288,92,yes
+us,.code,func_8070FCCC,928,no
+us,.code,func_806F9AF0,116,no
+us,.code,func_8067E510,396,no
+us,.code,alSepqSetVol,76,yes
+us,.code,func_8068A1CC,64,yes
+us,.code,func_80689064,176,no
+us,.code,n_alInit,108,yes
+us,.code,func_80679064,144,yes
+us,.code,func_806FA9C0,352,no
+us,.code,func_806EA568,100,no
+us,.code,func_806B4194,276,yes
+us,.code,func_806B8BDC,156,yes
+us,.code,func_806D80A8,608,yes
+us,.code,func_806C1734,704,no
+us,.code,func_80610310,28,no
+us,.code,func_8063C4C4,532,no
+us,.code,func_80676690,80,yes
+us,.code,func_80696A6C,1632,no
+us,.code,func_806C2A64,200,yes
+us,.code,func_80666FC8,328,yes
+us,.code,func_8065D0FC,116,yes
+us,.code,func_80671C0C,260,no
+us,.code,func_806057F8,11568,no
+us,.code,func_80710CA0,1904,no
+us,.code,func_8062A944,804,no
+us,.code,func_807186C8,756,no
+us,.code,func_8069E660,196,yes
+us,.code,func_806EA958,92,yes
+us,.code,func_80670FA4,316,no
+us,.code,func_806787FC,8,yes
+us,.code,func_8070DA28,76,no
+us,.code,func_807238D4,964,no
+us,.code,func_8067B2C0,28,yes
+us,.code,func_8068C3A0,520,no
+us,.code,func_806925AC,148,yes
+us,.code,func_80704444,64,no
+us,.code,func_806CD8EC,156,yes
+us,.code,func_80714A58,16,yes
+us,.code,func_806B9CB0,48,yes
+us,.code,func_806F8170,264,yes
+us,.code,func_8069DD40,536,no
+us,.code,func_80661520,156,no
+us,.code,func_8067C6BC,32,yes
+us,.code,func_8067618C,68,yes
+us,.code,func_806F5378,116,yes
+us,.code,func_80724A20,124,no
+us,.code,func_8066641C,12,yes
+us,.code,func_8066B0EC,12,yes
+us,.code,func_80714708,112,no
+us,.code,func_8071A1E4,604,no
+us,.code,func_80666AE0,12,yes
+us,.code,func_80644D50,220,no
+us,.code,func_806E7050,56,yes
+us,.code,func_80661264,80,no
+us,.code,func_8063C7C4,696,no
+us,.code,func_80704AFC,36,yes
+us,.code,func_806C9830,324,yes
+us,.code,func_8070770C,628,no
+us,.code,func_806A6134,40,yes
+us,.code,func_806EE6B0,80,yes
+us,.code,func_8063162C,424,no
+us,.code,func_806896D0,32,yes
+us,.code,func_80678BBC,268,yes
+us,.code,func_806CF42C,140,yes
+us,.code,func_806EB4F8,76,yes
+us,.code,func_80676260,32,yes
+us,.code,func_806115A8,108,no
+us,.code,func_806E0BEC,340,yes
+us,.code,func_80601728,88,yes
+us,.code,func_806111F8,276,no
+us,.code,func_80653FA4,988,no
+us,.code,func_80730D60,184,yes
+us,.code,func_806B3C30,100,yes
+us,.code,func_806C4904,68,yes
+us,.code,func_806ABC94,424,no
+us,.code,func_806F8EDC,728,no
+us,.code,func_8063DFEC,140,no
+us,.code,func_80641724,152,no
+us,.code,func_806C7200,8,yes
+us,.code,func_806BB604,536,no
+us,.code,func_8060B7D0,28,yes
+us,.code,func_8063DB0C,48,yes
+us,.code,func_80604C80,60,yes
+us,.code,func_805FF1B0,324,no
+us,.code,func_806FB3D0,72,no
+us,.code,func_806E0178,284,yes
+us,.code,func_806D239C,268,yes
+us,.code,func_8065E138,1276,no
+us,.code,func_8073B900,176,no
+us,.code,func_806E9F8C,192,no
+us,.code,func_806CD9A0,900,no
+us,.code,func_8067B450,120,no
+us,.code,func_806E9B3C,108,yes
+us,.code,func_8063373C,376,no
+us,.code,n_alAudioFrame,548,no
+us,.code,func_8065EA98,52,yes
+us,.code,func_806D0468,568,no
+us,.code,func_8071EA24,332,no
+us,.code,func_80713088,76,yes
+us,.code,func_806E0294,308,yes
+us,.code,func_8071EB70,636,no
+us,.code,func_806E7484,228,yes
+us,.code,func_80650D8C,148,no
+us,.code,func_80737A4C,40,no
+us,.code,func_8062A844,8,yes
+us,.code,func_80663A80,360,no
+us,.code,func_806D2BD0,132,yes
+us,.code,func_806CCB94,124,yes
+us,.code,func_80656F14,1444,no
+us,.code,func_806EBE8C,68,no
+us,.code,func_806D2A14,140,yes
+us,.code,func_80669588,200,no
+us,.code,func_807375E0,32,no
+us,.code,func_8070CA2C,68,yes
+us,.code,playerCanDive,116,yes
+us,.code,func_806EE878,172,yes
+us,.code,func_807146E0,20,yes
+us,.code,func_806EA8A0,92,yes
+us,.code,func_806CF398,148,yes
+us,.code,func_80662108,8,yes
+us,.code,func_80731E68,452,no
+us,.code,func_80737600,8,yes
+us,.code,func_806E78E0,24,yes
+us,.code,func_8071EEA4,60,no
+us,.code,func_80632630,560,no
+us,.code,func_806915B0,640,no
+us,.code,func_806EE5A4,144,yes
+us,.code,func_806F1350,40,yes
+us,.code,func_8062DB70,108,no
+us,.code,func_80701098,3064,no
+us,.code,func_80631D8C,300,no
+us,.code,func_80727194,96,no
+us,.code,func_80733180,2312,no
+us,.code,func_806EAFF4,100,yes
+us,.code,func_806B2D64,1724,no
+us,.code,func_8072AA80,244,no
+us,.code,func_80600454,220,yes
+us,.code,func_806B0848,2424,no
+us,.code,func_80679178,100,yes
+us,.code,func_8066C2D0,832,no
+us,.code,func_806524A0,244,yes
+us,.code,func_806CFEF4,40,yes
+us,.code,func_80714CC0,72,yes
+us,.code,func_8068E474,832,no
+us,.code,func_8070D6D8,124,yes
+us,.code,func_8062B840,44,yes
+us,.code,func_80634F14,140,yes
+us,.code,func_8067B1E0,88,yes
+us,.code,func_806DFFA0,60,yes
+us,.code,func_80732930,124,no
+us,.code,func_8065C334,1628,no
+us,.code,func_806F93EC,64,yes
+us,.code,func_806CF9CC,708,no
+us,.code,func_80602C6C,116,yes
+us,.code,func_8068C5A8,3260,no
+us,.code,func_806505F0,148,yes
+us,.code,func_8063DBD8,128,yes
+us,.code,func_8062CA70,1080,no
+us,.code,func_80713DFC,172,yes
+us,.code,func_8063D854,208,yes
+us,.code,func_8073E800,160,no
+us,.code,func_8066466C,456,no
+us,.code,func_806E7780,312,yes
+us,.code,func_806F1B58,56,no
+us,.code,func_80666280,16,yes
+us,.code,func_806DC170,564,no
+us,.code,func_806A18A8,532,no
+us,.code,func_806A6004,144,yes
+us,.code,func_806595B0,64,no
+us,.code,func_806651FC,452,no
+us,.code,func_806FB218,120,yes
+us,.code,func_806FB290,40,yes
+us,.code,func_8064954C,356,no
+us,.code,func_8064B190,116,no
+us,.code,func_806C7208,8,yes
+us,.code,func_80630DCC,2144,no
+us,.code,func_8073B830,208,no
+us,.code,func_8064ED68,160,yes
+us,.code,func_8073D160,144,no
+us,.code,func_80727F20,228,no
+us,.code,func_806118FC,152,yes
+us,.code,func_80601120,76,yes
+us,.code,func_806E7338,332,yes
+us,.code,func_806C226C,1392,no
+us,.code,func_806BFBF4,5292,no
+us,.code,func_806B6958,816,yes
+us,.code,func_806E1630,248,yes
+us,.code,func_80719EF4,324,no
+us,.code,func_806A610C,40,yes
+us,.code,func_806E3CEC,40,yes
+us,.code,func_806C9ED0,48,yes
+us,.code,func_806D69A4,348,yes
+us,.code,func_806CA1B4,184,yes
+us,.code,func_806DA94C,200,yes
+us,.code,func_806338F4,72,no
+us,.code,func_806ADDD8,520,no
+us,.code,func_806E3C14,36,yes
+us,.code,func_80688940,300,yes
+us,.code,func_806998C8,32,yes
+us,.code,func_806ECE2C,240,yes
+us,.code,func_80685F60,476,no
+us,.code,func_8060B55C,100,yes
+us,.code,func_806F027C,200,yes
+us,.code,func_806E9A5C,112,yes
+us,.code,func_8072E02C,124,yes
+us,.code,func_806E31FC,272,yes
+us,.code,func_806C850C,1144,no
+us,.code,func_8071321C,84,yes
+us,.code,func_806C6530,852,no
+us,.code,func_80737B50,8,yes
+us,.code,func_8066FE08,1856,no
+us,.code,func_806CEB44,192,no
+us,.code,func_80703CF8,984,no
+us,.code,func_807149C8,52,yes
+us,.code,func_8064B514,96,no
+us,.code,func_80726E60,128,no
+us,.code,func_80737CF4,316,no
+us,.code,func_806E709C,404,yes
+us,.code,setFlag,288,yes
+us,.code,func_80600C68,232,no
+us,.code,func_806EAC8C,48,yes
+us,.code,func_80691930,176,yes
+us,.code,func_80644EC8,504,no
+us,.code,func_806A6574,216,no
+us,.code,func_80602B60,172,no
+us,.code,func_8067A70C,120,yes
+us,.code,func_806A5C60,400,no
+us,.code,func_8065850C,280,no
+us,.code,gameIsInMainMenuMode,20,yes
+us,.code,func_8071B89C,80,no
+us,.code,func_806B3C94,132,yes
+us,.code,func_806E4D14,112,yes
+us,.code,func_807158C0,72,no
+us,.code,func_806CE174,880,no
+us,.code,func_806E6F74,124,yes
+us,.code,func_806398E4,132,no
+us,.code,func_80662188,72,yes
+us,.code,func_806AE2B0,228,yes
+us,.code,func_807069A4,1516,no
+us,.code,func_80678E6C,248,yes
+us,.code,func_8064F84C,264,no
+us,.code,func_8072E0A8,252,no
+us,.code,func_806F96CC,120,no
+us,.code,func_806F149C,32,yes
+us,.code,func_806D3B28,32,yes
+us,.code,func_80736FB8,112,no
+us,.code,func_807094D0,276,no
+us,.code,func_8060B49C,56,yes
+us,.code,func_806B3E08,116,yes
+us,.code,func_806A1FD8,848,no
+us,.code,func_8060131C,132,yes
+us,.code,func_8062B220,420,no
+us,.code,func_806ED420,232,yes
+us,.code,func_806E560C,224,no
+us,.code,func_806E918C,508,no
+us,.code,func_8060A6A0,288,no
+us,.code,func_8060AB38,16,yes
+us,.code,func_80676BCC,68,no
+us,.code,func_80629300,3632,no
+us,.code,func_806F014C,56,yes
+us,.code,func_80740A90,448,no
+us,.code,func_806833DC,756,no
+us,.code,func_80729AA4,80,yes
+us,.code,func_805FEF10,100,no
+us,.code,func_80690A28,136,no
+us,.code,func_806E2B20,340,no
+us,.code,func_8060E8CC,32,yes
+us,.code,func_8062A7D0,56,yes
+us,.code,func_807085D0,1512,no
+us,.code,func_806E521C,96,yes
+us,.code,func_806B1348,108,yes
+us,.code,__n_allocParam,96,yes
+us,.code,func_806F6EDC,76,yes
+us,.code,func_806EBA74,128,yes
+us,.code,func_8070F570,92,yes
+us,.code,func_806A112C,1108,no
+us,.code,func_8062D1E0,140,no
+us,.code,func_806E5ED4,204,yes
+us,.code,func_80676B70,92,yes
+us,.code,func_806F06A4,92,yes
+us,.code,func_80603450,5500,no
+us,.code,func_8062A228,36,yes
+us,.code,func_8060116C,52,yes
+us,.code,func_80717CE8,100,no
+us,.code,func_806717FC,132,yes
+us,.code,func_806EE10C,184,yes
+us,.code,func_8064B118,56,yes
+us,.code,func_8073CDD0,304,no
+us,.code,func_8067C71C,5540,no
+us,.code,func_806DF3D0,124,yes
+us,.code,func_806FD894,76,no
+us,.code,func_8067B4C8,1396,no
+us,.code,func_8063C784,64,yes
+us,.code,func_80692540,36,yes
+us,.code,func_806C9FD8,112,yes
+us,.code,func_807103E0,500,no
+us,.code,func_8065A708,380,no
+us,.code,func_8064B7E8,64,yes
+us,.code,func_8068A858,904,no
+us,.code,func_80684900,256,yes
+us,.code,func_806D2E9C,904,no
+us,.code,func_8064E174,692,no
+us,.code,func_806D024C,300,yes
+us,.code,func_806E884C,52,yes
+us,.code,func_8069B908,5268,no
+us,.code,func_806A734C,32,yes
+us,.code,func_80688320,80,yes
+us,.code,func_8070D754,216,no
+us,.code,func_80714608,48,yes
+us,.code,func_8073D060,224,no
+us,.code,func_8060CB9C,32,yes
+us,.code,func_8067B280,8,yes
+us,.code,func_806907B8,40,yes
+us,.code,func_806A1F64,108,yes
+us,.code,func_806FEDB0,460,no
+us,.code,func_8068AD7C,2704,no
+us,.code,func_8072E320,556,no
+us,.code,func_806CF4B8,200,no
+us,.code,func_806E41EC,916,yes
+us,.code,func_80635548,64,no
+us,.code,func_80670548,1812,no
+us,.code,func_806C71C0,8,yes
+us,.code,func_80604BE8,152,yes
+us,.code,func_80717100,268,no
+us,.code,func_806A7BDC,788,no
+us,.code,gameIsInMysteryMenuMinigameMode,52,yes
+us,.code,func_8062E548,192,no
+us,.code,func_80650794,288,no
+us,.code,func_8073E8B4,8,yes
+us,.code,func_806F70FC,636,no
+us,.code,func_806D3A38,144,yes
+us,.code,func_806ECC48,148,yes
+us,.code,func_80636448,124,yes
+us,.code,func_80611724,12,yes
+us,.code,func_8060BB18,200,no
+us,.code,func_806C71C8,8,yes
+us,.code,func_806F833C,1872,no
+us,.code,func_80737AC4,104,no
+us,.code,func_8062F640,856,no
+us,.code,func_806EA04C,88,yes
+us,.code,func_8063A8C4,164,no
+us,.code,func_80737198,212,no
+us,.code,func_80647D7C,644,no
+us,.code,func_8063C418,56,yes
+us,.code,func_8060245C,44,yes
+us,.code,func_80600530,96,yes
+us,.code,func_80650C98,108,no
+us,.code,func_8066B4AC,40,yes
+us,.code,func_8073A070,192,no
+us,.code,func_8067B2B8,8,yes
+us,.code,func_806D11FC,60,yes
+us,.code,func_80634FA0,120,yes
+us,.code,func_8066893C,180,no
+us,.code,func_806C4F5C,1660,no
+us,.code,func_806017B4,52,yes
+us,.code,func_80717404,860,no
+us,.code,func_806AE394,500,no
+us,.code,func_806D850C,752,yes
+us,.code,func_8064EB3C,96,yes
+us,.code,func_8073D1F0,2112,no
+us,.code,func_80657E24,240,no
+us,.code,func_806F0C18,336,no
+us,.code,func_806E8880,44,yes
+us,.code,func_806A5EAC,152,no
+us,.code,func_806639CC,64,yes
+us,.code,func_806E5488,388,yes
+us,.code,func_80709ACC,248,no
+us,.code,func_8068A20C,64,yes
+us,.code,func_8067AE0C,76,yes
+us,.code,func_806790F4,132,no
+us,.code,func_8067B2DC,280,yes
+us,.code,func_806D34B4,124,no
+us,.code,func_80694D20,1168,no
+us,.code,func_8069DC10,112,no
+us,.code,func_806DD24C,1576,no
+us,.code,func_80714360,52,yes
+us,.code,func_8064F210,224,no
+us,.code,func_8060ED6C,100,yes
+us,.code,func_806794EC,2264,no
+us,.code,func_806D97A4,124,yes
+us,.code,func_80683158,412,no
+us,.code,func_806F9848,680,no
+us,.code,func_8068A3A0,100,no
+us,.code,func_8072F120,272,no
+us,.code,func_806653C0,392,no
+us,.code,func_806F1B90,116,yes
+us,.code,func_806884B8,44,yes
+us,.code,func_8071D94C,552,no
+us,.code,func_806F5498,72,yes
+us,.code,func_80699958,3260,no
+us,.code,func_80703AB0,584,no
+us,.code,func_806CD988,24,yes
+us,.code,func_8064EC60,264,no
+us,.code,func_80682DF4,68,no
+us,.code,func_8070DB7C,32,no
+us,.code,func_806FB418,96,yes
+us,.code,func_8073C9C0,68,no
+us,.code,func_806FB490,644,no
+us,.code,func_8069E088,388,yes
+us,.code,func_80631B8C,64,yes
+us,.code,func_806E7900,584,yes
+us,.code,func_8072F4A8,244,yes
+us,.code,func_806D24E4,232,yes
+us,.code,func_80676AB8,128,no
+us,.code,func_80646058,1816,no
+us,.code,func_80731030,60,no
+us,.code,func_80650A70,104,no
+us,.code,alSeqpStop,64,yes
+us,.code,func_80632F20,84,no
+us,.code,func_806BD0CC,152,yes
+us,.code,func_8063D608,48,yes
+us,.code,func_8067E6E4,32,yes
+us,.code,func_8072F59C,824,no
+us,.code,func_80737B58,200,no
+us,.code,func_8068304C,268,no
+us,.code,func_806D2D38,140,yes
+us,.code,func_806E6318,80,yes
+us,.code,func_806DA320,196,yes
+us,.code,func_806C6884,716,no
+us,.code,func_8070068C,300,no
+us,.code,func_8060C6B8,108,yes
+us,.code,func_8063C4A8,28,yes
+us,.code,func_806F9744,260,no
+us,.code,func_8069E4E0,216,yes
+us,.code,func_80737608,40,no
+us,.code,func_806E607C,340,yes
+us,.code,func_8065297C,140,yes
+us,.code,func_806F6644,868,no
+us,.code,func_80635018,128,yes
+us,.code,func_80642748,252,no
+us,.code,func_80690AB0,312,no
+us,.code,func_8068A074,152,yes
+us,.code,func_80677148,1220,no
+us,.code,func_806D0964,132,yes
+us,.code,func_805FF898,96,yes
+us,.code,func_80672E90,44,no
+us,.code,func_806013E8,156,yes
+us,.code,func_8064AAC4,88,no
+us,.code,func_806B1F50,1384,no
+us,.code,func_80686390,1500,no
+us,.code,func_8064B260,76,no
+us,.code,func_80632FCC,248,no
+us,.code,func_80731B20,64,yes
+us,.code,func_8072DC7C,120,yes
+us,.code,func_8072DB68,276,yes
+us,.code,func_8066B7F4,212,no
+us,.code,func_8069E018,40,yes
+us,.code,func_80663C60,312,yes
+us,.code,func_806BD094,56,yes
+us,.code,func_80679010,84,no
+us,.code,func_806B9CE0,468,yes
+us,.code,func_805FE544,240,yes
+us,.code,func_806F1250,172,yes
+us,.code,func_806A1FD0,8,yes
+us,.code,func_8073A900,140,no
+us,.code,func_80641874,116,no
+us,.code,func_80601EE4,544,no
+us,.code,func_8060A1B0,488,no
+us,.code,func_80602498,276,no
+us,.code,func_80643F38,356,no
+us,.code,func_8060EA28,556,yes
+us,.code,func_806A7B94,36,yes
+us,.code,func_8072EA90,516,no
+us,.code,func_8068C20C,224,no
+us,.code,func_80636EFC,256,no
+us,.code,func_806EA334,300,yes
+us,.code,func_8072E2B0,112,yes
+us,.code,func_80714A28,16,yes
+us,.code,func_806E78B8,40,yes
+us,.code,func_80713168,84,yes
+us,.code,func_806B1D78,92,yes
+us,.code,func_805FF660,16,yes
+us,.code,func_806C7250,8,yes
+us,.code,func_807040D0,16,yes
+us,.code,func_8067A784,104,yes
+us,.code,func_805FC2B0,952,no
+us,.code,func_80713AA8,152,no
+us,.code,func_80705C00,860,no
+us,.code,func_806A8070,72,yes
+us,.code,func_8060F730,292,no
+us,.code,func_8067AC38,124,yes
+us,.code,func_8060C830,124,yes
+us,.code,func_8067B100,224,no
+us,.code,func_80724C2C,76,yes
+us,.code,func_806575D0,412,no
+us,.code,func_80666AB8,12,yes
+us,.code,func_806F1668,256,yes
+us,.code,func_8067C2B8,964,no
+us,.code,func_80713C8C,368,no
+us,.code,func_806CC8F0,48,yes
+us,.code,func_806B49B0,1052,no
+us,.code,func_806E9CDC,32,yes
+us,.code,func_8071D784,456,no
+us,.code,func_80733C34,344,no
+us,.code,func_8067B2B0,8,yes
+us,.code,func_80689DD4,196,no
+us,.code,func_8070D970,60,no
+us,.code,func_806545D4,468,no
+us,.code,func_806BC0E4,100,yes
+us,.code,func_8072C670,512,no
+us,.code,func_806D9320,1156,no
+us,.code,func_806E854C,472,no
+us,.code,func_806D2238,104,yes
+us,.code,func_806CC284,224,yes
+us,.code,func_806EC994,224,yes
+us,.code,func_806FB370,96,no
+us,.code,func_8063D930,96,no
+us,.code,func_80689C20,436,no
+us,.code,func_8067889C,328,no
+us,.code,func_807314F4,224,no
+us,.code,func_806C7258,8,yes
+us,.code,func_806D45A4,436,yes
+us,.code,func_806E6A38,352,yes
+us,.code,func_806B1EC8,32,yes
+us,.code,func_806EFB4C,236,yes
+us,.code,func_806E8D54,96,yes
+us,.code,func_8072DE10,52,yes
+us,.code,func_8072C918,1744,no
+us,.code,func_80726D7C,68,yes
+us,.code,func_806CEED8,228,no
+us,.code,func_80712634,36,yes
+us,.code,func_806730A4,412,no
+us,.code,func_806D3BC8,268,yes
+us,.code,func_80631FAC,216,no
+us,.code,func_806F8AD4,240,yes
+us,.code,func_806F5FE8,84,yes
+us,.code,func_806F942C,68,yes
+us,.code,func_806A4B84,600,no
+us,.code,func_806D22C0,112,yes
+us,.code,func_80636B50,176,no
+us,.code,func_8060095C,48,yes
+us,.code,func_806F6F28,384,yes
+us,.code,func_806F53EC,96,yes
+us,.code,func_806FD490,792,no
+us,.code,func_806A6408,96,yes
+us,.code,func_80738400,112,no
+us,.code,func_806F0074,8,yes
+us,.code,func_80662180,8,yes
+us,.code,func_806D1D84,104,yes
+us,.code,func_806F1990,136,no
+us,.code,func_806D1080,80,yes
+us,.code,func_806A9124,248,no
+us,.code,func_806FDF1C,56,yes
+us,.code,func_8067605C,304,no
+us,.code,func_80601D24,448,no
+us,.code,func_8068D9DC,280,no
+us,.code,func_8064F97C,256,no
+us,.code,func_806DF6D4,2144,no
+us,.code,func_8064B7D4,20,yes
+us,.code,func_80676590,88,yes
+us,.code,func_806A60BC,40,yes
+us,.code,func_806A285C,428,yes
+us,.code,func_80635098,124,yes
+us,.code,func_806EC4AC,604,no
+us,.code,func_806D0430,56,yes
+us,.code,func_8073F8A0,1264,no
+us,.code,func_80611534,96,no
+us,.code,func_8067881C,8,yes
+us,.code,func_8072DA60,68,yes
+us,.code,func_806A2B38,72,no
+us,.code,func_806E4E88,444,yes
+us,.code,func_806493C4,392,no
+us,.code,func_8067AB20,160,yes
+us,.code,func_8067A09C,212,no
+us,.code,func_80686F90,240,yes
+us,.code,func_806B8878,32,yes
+us,.code,func_8066B4D4,244,no
+us,.code,func_80652DB4,164,no
+us,.code,func_8065FB64,548,no
+us,.code,func_806882DC,68,yes
+us,.code,func_80602144,408,no
+us,.code,func_806D7FE8,136,yes
+us,.code,func_806C7B34,28,yes
+us,.code,func_80600340,172,no
+us,.code,func_8067C67C,32,yes
+us,.code,func_806637C0,132,no
+us,.code,func_8064B5A4,500,no
+us,.code,func_8068B9B4,120,no
+us,.code,func_806E8BFC,48,yes
+us,.code,func_8071F034,68,no
+us,.code,func_806D4A70,524,no
+us,.code,func_8064E55C,100,no
+us,.code,func_8073C604,540,no
+us,.code,func_80634768,332,no
+us,.code,func_806EB178,28,yes
+us,.code,func_806DF1A0,224,yes
+us,.code,func_80712830,276,yes
+us,.code,func_806E208C,180,no
+us,.code,func_8071F8E4,412,no
+us,.code,func_8064199C,92,no
+us,.code,func_80737924,108,no
+us,.code,func_80661B84,108,yes
+us,.code,func_806F397C,108,yes
+us,.code,func_806BA130,272,yes
+us,.code,func_80687CC8,128,yes
+us,.code,func_8070CD44,72,yes
+us,.code,func_80732420,28,no
+us,.code,func_806B76B0,384,no
+us,.code,func_806ED5C0,240,yes
+us,.code,func_8067E784,4932,no
+us,.code,func_80689710,224,yes
+us,.code,func_806DB670,1172,no
+us,.code,func_806EA200,108,yes
+us,.code,func_806B640C,500,no
+us,.code,func_8063C1EC,92,yes
+us,.code,func_80644A18,680,no
+us,.code,func_8062C22C,112,yes
+us,.code,func_8069900C,32,yes
+us,.code,func_8060098C,388,no
+us,.code,func_806BB81C,88,yes
+us,.code,func_8063BF34,696,no
+us,.code,func_8068A810,32,yes
+us,.code,func_80689B10,156,yes
+us,.code,func_806F4E74,72,yes
+us,.code,func_806B24B8,728,no
+us,.code,func_80732534,228,no
+us,.code,func_806ACA88,376,no
+us,.code,func_80679290,164,no
+us,.code,func_8065996C,1092,no
+us,.code,func_80692640,768,no
+us,.code,func_8067470C,376,no
+us,.code,func_80650684,100,yes
+us,.code,func_80664834,516,no
+us,.code,func_8066EABC,48,no
+us,.code,func_80685D84,244,yes
+us,.code,func_806CC920,40,yes
+us,.code,func_806B1290,184,yes
+us,.code,func_80724A9C,192,no
+us,.code,func_806CFEA4,40,yes
+us,.code,func_80732618,280,no
+us,.code,func_806E5E58,8,yes
+us,.code,func_8067E704,32,yes
+us,.code,func_8071DB74,284,no
+us,.code,func_806C8EE8,164,yes
+us,.code,func_806F0238,68,yes
+us,.code,func_8063DED0,284,no
+us,.code,func_805FE398,316,no
+us,.code,func_807131BC,96,yes
+us,.code,func_8062D2F0,244,no
+us,.code,func_80611850,172,no
+us,.code,gameIsInAdventureMode,52,yes
+us,.code,func_806319C4,444,no
+us,.code,func_806B1F28,32,yes
+us,.code,func_806B904C,404,no
+us,.code,func_80658E58,52,yes
+us,.code,func_8069CF54,196,no
+us,.code,func_80647508,264,yes
+us,.code,func_807127B4,64,yes
+us,.code,func_8065F5F0,36,no
+us,.code,func_8065A884,4636,no
+us,.code,func_80718080,116,no
+us,.code,func_806D91A4,380,no
+us,.code,func_806BFBB4,64,yes
+us,.code,func_8067A908,148,yes
+us,.code,func_806CCC10,68,no
+us,.code,func_8066F1F8,88,yes
+us,.code,func_80685B44,576,no
+us,.code,func_8062A3F0,900,no
+us,.code,func_8073E73C,196,no
+us,.code,func_80664D20,1088,no
+us,.code,func_80643354,236,no
+us,.code,func_80730AEC,628,no
+us,.code,func_80655BF0,264,yes
+us,.code,func_80677EC8,8,yes
+us,.code,func_80692940,1296,no
+us,.code,func_806CE4E4,700,no
+us,.code,alUnlink,64,yes
+us,.code,func_80671A6C,416,no
+us,.code,func_8060128C,72,yes
+us,.code,func_806C5C20,972,no
+us,.code,func_80642844,252,no
+us,.code,func_80672EBC,216,no
+us,.code,func_806C55E0,1600,no
+us,.code,func_80661054,528,no
+us,.code,func_80661484,76,yes
+us,.code,func_8062C99C,112,no
+us,.code,func_80600080,244,yes
+us,.code,func_8070D020,92,yes
+us,.code,func_806A3700,12,yes
+us,.code,func_80636FFC,2928,no
+us,.code,func_8072D13C,1496,no
+us,.code,func_80723320,44,yes
+us,.code,func_8064B828,64,yes
+us,.code,func_80733D8C,6296,no
+us,.code,func_8073209C,188,no
+us,.code,func_806D5008,528,no
+us,.code,func_80669930,148,no
+us,.code,func_806F5DF8,188,no
+us,.code,func_80610BD8,156,no
+us,.code,func_806C71A8,8,yes
+us,.code,func_805FCA64,48,yes
+us,.code,func_806BA8C8,116,yes
+us,.code,func_805FEF74,140,yes
+us,.code,isFlagSet,184,yes
+us,.code,func_806DE930,196,yes
+us,.code,func_807383F4,8,yes
+us,.code,func_80642204,212,yes
+us,.code,func_80739E24,56,no
+us,.code,func_8071006C,264,no
+us,.code,func_8066C8B0,84,yes
+us,.code,func_80634908,84,no
+us,.code,func_806732A8,124,no
+us,.code,func_8070CA70,68,yes
+us,.code,func_806EEA5C,156,yes
+us,.code,func_806C71F0,8,yes
+us,.code,func_806752D4,172,no
+us,.code,func_8064E428,100,no
+us,.code,func_806ECBD4,116,yes
+us,.code,func_806D1238,56,yes
+us,.code,func_8073DF50,792,no
+us,.code,func_8067AAB8,104,yes
+us,.code,func_806EBBD0,144,yes
+us,.code,func_80665ACC,24,yes
+us,.code,func_8067A9F0,104,yes
+us,.code,func_8060F928,56,no
+us,.code,clearGlobalFlags,80,yes
+us,.code,func_8072E740,156,yes
+us,.code,func_806776A0,1548,no
+us,.code,func_80722E00,72,yes
+us,.code,func_8062B8A4,64,yes
+us,.code,func_806D7DF8,144,yes
+us,.code,func_806C9C80,160,yes
+us,.code,func_8066E21C,164,yes
+us,.code,func_806F966C,96,no
+us,.code,func_80659F7C,1524,no
+us,.code,func_8071F660,248,no
+us,.code,func_806B2790,1484,no
+us,.code,func_80627C10,76,yes
+us,.code,func_80661E34,144,no
+us,.code,func_806CC8A8,16,yes
+us,.code,func_806BD170,628,no
+us,.code,func_8062A130,248,yes
+us,.code,func_806B4DCC,808,yes
+us,.code,func_8071586C,84,no
+us,.code,func_8060EDD0,136,no
+us,.code,alLink,52,yes
+us,.code,func_806A05FC,544,no
+us,.code,func_806C71F8,8,yes
+us,.code,func_8066635C,156,yes
+us,.code,func_8067B238,72,yes
+us,.code,func_806AA304,4584,no
+us,.code,func_806A3C6C,308,no
+us,.code,func_807317FC,176,no
+us,.code,func_8071E1C8,548,no
+us,.code,func_80714638,40,yes
+us,.code,func_80644CC0,144,no
+us,.code,func_80650ECC,2108,no
+us,.code,func_806EA9B4,144,yes
+us,.code,func_806116E0,68,no
+us,.code,func_8070C990,88,yes
+us,.code,func_8064E5C0,156,no
+us,.code,func_80659470,88,yes
+us,.code,func_80633A1C,788,no
+us,.code,func_8069D0F8,436,no
+us,.code,func_8067675C,44,yes
+us,.code,func_806884E4,48,yes
+us,.code,func_806D38AC,396,yes
+us,.code,func_806BA76C,348,no
+us,.code,func_806EFA08,20,yes
+us,.code,func_80687080,348,no
+us,.code,func_80645238,988,no
+us,.code,func_806FB2B8,184,no
+us,.code,func_8062EDA8,160,no
+us,.code,func_806CF918,180,no
+us,.code,func_806ACC00,100,yes
+us,.code,func_8065F134,140,no
+us,.code,func_8070DD44,152,no
+us,.code,func_80712490,40,yes
+us,.code,func_8063DE68,104,no
+us,.code,func_80690058,60,yes
+us,.code,func_80717930,564,no
+us,.code,func_8060E4B0,32,yes
+us,.code,func_806450C0,376,no
+us,.code,func_806DB3AC,708,no
+us,.code,func_806643C4,236,no
+us,.code,func_80675EE0,380,no
+us,.code,func_806A62B4,32,yes
+us,.code,func_805FF378,352,yes
+us,.code,func_8064B4AC,104,no
+us,.code,func_806C43A8,108,yes
+us,.code,func_806BB32C,212,yes
+us,.code,func_80737EA4,104,no
+us,.code,func_806A6230,132,yes
+us,.code,func_8066F274,396,no
+us,.code,func_80642E34,400,no
+us,.code,func_806613E8,88,yes
+us,.code,func_80660D38,788,no
+us,.code,func_806739D8,104,no
+us,.code,func_8067BCE8,32,yes
+us,.code,func_8064BB78,96,yes
+us,.code,func_806E2EA8,36,yes
+us,.code,func_80604CBC,180,no
+us,.code,func_80735AA0,596,no
+us,.code,func_806DBB04,1644,no
+us,.code,func_80601678,88,yes
+us,.code,func_806FEF7C,160,no
+us,.code,func_805FCFD8,88,yes
+us,.code,func_80689958,296,no
+us,.code,func_80713B40,332,no
+us,.code,func_80653DF0,184,no
+us,.code,func_80632F74,88,no
+us,.code,func_806DF44C,72,yes
+us,.code,func_80634EA4,56,yes
+us,.code,func_80683AD8,1460,no
+us,.code,func_80689250,456,no
+us,.code,func_8065CDA0,16,yes
+us,.code,func_80635EF0,292,no
+us,.code,func_806365D0,436,no
+us,.code,func_8063D638,540,no
+us,.code,func_806E3C38,180,yes
+us,.code,func_80688C84,64,no
+us,.code,func_806F0184,84,yes
+us,.code,func_80611408,300,no
+us,.code,func_80644E2C,156,no
+us,.code,func_80656E58,188,no
+us,.code,func_8066F84C,960,no
+us,.code,func_80642480,128,yes
+us,.code,func_806C19F4,348,yes
+us,.code,func_80731410,228,yes
+us,.code,func_80677D80,328,no
+us,.code,func_806E4D84,260,yes
+us,.code,func_8060E664,132,yes
+us,.code,func_8073195C,48,yes
+us,.code,func_8066F06C,396,no
+us,.code,func_806699C4,168,no
+us,.code,func_8066B06C,112,yes
+us,.code,func_8067BD28,144,yes
+us,.code,func_806BC148,100,yes
+us,.code,func_8068A784,44,no
+us,.code,func_8065EB10,1248,no
+us,.code,func_80639F1C,164,no
+us,.code,func_80718188,244,no
+us,.code,func_806AEE84,2052,no
+us,.code,func_80727958,1480,no
+us,.code,func_8065BAA0,980,no
+us,.code,func_80676540,80,yes
+us,.code,func_8064CD3C,904,no
+us,.code,func_806BD3E4,972,no
+us,.code,func_80631C20,28,yes
+us,.code,func_806D9940,404,yes
+us,.code,func_80674ADC,180,no
+us,.code,func_807144B8,212,yes
+us,.code,func_80689418,696,no
+us,.code,func_8064826C,820,no
+us,.code,func_806EBED0,100,yes
+us,.code,func_80738D20,312,no
+us,.code,func_80679490,92,yes
+us,.code,func_806DCF60,748,no
+us,.code,func_806C2DF4,3224,no
+us,.code,func_806E5C2C,72,yes
+us,.code,func_806F5CE4,156,yes
+us,.code,func_806CA048,160,yes
+us,.code,func_806DCA7C,1252,no
+us,.code,func_8066ADA0,324,no
+us,.code,func_806F4750,40,yes
+us,.code,func_80684850,176,yes
+us,.code,func_806E0654,64,yes
+us,.code,func_8068A118,76,yes
+us,.code,func_806F10E8,360,no
+us,.code,func_80675810,748,no
+us,.code,func_8065CFB8,80,yes
+us,.code,func_8065F1C0,732,no
+us,.code,func_8060E79C,80,yes
+us,.code,func_807007B8,572,no
+us,.code,func_80678B04,184,yes
+us,.code,func_80627C5C,588,no
+us,.code,func_8066EC6C,484,no
+us,.code,func_806085DC,144,no
+us,.code,func_806011E4,64,yes
+us,.code,func_806D37CC,224,yes
+us,.code,func_80631F58,84,no
+us,.code,func_806D4DE4,548,no
+us,.code,func_806C10A0,608,yes
+us,.code,func_8063D5AC,92,yes
+us,.code,func_80714950,12,yes
+us,.code,func_806A7600,1284,no
+us,.code,func_8065BF18,808,no
+us,.code,func_80653B80,624,no
+us,.code,func_8069D930,292,no
+us,.code,func_80659544,48,yes
+us,.code,func_80723F88,460,no
+us,.code,func_806F13C8,100,yes
+us,.code,func_806C3A8C,1156,no
+us,.code,func_8066B020,76,yes
+us,.code,func_806EE02C,64,yes
+us,.code,func_806ECCDC,248,yes
+us,.code,func_80726DC0,44,yes
+us,.code,func_806F50C8,424,no
+us,.code,func_80716F10,164,no
+us,.code,func_80712A40,320,no
+us,.code,func_806E8C2C,296,no
+us,.code,func_806012D4,72,yes
+us,.code,func_806E7DF4,1104,no
+us,.code,func_8073AD48,8,yes
+us,.code,func_806D491C,340,yes
+us,.code,func_8060E3B0,128,yes
+us,.code,func_8066CDF8,236,no
+us,.code,func_806DAA14,200,yes
+us,.code,func_806E2140,284,yes
+us,.code,func_806F8EB4,40,yes
+us,.code,func_806F94AC,108,no
+us,.code,func_806F91B4,568,no
+us,.code,func_80649D74,140,no
+us,.code,func_806E07F8,1012,no
+us,.code,func_8072FCC4,272,no
+us,.code,func_806E9580,644,no
+us,.code,func_806EB058,100,yes
+us,.code,func_806D21E4,84,yes
+us,.code,func_80688F74,76,yes
+us,.code,func_8065A654,12,yes
+us,.code,func_806C8220,748,no
+us,.code,func_807126B0,196,yes
+us,.code,func_806049CC,540,no
+us,.code,func_8060D2C8,1184,no
+us,.code,func_806306D0,60,no
+us,.code,func_8070D928,72,no
+us,.code,func_8066134C,76,yes
+us,.code,func_8072F09C,132,no
+us,.code,func_806C7220,8,yes
+us,.code,func_8060F854,212,no
+us,.code,func_80611730,276,no
+us,.code,func_80632E74,172,no
+us,.code,func_8069F020,2276,no
+us,.code,func_806883C8,44,yes
+us,.code,func_8072E5FC,324,no
+us,.code,func_80672C30,64,yes
+us,.code,func_80659670,764,no
+us,.code,func_806DF670,100,yes
+us,.code,func_806F603C,456,no
+us,.code,func_8067AEFC,72,yes
+us,.code,func_806762C0,72,yes
+us,.code,func_80676D00,464,no
+us,.code,func_8072A920,352,no
+us,.code,func_80672E64,8,yes
+us,.code,func_806E186C,484,yes
+us,.code,func_8060B968,104,no
+us,.code,func_8064EA48,108,yes
+us,.code,func_80685E78,232,no
+us,.code,func_80633570,64,no
+us,.code,func_80661EC4,72,yes
+us,.code,func_80630B70,604,no
+us,.code,func_80602D4C,120,yes
+us,.code,func_80681B14,196,no
+us,.code,func_806E5FA0,220,yes
+us,.code,func_8072DE44,100,yes
+us,.code,func_806C8D20,12,yes
+us,.code,func_806E84A4,28,yes
+us,.code,func_80662838,636,no
+us,.code,func_806DF5A0,208,no
+us,.code,func_806EB400,180,no
+us,.code,func_80712628,12,yes
+us,.code,alEvtqPostEvent,384,yes
+us,.code,func_8064B204,92,no
+us,.code,func_8060C8AC,712,no
+us,.code,func_805FCA94,1348,no
+us,.code,func_8064BB4C,44,yes
+us,.code,func_8072ED90,12,yes
+us,.code,func_806E06E8,148,yes
+us,.code,func_8066CEE4,876,no
+us,.code,func_8064CB3C,324,no
+us,.code,func_806AEE08,124,yes
+us,.code,func_806D3530,216,yes
+us,.code,func_806738D0,264,no
+us,.code,func_8070CCC4,80,yes
+us,.code,func_806ECDD4,88,yes
+us,.code,func_805FE7FC,1672,no
+us,.code,func_806ED508,184,yes
+us,.code,func_8062EBB8,496,no
+us,.code,func_805FB750,148,yes
+us,.code,func_80658B08,200,no
+us,.code,func_8061134C,64,no
+us,.code,func_806D7238,156,yes
+us,.code,func_8063C328,104,yes
+us,.code,func_806C6BC8,1496,no
+us,.code,func_806EEAF8,3384,no
+us,.code,func_806003EC,64,yes
+us,.code,func_806EFA1C,32,yes
+us,.code,func_80672B1C,184,yes
+us,.code,func_806725A0,68,yes
+us,.code,func_80665DE0,104,yes
+us,.code,func_8071C24C,576,no
+us,.code,func_806E36B4,344,no
+us,.code,func_806EA844,92,yes
+us,.code,func_806898F8,96,yes
+us,.code,func_806D5300,1264,yes
+us,.code,func_8060A634,60,yes
+us,.code,gameIsInDKTVMode,84,yes
+us,.code,func_8066104C,8,yes
+us,.code,func_8072EF7C,288,no
+us,.code,func_8073BE54,492,no
+us,.code,func_806EC8C4,208,no
+us,.code,func_8064774C,232,no
+us,.code,func_8064EAB4,136,yes
+us,.code,func_80651B64,92,yes
+us,.code,func_806F39E8,516,no
+us,.code,func_806DC410,1644,no
+us,.code,func_8064A180,20,yes
+us,.code,func_806CF580,760,no
+us,.code,func_805FB300,708,no
+us,.code,func_8060E6E8,180,yes
+us,.code,func_806791EC,20,yes
+us,.code,func_80659DB0,460,no
+us,.code,func_80726EE0,412,no
+us,.code,func_806696A0,400,no
+us,.code,func_806FD9B4,72,no
+us,.code,func_8068BBF8,1160,no
+us,.code,func_806D0408,40,yes
+us,.code,func_806897F0,184,yes
+us,.code,func_8066BB44,188,no
+us,.code,func_8060D14C,380,no
+us,.code,func_80650E20,172,no
+us,.code,func_806EB4B4,68,yes
+us,.code,func_806998E8,8,yes
+us,.code,func_8070DDDC,248,no
+us,.code,func_806EE660,80,yes
+us,.code,func_807063B8,576,no
+us,.code,func_806D27A4,120,yes
+us,.code,func_80688E08,96,yes
+us,.code,func_8068E9B0,136,no
+us,.code,func_807233B4,116,no
+us,.code,func_8067BCA8,32,yes
+us,.code,func_8072D99C,56,yes
+us,.code,func_8062F420,280,no
+us,.code,func_806D1D3C,72,yes
+us,.code,func_805FE4D4,112,no
+us,.code,func_807009F4,240,no
+us,.code,func_80713EB0,432,no
+us,.code,func_8068696C,240,no
+us,.code,func_8072818C,240,no
+us,.code,func_80690C60,720,no
+us,.code,func_806CF138,436,no
+us,.code,func_806D7F48,160,yes
+us,.code,func_805FB7E4,352,no
+us,.code,func_80700BF4,1188,no
+us,.code,func_806CA2E4,604,yes
+us,.code,func_806761D0,28,yes
+us,.code,func_806E9804,112,yes
+us,.code,func_806D5B44,392,yes
+us,.code,func_8060A500,268,no
+us,.code,func_80600B10,172,no
+us,.code,func_80634E10,148,yes
+us,.code,func_806C7228,8,yes
+us,.code,func_80645D14,556,no
+us,.code,func_80737F40,152,no
+us,.code,func_80605510,744,no
+us,.code,func_806FD9FC,144,no
+us,.code,func_8071B44C,212,no
+us,.code,func_806F2A40,520,no
+us,.code,func_806764D8,104,yes
+us,.code,func_80672328,632,no
+us,.code,func_80714660,8,yes
+us,.code,func_806F1858,156,no
+us,.code,func_8067BDF8,56,yes
+us,.code,func_806845B8,252,yes
+us,.code,func_8066E990,92,no
+us,.code,func_806A2B80,16,yes
+us,.code,func_8062C1C0,108,yes
+us,.code,func_8070F2FC,628,no
+us,.code,func_80600BBC,172,no
+us,.code,func_806D8070,56,yes
+us,.code,func_80671D64,156,no
+us,.code,func_80737E90,12,no
+us,.code,func_806EA600,40,yes
+us,.code,func_8063643C,12,yes
+us,.code,func_80600674,732,no
+us,.code,func_806CC970,412,no
+us,.code,func_807300BC,844,no
+us,.code,func_806FF628,308,no
+us,.code,func_806960A4,1232,no
+us,.code,func_806DD874,572,yes
+us,.code,func_80611688,8,yes
+us,.code,func_8063E5B4,256,no
+us,.code,func_80699070,184,no
+us,.code,func_80685708,276,no
+us,.code,func_806025D4,1216,no
+us,.code,func_806A0864,784,no
+us,.code,func_806E3040,444,no
+us,.code,func_80645700,456,no
+us,.code,func_80605380,400,no
+us,.code,func_8067BA7C,492,no
+us,.code,func_80671F54,480,no
+us,.code,func_80608DA8,920,no
+us,.code,func_8069F904,316,no
+us,.code,func_807232B8,52,yes
+us,.code,func_8073A488,144,no
+us,.code,func_8070E548,520,no
+us,.code,func_8071827C,260,no
+us,.code,func_8070A848,236,no
+us,.code,func_80601CC0,48,yes
+us,.code,func_806FA7BC,516,no
+us,.code,func_8066C958,560,no
+us,.code,func_8073A8BC,68,no
+us,.code,func_8066E9EC,120,no
+us,.code,func_8062F050,712,no
+us,.code,func_80658624,700,no
+us,.code,func_8069D358,204,no
+us,.code,func_80737FD8,68,no
+us,.code,func_806CF878,160,yes
+us,.code,func_806ED050,172,yes
+us,.code,func_805FF9AC,1188,no
+us,.code,func_806D2954,192,yes
+us,.code,func_80735A44,8,yes
+us,.code,func_8068BA2C,460,no
+us,.code,func_80689FEC,136,yes
+us,.code,func_806FACE8,764,no
+us,.code,func_8063E078,92,no
+us,.code,func_80738080,76,no
+us,.code,func_806E6E7C,100,yes
+us,.code,func_8067680C,412,no
+us,.code,func_806FDAEC,160,no
+us,.code,func_80663FCC,120,yes
+us,.code,func_80686E40,336,no
+us,.code,func_80661300,76,yes
+us,.code,func_80725BA4,540,no
+us,.code,func_80639C04,204,no
+us,.code,func_806FF358,720,no
+us,.code,func_806F6554,240,no
+us,.code,func_806E1728,204,yes
+us,.code,func_80689E98,12,yes
+us,.code,func_8072CFE8,164,no
+us,.code,func_80671D10,84,yes
+us,.code,func_806822FC,1976,no
+us,.code,func_80655258,440,no
+us,.code,func_80602DC4,168,no
+us,.code,func_8070CBA4,120,yes
+us,.code,func_806EE06C,160,yes
+us,.code,func_8068A7B0,96,yes
+us,.code,func_8063070C,160,no
+us,.code,clearPermanentFlags,80,yes
+us,.code,func_80665558,12,yes
+us,.code,func_807023E8,124,no
+us,.code,func_8060B5C0,268,yes
+us,.code,func_806F4D70,80,yes
+us,.code,func_806D2904,80,yes
+us,.code,func_806EAAA0,164,yes
+us,.code,func_80611154,12,yes
+us,.code,func_807184F4,468,no
+us,.code,func_8066AF40,224,no
+us,.code,func_8069A750,120,no
+us,.code,func_806EBFD0,68,yes
+us,.code,func_80600590,228,no
+us,.code,func_80737E40,8,yes
+us,.code,func_806E9D1C,196,yes
+us,.code,func_806291B4,332,no
+us,.code,func_80709BC4,1628,no
+us,.code,func_807264B0,568,no
+us,.code,func_80715A3C,244,no
+us,.code,func_806E3B00,276,yes
+us,.code,func_806C75A4,1372,no
+us,.code,func_8066715C,24,yes
+us,.code,func_806F8BC4,236,yes
+us,.code,func_8067760C,148,no
+us,.code,func_806EAF6C,128,yes
+us,.code,alEvtqNextEvent,164,yes
+us,.code,func_805FF8F8,64,yes
+us,.code,func_806871DC,548,no
+us,.code,alEvtqNew,156,yes
+us,.code,func_8060188C,40,yes
+us,.code,func_8064F358,172,no
+us,.code,func_806672B8,1444,no
+us,.code,func_80687400,116,yes
+us,.code,func_8064B370,136,yes
+us,.code,func_8067FAC8,164,no
+us,.code,func_806C71A0,8,yes
+us,.code,func_806D3CD4,136,yes
+us,.code,func_805FF168,32,yes
+us,.code,func_8069D018,64,yes
+us,.code,func_8063D468,44,yes
+us,.code,func_8067ABC0,120,yes
+us,.code,func_80737F0C,44,no
+us,.code,setIntroStoryPlaying,16,yes
+us,.code,func_8069CD9C,440,no
+us,.code,func_806E2C74,80,no
+us,.code,func_8063D4A4,264,no
+us,.code,func_8063BEC0,116,no
+us,.code,func_806E9874,132,yes
+us,.code,func_80678458,216,yes
+us,.code,func_806F8278,196,no
+us,.code,func_806EC2CC,240,yes
+us,.code,func_8066BC5C,248,no
+us,.code,func_8066C0DC,472,no
+us,.code,func_806F8A8C,72,yes
+us,.code,func_8062EE48,344,no
+us,.code,func_80642FC4,688,no
+us,.code,func_80602CE0,108,no
+us,.code,func_80724154,436,no
+us,.code,func_80692564,36,yes
+us,.code,func_8072DEA8,388,no
+us,.code,func_80717814,284,no
+us,.code,func_8062A24C,40,yes
+us,.code,func_806F0878,184,yes
+us,.code,func_8069AFF0,32,yes
+us,.code,func_8070DD18,44,no
+us,.code,func_8063E72C,744,no
+us,.code,func_806618A0,532,no
+us,.code,func_806CBE44,76,yes
+us,.code,func_806687E0,216,no
+us,.code,func_80700AE4,272,no
+us,.code,func_806E382C,32,yes
+us,.code,func_806C4EB4,44,yes
+us,.code,func_806FF144,488,no
+us,.code,func_807385F0,380,no
+us,.code,func_80641F68,8,yes
+us,.code,func_80658000,308,no
+us,.code,func_806522CC,168,yes
+us,.code,func_80737A9C,40,no
+us,.code,func_80642940,688,no
+us,.code,func_806EA26C,108,yes
+us,.code,func_80635468,224,no
+us,.code,func_805FEE84,52,yes
+us,.code,func_806E6FF0,96,yes
+us,.code,func_8062F998,560,no
+us,.code,func_8071496C,16,yes
+us,.code,func_8069E774,2012,no
+us,.code,func_80699128,348,no
+us,.code,func_806FC530,1880,no
+us,.code,func_806DFFDC,116,yes
+us,.code,func_80678014,60,yes
+us,.code,func_8063C390,48,yes
+us,.code,func_8064D1E8,560,no
+us,.code,func_806DA4D8,788,no
+us,.code,func_8071AADC,256,no
+us,.code,func_8060AC34,72,no
+us,.code,func_806E7230,264,yes
+us,.code,func_80653EA8,192,no
+us,.code,func_806EBAF4,80,yes
+us,.code,func_8066E72C,296,yes
+us,.code,func_806785D4,504,yes
+us,.code,func_8062F328,96,no
+us,.code,func_8067FB6C,3080,no
+us,.code,func_80645B9C,104,no
+us,.code,func_80602314,284,no
+us,.code,func_80694948,984,no
+us,.code,func_8060BBE0,192,no
+us,.code,func_8073A3C4,196,no
+us,.code,func_8072D08C,176,no
+us,.code,func_8066A834,340,no
+us,.code,func_8073BC74,336,no
+us,.code,func_806018D4,104,no
+us,.code,func_80712774,36,yes
+us,.code,func_806F12FC,84,yes
+us,.code,func_806A6DB4,1432,no
+us,.code,func_806E077C,124,yes
+us,.code,func_8066B0DC,16,yes
+us,.code,func_8073239C,132,yes
+us,.code,func_806D01AC,160,yes
+us,.code,func_806E8724,296,yes
+us,.code,func_806ED0FC,328,yes
+us,.code,func_80674330,268,no
+us,.code,func_8066EA90,44,yes
+us,.code,func_806B2D5C,8,yes
+us,.code,func_806F95C8,64,yes
+us,.code,func_8067E6C4,32,yes
+us,.code,func_80670F04,160,yes
+us,.code,func_80685984,448,no
+us,.code,func_806E330C,272,yes
+us,.code,func_806B7C74,556,no
+us,.code,func_806EE924,112,yes
+us,.code,func_80677CAC,172,yes
+us,.code,func_80666090,496,no
+us,.code,func_806B3F3C,84,yes
+us,.code,func_80740C50,760,no
+us,.code,func_80667110,76,yes
+us,.code,func_806A5DF0,188,no
+us,.code,func_806D2B90,32,yes
+us,.code,func_807149FC,12,yes
+us,.code,func_8065EAF4,20,yes
+us,.code,func_806787CC,32,yes
+us,.code,func_8073243C,8,yes
+us,.code,func_806832F4,232,no
+us,.code,func_80647218,752,no
+us,.code,func_806783BC,108,yes
+us,.code,func_8066B434,120,yes
+us,.code,func_806C1B50,380,no
+us,.code,func_8070FC40,140,no
+us,.code,func_807197B4,600,no
+us,.code,func_8068A164,84,yes
+us,.code,func_806BCF98,252,no
+us,.code,func_806FFF5C,44,yes
+us,.code,func_806A0330,676,no
+us,.code,func_8069A7C8,940,no
+us,.code,func_8071F3C0,132,no
+us,.code,func_8064C708,268,no
+us,.code,func_80681BD8,576,no
+us,.code,func_806D7098,216,yes
+us,.code,func_80675180,180,no
+us,.code,func_8066B424,16,yes
+us,.code,func_806423A8,216,no
+us,.code,func_806086CC,1756,no
+us,.code,func_80672134,500,no
+us,.code,func_8073E268,504,no
+us,.code,func_80663DA0,556,no
+us,.code,playSound,1068,no
+us,.code,func_806C9D7C,96,yes
+us,.code,func_806D8308,516,no
+us,.code,func_8072B7CC,3748,no
+us,.code,func_806F2C48,660,no
+us,.code,func_806016D0,88,yes
+us,.code,func_8073A518,376,no
+us,.code,func_806EF944,196,yes
+us,.code,func_8070835C,536,no
+us,.code,func_8060BA14,260,yes
+us,.code,func_80641C98,264,no
+us,.code,func_806919E0,2044,no
+us,.code,func_8065E124,20,yes
+us,.code,func_8062A808,60,yes
+us,.code,_n_collectPVoices,108,yes
+us,.code,func_80610044,548,no
+us,.code,func_80705B30,208,yes
+us,.code,func_80665160,156,yes
+us,.code,func_807122B4,476,no
+us,.code,func_806D2784,32,yes
+us,.code,func_8073CFB0,176,no
+us,.code,func_806C1640,244,yes
+us,.code,func_8063B4C0,664,no
+us,.code,func_806C7270,820,no
+us,.code,func_806CFDEC,68,yes
+us,.code,func_806AF688,984,no
+us,.code,func_8066241C,436,no
+us,.code,func_8073B560,112,no
+us,.code,func_806C92C4,64,yes
+us,.code,func_806A2328,1332,no
+us,.code,func_8071261C,12,yes
+us,.code,func_806B1EA8,32,yes
+us,.code,func_80674080,208,no
+us,.code,func_8071C914,212,no
+us,.code,func_806AD54C,608,yes
+us,.code,func_8073A2A4,288,no
+us,.code,func_806F1A18,200,yes
+us,.code,func_8070D9AC,124,no
+us,.code,func_8062A850,244,no
+us,.code,func_8062919C,12,yes
+us,.code,func_8071B1AC,160,no
+us,.code,func_8064BBD8,216,no
+us,.code,func_8067880C,8,yes
+us,.code,func_805FBE04,496,yes
+us,.code,func_806A1AC4,1124,no
+us,.code,func_807146F4,20,yes
+us,.code,func_806B486C,76,yes
+us,.code,func_80722FEC,52,yes
+us,.code,func_806B8C78,980,no
+us,.code,func_8069AB74,1148,no
+us,.code,func_806FBEAC,68,no
+us,.code,malloc,364,no
+us,.code,func_8072ED9C,112,no
+us,.code,func_80676C64,76,yes
+us,.code,func_806E88D8,436,no
+us,.code,func_806D2378,36,yes
+us,.code,func_806E5C74,236,yes
+us,.code,func_806E6368,80,yes
+us,.code,func_8069DF58,192,no
+us,.code,func_80650A04,108,no
+us,.code,func_8070FA58,488,no
+us,.code,func_807065F8,940,no
+us,.code,func_806C7B50,92,no
+us,.code,func_8072AB74,1968,no
+us,.code,func_8067B298,8,yes
+us,.code,func_806F3950,44,yes
+us,.code,func_806C9E70,48,yes
+us,.code,func_80651C2C,1312,no
+us,.code,func_80675AFC,372,no
+us,.code,func_80711F90,804,no
+us,.code,func_806C2B2C,592,no
+us,.code,func_806595F0,16,yes
+us,.code,func_806491F4,464,no
+us,.code,func_806D9820,260,no
+us,.code,func_80731654,304,no
+us,.code,func_8066461C,80,yes
+us,.code,func_8063CADC,100,yes
+us,.code,func_806FFB2C,216,no
+us,.code,func_806F1380,72,yes
+us,.code,func_80716FB4,332,no
+us,.code,func_80685020,176,yes
+us,.code,func_80673FDC,164,no
+us,.code,func_8067B42C,32,yes
+us,.code,func_8070AF24,312,no
+us,.code,func_806D59E4,352,yes
+us,.code,func_8063C6D8,172,yes
+us,.code,func_805FB944,792,no
+us,.code,func_80665564,1352,no
+us,.code,func_806F0700,204,yes
+us,.code,func_80703850,608,no
+us,.code,func_80601848,68,yes
+us,.code,loadExits,136,yes
+us,.code,func_8073876C,1076,no
+us,.code,func_8066B924,208,no
+us,.code,func_806FBD5C,336,no
+us,.code,func_806FF75C,976,no
+us,.code,func_806616A0,512,no
+us,.code,func_806EC800,196,yes
+us,.code,func_8067C69C,32,yes
+us,.code,func_806CFECC,40,yes
+us,.code,func_80704484,1244,no
+us,.code,func_805FF000,24,yes
+us,.code,func_8073BDC4,144,no
+us,.code,func_80629174,24,yes
+us,.code,func_806B8898,32,yes
+us,.code,func_80688584,180,yes
+us,.code,func_80652594,332,no
+us,.code,func_80711BD0,960,no
+us,.code,func_80732354,72,yes
diff --git a/progress/progress.jetpac.csv b/progress/progress.jetpac.csv
new file mode 100644
index 00000000..7137de24
--- /dev/null
+++ b/progress/progress.jetpac.csv
@@ -0,0 +1,109 @@
+version,section,function,length,matching
+us,.code,func_800274C0,80,yes
+us,.code,func_80025B70,72,yes
+us,.code,func_80029F7C,728,no
+us,.code,func_80025FC4,280,no
+us,.code,func_8002A8F0,84,no
+us,.code,func_8002ABDC,432,no
+us,.code,func_8002976C,280,no
+us,.code,func_8002466C,564,no
+us,.code,func_80025904,348,no
+us,.code,func_80025A60,272,no
+us,.code,func_80028FC0,164,no
+us,.code,func_8002AEC8,52,yes
+us,.code,func_80026D48,128,no
+us,.code,func_80029AF8,152,yes
+us,.code,func_80024390,120,no
+us,.code,func_800298C8,100,yes
+us,.code,func_80024A4C,64,yes
+us,.code,func_800292C4,396,no
+us,.code,func_8002A374,444,no
+us,.code,func_80027728,1216,no
+us,.code,func_80029C1C,496,no
+us,.code,func_80024408,564,no
+us,.code,func_80028BD0,108,yes
+us,.code,func_80029E0C,368,no
+us,.code,func_80026A3C,116,yes
+us,.code,func_80028CF8,268,no
+us,.code,func_80025C40,96,no
+us,.code,func_80028E88,312,no
+us,.code,func_80029064,328,no
+us,.code,func_8002A2DC,152,no
+us,.code,func_80024A8C,516,no
+us,.code,func_80028C3C,188,yes
+us,.code,func_80027510,228,no
+us,.code,func_80025368,248,no
+us,.code,func_800260DC,572,no
+us,.code,func_8002419C,500,no
+us,.code,func_80027D64,348,no
+us,.code,func_80027108,264,yes
+us,.code,func_8002A530,332,no
+us,.code,func_80026FE0,48,yes
+us,.code,func_8002AD8C,116,no
+us,.code,func_80024F64,56,yes
+us,.code,func_8002992C,96,yes
+us,.code,func_800250A0,200,yes
+us,.code,func_80027410,108,yes
+us,.code,func_80027060,168,yes
+us,.code,func_800254B8,284,no
+us,.code,func_8002463C,48,yes
+us,.code,func_800291AC,88,yes
+us,.code,func_80027480,64,yes
+us,.code,func_80026318,1828,no
+us,.code,func_80028E04,132,no
+us,.code,func_8002998C,364,no
+us,.code,func_80028544,152,no
+us,.code,func_80025F48,124,no
+us,.code,func_80028340,172,no
+us,.code,func_80028B54,124,no
+us,.code,func_8002A944,48,yes
+us,.code,func_80025BB8,136,no
+us,.code,func_8002A6C0,152,yes
+us,.code,func_80025168,512,no
+us,.code,func_800285DC,88,yes
+us,.code,func_8002A67C,68,yes
+us,.code,func_8002A758,408,no
+us,.code,func_8002A2AC,48,no
+us,.code,func_80029884,68,no
+us,.code,func_80024E70,180,no
+us,.code,func_800286D0,640,no
+us,.code,func_800289EC,360,no
+us,.code,func_80024000,412,no
+us,.code,func_8002A974,352,no
+us,.code,func_800275F4,308,no
+us,.code,func_8002AE00,148,no
+us,.code,func_80027010,72,yes
+us,.code,func_80024F9C,260,no
+us,.code,func_8002A254,88,yes
+us,.code,func_80029450,156,no
+us,.code,func_80029B90,140,yes
+us,.code,func_80026CEC,92,no
+us,.code,func_80026AB0,500,no
+us,.code,func_800248A0,72,yes
+us,.code,func_8002AAD4,264,no
+us,.code,func_80027EC0,1152,no
+us,.code,func_800283EC,344,no
+us,.code,func_80026DC8,536,no
+us,.code,func_80027BE8,380,no
+us,.code,func_80027210,64,yes
+us,.code,func_80029640,300,no
+us,.code,func_80027250,224,no
+us,.code,func_80024C90,184,yes
+us,.code,func_8002AEFC,404,no
+us,.code,func_80028950,156,no
+us,.code,func_80024D48,296,no
+us,.code,func_80025CB0,664,no
+us,.code,func_80028634,156,no
+us,.code,func_800294EC,340,no
+us,.code,func_80027380,72,yes
+us,.code,func_800273C8,72,yes
+us,.code,func_80026CA4,72,yes
+us,.code,func_800255D4,300,yes
+us,.code,func_80027330,80,yes
+us,.code,func_80025CA0,16,yes
+us,.code,func_80025700,516,no
+us,.code,func_80029204,192,yes
+us,.code,func_800248E8,356,no
+us,.code,func_80024F24,64,no
+us,.code,func_8002AE94,52,yes
+us,.code,func_80025460,88,yes
diff --git a/progress/progress.menu.csv b/progress/progress.menu.csv
new file mode 100644
index 00000000..459fe278
--- /dev/null
+++ b/progress/progress.menu.csv
@@ -0,0 +1,115 @@
+version,section,function,length,matching
+us,.code,func_80028C18,8,yes
+us,.code,func_8002A36C,252,yes
+us,.code,func_8003264C,736,no
+us,.code,func_8002AB80,340,no
+us,.code,func_8003292C,1572,no
+us,.code,func_80025B64,432,no
+us,.code,func_80026250,64,yes
+us,.code,func_800270E0,1292,no
+us,.code,func_80031980,220,no
+us,.code,func_80026B28,644,no
+us,.code,func_8002AD50,120,no
+us,.code,func_8002C584,176,yes
+us,.code,func_8002ECE8,304,no
+us,.code,func_80030258,232,no
+us,.code,func_80027E60,212,yes
+us,.code,func_8002EF68,796,no
+us,.code,func_800297A8,16,yes
+us,.code,func_8002E420,1176,no
+us,.code,func_80025D44,72,yes
+us,.code,func_800291CC,1500,no
+us,.code,func_80030250,8,yes
+us,.code,func_80026290,24,yes
+us,.code,func_8002AB28,88,no
+us,.code,func_80024BFC,180,yes
+us,.code,func_8002D520,716,no
+us,.code,func_80026874,692,no
+us,.code,func_80024EF0,956,no
+us,.code,func_80026DAC,636,no
+us,.code,func_80028C20,284,yes
+us,.code,func_8002F980,520,no
+us,.code,func_80032550,252,yes
+us,.code,func_8002D8AC,816,no
+us,.code,func_80025FB4,524,no
+us,.code,func_8002FC1C,284,yes
+us,.code,func_80024154,148,yes
+us,.code,func_800322D0,52,yes
+us,.code,func_80029EF8,400,yes
+us,.code,func_80025E04,432,yes
+us,.code,func_8002AA98,144,no
+us,.code,func_8002B708,2496,no
+us,.code,func_800241E8,60,yes
+us,.code,func_80027F34,12,yes
+us,.code,func_8002F6C8,148,yes
+us,.code,func_80026684,108,yes
+us,.code,func_800317E8,408,no
+us,.code,func_80027E10,80,yes
+us,.code,func_8002DEE8,192,yes
+us,.code,func_8002FE08,180,yes
+us,.code,func_8002A638,1120,no
+us,.code,func_8002F8EC,148,yes
+us,.code,func_8002A468,464,yes
+us,.code,func_8002CFA4,1404,no
+us,.code,func_8002C634,744,no
+us,.code,func_8002CB18,1164,no
+us,.code,func_8002FB88,148,no
+us,.code,func_800266F0,276,yes
+us,.code,func_8003155C,652,no
+us,.code,func_800275FC,316,no
+us,.code,func_80024CB0,576,no
+us,.code,func_8002907C,152,no
+us,.code,func_800261C0,144,yes
+us,.code,func_8002DBDC,780,no
+us,.code,func_80026804,112,yes
+us,.code,func_80030A90,388,no
+us,.code,func_80025AE0,8,yes
+us,.code,func_8002ADC8,2368,no
+us,.code,func_8002F284,1092,no
+us,.code,func_80028D3C,364,no
+us,.code,func_800252AC,2100,no
+us,.code,func_80030340,1364,no
+us,.code,func_80027738,208,no
+us,.code,func_80031B08,1308,no
+us,.code,func_800275EC,16,yes
+us,.code,func_80029AAC,264,yes
+us,.code,func_80024000,188,no
+us,.code,func_800244EC,668,no
+us,.code,func_8002FEBC,916,no
+us,.code,func_80025D8C,120,yes
+us,.code,func_8002C91C,508,no
+us,.code,func_80027028,184,yes
+us,.code,func_80027FAC,1820,no
+us,.code,func_80025AF0,116,no
+us,.code,func_800240BC,152,yes
+us,.code,func_80032304,456,no
+us,.code,func_80029D30,456,no
+us,.code,func_80027DEC,32,yes
+us,.code,func_8002E8B8,1072,no
+us,.code,func_800324CC,132,no
+us,.code,func_80032024,684,no
+us,.code,func_80029BB4,380,no
+us,.code,func_8002ACD4,124,no
+us,.code,func_8002C0C8,1212,no
+us,.code,func_80027808,384,no
+us,.code,func_8002D7EC,192,yes
+us,.code,func_80024788,1140,no
+us,.code,func_80028EA8,468,yes
+us,.code,func_8002FD38,208,yes
+us,.code,func_80025D14,48,yes
+us,.code,func_80030894,508,no
+us,.code,func_80027988,1124,no
+us,.code,func_80031A5C,172,no
+us,.code,func_80028834,996,no
+us,.code,func_80024224,500,no
+us,.code,func_8002EE18,336,yes
+us,.code,func_8002F75C,400,no
+us,.code,func_8002DFA8,1144,no
+us,.code,func_8002A088,740,no
+us,.code,func_800286C8,364,no
+us,.code,func_80029114,184,yes
+us,.code,func_80027F40,108,yes
+us,.code,func_800262A8,988,no
+us,.code,func_800297B8,756,no
+us,.code,func_80024418,212,yes
+us,.code,func_80030C14,2376,no
diff --git a/progress/progress.minecart.csv b/progress/progress.minecart.csv
new file mode 100644
index 00000000..d43c418f
--- /dev/null
+++ b/progress/progress.minecart.csv
@@ -0,0 +1,26 @@
+version,section,function,length,matching
+us,.code,func_8002430C,1116,no
+us,.code,func_80024B00,888,no
+us,.code,func_80024768,296,yes
+us,.code,func_80024E78,344,no
+us,.code,func_80024914,492,no
+us,.code,func_80027E04,228,no
+us,.code,func_80024254,184,no
+us,.code,func_80027778,1404,no
+us,.code,func_80026DA8,2512,no
+us,.code,func_8002835C,912,no
+us,.code,func_800286EC,1188,no
+us,.code,func_800241A0,180,yes
+us,.code,func_800253C0,4656,no
+us,.code,func_80027CF4,172,no
+us,.code,func_80026C54,340,yes
+us,.code,func_80027EE8,468,no
+us,.code,func_800280BC,672,no
+us,.code,func_80024000,220,yes
+us,.code,func_800240DC,196,yes
+us,.code,func_80027DA0,100,no
+us,.code,func_800265F0,1404,no
+us,.code,func_80026B6C,232,yes
+us,.code,func_8002538C,52,yes
+us,.code,func_80024FD0,956,no
+us,.code,func_80024890,132,no
diff --git a/progress/progress.multiplayer.csv b/progress/progress.multiplayer.csv
new file mode 100644
index 00000000..0671fa7b
--- /dev/null
+++ b/progress/progress.multiplayer.csv
@@ -0,0 +1,32 @@
+version,section,function,length,matching
+us,.code,func_800245B0,316,no
+us,.code,func_8002698C,60,yes
+us,.code,func_80025654,320,no
+us,.code,func_80025B48,416,no
+us,.code,func_800253C8,60,yes
+us,.code,func_80025CE8,668,no
+us,.code,func_80026E20,336,no
+us,.code,func_80024254,168,no
+us,.code,func_80025FFC,152,no
+us,.code,func_80026BD8,360,no
+us,.code,func_800246EC,748,no
+us,.code,func_80025608,76,no
+us,.code,func_80024CA4,1472,no
+us,.code,func_80026B0C,204,yes
+us,.code,func_8002452C,132,yes
+us,.code,func_80025794,948,no
+us,.code,func_800242FC,204,yes
+us,.code,func_80025264,276,no
+us,.code,func_800243C8,212,no
+us,.code,func_80024000,500,no
+us,.code,func_80025404,516,no
+us,.code,func_80026D40,224,yes
+us,.code,func_800268C0,28,yes
+us,.code,func_80026094,2092,no
+us,.code,func_800269C8,324,no
+us,.code,func_800249D8,716,no
+us,.code,func_800241F4,96,no
+us,.code,func_80025378,80,no
+us,.code,func_80025F84,120,no
+us,.code,func_800268DC,176,no
+us,.code,func_8002449C,144,yes
diff --git a/progress/progress.race.csv b/progress/progress.race.csv
new file mode 100644
index 00000000..3613e099
--- /dev/null
+++ b/progress/progress.race.csv
@@ -0,0 +1,114 @@
+version,section,function,length,matching
+us,.code,func_800274C0,496,no
+us,.code,func_8002D2C0,120,no
+us,.code,func_8002DD70,48,yes
+us,.code,func_80027AF8,56,yes
+us,.code,func_8002CAC8,292,no
+us,.code,func_800282D8,252,no
+us,.code,func_800294A8,740,no
+us,.code,func_80024634,92,yes
+us,.code,func_8002D40C,148,no
+us,.code,func_8002578C,24,yes
+us,.code,func_8002F420,112,no
+us,.code,func_8002DF38,656,no
+us,.code,func_8002E960,76,no
+us,.code,func_8002B6C8,44,yes
+us,.code,func_80026B20,392,no
+us,.code,func_8002B6F4,120,yes
+us,.code,func_8002DE78,192,no
+us,.code,func_8002D338,40,yes
+us,.code,func_80027710,368,no
+us,.code,func_80024690,4320,no
+us,.code,func_8002A7F8,1652,no
+us,.code,castleCarRaceSetup,76,yes
+us,.code,func_80027BD0,144,no
+us,.code,func_8002DC24,204,no
+us,.code,func_8002D72C,40,yes
+us,.code,func_80026F04,1468,no
+us,.code,func_80029F88,248,no
+us,.code,func_80026EE4,32,yes
+us,.code,func_8002AE6C,48,yes
+us,.code,func_8002F490,756,no
+us,.code,func_8002D360,172,no
+us,.code,func_80026354,1996,no
+us,.code,func_80027C60,136,yes
+us,.code,func_8002F0AC,468,no
+us,.code,func_8002DDA0,216,no
+us,.code,func_8002D224,156,no
+us,.code,func_8002DB90,148,yes
+us,.code,func_80028E20,564,no
+us,.code,func_80027CE8,1024,no
+us,.code,func_8002E1C8,256,no
+us,.code,sealRaceSetup,32,yes
+us,.code,func_8002ECD4,48,yes
+us,.code,func_8002F280,132,no
+us,.code,func_8002E2C8,412,no
+us,.code,func_8002E9AC,76,no
+us,.code,func_8002BBD0,92,yes
+us,.code,func_8002D0B0,76,yes
+us,.code,func_80026D2C,440,no
+us,.code,func_800283D4,108,no
+us,.code,func_8002F304,104,yes
+us,.code,func_80027B30,160,no
+us,.code,func_8002BDDC,268,no
+us,.code,func_8002F90C,68,yes
+us,.code,func_800292B0,32,yes
+us,.code,func_80026004,76,yes
+us,.code,func_80029054,604,no
+us,.code,func_8002978C,2044,no
+us,.code,func_8002CFF0,116,yes
+us,.code,func_800292D0,440,no
+us,.code,func_80025FDC,40,yes
+us,.code,setupRaceOnMapLoad,204,yes
+us,.code,func_800280E8,496,no
+us,.code,func_8002BCD4,264,no
+us,.code,func_8002E464,32,yes
+us,.code,func_8002A0AC,1444,no
+us,.code,func_8002A080,44,yes
+us,.code,func_800276B0,96,no
+us,.code,func_80024000,1588,no
+us,.code,func_8002597C,1312,no
+us,.code,func_80026CA8,132,yes
+us,.code,func_8002F36C,180,no
+us,.code,func_8002D0FC,76,yes
+us,.code,func_8002B180,920,no
+us,.code,func_8002B610,184,no
+us,.code,func_8002C63C,304,no
+us,.code,func_80026050,72,yes
+us,.code,func_800261E0,372,no
+us,.code,func_8002DCF0,128,no
+us,.code,func_80027880,160,no
+us,.code,func_80025770,28,yes
+us,.code,func_8002F950,448,no
+us,.code,func_8002CBEC,1028,no
+us,.code,func_8002B76C,504,no
+us,.code,func_80028AD0,848,no
+us,.code,func_8002AE9C,740,no
+us,.code,func_8002F04C,96,no
+us,.code,func_8002E8EC,116,no
+us,.code,func_8002BEE8,612,no
+us,.code,func_8002B518,248,no
+us,.code,func_8002F784,392,no
+us,.code,func_8002E9F8,528,no
+us,.code,func_8002EDD4,632,no
+us,.code,func_8002D148,220,no
+us,.code,func_8002D754,36,yes
+us,.code,func_8002B964,620,no
+us,.code,func_80026098,328,no
+us,.code,func_80028440,1680,no
+us,.code,func_8002D524,520,no
+us,.code,func_8002BC2C,132,no
+us,.code,func_8002ED04,208,yes
+us,.code,func_8002E484,448,no
+us,.code,func_80025E9C,320,no
+us,.code,func_80027920,472,no
+us,.code,initializeCastleCarRace,424,no
+us,.code,func_8002C14C,412,no
+us,.code,func_8002C76C,860,no
+us,.code,func_800257A4,472,no
+us,.code,func_8002DA68,296,yes
+us,.code,func_8002C2E8,852,no
+us,.code,func_8002BCB0,36,no
+us,.code,func_8002D778,752,no
+us,.code,func_8002E644,680,no
+us,.code,func_8002D4A0,132,yes
diff --git a/progress/progress.total.csv b/progress/progress.total.csv
new file mode 100644
index 00000000..fbb0fb8e
--- /dev/null
+++ b/progress/progress.total.csv
@@ -0,0 +1,4216 @@
+version,section,function,length,matching
+us,.code,func_80680908,232,yes
+us,.code,func_806C4414,1264,no
+us,.code,func_8072E5B0,76,yes
+us,.code,func_8069902C,32,yes
+us,.code,func_806436A4,60,yes
+us,.code,func_80688E68,60,yes
+us,.code,func_8071F2F8,200,no
+us,.code,func_806D3608,196,yes
+us,.code,func_80666290,204,yes
+us,.code,func_8071D0F0,368,no
+us,.code,func_8073726C,560,no
+us,.code,func_80651BC0,32,yes
+us,.code,func_8071B8EC,552,no
+us,.code,func_8060B430,108,no
+us,.code,func_8060042C,40,yes
+us,.code,func_8066EB40,16,yes
+us,.code,func_806EDFF8,52,yes
+us,.code,func_8067E764,32,yes
+us,.code,func_80738C6C,180,no
+us,.code,func_805FFFC8,124,yes
+us,.code,func_80652EBC,104,yes
+us,.code,func_80666AEC,12,yes
+us,.code,func_8066BF0C,228,yes
+us,.code,func_80643B24,232,no
+us,.code,func_806ED6B0,2376,no
+us,.code,func_806EB364,156,yes
+us,.code,func_806FA504,160,no
+us,.code,func_806679BC,2916,no
+us,.code,func_806F8CB0,76,yes
+us,.code,func_80679DC4,728,no
+us,.code,func_8068408C,160,yes
+us,.code,func_80724B5C,208,no
+us,.code,func_8073801C,100,no
+us,.code,func_80647170,168,no
+us,.code,func_80697184,160,yes
+us,.code,func_80658DAC,172,no
+us,.code,func_806B513C,416,yes
+us,.code,func_80610C74,344,no
+us,.code,func_8064C134,284,no
+us,.code,func_8067E4D4,60,yes
+us,.code,func_806458C8,412,no
+us,.code,func_8066A584,200,no
+us,.code,func_806688B8,132,no
+us,.code,func_8071B758,324,no
+us,.code,func_80646978,1100,no
+us,.code,func_807105D4,1740,no
+us,.code,func_806E8244,608,no
+us,.code,func_80687EE0,156,no
+us,.code,func_80663BE8,120,no
+us,.code,func_806BF218,1800,no
+us,.code,func_80712548,44,yes
+us,.code,func_80695BAC,1272,no
+us,.code,func_8060956C,1556,no
+us,.code,func_80738320,144,no
+us,.code,func_806EBA04,112,yes
+us,.code,n_alSynNew,1540,no
+us,.code,func_8066D4DC,1636,no
+us,.code,func_8062AC68,192,no
+us,.code,func_80675E3C,164,no
+us,.code,func_80712BD4,776,no
+us,.code,func_8060A900,188,yes
+us,.code,func_8065D964,48,yes
+us,.code,func_806E35D8,220,yes
+us,.code,func_806506E8,172,yes
+us,.code,func_807149B8,16,yes
+us,.code,func_80686CF8,328,no
+us,.code,func_806E6DE8,148,yes
+us,.code,func_8068581C,112,yes
+us,.code,func_805FD030,88,yes
+us,.code,func_806521F8,212,no
+us,.code,func_8063D1D8,176,yes
+us,.code,func_8063D494,16,yes
+us,.code,func_8063BBB0,784,no
+us,.code,func_80650BBC,108,no
+us,.code,func_80605314,108,no
+us,.code,func_806C1CCC,376,yes
+us,.code,func_8062D2AC,68,yes
+us,.code,func_80662110,72,yes
+us,.code,func_80687D50,400,no
+us,.code,func_80672F94,272,no
+us,.code,func_8065D244,16,yes
+us,.code,func_806B91E0,2768,no
+us,.code,func_806A6094,40,yes
+us,.code,func_806335B0,204,no
+us,.code,func_806F8004,364,yes
+us,.code,func_8066FC0C,352,no
+us,.code,func_8066A64C,272,no
+us,.code,func_806951B0,56,yes
+us,.code,func_8069D098,32,yes
+us,.code,func_806A7B4C,36,yes
+us,.code,func_8065C240,244,no
+us,.code,func_806C2D7C,120,yes
+us,.code,func_806C8DE0,120,no
+us,.code,func_806323C0,380,no
+us,.code,func_80698FEC,32,yes
+us,.code,func_806C55D8,8,yes
+us,.code,func_80689114,196,no
+us,.code,func_80714778,460,no
+us,.code,func_806B7830,904,no
+us,.code,func_8068EB3C,440,no
+us,.code,n_alSynDelete,28,yes
+us,.code,func_8071C004,584,no
+us,.code,func_80675380,248,no
+us,.code,func_80732DEC,292,no
+us,.code,func_8067B3F4,56,yes
+us,.code,func_8067BD08,32,yes
+us,.code,func_8060F208,76,no
+us,.code,func_807180F4,48,yes
+us,.code,func_8066DB40,500,no
+us,.code,func_80700088,548,no
+us,.code,func_80695B50,92,yes
+us,.code,func_80677FA8,108,no
+us,.code,func_806734E4,548,no
+us,.code,func_8063E0D4,1248,no
+us,.code,func_806E1BA4,404,no
+us,.code,func_806E93F8,112,yes
+us,.code,func_80719A0C,380,no
+us,.code,func_80668B28,264,no
+us,.code,func_80718124,100,yes
+us,.code,func_8073C820,176,no
+us,.code,func_806E1D38,284,yes
+us,.code,func_806547A8,644,no
+us,.code,func_8073E8A0,20,no
+us,.code,func_806A61D0,96,yes
+us,.code,func_80600950,12,yes
+us,.code,func_80711410,1344,no
+us,.code,func_806D1568,1088,no
+us,.code,func_806E9ACC,112,yes
+us,.code,func_806ACFFC,612,no
+us,.code,func_8060CBBC,1260,no
+us,.code,func_805FF158,16,yes
+us,.code,func_8067AE90,108,yes
+us,.code,func_8065FB04,96,yes
+us,.code,func_8063393C,224,no
+us,.code,func_80674E14,876,no
+us,.code,func_806F14BC,428,no
+us,.code,func_806C71D0,8,yes
+us,.code,func_8065EACC,40,yes
+us,.code,func_805FF018,24,yes
+us,.code,func_806EA2D8,92,yes
+us,.code,func_806CFF9C,436,no
+us,.code,func_8060C2C4,124,yes
+us,.code,func_806B83E4,712,no
+us,.code,func_806F9D8C,1048,no
+us,.code,func_805FF2F4,132,yes
+us,.code,func_806EE634,44,yes
+us,.code,func_8067BE30,284,no
+us,.code,func_807315D4,128,no
+us,.code,func_806BA240,1324,no
+us,.code,func_80601A10,688,no
+us,.code,func_806B3D18,140,yes
+us,.code,func_80632860,1456,no
+us,.code,func_80671E00,340,no
+us,.code,func_806449C0,88,yes
+us,.code,func_807138CC,476,no
+us,.code,func_8060D788,32,yes
+us,.code,func_807002AC,144,no
+us,.code,func_80738230,112,no
+us,.code,func_806FD094,1020,no
+us,.code,func_806E5044,472,yes
+us,.code,func_80737E30,8,yes
+us,.code,func_8060B84C,172,no
+us,.code,func_806EE1C4,168,yes
+us,.code,func_80684D98,648,no
+us,.code,func_8061116C,32,yes
+us,.code,func_80669C6C,72,yes
+us,.code,func_80676ED0,632,no
+us,.code,func_8066EE50,540,no
+us,.code,func_806F9608,100,no
+us,.code,func_806608FC,1084,no
+us,.code,func_806C71D8,8,yes
+us,.code,func_806E88AC,44,yes
+us,.code,func_806EA628,448,no
+us,.code,func_806ACC64,132,yes
+us,.code,func_806D24A8,60,yes
+us,.code,func_806AD9F4,996,yes
+us,.code,func_807095E4,684,no
+us,.code,func_806903BC,180,yes
+us,.code,func_806A63A8,96,yes
+us,.code,func_80653A70,256,yes
+us,.code,func_8069D2AC,172,yes
+us,.code,func_8065F4F4,252,no
+us,.code,areAllKeysTurnedIn,92,yes
+us,.code,func_80666A94,12,yes
+us,.code,func_806349FC,716,no
+us,.code,func_806E34D8,84,yes
+us,.code,func_806438B8,620,no
+us,.code,func_8066CCD8,248,no
+us,.code,func_806D5218,232,yes
+us,.code,func_8064F6C0,56,no
+us,.code,func_8065CE4C,364,no
+us,.code,func_80688A6C,452,no
+us,.code,func_806333F8,376,no
+us,.code,func_8064DE04,344,no
+us,.code,func_8065092C,108,no
+us,.code,func_806B9EB4,636,yes
+us,.code,func_8060193C,124,no
+us,.code,func_8069FDA0,1004,no
+us,.code,func_80652B04,196,yes
+us,.code,func_806E9BA8,308,no
+us,.code,func_8067E278,108,yes
+us,.code,func_806A018C,356,no
+us,.code,func_80726164,844,no
+us,.code,func_80684BB0,488,no
+us,.code,func_806E8AF0,56,yes
+us,.code,func_8060B700,80,yes
+us,.code,func_80704108,40,yes
+us,.code,func_807359A0,148,no
+us,.code,func_8066BD54,140,no
+us,.code,func_80663844,392,yes
+us,.code,func_80731D20,328,no
+us,.code,func_8069D0D8,32,yes
+us,.code,func_80664A38,632,no
+us,.code,func_806EE7F4,132,yes
+us,.code,func_806C7B00,52,yes
+us,.code,func_8064F308,80,yes
+us,.code,func_8063253C,16,yes
+us,.code,func_806FBB9C,152,yes
+us,.code,func_806627CC,108,yes
+us,.code,func_806A3B78,244,no
+us,.code,func_80642C78,444,no
+us,.code,func_80648C50,52,yes
+us,.code,func_80641F70,508,no
+us,.code,func_80629148,44,yes
+us,.code,func_806CF0D0,104,yes
+us,.code,func_80652F9C,64,yes
+us,.code,func_8067BCC8,32,yes
+us,.code,func_80647610,316,no
+us,.code,func_8073A7B8,260,no
+us,.code,func_8071B2EC,352,no
+us,.code,func_806E9CFC,32,yes
+us,.code,func_806EFD50,172,yes
+us,.code,func_80678814,8,yes
+us,.code,func_8060F54C,484,no
+us,.code,func_806F007C,64,yes
+us,.code,func_80725DC0,276,no
+us,.code,func_806FB714,412,no
+us,.code,func_80654418,444,no
+us,.code,func_8072B324,12,yes
+us,.code,func_8069E724,80,no
+us,.code,func_8062B3C4,180,no
+us,.code,func_80737B48,8,yes
+us,.code,func_80668E9C,1772,no
+us,.code,func_80604D70,724,no
+us,.code,func_806F544C,76,yes
+us,.code,func_805FEEB8,76,yes
+us,.code,func_80701CA0,1864,no
+us,.code,func_806A0F78,144,yes
+us,.code,func_80663A0C,116,yes
+us,.code,func_806809F0,4388,no
+us,.code,func_806D79E4,68,yes
+us,.code,func_805FF800,152,yes
+us,.code,func_806A7B04,36,yes
+us,.code,func_80659320,48,yes
+us,.code,func_8072B438,356,no
+us,.code,func_80704130,360,no
+us,.code,func_8070C2D8,696,no
+us,.code,func_80647B74,384,no
+us,.code,func_8071B24C,160,no
+us,.code,func_806D1420,328,yes
+us,.code,func_806D06A0,708,yes
+us,.code,func_80678F9C,116,no
+us,.code,func_8062F538,264,no
+us,.code,func_80630324,120,yes
+us,.code,func_80723380,52,yes
+us,.code,func_80705F5C,1116,no
+us,.code,func_80655CF8,216,no
+us,.code,func_806A62D4,116,yes
+us,.code,func_8066C610,484,no
+us,.code,func_806CD424,1140,no
+us,.code,func_8070AC74,688,no
+us,.code,func_80658134,452,no
+us,.code,func_80723284,52,yes
+us,.code,func_807024E0,3732,no
+us,.code,func_80652A08,252,yes
+us,.code,func_8064BCB0,124,yes
+us,.code,func_806DFF34,108,no
+us,.code,func_806BDEC8,468,yes
+us,.code,func_80654E84,360,no
+us,.code,func_8068C080,52,yes
+us,.code,func_8060A398,312,no
+us,.code,func_80682AB4,832,no
+us,.code,func_806921DC,804,no
+us,.code,func_8064EC04,92,no
+us,.code,func_806BD7B0,1404,no
+us,.code,func_80732444,140,no
+us,.code,func_80699914,68,yes
+us,.code,func_806E67D8,608,yes
+us,.code,func_806710E0,384,no
+us,.code,func_806AE588,2176,no
+us,.code,func_806FDAB8,52,yes
+us,.code,func_8072EE7C,256,no
+us,.code,func_806D374C,128,yes
+us,.code,func_80688638,168,no
+us,.code,func_80724C78,44,yes
+us,.code,func_80610350,1692,no
+us,.code,func_8064B9E0,276,no
+us,.code,func_806F0D68,736,no
+us,.code,func_8060C430,536,no
+us,.code,func_806C6B50,80,yes
+us,.code,func_80726DEC,116,no
+us,.code,func_8072E22C,132,yes
+us,.code,func_807324D0,100,no
+us,.code,func_8070D82C,148,no
+us,.code,func_80659110,128,yes
+us,.code,func_80676220,56,yes
+us,.code,func_80738118,88,no
+us,.code,func_806DED44,780,no
+us,.code,func_8060EC54,44,yes
+us,.code,func_8062BB2C,412,no
+us,.code,func_806A495C,552,no
+us,.code,func_80654BC0,268,no
+us,.code,func_806B3680,1456,no
+us,.code,func_806E4740,920,no
+us,.code,func_8060E930,40,yes
+us,.code,func_80737E38,8,yes
+us,.code,func_8063A38C,1212,no
+us,.code,func_806338B4,64,no
+us,.code,func_8063B8D8,728,no
+us,.code,func_806644B0,264,no
+us,.code,func_8063D9D0,112,no
+us,.code,func_806FDB8C,912,no
+us,.code,func_80665AAC,32,no
+us,.code,func_8068A764,32,no
+us,.code,func_8070B324,1224,no
+us,.code,func_8060BEA8,220,no
+us,.code,func_806FA1A4,864,no
+us,.code,func_8067BF84,820,no
+us,.code,func_806B1DD4,212,yes
+us,.code,func_806A2B08,24,yes
+us,.code,func_80664044,348,no
+us,.code,func_8071458C,108,yes
+us,.code,func_806D6F0C,88,yes
+us,.code,func_806CE928,540,no
+us,.code,func_80666AA0,12,yes
+us,.code,func_8062D094,56,yes
+us,.code,func_80669CB4,336,no
+us,.code,func_807195D4,480,no
+us,.code,func_8070CC54,56,yes
+us,.code,func_8072DAA4,196,yes
+us,.code,func_8065FD88,304,no
+us,.code,func_8072881C,308,no
+us,.code,func_806998F0,36,yes
+us,.code,func_8064C250,408,no
+us,.code,func_806D9184,32,yes
+us,.code,func_806EBF34,64,yes
+us,.code,func_8067BF4C,56,yes
+us,.code,func_8067DCC0,644,no
+us,.code,func_8064A194,196,no
+us,.code,func_80740100,1704,no
+us,.code,func_8070E8F0,2520,no
+us,.code,func_8070E8DC,16,yes
+us,.code,func_806DABE4,444,yes
+us,.code,func_806EC014,48,yes
+us,.code,func_8068ECF4,608,no
+us,.code,func_8067BC88,32,yes
+us,.code,func_8069904C,32,yes
+us,.code,func_8066AEE4,92,yes
+us,.code,func_806689F0,312,no
+us,.code,func_80636C00,312,no
+us,.code,func_8064B7C0,20,yes
+us,.code,func_805FF5A0,136,yes
+us,.code,func_806EE74C,108,yes
+us,.code,func_806A7518,232,yes
+us,.code,func_807383B0,60,no
+us,.code,func_807146A4,60,no
+us,.code,func_8073B9B0,176,no
+us,.code,func_80688EA4,64,yes
+us,.code,func_80688D20,232,no
+us,.code,func_806C498C,68,yes
+us,.code,func_806EA7E8,92,yes
+us,.code,func_80627B58,172,yes
+us,.code,func_80671528,724,no
+us,.code,func_806010A0,128,yes
+us,.code,func_806C13AC,368,no
+us,.code,func_8064B150,64,no
+us,.code,func_806D9D58,632,no
+us,.code,func_80712798,28,yes
+us,.code,func_80737C20,212,no
+us,.code,func_80685520,488,yes
+us,.code,func_8067ACC0,28,yes
+us,.code,func_80723C98,52,yes
+us,.code,func_8067B288,8,yes
+us,.code,func_8071375C,8,yes
+us,.code,func_8071268C,36,yes
+us,.code,func_806C4948,68,yes
+us,.code,func_8069DC80,192,no
+us,.code,func_8072E54C,100,no
+us,.code,func_806330C4,820,no
+us,.code,func_806641A0,548,no
+us,.code,func_80665E48,76,no
+us,.code,func_806645B8,100,no
+us,.code,func_80639FC0,972,no
+us,.code,func_8070CDD0,592,no
+us,.code,func_806E8F68,264,yes
+us,.code,func_806E6234,228,yes
+us,.code,func_80662AB4,220,no
+us,.code,func_80657974,828,no
+us,.code,func_80652374,300,no
+us,.code,func_80666AF8,656,no
+us,.code,func_806DA7EC,176,yes
+us,.code,func_8060A7C0,320,no
+us,.code,func_806D9AD4,644,no
+us,.code,func_806C49D0,244,yes
+us,.code,func_806D6F64,308,no
+us,.code,func_806E9DE0,236,no
+us,.code,func_8069DA54,444,no
+us,.code,func_805FF188,40,yes
+us,.code,func_806E2DE8,132,yes
+us,.code,func_806D0150,92,yes
+us,.code,func_8062AD28,1132,no
+us,.code,func_806C7240,8,yes
+us,.code,func_80715E94,4220,no
+us,.code,func_80654A2C,404,no
+us,.code,func_8060F254,760,no
+us,.code,func_8071338C,172,no
+us,.code,func_8070B05C,684,no
+us,.code,func_806686F4,236,no
+us,.code,func_80712944,252,no
+us,.code,func_806F6204,848,no
+us,.code,func_8063039C,40,yes
+us,.code,func_806C9D20,92,yes
+us,.code,func_806E98F8,108,yes
+us,.code,func_80677D58,36,yes
+us,.code,func_806348B4,84,no
+us,.code,func_806AD84C,352,yes
+us,.code,func_806951E8,1340,no
+us,.code,func_8068B8FC,52,no
+us,.code,func_806DF050,336,yes
+us,.code,func_8071D260,44,no
+us,.code,func_8060E430,120,yes
+us,.code,func_8062B194,140,yes
+us,.code,func_8069B010,1004,no
+us,.code,func_806FDA8C,44,yes
+us,.code,func_806F1048,160,yes
+us,.code,func_80723484,1104,no
+us,.code,func_8068086C,156,yes
+us,.code,func_8060866C,96,yes
+us,.code,func_8064F1C4,76,yes
+us,.code,func_8066B5C8,44,yes
+us,.code,func_80690F30,1664,no
+us,.code,func_807278C0,152,no
+us,.code,func_80665AE4,308,no
+us,.code,func_80676C10,84,no
+us,.code,func_8066E6C8,100,yes
+us,.code,func_80659190,12,yes
+us,.code,func_8066EAEC,84,no
+us,.code,func_8064F404,64,yes
+us,.code,func_806EFA3C,272,no
+us,.code,func_8063CA7C,96,yes
+us,.code,func_8060EE60,880,no
+us,.code,func_80690470,144,no
+us,.code,func_8068A10C,12,yes
+us,.code,func_806FB914,580,no
+us,.code,func_80690BE8,120,yes
+us,.code,func_8063C248,96,yes
+us,.code,func_8070C89C,88,yes
+us,.code,func_806A1F28,60,yes
+us,.code,func_80657508,100,yes
+us,.code,func_806E8E00,120,yes
+us,.code,func_806C7248,8,yes
+us,.code,func_806E5E68,64,yes
+us,.code,func_80672CBC,424,no
+us,.code,func_8066F4AC,928,no
+us,.code,func_8064DF5C,536,no
+us,.code,func_806F0930,184,yes
+us,.code,func_8064A804,704,no
+us,.code,func_8066A988,648,no
+us,.code,func_806C9F00,68,yes
+us,.code,func_806A2B20,24,yes
+us,.code,func_8070E2AC,160,no
+us,.code,func_8068450C,32,yes
+us,.code,func_8064BFD0,356,no
+us,.code,func_806EE700,76,yes
+us,.code,func_80674B90,644,no
+us,.code,func_807130D4,148,yes
+us,.code,func_80650D04,136,no
+us,.code,func_8063C2A8,128,no
+us,.code,func_80689EA4,64,yes
+us,.code,func_80676B38,56,yes
+us,.code,func_806E04E0,372,yes
+us,.code,func_80707980,2524,no
+us,.code,func_806858E8,156,no
+us,.code,func_806B11C0,208,yes
+us,.code,func_8072ECFC,148,no
+us,.code,func_8068EF54,2008,no
+us,.code,func_8068842C,52,yes
+us,.code,func_80677ED0,216,no
+us,.code,func_806D3D5C,136,yes
+us,.code,func_806A3E9C,1000,no
+us,.code,func_806C8E58,144,no
+us,.code,func_8071F444,540,no
+us,.code,func_80732B3C,580,no
+us,.code,func_8064431C,200,no
+us,.code,func_80692500,32,yes
+us,.code,func_8070D464,260,no
+us,.code,func_80674688,132,no
+us,.code,func_806634A4,240,no
+us,.code,func_80665C18,456,no
+us,.code,func_806DC3A4,108,yes
+us,.code,func_806BE674,124,yes
+us,.code,func_806FD7A8,236,no
+us,.code,func_806E9ECC,192,no
+us,.code,func_806FD8E0,112,no
+us,.code,func_8066CDD0,40,yes
+us,.code,func_806E5E60,8,yes
+us,.code,func_806621D0,508,no
+us,.code,func_8069B3FC,1120,no
+us,.code,func_807273A8,388,no
+us,.code,func_8068ABE0,412,no
+us,.code,func_806E52D0,440,no
+us,.code,func_806E8B28,124,yes
+us,.code,func_80608528,180,no
+us,.code,func_806877C8,68,yes
+us,.code,func_8073CAC0,468,no
+us,.code,func_806663F8,36,yes
+us,.code,func_8073198C,76,no
+us,.code,func_806AD9AC,72,yes
+us,.code,func_8065756C,100,yes
+us,.code,func_806F9B64,364,no
+us,.code,func_80702464,124,no
+us,.code,func_806836D0,944,no
+us,.code,func_806767E0,44,yes
+us,.code,func_8060B750,116,yes
+us,.code,func_80731B60,40,yes
+us,.code,func_8067ACDC,216,yes
+us,.code,func_80729B00,876,no
+us,.code,func_80645614,236,yes
+us,.code,func_806D0EBC,452,yes
+us,.code,func_806E61D0,100,no
+us,.code,func_8065E0CC,88,yes
+us,.code,func_8072E7DC,140,no
+us,.code,func_80672680,92,yes
+us,.code,func_80636074,240,no
+us,.code,func_806767B4,44,yes
+us,.code,func_806D9FD0,848,no
+us,.code,func_806FBEF0,1600,no
+us,.code,func_806C71B8,8,yes
+us,.code,func_8066E2C0,780,no
+us,.code,func_806E4C6C,168,no
+us,.code,func_8066D250,164,no
+us,.code,func_80658C10,188,no
+us,.code,func_80659620,80,yes
+us,.code,func_8065E040,140,yes
+us,.code,func_8065EFF0,324,no
+us,.code,func_806ABA6C,300,no
+us,.code,func_80692588,36,yes
+us,.code,func_8073F328,740,no
+us,.code,func_806F142C,112,yes
+us,.code,func_8063CE64,168,yes
+us,.code,func_80728300,1308,no
+us,.code,func_8066ACA4,252,no
+us,.code,func_806419F8,128,no
+us,.code,func_8060A9BC,72,no
+us,.code,func_806A4DDC,920,no
+us,.code,func_8069E040,72,yes
+us,.code,func_8064216C,152,yes
+us,.code,func_80635588,84,yes
+us,.code,func_80653684,384,yes
+us,.code,func_80687474,120,yes
+us,.code,func_806D2C54,88,yes
+us,.code,func_80636380,188,no
+us,.code,func_8062D0CC,220,no
+us,.code,func_806019B8,88,no
+us,.code,func_806F9CD0,188,no
+us,.code,func_80676A0C,100,no
+us,.code,func_806E41B4,56,yes
+us,.code,func_8065E81C,552,no
+us,.code,func_80697988,868,no
+us,.code,func_8062F318,16,yes
+us,.code,func_8063A848,124,no
+us,.code,func_806E380C,32,yes
+us,.code,func_806AD260,748,no
+us,.code,func_806D28E4,32,yes
+us,.code,func_806DF494,268,no
+us,.code,func_805FE634,232,no
+us,.code,func_80652BC8,492,yes
+us,.code,func_806E2FE8,88,yes
+us,.code,func_8064BD2C,300,no
+us,.code,func_80712F10,184,yes
+us,.code,func_806F37BC,176,no
+us,.code,func_80674884,472,no
+us,.code,func_8072334C,52,yes
+us,.code,func_8072B330,264,yes
+us,.code,func_806F7FD0,52,yes
+us,.code,func_806B4904,84,yes
+us,.code,func_806FFEAC,176,no
+us,.code,func_806CEC04,608,no
+us,.code,func_806D3224,156,no
+us,.code,func_80697CEC,1076,no
+us,.code,func_8061159C,12,yes
+us,.code,func_80715270,1532,no
+us,.code,func_806F00BC,144,yes
+us,.code,func_806CC8B8,56,yes
+us,.code,func_806E2E6C,60,yes
+us,.code,func_806EAE04,92,yes
+us,.code,func_8071509C,468,no
+us,.code,func_80738BA0,8,yes
+us,.code,func_806CEFBC,276,no
+us,.code,func_8073749C,324,no
+us,.code,func_80650998,108,no
+us,.code,func_806A0310,32,yes
+us,.code,func_8073B750,224,no
+us,.code,func_8071EDEC,184,no
+us,.code,func_8062F388,24,yes
+us,.code,func_8067E348,136,yes
+us,.code,func_806E0050,44,yes
+us,.code,func_806C28B8,428,no
+us,.code,func_80673A94,228,no
+us,.code,func_806A05D4,40,yes
+us,.code,func_8064BF58,120,yes
+us,.code,func_806D2DC4,216,no
+us,.code,func_8066EA64,44,yes
+us,.code,func_8062BAE4,72,yes
+us,.code,func_806D5834,432,no
+us,.code,func_806013A0,72,yes
+us,.code,func_806D0A84,864,no
+us,.code,func_806D9134,80,yes
+us,.code,func_8072A714,200,yes
+us,.code,func_8072A7DC,144,yes
+us,.code,func_8063DB3C,156,yes
+us,.code,func_8070E808,192,no
+us,.code,func_806D03BC,76,yes
+us,.code,func_806EFC38,280,yes
+us,.code,func_80602E6C,1236,no
+us,.code,func_806B5A90,2384,no
+us,.code,func_80689F2C,84,no
+us,.code,func_806AFB58,1940,no
+us,.code,func_806E5D60,248,yes
+us,.code,func_806A02F0,32,yes
+us,.code,func_80654380,152,no
+us,.code,func_8070A220,1576,no
+us,.code,func_8070CD14,48,yes
+us,.code,func_806AB808,612,no
+us,.code,func_80667174,12,yes
+us,.code,func_8064F028,412,yes
+us,.code,func_806D7704,372,no
+us,.code,func_80678428,48,yes
+us,.code,func_8062FBC8,840,no
+us,.code,func_80649BF0,388,no
+us,.code,func_806D3FA0,112,yes
+us,.code,func_806ECAC4,272,no
+us,.code,func_80738BA8,8,yes
+us,.code,func_80725B38,108,no
+us,.code,func_806EAFEC,8,yes
+us,.code,func_80738470,384,no
+us,.code,func_806F1378,8,yes
+us,.code,func_80610DCC,184,no
+us,.code,func_8070D8C0,104,no
+us,.code,func_80643274,224,no
+us,.code,func_80680774,248,yes
+us,.code,func_8064FB64,1404,no
+us,.code,func_806C7C94,172,no
+us,.code,func_8070CB2C,120,yes
+us,.code,func_80659350,120,no
+us,.code,func_80688460,44,yes
+us,.code,func_806018B4,32,yes
+us,.code,playSong,204,no
+us,.code,func_806761EC,28,yes
+us,.code,func_8067E3D0,108,yes
+us,.code,func_806E64D0,236,yes
+us,.code,func_806487C4,1164,no
+us,.code,func_80681E18,1252,no
+us,.code,func_806F54E0,960,no
+us,.code,func_806CC14C,68,yes
+us,.code,func_806F9518,176,no
+us,.code,func_806FF32C,44,yes
+us,.code,func_8064D418,1128,no
+us,.code,func_8068A4C8,64,yes
+us,.code,func_80663040,76,yes
+us,.code,func_80706F90,1916,no
+us,.code,func_8073AD50,828,no
+us,.code,func_80672AFC,32,yes
+us,.code,func_806C4AC4,968,no
+us,.code,func_8060E7EC,224,yes
+us,.code,func_80657CB0,372,no
+us,.code,func_80684A00,432,yes
+us,.code,func_806874EC,732,no
+us,.code,func_8060FA5C,72,no
+us,.code,func_80714944,12,yes
+us,.code,func_8068A24C,88,yes
+us,.code,func_806E9388,112,yes
+us,.code,func_80653B70,16,yes
+us,.code,func_806D8A64,164,yes
+us,.code,func_8062E608,116,yes
+us,.code,func_806612B4,76,yes
+us,.code,func_8071E028,232,no
+us,.code,func_806D2CAC,140,yes
+us,.code,func_8060E980,168,yes
+us,.code,func_80611690,80,no
+us,.code,func_806EA8FC,92,yes
+us,.code,func_806D1DEC,164,yes
+us,.code,func_80730E18,536,no
+us,.code,func_8066BECC,64,yes
+us,.code,func_80636D38,452,no
+us,.code,func_806FAB20,324,no
+us,.code,func_80672C70,76,yes
+us,.code,func_806D3AC8,32,yes
+us,.code,func_806DE9F4,176,yes
+us,.code,func_80717DB4,360,no
+us,.code,func_805FF938,116,yes
+us,.code,func_806F0B34,228,yes
+us,.code,func_806F9470,60,yes
+us,.code,func_8068A1B8,20,yes
+us,.code,func_8065F678,748,no
+us,.code,func_806A2E30,2244,no
+us,.code,func_8065A648,12,yes
+us,.code,func_80714A68,52,yes
+us,.code,func_8068D8C8,276,no
+us,.code,func_8064F804,72,yes
+us,.code,func_8073B640,112,no
+us,.code,func_8073CF00,176,no
+us,.code,func_80662B90,1200,no
+us,.code,func_806D281C,200,yes
+us,.code,func_806F4F50,376,no
+us,.code,func_806EBDC4,200,yes
+us,.code,func_80664CB0,112,no
+us,.code,func_807102AC,308,no
+us,.code,func_806D332C,392,no
+us,.code,func_8071498C,12,yes
+us,.code,func_8071DC90,920,no
+us,.code,func_805FF628,56,yes
+us,.code,func_80724308,720,no
+us,.code,func_80685390,400,no
+us,.code,func_806CEE64,116,yes
+us,.code,func_8066BA2C,140,no
+us,.code,func_8060151C,196,yes
+us,.code,func_806022DC,56,no
+us,.code,func_8071E3EC,1144,no
+us,.code,func_8063524C,540,no
+us,.code,func_8062CEA8,492,no
+us,.code,func_80737A74,40,no
+us,.code,func_806C7BAC,100,yes
+us,.code,func_8072EE0C,112,no
+us,.code,func_806CA26C,64,yes
+us,.code,func_8064DB98,620,no
+us,.code,func_806A92B4,3560,no
+us,.code,func_80674150,368,no
+us,.code,func_806ACF10,236,no
+us,.code,func_806DECD4,112,yes
+us,.code,func_806F0624,128,yes
+us,.code,func_8071AF30,636,no
+us,.code,func_806CBE90,636,yes
+us,.code,func_80735A50,80,no
+us,.code,func_806EE454,336,yes
+us,.code,func_80605044,720,no
+us,.code,func_806ADFE0,720,no
+us,.code,func_8063EA14,4148,no
+us,.code,func_806E6B98,592,no
+us,.code,func_8060BF84,832,no
+us,.code,func_8064B900,224,yes
+us,.code,func_806EB5C8,272,no
+us,.code,func_806496B0,1344,no
+us,.code,func_806A664C,1896,no
+us,.code,func_806017E8,96,yes
+us,.code,func_8070C9E8,68,yes
+us,.code,func_8070D654,132,no
+us,.code,func_806A5FA4,96,yes
+us,.code,func_806ECF1C,128,yes
+us,.code,func_806D3DE4,444,yes
+us,.code,func_806D4758,452,no
+us,.code,func_806765E8,168,yes
+us,.code,func_806ECF9C,180,yes
+us,.code,func_80728950,96,yes
+us,.code,func_806C9EA0,48,yes
+us,.code,func_806EC044,356,yes
+us,.code,func_80687C48,128,yes
+us,.code,func_80724D28,136,no
+us,.code,func_8073CC94,316,no
+us,.code,func_806907F0,36,yes
+us,.code,func_806766E0,80,yes
+us,.code,func_80705B14,28,yes
+us,.code,func_8064CC80,188,no
+us,.code,func_80678E14,88,yes
+us,.code,func_8060E128,128,no
+us,.code,func_807145F8,16,yes
+us,.code,func_8064F450,624,no
+us,.code,func_80666AC4,28,yes
+us,.code,func_8064B2AC,196,no
+us,.code,func_806FA5A4,512,no
+us,.code,gameIsInQuitGameMode,84,yes
+us,.code,func_806E0694,84,yes
+us,.code,func_8063B4A4,28,yes
+us,.code,func_806592B4,108,no
+us,.code,func_806F2754,748,no
+us,.code,func_806368F0,340,no
+us,.code,func_807319D8,44,yes
+us,.code,func_80690500,696,no
+us,.code,func_806F6E58,132,yes
+us,.code,func_80678CC8,272,no
+us,.code,func_806D4010,556,yes
+us,.code,func_8072F230,632,no
+us,.code,func_80689BAC,116,yes
+us,.code,func_8069EF50,208,yes
+us,.code,func_80735DBC,4604,no
+us,.code,func_807381D8,88,no
+us,.code,func_806787EC,8,yes
+us,.code,func_806F8CFC,92,yes
+us,.code,func_806AC07C,2572,no
+us,.code,func_806307CC,196,yes
+us,.code,func_806C7210,8,yes
+us,.code,func_806E84C0,56,yes
+us,.code,func_8062C29C,1792,no
+us,.code,func_806443E4,1500,no
+us,.code,func_8066BDE0,64,yes
+us,.code,func_80651BE0,76,no
+us,.code,func_80610A88,252,no
+us,.code,func_806D6558,1100,no
+us,.code,func_80630300,36,yes
+us,.code,func_8063C3C0,88,yes
+us,.code,func_806FFC04,680,no
+us,.code,func_806F3190,1488,no
+us,.code,func_8072FDD4,140,no
+us,.code,func_80600174,460,no
+us,.code,func_806F5EB4,120,no
+us,.code,func_80683A80,88,no
+us,.code,func_806F1AE0,120,yes
+us,.code,func_80675D70,96,no
+us,.code,func_806E78F8,8,yes
+us,.code,func_807124B8,108,yes
+us,.code,func_8073A98C,232,no
+us,.code,func_80642500,252,no
+us,.code,func_80701C90,16,yes
+us,.code,func_80704960,412,no
+us,.code,func_8062BA0C,104,yes
+us,.code,func_806791DC,16,yes
+us,.code,func_8060C758,216,no
+us,.code,func_806A3DA0,252,no
+us,.code,func_80637B6C,5968,no
+us,.code,func_806EC1A8,292,yes
+us,.code,func_806CC10C,64,yes
+us,.code,func_8071CDE0,784,no
+us,.code,getPointerTableFile,812,no
+us,.code,func_8073DA30,1312,no
+us,.code,func_80611614,116,no
+us,.code,func_806015E0,152,yes
+us,.code,func_80661AB4,208,no
+us,.code,func_8068848C,44,yes
+us,.code,func_806D7E88,192,yes
+us,.code,func_80602104,64,no
+us,.code,func_8070C808,148,no
+us,.code,func_80634EDC,56,yes
+us,.code,func_80740F48,296,no
+us,.code,func_8072B608,404,no
+us,.code,func_8071A674,572,no
+us,.code,func_80723CCC,700,no
+us,.code,func_806C7218,8,yes
+us,.code,func_806844EC,32,yes
+us,.code,func_80735CF4,200,no
+us,.code,func_8068E7B4,508,no
+us,.code,func_8071495C,16,yes
+us,.code,func_806C9DE0,48,yes
+us,.code,func_806EE26C,76,yes
+us,.code,func_8069329C,464,no
+us,.code,func_80712524,36,yes
+us,.code,func_80632084,828,no
+us,.code,func_8067C6DC,32,yes
+us,.code,func_806C8984,924,no
+us,.code,func_8064BAF4,88,no
+us,.code,func_8066F400,172,yes
+us,.code,func_80708DA4,1440,no
+us,.code,func_806787F4,8,yes
+us,.code,func_8070F2C8,52,yes
+us,.code,func_806FAC64,132,yes
+us,.code,func_806F79E0,1520,no
+us,.code,func_806F3760,92,yes
+us,.code,func_8068EA38,260,no
+us,.code,func_8073B5D0,112,no
+us,.code,func_8070DA74,264,no
+us,.code,func_80635214,56,no
+us,.code,func_8072FA14,688,no
+us,.code,func_80735624,576,no
+us,.code,func_80631B80,12,yes
+us,.code,func_8060AA04,84,no
+us,.code,func_8062B8E4,296,no
+us,.code,func_80676308,48,yes
+us,.code,func_806A370C,1132,no
+us,.code,func_8066BAB8,140,no
+us,.code,func_8070DED4,984,no
+us,.code,func_80676CB0,80,no
+us,.code,func_80653F68,60,yes
+us,.code,func_8065A6F8,16,yes
+us,.code,func_80673708,456,no
+us,.code,func_8068A404,196,no
+us,.code,func_806E0454,140,yes
+us,.code,func_80688C30,84,yes
+us,.code,func_806B6600,856,no
+us,.code,func_8064C9F8,324,no
+us,.code,func_8061118C,48,no
+us,.code,func_8063DA78,148,no
+us,.code,func_806B42A8,1476,no
+us,.code,func_8066DD34,1256,no
+us,.code,playerCanThrowOrange,292,yes
+us,.code,func_8071F1D0,296,no
+us,.code,func_80714670,52,yes
+us,.code,func_8066FD6C,156,no
+us,.code,func_806A6348,96,yes
+us,.code,func_806CA5F8,3908,no
+us,.code,func_80732730,196,no
+us,.code,func_806782C0,40,yes
+us,.code,func_8064D880,248,no
+us,.code,func_80673324,448,no
+us,.code,func_80672A70,140,yes
+us,.code,func_806CCC54,2000,no
+us,.code,func_8060C724,52,yes
+us,.code,func_80652FDC,476,no
+us,.code,func_806EF830,276,yes
+us,.code,func_807245F0,644,no
+us,.code,func_807280C8,196,no
+us,.code,func_8071C9E8,1016,no
+us,.code,func_806B52DC,480,yes
+us,.code,func_80686340,80,yes
+us,.code,func_8062BF24,668,no
+us,.code,func_80724DB0,152,no
+us,.code,func_80712574,168,no
+us,.code,func_805FBC5C,424,no
+us,.code,func_80665F24,144,no
+us,.code,func_806CFE30,76,yes
+us,.code,func_806F5FA0,72,yes
+us,.code,func_80641A78,136,yes
+us,.code,func_8062D26C,64,no
+us,.code,func_8062B660,480,no
+us,.code,func_806BB874,2060,no
+us,.code,func_806D428C,792,yes
+us,.code,func_806BA93C,2544,no
+us,.code,func_80665E94,144,yes
+us,.code,func_80714C08,184,yes
+us,.code,func_806A7B28,36,yes
+us,.code,func_806EA5CC,52,yes
+us,.code,func_8060D768,32,yes
+us,.code,func_8067443C,108,no
+us,.code,func_8060AB48,224,no
+us,.code,func_80661398,80,yes
+us,.code,func_8071F078,344,no
+us,.code,func_80629190,12,yes
+us,.code,func_8068DC54,2080,no
+us,.code,func_806D266C,108,yes
+us,.code,func_8068B830,116,no
+us,.code,func_80708C24,384,no
+us,.code,func_806317D4,496,no
+us,.code,func_807255A8,1424,no
+us,.code,func_806362C4,188,no
+us,.code,func_80673A40,84,no
+us,.code,func_806625D0,72,yes
+us,.code,func_8073E8C0,2340,no
+us,.code,func_806594C8,124,yes
+us,.code,func_8072C870,168,yes
+us,.code,func_8060BCA0,520,no
+us,.code,func_806FD9A0,20,yes
+us,.code,func_80672E6C,32,yes
+us,.code,func_8070D07C,644,no
+us,.code,func_806D57F0,68,yes
+us,.code,func_80665548,16,yes
+us,.code,func_806B3DA4,100,yes
+us,.code,func_8064E48C,108,no
+us,.code,func_806B48B8,76,yes
+us,.code,func_8064D978,544,no
+us,.code,func_80645F40,280,no
+us,.code,func_80724CA4,132,no
+us,.code,func_8073C948,120,no
+us,.code,func_80676A70,72,yes
+us,.code,func_806B3E7C,192,yes
+us,.code,func_80713270,108,yes
+us,.code,func_8071C818,252,no
+us,.code,func_80737E50,64,no
+us,.code,func_80658930,472,no
+us,.code,func_8060FAE4,1292,no
+us,.code,func_8060D7A8,1172,yes
+us,.code,func_8070DCA4,116,no
+us,.code,func_80670C5C,680,no
+us,.code,func_806F1768,240,no
+us,.code,func_80737B2C,28,no
+us,.code,func_80665FB4,220,no
+us,.code,func_80673B78,188,no
+us,.code,func_806D0378,68,yes
+us,.code,func_806D61B8,928,no
+us,.code,func_8072707C,68,yes
+us,.code,func_80732924,8,yes
+us,.code,func_8071910C,1224,no
+us,.code,func_8067457C,268,no
+us,.code,func_8065A570,216,yes
+us,.code,func_806C71B0,8,yes
+us,.code,func_80689F80,108,yes
+us,.code,func_8064F2F0,24,yes
+us,.code,func_8071BE04,512,no
+us,.code,func_8060F1D0,56,yes
+us,.code,func_8060DEA8,32,yes
+us,.code,func_80688CC4,48,no
+us,.code,func_805FF4D8,108,yes
+us,.code,func_806E9070,284,no
+us,.code,func_806526E0,176,yes
+us,.code,func_80668C30,620,no
+us,.code,func_806291A8,12,yes
+us,.code,func_806E341C,188,no
+us,.code,func_8065214C,172,no
+us,.code,func_806E007C,252,yes
+us,.code,func_806CFE7C,40,yes
+us,.code,func_8073A690,296,no
+us,.code,func_8064F6F8,268,no
+us,.code,func_80710174,312,no
+us,.code,func_806F09F0,324,no
+us,.code,func_806E8E78,140,yes
+us,.code,func_8066A08C,1272,no
+us,.code,func_80676338,228,no
+us,.code,func_8072EC94,104,no
+us,.code,func_80676788,44,yes
+us,.code,func_80634D64,172,yes
+us,.code,func_806533C4,284,no
+us,.code,func_80712EDC,52,yes
+us,.code,func_806C9974,364,no
+us,.code,func_8067B2A8,8,yes
+us,.code,func_80672630,80,yes
+us,.code,func_806A36F4,8,yes
+us,.code,func_8071A440,564,no
+us,.code,func_80647CF4,136,yes
+us,.code,func_8060B8F8,112,yes
+us,.code,func_8066AC10,148,no
+us,.code,func_806E1864,8,yes
+us,.code,func_806DB0C4,744,no
+us,.code,func_80738BB0,8,yes
+us,.code,func_806F70A8,84,yes
+us,.code,func_80738E58,576,no
+us,.code,func_806FDF54,292,no
+us,.code,func_806F18F4,156,no
+us,.code,func_806B0770,216,no
+us,.code,func_806B86AC,460,no
+us,.code,func_806F5A48,488,no
+us,.code,func_80724E48,1888,no
+us,.code,func_8068C2F8,88,yes
+us,.code,func_80661440,68,yes
+us,.code,func_806FB488,8,yes
+us,.code,func_8069E5B8,168,yes
+us,.code,func_806C9C1C,100,yes
+us,.code,func_806B8B20,188,yes
+us,.code,func_80709464,96,yes
+us,.code,func_8063C450,88,yes
+us,.code,func_806B4958,88,yes
+us,.code,func_8067BC68,32,yes
+us,.code,func_8069D0B8,32,yes
+us,.code,func_806C1300,172,yes
+us,.code,func_806EB544,132,yes
+us,.code,func_8064B798,40,no
+us,.code,func_807127F4,60,yes
+us,.code,func_8064C814,484,no
+us,.code,func_8066164C,12,yes
+us,.code,func_806DF280,272,yes
+us,.code,func_806D1E90,152,yes
+us,.code,func_806355DC,540,no
+us,.code,func_806CC5DC,92,yes
+us,.code,func_80679334,348,no
+us,.code,func_8069D078,32,yes
+us,.code,func_806E63B8,280,yes
+us,.code,func_8073AA74,140,no
+us,.code,func_806BF920,364,no
+us,.code,func_805FD088,4880,no
+us,.code,func_80687FC8,788,no
+us,.code,func_80699284,1604,no
+us,.code,func_8069B85C,172,no
+us,.code,func_80733B88,172,no
+us,.code,func_806A615C,116,yes
+us,.code,func_806D4C7C,360,no
+us,.code,func_806907E0,16,yes
+us,.code,func_806FB480,8,yes
+us,.code,func_80603340,272,no
+us,.code,func_80688CF4,44,no
+us,.code,func_8062D1A8,56,yes
+us,.code,func_806B7EA0,1348,no
+us,.code,func_8068D264,1636,no
+us,.code,func_806C151C,204,yes
+us,.code,func_80737F38,8,yes
+us,.code,func_80676208,24,yes
+us,.code,func_80739098,500,no
+us,.code,func_80601484,152,yes
+us,.code,func_806109EC,156,no
+us,.code,func_80652858,292,yes
+us,.code,func_8072FE60,604,no
+us,.code,func_80738BB8,180,no
+us,.code,func_806E7568,240,yes
+us,.code,func_806B3420,608,yes
+us,.code,func_80641DA0,456,no
+us,.code,func_8062E898,800,no
+us,.code,func_8068DAF4,176,no
+us,.code,func_8070CD8C,68,yes
+us,.code,func_8060A4D0,48,yes
+us,.code,func_806D205C,392,no
+us,.code,func_806FF01C,296,no
+us,.code,func_80715E38,92,yes
+us,.code,func_80657F14,236,no
+us,.code,func_806C15E8,88,yes
+us,.code,func_806898A8,80,yes
+us,.code,isIntroStoryPlaying,12,yes
+us,.code,func_80718BF4,1304,no
+us,.code,func_8066C904,84,no
+us,.code,func_80708BB8,108,yes
+us,.code,func_8068F72C,2068,no
+us,.code,func_80602488,16,yes
+us,.code,func_806C9F74,100,yes
+us,.code,func_80679200,144,no
+us,.code,func_806E7658,180,yes
+us,.code,func_807370A4,244,no
+us,.code,func_8073A130,372,no
+us,.code,func_806A2A10,248,no
+us,.code,func_806726DC,532,yes
+us,.code,func_806DF390,64,yes
+us,.code,func_806F22A8,1196,no
+us,.code,func_8060E958,40,yes
+us,.code,func_8064409C,640,no
+us,.code,func_8072E868,552,no
+us,.code,func_806F5F2C,116,yes
+us,.code,func_807289E8,4284,no
+us,.code,func_8066E5F8,52,yes
+us,.code,func_806EB2B8,172,yes
+us,.code,func_806F5D80,120,yes
+us,.code,func_8060EC80,236,no
+us,.code,func_806D3B48,128,yes
+us,.code,func_806F0344,128,yes
+us,.code,func_8063E6B4,120,no
+us,.code,func_80686A5C,668,no
+us,.code,func_80653804,620,no
+us,.code,func_806011A0,52,yes
+us,.code,func_806DAADC,264,yes
+us,.code,func_806ED244,476,no
+us,.code,func_80634D14,80,yes
+us,.code,func_80678824,120,no
+us,.code,func_806F58A0,424,no
+us,.code,func_8072F8D4,320,yes
+us,.code,func_80669E04,648,no
+us,.code,func_806E03C8,140,yes
+us,.code,func_806DADA0,444,yes
+us,.code,func_8071A038,428,no
+us,.code,func_8062FF10,1008,no
+us,.code,func_806852C4,204,yes
+us,.code,func_80687F7C,76,yes
+us,.code,func_8063367C,192,no
+us,.code,func_805FB5C4,396,no
+us,.code,func_80717F1C,356,no
+us,.code,func_80633D30,144,no
+us,.code,func_8073C8D0,120,no
+us,.code,func_80666428,1632,no
+us,.code,func_806AA09C,616,no
+us,.code,func_806EBC60,144,yes
+us,.code,func_8066D2F4,488,no
+us,.code,func_807383EC,8,yes
+us,.code,func_806E8DB4,76,yes
+us,.code,func_806A8158,4044,no
+us,.code,func_806A80C0,152,yes
+us,.code,func_8066E8E4,172,no
+us,.code,func_8066CB88,336,no
+us,.code,func_807040E0,40,yes
+us,.code,func_8070E8C8,20,yes
+us,.code,func_8065051C,48,yes
+us,.code,func_805FE71C,152,no
+us,.code,func_806C9658,108,yes
+us,.code,func_8060FFF0,84,no
+us,.code,func_8067B2A0,8,yes
+us,.code,func_806AFA60,248,no
+us,.code,func_807329AC,400,no
+us,.code,func_806DB08C,56,yes
+us,.code,__n_freeParam,44,yes
+us,.code,func_80676280,64,yes
+us,.code,func_8068A508,604,no
+us,.code,func_805FF670,400,no
+us,.code,func_80732894,144,no
+us,.code,func_8060B140,752,no
+us,.code,func_80737E9C,8,yes
+us,.code,func_80601780,52,yes
+us,.code,func_806614D0,80,yes
+us,.code,func_806896F0,32,yes
+us,.code,func_806E2F3C,172,yes
+us,.code,func_807266E8,92,yes
+us,.code,func_8060B7F0,92,yes
+us,.code,func_806CD898,84,yes
+us,.code,func_806EB8CC,152,yes
+us,.code,func_807407A8,744,no
+us,.code,func_806C7260,8,yes
+us,.code,func_8073F60C,528,no
+us,.code,func_80714998,16,yes
+us,.code,func_806F73A0,1600,no
+us,.code,func_80714A38,32,yes
+us,.code,func_806623D4,72,yes
+us,.code,func_80732158,296,no
+us,.code,func_806F4EBC,148,yes
+us,.code,func_806AB4EC,796,no
+us,.code,func_80646770,520,no
+us,.code,func_80688370,44,yes
+us,.code,func_80627EA8,92,yes
+us,.code,func_8067E69C,40,yes
+us,.code,func_80669650,80,no
+us,.code,func_80688FC0,164,no
+us,.code,func_8067A99C,84,yes
+us,.code,func_806E3D14,300,yes
+us,.code,func_806E56EC,1344,no
+us,.code,func_806FAFE4,564,no
+us,.code,func_8060A670,48,yes
+us,.code,func_806ACCE8,552,yes
+us,.code,func_806C7268,8,yes
+us,.code,func_806F3DC8,68,yes
+us,.code,func_8068B80C,16,yes
+us,.code,func_80690094,252,yes
+us,.code,func_80732064,56,no
+us,.code,func_806C1E44,1064,no
+us,.code,func_8065F49C,88,yes
+us,.code,func_8072827C,132,no
+us,.code,func_8064384C,108,yes
+us,.code,func_80627A00,344,no
+us,.code,func_806E6EE0,148,yes
+us,.code,func_8067A7EC,120,yes
+us,.code,func_806C6BA0,40,yes
+us,.code,func_80714B84,132,yes
+us,.code,func_8067BA3C,64,yes
+us,.code,func_8070E750,184,no
+us,.code,func_8073FD90,880,no
+us,.code,func_8062E1F8,444,no
+us,.code,func_8072B79C,48,no
+us,.code,func_8068C350,80,yes
+us,.code,func_806C9E40,48,yes
+us,.code,func_80661F0C,508,no
+us,.code,func_8062F3A0,128,no
+us,.code,func_8063CF3C,668,no
+us,.code,func_8067E2E4,100,yes
+us,.code,func_8068839C,44,yes
+us,.code,func_806EA0A4,348,yes
+us,.code,func_806615BC,144,yes
+us,.code,func_8069E210,640,no
+us,.code,func_8062EFA0,176,no
+us,.code,func_806CDD24,1104,no
+us,.code,func_80649F64,92,yes
+us,.code,func_8061130C,64,no
+us,.code,func_806883F4,56,yes
+us,.code,func_807248B0,228,no
+us,.code,func_80630588,328,yes
+us,.code,func_80717B64,388,no
+us,.code,func_80634CC8,76,yes
+us,.code,func_806FFF88,256,no
+us,.code,func_806A921C,152,no
+us,.code,func_80717760,180,no
+us,.code,func_80650B50,108,no
+us,.code,func_8068412C,960,yes
+us,.code,func_807138A4,40,yes
+us,.code,func_806485A0,548,no
+us,.code,func_8062D620,1236,no
+us,.code,func_806417BC,184,no
+us,.code,func_806769A8,100,no
+us,.code,gameIsInDKTheatreMode,52,yes
+us,.code,func_806E14DC,340,yes
+us,.code,func_80739FE0,144,no
+us,.code,func_8064B3F8,180,no
+us,.code,func_80643C0C,812,no
+us,.code,func_8070C27C,92,no
+us,.code,func_80636A8C,92,yes
+us,.code,func_806F5270,264,no
+us,.code,func_80671880,492,no
+us,.code,func_8064911C,216,no
+us,.code,func_806B7BB8,188,yes
+us,.code,func_80660070,1200,no
+us,.code,gameIsInSnidesBonusGameMode,52,yes
+us,.code,func_806F3E0C,1820,no
+us,.code,func_80651904,608,no
+us,.code,func_8071720C,504,no
+us,.code,func_8061138C,124,yes
+us,.code,func_806970CC,184,no
+us,.code,func_806DA3E4,244,no
+us,.code,func_8062D3E4,48,yes
+us,.code,func_80714464,84,yes
+us,.code,func_8070E34C,508,no
+us,.code,func_806E3E40,884,no
+us,.code,func_8064BE80,216,no
+us,.code,func_8062DAF4,124,no
+us,.code,func_80714D08,916,no
+us,.code,func_8073BA60,176,no
+us,.code,func_8062B478,440,yes
+us,.code,func_80652E58,100,yes
+us,.code,func_806E84F8,84,yes
+us,.code,func_8062E3B4,404,no
+us,.code,func_806C4EE0,124,yes
+us,.code,func_806EB744,392,yes
+us,.code,func_806E4AD8,404,no
+us,.code,func_8066C2B4,24,yes
+us,.code,func_806E1334,424,yes
+us,.code,func_806E8BA4,88,yes
+us,.code,func_806CFF1C,128,yes
+us,.code,func_80636A44,72,yes
+us,.code,func_8066308C,1048,no
+us,.code,func_806A736C,428,yes
+us,.code,func_806BC080,100,yes
+us,.code,func_8066EB50,164,yes
+us,.code,func_80735864,244,no
+us,.code,func_806C3F10,1176,no
+us,.code,func_806BE09C,1496,no
+us,.code,func_806E0D40,620,no
+us,.code,func_806F46B0,160,no
+us,.code,func_806574B8,80,no
+us,.code,func_80660830,204,no
+us,.code,func_8073E63C,256,no
+us,.code,func_8071E864,448,no
+us,.code,func_806D10D0,64,yes
+us,.code,func_80600044,60,yes
+us,.code,func_806D2BB0,32,yes
+us,.code,func_8066A75C,216,no
+us,.code,func_8063DA40,56,yes
+us,.code,func_80654FEC,620,no
+us,.code,func_806500E0,1084,no
+us,.code,func_806CC190,244,yes
+us,.code,func_806ABB98,252,no
+us,.code,func_80737990,188,no
+us,.code,func_806303C4,452,yes
+us,.code,func_80601258,52,yes
+us,.code,func_806ABE3C,524,no
+us,.code,func_80731A04,164,yes
+us,.code,func_80602C0C,96,yes
+us,.code,func_80688EE4,144,yes
+us,.code,func_8063CB40,804,no
+us,.code,func_806D19A8,440,yes
+us,.code,func_805FF0C8,80,yes
+us,.code,func_80636784,364,no
+us,.code,func_80668520,192,no
+us,.code,func_8068C0B4,120,yes
+us,.code,func_80689A80,144,yes
+us,.code,func_80651708,508,no
+us,.code,getFlagBlockAddress,340,no
+us,.code,func_806D7510,500,no
+us,.code,func_80689EE4,72,yes
+us,.code,func_80729EB0,1440,no
+us,.code,func_80732D80,44,no
+us,.code,func_807149A8,16,yes
+us,.code,func_8062B86C,56,yes
+us,.code,func_8071BB14,364,no
+us,.code,func_805FFEF8,208,yes
+us,.code,func_80645A64,312,no
+us,.code,func_806EB0C0,184,yes
+us,.code,func_8065D994,1708,no
+us,.code,func_80658BD0,64,no
+us,.code,func_80641BCC,204,no
+us,.code,func_8060AC7C,1172,no
+us,.code,func_807382A0,128,no
+us,.code,func_806A5F44,96,yes
+us,.code,func_806F4528,392,no
+us,.code,func_8068452C,32,yes
+us,.code,func_806C9AE0,316,no
+us,.code,func_8071EEE0,252,no
+us,.code,func_806D3B08,32,yes
+us,.code,func_80635114,256,no
+us,.code,func_8068A350,80,yes
+us,.code,func_807327F4,160,no
+us,.code,func_8070A934,832,no
+us,.code,func_8073B08C,324,no
+us,.code,func_806C8D2C,180,yes
+us,.code,func_80728004,196,no
+us,.code,func_8062CA0C,100,yes
+us,.code,func_8065D254,1808,no
+us,.code,func_80714060,632,no
+us,.code,func_807289B0,56,yes
+us,.code,func_8069E490,80,yes
+us,.code,func_80636014,96,yes
+us,.code,func_80611844,8,yes
+us,.code,func_806742C0,112,no
+us,.code,func_8060A60C,40,yes
+us,.code,func_8063254C,228,no
+us,.code,func_8065BE74,164,no
+us,.code,func_806E0FAC,904,no
+us,.code,func_8066BE20,172,yes
+us,.code,func_806EFDFC,312,yes
+us,.code,func_806E352C,172,yes
+us,.code,func_80631BCC,84,yes
+us,.code,func_806364C4,268,no
+us,.code,func_80658CCC,224,no
+us,.code,func_806F2FC0,464,no
+us,.code,func_806D25CC,160,yes
+us,.code,func_8065CDB0,156,no
+us,.code,func_8072752C,332,no
+us,.code,func_806B50F4,72,yes
+us,.code,func_80722E48,420,no
+us,.code,func_806C90C4,512,yes
+us,.code,func_806E7C70,388,no
+us,.code,func_8070DC40,100,no
+us,.code,func_806A6468,268,no
+us,.code,func_806F386C,228,no
+us,.code,func_8065D170,60,no
+us,.code,func_80692520,32,yes
+us,.code,func_806C7C10,132,yes
+us,.code,func_806D5CCC,1260,yes
+us,.code,func_8064E4F8,100,no
+us,.code,func_806D1278,84,yes
+us,.code,func_80732F10,624,no
+us,.code,func_806EB6D8,108,yes
+us,.code,func_80654CCC,440,no
+us,.code,func_806EACEC,280,yes
+us,.code,func_806FBB58,68,yes
+us,.code,func_80692E50,1100,no
+us,.code,func_80727678,584,no
+us,.code,func_806D2AA0,240,yes
+us,.code,func_806F1C04,684,no
+us,.code,func_80643440,612,no
+us,.code,func_8066E664,100,yes
+us,.code,func_80661658,72,yes
+us,.code,func_80602430,44,no
+us,.code,func_806944BC,1164,no
+us,.code,func_806CC638,624,no
+us,.code,func_8064A258,1452,no
+us,.code,func_8067ADB4,88,yes
+us,.code,func_806CE7A0,392,no
+us,.code,func_806D09E8,108,yes
+us,.code,func_806588E0,80,yes
+us,.code,func_8060E8EC,68,yes
+us,.code,func_80659600,16,yes
+us,.code,func_806850D0,320,no
+us,.code,func_80649E00,52,yes
+us,.code,func_8071D28C,816,no
+us,.code,func_80610B84,84,no
+us,.code,func_8060DC3C,620,no
+us,.code,func_806B88B8,616,no
+us,.code,func_806BE6F0,460,no
+us,.code,func_8073202C,56,no
+us,.code,func_8067AF44,48,yes
+us,.code,func_806E17F4,112,yes
+us,.code,func_8070C210,108,yes
+us,.code,func_806B6DB0,2116,no
+us,.code,func_8070D3CC,152,no
+us,.code,func_80695724,1068,no
+us,.code,func_806C71E0,8,yes
+us,.code,func_80732DAC,64,no
+us,.code,func_8067A170,108,no
+us,.code,func_8060CB74,40,yes
+us,.code,func_80636164,172,no
+us,.code,func_8065054C,164,yes
+us,.code,func_806C4E8C,40,yes
+us,.code,func_806F4DC0,180,no
+us,.code,func_80738170,104,no
+us,.code,func_80678DD8,60,yes
+us,.code,func_806D1110,236,yes
+us,.code,func_8068780C,1084,no
+us,.code,func_806A57C0,168,no
+us,.code,func_806F01D8,96,yes
+us,.code,func_806C9E10,48,yes
+us,.code,func_80652790,200,yes
+us,.code,func_806DA89C,176,yes
+us,.code,func_806D1270,8,yes
+us,.code,func_806F69A8,1200,no
+us,.code,func_807313BC,84,yes
+us,.code,func_8073BB10,356,no
+us,.code,func_806AC048,52,yes
+us,.code,func_80732280,212,no
+us,.code,func_80737028,124,no
+us,.code,func_806C7D40,932,no
+us,.code,func_8072A86C,180,no
+us,.code,func_8068C2EC,12,yes
+us,.code,func_8062A274,212,yes
+us,.code,func_806B63E0,44,yes
+us,.code,func_8067BDB8,64,yes
+us,.code,func_807035C4,652,no
+us,.code,func_80685210,180,yes
+us,.code,func_8067A864,164,yes
+us,.code,func_8069FA40,864,no
+us,.code,n_alClose,76,yes
+us,.code,func_806C9304,224,no
+us,.code,func_806422D8,208,yes
+us,.code,func_806C80E4,248,yes
+us,.code,func_8066E62C,56,yes
+us,.code,func_8066B5F4,360,no
+us,.code,func_8060F960,252,no
+us,.code,func_8068C12C,224,yes
+us,.code,func_80661BF0,580,no
+us,.code,func_8068A2FC,80,yes
+us,.code,func_806BC1AC,48,yes
+us,.code,func_806D87FC,616,no
+us,.code,func_80666A88,12,yes
+us,.code,func_806E9468,280,yes
+us,.code,func_8062BA74,112,no
+us,.code,func_806A5174,1612,no
+us,.code,func_806C71E8,8,yes
+us,.code,func_8062B630,48,no
+us,.code,func_806623CC,8,yes
+us,.code,func_806B0354,1052,no
+us,.code,func_80671260,388,no
+us,.code,func_806C93E4,80,yes
+us,.code,func_80713764,320,no
+us,.code,func_80708574,88,yes
+us,.code,func_8065E634,488,no
+us,.code,func_806D6B00,1036,yes
+us,.code,func_806789E4,288,no
+us,.code,func_80633DC0,2472,no
+us,.code,func_8060B4D4,136,no
+us,.code,func_8066B8C8,92,no
+us,.code,func_8070D380,76,yes
+us,.code,func_806A1008,180,no
+us,.code,func_8065FEB8,440,no
+us,.code,func_805FE7B4,72,no
+us,.code,func_806C9F44,48,yes
+us,.code,func_8073F81C,132,no
+us,.code,func_80675C70,256,no
+us,.code,func_806BE8BC,2396,no
+us,.code,func_80672BD4,92,yes
+us,.code,func_8064B868,152,yes
+us,.code,func_80609B80,1584,no
+us,.code,func_806725E4,76,yes
+us,.code,func_80675234,160,no
+us,.code,func_8064EB9C,104,no
+us,.code,func_80678804,8,yes
+us,.code,func_8062DBDC,1124,no
+us,.code,func_806A0B74,1028,no
+us,.code,func_80610E84,356,no
+us,.code,func_8060B6CC,52,yes
+us,.code,func_806F006C,8,yes
+us,.code,func_80642BF0,136,yes
+us,.code,func_806EC708,248,yes
+us,.code,func_807132DC,176,no
+us,.code,func_8070DB9C,164,no
+us,.code,func_8067A1DC,1216,no
+us,.code,func_806A7EF0,384,no
+us,.code,func_8063A968,2876,no
+us,.code,func_806D2330,72,yes
+us,.code,func_8067ACB4,12,yes
+us,.code,func_806F07CC,172,yes
+us,.code,func_806A4284,1752,no
+us,.code,func_806E225C,2244,no
+us,.code,func_8071C48C,404,no
+us,.code,func_8070D300,116,yes
+us,.code,func_806011D4,16,yes
+us,.code,func_80666F04,196,yes
+us,.code,func_806C27DC,220,yes
+us,.code,func_806D36CC,128,yes
+us,.code,func_806B75F4,40,yes
+us,.code,func_80639CD0,588,no
+us,.code,func_8064B574,48,yes
+us,.code,func_806886E0,608,no
+us,.code,func_80713438,380,no
+us,.code,func_80631C3C,336,no
+us,.code,func_80660520,784,no
+us,.code,func_80714A08,32,yes
+us,.code,func_8070CAB4,120,yes
+us,.code,func_8064D0C4,292,no
+us,.code,func_806891D8,120,yes
+us,.code,func_806A7B70,36,yes
+us,.code,func_806B54BC,1492,no
+us,.code,func_80659574,60,no
+us,.code,func_806534E0,420,no
+us,.code,func_80724994,140,no
+us,.code,func_8064AB1C,268,no
+us,.code,func_8068B81C,20,yes
+us,.code,func_8066E5CC,44,yes
+us,.code,func_806C8F8C,312,no
+us,.code,func_80648000,620,no
+us,.code,func_806CF2EC,172,no
+us,.code,func_806BFA8C,296,no
+us,.code,func_80675DD0,108,no
+us,.code,func_8069084C,228,no
+us,.code,func_80655DD0,3528,no
+us,.code,func_80649FC0,448,no
+us,.code,func_80630890,736,no
+us,.code,func_806B1EE8,32,yes
+us,.code,func_806A10BC,112,no
+us,.code,func_805FC98C,216,no
+us,.code,func_8065F614,100,yes
+us,.code,func_806EBDAC,24,yes
+us,.code,func_8060B110,48,no
+us,.code,func_80636210,180,no
+us,.code,func_8064C3E8,348,no
+us,.code,func_8072D9D4,140,yes
+us,.code,func_806DAF5C,304,yes
+us,.code,func_806B13B4,2500,no
+us,.code,func_80666D88,380,no
+us,.code,func_8063495C,160,no
+us,.code,func_806CB53C,2312,yes
+us,.code,func_807245D8,24,yes
+us,.code,func_80601CF0,52,yes
+us,.code,func_806EE2B8,412,yes
+us,.code,func_806D2744,64,yes
+us,.code,func_80636AE8,104,no
+us,.code,alSeqpSetSeq,76,yes
+us,.code,func_806B3F90,516,no
+us,.code,_n_freePVoice,64,yes
+us,.code,func_8063D990,64,no
+us,.code,func_806E65BC,540,no
+us,.code,func_806D3AE8,32,yes
+us,.code,func_80655AD0,288,no
+us,.code,func_80698120,3788,no
+us,.code,func_80645C04,272,yes
+us,.code,func_80697230,1740,no
+us,.code,func_806111BC,60,yes
+us,.code,func_80725ED4,656,no
+us,.code,func_8065A660,152,yes
+us,.code,getLevelIndex,152,yes
+us,.code,func_80703374,592,no
+us,.code,func_806531B8,524,no
+us,.code,func_8060B7C4,12,yes
+us,.code,func_80737630,8,yes
+us,.code,func_80648C84,1176,no
+us,.code,func_8073F1E4,324,no
+us,.code,func_80610268,168,no
+us,.code,func_8071C620,504,no
+us,.code,func_80715B30,776,no
+us,.code,func_8065EA44,84,yes
+us,.code,func_806ECA74,80,yes
+us,.code,func_80655410,1728,no
+us,.code,func_806C5FEC,476,no
+us,.code,func_8064E65C,1004,no
+us,.code,func_806713E4,324,no
+us,.code,func_80717D84,48,no
+us,.code,func_80688540,68,yes
+us,.code,func_807135B4,424,no
+us,.code,func_8066BFF0,236,no
+us,.code,func_8062A348,168,yes
+us,.code,func_8071ABDC,852,no
+us,.code,func_80723428,92,yes
+us,.code,func_806A7BB8,36,yes
+us,.code,func_8071BC80,388,no
+us,.code,func_806EB964,160,yes
+us,.code,func_8070B7EC,2580,no
+us,.code,func_806FB8B0,100,no
+us,.code,func_806CFD68,64,yes
+us,.code,func_807380CC,76,no
+us,.code,func_806D22A0,32,yes
+us,.code,func_806392BC,1576,no
+us,.code,func_80663594,556,no
+us,.code,func_80662158,40,yes
+us,.code,func_8065776C,520,no
+us,.code,func_806436E0,364,no
+us,.code,func_806E1F8C,256,yes
+us,.code,func_8072E1A4,136,yes
+us,.code,func_806A1580,808,no
+us,.code,func_80729E6C,68,yes
+us,.code,func_80678050,624,no
+us,.code,func_80632E10,100,no
+us,.code,func_806CA540,184,yes
+us,.code,func_8073B6B0,160,no
+us,.code,func_80690930,248,no
+us,.code,func_80737638,748,no
+us,.code,func_806EAE60,268,yes
+us,.code,func_8066B75C,80,no
+us,.code,func_80724874,60,no
+us,.code,func_8062A774,92,yes
+us,.code,func_80676730,44,yes
+us,.code,func_80646DC4,836,no
+us,.code,func_8073928C,148,no
+us,.code,func_806A2B90,672,no
+us,.code,func_8065D008,244,no
+us,.code,func_8066785C,352,no
+us,.code,func_8060C340,240,yes
+us,.code,func_8060E574,240,yes
+us,.code,func_807232EC,52,yes
+us,.code,func_806307AC,32,yes
+us,.code,func_80673D48,660,no
+us,.code,func_806BDD90,312,no
+us,.code,func_8064C644,196,no
+us,.code,func_80735958,72,no
+us,.code,func_806D32C0,108,yes
+us,.code,func_8070C590,632,no
+us,.code,func_8063D2E4,388,no
+us,.code,func_8065919C,280,no
+us,.code,func_8070D568,236,no
+us,.code,func_806C7230,8,yes
+us,.code,func_8064EE08,544,no
+us,.code,func_80713EA8,8,yes
+us,.code,func_806978FC,140,no
+us,.code,func_80611160,12,yes
+us,.code,func_806E7088,20,yes
+us,.code,func_8068FF40,280,no
+us,.code,func_8064BE58,40,yes
+us,.code,func_80673C34,276,no
+us,.code,func_806FD950,80,no
+us,.code,func_806F8DC4,240,yes
+us,.code,func_80666AAC,12,yes
+us,.code,func_8071A8B0,556,no
+us,.code,func_806846B4,412,yes
+us,.code,func_80674A5C,128,no
+us,.code,func_806CCB0C,136,yes
+us,.code,func_806EBCF0,188,yes
+us,.code,func_8067E724,64,yes
+us,.code,func_80600D50,848,no
+us,.code,func_80678F64,56,yes
+us,.code,func_8072A450,708,no
+us,.code,func_8069346C,2644,no
+us,.code,func_80730408,1764,no
+us,.code,func_805FF118,64,yes
+us,.code,func_806D1B60,476,yes
+us,.code,func_807311C4,216,no
+us,.code,func_806D26D8,108,yes
+us,.code,func_8063B758,384,no
+us,.code,func_8068B930,132,no
+us,.code,func_806DE264,1740,no
+us,.code,func_806E4580,180,yes
+us,.code,func_80691830,256,yes
+us,.code,func_8061032C,36,no
+us,.code,func_8067C6FC,32,yes
+us,.code,func_806F8D58,108,yes
+us,.code,func_8068588C,92,yes
+us,.code,func_80650AD8,120,no
+us,.code,func_806E4634,268,yes
+us,.code,func_8069D424,1292,no
+us,.code,func_8073CA04,188,no
+us,.code,func_806F3DB0,24,yes
+us,.code,func_806A5868,1016,no
+us,.code,func_806E7B48,296,yes
+us,.code,func_80690814,56,yes
+us,.code,func_80723020,612,no
+us,.code,func_806BC1E0,3512,no
+us,.code,func_8062BCC8,232,no
+us,.code,_n_timeToSamplesNoRound,100,yes
+us,.code,func_806744A8,212,no
+us,.code,func_80688514,44,yes
+us,.code,func_8071F758,396,no
+us,.code,func_806D9924,28,yes
+us,.code,func_806F03C4,608,no
+us,.code,func_806EFF34,312,yes
+us,.code,func_80678530,164,yes
+us,.code,func_806C7238,8,yes
+us,.code,func_806E1A50,340,yes
+us,.code,func_80684550,104,yes
+us,.code,func_8066B9F4,56,yes
+us,.code,func_806D12CC,340,yes
+us,.code,func_8063FA48,7388,no
+us,.code,func_8068A830,40,yes
+us,.code,func_80719B88,120,no
+us,.code,func_806CC948,40,yes
+us,.code,func_8071EFDC,88,no
+us,.code,func_807318AC,176,no
+us,.code,func_8063CF0C,48,yes
+us,.code,func_80658E8C,644,no
+us,.code,func_80631EB8,160,no
+us,.code,func_8060EE58,8,yes
+us,.code,func_806E9964,248,yes
+us,.code,func_80647834,480,no
+us,.code,func_80712B80,84,yes
+us,.code,func_806418E8,180,no
+us,.code,func_806C81DC,68,yes
+us,.code,func_8064C544,256,no
+us,.code,func_80675478,304,no
+us,.code,func_8070CC8C,56,yes
+us,.code,func_8062BDB0,372,no
+us,.code,func_8070C8F4,156,yes
+us,.code,func_806755A8,616,no
+us,.code,func_806E5EA8,44,yes
+us,.code,func_806D7A28,976,no
+us,.code,func_806CA2AC,56,yes
+us,.code,func_80731B88,408,no
+us,.code,func_8067641C,188,no
+us,.code,func_80731AA8,116,yes
+us,.code,func_806DDAB0,1972,no
+us,.code,func_806582F8,532,no
+us,.code,func_80667180,312,no
+us,.code,func_80693EC0,1532,no
+us,.code,func_806D0DE4,216,no
+us,.code,func_806EACBC,48,yes
+us,.code,func_806B1F08,32,yes
+us,.code,func_80712FC8,192,yes
+us,.code,func_8070C200,16,no
+us,.code,func_806F1EB0,1016,no
+us,.code,func_806B7660,68,yes
+us,.code,func_80601224,52,yes
+us,.code,func_80733A88,256,no
+us,.code,func_80641B00,204,no
+us,.code,func_806F3BEC,452,no
+us,.code,func_8070943C,40,yes
+us,.code,func_8067E43C,152,no
+us,.code,func_80639968,668,no
+us,.code,func_805FBFF4,700,no
+us,.code,func_80731784,120,no
+us,.code,func_806FA7A4,24,yes
+us,.code,func_806025AC,40,yes
+us,.code,func_806E527C,84,no
+us,.code,func_806A1ABC,8,yes
+us,.code,func_8060E1A8,180,yes
+us,.code,func_80649E34,304,no
+us,.code,func_80735A34,16,no
+us,.code,func_805FFE50,168,yes
+us,.code,func_806FCC88,1036,no
+us,.code,func_8062E67C,540,no
+us,.code,func_806CFC90,216,yes
+us,.code,func_8067AF74,168,yes
+us,.code,func_806357F8,240,no
+us,.code,func_8073AB00,584,no
+us,.code,func_8066EBF4,120,yes
+us,.code,func_806D8FCC,360,yes
+us,.code,func_806FBC34,296,no
+us,.code,func_8068B8A4,88,no
+us,.code,func_806BB400,516,no
+us,.code,func_806CFDA8,68,yes
+us,.code,func_8067AE58,56,yes
+us,.code,func_806A60E4,40,yes
+us,.code,func_80669A6C,380,no
+us,.code,func_806F2EDC,228,no
+us,.code,func_80652F24,120,yes
+us,.code,func_807271F4,436,no
+us,.code,func_806CA0E8,204,yes
+us,.code,func_8060C648,112,yes
+us,.code,func_806D72D4,572,no
+us,.code,func_806E8A8C,100,yes
+us,.code,func_806C9434,412,yes
+us,.code,alEvtqFlushType,208,yes
+us,.code,func_80714A9C,232,yes
+us,.code,func_8068DBA4,176,no
+us,.code,func_8070033C,848,no
+us,.code,func_8066C7F4,188,no
+us,.code,func_80611594,8,yes
+us,.code,func_806782E8,212,yes
+us,.code,func_8072D714,648,no
+us,.code,func_8072DCF4,284,no
+us,.code,func_806425FC,332,no
+us,.code,func_806B6C88,296,yes
+us,.code,func_8066B7AC,72,yes
+us,.code,func_8071E110,184,no
+us,.code,func_8062E040,440,no
+us,.code,func_80682E38,532,no
+us,.code,func_8067B290,8,yes
+us,.code,func_806A081C,72,yes
+us,.code,func_8066BC00,92,no
+us,.code,getEEPROMSaveSlot,68,yes
+us,.code,func_806B02EC,104,yes
+us,.code,func_8063DC58,528,no
+us,.code,func_80662618,436,no
+us,.code,func_80647A14,352,no
+us,.code,func_8072B59C,108,yes
+us,.code,func_8068A2AC,88,yes
+us,.code,getExitData,364,yes
+us,.code,func_8071497C,16,yes
+us,.code,func_8065C990,1040,no
+us,.code,func_8068613C,516,no
+us,.code,func_806E384C,692,no
+us,.code,func_806AD7AC,160,yes
+us,.code,func_806F4778,1528,no
+us,.code,func_806DEAA4,560,no
+us,.code,func_80696574,1272,no
+us,.code,func_806E8F04,100,yes
+us,.code,func_80709890,572,no
+us,.code,func_806685E0,276,no
+us,.code,func_80726744,1592,no
+us,.code,func_8064FA7C,232,no
+us,.code,func_8060D0A8,164,yes
+us,.code,func_805FF544,92,yes
+us,.code,func_8066E854,144,yes
+us,.code,func_806D7878,364,yes
+us,.code,func_80650C28,112,no
+us,.code,func_806D1F28,308,yes
+us,.code,func_80647108,104,yes
+us,.code,func_806D8B08,1220,no
+us,.code,func_8064AC28,1264,no
+us,.code,func_8070CC1C,56,yes
+us,.code,func_8060FAA4,64,yes
+us,.code,func_8073C040,1476,no
+us,.code,func_8073E460,476,no
+us,.code,func_8066F250,36,yes
+us,.code,func_806F7378,40,yes
+us,.code,func_80669BE8,132,yes
+us,.code,func_80704B20,4084,no
+us,.code,func_806728F0,384,yes
+us,.code,func_8060E4D0,164,yes
+us,.code,func_806EAA44,92,yes
+us,.code,func_806593C8,168,no
+us,.code,func_8071D5BC,456,no
+us,.code,func_806508B4,120,no
+us,.code,func_8064F954,40,yes
+us,.code,func_807270C0,212,yes
+us,.code,func_807189BC,568,no
+us,.code,func_80715908,308,no
+us,.code,func_806D423C,80,yes
+us,.code,func_80627F04,4676,no
+us,.code,func_80656B98,704,no
+us,.code,func_806358E8,1544,no
+us,.code,func_8069A614,316,no
+us,.code,func_80711950,640,no
+us,.code,func_8060DEC8,608,yes
+us,.code,func_80669830,256,no
+us,.code,func_806EE7B8,60,yes
+us,.code,func_8069D058,32,yes
+us,.code,func_8060AA58,224,no
+us,.code,func_80717D4C,56,no
+us,.code,func_806E2ECC,112,yes
+us,.code,func_80659610,16,yes
+us,.code,func_806EB194,292,yes
+us,.code,func_805FC668,804,no
+us,.code,func_806F5C30,180,yes
+us,.code,func_80704298,428,no
+us,.code,func_806EA460,264,yes
+us,.code,func_806EBF74,92,yes
+us,.code,func_806EBB44,140,yes
+us,.code,func_8065F964,416,no
+us,.code,func_80719C00,756,no
+us,.code,func_806D7170,200,yes
+us,.code,func_806E1E54,312,yes
+us,.code,func_80673240,104,no
+us,.code,func_8067A69C,112,yes
+us,.code,func_80690190,556,no
+us,.code,func_8060AC28,12,yes
+us,.code,func_80709344,248,yes
+us,.code,func_8067DF44,820,no
+us,.code,func_806C61C8,872,no
+us,.code,func_806B761C,68,yes
+us,.code,func_8070F5CC,1164,no
+us,.code,func_8067B01C,228,no
+us,.code,func_8065D1AC,152,no
+us,.code,func_806FE078,3384,no
+us,.code,func_806EAB44,328,yes
+us,.code,func_8071B520,568,no
+us,.code,func_806EC3BC,240,yes
+us,.code,func_8062D414,524,no
+us,.code,func_806D0A54,48,yes
+us,.code,func_806CC364,632,no
+us,.code,func_8067AA58,96,yes
+us,.code,func_806EE994,200,yes
+us,.code,func_80718380,372,no
+us,.code,func_8063D288,92,yes
+us,.code,func_8070FCCC,928,no
+us,.code,func_806F9AF0,116,no
+us,.code,func_8067E510,396,no
+us,.code,alSepqSetVol,76,yes
+us,.code,func_8068A1CC,64,yes
+us,.code,func_80689064,176,no
+us,.code,n_alInit,108,yes
+us,.code,func_80679064,144,yes
+us,.code,func_806FA9C0,352,no
+us,.code,func_806EA568,100,no
+us,.code,func_806B4194,276,yes
+us,.code,func_806B8BDC,156,yes
+us,.code,func_806D80A8,608,yes
+us,.code,func_806C1734,704,no
+us,.code,func_80610310,28,no
+us,.code,func_8063C4C4,532,no
+us,.code,func_80676690,80,yes
+us,.code,func_80696A6C,1632,no
+us,.code,func_806C2A64,200,yes
+us,.code,func_80666FC8,328,yes
+us,.code,func_8065D0FC,116,yes
+us,.code,func_80671C0C,260,no
+us,.code,func_806057F8,11568,no
+us,.code,func_80710CA0,1904,no
+us,.code,func_8062A944,804,no
+us,.code,func_807186C8,756,no
+us,.code,func_8069E660,196,yes
+us,.code,func_806EA958,92,yes
+us,.code,func_80670FA4,316,no
+us,.code,func_806787FC,8,yes
+us,.code,func_8070DA28,76,no
+us,.code,func_807238D4,964,no
+us,.code,func_8067B2C0,28,yes
+us,.code,func_8068C3A0,520,no
+us,.code,func_806925AC,148,yes
+us,.code,func_80704444,64,no
+us,.code,func_806CD8EC,156,yes
+us,.code,func_80714A58,16,yes
+us,.code,func_806B9CB0,48,yes
+us,.code,func_806F8170,264,yes
+us,.code,func_8069DD40,536,no
+us,.code,func_80661520,156,no
+us,.code,func_8067C6BC,32,yes
+us,.code,func_8067618C,68,yes
+us,.code,func_806F5378,116,yes
+us,.code,func_80724A20,124,no
+us,.code,func_8066641C,12,yes
+us,.code,func_8066B0EC,12,yes
+us,.code,func_80714708,112,no
+us,.code,func_8071A1E4,604,no
+us,.code,func_80666AE0,12,yes
+us,.code,func_80644D50,220,no
+us,.code,func_806E7050,56,yes
+us,.code,func_80661264,80,no
+us,.code,func_8063C7C4,696,no
+us,.code,func_80704AFC,36,yes
+us,.code,func_806C9830,324,yes
+us,.code,func_8070770C,628,no
+us,.code,func_806A6134,40,yes
+us,.code,func_806EE6B0,80,yes
+us,.code,func_8063162C,424,no
+us,.code,func_806896D0,32,yes
+us,.code,func_80678BBC,268,yes
+us,.code,func_806CF42C,140,yes
+us,.code,func_806EB4F8,76,yes
+us,.code,func_80676260,32,yes
+us,.code,func_806115A8,108,no
+us,.code,func_806E0BEC,340,yes
+us,.code,func_80601728,88,yes
+us,.code,func_806111F8,276,no
+us,.code,func_80653FA4,988,no
+us,.code,func_80730D60,184,yes
+us,.code,func_806B3C30,100,yes
+us,.code,func_806C4904,68,yes
+us,.code,func_806ABC94,424,no
+us,.code,func_806F8EDC,728,no
+us,.code,func_8063DFEC,140,no
+us,.code,func_80641724,152,no
+us,.code,func_806C7200,8,yes
+us,.code,func_806BB604,536,no
+us,.code,func_8060B7D0,28,yes
+us,.code,func_8063DB0C,48,yes
+us,.code,func_80604C80,60,yes
+us,.code,func_805FF1B0,324,no
+us,.code,func_806FB3D0,72,no
+us,.code,func_806E0178,284,yes
+us,.code,func_806D239C,268,yes
+us,.code,func_8065E138,1276,no
+us,.code,func_8073B900,176,no
+us,.code,func_806E9F8C,192,no
+us,.code,func_806CD9A0,900,no
+us,.code,func_8067B450,120,no
+us,.code,func_806E9B3C,108,yes
+us,.code,func_8063373C,376,no
+us,.code,n_alAudioFrame,548,no
+us,.code,func_8065EA98,52,yes
+us,.code,func_806D0468,568,no
+us,.code,func_8071EA24,332,no
+us,.code,func_80713088,76,yes
+us,.code,func_806E0294,308,yes
+us,.code,func_8071EB70,636,no
+us,.code,func_806E7484,228,yes
+us,.code,func_80650D8C,148,no
+us,.code,func_80737A4C,40,no
+us,.code,func_8062A844,8,yes
+us,.code,func_80663A80,360,no
+us,.code,func_806D2BD0,132,yes
+us,.code,func_806CCB94,124,yes
+us,.code,func_80656F14,1444,no
+us,.code,func_806EBE8C,68,no
+us,.code,func_806D2A14,140,yes
+us,.code,func_80669588,200,no
+us,.code,func_807375E0,32,no
+us,.code,func_8070CA2C,68,yes
+us,.code,playerCanDive,116,yes
+us,.code,func_806EE878,172,yes
+us,.code,func_807146E0,20,yes
+us,.code,func_806EA8A0,92,yes
+us,.code,func_806CF398,148,yes
+us,.code,func_80662108,8,yes
+us,.code,func_80731E68,452,no
+us,.code,func_80737600,8,yes
+us,.code,func_806E78E0,24,yes
+us,.code,func_8071EEA4,60,no
+us,.code,func_80632630,560,no
+us,.code,func_806915B0,640,no
+us,.code,func_806EE5A4,144,yes
+us,.code,func_806F1350,40,yes
+us,.code,func_8062DB70,108,no
+us,.code,func_80701098,3064,no
+us,.code,func_80631D8C,300,no
+us,.code,func_80727194,96,no
+us,.code,func_80733180,2312,no
+us,.code,func_806EAFF4,100,yes
+us,.code,func_806B2D64,1724,no
+us,.code,func_8072AA80,244,no
+us,.code,func_80600454,220,yes
+us,.code,func_806B0848,2424,no
+us,.code,func_80679178,100,yes
+us,.code,func_8066C2D0,832,no
+us,.code,func_806524A0,244,yes
+us,.code,func_806CFEF4,40,yes
+us,.code,func_80714CC0,72,yes
+us,.code,func_8068E474,832,no
+us,.code,func_8070D6D8,124,yes
+us,.code,func_8062B840,44,yes
+us,.code,func_80634F14,140,yes
+us,.code,func_8067B1E0,88,yes
+us,.code,func_806DFFA0,60,yes
+us,.code,func_80732930,124,no
+us,.code,func_8065C334,1628,no
+us,.code,func_806F93EC,64,yes
+us,.code,func_806CF9CC,708,no
+us,.code,func_80602C6C,116,yes
+us,.code,func_8068C5A8,3260,no
+us,.code,func_806505F0,148,yes
+us,.code,func_8063DBD8,128,yes
+us,.code,func_8062CA70,1080,no
+us,.code,func_80713DFC,172,yes
+us,.code,func_8063D854,208,yes
+us,.code,func_8073E800,160,no
+us,.code,func_8066466C,456,no
+us,.code,func_806E7780,312,yes
+us,.code,func_806F1B58,56,no
+us,.code,func_80666280,16,yes
+us,.code,func_806DC170,564,no
+us,.code,func_806A18A8,532,no
+us,.code,func_806A6004,144,yes
+us,.code,func_806595B0,64,no
+us,.code,func_806651FC,452,no
+us,.code,func_806FB218,120,yes
+us,.code,func_806FB290,40,yes
+us,.code,func_8064954C,356,no
+us,.code,func_8064B190,116,no
+us,.code,func_806C7208,8,yes
+us,.code,func_80630DCC,2144,no
+us,.code,func_8073B830,208,no
+us,.code,func_8064ED68,160,yes
+us,.code,func_8073D160,144,no
+us,.code,func_80727F20,228,no
+us,.code,func_806118FC,152,yes
+us,.code,func_80601120,76,yes
+us,.code,func_806E7338,332,yes
+us,.code,func_806C226C,1392,no
+us,.code,func_806BFBF4,5292,no
+us,.code,func_806B6958,816,yes
+us,.code,func_806E1630,248,yes
+us,.code,func_80719EF4,324,no
+us,.code,func_806A610C,40,yes
+us,.code,func_806E3CEC,40,yes
+us,.code,func_806C9ED0,48,yes
+us,.code,func_806D69A4,348,yes
+us,.code,func_806CA1B4,184,yes
+us,.code,func_806DA94C,200,yes
+us,.code,func_806338F4,72,no
+us,.code,func_806ADDD8,520,no
+us,.code,func_806E3C14,36,yes
+us,.code,func_80688940,300,yes
+us,.code,func_806998C8,32,yes
+us,.code,func_806ECE2C,240,yes
+us,.code,func_80685F60,476,no
+us,.code,func_8060B55C,100,yes
+us,.code,func_806F027C,200,yes
+us,.code,func_806E9A5C,112,yes
+us,.code,func_8072E02C,124,yes
+us,.code,func_806E31FC,272,yes
+us,.code,func_806C850C,1144,no
+us,.code,func_8071321C,84,yes
+us,.code,func_806C6530,852,no
+us,.code,func_80737B50,8,yes
+us,.code,func_8066FE08,1856,no
+us,.code,func_806CEB44,192,no
+us,.code,func_80703CF8,984,no
+us,.code,func_807149C8,52,yes
+us,.code,func_8064B514,96,no
+us,.code,func_80726E60,128,no
+us,.code,func_80737CF4,316,no
+us,.code,func_806E709C,404,yes
+us,.code,setFlag,288,yes
+us,.code,func_80600C68,232,no
+us,.code,func_806EAC8C,48,yes
+us,.code,func_80691930,176,yes
+us,.code,func_80644EC8,504,no
+us,.code,func_806A6574,216,no
+us,.code,func_80602B60,172,no
+us,.code,func_8067A70C,120,yes
+us,.code,func_806A5C60,400,no
+us,.code,func_8065850C,280,no
+us,.code,gameIsInMainMenuMode,20,yes
+us,.code,func_8071B89C,80,no
+us,.code,func_806B3C94,132,yes
+us,.code,func_806E4D14,112,yes
+us,.code,func_807158C0,72,no
+us,.code,func_806CE174,880,no
+us,.code,func_806E6F74,124,yes
+us,.code,func_806398E4,132,no
+us,.code,func_80662188,72,yes
+us,.code,func_806AE2B0,228,yes
+us,.code,func_807069A4,1516,no
+us,.code,func_80678E6C,248,yes
+us,.code,func_8064F84C,264,no
+us,.code,func_8072E0A8,252,no
+us,.code,func_806F96CC,120,no
+us,.code,func_806F149C,32,yes
+us,.code,func_806D3B28,32,yes
+us,.code,func_80736FB8,112,no
+us,.code,func_807094D0,276,no
+us,.code,func_8060B49C,56,yes
+us,.code,func_806B3E08,116,yes
+us,.code,func_806A1FD8,848,no
+us,.code,func_8060131C,132,yes
+us,.code,func_8062B220,420,no
+us,.code,func_806ED420,232,yes
+us,.code,func_806E560C,224,no
+us,.code,func_806E918C,508,no
+us,.code,func_8060A6A0,288,no
+us,.code,func_8060AB38,16,yes
+us,.code,func_80676BCC,68,no
+us,.code,func_80629300,3632,no
+us,.code,func_806F014C,56,yes
+us,.code,func_80740A90,448,no
+us,.code,func_806833DC,756,no
+us,.code,func_80729AA4,80,yes
+us,.code,func_805FEF10,100,no
+us,.code,func_80690A28,136,no
+us,.code,func_806E2B20,340,no
+us,.code,func_8060E8CC,32,yes
+us,.code,func_8062A7D0,56,yes
+us,.code,func_807085D0,1512,no
+us,.code,func_806E521C,96,yes
+us,.code,func_806B1348,108,yes
+us,.code,__n_allocParam,96,yes
+us,.code,func_806F6EDC,76,yes
+us,.code,func_806EBA74,128,yes
+us,.code,func_8070F570,92,yes
+us,.code,func_806A112C,1108,no
+us,.code,func_8062D1E0,140,no
+us,.code,func_806E5ED4,204,yes
+us,.code,func_80676B70,92,yes
+us,.code,func_806F06A4,92,yes
+us,.code,func_80603450,5500,no
+us,.code,func_8062A228,36,yes
+us,.code,func_8060116C,52,yes
+us,.code,func_80717CE8,100,no
+us,.code,func_806717FC,132,yes
+us,.code,func_806EE10C,184,yes
+us,.code,func_8064B118,56,yes
+us,.code,func_8073CDD0,304,no
+us,.code,func_8067C71C,5540,no
+us,.code,func_806DF3D0,124,yes
+us,.code,func_806FD894,76,no
+us,.code,func_8067B4C8,1396,no
+us,.code,func_8063C784,64,yes
+us,.code,func_80692540,36,yes
+us,.code,func_806C9FD8,112,yes
+us,.code,func_807103E0,500,no
+us,.code,func_8065A708,380,no
+us,.code,func_8064B7E8,64,yes
+us,.code,func_8068A858,904,no
+us,.code,func_80684900,256,yes
+us,.code,func_806D2E9C,904,no
+us,.code,func_8064E174,692,no
+us,.code,func_806D024C,300,yes
+us,.code,func_806E884C,52,yes
+us,.code,func_8069B908,5268,no
+us,.code,func_806A734C,32,yes
+us,.code,func_80688320,80,yes
+us,.code,func_8070D754,216,no
+us,.code,func_80714608,48,yes
+us,.code,func_8073D060,224,no
+us,.code,func_8060CB9C,32,yes
+us,.code,func_8067B280,8,yes
+us,.code,func_806907B8,40,yes
+us,.code,func_806A1F64,108,yes
+us,.code,func_806FEDB0,460,no
+us,.code,func_8068AD7C,2704,no
+us,.code,func_8072E320,556,no
+us,.code,func_806CF4B8,200,no
+us,.code,func_806E41EC,916,yes
+us,.code,func_80635548,64,no
+us,.code,func_80670548,1812,no
+us,.code,func_806C71C0,8,yes
+us,.code,func_80604BE8,152,yes
+us,.code,func_80717100,268,no
+us,.code,func_806A7BDC,788,no
+us,.code,gameIsInMysteryMenuMinigameMode,52,yes
+us,.code,func_8062E548,192,no
+us,.code,func_80650794,288,no
+us,.code,func_8073E8B4,8,yes
+us,.code,func_806F70FC,636,no
+us,.code,func_806D3A38,144,yes
+us,.code,func_806ECC48,148,yes
+us,.code,func_80636448,124,yes
+us,.code,func_80611724,12,yes
+us,.code,func_8060BB18,200,no
+us,.code,func_806C71C8,8,yes
+us,.code,func_806F833C,1872,no
+us,.code,func_80737AC4,104,no
+us,.code,func_8062F640,856,no
+us,.code,func_806EA04C,88,yes
+us,.code,func_8063A8C4,164,no
+us,.code,func_80737198,212,no
+us,.code,func_80647D7C,644,no
+us,.code,func_8063C418,56,yes
+us,.code,func_8060245C,44,yes
+us,.code,func_80600530,96,yes
+us,.code,func_80650C98,108,no
+us,.code,func_8066B4AC,40,yes
+us,.code,func_8073A070,192,no
+us,.code,func_8067B2B8,8,yes
+us,.code,func_806D11FC,60,yes
+us,.code,func_80634FA0,120,yes
+us,.code,func_8066893C,180,no
+us,.code,func_806C4F5C,1660,no
+us,.code,func_806017B4,52,yes
+us,.code,func_80717404,860,no
+us,.code,func_806AE394,500,no
+us,.code,func_806D850C,752,yes
+us,.code,func_8064EB3C,96,yes
+us,.code,func_8073D1F0,2112,no
+us,.code,func_80657E24,240,no
+us,.code,func_806F0C18,336,no
+us,.code,func_806E8880,44,yes
+us,.code,func_806A5EAC,152,no
+us,.code,func_806639CC,64,yes
+us,.code,func_806E5488,388,yes
+us,.code,func_80709ACC,248,no
+us,.code,func_8068A20C,64,yes
+us,.code,func_8067AE0C,76,yes
+us,.code,func_806790F4,132,no
+us,.code,func_8067B2DC,280,yes
+us,.code,func_806D34B4,124,no
+us,.code,func_80694D20,1168,no
+us,.code,func_8069DC10,112,no
+us,.code,func_806DD24C,1576,no
+us,.code,func_80714360,52,yes
+us,.code,func_8064F210,224,no
+us,.code,func_8060ED6C,100,yes
+us,.code,func_806794EC,2264,no
+us,.code,func_806D97A4,124,yes
+us,.code,func_80683158,412,no
+us,.code,func_806F9848,680,no
+us,.code,func_8068A3A0,100,no
+us,.code,func_8072F120,272,no
+us,.code,func_806653C0,392,no
+us,.code,func_806F1B90,116,yes
+us,.code,func_806884B8,44,yes
+us,.code,func_8071D94C,552,no
+us,.code,func_806F5498,72,yes
+us,.code,func_80699958,3260,no
+us,.code,func_80703AB0,584,no
+us,.code,func_806CD988,24,yes
+us,.code,func_8064EC60,264,no
+us,.code,func_80682DF4,68,no
+us,.code,func_8070DB7C,32,no
+us,.code,func_806FB418,96,yes
+us,.code,func_8073C9C0,68,no
+us,.code,func_806FB490,644,no
+us,.code,func_8069E088,388,yes
+us,.code,func_80631B8C,64,yes
+us,.code,func_806E7900,584,yes
+us,.code,func_8072F4A8,244,yes
+us,.code,func_806D24E4,232,yes
+us,.code,func_80676AB8,128,no
+us,.code,func_80646058,1816,no
+us,.code,func_80731030,60,no
+us,.code,func_80650A70,104,no
+us,.code,alSeqpStop,64,yes
+us,.code,func_80632F20,84,no
+us,.code,func_806BD0CC,152,yes
+us,.code,func_8063D608,48,yes
+us,.code,func_8067E6E4,32,yes
+us,.code,func_8072F59C,824,no
+us,.code,func_80737B58,200,no
+us,.code,func_8068304C,268,no
+us,.code,func_806D2D38,140,yes
+us,.code,func_806E6318,80,yes
+us,.code,func_806DA320,196,yes
+us,.code,func_806C6884,716,no
+us,.code,func_8070068C,300,no
+us,.code,func_8060C6B8,108,yes
+us,.code,func_8063C4A8,28,yes
+us,.code,func_806F9744,260,no
+us,.code,func_8069E4E0,216,yes
+us,.code,func_80737608,40,no
+us,.code,func_806E607C,340,yes
+us,.code,func_8065297C,140,yes
+us,.code,func_806F6644,868,no
+us,.code,func_80635018,128,yes
+us,.code,func_80642748,252,no
+us,.code,func_80690AB0,312,no
+us,.code,func_8068A074,152,yes
+us,.code,func_80677148,1220,no
+us,.code,func_806D0964,132,yes
+us,.code,func_805FF898,96,yes
+us,.code,func_80672E90,44,no
+us,.code,func_806013E8,156,yes
+us,.code,func_8064AAC4,88,no
+us,.code,func_806B1F50,1384,no
+us,.code,func_80686390,1500,no
+us,.code,func_8064B260,76,no
+us,.code,func_80632FCC,248,no
+us,.code,func_80731B20,64,yes
+us,.code,func_8072DC7C,120,yes
+us,.code,func_8072DB68,276,yes
+us,.code,func_8066B7F4,212,no
+us,.code,func_8069E018,40,yes
+us,.code,func_80663C60,312,yes
+us,.code,func_806BD094,56,yes
+us,.code,func_80679010,84,no
+us,.code,func_806B9CE0,468,yes
+us,.code,func_805FE544,240,yes
+us,.code,func_806F1250,172,yes
+us,.code,func_806A1FD0,8,yes
+us,.code,func_8073A900,140,no
+us,.code,func_80641874,116,no
+us,.code,func_80601EE4,544,no
+us,.code,func_8060A1B0,488,no
+us,.code,func_80602498,276,no
+us,.code,func_80643F38,356,no
+us,.code,func_8060EA28,556,yes
+us,.code,func_806A7B94,36,yes
+us,.code,func_8072EA90,516,no
+us,.code,func_8068C20C,224,no
+us,.code,func_80636EFC,256,no
+us,.code,func_806EA334,300,yes
+us,.code,func_8072E2B0,112,yes
+us,.code,func_80714A28,16,yes
+us,.code,func_806E78B8,40,yes
+us,.code,func_80713168,84,yes
+us,.code,func_806B1D78,92,yes
+us,.code,func_805FF660,16,yes
+us,.code,func_806C7250,8,yes
+us,.code,func_807040D0,16,yes
+us,.code,func_8067A784,104,yes
+us,.code,func_805FC2B0,952,no
+us,.code,func_80713AA8,152,no
+us,.code,func_80705C00,860,no
+us,.code,func_806A8070,72,yes
+us,.code,func_8060F730,292,no
+us,.code,func_8067AC38,124,yes
+us,.code,func_8060C830,124,yes
+us,.code,func_8067B100,224,no
+us,.code,func_80724C2C,76,yes
+us,.code,func_806575D0,412,no
+us,.code,func_80666AB8,12,yes
+us,.code,func_806F1668,256,yes
+us,.code,func_8067C2B8,964,no
+us,.code,func_80713C8C,368,no
+us,.code,func_806CC8F0,48,yes
+us,.code,func_806B49B0,1052,no
+us,.code,func_806E9CDC,32,yes
+us,.code,func_8071D784,456,no
+us,.code,func_80733C34,344,no
+us,.code,func_8067B2B0,8,yes
+us,.code,func_80689DD4,196,no
+us,.code,func_8070D970,60,no
+us,.code,func_806545D4,468,no
+us,.code,func_806BC0E4,100,yes
+us,.code,func_8072C670,512,no
+us,.code,func_806D9320,1156,no
+us,.code,func_806E854C,472,no
+us,.code,func_806D2238,104,yes
+us,.code,func_806CC284,224,yes
+us,.code,func_806EC994,224,yes
+us,.code,func_806FB370,96,no
+us,.code,func_8063D930,96,no
+us,.code,func_80689C20,436,no
+us,.code,func_8067889C,328,no
+us,.code,func_807314F4,224,no
+us,.code,func_806C7258,8,yes
+us,.code,func_806D45A4,436,yes
+us,.code,func_806E6A38,352,yes
+us,.code,func_806B1EC8,32,yes
+us,.code,func_806EFB4C,236,yes
+us,.code,func_806E8D54,96,yes
+us,.code,func_8072DE10,52,yes
+us,.code,func_8072C918,1744,no
+us,.code,func_80726D7C,68,yes
+us,.code,func_806CEED8,228,no
+us,.code,func_80712634,36,yes
+us,.code,func_806730A4,412,no
+us,.code,func_806D3BC8,268,yes
+us,.code,func_80631FAC,216,no
+us,.code,func_806F8AD4,240,yes
+us,.code,func_806F5FE8,84,yes
+us,.code,func_806F942C,68,yes
+us,.code,func_806A4B84,600,no
+us,.code,func_806D22C0,112,yes
+us,.code,func_80636B50,176,no
+us,.code,func_8060095C,48,yes
+us,.code,func_806F6F28,384,yes
+us,.code,func_806F53EC,96,yes
+us,.code,func_806FD490,792,no
+us,.code,func_806A6408,96,yes
+us,.code,func_80738400,112,no
+us,.code,func_806F0074,8,yes
+us,.code,func_80662180,8,yes
+us,.code,func_806D1D84,104,yes
+us,.code,func_806F1990,136,no
+us,.code,func_806D1080,80,yes
+us,.code,func_806A9124,248,no
+us,.code,func_806FDF1C,56,yes
+us,.code,func_8067605C,304,no
+us,.code,func_80601D24,448,no
+us,.code,func_8068D9DC,280,no
+us,.code,func_8064F97C,256,no
+us,.code,func_806DF6D4,2144,no
+us,.code,func_8064B7D4,20,yes
+us,.code,func_80676590,88,yes
+us,.code,func_806A60BC,40,yes
+us,.code,func_806A285C,428,yes
+us,.code,func_80635098,124,yes
+us,.code,func_806EC4AC,604,no
+us,.code,func_806D0430,56,yes
+us,.code,func_8073F8A0,1264,no
+us,.code,func_80611534,96,no
+us,.code,func_8067881C,8,yes
+us,.code,func_8072DA60,68,yes
+us,.code,func_806A2B38,72,no
+us,.code,func_806E4E88,444,yes
+us,.code,func_806493C4,392,no
+us,.code,func_8067AB20,160,yes
+us,.code,func_8067A09C,212,no
+us,.code,func_80686F90,240,yes
+us,.code,func_806B8878,32,yes
+us,.code,func_8066B4D4,244,no
+us,.code,func_80652DB4,164,no
+us,.code,func_8065FB64,548,no
+us,.code,func_806882DC,68,yes
+us,.code,func_80602144,408,no
+us,.code,func_806D7FE8,136,yes
+us,.code,func_806C7B34,28,yes
+us,.code,func_80600340,172,no
+us,.code,func_8067C67C,32,yes
+us,.code,func_806637C0,132,no
+us,.code,func_8064B5A4,500,no
+us,.code,func_8068B9B4,120,no
+us,.code,func_806E8BFC,48,yes
+us,.code,func_8071F034,68,no
+us,.code,func_806D4A70,524,no
+us,.code,func_8064E55C,100,no
+us,.code,func_8073C604,540,no
+us,.code,func_80634768,332,no
+us,.code,func_806EB178,28,yes
+us,.code,func_806DF1A0,224,yes
+us,.code,func_80712830,276,yes
+us,.code,func_806E208C,180,no
+us,.code,func_8071F8E4,412,no
+us,.code,func_8064199C,92,no
+us,.code,func_80737924,108,no
+us,.code,func_80661B84,108,yes
+us,.code,func_806F397C,108,yes
+us,.code,func_806BA130,272,yes
+us,.code,func_80687CC8,128,yes
+us,.code,func_8070CD44,72,yes
+us,.code,func_80732420,28,no
+us,.code,func_806B76B0,384,no
+us,.code,func_806ED5C0,240,yes
+us,.code,func_8067E784,4932,no
+us,.code,func_80689710,224,yes
+us,.code,func_806DB670,1172,no
+us,.code,func_806EA200,108,yes
+us,.code,func_806B640C,500,no
+us,.code,func_8063C1EC,92,yes
+us,.code,func_80644A18,680,no
+us,.code,func_8062C22C,112,yes
+us,.code,func_8069900C,32,yes
+us,.code,func_8060098C,388,no
+us,.code,func_806BB81C,88,yes
+us,.code,func_8063BF34,696,no
+us,.code,func_8068A810,32,yes
+us,.code,func_80689B10,156,yes
+us,.code,func_806F4E74,72,yes
+us,.code,func_806B24B8,728,no
+us,.code,func_80732534,228,no
+us,.code,func_806ACA88,376,no
+us,.code,func_80679290,164,no
+us,.code,func_8065996C,1092,no
+us,.code,func_80692640,768,no
+us,.code,func_8067470C,376,no
+us,.code,func_80650684,100,yes
+us,.code,func_80664834,516,no
+us,.code,func_8066EABC,48,no
+us,.code,func_80685D84,244,yes
+us,.code,func_806CC920,40,yes
+us,.code,func_806B1290,184,yes
+us,.code,func_80724A9C,192,no
+us,.code,func_806CFEA4,40,yes
+us,.code,func_80732618,280,no
+us,.code,func_806E5E58,8,yes
+us,.code,func_8067E704,32,yes
+us,.code,func_8071DB74,284,no
+us,.code,func_806C8EE8,164,yes
+us,.code,func_806F0238,68,yes
+us,.code,func_8063DED0,284,no
+us,.code,func_805FE398,316,no
+us,.code,func_807131BC,96,yes
+us,.code,func_8062D2F0,244,no
+us,.code,func_80611850,172,no
+us,.code,gameIsInAdventureMode,52,yes
+us,.code,func_806319C4,444,no
+us,.code,func_806B1F28,32,yes
+us,.code,func_806B904C,404,no
+us,.code,func_80658E58,52,yes
+us,.code,func_8069CF54,196,no
+us,.code,func_80647508,264,yes
+us,.code,func_807127B4,64,yes
+us,.code,func_8065F5F0,36,no
+us,.code,func_8065A884,4636,no
+us,.code,func_80718080,116,no
+us,.code,func_806D91A4,380,no
+us,.code,func_806BFBB4,64,yes
+us,.code,func_8067A908,148,yes
+us,.code,func_806CCC10,68,no
+us,.code,func_8066F1F8,88,yes
+us,.code,func_80685B44,576,no
+us,.code,func_8062A3F0,900,no
+us,.code,func_8073E73C,196,no
+us,.code,func_80664D20,1088,no
+us,.code,func_80643354,236,no
+us,.code,func_80730AEC,628,no
+us,.code,func_80655BF0,264,yes
+us,.code,func_80677EC8,8,yes
+us,.code,func_80692940,1296,no
+us,.code,func_806CE4E4,700,no
+us,.code,alUnlink,64,yes
+us,.code,func_80671A6C,416,no
+us,.code,func_8060128C,72,yes
+us,.code,func_806C5C20,972,no
+us,.code,func_80642844,252,no
+us,.code,func_80672EBC,216,no
+us,.code,func_806C55E0,1600,no
+us,.code,func_80661054,528,no
+us,.code,func_80661484,76,yes
+us,.code,func_8062C99C,112,no
+us,.code,func_80600080,244,yes
+us,.code,func_8070D020,92,yes
+us,.code,func_806A3700,12,yes
+us,.code,func_80636FFC,2928,no
+us,.code,func_8072D13C,1496,no
+us,.code,func_80723320,44,yes
+us,.code,func_8064B828,64,yes
+us,.code,func_80733D8C,6296,no
+us,.code,func_8073209C,188,no
+us,.code,func_806D5008,528,no
+us,.code,func_80669930,148,no
+us,.code,func_806F5DF8,188,no
+us,.code,func_80610BD8,156,no
+us,.code,func_806C71A8,8,yes
+us,.code,func_805FCA64,48,yes
+us,.code,func_806BA8C8,116,yes
+us,.code,func_805FEF74,140,yes
+us,.code,isFlagSet,184,yes
+us,.code,func_806DE930,196,yes
+us,.code,func_807383F4,8,yes
+us,.code,func_80642204,212,yes
+us,.code,func_80739E24,56,no
+us,.code,func_8071006C,264,no
+us,.code,func_8066C8B0,84,yes
+us,.code,func_80634908,84,no
+us,.code,func_806732A8,124,no
+us,.code,func_8070CA70,68,yes
+us,.code,func_806EEA5C,156,yes
+us,.code,func_806C71F0,8,yes
+us,.code,func_806752D4,172,no
+us,.code,func_8064E428,100,no
+us,.code,func_806ECBD4,116,yes
+us,.code,func_806D1238,56,yes
+us,.code,func_8073DF50,792,no
+us,.code,func_8067AAB8,104,yes
+us,.code,func_806EBBD0,144,yes
+us,.code,func_80665ACC,24,yes
+us,.code,func_8067A9F0,104,yes
+us,.code,func_8060F928,56,no
+us,.code,clearGlobalFlags,80,yes
+us,.code,func_8072E740,156,yes
+us,.code,func_806776A0,1548,no
+us,.code,func_80722E00,72,yes
+us,.code,func_8062B8A4,64,yes
+us,.code,func_806D7DF8,144,yes
+us,.code,func_806C9C80,160,yes
+us,.code,func_8066E21C,164,yes
+us,.code,func_806F966C,96,no
+us,.code,func_80659F7C,1524,no
+us,.code,func_8071F660,248,no
+us,.code,func_806B2790,1484,no
+us,.code,func_80627C10,76,yes
+us,.code,func_80661E34,144,no
+us,.code,func_806CC8A8,16,yes
+us,.code,func_806BD170,628,no
+us,.code,func_8062A130,248,yes
+us,.code,func_806B4DCC,808,yes
+us,.code,func_8071586C,84,no
+us,.code,func_8060EDD0,136,no
+us,.code,alLink,52,yes
+us,.code,func_806A05FC,544,no
+us,.code,func_806C71F8,8,yes
+us,.code,func_8066635C,156,yes
+us,.code,func_8067B238,72,yes
+us,.code,func_806AA304,4584,no
+us,.code,func_806A3C6C,308,no
+us,.code,func_807317FC,176,no
+us,.code,func_8071E1C8,548,no
+us,.code,func_80714638,40,yes
+us,.code,func_80644CC0,144,no
+us,.code,func_80650ECC,2108,no
+us,.code,func_806EA9B4,144,yes
+us,.code,func_806116E0,68,no
+us,.code,func_8070C990,88,yes
+us,.code,func_8064E5C0,156,no
+us,.code,func_80659470,88,yes
+us,.code,func_80633A1C,788,no
+us,.code,func_8069D0F8,436,no
+us,.code,func_8067675C,44,yes
+us,.code,func_806884E4,48,yes
+us,.code,func_806D38AC,396,yes
+us,.code,func_806BA76C,348,no
+us,.code,func_806EFA08,20,yes
+us,.code,func_80687080,348,no
+us,.code,func_80645238,988,no
+us,.code,func_806FB2B8,184,no
+us,.code,func_8062EDA8,160,no
+us,.code,func_806CF918,180,no
+us,.code,func_806ACC00,100,yes
+us,.code,func_8065F134,140,no
+us,.code,func_8070DD44,152,no
+us,.code,func_80712490,40,yes
+us,.code,func_8063DE68,104,no
+us,.code,func_80690058,60,yes
+us,.code,func_80717930,564,no
+us,.code,func_8060E4B0,32,yes
+us,.code,func_806450C0,376,no
+us,.code,func_806DB3AC,708,no
+us,.code,func_806643C4,236,no
+us,.code,func_80675EE0,380,no
+us,.code,func_806A62B4,32,yes
+us,.code,func_805FF378,352,yes
+us,.code,func_8064B4AC,104,no
+us,.code,func_806C43A8,108,yes
+us,.code,func_806BB32C,212,yes
+us,.code,func_80737EA4,104,no
+us,.code,func_806A6230,132,yes
+us,.code,func_8066F274,396,no
+us,.code,func_80642E34,400,no
+us,.code,func_806613E8,88,yes
+us,.code,func_80660D38,788,no
+us,.code,func_806739D8,104,no
+us,.code,func_8067BCE8,32,yes
+us,.code,func_8064BB78,96,yes
+us,.code,func_806E2EA8,36,yes
+us,.code,func_80604CBC,180,no
+us,.code,func_80735AA0,596,no
+us,.code,func_806DBB04,1644,no
+us,.code,func_80601678,88,yes
+us,.code,func_806FEF7C,160,no
+us,.code,func_805FCFD8,88,yes
+us,.code,func_80689958,296,no
+us,.code,func_80713B40,332,no
+us,.code,func_80653DF0,184,no
+us,.code,func_80632F74,88,no
+us,.code,func_806DF44C,72,yes
+us,.code,func_80634EA4,56,yes
+us,.code,func_80683AD8,1460,no
+us,.code,func_80689250,456,no
+us,.code,func_8065CDA0,16,yes
+us,.code,func_80635EF0,292,no
+us,.code,func_806365D0,436,no
+us,.code,func_8063D638,540,no
+us,.code,func_806E3C38,180,yes
+us,.code,func_80688C84,64,no
+us,.code,func_806F0184,84,yes
+us,.code,func_80611408,300,no
+us,.code,func_80644E2C,156,no
+us,.code,func_80656E58,188,no
+us,.code,func_8066F84C,960,no
+us,.code,func_80642480,128,yes
+us,.code,func_806C19F4,348,yes
+us,.code,func_80731410,228,yes
+us,.code,func_80677D80,328,no
+us,.code,func_806E4D84,260,yes
+us,.code,func_8060E664,132,yes
+us,.code,func_8073195C,48,yes
+us,.code,func_8066F06C,396,no
+us,.code,func_806699C4,168,no
+us,.code,func_8066B06C,112,yes
+us,.code,func_8067BD28,144,yes
+us,.code,func_806BC148,100,yes
+us,.code,func_8068A784,44,no
+us,.code,func_8065EB10,1248,no
+us,.code,func_80639F1C,164,no
+us,.code,func_80718188,244,no
+us,.code,func_806AEE84,2052,no
+us,.code,func_80727958,1480,no
+us,.code,func_8065BAA0,980,no
+us,.code,func_80676540,80,yes
+us,.code,func_8064CD3C,904,no
+us,.code,func_806BD3E4,972,no
+us,.code,func_80631C20,28,yes
+us,.code,func_806D9940,404,yes
+us,.code,func_80674ADC,180,no
+us,.code,func_807144B8,212,yes
+us,.code,func_80689418,696,no
+us,.code,func_8064826C,820,no
+us,.code,func_806EBED0,100,yes
+us,.code,func_80738D20,312,no
+us,.code,func_80679490,92,yes
+us,.code,func_806DCF60,748,no
+us,.code,func_806C2DF4,3224,no
+us,.code,func_806E5C2C,72,yes
+us,.code,func_806F5CE4,156,yes
+us,.code,func_806CA048,160,yes
+us,.code,func_806DCA7C,1252,no
+us,.code,func_8066ADA0,324,no
+us,.code,func_806F4750,40,yes
+us,.code,func_80684850,176,yes
+us,.code,func_806E0654,64,yes
+us,.code,func_8068A118,76,yes
+us,.code,func_806F10E8,360,no
+us,.code,func_80675810,748,no
+us,.code,func_8065CFB8,80,yes
+us,.code,func_8065F1C0,732,no
+us,.code,func_8060E79C,80,yes
+us,.code,func_807007B8,572,no
+us,.code,func_80678B04,184,yes
+us,.code,func_80627C5C,588,no
+us,.code,func_8066EC6C,484,no
+us,.code,func_806085DC,144,no
+us,.code,func_806011E4,64,yes
+us,.code,func_806D37CC,224,yes
+us,.code,func_80631F58,84,no
+us,.code,func_806D4DE4,548,no
+us,.code,func_806C10A0,608,yes
+us,.code,func_8063D5AC,92,yes
+us,.code,func_80714950,12,yes
+us,.code,func_806A7600,1284,no
+us,.code,func_8065BF18,808,no
+us,.code,func_80653B80,624,no
+us,.code,func_8069D930,292,no
+us,.code,func_80659544,48,yes
+us,.code,func_80723F88,460,no
+us,.code,func_806F13C8,100,yes
+us,.code,func_806C3A8C,1156,no
+us,.code,func_8066B020,76,yes
+us,.code,func_806EE02C,64,yes
+us,.code,func_806ECCDC,248,yes
+us,.code,func_80726DC0,44,yes
+us,.code,func_806F50C8,424,no
+us,.code,func_80716F10,164,no
+us,.code,func_80712A40,320,no
+us,.code,func_806E8C2C,296,no
+us,.code,func_806012D4,72,yes
+us,.code,func_806E7DF4,1104,no
+us,.code,func_8073AD48,8,yes
+us,.code,func_806D491C,340,yes
+us,.code,func_8060E3B0,128,yes
+us,.code,func_8066CDF8,236,no
+us,.code,func_806DAA14,200,yes
+us,.code,func_806E2140,284,yes
+us,.code,func_806F8EB4,40,yes
+us,.code,func_806F94AC,108,no
+us,.code,func_806F91B4,568,no
+us,.code,func_80649D74,140,no
+us,.code,func_806E07F8,1012,no
+us,.code,func_8072FCC4,272,no
+us,.code,func_806E9580,644,no
+us,.code,func_806EB058,100,yes
+us,.code,func_806D21E4,84,yes
+us,.code,func_80688F74,76,yes
+us,.code,func_8065A654,12,yes
+us,.code,func_806C8220,748,no
+us,.code,func_807126B0,196,yes
+us,.code,func_806049CC,540,no
+us,.code,func_8060D2C8,1184,no
+us,.code,func_806306D0,60,no
+us,.code,func_8070D928,72,no
+us,.code,func_8066134C,76,yes
+us,.code,func_8072F09C,132,no
+us,.code,func_806C7220,8,yes
+us,.code,func_8060F854,212,no
+us,.code,func_80611730,276,no
+us,.code,func_80632E74,172,no
+us,.code,func_8069F020,2276,no
+us,.code,func_806883C8,44,yes
+us,.code,func_8072E5FC,324,no
+us,.code,func_80672C30,64,yes
+us,.code,func_80659670,764,no
+us,.code,func_806DF670,100,yes
+us,.code,func_806F603C,456,no
+us,.code,func_8067AEFC,72,yes
+us,.code,func_806762C0,72,yes
+us,.code,func_80676D00,464,no
+us,.code,func_8072A920,352,no
+us,.code,func_80672E64,8,yes
+us,.code,func_806E186C,484,yes
+us,.code,func_8060B968,104,no
+us,.code,func_8064EA48,108,yes
+us,.code,func_80685E78,232,no
+us,.code,func_80633570,64,no
+us,.code,func_80661EC4,72,yes
+us,.code,func_80630B70,604,no
+us,.code,func_80602D4C,120,yes
+us,.code,func_80681B14,196,no
+us,.code,func_806E5FA0,220,yes
+us,.code,func_8072DE44,100,yes
+us,.code,func_806C8D20,12,yes
+us,.code,func_806E84A4,28,yes
+us,.code,func_80662838,636,no
+us,.code,func_806DF5A0,208,no
+us,.code,func_806EB400,180,no
+us,.code,func_80712628,12,yes
+us,.code,alEvtqPostEvent,384,yes
+us,.code,func_8064B204,92,no
+us,.code,func_8060C8AC,712,no
+us,.code,func_805FCA94,1348,no
+us,.code,func_8064BB4C,44,yes
+us,.code,func_8072ED90,12,yes
+us,.code,func_806E06E8,148,yes
+us,.code,func_8066CEE4,876,no
+us,.code,func_8064CB3C,324,no
+us,.code,func_806AEE08,124,yes
+us,.code,func_806D3530,216,yes
+us,.code,func_806738D0,264,no
+us,.code,func_8070CCC4,80,yes
+us,.code,func_806ECDD4,88,yes
+us,.code,func_805FE7FC,1672,no
+us,.code,func_806ED508,184,yes
+us,.code,func_8062EBB8,496,no
+us,.code,func_805FB750,148,yes
+us,.code,func_80658B08,200,no
+us,.code,func_8061134C,64,no
+us,.code,func_806D7238,156,yes
+us,.code,func_8063C328,104,yes
+us,.code,func_806C6BC8,1496,no
+us,.code,func_806EEAF8,3384,no
+us,.code,func_806003EC,64,yes
+us,.code,func_806EFA1C,32,yes
+us,.code,func_80672B1C,184,yes
+us,.code,func_806725A0,68,yes
+us,.code,func_80665DE0,104,yes
+us,.code,func_8071C24C,576,no
+us,.code,func_806E36B4,344,no
+us,.code,func_806EA844,92,yes
+us,.code,func_806898F8,96,yes
+us,.code,func_806D5300,1264,yes
+us,.code,func_8060A634,60,yes
+us,.code,gameIsInDKTVMode,84,yes
+us,.code,func_8066104C,8,yes
+us,.code,func_8072EF7C,288,no
+us,.code,func_8073BE54,492,no
+us,.code,func_806EC8C4,208,no
+us,.code,func_8064774C,232,no
+us,.code,func_8064EAB4,136,yes
+us,.code,func_80651B64,92,yes
+us,.code,func_806F39E8,516,no
+us,.code,func_806DC410,1644,no
+us,.code,func_8064A180,20,yes
+us,.code,func_806CF580,760,no
+us,.code,func_805FB300,708,no
+us,.code,func_8060E6E8,180,yes
+us,.code,func_806791EC,20,yes
+us,.code,func_80659DB0,460,no
+us,.code,func_80726EE0,412,no
+us,.code,func_806696A0,400,no
+us,.code,func_806FD9B4,72,no
+us,.code,func_8068BBF8,1160,no
+us,.code,func_806D0408,40,yes
+us,.code,func_806897F0,184,yes
+us,.code,func_8066BB44,188,no
+us,.code,func_8060D14C,380,no
+us,.code,func_80650E20,172,no
+us,.code,func_806EB4B4,68,yes
+us,.code,func_806998E8,8,yes
+us,.code,func_8070DDDC,248,no
+us,.code,func_806EE660,80,yes
+us,.code,func_807063B8,576,no
+us,.code,func_806D27A4,120,yes
+us,.code,func_80688E08,96,yes
+us,.code,func_8068E9B0,136,no
+us,.code,func_807233B4,116,no
+us,.code,func_8067BCA8,32,yes
+us,.code,func_8072D99C,56,yes
+us,.code,func_8062F420,280,no
+us,.code,func_806D1D3C,72,yes
+us,.code,func_805FE4D4,112,no
+us,.code,func_807009F4,240,no
+us,.code,func_80713EB0,432,no
+us,.code,func_8068696C,240,no
+us,.code,func_8072818C,240,no
+us,.code,func_80690C60,720,no
+us,.code,func_806CF138,436,no
+us,.code,func_806D7F48,160,yes
+us,.code,func_805FB7E4,352,no
+us,.code,func_80700BF4,1188,no
+us,.code,func_806CA2E4,604,yes
+us,.code,func_806761D0,28,yes
+us,.code,func_806E9804,112,yes
+us,.code,func_806D5B44,392,yes
+us,.code,func_8060A500,268,no
+us,.code,func_80600B10,172,no
+us,.code,func_80634E10,148,yes
+us,.code,func_806C7228,8,yes
+us,.code,func_80645D14,556,no
+us,.code,func_80737F40,152,no
+us,.code,func_80605510,744,no
+us,.code,func_806FD9FC,144,no
+us,.code,func_8071B44C,212,no
+us,.code,func_806F2A40,520,no
+us,.code,func_806764D8,104,yes
+us,.code,func_80672328,632,no
+us,.code,func_80714660,8,yes
+us,.code,func_806F1858,156,no
+us,.code,func_8067BDF8,56,yes
+us,.code,func_806845B8,252,yes
+us,.code,func_8066E990,92,no
+us,.code,func_806A2B80,16,yes
+us,.code,func_8062C1C0,108,yes
+us,.code,func_8070F2FC,628,no
+us,.code,func_80600BBC,172,no
+us,.code,func_806D8070,56,yes
+us,.code,func_80671D64,156,no
+us,.code,func_80737E90,12,no
+us,.code,func_806EA600,40,yes
+us,.code,func_8063643C,12,yes
+us,.code,func_80600674,732,no
+us,.code,func_806CC970,412,no
+us,.code,func_807300BC,844,no
+us,.code,func_806FF628,308,no
+us,.code,func_806960A4,1232,no
+us,.code,func_806DD874,572,yes
+us,.code,func_80611688,8,yes
+us,.code,func_8063E5B4,256,no
+us,.code,func_80699070,184,no
+us,.code,func_80685708,276,no
+us,.code,func_806025D4,1216,no
+us,.code,func_806A0864,784,no
+us,.code,func_806E3040,444,no
+us,.code,func_80645700,456,no
+us,.code,func_80605380,400,no
+us,.code,func_8067BA7C,492,no
+us,.code,func_80671F54,480,no
+us,.code,func_80608DA8,920,no
+us,.code,func_8069F904,316,no
+us,.code,func_807232B8,52,yes
+us,.code,func_8073A488,144,no
+us,.code,func_8070E548,520,no
+us,.code,func_8071827C,260,no
+us,.code,func_8070A848,236,no
+us,.code,func_80601CC0,48,yes
+us,.code,func_806FA7BC,516,no
+us,.code,func_8066C958,560,no
+us,.code,func_8073A8BC,68,no
+us,.code,func_8066E9EC,120,no
+us,.code,func_8062F050,712,no
+us,.code,func_80658624,700,no
+us,.code,func_8069D358,204,no
+us,.code,func_80737FD8,68,no
+us,.code,func_806CF878,160,yes
+us,.code,func_806ED050,172,yes
+us,.code,func_805FF9AC,1188,no
+us,.code,func_806D2954,192,yes
+us,.code,func_80735A44,8,yes
+us,.code,func_8068BA2C,460,no
+us,.code,func_80689FEC,136,yes
+us,.code,func_806FACE8,764,no
+us,.code,func_8063E078,92,no
+us,.code,func_80738080,76,no
+us,.code,func_806E6E7C,100,yes
+us,.code,func_8067680C,412,no
+us,.code,func_806FDAEC,160,no
+us,.code,func_80663FCC,120,yes
+us,.code,func_80686E40,336,no
+us,.code,func_80661300,76,yes
+us,.code,func_80725BA4,540,no
+us,.code,func_80639C04,204,no
+us,.code,func_806FF358,720,no
+us,.code,func_806F6554,240,no
+us,.code,func_806E1728,204,yes
+us,.code,func_80689E98,12,yes
+us,.code,func_8072CFE8,164,no
+us,.code,func_80671D10,84,yes
+us,.code,func_806822FC,1976,no
+us,.code,func_80655258,440,no
+us,.code,func_80602DC4,168,no
+us,.code,func_8070CBA4,120,yes
+us,.code,func_806EE06C,160,yes
+us,.code,func_8068A7B0,96,yes
+us,.code,func_8063070C,160,no
+us,.code,clearPermanentFlags,80,yes
+us,.code,func_80665558,12,yes
+us,.code,func_807023E8,124,no
+us,.code,func_8060B5C0,268,yes
+us,.code,func_806F4D70,80,yes
+us,.code,func_806D2904,80,yes
+us,.code,func_806EAAA0,164,yes
+us,.code,func_80611154,12,yes
+us,.code,func_807184F4,468,no
+us,.code,func_8066AF40,224,no
+us,.code,func_8069A750,120,no
+us,.code,func_806EBFD0,68,yes
+us,.code,func_80600590,228,no
+us,.code,func_80737E40,8,yes
+us,.code,func_806E9D1C,196,yes
+us,.code,func_806291B4,332,no
+us,.code,func_80709BC4,1628,no
+us,.code,func_807264B0,568,no
+us,.code,func_80715A3C,244,no
+us,.code,func_806E3B00,276,yes
+us,.code,func_806C75A4,1372,no
+us,.code,func_8066715C,24,yes
+us,.code,func_806F8BC4,236,yes
+us,.code,func_8067760C,148,no
+us,.code,func_806EAF6C,128,yes
+us,.code,alEvtqNextEvent,164,yes
+us,.code,func_805FF8F8,64,yes
+us,.code,func_806871DC,548,no
+us,.code,alEvtqNew,156,yes
+us,.code,func_8060188C,40,yes
+us,.code,func_8064F358,172,no
+us,.code,func_806672B8,1444,no
+us,.code,func_80687400,116,yes
+us,.code,func_8064B370,136,yes
+us,.code,func_8067FAC8,164,no
+us,.code,func_806C71A0,8,yes
+us,.code,func_806D3CD4,136,yes
+us,.code,func_805FF168,32,yes
+us,.code,func_8069D018,64,yes
+us,.code,func_8063D468,44,yes
+us,.code,func_8067ABC0,120,yes
+us,.code,func_80737F0C,44,no
+us,.code,setIntroStoryPlaying,16,yes
+us,.code,func_8069CD9C,440,no
+us,.code,func_806E2C74,80,no
+us,.code,func_8063D4A4,264,no
+us,.code,func_8063BEC0,116,no
+us,.code,func_806E9874,132,yes
+us,.code,func_80678458,216,yes
+us,.code,func_806F8278,196,no
+us,.code,func_806EC2CC,240,yes
+us,.code,func_8066BC5C,248,no
+us,.code,func_8066C0DC,472,no
+us,.code,func_806F8A8C,72,yes
+us,.code,func_8062EE48,344,no
+us,.code,func_80642FC4,688,no
+us,.code,func_80602CE0,108,no
+us,.code,func_80724154,436,no
+us,.code,func_80692564,36,yes
+us,.code,func_8072DEA8,388,no
+us,.code,func_80717814,284,no
+us,.code,func_8062A24C,40,yes
+us,.code,func_806F0878,184,yes
+us,.code,func_8069AFF0,32,yes
+us,.code,func_8070DD18,44,no
+us,.code,func_8063E72C,744,no
+us,.code,func_806618A0,532,no
+us,.code,func_806CBE44,76,yes
+us,.code,func_806687E0,216,no
+us,.code,func_80700AE4,272,no
+us,.code,func_806E382C,32,yes
+us,.code,func_806C4EB4,44,yes
+us,.code,func_806FF144,488,no
+us,.code,func_807385F0,380,no
+us,.code,func_80641F68,8,yes
+us,.code,func_80658000,308,no
+us,.code,func_806522CC,168,yes
+us,.code,func_80737A9C,40,no
+us,.code,func_80642940,688,no
+us,.code,func_806EA26C,108,yes
+us,.code,func_80635468,224,no
+us,.code,func_805FEE84,52,yes
+us,.code,func_806E6FF0,96,yes
+us,.code,func_8062F998,560,no
+us,.code,func_8071496C,16,yes
+us,.code,func_8069E774,2012,no
+us,.code,func_80699128,348,no
+us,.code,func_806FC530,1880,no
+us,.code,func_806DFFDC,116,yes
+us,.code,func_80678014,60,yes
+us,.code,func_8063C390,48,yes
+us,.code,func_8064D1E8,560,no
+us,.code,func_806DA4D8,788,no
+us,.code,func_8071AADC,256,no
+us,.code,func_8060AC34,72,no
+us,.code,func_806E7230,264,yes
+us,.code,func_80653EA8,192,no
+us,.code,func_806EBAF4,80,yes
+us,.code,func_8066E72C,296,yes
+us,.code,func_806785D4,504,yes
+us,.code,func_8062F328,96,no
+us,.code,func_8067FB6C,3080,no
+us,.code,func_80645B9C,104,no
+us,.code,func_80602314,284,no
+us,.code,func_80694948,984,no
+us,.code,func_8060BBE0,192,no
+us,.code,func_8073A3C4,196,no
+us,.code,func_8072D08C,176,no
+us,.code,func_8066A834,340,no
+us,.code,func_8073BC74,336,no
+us,.code,func_806018D4,104,no
+us,.code,func_80712774,36,yes
+us,.code,func_806F12FC,84,yes
+us,.code,func_806A6DB4,1432,no
+us,.code,func_806E077C,124,yes
+us,.code,func_8066B0DC,16,yes
+us,.code,func_8073239C,132,yes
+us,.code,func_806D01AC,160,yes
+us,.code,func_806E8724,296,yes
+us,.code,func_806ED0FC,328,yes
+us,.code,func_80674330,268,no
+us,.code,func_8066EA90,44,yes
+us,.code,func_806B2D5C,8,yes
+us,.code,func_806F95C8,64,yes
+us,.code,func_8067E6C4,32,yes
+us,.code,func_80670F04,160,yes
+us,.code,func_80685984,448,no
+us,.code,func_806E330C,272,yes
+us,.code,func_806B7C74,556,no
+us,.code,func_806EE924,112,yes
+us,.code,func_80677CAC,172,yes
+us,.code,func_80666090,496,no
+us,.code,func_806B3F3C,84,yes
+us,.code,func_80740C50,760,no
+us,.code,func_80667110,76,yes
+us,.code,func_806A5DF0,188,no
+us,.code,func_806D2B90,32,yes
+us,.code,func_807149FC,12,yes
+us,.code,func_8065EAF4,20,yes
+us,.code,func_806787CC,32,yes
+us,.code,func_8073243C,8,yes
+us,.code,func_806832F4,232,no
+us,.code,func_80647218,752,no
+us,.code,func_806783BC,108,yes
+us,.code,func_8066B434,120,yes
+us,.code,func_806C1B50,380,no
+us,.code,func_8070FC40,140,no
+us,.code,func_807197B4,600,no
+us,.code,func_8068A164,84,yes
+us,.code,func_806BCF98,252,no
+us,.code,func_806FFF5C,44,yes
+us,.code,func_806A0330,676,no
+us,.code,func_8069A7C8,940,no
+us,.code,func_8071F3C0,132,no
+us,.code,func_8064C708,268,no
+us,.code,func_80681BD8,576,no
+us,.code,func_806D7098,216,yes
+us,.code,func_80675180,180,no
+us,.code,func_8066B424,16,yes
+us,.code,func_806423A8,216,no
+us,.code,func_806086CC,1756,no
+us,.code,func_80672134,500,no
+us,.code,func_8073E268,504,no
+us,.code,func_80663DA0,556,no
+us,.code,playSound,1068,no
+us,.code,func_806C9D7C,96,yes
+us,.code,func_806D8308,516,no
+us,.code,func_8072B7CC,3748,no
+us,.code,func_806F2C48,660,no
+us,.code,func_806016D0,88,yes
+us,.code,func_8073A518,376,no
+us,.code,func_806EF944,196,yes
+us,.code,func_8070835C,536,no
+us,.code,func_8060BA14,260,yes
+us,.code,func_80641C98,264,no
+us,.code,func_806919E0,2044,no
+us,.code,func_8065E124,20,yes
+us,.code,func_8062A808,60,yes
+us,.code,_n_collectPVoices,108,yes
+us,.code,func_80610044,548,no
+us,.code,func_80705B30,208,yes
+us,.code,func_80665160,156,yes
+us,.code,func_807122B4,476,no
+us,.code,func_806D2784,32,yes
+us,.code,func_8073CFB0,176,no
+us,.code,func_806C1640,244,yes
+us,.code,func_8063B4C0,664,no
+us,.code,func_806C7270,820,no
+us,.code,func_806CFDEC,68,yes
+us,.code,func_806AF688,984,no
+us,.code,func_8066241C,436,no
+us,.code,func_8073B560,112,no
+us,.code,func_806C92C4,64,yes
+us,.code,func_806A2328,1332,no
+us,.code,func_8071261C,12,yes
+us,.code,func_806B1EA8,32,yes
+us,.code,func_80674080,208,no
+us,.code,func_8071C914,212,no
+us,.code,func_806AD54C,608,yes
+us,.code,func_8073A2A4,288,no
+us,.code,func_806F1A18,200,yes
+us,.code,func_8070D9AC,124,no
+us,.code,func_8062A850,244,no
+us,.code,func_8062919C,12,yes
+us,.code,func_8071B1AC,160,no
+us,.code,func_8064BBD8,216,no
+us,.code,func_8067880C,8,yes
+us,.code,func_805FBE04,496,yes
+us,.code,func_806A1AC4,1124,no
+us,.code,func_807146F4,20,yes
+us,.code,func_806B486C,76,yes
+us,.code,func_80722FEC,52,yes
+us,.code,func_806B8C78,980,no
+us,.code,func_8069AB74,1148,no
+us,.code,func_806FBEAC,68,no
+us,.code,malloc,364,no
+us,.code,func_8072ED9C,112,no
+us,.code,func_80676C64,76,yes
+us,.code,func_806E88D8,436,no
+us,.code,func_806D2378,36,yes
+us,.code,func_806E5C74,236,yes
+us,.code,func_806E6368,80,yes
+us,.code,func_8069DF58,192,no
+us,.code,func_80650A04,108,no
+us,.code,func_8070FA58,488,no
+us,.code,func_807065F8,940,no
+us,.code,func_806C7B50,92,no
+us,.code,func_8072AB74,1968,no
+us,.code,func_8067B298,8,yes
+us,.code,func_806F3950,44,yes
+us,.code,func_806C9E70,48,yes
+us,.code,func_80651C2C,1312,no
+us,.code,func_80675AFC,372,no
+us,.code,func_80711F90,804,no
+us,.code,func_806C2B2C,592,no
+us,.code,func_806595F0,16,yes
+us,.code,func_806491F4,464,no
+us,.code,func_806D9820,260,no
+us,.code,func_80731654,304,no
+us,.code,func_8066461C,80,yes
+us,.code,func_8063CADC,100,yes
+us,.code,func_806FFB2C,216,no
+us,.code,func_806F1380,72,yes
+us,.code,func_80716FB4,332,no
+us,.code,func_80685020,176,yes
+us,.code,func_80673FDC,164,no
+us,.code,func_8067B42C,32,yes
+us,.code,func_8070AF24,312,no
+us,.code,func_806D59E4,352,yes
+us,.code,func_8063C6D8,172,yes
+us,.code,func_805FB944,792,no
+us,.code,func_80665564,1352,no
+us,.code,func_806F0700,204,yes
+us,.code,func_80703850,608,no
+us,.code,func_80601848,68,yes
+us,.code,loadExits,136,yes
+us,.code,func_8073876C,1076,no
+us,.code,func_8066B924,208,no
+us,.code,func_806FBD5C,336,no
+us,.code,func_806FF75C,976,no
+us,.code,func_806616A0,512,no
+us,.code,func_806EC800,196,yes
+us,.code,func_8067C69C,32,yes
+us,.code,func_806CFECC,40,yes
+us,.code,func_80704484,1244,no
+us,.code,func_805FF000,24,yes
+us,.code,func_8073BDC4,144,no
+us,.code,func_80629174,24,yes
+us,.code,func_806B8898,32,yes
+us,.code,func_80688584,180,yes
+us,.code,func_80652594,332,no
+us,.code,func_80711BD0,960,no
+us,.code,func_80732354,72,yes
+version,section,function,length,matching
+us,.code,func_80028C18,8,yes
+us,.code,func_8002A36C,252,yes
+us,.code,func_8003264C,736,no
+us,.code,func_8002AB80,340,no
+us,.code,func_8003292C,1572,no
+us,.code,func_80025B64,432,no
+us,.code,func_80026250,64,yes
+us,.code,func_800270E0,1292,no
+us,.code,func_80031980,220,no
+us,.code,func_80026B28,644,no
+us,.code,func_8002AD50,120,no
+us,.code,func_8002C584,176,yes
+us,.code,func_8002ECE8,304,no
+us,.code,func_80030258,232,no
+us,.code,func_80027E60,212,yes
+us,.code,func_8002EF68,796,no
+us,.code,func_800297A8,16,yes
+us,.code,func_8002E420,1176,no
+us,.code,func_80025D44,72,yes
+us,.code,func_800291CC,1500,no
+us,.code,func_80030250,8,yes
+us,.code,func_80026290,24,yes
+us,.code,func_8002AB28,88,no
+us,.code,func_80024BFC,180,yes
+us,.code,func_8002D520,716,no
+us,.code,func_80026874,692,no
+us,.code,func_80024EF0,956,no
+us,.code,func_80026DAC,636,no
+us,.code,func_80028C20,284,yes
+us,.code,func_8002F980,520,no
+us,.code,func_80032550,252,yes
+us,.code,func_8002D8AC,816,no
+us,.code,func_80025FB4,524,no
+us,.code,func_8002FC1C,284,yes
+us,.code,func_80024154,148,yes
+us,.code,func_800322D0,52,yes
+us,.code,func_80029EF8,400,yes
+us,.code,func_80025E04,432,yes
+us,.code,func_8002AA98,144,no
+us,.code,func_8002B708,2496,no
+us,.code,func_800241E8,60,yes
+us,.code,func_80027F34,12,yes
+us,.code,func_8002F6C8,148,yes
+us,.code,func_80026684,108,yes
+us,.code,func_800317E8,408,no
+us,.code,func_80027E10,80,yes
+us,.code,func_8002DEE8,192,yes
+us,.code,func_8002FE08,180,yes
+us,.code,func_8002A638,1120,no
+us,.code,func_8002F8EC,148,yes
+us,.code,func_8002A468,464,yes
+us,.code,func_8002CFA4,1404,no
+us,.code,func_8002C634,744,no
+us,.code,func_8002CB18,1164,no
+us,.code,func_8002FB88,148,no
+us,.code,func_800266F0,276,yes
+us,.code,func_8003155C,652,no
+us,.code,func_800275FC,316,no
+us,.code,func_80024CB0,576,no
+us,.code,func_8002907C,152,no
+us,.code,func_800261C0,144,yes
+us,.code,func_8002DBDC,780,no
+us,.code,func_80026804,112,yes
+us,.code,func_80030A90,388,no
+us,.code,func_80025AE0,8,yes
+us,.code,func_8002ADC8,2368,no
+us,.code,func_8002F284,1092,no
+us,.code,func_80028D3C,364,no
+us,.code,func_800252AC,2100,no
+us,.code,func_80030340,1364,no
+us,.code,func_80027738,208,no
+us,.code,func_80031B08,1308,no
+us,.code,func_800275EC,16,yes
+us,.code,func_80029AAC,264,yes
+us,.code,func_80024000,188,no
+us,.code,func_800244EC,668,no
+us,.code,func_8002FEBC,916,no
+us,.code,func_80025D8C,120,yes
+us,.code,func_8002C91C,508,no
+us,.code,func_80027028,184,yes
+us,.code,func_80027FAC,1820,no
+us,.code,func_80025AF0,116,no
+us,.code,func_800240BC,152,yes
+us,.code,func_80032304,456,no
+us,.code,func_80029D30,456,no
+us,.code,func_80027DEC,32,yes
+us,.code,func_8002E8B8,1072,no
+us,.code,func_800324CC,132,no
+us,.code,func_80032024,684,no
+us,.code,func_80029BB4,380,no
+us,.code,func_8002ACD4,124,no
+us,.code,func_8002C0C8,1212,no
+us,.code,func_80027808,384,no
+us,.code,func_8002D7EC,192,yes
+us,.code,func_80024788,1140,no
+us,.code,func_80028EA8,468,yes
+us,.code,func_8002FD38,208,yes
+us,.code,func_80025D14,48,yes
+us,.code,func_80030894,508,no
+us,.code,func_80027988,1124,no
+us,.code,func_80031A5C,172,no
+us,.code,func_80028834,996,no
+us,.code,func_80024224,500,no
+us,.code,func_8002EE18,336,yes
+us,.code,func_8002F75C,400,no
+us,.code,func_8002DFA8,1144,no
+us,.code,func_8002A088,740,no
+us,.code,func_800286C8,364,no
+us,.code,func_80029114,184,yes
+us,.code,func_80027F40,108,yes
+us,.code,func_800262A8,988,no
+us,.code,func_800297B8,756,no
+us,.code,func_80024418,212,yes
+us,.code,func_80030C14,2376,no
+version,section,function,length,matching
+us,.code,func_800245B0,316,no
+us,.code,func_8002698C,60,yes
+us,.code,func_80025654,320,no
+us,.code,func_80025B48,416,no
+us,.code,func_800253C8,60,yes
+us,.code,func_80025CE8,668,no
+us,.code,func_80026E20,336,no
+us,.code,func_80024254,168,no
+us,.code,func_80025FFC,152,no
+us,.code,func_80026BD8,360,no
+us,.code,func_800246EC,748,no
+us,.code,func_80025608,76,no
+us,.code,func_80024CA4,1472,no
+us,.code,func_80026B0C,204,yes
+us,.code,func_8002452C,132,yes
+us,.code,func_80025794,948,no
+us,.code,func_800242FC,204,yes
+us,.code,func_80025264,276,no
+us,.code,func_800243C8,212,no
+us,.code,func_80024000,500,no
+us,.code,func_80025404,516,no
+us,.code,func_80026D40,224,yes
+us,.code,func_800268C0,28,yes
+us,.code,func_80026094,2092,no
+us,.code,func_800269C8,324,no
+us,.code,func_800249D8,716,no
+us,.code,func_800241F4,96,no
+us,.code,func_80025378,80,no
+us,.code,func_80025F84,120,no
+us,.code,func_800268DC,176,no
+us,.code,func_8002449C,144,yes
+version,section,function,length,matching
+us,.code,func_8002430C,1116,no
+us,.code,func_80024B00,888,no
+us,.code,func_80024768,296,yes
+us,.code,func_80024E78,344,no
+us,.code,func_80024914,492,no
+us,.code,func_80027E04,228,no
+us,.code,func_80024254,184,no
+us,.code,func_80027778,1404,no
+us,.code,func_80026DA8,2512,no
+us,.code,func_8002835C,912,no
+us,.code,func_800286EC,1188,no
+us,.code,func_800241A0,180,yes
+us,.code,func_800253C0,4656,no
+us,.code,func_80027CF4,172,no
+us,.code,func_80026C54,340,yes
+us,.code,func_80027EE8,468,no
+us,.code,func_800280BC,672,no
+us,.code,func_80024000,220,yes
+us,.code,func_800240DC,196,yes
+us,.code,func_80027DA0,100,no
+us,.code,func_800265F0,1404,no
+us,.code,func_80026B6C,232,yes
+us,.code,func_8002538C,52,yes
+us,.code,func_80024FD0,956,no
+us,.code,func_80024890,132,no
+version,section,function,length,matching
+us,.code,func_800274C0,496,no
+us,.code,func_8002D2C0,120,no
+us,.code,func_8002DD70,48,yes
+us,.code,func_80027AF8,56,yes
+us,.code,func_8002CAC8,292,no
+us,.code,func_800282D8,252,no
+us,.code,func_800294A8,740,no
+us,.code,func_80024634,92,yes
+us,.code,func_8002D40C,148,no
+us,.code,func_8002578C,24,yes
+us,.code,func_8002F420,112,no
+us,.code,func_8002DF38,656,no
+us,.code,func_8002E960,76,no
+us,.code,func_8002B6C8,44,yes
+us,.code,func_80026B20,392,no
+us,.code,func_8002B6F4,120,yes
+us,.code,func_8002DE78,192,no
+us,.code,func_8002D338,40,yes
+us,.code,func_80027710,368,no
+us,.code,func_80024690,4320,no
+us,.code,func_8002A7F8,1652,no
+us,.code,castleCarRaceSetup,76,yes
+us,.code,func_80027BD0,144,no
+us,.code,func_8002DC24,204,no
+us,.code,func_8002D72C,40,yes
+us,.code,func_80026F04,1468,no
+us,.code,func_80029F88,248,no
+us,.code,func_80026EE4,32,yes
+us,.code,func_8002AE6C,48,yes
+us,.code,func_8002F490,756,no
+us,.code,func_8002D360,172,no
+us,.code,func_80026354,1996,no
+us,.code,func_80027C60,136,yes
+us,.code,func_8002F0AC,468,no
+us,.code,func_8002DDA0,216,no
+us,.code,func_8002D224,156,no
+us,.code,func_8002DB90,148,yes
+us,.code,func_80028E20,564,no
+us,.code,func_80027CE8,1024,no
+us,.code,func_8002E1C8,256,no
+us,.code,sealRaceSetup,32,yes
+us,.code,func_8002ECD4,48,yes
+us,.code,func_8002F280,132,no
+us,.code,func_8002E2C8,412,no
+us,.code,func_8002E9AC,76,no
+us,.code,func_8002BBD0,92,yes
+us,.code,func_8002D0B0,76,yes
+us,.code,func_80026D2C,440,no
+us,.code,func_800283D4,108,no
+us,.code,func_8002F304,104,yes
+us,.code,func_80027B30,160,no
+us,.code,func_8002BDDC,268,no
+us,.code,func_8002F90C,68,yes
+us,.code,func_800292B0,32,yes
+us,.code,func_80026004,76,yes
+us,.code,func_80029054,604,no
+us,.code,func_8002978C,2044,no
+us,.code,func_8002CFF0,116,yes
+us,.code,func_800292D0,440,no
+us,.code,func_80025FDC,40,yes
+us,.code,setupRaceOnMapLoad,204,yes
+us,.code,func_800280E8,496,no
+us,.code,func_8002BCD4,264,no
+us,.code,func_8002E464,32,yes
+us,.code,func_8002A0AC,1444,no
+us,.code,func_8002A080,44,yes
+us,.code,func_800276B0,96,no
+us,.code,func_80024000,1588,no
+us,.code,func_8002597C,1312,no
+us,.code,func_80026CA8,132,yes
+us,.code,func_8002F36C,180,no
+us,.code,func_8002D0FC,76,yes
+us,.code,func_8002B180,920,no
+us,.code,func_8002B610,184,no
+us,.code,func_8002C63C,304,no
+us,.code,func_80026050,72,yes
+us,.code,func_800261E0,372,no
+us,.code,func_8002DCF0,128,no
+us,.code,func_80027880,160,no
+us,.code,func_80025770,28,yes
+us,.code,func_8002F950,448,no
+us,.code,func_8002CBEC,1028,no
+us,.code,func_8002B76C,504,no
+us,.code,func_80028AD0,848,no
+us,.code,func_8002AE9C,740,no
+us,.code,func_8002F04C,96,no
+us,.code,func_8002E8EC,116,no
+us,.code,func_8002BEE8,612,no
+us,.code,func_8002B518,248,no
+us,.code,func_8002F784,392,no
+us,.code,func_8002E9F8,528,no
+us,.code,func_8002EDD4,632,no
+us,.code,func_8002D148,220,no
+us,.code,func_8002D754,36,yes
+us,.code,func_8002B964,620,no
+us,.code,func_80026098,328,no
+us,.code,func_80028440,1680,no
+us,.code,func_8002D524,520,no
+us,.code,func_8002BC2C,132,no
+us,.code,func_8002ED04,208,yes
+us,.code,func_8002E484,448,no
+us,.code,func_80025E9C,320,no
+us,.code,func_80027920,472,no
+us,.code,initializeCastleCarRace,424,no
+us,.code,func_8002C14C,412,no
+us,.code,func_8002C76C,860,no
+us,.code,func_800257A4,472,no
+us,.code,func_8002DA68,296,yes
+us,.code,func_8002C2E8,852,no
+us,.code,func_8002BCB0,36,no
+us,.code,func_8002D778,752,no
+us,.code,func_8002E644,680,no
+us,.code,func_8002D4A0,132,yes
+version,section,function,length,matching
+us,.code,func_8002AED8,2632,no
+us,.code,func_80027308,52,yes
+us,.code,func_8002BF98,2388,no
+us,.code,func_8002563C,136,yes
+us,.code,func_8002881C,1568,no
+us,.code,func_800264E0,224,yes
+us,.code,func_80024E38,1128,no
+us,.code,func_80024D8C,172,no
+us,.code,func_8002BE44,340,no
+us,.code,func_8002D7E8,112,yes
+us,.code,func_800240F0,104,yes
+us,.code,func_800256C4,72,no
+us,.code,func_8002D2F0,1032,no
+us,.code,func_800277F8,1820,no
+us,.code,func_800284C0,392,no
+us,.code,func_80026CF0,1220,no
+us,.code,func_80028648,468,no
+us,.code,func_80025480,48,no
+us,.code,func_800271B4,340,no
+us,.code,func_8002CC08,1032,no
+us,.code,func_80024D3C,80,no
+us,.code,func_8002B920,1316,no
+us,.code,func_80024158,3044,no
+us,.code,func_8002A398,1804,no
+us,.code,func_8002AAA4,620,no
+us,.code,func_80028E3C,1320,no
+us,.code,func_800261B8,808,no
+us,.code,func_80029B9C,696,no
+us,.code,func_80029364,2104,no
+us,.code,func_8002733C,356,no
+us,.code,func_80024000,240,no
+us,.code,func_8002AD10,456,no
+us,.code,func_8002C8EC,796,no
+us,.code,func_800265C0,200,yes
+us,.code,func_8002D010,736,no
+us,.code,func_8002570C,2732,no
+us,.code,func_80026940,944,no
+us,.code,func_800253E4,156,yes
+us,.code,func_800274A0,168,yes
+us,.code,func_80029E54,444,no
+us,.code,func_80026690,688,no
+us,.code,func_800254B0,396,no
+us,.code,func_8002D6F8,240,no
+us,.code,func_800252A0,324,no
+us,.code,func_80027F14,1452,no
+us,.code,func_8002A010,904,no
+us,.code,func_80027548,688,no
+version,section,function,length,matching
+us,.code,func_8002658C,744,no
+us,.code,func_800255C4,528,no
+us,.code,func_80027118,552,no
+us,.code,func_800247F4,900,no
+us,.code,func_80024C88,672,no
+us,.code,func_800288A8,500,no
+us,.code,func_8002904C,196,no
+us,.code,func_80027340,264,no
+us,.code,func_80029110,8,yes
+us,.code,func_80026874,144,no
+us,.code,func_80025DB8,388,no
+us,.code,func_80024578,64,yes
+us,.code,func_80025F8C,144,yes
+us,.code,func_80025F3C,80,yes
+us,.code,func_80025A3C,148,no
+us,.code,func_80025500,196,no
+us,.code,func_80026530,92,yes
+us,.code,func_80024154,296,no
+us,.code,func_80028840,104,yes
+us,.code,func_80026410,92,yes
+us,.code,func_80026B78,292,no
+us,.code,func_800296DC,276,no
+us,.code,func_80026E0C,452,no
+us,.code,func_80026C9C,368,no
+us,.code,func_80028EE8,356,no
+us,.code,func_80026298,40,yes
+us,.code,func_80024518,96,no
+us,.code,func_80029118,1476,no
+us,.code,func_80027DC0,864,no
+us,.code,func_80028DE8,256,no
+us,.code,func_80028120,1824,no
+us,.code,func_80026904,344,no
+us,.code,func_80025AD0,588,no
+us,.code,func_8002427C,528,no
+us,.code,func_800245B8,572,no
+us,.code,func_80026338,216,yes
+us,.code,func_8002601C,636,no
+us,.code,func_80024000,156,no
+us,.code,func_80024F28,580,no
+us,.code,func_80028A9C,844,no
+us,.code,func_8002516C,916,no
+us,.code,func_80026A5C,284,yes
+us,.code,func_80024B78,272,no
+us,.code,func_80025D1C,156,no
+us,.code,func_800262C0,120,no
+us,.code,func_8002646C,196,yes
+us,.code,func_80026FD0,100,yes
+us,.code,func_800257D4,220,no
+us,.code,func_80027448,2424,no
+us,.code,func_8002448C,140,no
+us,.code,func_800258B0,396,no
+us,.code,func_80027034,88,yes
+us,.code,func_8002708C,140,no
+us,.code,func_800240EC,104,yes
+us,.code,func_8002409C,80,yes
+version,section,function,length,matching
+us,.code,func_80030C70,124,yes
+us,.code,func_80024764,84,yes
+us,.code,func_8002451C,296,yes
+us,.code,arcade_nintendo_coin_update,316,yes
+us,.code,func_8002B390,1292,no
+us,.code,func_80029ACC,516,yes
+us,.code,arcade_pie_update,360,yes
+us,.code,func_8002AF2C,120,yes
+us,.code,func_80030FEC,500,yes
+us,.code,arcade_75m_setup,1792,yes
+us,.code,func_8002E3D4,780,no
+us,.code,func_800252D8,452,yes
+us,.code,func_8002F82C,1532,no
+us,.code,arcade_100m_setup,1460,yes
+us,.code,arcade_25m_setup,1328,yes
+us,.code,func_80030CEC,708,no
+us,.code,arcade_help_text_update,356,yes
+us,.code,func_8002628C,352,yes
+us,.code,func_800244E4,36,yes
+us,.code,func_80024320,236,yes
+us,.code,func_80029CD0,556,no
+us,.code,func_800319D4,2124,no
+us,.code,func_800263EC,300,yes
+us,.code,func_80027A38,1108,no
+us,.code,func_800255A8,76,yes
+us,.code,func_80029968,356,yes
+us,.code,func_80024508,20,yes
+us,.code,func_8002419C,388,yes
+us,.code,func_800268AC,1608,no
+us,.code,func_800246EC,120,yes
+us,.code,arcade_pauline_bottom_update,268,yes
+us,.code,arcade_bonus_item_update,260,yes
+us,.code,func_800247B8,56,yes
+us,.code,func_8002AFA4,796,yes
+us,.code,func_80024E84,852,yes
+us,.code,func_8002AC54,728,yes
+us,.code,arcade_rivet_update,388,yes
+us,.code,func_8002440C,216,yes
+us,.code,func_800247F0,56,yes
+us,.code,arcade_get_object_type_count,104,yes
+us,.code,func_800259D0,568,yes
+us,.code,__arcade_abs_w,24,yes
+us,.code,arcade_dk_50m_update,460,yes
+us,.code,func_8002A390,120,yes
+us,.code,func_8002B89C,4924,no
+us,.code,arcade_dk_title_update,692,yes
+us,.code,func_80027E8C,128,yes
+us,.code,func_8002D6FC,2652,no
+us,.code,func_8002A264,300,no
+us,.code,func_800251D8,104,yes
+us,.code,func_800311E0,472,no
+us,.code,func_80024CF8,152,yes
+us,.code,func_80030734,332,yes
+us,.code,func_80025C08,1096,yes
+us,.code,func_8002B2C0,184,yes
+us,.code,func_8002CBD8,396,yes
+us,.code,func_80026EF4,1516,no
+us,.code,func_80025240,100,yes
+us,.code,func_80029EFC,872,no
+us,.code,func_80024000,412,yes
+us,.code,func_8002EEB8,2420,no
+us,.code,func_800257D8,392,yes
+us,.code,func_80024C34,196,yes
+us,.code,func_80024644,48,yes
+us,.code,func_800255F4,484,yes
+us,.code,func_80025960,112,yes
+us,.code,arcade_barrel_stack_update,60,yes
+us,.code,func_80026518,360,yes
+us,.code,func_80026050,572,yes
+us,.code,func_80024A50,180,no
+us,.code,func_800274E0,264,no
+us,.code,func_8002E158,636,no
+us,.code,arcade_pulley_update,196,yes
+us,.code,func_8002549C,268,yes
+us,.code,func_80026680,556,yes
+us,.code,func_80030A04,260,no
+us,.code,func_8002A734,752,yes
+us,.code,func_800252A4,52,yes
+us,.code,func_80024828,56,yes
+us,.code,func_80024D90,244,yes
+us,.code,func_800275E8,1104,no
+us,.code,arcade_50m_setup,2168,yes
+us,.code,func_8003159C,940,yes
+us,.code,func_8002CD64,2456,no
+us,.code,func_8002AA24,560,yes
+us,.code,func_8002FE28,540,no
+us,.code,arcade_add_points_to_score,84,yes
+us,.code,arcade_hammer_update,892,yes
+us,.code,func_8002A474,704,yes
+us,.code,arcade_pauline_top_update,180,yes
+us,.code,func_80024940,272,no
+us,.code,func_80031948,140,yes
+us,.code,func_8002A408,108,no
+us,.code,func_800313B8,484,yes
+us,.code,func_80024B04,304,no
+us,.code,arcade_points_text_update,164,yes
+us,.code,func_80024860,120,yes
+us,.code,func_800246C8,36,yes
+version,section,function,length,matching
+us,.code,func_800274C0,80,yes
+us,.code,func_80025B70,72,yes
+us,.code,func_80029F7C,728,no
+us,.code,func_80025FC4,280,no
+us,.code,func_8002A8F0,84,no
+us,.code,func_8002ABDC,432,no
+us,.code,func_8002976C,280,no
+us,.code,func_8002466C,564,no
+us,.code,func_80025904,348,no
+us,.code,func_80025A60,272,no
+us,.code,func_80028FC0,164,no
+us,.code,func_8002AEC8,52,yes
+us,.code,func_80026D48,128,no
+us,.code,func_80029AF8,152,yes
+us,.code,func_80024390,120,no
+us,.code,func_800298C8,100,yes
+us,.code,func_80024A4C,64,yes
+us,.code,func_800292C4,396,no
+us,.code,func_8002A374,444,no
+us,.code,func_80027728,1216,no
+us,.code,func_80029C1C,496,no
+us,.code,func_80024408,564,no
+us,.code,func_80028BD0,108,yes
+us,.code,func_80029E0C,368,no
+us,.code,func_80026A3C,116,yes
+us,.code,func_80028CF8,268,no
+us,.code,func_80025C40,96,no
+us,.code,func_80028E88,312,no
+us,.code,func_80029064,328,no
+us,.code,func_8002A2DC,152,no
+us,.code,func_80024A8C,516,no
+us,.code,func_80028C3C,188,yes
+us,.code,func_80027510,228,no
+us,.code,func_80025368,248,no
+us,.code,func_800260DC,572,no
+us,.code,func_8002419C,500,no
+us,.code,func_80027D64,348,no
+us,.code,func_80027108,264,yes
+us,.code,func_8002A530,332,no
+us,.code,func_80026FE0,48,yes
+us,.code,func_8002AD8C,116,no
+us,.code,func_80024F64,56,yes
+us,.code,func_8002992C,96,yes
+us,.code,func_800250A0,200,yes
+us,.code,func_80027410,108,yes
+us,.code,func_80027060,168,yes
+us,.code,func_800254B8,284,no
+us,.code,func_8002463C,48,yes
+us,.code,func_800291AC,88,yes
+us,.code,func_80027480,64,yes
+us,.code,func_80026318,1828,no
+us,.code,func_80028E04,132,no
+us,.code,func_8002998C,364,no
+us,.code,func_80028544,152,no
+us,.code,func_80025F48,124,no
+us,.code,func_80028340,172,no
+us,.code,func_80028B54,124,no
+us,.code,func_8002A944,48,yes
+us,.code,func_80025BB8,136,no
+us,.code,func_8002A6C0,152,yes
+us,.code,func_80025168,512,no
+us,.code,func_800285DC,88,yes
+us,.code,func_8002A67C,68,yes
+us,.code,func_8002A758,408,no
+us,.code,func_8002A2AC,48,no
+us,.code,func_80029884,68,no
+us,.code,func_80024E70,180,no
+us,.code,func_800286D0,640,no
+us,.code,func_800289EC,360,no
+us,.code,func_80024000,412,no
+us,.code,func_8002A974,352,no
+us,.code,func_800275F4,308,no
+us,.code,func_8002AE00,148,no
+us,.code,func_80027010,72,yes
+us,.code,func_80024F9C,260,no
+us,.code,func_8002A254,88,yes
+us,.code,func_80029450,156,no
+us,.code,func_80029B90,140,yes
+us,.code,func_80026CEC,92,no
+us,.code,func_80026AB0,500,no
+us,.code,func_800248A0,72,yes
+us,.code,func_8002AAD4,264,no
+us,.code,func_80027EC0,1152,no
+us,.code,func_800283EC,344,no
+us,.code,func_80026DC8,536,no
+us,.code,func_80027BE8,380,no
+us,.code,func_80027210,64,yes
+us,.code,func_80029640,300,no
+us,.code,func_80027250,224,no
+us,.code,func_80024C90,184,yes
+us,.code,func_8002AEFC,404,no
+us,.code,func_80028950,156,no
+us,.code,func_80024D48,296,no
+us,.code,func_80025CB0,664,no
+us,.code,func_80028634,156,no
+us,.code,func_800294EC,340,no
+us,.code,func_80027380,72,yes
+us,.code,func_800273C8,72,yes
+us,.code,func_80026CA4,72,yes
+us,.code,func_800255D4,300,yes
+us,.code,func_80027330,80,yes
+us,.code,func_80025CA0,16,yes
+us,.code,func_80025700,516,no
+us,.code,func_80029204,192,yes
+us,.code,func_800248E8,356,no
+us,.code,func_80024F24,64,no
+us,.code,func_8002AE94,52,yes
+us,.code,func_80025460,88,yes
+version,section,function,length,matching
+us,.code,func_8002920C,160,yes
+us,.code,func_80033AF0,7276,no
+us,.code,func_80033A80,112,yes
+us,.code,func_80028478,520,no
+us,.code,func_80029140,204,yes
+us,.code,func_8002C748,132,yes
+us,.code,func_800254D0,8864,no
+us,.code,func_8003340C,152,yes
+us,.code,func_8002531C,72,yes
+us,.code,func_80024EAC,252,yes
+us,.code,func_80024300,524,no
+us,.code,func_8002C5F4,340,yes
+us,.code,func_80027A30,376,no
+us,.code,func_80030C30,288,yes
+us,.code,func_8002E82C,396,yes
+us,.code,func_80030D50,264,yes
+us,.code,func_8002FEC0,180,yes
+us,.code,func_8002DCE0,156,yes
+us,.code,func_8002A5CC,748,yes
+us,.code,func_80024568,2372,no
+us,.code,func_80028878,2140,no
+us,.code,func_8002E9B8,92,yes
+us,.code,func_8002FC98,352,no
+us,.code,func_8002DD7C,136,yes
+us,.code,func_8003392C,172,no
+us,.code,func_8002EA7C,1668,no
+us,.code,func_8002DC60,128,yes
+us,.code,func_80031AA0,4200,no
+us,.code,func_8002C520,212,yes
+us,.code,func_8002FDF8,200,yes
+us,.code,func_80030888,152,no
+us,.code,func_8002EA14,104,yes
+us,.code,func_8002C964,2252,no
+us,.code,func_80028458,32,yes
+us,.code,func_8002FF74,2324,no
+us,.code,func_8002450C,24,no
+us,.code,func_800251A0,380,yes
+us,.code,func_800292B0,272,yes
+us,.code,func_80024FA8,504,yes
+us,.code,func_8002A8B8,116,yes
+us,.code,func_80030AE0,336,yes
+us,.code,func_80025364,72,yes
+us,.code,func_800336C0,196,yes
+us,.code,func_8002FC48,80,yes
+us,.code,func_80028818,8,yes
+us,.code,func_80030EC4,3036,no
+us,.code,func_800253AC,292,no
+us,.code,func_80032B08,1480,no
+us,.code,func_80029468,3544,no
+us,.code,func_80027840,180,no
+us,.code,func_800290D4,108,yes
+us,.code,func_800334A4,540,no
+us,.code,func_80024000,316,no
+us,.code,func_8002D230,2608,no
+us,.code,func_80027950,224,no
+us,.code,func_80030920,448,no
+us,.code,func_8002A92C,7156,no
+us,.code,func_80028820,88,yes
+us,.code,func_80030E58,108,yes
+us,.code,func_8002FB7C,204,yes
+us,.code,func_8002A41C,320,yes
+us,.code,func_800278F4,92,yes
+us,.code,func_80024524,68,no
+us,.code,func_8002E7A0,140,yes
+us,.code,func_8002A240,476,no
+us,.code,func_800330D0,828,no
+us,.code,func_8002A55C,112,yes
+us,.code,func_800293C0,168,yes
+us,.code,func_8002C8B4,176,yes
+us,.code,func_80027BA8,2224,no
+us,.code,func_8002C7CC,232,yes
+us,.code,func_800339D8,168,yes
+us,.code,func_8003575C,328,yes
+us,.code,func_800286B8,352,no
+us,.code,func_8002413C,452,no
+us,.code,func_8002DE04,2460,no
+us,.code,func_8002F100,2684,no
+us,.code,func_80033784,424,no
+us,.code,func_80028680,56,yes
+us,.code,func_80027770,208,no
+version,section,function,length,matching
+us,boot,func_80005A70,16,no
+us,boot,func_800058BC,92,no
+us,boot,osDestroyThread,260,yes
+us,boot,guSprite2DInit,80,no
+us,boot,func_8000102C,144,yes
+us,boot,osRecvMesg,312,yes
+us,boot,osGetThreadId,24,yes
+us,boot,osCreateViManager,384,no
+us,boot,func_80002F18,60,no
+us,boot,func_80002750,52,yes
+us,boot,__osContDataCrc,160,no
+us,boot,func_80002ECC,76,no
+us,boot,__osSetCompare,16,yes
+us,boot,guMtxL2F,184,no
+us,boot,__osPiCreateAccessQueue,80,no
+us,boot,func_800005A8,984,no
+us,boot,func_80007360,112,no
+us,boot,__osDispatchThread,396,yes
+us,boot,guTranslate,84,yes
+us,boot,func_80000D8C,188,yes
+us,boot,__osAiDeviceBusy,48,yes
+us,boot,osEepromLongRead,140,yes
+us,boot,func_80001700,1012,no
+us,boot,func_80002790,152,no
+us,boot,func_800022D4,288,no
+us,boot,func_80002724,44,no
+us,boot,__osPackRamWriteDataSafe,128,no
+us,boot,func_80005948,96,no
+us,boot,func_80005818,60,no
+us,boot,osDpGetStatus,12,yes
+us,boot,func_8000BE20,480,no
+us,boot,osEPiRawReadIo,352,no
+us,boot,__osEepStatus,428,no
+us,boot,guLookAtHiliteF,1848,no
+us,boot,osMotorStartStop,360,no
+us,boot,osViGetCurrentFramebuffer,64,yes
+us,boot,__osDevMgrMain,1168,no
+us,boot,guAlign,80,no
+us,boot,__osExceptionPreamble,16,yes
+us,boot,__osSpSetStatus,12,yes
+us,boot,func_80002D60,132,no
+us,boot,func_800075CC,28,no
+us,boot,func_800010C0,1600,no
+us,boot,func_800004F4,180,yes
+us,boot,func_800075E8,160,no
+us,boot,osSendMesg,332,yes
+us,boot,func_8000DB90,288,no
+us,boot,sqrtf,16,yes
+us,boot,__osPfsGetStatus,208,no
+us,boot,__osSetGlobalIntMask,76,yes
+us,boot,osUnmapTLBAll,80,yes
+us,boot,__osPiGetAccess,68,no
+us,boot,osSetThreadPri,224,yes
+us,boot,__osSpGetStatus,12,yes
+us,boot,memcpy,288,no
+us,boot,func_800024E0,196,yes
+us,boot,osMotorInit,348,yes
+us,boot,osVirtualToPhysical,124,yes
+us,boot,guMtxIdent,48,yes
+us,boot,osEepromRead,452,no
+us,boot,_MakeMotorData,268,no
+us,boot,func_80007754,52,no
+us,boot,osYieldThread,76,yes
+us,boot,osPiReadIo,64,yes
+us,boot,func_80002A64,88,no
+us,boot,func_80002ABC,80,no
+us,boot,__ull_to_f,28,no
+us,boot,osViSwapBuffer,80,yes
+us,boot,func_80005918,48,no
+us,boot,__osContRamWrite,592,no
+us,boot,func_80000980,80,yes
+us,boot,osEepromProbe,112,no
+us,boot,__osSetTimerIntr,116,yes
+us,boot,guOrthoF,340,yes
+us,boot,__osSetSR,16,yes
+us,boot,osStartThread,336,yes
+us,boot,guLookAtHilite,184,yes
+us,boot,func_800057B0,44,no
+us,boot,osSetIntMask,160,no
+us,boot,func_80007724,24,no
+us,boot,osGetCount,16,yes
+us,boot,osContInit,368,no
+us,boot,osPiStartDma,268,yes
+us,boot,__osSumcalc,116,no
+us,boot,func_80002E98,52,no
+us,boot,bzero,160,yes
+us,boot,__osInsertTimer,392,yes
+us,boot,__osEnqueueAndYield,256,yes
+us,boot,__osSpDeviceBusy,44,yes
+us,boot,cosf,368,no
+us,boot,osSpTaskYield,32,yes
+us,boot,guMtxCatF,360,yes
+us,boot,__osPopThread,16,yes
+us,boot,func_80000AA0,564,no
+us,boot,osGetTime,132,yes
+us,boot,osCreateMesgQueue,44,yes
+us,boot,guLookAt,120,yes
+us,boot,func_800025A4,384,no
+us,boot,__osSpRawStartDma,140,yes
+us,boot,guPerspective,88,yes
+us,boot,__osSiRawReadIo,80,yes
+us,boot,__osIdCheckSum,252,no
+us,boot,osViGetCurrentMode,72,yes
+us,boot,func_8000320C,4884,no
+us,boot,func_800057DC,60,no
+us,boot,guOrtho,104,yes
+us,boot,func_80002BB8,188,no
+us,boot,func_80005880,60,no
+us,boot,guNormalize,132,yes
+us,boot,__osRestoreInt,32,yes
+us,boot,__osViGetCurrentContext,12,yes
+us,boot,osSetTime,36,yes
+us,boot,osViSetMode,104,yes
+us,boot,__osPiRelAccess,44,no
+us,boot,func_80002DE4,180,no
+us,boot,osInitialize,704,no
+us,boot,func_800031E0,44,no
+us,boot,func_80002828,184,no
+us,boot,__osPackEepWriteData,172,no
+us,boot,osPfsIsPlug,416,no
+us,boot,send_mesg,232,yes
+us,boot,__osEnqueueThread,72,yes
+us,boot,osEPiRawWriteIo,352,no
+us,boot,guLookAtF,696,yes
+us,boot,guAlignF,448,no
+us,boot,__osTimerInterrupt,376,yes
+us,boot,osPiGetCmdQueue,40,yes
+us,boot,__osProbeTLB,192,yes
+us,boot,bcopy,784,yes
+us,boot,osPiRawReadIo,84,yes
+us,boot,func_80003120,192,no
+us,boot,osSpTaskYielded,128,yes
+us,boot,osGetThreadPri,24,yes
+us,boot,guTranslateF,72,yes
+us,boot,osInvalICache,128,yes
+us,boot,osSetEventMesg,104,yes
+us,boot,func_800023F4,236,no
+us,boot,guRotateF,404,no
+us,boot,guMtxCatL,88,yes
+us,boot,func_80002CE8,120,no
+us,boot,__osSiCreateAccessQueue,80,no
+us,boot,__osSiDeviceBusy,48,no
+us,boot,func_80005070,336,no
+us,boot,__osTimerServicesInit,140,no
+us,boot,func_80001AF4,340,no
+us,boot,__osPfsRequestOneChannel,196,no
+us,boot,__osSiRawWriteIo,76,yes
+us,boot,guRotate,92,no
+us,boot,osAiGetLength,12,yes
+us,boot,func_8000D7E0,212,no
+us,boot,osInvalDCache,176,yes
+us,boot,__osPfsGetOneChannelData,156,no
+us,boot,osJamMesg,336,yes
+us,boot,__osSpSetPc,52,yes
+us,boot,func_80007788,56,no
+us,boot,func_80001C48,360,no
+us,boot,osViGetNextFramebuffer,64,yes
+us,boot,guPosition,112,no
+us,boot,func_80000EEC,320,no
+us,boot,__osResetGlobalIntMask,96,no
+us,boot,__osException,1316,yes
+us,boot,__osContGetInitData,208,no
+us,boot,__osGetFpcCsr,16,yes
+us,boot,__osSiRawStartDma,176,no
+us,boot,guScale,72,yes
+us,boot,osAiSetNextBuffer,164,yes
+us,boot,__osDisableInt,32,yes
+us,boot,__osViInit,316,yes
+us,boot,func_80001DB0,1316,no
+us,boot,func_80000E48,164,no
+us,boot,__osPackRequestData,256,no
+us,boot,osPiRawStartDma,224,yes
+us,boot,func_800004B4,64,yes
+us,boot,osStopThread,192,yes
+us,boot,guMtxXFMF,160,yes
+us,boot,__osRepairPackId,848,no
+us,boot,func_80007688,156,no
+us,boot,func_800028E0,268,no
+us,boot,func_800073D0,132,yes
+us,boot,osPiGetStatus,12,yes
+us,boot,osSpTaskStartGo,64,yes
+us,boot,func_80000CD4,184,yes
+us,boot,sinf,448,no
+us,boot,__osPfsRequestData,208,no
+us,boot,func_80005A44,44,no
+us,boot,func_800029EC,68,no
+us,boot,func_800074E0,208,no
+us,boot,func_800009D0,88,yes
+us,boot,guMtxXFML,96,yes
+us,boot,func_80000450,100,yes
+us,boot,osSetTimer,212,yes
+us,boot,osMapTLBRdb,96,yes
+us,boot,func_80005854,44,no
+us,boot,__osGetId,428,no
+us,boot,osCreatePiManager,368,no
+us,boot,func_80000A30,112,no
+us,boot,func_8000D8B4,732,no
+us,boot,osCreateThread,336,no
+us,boot,func_800059A8,156,no
+us,boot,osViBlack,112,yes
+us,boot,func_80002C74,116,no
+us,boot,func_800055D0,156,yes
+us,boot,func_8000773C,24,no
+us,boot,__osPackEepReadData,140,no
+us,boot,osEepromWrite,376,no
+us,boot,func_80002F54,172,no
+us,boot,osWritebackDCache,128,yes
+us,boot,osDpSetStatus,12,yes
+us,boot,__osSetFpcCsr,16,yes
+us,boot,__osSiRelAccess,44,no
+us,boot,osSpTaskLoad,400,yes
+us,boot,osViSetSpecialFeatures,440,yes
+us,boot,__osGetSR,16,yes
+us,boot,guMtxIdentF,136,yes
+us,boot,func_80007454,140,no
+us,boot,__osPfsGetInitData,208,no
+us,boot,__osViSwapContext,768,no
+us,boot,viMgrMain,400,no
+us,boot,__osContRamReadData,560,no
+us,boot,guMtxF2L,256,yes
+us,boot,func_800056F0,112,no
+us,boot,guPerspectiveF,560,yes
+us,boot,func_80002B0C,172,no
+us,boot,__osSiGetAccess,68,no
+us,boot,guScaleF,84,yes
+us,boot,func_80002A30,52,no
+us,boot,__osCheckPackId,356,no
+us,boot,__osContAddressCrc,208,no
+us,boot,func_80000400,80,yes
+us,boot,osWriteBackDCacheAll,48,yes
+us,boot,__osDequeueThread,64,yes
+us,boot,guPositionF,432,no
diff --git a/progress/progress.water.csv b/progress/progress.water.csv
new file mode 100644
index 00000000..7da973ad
--- /dev/null
+++ b/progress/progress.water.csv
@@ -0,0 +1,56 @@
+version,section,function,length,matching
+us,.code,func_8002658C,744,no
+us,.code,func_800255C4,528,no
+us,.code,func_80027118,552,no
+us,.code,func_800247F4,900,no
+us,.code,func_80024C88,672,no
+us,.code,func_800288A8,500,no
+us,.code,func_8002904C,196,no
+us,.code,func_80027340,264,no
+us,.code,func_80029110,8,yes
+us,.code,func_80026874,144,no
+us,.code,func_80025DB8,388,no
+us,.code,func_80024578,64,yes
+us,.code,func_80025F8C,144,yes
+us,.code,func_80025F3C,80,yes
+us,.code,func_80025A3C,148,no
+us,.code,func_80025500,196,no
+us,.code,func_80026530,92,yes
+us,.code,func_80024154,296,no
+us,.code,func_80028840,104,yes
+us,.code,func_80026410,92,yes
+us,.code,func_80026B78,292,no
+us,.code,func_800296DC,276,no
+us,.code,func_80026E0C,452,no
+us,.code,func_80026C9C,368,no
+us,.code,func_80028EE8,356,no
+us,.code,func_80026298,40,yes
+us,.code,func_80024518,96,no
+us,.code,func_80029118,1476,no
+us,.code,func_80027DC0,864,no
+us,.code,func_80028DE8,256,no
+us,.code,func_80028120,1824,no
+us,.code,func_80026904,344,no
+us,.code,func_80025AD0,588,no
+us,.code,func_8002427C,528,no
+us,.code,func_800245B8,572,no
+us,.code,func_80026338,216,yes
+us,.code,func_8002601C,636,no
+us,.code,func_80024000,156,no
+us,.code,func_80024F28,580,no
+us,.code,func_80028A9C,844,no
+us,.code,func_8002516C,916,no
+us,.code,func_80026A5C,284,yes
+us,.code,func_80024B78,272,no
+us,.code,func_80025D1C,156,no
+us,.code,func_800262C0,120,no
+us,.code,func_8002646C,196,yes
+us,.code,func_80026FD0,100,yes
+us,.code,func_800257D4,220,no
+us,.code,func_80027448,2424,no
+us,.code,func_8002448C,140,no
+us,.code,func_800258B0,396,no
+us,.code,func_80027034,88,yes
+us,.code,func_8002708C,140,no
+us,.code,func_800240EC,104,yes
+us,.code,func_8002409C,80,yes
diff --git a/progress/progress_arcade.svg b/progress/progress_arcade.svg
new file mode 100644
index 00000000..75740947
--- /dev/null
+++ b/progress/progress_arcade.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_bonus.svg b/progress/progress_bonus.svg
new file mode 100644
index 00000000..21d44038
--- /dev/null
+++ b/progress/progress_bonus.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_boss.svg b/progress/progress_boss.svg
new file mode 100644
index 00000000..d716c3a6
--- /dev/null
+++ b/progress/progress_boss.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_dk64_boot.svg b/progress/progress_dk64_boot.svg
new file mode 100644
index 00000000..d88b2314
--- /dev/null
+++ b/progress/progress_dk64_boot.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_global_asm.svg b/progress/progress_global_asm.svg
new file mode 100644
index 00000000..6b7fb363
--- /dev/null
+++ b/progress/progress_global_asm.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_jetpac.svg b/progress/progress_jetpac.svg
new file mode 100644
index 00000000..75d10c69
--- /dev/null
+++ b/progress/progress_jetpac.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_menu.svg b/progress/progress_menu.svg
new file mode 100644
index 00000000..55e2b8c3
--- /dev/null
+++ b/progress/progress_menu.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_minecart.svg b/progress/progress_minecart.svg
new file mode 100644
index 00000000..f4b65f95
--- /dev/null
+++ b/progress/progress_minecart.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_multiplayer.svg b/progress/progress_multiplayer.svg
new file mode 100644
index 00000000..dd874e4b
--- /dev/null
+++ b/progress/progress_multiplayer.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_race.svg b/progress/progress_race.svg
new file mode 100644
index 00000000..e1764762
--- /dev/null
+++ b/progress/progress_race.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_total.svg b/progress/progress_total.svg
new file mode 100644
index 00000000..19afb108
--- /dev/null
+++ b/progress/progress_total.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/progress/progress_water.svg b/progress/progress_water.svg
new file mode 100644
index 00000000..6b61b8d4
--- /dev/null
+++ b/progress/progress_water.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/src/arcade/code_0.c b/src/arcade/code_0.c
new file mode 100644
index 00000000..cd6e0666
--- /dev/null
+++ b/src/arcade/code_0.c
@@ -0,0 +1,3293 @@
+#include "arcade_int.h"
+
+extern u8 D_80032D50;
+extern u8 D_80032CA8;
+extern u8 D_800342B8;
+extern uSprite D_8004BC20[2];
+extern uSprite D_8004BC50[2];
+
+extern void func_8060A9BC(void);
+extern void func_8060AC7C(void);
+extern void func_80610044(Gfx *, s32, s32, s32, s32, s32);
+extern Gfx *func_806FD490(Gfx *, s32, s32, s32, s32 *);
+extern void func_8070F2FC(Gfx **arg0, s16 arg1, s16 arg2);
+extern void func_8070E8F0(Gfx**, Sprite*);
+extern void func_8070F2C8(s32, s16, s32, u8);
+
+void func_8002419C(void *arg0, Gfx **arg1);
+void func_80024940(Gfx **gpp);
+void func_80024CF8(Gfx **arg0);
+void func_800251D8(Gfx **arg0);
+void func_800252D8(Gfx **arg0);
+void func_800257D8(void);
+void func_80025960(Gfx **arg0);
+void func_800275E8(Gfx **arg0);
+void func_80027A38(Gfx **arg0);
+void func_800311E0(void);
+
+/* .code */
+void func_80024000(void) {
+ Gfx *sp2C;
+ s32 sp28;
+
+ func_8060A9BC();
+ func_80610044(D_8076A050[D_807444FC], D_8076A088, 3, 1, 0x4D2, 1);
+ D_807444FC ^= 1;
+ object_timer++;
+ D_8076A048 = D_807444FC * 0x11B0 + &D_80767CE8;
+ func_8060AC7C();
+ if (((D_8076A0B1 & 1) != 0) && (D_807FD888 == 31.0f)) {
+ sp2C = D_8076A050[D_807444FC];
+ } else {
+ func_8002419C(D_8076A048, &sp2C);
+ }
+ sp2C = func_80704484(sp2C, 0);
+ if (is_cutscene_active != 3) {
+ sp28 = D_8076A048 + 0xDB0;
+ func_805FE71C(sp2C, D_807444FC, &D_8076A088, 0);
+ func_805FE7B4(sp28, D_8076A048, &D_8076A08C, 1);
+ return;
+ }
+ func_805FE71C(sp2C, D_807444FC, &D_8076A088, 1);
+}
+
+void func_8002419C(void *arg0, Gfx **arg1) {
+ Gfx *sp44 = (Gfx *)D_8076A050[D_807444FC];
+ gSPSegment(sp44++, 0x00, NULL);
+ gSPSegment(sp44++, 0x02, osVirtualToPhysical(arg0));
+ gSPSegment(sp44++, 0x01, osVirtualToPhysical(D_8076A080));
+ gSPDisplayList(sp44++, &D_1000090);
+ gSPDisplayList(sp44++, &D_1000040);
+ gDPPipeSync(sp44++);
+ sp44 = func_805FE4D4(sp44);
+ gDPSetColorDither(sp44++,G_CD_MAGICSQ);
+ gDPSetAlphaDither(sp44++,G_AD_PATTERN);
+ gDPSetFillColor(sp44++, 0x00050005);
+ gDPFillRectangle(sp44++, 0, 0, 319, 239);
+ func_80024940(&sp44);
+ *arg1 = sp44;
+}
+
+void func_80024320(void) {
+ s32 i;
+
+ for (i = 0; i < 5; i++) {
+ func_8060C648(0x15, 0, i, 0, arcade_saved_high_scores[i]);
+ func_8060C648(0x12, 0, i, 0, arcade_saved_high_score_initials[i][0]);
+ func_8060C648(0x13, 0, i, 0, arcade_saved_high_score_initials[i][1]);
+ func_8060C648(0x14, 0, i, 0, arcade_saved_high_score_initials[i][2]);
+ }
+ D_8004A760 = arcade_saved_high_scores[0];
+ func_8060DEA8();
+}
+
+void func_8002440C(void) {
+ s32 i;
+
+ for (i = 0; i < 5; i++) {
+ arcade_saved_high_scores[i] = func_8060C6B8(0x15, 0, i, 0);
+ arcade_saved_high_score_initials[i][0] = func_8060C6B8(0x12, 0, i, 0);
+ arcade_saved_high_score_initials[i][1] = func_8060C6B8(0x13, 0, i, 0);
+ arcade_saved_high_score_initials[i][2] = func_8060C6B8(0x14, 0, i, 0);
+ }
+ D_8004A760 = arcade_saved_high_scores[0];
+}
+
+void func_800244E4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
+ D_8004C725 = arg0;
+ D_8004C726 = arg1;
+ D_8004C727 = arg2;
+ D_8004C728 = arg3;
+}
+
+void func_80024508(s32 arg0, s32 arg1) {
+ D_8004C72C = arg0;
+ D_8004C730 = arg1;
+}
+
+void func_8002451C(Gfx **gpp, s32 *arg1) {
+ Gfx *gp = *gpp;
+ gDPPipeSync(gp++);
+ gDPSetCycleType(gp++, G_CYC_1CYCLE);
+ gSPClearGeometryMode(gp++, -1);
+ gSPSetGeometryMode(gp++, G_SHADE | 0x200000);
+ gDPSetPrimColor(gp++, 0, 0, D_8004C725, D_8004C726, D_8004C727, D_8004C728);
+ gDPSetCombineMode(gp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+ gDPSetRenderMode(gp++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ *gpp = func_806FD490(gp, 2, D_8004C72E, D_8004C732, arg1);
+}
+
+// cycle_rng
+s32 func_80024644(void) {
+ D_8004A738 = (D_8004A738 * 0x41C64E6D) + 12345;
+ return D_8004A738 >> 0x10 & 0x7FFF;
+}
+
+void arcade_add_points_to_score(s32 round_points) {
+ s32 oldScore;
+
+ oldScore = arcade_current_score;
+ arcade_current_score += round_points;
+ if ((arcade_current_score >= 10000) && (oldScore < 10000)) {
+ arcade_lives_internal++;
+ arcade_lives_visual++;
+ }
+}
+
+//arcade_maxf
+f32 func_800246C8(f32 arg0, f32 arg1) {
+ if (arg1 < arg0) {
+ return arg1;
+ }
+ return arg0;
+}
+
+//get_first_empty_obj_slot
+s32 func_800246EC(void) {
+ s32 i;
+ for (i = 0; i <= 0x4F; i++) {
+ if (D_8004BCD0[i].unk18 == 0) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+//get_first_empty_obj_slot_after_player
+s32 func_80024764(void) {
+ s32 i;
+ for (i = D_8004C71F + 1; i < 0x50; i++) {
+ if (D_8004BCD0[i].unk18 == 0) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+//get_last_empty_obj_slot
+s32 func_800247B8(void) {
+ s32 i;
+ for (i = 0x4F; i >= 0; i--) {
+ if (D_8004BCD0[i].unk18 == 0) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+s32 func_800247F0(void) {
+ s32 i;
+ for (i = 0x27; i >= 0; i--) {
+ if (D_8004BCD0[i].unk18 == 0) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+s32 func_80024828(void) {
+ s32 i;
+ for (i = 0x24; i >= 0; i--) {
+ if (D_8004BCD0[i].unk18 == 0) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+s32 func_80024860(enum ARCADE_OBJ_E arg0) {
+ s32 i;
+ for (i = 0; i < 0x50; i++) {
+ if (arg0 == D_8004BCD0[i].unk18) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+s32 arcade_get_object_type_count(enum ARCADE_OBJ_E arg0) {
+ s32 i;
+ s32 count = 0;
+ for (i = 0; i < 0x50; i++) {
+ if (arg0 == D_8004BCD0[i].unk18) {
+ count++;
+ }
+ }
+ return count;
+}
+
+#ifndef NONMATCHING //needs .rodata and .data sections defined
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80024940.s")
+#else
+void func_80024940(Gfx **gpp) {
+ Gfx* sp1C;
+ //static D_8004A78C = 1;
+ //static D_8004A790 = 0;
+
+ sp1C = *gpp;
+ if (D_8004A78C) {
+ D_8004A78C = 0;
+ arcade_background_visual = 1;
+ func_80024D90();
+ func_8002440C();
+ }
+ switch(D_8004C724) {
+ case 0:// 800249A8
+ func_80024E84(&sp1C);
+ break;
+ case 1:// 800249B8
+ func_800251D8(&sp1C);
+ break;
+ case 5:// 800249C8
+ func_800252D8(&sp1C);
+ break;
+ case 4:// 800249D8
+ func_800255F4(&sp1C);
+ break;
+ case 3:// 800249E8
+ func_80024CF8(&sp1C);
+ break;
+ case 2:// 800249F8
+ default:
+ func_80025960(&sp1C);
+ break;
+ }
+ func_800319D4(&sp1C);
+ D_8004C6D8++;
+ *gpp = --sp1C;
+ D_8004A790++;
+}
+#endif
+
+// struct, score, big offset, loops, aaa
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80024A50.s")
+#else
+void func_80024A50(s32 arg0) {
+ /* adds score to high scores */
+ u8 pad[0x10];
+ volatile u8 spC = D_8004A794; //static???
+ int i, j;
+
+
+ for (i = 4; arg0 < i; i--) {
+ arcade_saved_high_scores[i] = arcade_saved_high_scores[i - 1];
+ for (j = 0; j < 3; j++) {
+ arcade_saved_high_score_initials[i][j] = arcade_saved_high_score_initials[i - 1][j];
+ }
+ }
+ arcade_saved_high_scores[arg0] = arcade_current_score;
+ for (j = 0; j < 3; j++) {
+ arcade_saved_high_score_initials[arg0][j] = spC;
+ }
+}
+#endif
+
+// update saved scores
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80024B04.s")
+#else
+void func_80024B04(void) {
+ int i;
+ for (i = 0; i < (u8)5; i++) {
+ if (arcade_saved_high_scores[i] < arcade_current_score) {
+ func_80024A50(i);
+ break;
+ }
+ }
+ for (i = 0; i < 3; i++) {
+ D_8004A774[i] = ' ';
+ }
+ D_8004C724 = 3;
+ arcade_background_visual = 0;
+ D_8004C6DC = 0;
+ D_8004C720 = 0;
+ for (i = 0; i < 0x50; i++) {
+ D_8004BCD0[i].unk18 = 0;
+ D_8004BCD0[0] = D_8004BCD0[i];
+ }
+}
+#endif
+
+void func_80024C34(void) {
+ if (D_8004A73C == 0) {
+ if (D_8004A770 && D_8004A740 && !isFlagSet(0x84, FLAG_TYPE_PERMANENT)) {
+ // Arcade Golden Banana Collected
+ if (isFlagSet(0x82, FLAG_TYPE_PERMANENT)) {
+ // Nintendo Coin Spawn Pending
+ setFlag(0x11, TRUE, FLAG_TYPE_TEMPORARY);
+ } else {
+ // Arcade GB Spawn Pending
+ setFlag(0x10, TRUE, FLAG_TYPE_TEMPORARY);
+ }
+ }
+ if (D_8004A740) { // arcade_is_in_nintendo_coin_mode
+ func_805FF898();
+ } else {
+ func_805FF378(MAP_MAIN_MENU, 0);
+ }
+ D_8004A73C = 1;
+ }
+}
+
+void func_80024CF8(Gfx **arg0) {
+ Gfx *sp1C;
+ sp1C = *arg0;
+ D_8004C6DC++;
+ func_800259D0(&sp1C);
+ func_80030FEC(); //update objects
+ func_8002B2C0(&sp1C);
+ if (D_8004C6DC >= 1981) { // arcade_internal_timer
+ if (D_8004A740) { // arcade_is_in_nintendo_coin_mode
+ func_80024C34();
+ } else {
+ func_80024D90();
+ }
+ }
+ *arg0 = sp1C;
+}
+
+void func_80024D90(void) {
+ s32 temp_v1;
+ ArcadeStruct1 *iPtr;
+
+ D_8004C724 = 0; // arcade_should_reload_level
+ D_8004A740 = isFlagSet(0x63, FLAG_TYPE_TEMPORARY); // arcade_is_in_nintendo_coin_mode
+ arcade_background_visual = 0;
+ D_8004C6DC = 0x200; // arcade_internal_timer
+ arcade_game_state = 1;
+
+ for (iPtr = D_8004BCD0; iPtr < &D_8004BCD0[0x50]; iPtr++) {
+ iPtr->unk18 = 0;
+ }
+
+ temp_v1 = func_800246EC();
+
+ D_8004BCD0[temp_v1] = arcade_dk_title_obj_template;
+ D_8004BCD0[temp_v1].x_position = 138.0f;
+ D_8004BCD0[temp_v1].y_position = 180.0f;
+ D_8004BCD0[temp_v1].unk14 = &D_800424D0;
+}
+
+void func_80024E84(Gfx **arg0) {
+ Gfx *sp24;
+ int i;
+
+ sp24 = *arg0;
+ D_8004C6DC++;
+ func_800259D0(&sp24);
+ if (D_8004C6DC & 0x200) {
+ func_8002B2C0(&sp24);
+ }
+ if (D_8004A740 && D_8004C6DC == 0x5FE || newly_pressed_input & 0x9000) {
+ arcade_current_score = 0;
+ D_8004C723 = 0;
+ arcade_lives_internal = 2;
+ if (D_8004A740) {
+ arcade_lives_internal = 0;
+ // Nintendo Coin Collected
+ if (isFlagSet(0x84, FLAG_TYPE_PERMANENT)) {
+ D_8004C723 = 8;
+ // Arcade Golden Banana Collected
+ } else if (isFlagSet(0x82, FLAG_TYPE_PERMANENT)) {
+ D_8004C723 = 4;
+ }
+ }//L80024F74
+ if (D_8004C723 / 4 + 1 >= 0xA) {
+ D_8004A76C = 9;
+ } else {
+ D_8004A76C = D_8004C723 / 4 + 1;
+ }
+ arcade_lives_visual = arcade_lives_internal + 1;
+ arcade_background_visual = 1;
+ D_8004C724 = 1;
+ D_8004C6DC = 0;
+ arcade_game_state = 1;
+ D_8004C721 = 0;
+ for (i = 0; i < 80; i++) {
+ D_8004BCD0[i].unk18 = 0;
+ }
+ D_8004BCD0[func_800246EC()] = arcade_pauline_bottom_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_top_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_dk_title_obj_template;
+ if (D_8004A76C == 2 && D_8004A740) {
+ D_8004BCD0[func_800246EC()] = arcade_nintendo_coin_obj_template;
+ }
+ D_8004C708 = 0;
+ }//L800251BC
+ *arg0 = sp24;
+}
+
+void func_800251D8(Gfx **arg0) {
+ Gfx *sp1C;
+ sp1C = *arg0;
+
+ func_80030FEC(); //update objects
+ func_800259D0(&sp1C);
+ func_8002B2C0(&sp1C);
+ if (D_8004C6DC++ >= 761) { // arcade_internal_timer
+ func_800257D8();
+ }
+ *arg0 = sp1C;
+}
+
+void func_80025240(void) { // queue_arcade_sfx()
+ if (arcade_background_visual == 1) {
+ arcade_next_sfx = SFX_4D_ARCADE_25M;
+ return;
+ }
+ if (arcade_background_visual == 2) {
+ arcade_next_sfx = SFX_4F_ARCADE_50M;
+ return;
+ }
+ if (arcade_background_visual == 4) {
+ arcade_next_sfx = SFX_4E_ARCADE_100M;
+ return;
+ }
+ arcade_next_sfx = -1;
+}
+
+void func_800252A4(SFX_E arg0) {
+ arcade_next_sfx = arg0;
+ if (D_80770DF8 != 0) {
+ func_80737924(D_80770DF8);
+ }
+}
+
+void func_800252D8(Gfx **arg0) {
+ Gfx *sp34;
+ s32 temp;
+
+ sp34 = *arg0;
+ func_800259D0(&sp34);
+ if (D_8004C71E < 0xA) { // arcade_bonus_timer
+ if ((arcade_next_sfx == SFX_4D_ARCADE_25M)
+ || (arcade_next_sfx == SFX_4E_ARCADE_100M)
+ || (arcade_next_sfx == SFX_4F_ARCADE_50M)
+ || (arcade_next_sfx == -1)) {
+ func_800252A4(SFX_48_ARCADE_RUNNING_OUT_OF_TIME); // playSFX(runningOutOfTimeJingle)
+ }
+ }
+ if (D_80770DF8 == 0 && arcade_next_sfx > 0) {
+ temp = (s16) arcade_next_sfx;
+ func_80737638(D_8076D1F8, temp, 0x7FFF, 0x3F, 1.0f, 0, &D_80770DF8);
+ }
+ if (D_8004A760 < arcade_current_score) {
+ D_8004A760 = arcade_current_score;
+ }
+ if (D_8004C6DC++ == 0x3C) {
+ arcade_lives_visual = arcade_lives_internal;
+ arcade_game_state = 0;
+ D_8004BCD0[func_80024860(0xD)].unk19 = 2;
+ }
+ func_80030FEC(); //update objects
+ func_8002B2C0(&sp34);
+ if (arcade_game_state == 0) {
+ if (arcade_background_visual == 2) {
+ func_800313B8(); //100m_flame_spawn_check
+ }
+ if (arcade_background_visual == 4) {
+ func_800311E0(); //50m_pie_spawn_check
+ }
+ if ((newly_pressed_input & START_BUTTON) != 0) {
+ func_8002549C();
+ D_8004C724 = 4;
+ }
+ }
+ *arg0 = sp34;
+}
+
+void func_8002549C(void) {
+ int x, y;
+ s32 index;
+ for (x = 0x60; x < 0xe0; x += 0x10) {
+ for (y = 0x8C; y < 0xCC; y += 0x10) {
+ index = func_800247B8();
+ D_8004BCD0[index] = D_8004A6B8;
+ D_8004BCD0[index].x_position = x;
+ D_8004BCD0[index].y_position = y;
+ }
+ }
+ D_8004A768 = 0;
+ D_8004C70C = D_807ECDE8->unk3;
+ D_8004A744 = 0;
+}
+
+void func_800255A8(void) {
+ s32 temp_v0;
+ do {
+ temp_v0 = func_80024860(0x1C);
+ if (temp_v0 >= 0) {
+ D_8004BCD0[temp_v0].unk18 = 0;
+ }
+ } while (temp_v0 >= 0);
+}
+
+void func_800255F4(Gfx **arg0) {
+ Gfx *sp2C;
+
+ sp2C = *arg0;
+ func_800259D0(&sp2C);
+ func_8002B2C0(&sp2C);
+ if (newly_pressed_input & U_JPAD
+ || (D_807ECDE8->unk3 >= 0x1F && D_8004C70C < 0x1F)
+ ) {
+ D_8004A768--;
+ }
+ if (newly_pressed_input & D_JPAD
+ || (D_807ECDE8->unk3 < -0x1E && D_8004C70C >= -0x1E)
+ ) {
+ D_8004A768++;
+ }
+
+ if (D_8004A768 >= 3) {
+ D_8004A768 = 0;
+ }
+
+ if (D_8004A768 < 0) {
+ D_8004A768 = 2;
+ }
+ D_8004C70C = D_807ECDE8->unk3;
+ if (newly_pressed_input & CONT_START) {
+ func_800255A8();
+ D_8004C724 = 5;
+ }
+
+ if (newly_pressed_input & (CONT_A | CONT_B)) {
+ switch(D_8004A768) {
+ case 0:
+ func_800255A8();
+ D_8004C724 = 5;
+ break;
+ case 1:
+ if (!D_8004A744) {
+ func_8060C8AC(2);
+ func_8002440C();
+ func_80024320();
+ if (D_8004A760 < arcade_current_score)
+ D_8004A760 = arcade_current_score;
+ D_8004A744 = 1;
+ }
+ break;
+ case 2:
+ func_80024C34();
+ break;
+ }
+ }
+ *arg0 = sp2C;
+}
+
+void func_800257D8(void) {
+ int i;
+ ArcadeStruct1 *tmp_v1;
+ for (i = 0; i < 80; i++) {
+ D_8004BCD0[i].unk18 = 0;
+ }
+ for (i = 0; i < (D_8004C723 & 3) + 1; i++) {
+ tmp_v1 = &D_8004BCD0[func_800246EC()];
+ *tmp_v1 = arcade_dk_how_high_obj_template;
+ tmp_v1->y_position -= i * 0x20;
+ }//L800258C0
+
+ D_8004C6DC = 0;
+ if (D_8004C723 / 4 + 1 >= 0xA) {
+ D_8004A76C = 9;
+ } else {
+ D_8004A76C = D_8004C723 / 4 + 1;
+ }
+ func_80737638(D_8076D1F8, 0x47, 0x7fff, 0x3f, 1.0f, 0, 0);
+ D_8004C724 = 2;
+ arcade_game_state = 1;
+}
+
+void func_80025960(Gfx **arg0) {
+ Gfx *sp1C = *arg0;
+ func_800259D0(&sp1C);
+ func_8002B2C0(&sp1C);
+ if (D_8004C6DC++ >= 0xa1) {
+ func_80029968(); //setup stage
+ D_8004C724 = 5;
+ }
+ *arg0 = sp1C;
+}
+
+void func_800259D0(Gfx **arg0) {
+ Gfx *sp4C = *arg0;
+ gDPSetAlphaCompare(sp4C++, G_AC_NONE);
+ gDPSetTexturePersp(sp4C++, G_TP_NONE);
+ gDPSetTextureFilter(sp4C++, G_TF_BILERP);
+ gDPSetTextureConvert(sp4C++, G_TC_FILT);
+ gDPSetTextureDetail(sp4C++, G_TD_CLAMP);
+ gDPSetTextureLOD(sp4C++, G_TL_TILE);
+ gDPSetTextureLUT(sp4C++, G_TT_NONE);
+ gDPSetPrimColor(sp4C++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
+ gDPSetRenderMode(sp4C++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ gDPSetCombineMode(sp4C++, G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM);
+ gDPSetScissor(sp4C++, G_SC_NON_INTERLACE, 48, 36, 272, 232);
+
+ switch(D_8004C724) {
+ case 0://L80025B68
+ if (D_8004C6DC & 0x200) {
+ func_80026680(&sp4C);
+ }
+ break;
+ case 1:
+ case 4:
+ case 5://L80025B88
+ switch(arcade_background_visual) {
+ case 1:
+ func_800268AC(&sp4C);
+ break;
+ case 2:
+ func_80026EF4(&sp4C);
+ break;
+ case 3:
+ func_800275E8(&sp4C);
+ break;
+ default:
+ func_80027A38(&sp4C);
+ break;
+ }
+ break;
+ }
+ *arg0 = sp4C;
+}
+
+void func_80025C08(Gfx **arg0, s32 arg1, s32 arg2, s32 arg3) {
+ int i;
+ Gfx *sp60;
+
+ D_8004C719 = 8;
+ D_8004C71A = 4;
+ D_8004C6D4 = 0x400;
+ if (arcade_background_visual == 2) { D_8004C6D0 = &D_80032B90; }
+ else if (arcade_background_visual == 4) { D_8004C6D0 = &D_80032BD8; }
+ else { D_8004C6D0 = &D_80032B48; }//L80025CC0
+
+ guSprite2DInit(
+ D_8004BB30 + D_807444FC, D_8004C6D0, NULL,
+ D_8004C719, D_8004C719, D_8004C71A, G_IM_FMT_RGBA,
+ G_IM_SIZ_16b, 0, 0
+ );
+
+ guSprite2DInit(
+ D_8004BB60 + D_807444FC, D_8004C6D0, NULL,
+ D_8004C719, D_8004C719, 1, G_IM_FMT_RGBA,
+ G_IM_SIZ_16b, 0, 0
+ );
+
+ guSprite2DInit(
+ D_8004BB90 + D_807444FC, D_8004C6D0, NULL,
+ D_8004C719, D_8004C719, 2, G_IM_FMT_RGBA,
+ G_IM_SIZ_16b, 0, 0
+ );
+
+ guSprite2DInit(
+ D_8004BBC0 + D_807444FC, D_8004C6D0, NULL,
+ D_8004C719, D_8004C719, 3, G_IM_FMT_RGBA,
+ G_IM_SIZ_16b, 0, 0
+ );
+ sp60 = *arg0;
+ func_8070E8F0(&sp60, D_8004BB30 + D_807444FC);
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+
+ for (i = 0; i < arg3 / 4; i++) {
+ func_8070F2FC(&sp60, 4 * arg1, 4.0 * (f64)(arg2 + 4 * i + 8));
+ }//L80025ED8
+ D_8004C71A = arg3 % 4;
+ if (D_8004C71A) {
+ switch(D_8004C71A) {
+ case 1:
+ func_8070E8F0(&sp60, D_8004BB60 + D_807444FC);
+ break;
+ case 2:
+ func_8070E8F0(&sp60, D_8004BB90 + D_807444FC);
+ break;
+ case 3:
+ func_8070E8F0(&sp60, D_8004BBC0 + D_807444FC);
+ break;
+ }
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+ func_8070F2FC(&sp60, 4 * arg1, 4.0 * (f64)(arg2 + 4 * i + 8));
+ }
+ *arg0 = sp60;
+}
+
+void func_80026050(Gfx **arg0) {
+ Gfx *sp2C;
+ s32 sp28;
+
+ sp2C = *arg0;
+ func_80025C08(&sp2C, 0x70, 0x1C, 0x2E);
+ func_80025C08(&sp2C, 0x80, 0x1C, 0x2E);
+ func_80025C08(&sp2C, 0xB0, 0x38, 0x12);
+ if (D_8004C724 == 1) {
+ if (D_8004C6DC < 0x190) {
+ sp28 = 0x82 - ((D_8004C6DC-0x3C)/0x14)*8;
+ if (sp28 >= 0x83) {
+ sp28 = 0x82;
+ }
+ if (sp28 < 0x22)
+ sp28 = 0x22;
+ func_80025C08(&sp2C, 0xA0, 0x51, sp28);
+ func_80025C08(&sp2C, 0xb0, 0x51, sp28);
+ }
+ }//L80026134
+ else {
+ func_80025C08(&sp2C, 0x88, 0x50, 0x4);
+ func_80025C08(&sp2C, 0x88, 0x5b, 0xc);
+ func_80025C08(&sp2C, 0xe8, 0x53, 0xe);
+ func_80025C08(&sp2C, 0x50, 0x70, 0xe);
+ func_80025C08(&sp2C, 0x78, 0x6e, 0x12);
+ func_80025C08(&sp2C, 0xd8, 0x69, 0x8);
+ func_80025C08(&sp2C, 0xd8, 0x7d, 0x8);
+ func_80025C08(&sp2C, 0x70, 0x87, 0x5);
+ func_80025C08(&sp2C, 0x70, 0x99, 0x8);
+ func_80025C08(&sp2C, 0xA8, 0x89, 0x16);
+ func_80025C08(&sp2C, 0xE8, 0x8D, 0xE);
+ func_80025C08(&sp2C, 0x50, 0xAA, 0xE);
+ func_80025C08(&sp2C, 0x90, 0xA6, 0x15);
+ func_80025C08(&sp2C, 0x80, 0xC1, 0x4);
+ func_80025C08(&sp2C, 0x80, 0xD1, 0x8);
+ func_80025C08(&sp2C, 0xE8, 0xC7, 0xE);
+ }
+ //L8002626C
+ *arg0 = sp2C;
+}
+
+void func_8002628C(Gfx **arg0) {
+ Gfx *sp24;
+ sp24 = *arg0;
+ func_80025C08(&sp24, 0x38, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0x100, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0x40, 0x9B, 0x1C);
+ func_80025C08(&sp24, 0xF8, 0x9B, 0x1C);
+ func_80025C08(&sp24, 0x48, 0x7A, 0x1A);
+ func_80025C08(&sp24, 0xF0, 0x7A, 0x1A);
+ func_80025C08(&sp24, 0x50, 0x58, 0x1C);
+ func_80025C08(&sp24, 0xE8, 0x58, 0x1C);
+ if (D_8004C708 == 0) {
+ func_80025C08(&sp24, 0x98, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0x78, 0x9B, 0x1C);
+ func_80025C08(&sp24, 0xC0, 0x9B, 0x1C);
+ func_80025C08(&sp24, 0x98, 0x7A, 0x1A);
+ func_80025C08(&sp24, 0x70, 0x58, 0x1C);
+ func_80025C08(&sp24, 0xC8, 0x58, 0x1C);
+ }
+ *arg0 = sp24;
+}
+
+void func_800263EC(Gfx **arg0) {
+ Gfx *sp24;
+ sp24 = *arg0;
+ func_80025C08(&sp24, 0x70, 0x1C, 0x31);
+ func_80025C08(&sp24, 0x80, 0x1C, 0x31);
+ func_80025C08(&sp24, 0xB0, 0x38, 0x15);
+ func_80025C08(&sp24, 0xD0, 0x54, 0x15);
+ func_80025C08(&sp24, 0x100, 0x62, 0x1C);
+ func_80025C08(&sp24, 0xB8, 0x77, 0x15);
+ func_80025C08(&sp24, 0x40, 0x7E, 0x2A);
+ func_80025C08(&sp24, 0x70, 0x7E, 0x38);
+ func_80025C08(&sp24, 0x80, 0x7E, 0x38);
+ func_80025C08(&sp24, 0xE8, 0x85, 0x15);
+ func_80025C08(&sp24, 0x100, 0xA8, 0xE);
+ func_80025C08(&sp24, 0x38, 0xAF, 0x1C);
+ *arg0 = sp24;
+}
+
+void func_80026518(Gfx **arg0) {
+ Gfx *sp24;
+ sp24 = *arg0;
+ func_80025C08(&sp24, 0x70, 0x1C, 0x31);
+ func_80025C08(&sp24, 0x80, 0x1C, 0x31);
+ func_80025C08(&sp24, 0xB0, 0x38, 0x15);
+ func_80025C08(&sp24, 0x48, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0x80, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0xB8, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0xF0, 0xBD, 0x1C);
+ func_80025C08(&sp24, 0x70, 0x9A, 0x1C);
+ func_80025C08(&sp24, 0xC0, 0x9A, 0x1C);
+ func_80025C08(&sp24, 0x48, 0x77, 0x1C);
+ func_80025C08(&sp24, 0x80, 0x77, 0x1C);
+ func_80025C08(&sp24, 0xB8, 0x77, 0x1C);
+ func_80025C08(&sp24, 0xF0, 0x77, 0x1C);
+ func_80025C08(&sp24, 0x40, 0x62, 0xE);
+ func_80025C08(&sp24, 0xF8, 0x62, 0xE);
+ *arg0 = sp24;
+}
+
+void func_80026680(Gfx **gpp) {
+ int i;
+ int j;
+ Gfx *sp94;
+ s32 sp64[0xC] = D_8004A798;
+ s32 word;
+
+ sp94 = *gpp;
+ D_8004C719 = 8;
+ D_8004C71A = 8;
+ D_8004C6D4 = 0x400;
+ if (D_8004C6DC & 0x182) D_8004C6D0 = &D_80032C20;
+ else D_8004C6D0 = &D_80032DF8;
+
+ func_80005A90(&D_8004BB00[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A, 0, 2, 0, 0
+ );
+ func_8070E8F0(&sp94, &D_8004BB00[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D4, 0, 0);
+ for (i = 0; i < 0xC; i++) {//L80026800
+ word = sp64[i];
+ for (j = 0; j < 0x19; j++) {//L8002680C
+ if ((1 << j) & word) {
+ func_8070F2FC(&sp94, 0x3E0 - j * 0x20, ((i * 8 + 0x3F) * 4.0));
+ }
+ }
+ }
+ *gpp = sp94;
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_800268AC.s")
+#else
+void func_800268AC(Gfx **gpp) {
+ int i;
+ Gfx *sp68;
+ int x;
+ int y;
+
+ D_8004C719 = 8;
+ D_8004C71A = 8;
+ D_8004C6D4 = 0x492;
+
+ D_8004C6D0 = &D_80034568;
+ func_80005A90(&D_8004BB00[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A, 0, 2, 0, 0
+ );
+ sp68 = *gpp;
+
+
+ func_8070E8F0(&sp68, &D_8004BB00[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D4, 0, 0);
+ for (i = 0; i < 6; i++) {
+ func_8070F2FC(&sp68, 0x220 + i*0x20, 0xE0);
+ }
+
+ if (!((s32)D_8004C708 < 6)) {
+ for (i = 0; i < 0xE; i++) {////L800269FC
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x380);
+ }
+ for (i = 0xE; i < 0x1C; i++) {//L80026A50
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0xf7 - (i-0xC)/2)*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026AC0
+ for (i = 0; i < 0x1C; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x368);
+ }
+ }//L80026B0C
+
+ if (!((s32)D_8004C708 < 5)) {
+ for (i = 0; i < 0x1A; i++) {//L80026B30
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0xCF + (i/2))*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026B98
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x2f4);
+ }
+ }//L80026BC0
+
+
+ if (!((s32)D_8004C708 < 4)) {
+ for (i = 2; i < 0x1C; i++) {//L80026B30
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0xbb - (i/2))*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026C50
+ for (i = 2; i < 0x1C; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x281);
+ }
+ }//L80026C74
+
+ if (!((s32)D_8004C708 < 3)) {
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0x8d + (i/2))*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026D04
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x20d);
+ }
+ }//L80026D24
+
+ if (!((s32)D_8004C708 < 2)) {
+ for (i = 2; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0x79 - (i/2))*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026DB4
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0x100 + i*0x20, 0x19a);
+ }
+ }//L80026DD8
+
+ if (!((s32)D_8004C708 < 1)) {
+ for (i = 0; i < 0x12; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x142);
+ }
+ for (i = 0x12; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, ((0x53 + ((i - 0x10)/2))*0.875 + 8.0)*4.0);
+ }
+ } else {//L80026E90
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp68, 0xC0 + i*0x20, 0x142);
+ }
+ }
+
+ func_80026050(&sp68);
+ *gpp = sp68;
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80026EF4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_800274E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_800275E8.s")
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80027A38.s")
+#else
+//arcade_50m_draw
+void func_80027A38(Gfx **arg0) {
+ int i, j;
+ Gfx *sp6C;
+
+ sp6C = *arg0;
+ D_8004C719 = 8;
+ D_8004C71A = 10;
+ D_8004C6D4 = 1170;
+
+ //50m solid beam
+ D_8004C6D0 = &D_80032D50;
+ func_80005A90(&D_8004BB00[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A, 0, 2, 0, 0
+ );
+ func_8070E8F0(&sp6C, &D_8004BB00[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+ for (i = 0; i <0x6; i++) {
+ func_8070F2FC(&sp6C, 0x220 + 0x20*i, 0xe0);
+ }
+ for (i = 0; i <0x1C; i++) {
+ func_8070F2FC(&sp6C, 0xC0 + 0x20*i, 0x380);
+ }
+ for (i = 1; i < 0x1B; i++) {
+ if (i != 6 && i != 7 && i != 0x13 && i != 0x14) {
+ func_8070F2FC(&sp6C, 0xC0 + 0x20*i, 0x268);
+ }
+ }
+
+ //50m conveyer belt
+ D_8004C6D0 = &D_80032CA8;
+ func_80005A90(&D_8004BC20[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A, 0, 2, 0, 0
+ );
+ func_8070E8F0(&sp6C, &D_8004BC20[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp6C, 0xE0 + 0x20*i, 0x150);
+ }
+ for (i = 0; i < 0x1C; i++) {
+ if (i < 0xC || i >= 0x10) {
+ func_8070F2FC(&sp6C, 0xC0 + 0x20*i, 0x1DC);
+ }
+ }
+ for (i = 0; i < 0x1A; i++) {
+ func_8070F2FC(&sp6C, 0xE0 + 0x20*i, 0x2f4);
+ }
+
+ //50m background grate
+ D_8004C6D0 = &D_800342B8;
+ func_80005A90(&D_8004BC50[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A, 0, 2, 0, 0
+ );
+ func_8070E8F0(&sp6C, &D_8004BC50[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 3; j++) {
+ func_8070F2FC(&sp6C, 0x240 + 0x20*i, ((0x9f - 8*j)*0.875 + 8.0)*4.0);
+ }
+ }
+ func_80026518(&sp6C);
+ *arg0 = sp6C;
+}
+#endif
+
+// death()?
+void func_80027E8C(void) {
+ func_800252A4(SFX_0_SILENCE);
+ func_80737638(D_8076D1F8, SFX_42_ARCADE_JUMPMAN_HIT, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ D_8004BCD0[D_8004C71F].unk19 = 8;
+ D_8004BCD0[D_8004C71F].x_velocity = 0.0f;
+ D_8004BCD0[D_8004C71F].unk10 = 0.0f;
+ arcade_game_state = 1;
+}
+
+void arcade_25m_setup(void) {
+ int v1 = 0x25;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_bottom_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_top_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_help_text_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_dk_25m_obj_template;
+ if (D_8004A76C == 2 && D_8004A740)
+ D_8004BCD0[func_800246EC()] = arcade_nintendo_coin_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_bonus_osd_obj_template;
+ D_8004C71F = func_800246EC();
+ D_8004BCD0[D_8004C71F] = arcade_jumpman_obj_template;
+ D_8004BCD0[v1] = arcade_oil_drum_obj_template;
+ v1--;
+
+ D_8004BCD0[v1] = arcade_hammer_obj_template;
+ v1--;
+
+ D_8004BCD0[v1] = arcade_hammer_obj_template;
+ D_8004BCD0[v1].x_position = 68.0f;
+ D_8004BCD0[v1].y_position = 110.0f;
+ v1--;
+
+ D_8004BCD0[v1--] = arcade_barrel_stack_obj_template;
+
+ D_8004BCD0[v1] = arcade_barrel_stack_obj_template;
+ D_8004BCD0[v1].x_position = 48.0f;
+ D_8004BCD0[v1--].unk1C = 1;
+
+ D_8004BCD0[v1] = arcade_barrel_stack_obj_template;
+ D_8004BCD0[v1].y_position = 65.0f;
+ D_8004BCD0[v1--].unk1C = 2;
+
+ D_8004BCD0[v1] = arcade_barrel_stack_obj_template;
+ D_8004BCD0[v1].x_position = 48.0f;
+ D_8004BCD0[v1].y_position = 65.0f;
+ D_8004BCD0[v1].unk1C = 3;
+
+ D_8004C708 = 7;
+}
+
+void arcade_100m_setup(void) {
+ s32 i;
+ s32 indx;
+ f32 f6;
+
+ u8 sp3C[8][2] = D_8004A81C;
+ u32 s1 = 1;
+
+ D_8004BCD0[func_800246EC()] = arcade_pauline_bottom_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_top_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_help_text_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_dk_100m_obj_template;
+ if (D_8004A76C == 2 && D_8004A740)
+ D_8004BCD0[func_800246EC()] = arcade_nintendo_coin_obj_template;
+
+ for (i = 0; i < 8; i++) {
+ indx = func_800246EC();
+ D_8004BCD0[indx] = arcade_rivet_obj_template;
+ D_8004BCD0[indx].x_position = (f32)sp3C[i][0];
+ D_8004BCD0[indx].y_position = (f32)sp3C[i][1];
+ D_8004BCD0[indx].unk1C = s1;
+ s1 <<= 1;
+ }
+
+ indx = func_800246EC();
+ D_8004BCD0[indx] = arcade_bonus_osd_obj_template;
+ D_8004BCD0[indx].unk14 = &D_800335D8;
+
+ D_8004C71F = func_800246EC();
+ D_8004BCD0[D_8004C71F] = arcade_jumpman_obj_template;
+
+ D_8004BCD0[0x25] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x25].unk14 = &D_80038FE8;
+
+ D_8004BCD0[0x24] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x24].x_position = 252.0f;
+ D_8004BCD0[0x24].y_position = 208.0f;
+
+ D_8004BCD0[0x23] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x23].unk14 = &D_800391F0;
+ D_8004BCD0[0x23].x_position = 84.0f;
+ D_8004BCD0[0x23].y_position = 93.0f;
+
+ D_8004BCD0[0x22] = arcade_hammer_obj_template;
+ D_8004BCD0[0x22].x_position = 60.0f;
+ D_8004BCD0[0x22].y_position = 152.0f;
+
+ D_8004BCD0[0x21] = arcade_hammer_obj_template;
+ D_8004BCD0[0x21].x_position = 156.0f;
+ D_8004BCD0[0x21].y_position = 114.0f;
+}
+
+void arcade_75m_setup(void) {
+ s32 a0 = 0x25;
+ s32 tmp;
+ f32 tmp_f2;
+
+ D_8004BCD0[func_800246EC()] = arcade_pauline_bottom_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_top_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_help_text_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_dk_75m_obj_template;
+ if (D_8004A76C == 2 && D_8004A740)
+ D_8004BCD0[func_800246EC()] = arcade_nintendo_coin_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_bonus_osd_obj_template;
+ D_8004C71F = func_800246EC();
+ D_8004BCD0[D_8004C71F] = arcade_jumpman_obj_template;
+ D_8004BCD0[D_8004C71F].x_position = 56.0;
+ D_8004BCD0[D_8004C71F].y_position = 231.0;
+
+ D_8004BCD0[a0--] = arcade_elevator_obj_template;
+
+ D_8004BCD0[a0] = arcade_elevator_obj_template;
+ D_8004BCD0[a0--].x_position = 144.0f;
+
+ D_8004BCD0[a0] = arcade_elevator_obj_template;
+ D_8004BCD0[a0].y_position = 238.0f;
+ D_8004BCD0[a0--].unk1B = 1;
+
+ D_8004BCD0[a0] = arcade_elevator_obj_template;
+ D_8004BCD0[a0].x_position = 144.0f;
+ D_8004BCD0[a0].y_position = 238.0f;
+ D_8004BCD0[a0--].unk1B = 1;
+
+ D_8004BCD0[a0] = arcade_bonus_item_obj_template;
+ D_8004BCD0[a0].x_position = 260.0f;
+ D_8004BCD0[a0].y_position = 103.0f;
+ D_8004BCD0[a0--].unk14 = &D_80038FE8;
+
+ D_8004BCD0[a0] = arcade_bonus_item_obj_template;
+ D_8004BCD0[a0].x_position = 60.0f;
+ D_8004BCD0[a0].y_position = 135.0f;
+ D_8004BCD0[a0--].unk14 = &D_800391F0;
+
+ tmp = func_800246EC();
+ D_8004BCD0[tmp] = arcade_flame_enemy_obj_template;
+ D_8004BCD0[tmp].x_velocity = 0.5;
+ D_8004BCD0[tmp].unk1A = 1;
+ D_8004BCD0[tmp].x_position = 114.0f;
+ D_8004BCD0[tmp].y_position = 135.0f;
+
+ tmp = func_800246EC();
+ D_8004BCD0[tmp] = arcade_flame_enemy_obj_template;
+ D_8004BCD0[tmp].x_velocity = 0.5;
+ D_8004BCD0[tmp].unk1A = 1;
+ D_8004BCD0[tmp].x_position = 260.0f;
+ D_8004BCD0[tmp].y_position = 103.0f;
+
+ D_8004BC88[0][0] = 40.0f;
+ D_8004BC88[1][0] = 40.0f;
+ D_8004BC88[2][0] = 40.0f;
+ D_8004BC88[3][0] = 104.0f;
+ D_8004BC88[4][0] = 104.0f;
+ D_8004BC88[5][0] = 104.0f;
+ D_8004BC88[0][1] = 95.0f;
+ D_8004BC88[3][1] = 95.0f;
+ D_8004BC88[1][1] = 143.0f;
+ D_8004BC88[4][1] = 143.0f;
+ D_8004BC88[2][1] = 191.0f;
+ D_8004BC88[5][1] = 191.0f;
+ tmp_f2 = (func_800246C8(D_8004A76C, 4.0f) - 2.0)/16 + 0.5;
+ D_8004BC88[3][2] = tmp_f2;
+ D_8004BC88[0][2] = -tmp_f2;
+ D_8004BC88[1][2] = -tmp_f2;
+ D_8004BC88[2][2] = -tmp_f2;
+ D_8004BC88[4][2] = tmp_f2;
+ D_8004BC88[5][2] = tmp_f2;
+}
+
+void arcade_50m_setup(void) {
+ s32 i;
+ int v1 = 0x25;
+ D_8004BCD0[func_800246EC()] = arcade_moving_ladder_obj_template;
+ i = func_800246EC();
+ D_8004BCD0[i] = arcade_moving_ladder_obj_template;
+ D_8004BCD0[i].x_position = 244.0f;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_bottom_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_pauline_top_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_help_text_obj_template;
+ D_8004BCD0[func_800246EC()] = arcade_dk_50m_obj_template;
+ if (D_8004A76C == 2 && D_8004A740)
+ D_8004BCD0[func_800246EC()] = arcade_nintendo_coin_obj_template;
+
+ i = func_800246EC();
+ D_8004BCD0[i] = arcade_bonus_osd_obj_template;
+ D_8004BCD0[i].unk14 = &D_80033C48;
+
+ D_8004C71F = func_800246EC();
+ D_8004BCD0[D_8004C71F] = arcade_jumpman_obj_template;
+
+ D_8004BCD0[0x25] = arcade_oil_drum_obj_template;
+ D_8004BCD0[0x25].x_position = 152.0f;
+ D_8004BCD0[0x25].y_position = 127.0f;
+
+ D_8004BCD0[0x24] = arcade_oil_drum_flame_obj_template;
+ D_8004BCD0[0x24].x_position = 152.0f;
+ D_8004BCD0[0x24].y_position = 113.0f;
+
+ D_8004BCD0[0x23] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x23].unk14 = &D_80038FE8;
+ D_8004BCD0[0x23].x_position = 172.0f;
+
+ D_8004BCD0[0x22] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x22].y_position = 167.0f;
+ D_8004BCD0[0x22].x_position = 116.0f;
+
+ D_8004BCD0[0x21] = arcade_bonus_item_obj_template;
+ D_8004BCD0[0x21].unk14 = &D_800391F0;
+ D_8004BCD0[0x21].y_position = 167.0f;
+ D_8004BCD0[0x21].x_position = 252.0f;
+
+ D_8004BCD0[0x20] = arcade_hammer_obj_template;
+ D_8004BCD0[0x20].x_position = 68.0f;
+ D_8004BCD0[0x20].y_position = 148.0f;
+
+ D_8004BCD0[0x1F] = arcade_hammer_obj_template;
+ D_8004BCD0[0x1F].x_position = 156.0f;
+ D_8004BCD0[0x1F].y_position = 188.0f;
+
+ D_8004BCD0[0x1E] = arcade_pulley_obj_template;
+
+ D_8004BCD0[0x1D] = arcade_pulley_obj_template;
+ D_8004BCD0[0x1D].unk1A = 1;
+ D_8004BCD0[0x1D].unk1B = 1;
+ D_8004BCD0[0x1D].unk1C = 0;
+ D_8004BCD0[0x1D].x_position = 256.0f;
+ D_8004BCD0[0x1D].y_position = 84.0f;
+
+ D_8004BCD0[0x1C] = arcade_pulley_obj_template;
+ D_8004BCD0[0x1C].unk1A = 1;
+ D_8004BCD0[0x1C].unk1B = 1;
+ D_8004BCD0[0x1C].unk1C = 1;
+ D_8004BCD0[0x1C].y_position = 124.0f;
+ D_8004BCD0[0x1C].x_position = 139.0f;
+
+ D_8004BCD0[0x1B] = arcade_pulley_obj_template;
+ D_8004BCD0[0x1B].y_position = 124.0f;
+ D_8004BCD0[0x1B].unk1C = 2;
+ D_8004BCD0[0x1B].x_position = 165.0f;
+
+ D_8004BCD0[0x1A] = arcade_pulley_obj_template;
+ D_8004BCD0[0x1A].y_position = 204.0f;
+ D_8004BCD0[0x1A].unk1C = 3;
+ D_8004BCD0[0x1A].x_position = 48.0f;
+
+ D_8004BCD0[0x19] = arcade_pulley_obj_template;
+ D_8004BCD0[0x19].unk1A = 1;
+ D_8004BCD0[0x19].unk1B = 1;
+ D_8004BCD0[0x19].x_position = 256.0f;
+ D_8004BCD0[0x19].y_position = 204.0f;
+ D_8004BCD0[0x19].unk1C = 3;
+}
+
+void func_80029968(void) {
+ int i;
+ int tmp_v0;
+
+ D_8004C708 = 0;
+ arcade_background_visual = D_8004A788[D_8004C723 & 3];
+ for (i = 0; i < 0x50; i++) { //clear arcade_obj_array
+ D_8004BCD0[i].unk18 = 0;
+ }
+
+ switch(arcade_background_visual) {
+ case 1:
+ arcade_25m_setup();
+ break;
+ case 2:
+ arcade_100m_setup();
+ break;
+ case 3:
+ arcade_75m_setup();
+ break;
+ default:
+ arcade_50m_setup();
+ break;
+ }
+ func_80025240(); //queue stage music
+ tmp_v0 = D_8004A76C * 0xA + 0x28;
+ if (tmp_v0 >= 0x5B) {
+ D_8004C71E = 0x5A;
+ } else {
+ D_8004C71E = tmp_v0;
+ }
+ D_8004C710 = 0;
+ D_8004C718 = 0xFF;
+ D_8004A764 = 0;
+ D_8004C6DC = 0;
+ arcade_game_state = 1;
+ D_8004C6F8 = 1;
+ D_8004C721 = 1;
+ D_8004A308[0] = 0;
+ D_8004A308[1] = 0;
+ D_8004A308[2] = 0;
+ D_8004A308[3] = 0;
+
+}
+
+s32 func_80029ACC(s32 arg0, s32 arg1) {
+ s32 phi_v1;
+
+ if (arg1 < 0x5D) {
+ D_8004C6F0 = 0x88;
+ } else {
+ D_8004C6F0 = 0x36;
+ }
+ D_8004C6F4 = 0x10A;
+ if (arg1 < 0x3F) {
+ D_8004C6F8 = 0;
+ if ((arg0 >= 0x85) && (arg0 < 0xBC)) {
+ phi_v1 = 0x37;
+ } else {
+ phi_v1 = 0xF8;
+ }
+ } else if (arg1 < 0x5D) {
+ D_8004C6F8 = 1;
+ phi_v1 = arg0 / 0x10;
+ if (arg0 / 0x10 < 0xB) {
+ phi_v1 = 0xB;
+ }
+ phi_v1 += 0x48;
+ if (arg0 >= 0x105) {
+ phi_v1 = 0xF8;
+ }
+ } else if (arg1 < 0x7F) {
+ D_8004C6F8 = 2;
+ phi_v1 = 0x7C - (arg0 / 0x10);
+ if (arg0 < 0x3C) {
+ phi_v1 = 0xF8;
+ }
+ } else if (arg1 < 0xA0) {
+ D_8004C6F8 = 3;
+ phi_v1 = (arg0 / 0x10) + 0x8A;
+ if (arg0 >= 0x105) {
+ phi_v1 = 0xF8;
+ }
+ } else if (arg1 < 0xC3) {
+ D_8004C6F8 = 4;
+ phi_v1 = 0xBE - (arg0 / 0x10);
+ if (arg0 < 0x3C) {
+ phi_v1 = 0xF8;
+ }
+ } else if (arg1 < 0xE1) {
+ D_8004C6F8 = 5;
+ phi_v1 = (arg0 / 0x10) + 0xCC;
+ if (arg0 >= 0x105) {
+ phi_v1 = 0xF8;
+ }
+ } else {
+ D_8004C6F8 = 6;
+ phi_v1 = 0x100 - (arg0 / 0x10);
+ if (phi_v1 >= 0xF8) {
+ phi_v1 = 0xF7;
+ }
+ }
+ if (phi_v1 < arg1) {
+ D_8004C6F8++;
+ }
+ return phi_v1;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80029CD0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80029EFC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002A264.s")
+
+s32 func_8002A390(s32 arg0, s32 arg1) {
+ if (arcade_background_visual == 1) {
+ func_80029ACC(arg0, arg1);
+ return;
+ }
+ if (arcade_background_visual == 2) {
+ func_80029CD0(arg0, arg1);
+ return;
+ }
+ if (arcade_background_visual == 3) {
+ func_80029EFC(arg0, arg1);
+ return;
+ }
+ return func_8002A264(arg0, arg1);
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002A408.s")
+#else
+s32 func_8002A408(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) {
+ if ((arg1 < arg3 ^ 1) & (arg5 < arg1 ^ 1) & (arg2 - 4 < arg0) & (arg0 < arg2 + 3)) {
+ D_8004C6E0 = arg2;
+ D_8004C6E4 = arg3;
+ D_8004C6E8 = arg5;
+ D_8004C6EC = arg4;
+ return 1;
+ }
+ return 0;
+}
+#endif
+
+
+s32 func_8002A474(s32 arg0, s32 arg1) {
+ if (func_8002A408(arg0, arg1, 0x84, 0xD4, 0xEB, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xEC, 0xDA, 0xDA, 0xF2)) {
+ return 2;
+ }
+ if (func_8002A408(arg0, arg1, 0x94, 0xB5, 0xB5, 0xD5)) {
+ return 3;
+ }
+ if (func_8002A408(arg0, arg1, 0x54, 0xB9, 0xB9, 0xD1)) {
+ return 4;
+ }
+ if (func_8002A408(arg0, arg1, 0x74, 0x91, 0xAB, 0xB7)) {
+ return 5;
+ }
+ if (func_8002A408(arg0, arg1, 0xAC, 0x94, 0x94, 0xB4)) {
+ return 6;
+ }
+ if (func_8002A408(arg0, arg1, 0xEC, 0x98, 0x98, 0xB0)) {
+ return 7;
+ }
+ if (func_8002A408(arg0, arg1, 0xDC, 0x6F, 0x8B, 0x97)) {
+ return 8;
+ }
+ if (func_8002A408(arg0, arg1, 0x7C, 0x75, 0x75, 0x91)) {
+ return 9;
+ }
+ if (func_8002A408(arg0, arg1, 0x54, 0x77, 0x77, 0x8F)) {
+ return 0xA;
+ }
+ if (func_8002A408(arg0, arg1, 0x8C, 0x53, 0x64, 0x74)) {
+ return 0xB;
+ }
+ if (func_8002A408(arg0, arg1, 0xEC, 0x56, 0x56, 0x6E)) {
+ return 0xC;
+ }
+ if (func_8002A408(arg0, arg1, 0xB4, 0x37, 0x37, 0x53)) {
+ return 0xD;
+ }
+ D_8004C6E0 = 0;
+ D_8004C6E4 = 300;
+ D_8004C6EC = 300;
+ D_8004C6E8 = 1;
+ return 0;
+}
+
+s32 func_8002A734(s32 arg0, s32 arg1) {
+ if (func_8002A408(arg0, arg1, 0x3C, 0xD0, 0xD0, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x9C, 0xD0, 0xD0, 0xF7)) {
+ return 2;
+ }
+ if (func_8002A408(arg0, arg1, 0x104, 0xD0, 0xD0, 0xF7)) {
+ return 3;
+ }
+ if (func_8002A408(arg0, arg1, 0x44, 0xAA, 0xAA, 0xD0)) {
+ return 4;
+ }
+ if (func_8002A408(arg0, arg1, 0x7C, 0xAA, 0xAA, 0xD0)) {
+ return 5;
+ }
+ if (func_8002A408(arg0, arg1, 0xC4, 0xAA, 0xAA, 0xD0)) {
+ return 6;
+ }
+ if (func_8002A408(arg0, arg1, 0xFC, 0xAA, 0xAA, 0xD0)) {
+ return 7;
+ }
+ if (func_8002A408(arg0, arg1, 0x4C, 0x84, 0x84, 0xAA)) {
+ return 8;
+ }
+ if (func_8002A408(arg0, arg1, 0x9C, 0x84, 0x84, 0xAA)) {
+ return 9;
+ }
+ if (func_8002A408(arg0, arg1, 0xF4, 0x84, 0x84, 0xAA)) {
+ return 0xA;
+ }
+ if (func_8002A408(arg0, arg1, 0x54, 0x5D, 0x5D, 0x84)) {
+ return 0xB;
+ }
+ if (func_8002A408(arg0, arg1, 0x74, 0x5D, 0x5D, 0x84)) {
+ return 0xC;
+ }
+ if (func_8002A408(arg0, arg1, 0xCC, 0x5D, 0x5D, 0x84)) {
+ return 0xD;
+ }
+ if (func_8002A408(arg0, arg1, 0xEC, 0x5D, 0x5D, 0x84)) {
+ return 0xE;
+ }
+ D_8004C6E0 = 0;
+ D_8004C6E4 = 300;
+ D_8004C6EC = 300;
+ D_8004C6E8 = 1;
+ return 0;
+}
+
+s32 func_8002AA24(s32 arg0, s32 arg1) {
+ if (func_8002A408(arg0, arg1, 0xB4, 0x37, 0x37, 0x57)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xD4, 0x57, 0x57, 0x77)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x104, 0x67, 0x67, 0x8F)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xBC, 0x7F, 0x7F, 0x9F)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xEC, 0x8F, 0x8F, 0xAF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x104, 0xB7, 0xB7, 0xCF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x44, 0x87, 0x87, 0xBF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x74, 0x87, 0x87, 0xCF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x84, 0x87, 0x87, 0xCF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x3C, 0xBF, 0xBF, 0xE7)) {
+ return 1;
+ }
+ D_8004C6E0 = 0;
+ D_8004C6E4 = 300;
+ D_8004C6EC = 300;
+ D_8004C6E8 = 1;
+ return 0;
+}
+
+s32 func_8002AC54(s32 arg0, s32 arg1) {
+ s32 phi_v0;
+
+ if (func_8002A408(arg0, arg1, 0x4C, 0xCF, 0xCF, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x84, 0xCF, 0xCF, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xBC, 0xCF, 0xCF, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xF4, 0xCF, 0xCF, 0xF7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x74, 0xA7, 0xA7, 0xCF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xC4, 0xA7, 0xA7, 0xCF)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x4C, 0x7F, 0x7F, 0xA7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0x84, 0x7F, 0x7F, 0xA7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xBC, 0x7F, 0x7F, 0xA7)) {
+ return 1;
+ }
+ if (func_8002A408(arg0, arg1, 0xF4, 0x7F, 0x7F, 0xA7)) {
+ return 1;
+ }
+ phi_v0 = D_8004BCD0[0].y_position;
+ if (phi_v0 == 0x61) {
+ phi_v0 = 0x57;
+ } else {
+ phi_v0 = 0x74;
+ }
+ if (func_8002A408(arg0, arg1, 0x44, 0x57, phi_v0, 0x7F)) {
+ return 1;
+ }
+
+ phi_v0 = D_8004BCD0[1].y_position;
+ if (phi_v0 == 0x61) {
+ phi_v0 = 0x57;
+ } else {
+ phi_v0 = 0x74;
+ }
+ if (func_8002A408(arg0, arg1, 0xFC, 0x57, phi_v0, 0x7F)) {
+ return 1;
+ }
+ D_8004C6E0 = 0;
+ D_8004C6E4 = 300;
+ D_8004C6EC = 300;
+ D_8004C6E8 = 1;
+ return 0;
+}
+
+s32 func_8002AF2C(s32 arg0, s32 arg1) {
+ if (arcade_background_visual == 1) {
+ return func_8002A474(arg0, arg1);
+ }
+ if (arcade_background_visual == 2) {
+ return func_8002A734(arg0, arg1);
+ }
+ if (arcade_background_visual == 3) {
+ return func_8002AA24(arg0, arg1);
+ }
+ return func_8002AC54(arg0, arg1);
+}
+
+void func_8002AFA4(Gfx **arg0, s32 arg1) {
+ Gfx *sp4C;
+ s32 tmp_v0;
+ f32 phi_f0;
+
+ if (D_8004A338[D_8004BCD0[arg1].unk18] & 1) {
+ phi_f0 = 1024.0f;
+ } else {
+ phi_f0 = D_8004AA18;
+ }
+ guSprite2DInit(
+ &D_8004AC00[D_807444FC].sprite[arg1], D_8004BCD0[arg1].unk14, 0,
+ D_8004BCD0[arg1].unk1E, D_8004BCD0[arg1].unk1E, D_8004BCD0[arg1].unk1F, G_IM_FMT_RGBA,
+ G_IM_SIZ_16b, 0, 0
+ );
+ sp4C = *arg0;
+ func_8070E8F0(&sp4C, &D_8004AC00[D_807444FC].sprite[arg1]);
+ func_8070F2C8(0x400, phi_f0, 1 & D_8004BCD0[arg1].unk1A & 1, D_8004BCD0[arg1].unk1B);
+
+ if (D_8004A338[D_8004BCD0[arg1].unk18] & 2) {
+ func_8070F2FC(&sp4C,
+ (s32)(D_8004BCD0[arg1].x_position - (f32)D_8004A358[D_8004BCD0[arg1].unk18])*4,
+ (s32)((D_8004BCD0[arg1].y_position - (f32)D_8004A378[D_8004BCD0[arg1].unk18])*0.875 + 8)*4);
+ } else {//L8002B1AC
+ if (D_8004BCD0[arg1].unk18 == 2) {
+ tmp_v0 = (s32)D_8004BCD0[arg1].unk10;
+ if (tmp_v0 > 2) {
+ tmp_v0 = 5 - tmp_v0;
+ }
+ } else {
+ tmp_v0 = 0;
+ }
+ func_8070F2FC(&sp4C,
+ (s32)(D_8004BCD0[arg1].x_position - D_8004A358[D_8004BCD0[arg1].unk18])*4,
+ (s32)(4*((D_8004BCD0[arg1].y_position - tmp_v0 - D_8004A378[D_8004BCD0[arg1].unk18])*0.875 + 8.0)));
+ }//L8002B2A4
+ *arg0 = sp4C;
+}
+
+void func_8002B2C0(Gfx **arg0) {
+ s32 i;
+ Gfx *sp38;
+
+ sp38 = *arg0;
+ for (i = 0; i < 0x50; i++) {
+ if ((D_8004BCD0[i].unk18 != 0) && (D_8004BCD0[i].unk14 != 0)) {
+ if ((D_8004BCD0[i].unk18 >= 8) || (arcade_game_state < 2)) {
+ func_8002AFA4(&sp38, i);
+ }
+ }
+ }
+ *arg0 = sp38;
+}
+
+s32 __arcade_abs_w(s32 arg0) {
+ if (arg0 >= 0) {
+ return arg0;
+ }
+ return -arg0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002B390.s")
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002B89C.s")
+#else
+ extern f32 D_8004AA1C;
+ extern f64 D_8004AA20;
+ extern f32 D_8004AA28;
+ extern f64 D_8004AA30;
+ extern f32 D_8004AA38;
+ extern f64 D_8004AA40;
+ extern f32 D_8004AA64;
+ extern f64 D_8004AA68;
+ extern f64 D_8004AA78;
+ extern f64 D_8004AA80;
+ extern f64 D_8004AA88;
+ extern f32 D_8004AA90;
+ extern s32 D_8004BC80;
+ extern s32 D_8004BC84;
+ extern s32 D_8004C700;
+
+ extern s32 D_80770DFC;
+
+void func_8002B89C(s32 arg0) {
+ f32 sp44;
+ s32 sp40;
+ s32 sp3C;
+ s32 sp38;
+ ArcadeStruct1 *sp30 = D_8004BCD0 + arg0;
+ s32 tmp_v0;
+ int i;
+ int pointIndx;
+ ArcadeStruct1 *stagePtr;
+
+ if (sp30->unk19 == 8 || arcade_game_state == 0) {
+ if (sp30->unk19 == 2) {
+ func_8002A390(sp30->unk0, sp30->unk4);
+ if (sp30->unk8 < 0.0f) {
+ sp30->unk1A &= 1;
+ } else if (0.0f < sp30->unk8) {
+ sp30->unk1A |= 2;
+ }
+ if (( D_807ECDE8->unk0 & 0x200 || D_807ECDE8->unk2 < -0x14 )
+ && D_8004C6F0 < sp30->unk0
+ ) {
+ D_8004BC80 += 3;
+ sp30->unk8 = D_8004AA1C;
+ sp30->unk10 += D_8004AA20;
+ } else if ((D_807ECDE8->unk0 & 0x100 || D_807ECDE8->unk2 >= 0x15)
+ && D_8004C6F4 < sp30->unk0
+ ) {//L8002B9DC
+ D_8004BC80 += 3;
+ sp30->unk8 = D_8004AA28;
+ sp30->unk10 += D_8004AA30;
+ } else {
+ sp30->unk8 = 0.0f;
+ }//L8002BA5C
+ if (newly_pressed_input & (A_BUTTON | B_BUTTON | Z_TRIG) && !D_8004C710) {
+ func_80737638(D_8076D1F8, SFX_41_ARCADE_JUMPMAN_JUMPING, 0x7fff, 0x3F, 1.0f, 0, 0);
+ sp30->unk10 = 0.0f;
+ sp30->unkC = D_8004AA38;
+ sp30->unk8 *= D_8004AA40;
+ sp30->unk1D = (s8) (u32) sp30->unk4;
+ sp30->unk19 = 3;
+ }
+ }//L8002BB74
+ if (sp30->unk4 < func_8002A390( sp30->unk8 + sp30->unk0,sp30->unk4) + 3) {
+ sp30->unk0 += sp30->unk8;
+ } else {
+ sp30->unk8 = 0.0f;
+ }
+ if (sp30->unk19 != 8
+ && arcade_background_visual == 3
+ && ( (76.0f < sp30->unk0 && sp30->unk0 < 140.0f) || (140.0f < sp30->unk0 && sp30->unk0 < 164.0f))
+ && ( (sp30->unk4 < 116.0f && 239.0f < sp30->unk4) || (239.0f < sp30->unk4))
+ ) {
+ func_80027E8C();
+ } else {////L8002BCC4
+ D_8004C700 = func_8002AF2C(sp30->unk0, sp30->unk4);
+ sp40 = func_8002A390(sp30->unk0, sp30->unk4);
+ D_8004C6FC = D_8004C6F8;
+ switch (sp30->unk19) {
+ case 2:// 8002BD64
+ if (D_8004C6FC == 0)
+ D_8004BCD0[D_8004C71F].unk0 += D_8004A308[0];
+ if (D_8004C6FC == 1)
+ D_8004BCD0[D_8004C71F].unk0 += D_8004A308[1];
+ if (D_8004C6FC == 2)
+ D_8004BCD0[D_8004C71F].unk0 += D_8004A308[2];
+ if (D_8004C6FC == 3)
+ D_8004BCD0[D_8004C71F].unk0 += D_8004A308[3];
+
+ if (sp30->unk0 <= D_8004C6F0 - 1)
+ sp30->unk0 = D_8004C6F0;
+ if (D_8004C6F4 + 1 <= sp30->unk0)
+ sp30->unk0 = D_8004C6F4;
+
+ if (D_8004C6EC < sp30->unk4
+ && ((D_807ECDE8->unk0 & 0x800) | ((D_807ECDE8->unk3 < 0x15) ^ 1))
+ && D_807ECDE8->unk2 < 0x29 && D_807ECDE8->unk2 >= -0x28
+ && !(D_807ECDE8->unk0 & 0x300)
+ && !D_8004C710
+ ) {
+ sp30->unk19 = 5;
+ sp30->unk8 = 0.0f;
+ sp30->unk4--;
+ sp30->unk0 = D_8004C6E0;
+ } else if (
+ sp30->unk4 < D_8004C6E8
+ && D_8004C6EC <= sp30->unk4
+ && !(D_807ECDE8->unk0 & 0x300)
+ && D_807ECDE8->unk2 < 0x29 && D_807ECDE8->unk2 >= -0x28
+ && ((D_807ECDE8->unk0 & 0x400) | (D_807ECDE8->unk3 < -0x14))
+ && !D_8004C710
+ ) {
+ sp30->unk19 = 5;
+ sp30->unk8 = 0.0f;
+ sp30->unk4++;
+ sp30->unk0 = D_8004C6E0;
+ } else if (sp40 - sp30->unk4 < 2.0f) {
+ sp30->unk4 = sp40;
+ } else {
+ sp30->unk19 = 3;
+ sp30->unk8 = 0.0f;
+ sp30->unkC = 0.0f;
+ sp30->unk1D = (s8) (u32) sp30->unk4;
+ }
+ sp3C = 4;
+ break;
+ case 5:// 8002C0FC
+ if (sp40 == sp30->unk4
+ && ( ( (D_807ECDE8->unk0 & 0x300) | (D_807ECDE8->unk2 < 0x15)^1 | (D_807ECDE8->unk2 < -0x14))
+ || (D_8004C6FC == 2 && D_8004A308[2])
+ || (D_8004C6FC == 1 && D_8004A308[1])
+ || (D_8004C6FC == 3 && D_8004A308[3])
+ )
+ ) {
+ sp30->unk19 = 2;
+ } else if (
+ sp40 == sp30->unk4
+ && newly_pressed_input & (A_BUTTON | B_BUTTON | Z_TRIG)
+ ) {//L8002C198
+ func_80737638(D_8076D1F8, SFX_41_ARCADE_JUMPMAN_JUMPING, 0x7fff, 0x3f, 1.0f, 0, NULL);
+ sp30->unk10 = 0.0f;
+ sp30->unkC = D_8004AA64;
+ sp30->unk8 *= D_8004AA68;
+ sp30->unk19 = 3;
+ sp30->unk1D = (s8) (u32) sp30->unk4;
+ } else {//L8002C2AC
+ //TODO: FINISH THIS
+ }
+ break;
+ case 3:// 8002C420
+ if (D_8004C6F4 < sp30->unk0) {
+ sp30->unk0 = D_8004C6F4;
+ if (sp30->unkC < D_8004AA78) {
+ sp30->unk1A &= 1;
+ sp30->unk8 = -sp30->unk8;
+ sp30->unkC = -sp30->unkC;
+ }
+ } else { //L8002C490
+ if (sp30->unk0 < D_8004C6F0) {
+ sp30->unk0 = D_8004C6F0;
+ if (sp30->unkC < D_8004AA80) {
+ sp30->unk1A |= 2;
+ sp30->unk8 = -sp30->unk8;
+ sp30->unkC = -sp30->unkC;
+ }
+ }
+ }//L8002C4F8
+ sp30->unk4 += sp30->unkC;
+ sp30->unkC += D_8004AA88;
+ if (0.0f <= sp30->unkC && sp30->unkC < D_8004AA88) {
+ sp38 = 0;
+ for (i = 0; i < 0x50; i++) {
+ if (D_8004BCD0[i].unk18 == 1 || D_8004BCD0[i].unk18 == 2) {
+ if (__arcade_abs_w(D_8004BCD0[i].unk0) < 0xD
+ && D_8004BCD0[i].unk0 - sp30->unk0 < 24.0f
+ && sp30->unk0 < D_8004BCD0[i].unk0
+ ) {
+ sp38++;
+ }
+ }//L8002C5EC
+ }
+ if (sp38) {
+ pointIndx = func_800247F0();
+ D_8004BCD0[pointIndx] = arcade_points_text_obj_template;
+ D_8004BCD0[pointIndx].unk0 = sp30->unk0;
+ D_8004BCD0[pointIndx].unk4 = sp30->unk4;
+ if (sp38 == 1) {
+ arcade_add_points_to_score(100);
+ } else if (sp38 == 2) {
+ D_8004BCD0[pointIndx].unk14 = &D_800383B8;
+ arcade_add_points_to_score(300);
+ } else if (sp38 == 3) {
+ D_8004BCD0[pointIndx].unk14 = &D_800385C0;
+ arcade_add_points_to_score(500);
+ }
+ }
+ }//L8002C70C
+ if (15.0f < sp30->unk4 - sp30->unk1D) {
+ func_80737638(D_8076D1F8, SFX_44_ARCADE_SPRING_FALL, 0x7fff, 0x3f, 1.0f, 0, NULL);
+ sp30->unk1D = 0xff;
+ }
+ if (2.5 < sp30->unkC) {
+ sp30->unkC = 2.5f;
+ }
+ if (sp40 < sp30->unk4 && sp30->unk4 - sp40 < 3.0f) {
+ sp30->unk4 = sp40;
+ if (sp30->unk1D == 0xff) {
+ func_80027E8C();
+ } else {
+ sp30->unk19 = 4;
+ sp30->unkC = 0.0f;
+ sp30->unk8 = 0.0f;
+ sp30->unk10 = 4.0f;
+ }
+ }//L8002C850
+ break;
+ case 4:// 8002C858
+ if (0.0f == sp30->unk10) {
+ sp30->unk19 = 2;
+ }
+ break;
+ case 8:// 8002C898
+ sp30->unk10 += 0.125;
+ if (8.0f == sp30->unk10) {
+ func_80737638(D_8076D1F8, SFX_54_ARCADE_JUMPMAN_DEATH, 0x7fff, 0x3f, 1.0, 0, NULL);
+ }
+ break;
+ }// 8002C908
+ if (!(D_8004BC80 < 0x24)) {
+ D_8004BC80 = 0;
+ tmp_v0 = D_8004BC84;
+ tmp_v0++;
+ if (tmp_v0 == 7)
+ tmp_v0 = 0;
+ if (tmp_v0 & 1) {
+ sp44 = 1.0f;
+ } else {
+ sp44 = D_8004AA90;
+ }
+ func_80737638(D_8076D1F8, SFX_40_ARCADE_JUMPMAN_MOVING, 0x7fff, 0x3f, 1.0f, 0, &D_80770DFC);
+ func_80737AC4(D_80770DFC, 0x10, sp44);
+ }//L8002C9C0
+ sp40 = func_8002A390(sp30->unk0, sp30->unk4);
+ sp30->unk1C = D_8004C6F8;
+ D_8004C704 = sp30->unk4 - D_8004C6E4;
+ if (D_8004C71E < 0 && sp30->unk19 != 8) {
+ func_80027E8C();
+ }
+ if (D_8004C6F8 == 0 && sp40 == sp30->unk4) {
+ func_80737638(D_8076D1F8, SFX_4C_ARCADE_PAULINE_SAVED_STAGE, 0x7fff, 0x3f, 1.0f, 0, NULL);
+ func_800252A4(0);
+ if (arcade_background_visual == 1) {
+ stagePtr = func_80024860(ARCADE_OBJ_16_DK_25M);
+ } else if (arcade_background_visual == 3) {
+ stagePtr = func_80024860(ARCADE_OBJ_18_DK_75M);
+ } else if (arcade_background_visual == 4) {
+ stagePtr = func_80024860(ARCADE_OBJ_19_DK_50M);
+ }
+ //L8002CB6C
+ stagePtr->unk19 = 5;
+ if (arcade_background_visual != 4) {
+ stagePtr->unk18 = ARCADE_OBJ_18_DK_75M;
+ }
+ stagePtr->unk10 = 0.0f;
+ arcade_game_state = 3;
+ sp30->unk14 = &D_8003B180;
+ sp30->unk1A = 0;
+
+ } else {//L8002CBB4
+ if (sp30->unk19)
+ func_8002B390(arg0);
+ }
+ }
+ }//L8002CBC8
+}
+#endif
+
+//arcade_barrel_update_sprite
+void func_8002CBD8(s32 arg0) {
+ ArcadeStruct1 *v0 = D_8004BCD0 + arg0;
+ s32 v1 = v0->unk10;
+
+ if (v0->unk19 == 5
+ || v0->unk19 == 7
+ || v0->unk19 == 1
+ ) { //on ladder
+ if (v0->unk1D) { //blue barrel
+ switch(v1 & 1) {
+ case 0:
+ v0->unk14 = &D_80035AE0;
+ break;
+ case 1:
+ v0->unk14 = &D_80035CE8;
+ break;
+ }
+ } else { //red barrel
+ switch(v1 & 1) {
+ case 0:
+ v0->unk14 = &D_80035650;
+ break;
+ case 1:
+ v0->unk14 = &D_80035898;
+ break;
+ }
+ }
+ } else {// normal rolling
+ if (v0->unk1D) {
+ switch(v1 & 3) { //blue barrel
+ case 0:
+ v0->unk14 = &D_80035448;
+ break;
+ case 1:
+ v0->unk14 = &D_80035240;
+ break;
+ case 2:
+ v0->unk14 = &D_80035038;
+ break;
+ case 3:
+ v0->unk14 = &D_80034E30;
+ break;
+ }
+ } else {
+ switch(v1 & 3) { //red barrel
+ case 0:
+ v0->unk14 = &D_80034C28;
+ break;
+ case 1:
+ v0->unk14 = &D_80034A20;
+ break;
+ case 2:
+ v0->unk14 = &D_80034818;
+ break;
+ case 3:
+ v0->unk14 = &D_80034610;
+ break;
+ }
+ }
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002CD64.s")
+#else
+
+extern f64 D_8004AAB8;
+extern f64 D_8004AAC0;
+extern f64 D_8004AAC8;
+extern f64 D_8004AAD0;
+extern f64 D_8004AAD8;
+extern f32 D_8004AAE0;
+
+void func_8002CD64(s32 arg0) {
+ s32 sp3C;
+ s32 sp34;
+ f32 sp30;
+ ArcadeStruct1 *this;
+ f32 tmp_f12;
+ s32 flame_indx;
+
+
+ if (arcade_game_state != 0)
+ return;
+
+ this = &D_8004BCD0[arg0];
+ if (this->unk19 == 0 || this->unk19 == 1) {
+ func_8002CBD8(arg0);
+ }
+ else {
+ this->unk0 += this->unk8;
+ sp3C = func_8002A390( this->unk0, this->unk4);
+ func_8002AF2C( this->unk0, this->unk4);
+ switch(this->unk19) {
+ case 2: //L8002CE70
+ this->unk8 = (f32)(1 - (this->unk1A << 1));
+ this->unk10 += D_8004AA98;
+ if ((this->unk4 < D_8004C6E8)
+ && ( D_8004C6F8 + 1 < D_8004C6FC
+ || (D_8004C6FC == this->unk1C && D_8004C704 < 0x12)
+ || (D_8004BCD0[0].unk19 != 5))
+ ) {
+ if (this->unk1C & 0x80)
+ break;
+
+ this->unk1C &= 0xF;
+ if (this->unk1C & 0xFF > 0) {
+ this->unk1C--;
+ this->unk19 = 5;
+ this->unk4 += 1.0f;
+ this->unkC = 1.0f;
+ this->unk8 = 0.0f;
+ this->unk0 = D_8004C6E0;
+ }
+ else {
+ this->unk1C |= 0x80;
+ }
+ }
+ else {//L8002CFDC
+ if (!(this->unk1C & 0x47)) {
+ this->unk1C = 0x40 | (4096.0f + func_800246C8((f32)D_8004A76C, 5.0f) * 1512.0f > (f32)func_80024644()) ? TRUE : FALSE;
+ }//L8002D074
+ if ((f32)sp3C - this->unk4 < 3.0f) {
+ this->unk4 = sp3C;
+ }
+ else {
+ this->unk19 = 3;
+ this->unkC = 0.0f;
+ this->unk8 = this->unk8/2;
+ }
+ }
+ break;
+ case 3: //L8002D0FC
+ this->unk10 += D_8004AAA0;
+ this->unk4 += this->unkC;
+ this->unkC += D_8004AAA8;
+ if (sp3C < this->unk4
+ && this->unk4 - sp3C < 3.0f
+ ) {
+ this->unk4 = sp3C;
+ this->unkC = -this->unkC/3.0f;
+ if (D_8004AAB0 < this->unkC)
+ this->unk19 = 2;
+ }//L8002D1C8
+ break;
+ case 5: //L8002D1E4
+ this->unk10 += D_8004AAB8;
+ this->unk4 += this->unkC;
+ if (D_8004C6E8 < this->unk4) {
+ this->unk1A = (1 - this->unk1A);
+ this->unk19 = 2;
+ this->unk4 = sp3C;
+ this->unk8 = 1 - 2*this->unk1A;
+ }//L8002D28C
+ break;
+ case 7: //L8002D2A8
+ this->unk10 += D_8004AAC0;
+ this->unk4 += this->unkC;
+ this->unkC += D_8004AAC8;
+ tmp_f12 = func_8002A390(this->unk0, this->unk4);
+ if (tmp_f12 < this->unk4
+ && this->unk4 - tmp_f12 < 8.0f
+ && this->unk1C < D_8004C6F8
+ ) {
+ this->unkC = 0.0f;
+ if (this->unk1D == 2) {
+ sp34 = func_80024644();
+ this->unk8 = (func_800246C8(3.0f, D_8004A76C)*(sp34 - 0.0f))/D_8004AAD0 + (-this->unk8)*D_8004AAD8;
+ }//L8002D414
+ if (230.0f < this->unk4) {
+ this->unk19 = 3;
+ this->unk1A = 1;
+ this->unk8 = -1.0f;
+ this->unkC = D_8004AAE0;
+ }
+ }//L8002D454
+ break;
+ }//L8002D47C
+ if (!(D_8004BCD0[D_8004C71F].unk1C < D_8004C6F8)
+ || this->unk1D
+ ) {
+ if (270.0f < this->unk0) {
+ this->unk1A = 1;
+ this->unk8 = (1 - ((s8)this->unk1A) << 1);
+ }
+ else if (this->unk0 < 50.0f) {
+ this->unk1A = 0;
+ this->unk8 = (1 - ((s8)this->unk1A) << 1);
+ }
+ }//L8002D504
+ if ((278.0f < this->unk0) || (this->unk0 < 2.0f)) {
+ this->unk18 = 0;
+ }//L8002D548
+ if (( 242.0f < this->unk4) & ( this->unk0 < 74.0f)) {
+ if (this->unk1D) {
+ func_80737638(D_8076D1F8, SFX_42_ARCADE_JUMPMAN_HIT, 0x7fff, 0x3f, D_8004BCD0[D_8004C71F].unk0, 0, NULL);
+ flame_indx = func_80024860(ARCADE_OBJ_13_OIL_DRUM_FLAMES);
+ if (flame_indx < 0)
+ flame_indx = func_800246EC();
+ D_8004BCD0[flame_indx] = arcade_oil_drum_flame_obj_template;
+ D_8004BCD0[flame_indx].unk19 = 3;
+ this->unk18 = 0;
+ }//L8002D668
+ else {
+ this->unk18 = 0;
+ }
+ }//L8002D674
+ if (this->unk0 - D_8004BCD0[D_8004C71F].unk0 < 8.0f
+ && D_8004BCD0[D_8004C71F].unk0 - this->unk0 < 8.0f
+ && this->unk4 - D_8004BCD0[D_8004C71F].unk4 < 3.0f
+ && D_8004BCD0[D_8004C71F].unk4 - this->unk4 < 3.0f
+ ) {
+ func_80027E8C();
+ }
+ func_8002CBD8(arg0);
+ }
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002D6FC.s")
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002E158.s")
+#else
+extern u8 D_80037788[];
+extern u8 D_80037990[];
+
+extern f64 D_8004AB10;
+extern f64 D_8004AB18;
+extern f32 D_8004AB20;
+
+void func_8002E158(s32 arg0) {
+ f32 tmp_f0;
+
+ if (arcade_game_state != 0)
+ return;
+
+ D_8004BCD0[arg0].unk0 += D_8004BCD0[arg0].unk8;
+ D_8004BCD0[arg0].unk10 += D_8004AB10;
+ switch((s32)D_8004BCD0[arg0].unk10 & 0x1) {
+ case 0:
+ D_8004BCD0[arg0].unk14 = &D_80037788;
+ break;
+ case 1:
+ D_8004BCD0[arg0].unk14 = &D_80037990;
+ break;
+ }
+ D_8004BCD0[arg0].unk4 += 5.0f;
+ if (D_8004BCD0[arg0].unkC < 5.0f) {
+ D_8004BCD0[arg0].unkC += D_8004AB18;
+ }
+ if (81.0f < D_8004BCD0[arg0].unk4) {
+ if (D_8004BCD0[arg0].unk0 < 220.0f) {
+ D_8004BCD0[arg0].unk4 = 81.0f;
+ D_8004BCD0[arg0].unkC = -3.5f;
+ if (40.0f < D_8004BCD0[arg0].unk0) {
+ func_80737638(D_8076D1F8, SFX_43_ARCADE_SPRING_SPRINGING, 0x7fff, 0x3f, 1.0f, 0, NULL);
+ }//L8002E2B4
+ }//L8002E2C0
+ else if (0.0f != D_8004BCD0[arg0].unk8) {
+ D_8004BCD0[arg0].unk8 = 0.0f;
+ func_80737638(D_8076D1F8, SFX_44_ARCADE_SPRING_FALL, 0x7fff, 0x3f, 1.0f, 0, NULL);
+ }
+ }//L8002E30C
+ if (D_8004AB20 < D_8004BCD0[arg0].unk4) {
+ D_8004BCD0[arg0].unk18 = 0;
+ }
+ if (__arcade_abs_w(D_8004BCD0[arg0].unk0 - D_8004BCD0[D_8004C71F].unk0) < 7) {
+ tmp_f0 = D_8004BCD0[arg0].unk4 - D_8004BCD0[D_8004C71F].unk4;
+ if (tmp_f0 < 4.0f && -8.0f < tmp_f0 ) {
+ func_80027E8C();
+ }
+ }
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002E3D4.s")
+
+void arcade_pauline_top_update(s32 arg0) {
+ ArcadeStruct1 *pauline = & D_8004BCD0[arg0];
+ s32 tmp_v1 = 2;
+ if (arcade_background_visual == tmp_v1) {
+ pauline->unk1A = (D_8004BCD0[D_8004C71F].x_position < 160.0f);
+ pauline->x_position = 152.0f;
+ if (D_8004C708 == tmp_v1) {
+ pauline->unk1A = 0;
+ pauline->y_position = 63.0f;
+ }
+ }//L8002E764
+ if (!D_8004C721) {
+ pauline->unk14 = NULL;
+ return;
+ }
+ pauline->unk14 = &D_8003E438;
+}
+
+void arcade_pauline_bottom_update(s32 arg0) {
+ ArcadeStruct1 *pauline = & D_8004BCD0[arg0];
+ s32 tmp_v1 = 2;
+ if (arcade_background_visual == tmp_v1) {
+ pauline->unk1A = (D_8004BCD0[D_8004C71F].x_position < 160.0f);
+ pauline->x_position = 152.0f;
+ if (D_8004C708 == tmp_v1) {
+ pauline->unk1A = 0;
+ pauline->y_position = 79.0f;
+ }
+ }//L8002E818
+ if (!D_8004C721) {
+ pauline->unk14 = NULL;
+ return;
+ }
+ if (pauline->unk14 == NULL)
+ pauline->unk14 = &D_8003DB18;
+
+ if (arcade_game_state == 0) {
+ tmp_v1 = pauline->unk1C++ & 0xC8;
+ if (tmp_v1 || D_8004C724 == 1) {
+ pauline->unk14 = &D_8003DB18;
+ }
+ else {
+ pauline->unk14 = &D_8003DD60;
+ }
+ }
+}
+
+void arcade_nintendo_coin_update(s32 arg0) {
+ D_8004BCD0[arg0].unk14 = &D_8003AE58;
+ if (D_8004C721) {
+ D_8004BCD0[arg0].y_position = D_8004BCD0[func_80024860(ARCADE_OBJ_1A_PAULINE_BOTTOM)].y_position - 8.0f;
+ D_8004BCD0[arg0].x_position = D_8004BCD0[func_80024860(ARCADE_OBJ_1A_PAULINE_BOTTOM)].x_position;
+ }//L8002E924
+ else {
+ if (D_8004BCD0[arg0 - 1].unk14 == NULL) {
+ D_8004BCD0[arg0].unk14 = NULL;
+ }
+ D_8004BCD0[arg0].y_position = D_8004BCD0[arg0 - 1].y_position + 20.0f;
+ D_8004BCD0[arg0].x_position = D_8004BCD0[arg0 - 1].x_position + 30.0f;
+ }
+ D_8004BCD0[func_80024860(ARCADE_OBJ_1A_PAULINE_BOTTOM)].unk14 = NULL;
+ D_8004BCD0[func_80024860(ARCADE_OBJ_1B_PAULINE_TOP)].unk14 = NULL;
+ if (func_80024860(ARCADE_OBJ_1D_HELP_TEXT) >= 0) {
+ if ((u32) D_8004BCD0[func_80024860(ARCADE_OBJ_1D_HELP_TEXT)].unk14 != (u32)&D_800389D0)
+ {
+ D_8004BCD0[func_80024860(ARCADE_OBJ_1D_HELP_TEXT)].unk14 = NULL;
+ }
+ }
+}
+
+void arcade_help_text_update(s32 arg0) {
+ s32 tmp_a3 = 2;
+ s32 tmp_v0 = 0x10;
+
+ if (arcade_background_visual == tmp_a3) {
+ D_8004BCD0[arg0].x_position = 0x80 + 0x28 * (160.0f <= D_8004BCD0[D_8004C71F].x_position);
+ if (D_8004C708 == tmp_a3) {
+ D_8004BCD0[arg0].y_position = 63.0f;
+ D_8004BCD0[arg0].unk1A = 0;
+ }
+ }//L8002EA68
+
+ if (arcade_game_state == 3) {
+ if (D_8004C721 == 0)
+ D_8004BCD0[arg0].unk14 = &D_80038BD8;
+ else
+ D_8004BCD0[arg0].unk14 = &D_800389D0;
+ D_8004BCD0[arg0].unk1F = D_8004BCD0[arg0].unk1E = tmp_v0;
+ }//L8002EAC8
+ else if (!D_8004C721) {
+ D_8004BCD0[arg0].unk14 = NULL;
+ }
+ else if (arcade_game_state == 0) {
+ if (!(D_8004BCD0[arg0].unk1C++ & 0xC0)) {
+ if (arcade_background_visual == tmp_a3 || arcade_background_visual == 4)
+ D_8004BCD0[arg0].unk14 = &D_8003E868;
+ else
+ D_8004BCD0[arg0].unk14 = &D_8003E680;
+ }
+ else {
+ D_8004BCD0[arg0].unk14 = NULL;
+ }
+ }//L8002EB38
+}
+
+void arcade_pulley_update(s32 arg0) {
+ if (arcade_game_state == 0) {
+ D_8004BCD0[arg0].unk1D += D_8004A308[D_8004BCD0[arg0].unk1C];
+ if (D_8004BCD0[arg0].unk1D < 0) {
+ D_8004BCD0[arg0].unk1D += 0x2EE00;
+ }
+ switch ((D_8004BCD0[arg0].unk1D / 8) % 3) {
+ case 0:
+ D_8004BCD0[arg0].unk14 = &D_80037B98;
+ break;
+ case 1:
+ D_8004BCD0[arg0].unk14 = &D_80037DA0;
+ break;
+ case 2:
+ D_8004BCD0[arg0].unk14 = &D_80037FA8;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void arcade_dk_title_update(s32 arg0) {
+ s32 phi_v1;
+
+ phi_v1 = D_8004C6DC;
+ if (phi_v1 == 0x3C) {
+ func_80737638(D_8076D1F8, SFX_46_ARCADE_INTRO, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ phi_v1 = D_8004C6DC;
+ }
+ if (phi_v1 >= 0x3C) {
+ if (phi_v1 >= 0x169) {
+ D_8004BCD0[arg0].y_velocity += D_8004AB28;
+ //D_8004BCD0[arg0].unkC += 0.05;
+ D_8004BCD0[arg0].y_position += D_8004BCD0[arg0].y_velocity;
+ D_8004BCD0[arg0].x_position += D_8004BCD0[arg0].x_velocity;
+ if ((D_8004BCD0[arg0].y_velocity > 0.0f) && (D_8004BCD0[arg0].y_position >= 38.0f)) {
+ D_8004C721 = 1;
+ D_8004BCD0[arg0].y_position = 38.0f;
+ if (phi_v1 == 0x26C) {
+ func_80737638(D_8076D1F8, SFX_53_ARCADE_DK_GRUNT, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ D_8004BCD0[arg0].unk14 = &D_80041508;
+ phi_v1 = D_8004C6DC;
+ }
+ if ((phi_v1 == 0x2D0) || (phi_v1 < 0x26C)) {
+ D_8004BCD0[arg0].unk14 = &D_80040540;
+ }
+ if (D_8004AB30 < D_8004BCD0[arg0].y_velocity) {
+ //if (0.06 < D_8004BCD0[arg0].unkC) {
+ D_8004C708 = (s32) (D_8004C708 + 1);
+ func_80737638(D_8076D1F8, SFX_42_ARCADE_JUMPMAN_HIT, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ }
+ if ((D_8004BCD0[arg0].x_position > 74.0f) && !(D_8004C6DC < 0x1A5)) {
+ D_8004BCD0[arg0].x_velocity = -0.5f;
+ D_8004BCD0[arg0].y_velocity = D_8004AB38;
+ //D_8004BCD0[arg0].unkC = -0.81f;
+ }
+ else {
+ D_8004BCD0[arg0].x_velocity = 0.0f;
+ D_8004BCD0[arg0].y_velocity = 0.0f;
+ }
+ }
+ } else {
+ if (D_8004BCD0[arg0].y_position > 74.0f) {
+ D_8004BCD0[arg0].y_velocity = -2.0f;
+ D_8004BCD0[arg0].x_velocity = 0.0f;
+ D_8004BCD0[arg0].y_position = (f32) (0xC5 - ((s32) (phi_v1 - 0x3C) / 2));
+ if ((phi_v1 & 8))
+ D_8004BCD0[arg0].unk14 = &D_80044460;
+ else
+ D_8004BCD0[arg0].unk14 = &D_80045428;
+ }
+ }
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002EEB8.s")
+/*
+void func_8002EEB8(s32 arg0) {
+ ArcadeStruct1 *DK;
+ s32 sp28;
+ s32 sp24;
+
+ DK = &D_8004BCD0[arg0];
+ if (arcade_game_state == 0 || DK->unk19 == 5) {
+ switch(DK->unk19) {
+ case 12: //8002EF20
+ DK->unk1C--;
+ if (DK->unk1C == 0) {
+ DK->unk1C = 0x14;
+ DK->unk19 = 9;
+ DK->unk14 = &D_8003E9F0;
+ DK->unk19 = 0;
+ DK->unk1D = func_800246EC();
+ DK->unk10 += 1.0f;
+
+ D_8004BCD0[DK->unk1D] = arcade_barrel_obj_template;
+ sp28 = DK->unk10;
+ if (!(sp28 & 7))
+ D_8004BCD0[DK->unk1D].unk1D;
+
+ if (sp28 == 2 && D_8004C723)
+ DK->unk1C = 2;
+ else if (sp28 == 1) {
+ if (!D_8004C723)
+ DK->unk1C = 2;
+ else
+ DK->unk1C = 5;
+ }
+ else if (sp28) {
+ if (!(func_80024644() < func_800246C8(D_8004A76C, 3.0f)*2000.0f + 2048.0f))
+ break;
+ }
+ }//L8002F280
+ else {
+ D_8004C71E--;
+ }
+ break;
+ case 9: //8002F29C
+ break;
+ case 11: //8002F338
+ break;
+ case 10: //8002F45C
+ break;
+ case 5: //8002F668
+ break;
+ }
+ }//L8002F81C
+}
+//*/
+
+// big
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002F82C.s")
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_8002FE28.s")
+#else
+// TODO: Regalloc and some other minor stuff
+void func_8002FE28(s32 arg0) {
+ if (arcade_game_state == 0) {
+ D_8004BCD0[arg0].unk10 += 1.0f;
+ if (((s8) D_8004BCD0[arg0].unk10 & 0xFF) < 0xA0) {
+ D_8004BCD0[arg0].unk14 = &D_80040540;
+ } else {
+ if (((s32) D_8004BCD0[arg0].unk10 & 0x1F) == 0) {
+ func_80737638(D_8076D1F8, SFX_42_ARCADE_JUMPMAN_HIT, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ }
+ D_8004BCD0[arg0].unk14 = &D_800424D0;
+ D_8004BCD0[arg0].unk1A = ((((s32)D_8004BCD0[arg0].unk10 & 0x20) / 0x20) == 0);
+ }
+ if (((s32) D_8004BCD0[arg0].unk10 % (0x72 - ((s32) func_800246C8(D_8004A76C, 4.0f) * 0xC))) == 0) {
+ D_8004C71E--;
+ arg0 = func_800246EC();
+ D_8004BCD0[arg0] = arcade_spring_obj_template;
+ D_8004BCD0[arg0].unk0 = ((func_80024644() & 0xF) - 0x1C);
+ D_8004BCD0[arg0].unk19 = 2;
+ }
+ }
+}
+#endif
+
+void arcade_dk_50m_update(s32 arg0) {
+ switch(D_8004BCD0[arg0].unk19) {
+ case 2://L8003007C
+ if (arcade_game_state != 0)
+ return;
+
+ if ((D_8004C6DC % 0x78) == 0) {
+ D_8004C71E--;
+ }
+
+ if (204.0f < D_8004BCD0[arg0].x_position) {
+ D_8004BCD0[arg0].x_velocity = -1.0;
+ }
+
+ if (D_8004BCD0[arg0].x_position < 68.0f) {
+ D_8004BCD0[arg0].x_velocity = 1.0f;
+ }
+
+ D_8004BCD0[arg0].unk10++;
+ if (((s32)D_8004BCD0[arg0].unk10 & 0xff) < 0xA0) {
+ D_8004BCD0[arg0].unk14 = &D_80040540;
+ }
+ else {
+ D_8004BCD0[arg0].unk14 = &D_800424D0;
+ D_8004BCD0[arg0].unk1A = !(((s32)D_8004BCD0[arg0].unk10 & 0x20)/0x20);
+ }
+ break;
+ case 5://L80030170
+ if (100.0f < D_8004BCD0[arg0].x_position) {
+ D_8004BCD0[arg0].x_velocity = -1.0f;
+ }
+ else if (D_8004BCD0[arg0].x_position < 100.0f) {
+ D_8004BCD0[arg0].x_velocity = 1.0f;
+ }
+ else {
+ D_8004BCD0[arg0].x_velocity = 0.0f;
+ D_8004BCD0[arg0].unk18 = 0x16;
+ D_8004BCD0[arg0].unk10 = 41.0f;
+ }
+ break;
+ }
+ if ((D_8004C6DC & 1) == 0) {
+ D_8004A308[0] = D_8004BCD0[arg0].x_velocity;
+ D_8004BCD0[arg0].x_position += D_8004BCD0[arg0].x_velocity;
+ }
+}
+
+void arcade_points_text_update(s32 arg0) {
+ s32 phi_v1;
+
+ if (D_8004BCD0[arg0].unk10 == 0.0f) {
+ func_80737638(D_8076D1F8, SFX_45_ARCADE_POINTS, 0x7FFF, 0x3F, 1.0f, 0, 0);
+ }
+ phi_v1 = 0;
+ if (D_8004BCD0[arg0].unk10 > 40.0f) {
+ phi_v1 = 1;
+ }
+ D_8004BCD0[arg0].unk10++;
+ if (phi_v1) {
+ D_8004BCD0[arg0].unk18 = 0;
+ }
+}
+
+void arcade_bonus_item_update(s32 arg0) {
+ if ((D_8004BCD0[arg0].x_position == (s32) D_8004BCD0[D_8004C71F].x_position)
+ && (D_8004BCD0[arg0].y_position == (s32) D_8004BCD0[D_8004C71F].y_position)
+ ) {
+ D_8004BCD0[arg0].unk18 = ARCADE_OBJ_14_POINTS_TEXT;
+ if (D_8004A76C == 1) {
+ D_8004BCD0[arg0].unk14 = &D_800383B8;
+ arcade_add_points_to_score(300);
+ return;
+ }
+ if (D_8004A76C == 2) {
+ D_8004BCD0[arg0].unk14 = &D_800385C0;
+ arcade_add_points_to_score(500);
+ return;
+ }
+ D_8004BCD0[arg0].unk14 = &D_800387C8;
+ arcade_add_points_to_score(800);
+ }
+}
+
+void arcade_hammer_update(u8 arg0) {
+ ArcadeStruct1 *s2;
+ ArcadeStruct1 *v1;
+ u8 i;
+
+ if (arcade_game_state != 0)
+ return;
+ s2 = &D_8004BCD0[arg0];
+ switch(s2->unk19) {
+ case 0: //L80030418
+ {
+ v1 = &D_8004BCD0[D_8004C71F];
+ if (s2->x_position - v1->x_position < 8.0f && -8.0f < s2->x_position - v1->x_position ) {
+ if (s2->y_position - v1->y_position < 8.0f && -8.0f < s2->y_position - v1->y_position ) {
+ func_800252A4(SFX_49_ARCADE_HAMMER_MUSIC);
+ D_8004C710 = 0x258;
+ s2->unk19 = 2;
+ }
+ }
+ break;
+ }
+ case 2: //L800304B0
+ {
+ v1 = &D_8004BCD0[D_8004C71F];
+ s2->unk1A = v1->unk1A;
+ if ((D_8004C710 & 8) || v1->unk19 != 2) {
+ if (!(D_8004C710 < 0xf1) || D_8004C710 & 0x4)
+ s2->unk14 = &D_800393F8;
+ else
+ s2->unk14 = &D_80039888;
+
+ s2->x_position = v1->x_position;
+ s2->y_position = v1->y_position - 16.0f;
+ }
+ else {//L80030538
+ if (!(D_8004C710 < 0xf1) || D_8004C710 & 0x4)
+ s2->unk14 = &D_80039640;
+ else
+ s2->unk14 = &D_80039AD0;
+
+ if (s2->unk1A)
+ s2->x_position = v1->x_position + 15.0f;
+ else
+ s2->x_position = v1->x_position - 15.0f;
+
+ s2->y_position = v1->y_position;
+ }
+ for (i = 0; i < 0x50; i++) {
+ ArcadeStruct1 *iPtr;
+ ArcadeStruct1 *v1;
+
+ iPtr = &D_8004BCD0[(u8)i];
+
+ if ((iPtr->unk18 == ARCADE_OBJ_01_BARREL)
+ || (iPtr->unk18 == ARCADE_OBJ_04_PIE)
+ || (iPtr->unk18 == ARCADE_OBJ_02_FLAME_ENEMY)
+ ) {
+ if (__arcade_abs_w((s32)(iPtr->x_position - s2->x_position)) < 0xD
+ && __arcade_abs_w((s32)(iPtr->y_position - s2->y_position)) < 0x8
+ ) {
+ func_80737638(D_8076D1F8, SFX_4B_ARCADE_HAMMER_ATTACK, 0x7fff, 0x3f, 1.0f, 0, 0);
+ v1 = &D_8004BCD0[(u8)func_800247F0()];
+ *v1 = arcade_bonus_item_obj_template;
+ v1->unk18 = ARCADE_OBJ_07_HAMMER_PARTICLES;
+ v1->unk1D = iPtr->unk18;
+ v1->x_position = s2->x_position;
+ v1->y_position = s2->y_position;
+ iPtr->unk18 = 0;
+ arcade_game_state = 1;
+ }
+ }
+ }
+ if (D_8004C710-- == 1) {
+ s2->unk18 = 0; //destroy hammer
+ func_800252A4(SFX_0_SILENCE); //play_sfx
+ func_80025240(); //queue_background_music
+ }
+ break;
+ }
+ }//L8003071C
+}
+
+void func_80030734(u8 arg0) {
+ u8 temp_a0;
+ u8 temp_v0;
+ ArcadeStruct1 *temp_s0 = &D_8004BCD0[arg0];
+
+ if (temp_s0->unk1C >= 0x37) {
+ temp_s0->unk14 = &D_8003A3F0;
+ } else {
+ temp_a0 = temp_s0->unk1C / 6 % 3;
+ if (temp_a0 == 0) {
+ temp_s0->unk14 = &D_80039D18;
+ } else if (temp_a0 == 1) {
+ temp_s0->unk14 = &D_80039F60;
+ } else {
+ temp_s0->unk14 = &D_8003A1A8;
+ }
+ }
+
+
+ if (temp_s0->unk1C++ == 0x42) {
+ temp_s0->unk18 = ARCADE_OBJ_14_POINTS_TEXT;
+ temp_v0 = func_80024644() & 3;
+
+ if ((temp_s0->unk1D == 2) && (temp_v0 == 0)) {
+ temp_s0->unk14 = &D_800387C8;
+ arcade_add_points_to_score(800);
+ } else if ((temp_s0->unk1D == 2) && (temp_v0 == 1)) {
+ temp_s0->unk14 = &D_800385C0;
+ arcade_add_points_to_score(500);
+ } else {
+ temp_s0->unk14 = &D_800383B8;
+ arcade_add_points_to_score(300);
+ }
+ temp_s0->unk10 = 0.0f;
+ arcade_game_state = 0;
+ }
+}
+
+void arcade_rivet_update(u8 arg0) {
+ u8 temp_t6;
+
+ if (D_8004BCD0[arg0].x_position == (s32) D_8004BCD0[D_8004C71F].x_position
+ && (D_8004BCD0[arg0].y_position - D_8004BCD0[D_8004C71F].y_position < 20.0f)
+ && (D_8004BCD0[arg0].y_position - D_8004BCD0[D_8004C71F].y_position > -2.0f)
+ ) {
+ D_8004BCD0[arg0].unk1D = 1;
+ }
+ else if (D_8004BCD0[arg0].unk1D) {
+ D_8004BCD0[arg0].unk18 = 0;
+ D_8004C718 = D_8004C718 ^ D_8004BCD0[arg0].unk1C;
+ if (D_8004C718) {
+ temp_t6 = func_800247F0();
+ D_8004BCD0[temp_t6] = arcade_points_text_obj_template;
+ D_8004BCD0[temp_t6].x_position = D_8004BCD0[D_8004C71F].x_position;
+ D_8004BCD0[temp_t6].y_position = D_8004BCD0[D_8004C71F].y_position + 14.0f;
+ D_8004BCD0[temp_t6].unk10 = 0.0f;
+
+ arcade_add_points_to_score(100);
+ }
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80030A04.s")
+#else
+void func_80030A04(u8 index) {
+ f32 phi_f0;
+ if (arcade_game_state == 0) {
+ D_8004BCD0[index].unk10--;
+ if (D_8004BCD0[index].unk10 < 0.0f) {
+ D_8004BCD0[index].unk10 = (f32)((func_80024644() & 0x7F) + 0x1C2);
+ }
+ if (D_8004BCD0[index].unk10 < 200.0f) {
+ phi_f0 = 0.2f;
+ } else {
+ phi_f0 = -0.2f;
+ }
+ D_8004BCD0[index].unk4 += phi_f0;
+ if (97.0f > D_8004BCD0[index].unk4) {
+ D_8004BCD0[index].unk4 = 97.0f;
+ }
+ if (110.0f < D_8004BCD0[index].unk4) {
+ D_8004BCD0[index].unk4 = 110.0f;
+ }
+ }
+}
+#endif
+
+void arcade_pie_update(u8 arg0) {
+ if (arcade_game_state == 0) {
+ D_8004BCD0[arg0].x_position += D_8004A308[D_8004BCD0[arg0].unk1C];
+ if ((D_8004BCD0[arg0].x_position > 288.0f)
+ || (D_8004BCD0[arg0].x_position < 32.0f)
+ || ((D_8004BCD0[arg0].x_position == 160.0f) && (D_8004BCD0[arg0].y_position == 127.0f))
+ ) {
+ D_8004BCD0[arg0].unk18 = 0;
+ }
+ if ((__arcade_abs_w(D_8004BCD0[arg0].x_position - D_8004BCD0[D_8004C71F].x_position) < 0xC)
+ && (D_8004BCD0[arg0].y_position - D_8004BCD0[D_8004C71F].y_position < 4.0f)
+ && (D_8004BCD0[arg0].y_position - D_8004BCD0[D_8004C71F].y_position > -8.0f)
+ ) {
+ func_80027E8C();
+ }
+ }
+}
+
+
+void func_80030C70(u8 arg0) {
+ if (!(D_8004BCD0[func_80024860(0x17)].unk10 > 460.0f)) {
+ D_8004BCD0[arg0].unk1A = (D_8004BCD0[arg0].unk1C++ / 8) & 1;
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_80030CEC.s")
+#else
+void func_80030CEC(u8 arg0) {
+ u8 a0;
+ if (D_8004BCD0[arg0].unk19 == 4)
+ return;
+ if ((D_807ECDE8->unk0 & 0x200) || D_807ECDE8->unk2 < -0x14) {
+ D_8004C720--;
+ switch(D_8004C720) {
+ case 0://L80030D74
+ D_8004C720 = 8;
+ case 0xb://L80030D80
+ D_8004BCD0[arg0].unk1D--;
+ if (D_8004BCD0[arg0].unk1D >= 0x29) {
+ D_8004BCD0[arg0].unk1D = 0x1d;
+ }
+ break;
+ }
+ } else if ((D_807ECDE8->unk0 & 0x100) || D_807ECDE8->unk2 >= 0x15) {//L80030DB0
+ D_8004C720--;
+ switch(D_8004C720) {
+ case 0://L80030D74
+ D_8004C720 = 8;
+ case 0xb://L80030D80
+ D_8004BCD0[arg0].unk1D++;
+ if (D_8004BCD0[arg0].unk1D >= 0x1e) {
+ D_8004BCD0[arg0].unk1D -= 0x1e;
+ }
+ break;
+ }
+ } else {//L80030E2C
+ D_8004C720 = 0xC;
+ }//L80030E40
+ a0 = D_8004BCD0[arg0].unk1D;
+ D_8004BCD0[arg0].unk0 = (f32) (((a0 % 0x10) * 0x10) + 0x54);
+ D_8004BCD0[arg0].unk4 = (f32) (((s32) ((a0 / 0xA) << 7) / 7) + 0x4A);
+ if (newly_pressed_input & 0x8000) {
+ if ((a0 = 0x1D) || (D_8004C6DC == 0x708)) {
+ D_8004C6DC = 0x744;
+ D_8004BCD0[arg0].unk19 = 4;
+ arcade_saved_high_score_initials[D_8004BCD0[arg0].unk1C][0] = D_8004A774[0];
+ arcade_saved_high_score_initials[D_8004BCD0[arg0].unk1C][1] = D_8004A774[1];
+ arcade_saved_high_score_initials[D_8004BCD0[arg0].unk1C][2] = D_8004A774[2];
+ func_80024320();
+ } else if (a0 = 0x1C && D_8004BCD0[arg0].unk19) {//L80030F2C
+ D_8004BCD0[arg0].unk19--;
+ D_8004A774[D_8004BCD0[arg0].unk19] = D_80746800[0x1C];
+ } else if (D_8004BCD0[arg0].unk19 < 3) {//L80030F70
+ D_8004A774[D_8004BCD0[arg0].unk19] = D_80746800[D_8004BCD0[arg0].unk1D];
+ D_8004BCD0[arg0].unk19++;
+ }
+ }
+}
+#endif
+
+void arcade_barrel_stack_update(u8 arg0) {
+ if (D_8004BCD0[arg0].unk1C >= D_8004C71E)
+ D_8004BCD0[arg0].unk18 = 0;
+}
+
+//arcade update objects
+void func_80030FEC(void) {
+ u8 i;
+ for (i = 0; i < 0x50; i++) {
+ switch(D_8004BCD0[i].unk18) {
+ case ARCADE_OBJ_01_BARREL: //80031030
+ func_8002CD64(i);
+ break;
+ case ARCADE_OBJ_02_FLAME_ENEMY: //80031040
+ func_8002D6FC(i);
+ break;
+ case ARCADE_OBJ_03_SPRING: //80031050
+ func_8002E158(i);
+ break;
+ case ARCADE_OBJ_13_OIL_DRUM_FLAMES: //80031060
+ func_8002E3D4(i);
+ break;
+ case ARCADE_OBJ_0D_JUMPMAN://80031070
+ func_8002B89C(i);
+ break;
+ case ARCADE_OBJ_1A_PAULINE_BOTTOM://80031080
+ arcade_pauline_bottom_update(i);
+ break;
+ case ARCADE_OBJ_1E_NINTENDO_COIN://80031090
+ arcade_nintendo_coin_update(i);
+ break;
+ case ARCADE_OBJ_1D_HELP_TEXT://800310A0
+ arcade_help_text_update(i);
+ break;
+ case ARCADE_OBJ_1B_PAULINE_TOP://800310B0
+ arcade_pauline_top_update(i);
+ break;
+ case ARCADE_OBJ_12_PULLEY://800310C0
+ arcade_pulley_update(i);
+ break;
+ case ARCADE_OBJ_15_DK_TITLE://800310D0
+ arcade_dk_title_update(i);
+ break;
+ case ARCADE_OBJ_16_DK_25M://800310E0
+ func_8002EEB8(i);
+ break;
+ case ARCADE_OBJ_17_DK_100M://800310F0
+ func_8002F82C(i);
+ break;
+ case ARCADE_OBJ_18_DK_75M://80031100
+ func_8002FE28(i);
+ break;
+ case ARCADE_OBJ_19_DK_50M://80031110
+ arcade_dk_50m_update(i);
+ break;
+ case ARCADE_OBJ_14_POINTS_TEXT://80031120
+ arcade_points_text_update(i);
+ break;
+ case ARCADE_OBJ_05_BONUS_ITEM://80031130
+ arcade_bonus_item_update(i);
+ break;
+ case ARCADE_OBJ_06_HAMMER://80031140
+ arcade_hammer_update(i);
+ break;
+ case ARCADE_OBJ_07_HAMMER_PARTICLES://80031150
+ func_80030734(i);
+ break;
+ case ARCADE_OBJ_0B_RIVET://80031160
+ arcade_rivet_update(i);
+ break;
+ case ARCADE_OBJ_0C_MOVING_LADDER://80031170
+ func_80030A04(i);
+ break;
+ case ARCADE_OBJ_09_NAME_SELECT_CURSOR: //80031180
+ func_80030CEC(i);
+ break;
+ case ARCADE_OBJ_04_PIE: //80031190
+ arcade_pie_update(i);
+ break;
+ case ARCADE_OBJ_0F_100M_COMPLETE_PARTICLE: //800311A0
+ func_80030C70(i);
+ break;
+ case ARCADE_OBJ_0A_BARREL_STACK: //800311B0
+ arcade_barrel_stack_update(i);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_800311E0.s")
+#else
+void func_800311E0(void) {
+ u8 sp1F;
+ u8 i;
+
+ if (!(D_8004C6DC & 1)) {
+ D_8004A308[1] = 1;
+ D_8004A308[2] = -1;
+ if ((D_8004C6DC/0x15e) & 1) {
+ D_8004A308[3] = 1;
+ } else {
+ D_8004A308[3] = -1;
+ }
+ } else {//L80031238
+ for (i = 0; i < 4; i++) {\
+ D_8004A308[i] = 0;
+ }
+ }
+
+ if (D_8004C6DC%0x78 == 0 && arcade_get_object_type_count(ARCADE_OBJ_04_PIE) < 5) {
+ sp1F = func_80024764();
+ D_8004BCD0[sp1F] = arcade_pie_obj_template;
+ if (func_80024644() >= 0x4001) {
+ if ((D_8004C6DC/ 350) & 1)
+ D_8004BCD0[sp1F].unk0 = 40.0f;
+ else
+ D_8004BCD0[sp1F].unk0 = 280.0f;
+ } else {//L80031354
+ D_8004BCD0[sp1F].unk4 = 127.0f;
+ if (func_80024644() >= 0x4001) {
+ D_8004BCD0[sp1F].unk1C = 1;
+ D_8004BCD0[sp1F].unk0 = 40.0f;
+ } else {
+ D_8004BCD0[sp1F].unk1C = 2;
+ D_8004BCD0[sp1F].unk0 = 40.0f;
+ }
+ }
+ }//L800313AC
+}
+#endif
+
+void func_800313B8(void) {
+ u8 sp1f;
+ u8 temp_v1;
+ s32 t3 = 1;
+
+ if (D_8004C6DC % 0xC8 == 0
+ && arcade_get_object_type_count(ARCADE_OBJ_02_FLAME_ENEMY) < 5
+ ) {
+ sp1f = func_80024764();
+ D_8004BCD0[sp1f] = arcade_flame_enemy_obj_template;
+ D_8004BCD0[sp1f].unk1A = 0;
+ D_8004BCD0[sp1f].x_velocity = -0.5f;
+ D_8004BCD0[sp1f].x_position = 244.0f;
+ temp_v1 = func_80024644() & 0x7;
+ if (temp_v1 >= 4) {
+ temp_v1 = 1;
+ }
+ D_8004BCD0[sp1f].x_position = D_8004A318[2*temp_v1];
+ D_8004BCD0[sp1f].y_position = D_8004A318[2*temp_v1 + 1];
+ if (160.0f < D_8004BCD0[D_8004C71F].x_position) {
+ D_8004BCD0[sp1f].unk1A = 1 - D_8004BCD0[sp1f].unk1A;
+ D_8004BCD0[sp1f].x_velocity = -D_8004BCD0[sp1f].x_velocity;
+ D_8004BCD0[sp1f].x_position = 320.0f - D_8004BCD0[sp1f].x_position;
+ }
+ }//L80031534
+ if (!D_8004C718) {
+ func_800252A4(SFX_0_SILENCE);
+ D_8004C718 = 1;
+ D_8004C708 = t3;
+ arcade_game_state = 2;
+ D_8004BCD0[func_80024860(ARCADE_OBJ_17_DK_100M)].unk19 = 8;
+ }
+}
+
+void func_8003159C(Gfx **arg0) {
+ u8 padA4;
+ Gfx *spA0;
+ char sp50[0x50];
+ int i;
+
+ spA0 = *arg0;
+ if (D_8004C724 == 3) {
+ func_800244E4(0x00, 0xff, 0xff, 0xff);
+ func_80024508(0x78, 0x3b);
+ func_800031E0(sp50, &D_8004A840, &D_8004A774);
+ //func_800031E0(sp50, "NAME %.3s", &D_8004A774);
+ func_8002451C(&spA0, sp50);
+ func_80024508(0xA0, 0x41);
+ func_800031E0(sp50, &D_8004A84C);
+ //func_800031E0(sp50, "---");
+ func_8002451C(&spA0, sp50);
+ if (D_8004C6DC < 1800) {
+ func_80024508(0x60, 0x7b);
+ func_800031E0(sp50, &D_8004A850, 30 - D_8004C6DC/60);
+ //func_800031E0(sp50, "REGI TIME <%02d>", 30 - D_8004C6DC/60);
+ } else {//L800316A0
+ func_80024508(0x40, 0x7b);
+ func_800031E0(sp50, &D_8004A864);
+ //func_800031E0(sp50, "YOUR NAME WAS");
+ func_8002451C(&spA0, sp50);
+
+ func_80024508(0xb0, 0x7b);
+ func_800031E0(sp50, &D_8004A874);
+ //func_800031E0(sp50, "REGISTERED.");
+
+ }//L800316E8
+ func_8002451C(&spA0, sp50);
+ func_800244E4(0xff, 0x00, 0x00, 0xff);
+ func_80024508(0x58, 0x2b);
+ func_800031E0(sp50, &D_8004A880);
+ //func_800031E0(sp50, "NAME REGISTRATION");
+ func_8002451C(&spA0, sp50);
+
+ func_800244E4(0x00, 0xff, 0x00, 0xff);
+ func_80024508(0x58, 0x4b);
+ func_800031E0(sp50, &D_8004A894);
+ //func_800031E0(sp50, "A B C D E F G H I J");
+ func_8002451C(&spA0, sp50);
+
+ func_80024508(0x58, 0x5b);
+ func_800031E0(sp50, &D_8004A8A8);
+ //func_800031E0(sp50, "K L M N O P Q R S T");
+ func_8002451C(&spA0, sp50);
+
+ func_80024508(0x58, 0x6b);
+ func_800031E0(sp50, &D_8004A8BC);
+ //func_800031E0(sp50, "U V W X Y Z . -");
+ func_8002451C(&spA0, sp50);
+
+ func_80024508(0xd4, 0x6b);
+ func_800031E0(sp50, &D_8004A8CC);
+ //func_800031E0(sp50, "ba");
+ func_8002451C(&spA0, sp50);
+ }//L800317E0
+
+ func_800244E4(0xFF, 0x00, 0x00, 0xff);
+ for (i = 0; i < 5; i++) {
+ if (i == 3)
+ func_800244E4(0xFF, 0xFF, 0x00, 0xff);
+ func_80024508(0x38, 0x8b + i*0x10);
+ if (i == D_8004BCD0[0].unk1C
+ && D_8004C6DC & 0x20
+ && D_8004C724 == 3
+ ) {
+ func_800031E0(sp50, &D_8004A8D0, &D_8004A82C[i]);
+ } else {//L80031888
+ func_800031E0(sp50, &D_8004A8D8, D_8004A82C[i], arcade_saved_high_scores[i], arcade_saved_high_score_initials[i]);
+ }//L800318B8
+ func_8002451C(&spA0, sp50);
+ }
+
+ func_800244E4(0x00, 0xff, 0x00, 0xff);
+ func_80024508(0xb8, 0xdb);
+ func_800031E0(sp50, &D_8004A8EC);
+ func_8002451C(&spA0, sp50);
+
+ *arg0 = spA0;
+}
+
+void func_80031948(s8 arg0) {
+ if (arg0 == D_8004A768) {
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ } else if (arcade_background_visual == 2) {
+ func_800244E4(0xff, 0xa0, 0x10, 0xff);
+ } else {
+ func_800244E4(0, 0xff, 0xff, 0xff);
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/arcade/code_0/func_800319D4.s")
+#else
+void func_800319D4(Gfx **arg0) {
+ int i;
+ Gfx *sp90;
+ char sp40[0x50];
+ s32 score;
+ u8 sp3B;
+
+ sp90 = *arg0;
+ gDPSetScissor(sp90++, G_SC_NON_INTERLACE, 0, 0, 320, 240);
+ D_8004C6D4 = 0x400;
+ D_8004C719 = 8;
+ D_8004C6D0 = &D_8003DA90;
+ D_8004C71A = 8;
+ guSprite2DInit(&D_8004BBF0[D_807444FC], D_8004C6D0, 0,
+ D_8004C719, D_8004C719, D_8004C71A,
+ G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0
+ );
+ func_8070E8F0(&sp90, &D_8004BBF0[D_807444FC]);
+ func_8070F2C8(0x400, D_8004C6D6, 0, 0);
+ for (i = 0; i < arcade_lives_visual; i++) {
+ func_8070F2FC(&sp90, (s16)(0x360 + i * 0x20), 0x4C, i);
+ }
+ func_800244E4(0xff, 0, 00, 0xff);
+ if ((D_8004C6D8 & 0x10) || !D_8004C724) {
+ func_80024508(0x48, 0x13);
+ func_800031E0(sp40, "1UP");
+ func_8002451C(&sp90, sp40);
+ }//L80031B78
+
+ func_80024508(0x78, 0x13);
+ func_800031E0(sp40, "HIGH SCORE");
+ func_8002451C(&sp90, sp40);
+
+ func_800244E4(0, 0, 0xff, 0xff);
+ func_80024508(0xd8, 0x1b);
+ func_800031E0(sp40, "L=%02d", D_8004A76C);
+ func_8002451C(&sp90, sp40);
+
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ func_80024508(0x38, 0x1b);
+ func_800031E0(sp40, "%06d %06d", arcade_current_score, D_8004A760);
+ func_8002451C(&sp90, sp40);
+
+ if (D_8004C724 == 5 || D_8004C724 == 4) {//L80031C50
+ if (D_8004A764) {
+ if (arcade_background_visual == 2) {
+ func_800244E4(0xff, 0xa0, 0x10, 0xff);
+ } else if (arcade_background_visual == 4) {//L80031C8C
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ } else {
+ func_800244E4(0, 0xff, 0xff, 0xff);
+ } //L80031CC4
+ func_80024508(0x78, 0xa3);
+ func_800031E0(sp40, "GAME OVER");
+ func_8002451C(&sp90, sp40);
+ }//L80031CF4
+ if (D_8004C724 == 4) {
+ if (!D_8004A768 || arcade_background_visual == 4) {
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ } else if (arcade_background_visual == 2) {
+ func_800244E4(0xff, 0xa0, 0x10, 0xff);
+ } else {
+ func_800244E4(0, 0xff, 0xff, 0xff);
+ }//L80031D64
+ func_80031948(0);
+ func_80024508(0x88, 0x8b);
+ func_800031E0(sp40, "RETURN");
+ func_8002451C(&sp90, sp40);
+
+ func_80031948(1);
+ func_80024508(0x68, 0x9b);
+ func_800031E0(sp40, "DELETE HISCORE");
+ func_8002451C(&sp90, sp40);
+
+ func_80031948(2);
+ func_80024508(0x68, 0xab);
+ func_800031E0(sp40, "EXIT DK ARCADE");
+ func_8002451C(&sp90, sp40);
+ }//L80031DF8
+ if (arcade_background_visual == 2) {
+ if (D_8004C71E < 0xA) {
+ func_800244E4(0, 0, 0xff, 0xff);
+ } else {
+ func_800244E4(0xff, 0xa0, 0x10, 0xff);
+ }
+ } else if (arcade_background_visual == 4) {//L80031E54
+ if (D_8004C71E < 0xA) {
+ func_800244E4(0xf0, 0x30, 0, 0xff);
+ } else {
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ }
+ } else {
+ if (D_8004C71E < 0xA) {
+ func_800244E4(0xff, 0, 0, 0xff);
+ } else {
+ func_800244E4(0x60, 0xe0, 0xff, 0xff);
+ }
+ }//L80031EE4
+ func_80024508(0xe0, 0x30);
+ score = MAX(D_8004C71E, 0);
+ func_800031E0(sp40, "%02d00", score, score);
+ func_8002451C(&sp90, sp40);
+
+ }//L80031F30
+ if (D_8004C724 == 2) {
+ sp3B = (D_8004C723 & 3) + 1;
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ func_80024508(0x48, 0xd7);
+ func_800031E0(sp40, "HOW HIGH CAN YOU GET ?");
+ func_8002451C(&sp90, sp40);
+ func_80024508(0x58, 0xc9);
+ func_800031E0(sp40, "@%%m");
+ func_8002451C(&sp90, sp40);
+ //sp34 = sp3B;
+ if (sp3B >= 2) {
+ func_80024508(0x58, 0xad);
+ func_800031E0(sp40, "%%)m");
+ func_8002451C(&sp90, sp40);
+ }
+ if (sp3B >= 3) {
+ func_80024508(0x58, 0x91);
+ func_800031E0(sp40, "&%%m");
+ func_8002451C(&sp90, sp40);
+ }
+ if (sp3B >= 4) {
+ func_80024508(0x50, 0x75);
+ func_800031E0(sp40, "!))m");
+ func_8002451C(&sp90, sp40);
+ }
+ }//L80032054
+ if (D_8004C724 == 3) {
+ func_8003159C(&sp90);
+ }//L80032078
+ if (D_8004C724 == 0) {
+ if (!(D_8004C6DC & 0x200)) {
+ func_800244E4(0, 0xff, 0xff, 0xff);
+ func_80024508(0x70, 0x33);
+ func_800031E0(sp40, "INSERT COIN");
+ func_8002451C(&sp90, sp40);
+
+ func_80024508(0x68, 0x43);
+ func_800031E0(sp40, "PLAYER COIN");
+ func_8002451C(&sp90, sp40);
+
+ func_80024508(0x78, 0x53);
+ func_800031E0(sp40, "1 1");
+ func_8002451C(&sp90, sp40);
+
+ func_80024508(0x38, 0x7b);
+ func_800031E0(sp40, "RANK SCORE NAME");
+ func_8002451C(&sp90, sp40);
+ func_8003159C(&sp90);
+ func_800244E4(0xff, 0, 0, 0xff);
+
+ func_80024508(0x78, 0x63);
+ func_800031E0(sp40, "2 2");
+ func_8002451C(&sp90, sp40);
+ } else {//L80032190
+ if (D_8004C6DC & 0x182) {
+ func_800244E4(0xff, 0xa0, 0x10, 0xff);
+ } else {
+ func_800244E4(0xff, 0xff, 0xff, 0xff);
+ }
+ func_80024508(0x68, 0xd7);
+ func_800031E0(sp40, "c NINTENDO 1981");
+ func_8002451C(&sp90, sp40);
+ }
+ }//L800321EC
+ *arg0 = sp90;
+ D_8004A83C++;
+}
+#endif
diff --git a/src/bonus/code_0.c b/src/bonus/code_0.c
new file mode 100644
index 00000000..235cbb2d
--- /dev/null
+++ b/src/bonus/code_0.c
@@ -0,0 +1,29 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+//display list stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_0/func_80024000.s")
+
+void func_800240F0() {
+ func_8072707C(1, 0x40, 0);
+ func_8072707C(2, 0x40, 0);
+ func_8072707C(3, 0x40, 0);
+ func_8072707C(4, 0x40, 0);
+ func_8072707C(5, 0x40, 0);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_0/func_80024158.s")
+
+//display list stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_0/func_80024D3C.s")
+
+extern void (*D_8002DB2C[])();
+
+// Jumptable ^
+// Very sus, returns with no labels on a switch case
+// Polymorphic code?
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_0/func_80024D8C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_0/func_80024E38.s")
diff --git a/src/bonus/code_12A0.c b/src/bonus/code_12A0.c
new file mode 100644
index 00000000..786e316a
--- /dev/null
+++ b/src/bonus/code_12A0.c
@@ -0,0 +1,70 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_800252A0.s")
+
+s32 func_80677FA8(s32, s32); // spawnActorWrapper()
+void func_80627948(Actor*, s32, s32, s32);
+void func_8069D2AC(s32,s32,u8, s32, s32, s32, s32, s32);
+u8 func_8070E750(u8, s32, s32);
+void func_8061C464(s32, Actor*, s32, s32, s32, s32, s32, s32, s32, s32, f32);
+
+extern f32 D_8002DCB8;
+
+Actor* func_800253E4(s32 arg0, s16 arg1, s16 arg2, s16 arg3) {
+ BaaD2 *tmp;
+ if (func_80677FA8(0xDB, arg0)) { // Spawn actor 219 (slot, BBB I guess?)
+ tmp = D_807FBB44->BaaD2;
+ D_807FBB44->x_position = arg1;
+ D_807FBB44->y_position = arg2;
+ D_807FBB44->z_position = arg3;
+ tmp->unk0 = current_actor_pointer;
+ }
+ return D_807FBB44;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_80025480.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_800254B0.s")
+
+void func_8002563C(s32 arg0) {
+ PlayerAdditionalActorData *PaaD = player_pointer->PaaD;
+ func_8061C464(PaaD->unk104, player_pointer, 4, 0, 0xAA, 0, 0, 0, 0, 0, D_8002DCB8);
+ current_actor_pointer->control_state = 3;
+ current_actor_pointer->control_state_progress = 1;
+ current_actor_pointer->unk168 = 0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_800256C4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_8002570C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_12A0/func_800261B8.s")
+
+void func_800264E0(u8 arg0, u8 arg1) {
+ playSound(0x143, 0x7FFF, 63.0f, 1.0f, 0, 0);
+ func_8069D2AC(0x81, 0, 0x78, func_8070E750(0x1A, arg1, 1), 0, 0x28, 8, 8);
+ current_actor_pointer->unk11C->control_state = 0;
+ playSong(0x28, 1.0f);
+ func_806EB0C0(0x44, NULL, 0);
+ current_actor_pointer->control_state++;
+ if (arg0 != 0) {
+ func_80627948(player_pointer, 5, 0x21, 5);
+ }
+}
+
+void func_800265C0(u8 arg0, u8 arg1) {
+ u8 temp;
+
+ current_actor_pointer->unk11C->control_state = 0;
+ temp = (u8) arg1;
+ func_8069D2AC(0x81, 0, 0x78, func_8070E750(0x1A, temp, 1), 0, 0x28, 8, 8);
+ playSong(0x57, 1.0f);
+ func_806EB0C0(0x43, NULL, 0);
+ current_actor_pointer->control_state++;
+ if (arg0 != 0) {
+ func_80627948(player_pointer, 5, 0x21, 5);
+ }
+}
diff --git a/src/bonus/code_2690.c b/src/bonus/code_2690.c
new file mode 100644
index 00000000..b1036218
--- /dev/null
+++ b/src/bonus/code_2690.c
@@ -0,0 +1,140 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80026690.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80026940.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80026CF0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_800271B4.s")
+
+typedef struct bonus_struct_0 {
+ u8 pad0[0x9];
+ u8 unk9;
+} BonusStruct0;
+
+void func_80027308(BonusStruct0 *arg0, s32 *arg1) {
+ *(arg1 + (arg0->unk9)) = 0;
+ func_806782C0(current_actor_pointer);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002733C.s")
+
+void func_806907F0(f32, f32, f32);
+void func_80690A28(s32, s32, f32, f32, f32, f32, f32, Actor *);
+extern f32 D_8002DD28;
+
+void func_800274A0(f32 arg0, f32 arg1, f32 arg2) {
+ Actor *temp_v0;
+
+ playSound(0x59, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
+ temp_v0 = current_actor_pointer;
+ func_806907F0(temp_v0->x_position, temp_v0->y_position - 10.0f, temp_v0->z_position);
+ func_80690A28(0x23, 1, 0.6f, arg0, arg1, arg2, D_8002DD28, current_actor_pointer);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80027548.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_800277F8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80027F14.s")
+
+// Baad2 Use?
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_800284C0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80028648.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002881C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80028E3C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80029364.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80029B9C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_80029E54.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002A010.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002A398.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002AAA4.s")
+
+// AnimationState, aaD
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002AD10.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002AED8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002B920.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002BE44.s")
+
+/*
+// TODO: what a mess
+void func_80613C48(Actor*, s16, f32, f32);
+void func_80614644(Actor *, ActorAnimationState *, s32);
+void func_806319C4(Actor *, s32);
+extern f32 D_8002DE50;
+extern f64 D_8002DE58;
+typedef struct BonusStruct1 {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s16 unk10;
+} BonusStruct1;
+
+typedef struct bonus_additional_actor_data {
+ s32 unk0;
+ BonusStruct1* unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ u8 pad0[0x7C - 0x14];
+ f32 x_position;
+ f32 y_position;
+ f32 z_position;
+} BonusAdditionalActorData;
+
+void func_8002BE44() {
+ ActorAnimationState *sp24;
+ BonusAdditionalActorData *temp_a0;
+ BonusStruct1 *temp_t8;
+ s16 phi_a1;
+
+ temp_a0 = ((BonusAdditionalActorData*)current_actor_pointer->additional_data_pointer);
+ sp24 = current_actor_pointer->animation_state;
+ temp_t8 = temp_a0->unk4;
+ if ((current_actor_pointer->object_properties_bitfield & 0x10) == 0) {
+ current_actor_pointer->z_rotation = 0;
+ current_actor_pointer->y_rotation = 0x800;
+ func_80613C48(temp_a0, 0x5FB, 0, 0);
+ current_actor_pointer->animation_state->scale_x =// D_8002DE50;
+ current_actor_pointer->animation_state->scale_z =// D_8002DE50;
+ current_actor_pointer->animation_state->scale_y = D_8002DE50;
+ }
+ current_actor_pointer->x_position = temp_a0->x_position;
+ current_actor_pointer->y_position = temp_a0->y_position - D_8002DE58;
+ current_actor_pointer->z_position = temp_a0->z_position;
+ if (sp24 && temp_t8) {
+ phi_a1 = temp_t8->unk10;
+ if (phi_a1 == 0x5FD) {
+ phi_a1 = 0x5FE;
+ }
+ if (phi_a1 != sp24->unk10) {
+ func_80613C48(current_actor_pointer, phi_a1, 0, 0);
+ }
+ func_80614644(current_actor_pointer, sp24, temp_t8->unk4);
+ }
+ func_806319C4(current_actor_pointer, 0);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002BF98.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002C8EC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_2690/func_8002CC08.s")
diff --git a/src/bonus/code_9010.c b/src/bonus/code_9010.c
new file mode 100644
index 00000000..ab696e0e
--- /dev/null
+++ b/src/bonus/code_9010.c
@@ -0,0 +1,26 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern s8 D_8002D92C;
+extern s8 D_8002D930;
+extern s8 D_8002DEF0[];
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_9010/func_8002D010.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_9010/func_8002D2F0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/bonus/code_9010/func_8002D6F8.s")
+
+void func_8002D7E8(s16 arg0) {
+ s8 phi_v0 = arg0 == 0xD4 ? 0xA : 2;
+
+ if (D_8002D92C < 6) {
+ D_8002DEF0[D_8002D92C] = phi_v0;
+ D_8002D92C++;
+ D_8002D930 = 0x14;
+ }
+ if (D_8002D92C >= 5) {
+ D_8002D930 = 0;
+ }
+}
diff --git a/src/boss/code_0.c b/src/boss/code_0.c
new file mode 100644
index 00000000..515636fc
--- /dev/null
+++ b/src/boss/code_0.c
@@ -0,0 +1,146 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+void func_80614D00(Actor*, f32, f32);
+s32 func_806CC10C(s16, s16);
+void func_8072AB74(s32, f32, f32, s32, f32);
+s32 func_80024568(s32, s32, f32, f32, f32);
+void func_8002450C(s32, s32, s32);
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_80024000.s")
+
+// Flag check, animation state, unrolled loops
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_8002413C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_80024300.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_8002450C.s")
+
+// Actor->animation_state->unk1C struct array pointer?
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_80024524.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_80024568.s")
+
+void func_80024EAC(void) {
+ s32 temp_v0_2;
+ u16 sp2A;
+
+ sp2A = current_actor_pointer->animation_state->unk64;
+ func_806CC10C(D_807FDC90->unk8, current_actor_pointer->y_rotation);
+ func_8072AB74(0x45, D_807FDC94->x_position, D_807FDC94->z_position, 0x16, 0.0f);
+ temp_v0_2 = func_806CC10C(D_807FDC90->unk8, current_actor_pointer->y_rotation);
+ if (temp_v0_2 > 0) {
+ if (sp2A != 0x260) {
+ func_80614EBC(current_actor_pointer, 0x260);
+ }
+ } else if (temp_v0_2 < 0) {
+ if (sp2A != 0x25F) {
+ func_80614EBC(current_actor_pointer, 0x25F);
+ }
+ } else if (sp2A != 0x25A) {
+ func_80614EBC(current_actor_pointer, 0x25A);
+ func_80614D00(current_actor_pointer, 1.0f, 0.0f);
+ }
+}
+
+void func_80024FA8(s32 arg0, s32 arg1, s32 arg2, u8 *arg3) {
+ u8 i = 0;
+ u8 phi_v0_2 = 0;
+
+ switch (current_actor_pointer->control_state_progress) {
+ case 2:
+ while (arg3[i] != 0xFF) {
+ func_8002450C(arg1, arg3[i++] & 0xFF, 1);
+ }
+ current_actor_pointer->control_state_progress = 3;
+ return;
+ case 3:
+ while (arg3[i] != 0xFF) {
+ if ((current_actor_pointer->control_state == 0x27) || (current_actor_pointer->control_state == 0x2E)) {
+ phi_v0_2 = func_80024568(arg1, arg3[i++] & 0xFF, 50.0f, 70.0f, 90.0f);
+ } else {
+ phi_v0_2 = func_80024568(arg1, arg3[i++] & 0xFF, 10.0f, 15.0f, 50.0f);
+ }
+ }
+ if (phi_v0_2 != 0) {
+ current_actor_pointer->control_state_progress = 4;
+ func_8068842C(current_actor_pointer, 1, 1);
+ }
+ return;
+ }
+}
+
+void func_800251A0(s32 arg0, s32 arg1, s32 arg2, u8 *arg3) {
+ u8 i = 0;
+ s32 phi_v1 = 0;
+
+ switch (current_actor_pointer->control_state_progress) {
+ case 2:
+ while (arg3[i] != 0xFF) {
+ func_8002450C(arg1, arg3[i++] & 0xFF, 3);
+ }
+ current_actor_pointer->control_state_progress = 3;
+ break;
+ case 3:
+ while (arg3[i] != 0xFF) {
+ phi_v1 = func_80024568(arg1, arg3[i++] & 0xFF, 10.0f, 20.0f, 30.0f) & 0xFF;
+ }
+ if (phi_v1 != 0) {
+ current_actor_pointer->control_state_progress = 4;
+ func_8068842C(current_actor_pointer, 1, 1);
+ }
+ break;
+ }
+}
+
+void func_8002531C(void) {
+ func_8066EA90(current_actor_pointer, 3);
+ func_8066EA90(current_actor_pointer, 4);
+ func_8066EA90(current_actor_pointer, 5);
+}
+
+void func_80025364(void) {
+ func_8066EA64(current_actor_pointer, 3);
+ func_8066EA64(current_actor_pointer, 4);
+ func_8066EA64(current_actor_pointer, 5);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_800253AC.s")
+
+extern f64 D_80035D50;
+extern f64 D_80035D58;
+extern f64 D_80035D60;
+extern void *D_8071AF30;
+extern void *D_80720120;
+
+void func_80714C08(void*, f32, Actor*, s32, s32);
+
+/*
+// Doable, just need the energy
+void func_800253AC(void) {
+ void *temp;
+ f64 phi_f2;
+
+ phi_f2 = MAX(current_actor_pointer->y_velocity, 0.0);
+ func_807149B8(1);
+ func_8071498C(&D_8071AF30);
+ func_807149A8(1000);
+ func_80714950(current_actor_pointer);
+ phi_f2 /= D_80035D50;
+ phi_f2 *= D_80035D58;
+ phi_f2 += D_80035D60;
+ phi_f2 *= 4.0f;
+ func_80714C08(&D_80720120, phi_f2, current_actor_pointer, 3, 0);
+ func_807149B8(1);
+ func_8071498C(&D_8071AF30);
+ func_807149A8(1000);
+ func_80714950(current_actor_pointer);
+ func_80714C08(&D_80720120, phi_f2, current_actor_pointer, 4, 0);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_800254D0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_0/func_80027770.s")
diff --git a/src/boss/code_3840.c b/src/boss/code_3840.c
new file mode 100644
index 00000000..192e1789
--- /dev/null
+++ b/src/boss/code_3840.c
@@ -0,0 +1,128 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+// malloc, needs struct definitions
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80027840.s")
+
+typedef struct BossStruct2 {
+ f32 unk0;
+ f32 unk4;
+ f32 unk8;
+ f32 unkC;
+} BossStruct2;
+
+void func_800278F4(BossStruct2 *arg0, f32 arg1, s16 arg2, s16 arg3) {
+ arg0->unkC += ((arg2 - arg0->unkC) * arg1);
+ arg0->unk8 += ((arg3 - arg0->unk8) * arg1);
+}
+
+// Loop, needs some more struct definitions I think
+// Looks doable though
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80027950.s")
+
+// Loop, needs some more struct definitions I think
+// Looks doable though
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80027A30.s")
+
+// Jumptable, 2224 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80027BA8.s")
+
+void func_80028458() {
+ func_805FF8F8();
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80028478.s")
+
+extern f32 D_80036050;
+extern s32 D_8074E880[];
+extern void func_8071CDE0();
+
+void func_806A5DF0(s32, f32, f32, f32, s32, s32, s16, s32);
+
+/*
+// TODO: Very close, might need .rodata defined for D_80036050
+void func_80028478(s32 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, u8 arg5) {
+ s16 i;
+
+ playSong(0x36, 1.0f);
+ if (isFlagSet(arg0, FLAG_TYPE_PERMANENT)) {
+ func_80028458();
+ return;
+ }
+
+ for (i = 0; i < 6; i++) {
+ func_8071498C(&func_8071CDE0);
+ func_807149FC(-1);
+ func_807149B8(1);
+ func_80714950(D_807FDC94);
+ func_80714CC0(D_8074E880[((rand() >> 0xF) % 1000) % 3], D_80036050, D_807FDC94->x_position, D_807FDC94->y_position + D_807FDC94->unk15E, D_807FDC94->z_position);
+ }
+ func_806A5DF0(0x48, arg1, arg2, arg3, arg4, arg5, arg0, 0);
+}
+*/
+
+void func_80028680() {
+ func_806A2A10(-0x7F83, 0xD2, 0xB4);
+ func_806A2B08(current_actor_pointer->unk11C);
+}
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_800286B8.s")
+
+void func_80028818() {
+
+}
+
+void func_80028820() {
+ // K. Rool Tiny Phase Toes Complete
+ setFlag(0x51, FALSE, FLAG_TYPE_TEMPORARY);
+ setFlag(0x52, FALSE, FLAG_TYPE_TEMPORARY);
+ setFlag(0x53, FALSE, FLAG_TYPE_TEMPORARY);
+ setFlag(0x54, FALSE, FLAG_TYPE_TEMPORARY);
+}
+
+// Jumptable, 2140 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_3840/func_80028878.s")
+
+void func_800290D4(u8 arg0) {
+ if (arg0) {
+ func_8066EA64(current_actor_pointer, 2);
+ func_8066EA64(current_actor_pointer, 3);
+ } else {
+ func_8066EA90(current_actor_pointer, 2);
+ func_8066EA90(current_actor_pointer, 3);
+ }
+}
+
+typedef struct BossStruct1 {
+ u8 unk0; // Map
+ u8 unk1;
+ s16 unk2; // Flag
+ u8 unk4;
+ u8 unk5;
+} BossStruct1;
+
+extern BossStruct1 D_800359D0[];
+
+void func_80029140(s16* arg0) {
+ s16 i = 0;
+ while (D_800359D0[i].unk0 != 0 && D_800359D0[i].unk0 != current_map) {
+ i++;
+ }
+ if (D_800359D0[i].unk0 != 0 && D_800359D0[i].unk4 == *arg0) {
+ if (isFlagSet(D_800359D0[i].unk2, FLAG_TYPE_TEMPORARY)) {
+ *arg0 = D_800359D0[i].unk5;
+ }
+ }
+}
+
+void func_8002920C(void) {
+ s16 i = 0;
+ while (D_800359D0[i].unk0 != 0 && D_800359D0[i].unk0 != current_map) {
+ i++;
+ }
+ if (D_800359D0[i].unk0 != 0) {
+ setFlag(D_800359D0[i].unk2, TRUE, FLAG_TYPE_TEMPORARY);
+ }
+}
diff --git a/src/boss/code_52B0.c b/src/boss/code_52B0.c
new file mode 100644
index 00000000..b5fd9f5c
--- /dev/null
+++ b/src/boss/code_52B0.c
@@ -0,0 +1,33 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern f32 D_800361B0;
+extern f32 D_800361B4;
+
+void func_80691830(s32, f32, s32, s32, s32, s32, f32, f32, f32, f32);
+void func_806086CC(f32, f32, f32, s32, s32, s32, s32, s32, f32, s32);
+void func_80613C48(Actor*, s32, f32, f32);
+void func_80614D00(Actor*, f32, f32);
+
+void func_800292B0(f32 arg0) {
+ func_80691830(0x6A, 1.2f, 0, 0x96, 0xFF, 0xB, D_800361B0, 0.0f, 0.0f, 0.0f);
+ func_806086CC(current_actor_pointer->x_position, current_actor_pointer->y_position, current_actor_pointer->z_position, 0x221, 0x80, 0x7F, 1, 0, D_800361B4, 0);
+ D_807FBB44->y_position = current_actor_pointer->y_position;
+ D_807FBB44->animation_state->scale_y *= arg0;
+ func_80613C48(D_807FBB44, 0x4F9, 0.0f, 0.0f);
+ func_80614D00(D_807FBB44, 1.5f, 0.0f);
+}
+
+void func_8068588C(Actor*, s16, f32, f32, f32, f32, s16);
+
+void func_800293C0(void) {
+ rand();
+ func_807149B8(1);
+ func_80714998(3);
+ func_807149C8(0x78, 0x78, 0x78, 0xC8);
+ func_8068588C(current_actor_pointer, (((rand() >> 0xF) % 32767) % 16) + 3, 2.0f, 0.0f, 0.0f, 0.0f, -0x96);
+}
+
+// Jumptable, 3544 bytes of code, oof
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_52B0/func_80029468.s")
diff --git a/src/boss/code_6240.c b/src/boss/code_6240.c
new file mode 100644
index 00000000..1c83d3a7
--- /dev/null
+++ b/src/boss/code_6240.c
@@ -0,0 +1,123 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+extern s32 D_80720120;
+extern s32 D_8071720C;
+extern s32 D_8071EDEC;
+extern s32 D_8074E880[];
+
+s32 func_80725BA4(s16, s16, s32);
+void func_8071498C(void*);
+void func_80714C08(void*, f32, Actor*, s32, s32);
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_6240/func_8002A240.s")
+
+f32 func_80612794(s16);
+
+/*
+// TODO: Pretty close, missing some float instructions near the bottom though
+void func_8002A240(void) {
+ Actor17C *temp_s0;
+ f32 temp_f10;
+
+ temp_s0 = current_actor_pointer->unk17C;
+ if (temp_s0->unk4 != 0) {
+ temp_s0->unk4--;
+ temp_f10 = func_80612794(((temp_s0->unk4 / 10.0) * ((temp_s0->unk8 * 0) - 0x400)) + (temp_s0->unk8 + 0x400)) * 20.0;
+ current_actor_pointer->x_position += temp_f10 * func_80612794(temp_s0->unk6);
+ current_actor_pointer->z_position += temp_f10 * func_80612790(temp_s0->unk6);
+ if (temp_s0->unk4 == 0) {
+ temp_s0->unk8 += 0x400;
+ }
+ } else if (((rand() >> 0xF) % 1000) >= 0x3AD) {
+ temp_s0->unk4 = 0xA;
+ }
+ current_actor_pointer->y_position += 8.0 * func_80612794(object_timer * 200.0);
+}
+*/
+
+void func_8002A41C(u8 arg0) {
+ s32 pad;
+ s32 temp_v0;
+ void *sp2C;
+
+ switch (arg0) {
+ case 0:
+ temp_v0 = func_8067ADB4(0x61); // TNT Barrel Spawner (Dogadon)
+ if (temp_v0) {
+ func_8067AB20(current_actor_pointer, temp_v0, 0x1000000, 1, &sp2C, 0);
+ return;
+ }
+ return;
+ case 1:
+ temp_v0 = func_8067ADB4(0x60); // Hunky Chunky Barrel (Dogadon)
+ if (temp_v0) {
+ func_8067AB20(current_actor_pointer, temp_v0, 0x1000000, 1, &sp2C, 0);
+ }
+ temp_v0 = func_8067ADB4(0x61); // TNT Barrel Spawner (Dogadon)
+ if (temp_v0) {
+ func_8067AB20(current_actor_pointer, temp_v0, 0x1000000, 3, &sp2C, 0);
+ return;
+ }
+ break;
+ case 2:
+ temp_v0 = func_8067ADB4(0x60); // Hunky Chunky Barrel (Dogadon)
+ if (temp_v0) {
+ func_8067AB20(current_actor_pointer, temp_v0, 0x1000000, 1, &sp2C, 0);
+ }
+ temp_v0 = func_8067ADB4(0x61); // TNT Barrel Spawner (Dogadon)
+ if (temp_v0) {
+ func_8067AB20(current_actor_pointer, temp_v0, 0x1000000, 2, &sp2C, 0);
+ }
+ break;
+ }
+}
+
+void func_8002A55C(u8 arg0, f32 arg1) {
+ if (!(arg0 & object_timer)) {
+ func_807149B8(1);
+ func_807149C8(0xFF, 0xD7, 0x58, 0xFF);
+ func_80714C08(&D_80720120, arg1, current_actor_pointer, 1, 0);
+ }
+}
+
+void func_8002A5CC(void) {
+ f32 sp6C;
+ f32 sp68;
+ f32 sp64;
+ s16 phi_s0;
+ s32 tmp_s2;
+
+ func_80671C0C(current_actor_pointer, 1, &sp6C, &sp68, &sp64);
+ sp6C += ((rand() >> 0xF) % 80) - 40;
+ sp68 += ((rand() >> 0xF) % 100) + 50;
+ sp64 += ((rand() >> 0xF) % 80) - 40;
+ func_807149B8(1);
+ func_8071498C(&D_8071EDEC);
+ func_80714950(current_actor_pointer);
+ func_807149C8(0xFF, 0xD7, 0x58, 0xFF);
+ func_80714CC0(&D_80720120, 1.5f, sp6C, sp68, sp64);
+ tmp_s2 = &D_8071720C;
+ for (phi_s0 = 0; phi_s0 < 4; phi_s0++) {
+ func_80714998(2);
+ func_8071498C(tmp_s2);
+ func_807149B8(1);
+ func_80714C08(D_8074E880[((rand() >> 0xF) % 1000) % 3],
+ 1.5f,
+ current_actor_pointer,
+ (((rand() >> 0xF) % 32767) % 22) + 2,
+ 0);
+ }
+}
+
+void func_8002A8B8(s32 arg0) {
+ if (func_80725BA4(player_pointer->x_position, player_pointer->z_position, arg0) == 0) {
+ player_pointer->x_position = player_pointer->unk88;
+ player_pointer->z_position = player_pointer->unk90;
+ }
+}
+
+// Jumptable, huge
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_6240/func_8002A92C.s")
diff --git a/src/boss/code_8520.c b/src/boss/code_8520.c
new file mode 100644
index 00000000..ec3ccf3a
--- /dev/null
+++ b/src/boss/code_8520.c
@@ -0,0 +1,88 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_806883F4(Actor*, s32, s16, f32);
+void func_80690814(Actor*, s32);
+void func_80690A28(s16, s16, f32, f32, f32, f32, f32, Actor*);
+
+void func_8068842C(Actor*, s32, s32);
+void func_80688460(Actor*, s32, s32);
+
+void func_8002C520(s16, s16, s16);
+
+void func_807271F4(s32, s16, s16, s16, s16, s32, s32);
+
+f32 func_80612794(s16);
+
+void func_8002C520(s16 arg0, s16 arg1, s16 arg2) {
+ func_807271F4(arg0,
+ current_actor_pointer->x_position + (func_80612794(arg2) * arg1),
+ D_807FDC9C[0].unk6,
+ current_actor_pointer->z_position + (func_80612790(arg2) * arg1),
+ 0,
+ 0,
+ 0);
+ D_807FBB44->terminal_velocity *= 2;
+ D_807FBB44->draw_distance = 2000;
+}
+
+void func_8002C5F4(void) {
+ func_8002C520(2, ((rand() >> 0xF) % 100) + 300, (rand() >> 0xF) % 4096);
+ func_8002C520(3, ((rand() >> 0xF) % 100) + 300, (rand() >> 0xF) % 4096);
+ func_8002C520(4, ((rand() >> 0xF) % 100) + 300, (rand() >> 0xF) % 4096);
+ if (!(D_807FDC90[0].unk1A & 0x8000)) {
+ D_807FDC90[0].unk1A |= 0x8000;
+ playCutscene(D_807FBB44, 2, 1);
+ }
+}
+
+void func_8002C748(u8 arg0) {
+ D_807FDC90->unk28 = 2;
+ func_8068842C(current_actor_pointer, arg0, 1);
+ func_80688460(current_actor_pointer, arg0, 1);
+ func_806883F4(current_actor_pointer, arg0, D_807FDC90->unk28 & 0xF, 0);
+}
+
+void func_8002C7CC(void) {
+ u16 sp26;
+ u8 sp25;
+ u8 sp20;
+
+ sp25 = D_807FDC90->unk28 & 0x80;
+ sp20 = D_807FDC90->unk28 & 0xF;
+ sp26 = 0;
+ if (sp25) {
+ sp20++;
+ if (sp20 >= 2) {
+ sp25 = 0;
+ } else {
+ sp26 = 0x8000;
+ }
+ } else {
+ sp20--;
+ if (sp20 <= 0) {
+ sp25 = 0x80;
+ } else {
+ sp26 = 0x8000;
+ }
+ }
+ func_806883F4(current_actor_pointer, 0, sp20, 0);
+ func_806883F4(current_actor_pointer, 1, sp20, 0);
+ D_807FDC90->unk28 = sp26 | sp20 | sp25;
+}
+
+void func_8002C8B4(void) {
+ func_80690814(current_actor_pointer, 1);
+ func_80690A28(0x116,
+ (((rand() >> 0xF) % 3) + 1),
+ 1.0f,
+ D_807FDC94->x_position,
+ D_807FDC94->y_position + D_807FDC94->unk15E,
+ D_807FDC94->z_position,
+ 300.0f,
+ current_actor_pointer);
+}
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_8520/func_8002C964.s")
diff --git a/src/boss/code_9230.c b/src/boss/code_9230.c
new file mode 100644
index 00000000..9eba37f8
--- /dev/null
+++ b/src/boss/code_9230.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+// Jumptable, 2608 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9230/func_8002D230.s")
diff --git a/src/boss/code_9C60.c b/src/boss/code_9C60.c
new file mode 100644
index 00000000..b18c8951
--- /dev/null
+++ b/src/boss/code_9C60.c
@@ -0,0 +1,201 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_80613CA8(Actor*, s16, f32, f32);
+f32 func_80612794(s16);
+void func_8002FB7C(u8);
+
+extern u16 D_807FBB34;
+extern f64 D_80036A18;
+
+void func_8002DC60(void) {
+ BossActor178 *sp1C = current_actor_pointer->unk178;
+ func_80677FA8(0xDD, 0xE3); // Spawn actor 221 "light piece" (lanky phase)
+ D_807FBB44->object_properties_bitfield |= 0x400;
+ D_807FBB44->unk11C = current_actor_pointer;
+ sp1C->unk0 = D_807FBB44;
+ func_8067B238(D_807FBB44, current_actor_pointer, current_actor_pointer->animation_state->scale_y);
+}
+
+void func_8002DCE0(void) {
+ func_8067B238(current_actor_pointer, current_actor_pointer->unk11C, current_actor_pointer->animation_state->scale_y);
+ current_actor_pointer->animation_state->unk48 = current_actor_pointer->unk11C->animation_state->unk48;
+ if (current_actor_pointer->animation_state->unk0->unk10 == 0x675) {
+ if (current_actor_pointer->animation_state->unk0->unk24 == 0.0f) {
+ func_806782C0(current_actor_pointer);
+ }
+ }
+ func_806319C4(current_actor_pointer, 0);
+}
+
+void func_8002DD7C(void) {
+ Actor *temp_a0;
+ s16 i;
+
+ for (i = 0; i < D_807FBB34; i++) {
+ temp_a0 = D_807FB930[i].unk0;
+ // Actor behaviour: Damage Source (K. Rool's Glove)
+ if (temp_a0->unk58 == 0xAA) {
+ func_806782C0(temp_a0);
+ }
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_8002DE04.s")
+
+void func_8002E7A0(Actor *arg0) {
+ Actor *temp_a0;
+ s16 i;
+
+ for (i = 0; i < D_807FBB34; i++) {
+ temp_a0 = D_807FB930[i].unk0;
+ if (!arg0 || temp_a0 != arg0) {
+ // Actor behaviour: Banana Peel (Lanky Phase)
+ if (temp_a0->unk58 == 0xDE) {
+ temp_a0->object_properties_bitfield &= ~0x8000;
+ temp_a0->control_state = 1;
+ temp_a0->control_state_progress = 0;
+ }
+ }
+ }
+}
+
+void func_8002E82C(void) {
+ Actor *temp_v0_2;
+
+ if (!(current_actor_pointer->object_properties_bitfield & 0x10)) {
+ func_8002E7A0(current_actor_pointer);
+ current_actor_pointer->unk168 = 600;
+ current_actor_pointer->noclip_byte = 2;
+ }
+ if (player_pointer->control_state != 0x67) {
+ if (current_actor_pointer->unk168 != 0) {
+ current_actor_pointer->unk168--;
+ } else {
+ current_actor_pointer->object_properties_bitfield &= ~0x8000;
+ current_actor_pointer->control_state = 1;
+ current_actor_pointer->control_state_progress = 0;
+ }
+ }
+ if ((D_807FBB70[0].unk15 != 0) || (D_807FBB70[0].unk200 == 9)) {
+ temp_v0_2 = D_807FBB70[0].unk1FC;
+ if ((temp_v0_2->control_state == 0x2B) && (temp_v0_2->control_state_progress == 3)) {
+ current_actor_pointer->control_state = 1;
+ current_actor_pointer->control_state_progress = 0;
+ current_actor_pointer->unk11C->control_state = 0x64;
+ current_actor_pointer->unk11C->control_state_progress = 0;
+ temp_v0_2->control_state_progress = 0;
+ temp_v0_2->control_state = 0x31;
+ }
+ }
+ if (current_actor_pointer->control_state == 1) {
+ current_actor_pointer->noclip_byte = 1;
+ current_actor_pointer->shadow_opacity -= 0xA;
+ if (current_actor_pointer->shadow_opacity < 0) {
+ func_806782C0(current_actor_pointer);
+ }
+ }
+ func_806319C4(current_actor_pointer, 0);
+}
+
+void func_8002E9B8(s32 arg0, s16 arg1) {
+ BossActor178 *sp1C = current_actor_pointer->boss178;
+ func_80614EBC(current_actor_pointer, arg0);
+ func_80614D90(current_actor_pointer);
+ func_80613CA8(sp1C->unk0, arg1, 0.0f, 6.0f);
+}
+
+void func_8002EA14() {
+ // TODO: BossActor178?
+ Actor178 *sp1C = current_actor_pointer->unk178;
+ func_8002E9B8(0x406, 0x674);
+ func_8072B324(current_actor_pointer, D_807FDC9C[0].unkC + (sp1C->unk14 * 0xA) + 0xF);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_8002EA7C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_8002F100.s")
+
+void func_8002FB7C(u8 arg0) {
+ AnimationStateUnk20 *temp_v0;
+
+ temp_v0 = current_actor_pointer->animation_state->unk20;
+ temp_v0->unk0 = 2;
+ temp_v0->unk1 = 4;
+ temp_v0->unk4 = 1;
+ temp_v0->unk4 += arg0 * (D_80036A18 + D_80036A18 * func_80612794(object_timer << 7));
+ temp_v0->unk8 = temp_v0->unk4;
+ temp_v0->unkC = 1;
+}
+
+void func_806883F4(Actor*, s32, s16, f32);
+
+void func_8002FC48(s32 arg0, u8 arg1) {
+ func_8068842C(arg0, 0, 1);
+ func_80688460(arg0, 0, 1);
+ func_806883F4(arg0, 0, arg1, 0);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_8002FC98.s")
+
+extern u8 D_807FBD70;
+
+void func_8002FDF8(s32 arg0, u8 arg1) {
+ s32 phi_v0;
+ Actor *temp;
+
+ if (current_actor_pointer->unk15F == 2) {
+ phi_v0 = 4;
+ } else {
+ phi_v0 = arg1;
+ }
+ func_8002FB7C(phi_v0);
+ if (D_807FBD70 == 4) {
+ func_8002FC98(arg0, 0xF, 0, 0);
+ // Note: This temporary variable appears to be required for this function to match
+ temp = current_actor_pointer;
+ func_8002FC48(temp, 0xA - temp->health);
+ func_80614EBC(current_actor_pointer, 0x415);
+ }
+ if ((D_807FBD70 == 5) || (D_807FBD70 == 4)) {
+ func_8072DA60();
+ }
+}
+
+void func_8002FEC0(Actor* arg0[], u8 arg1, s32 arg2) {
+ func_80677FA8(0xE5, arg2); // Spawn actor 229 (K. Rool's toe)
+ func_8067B238(D_807FBB44, current_actor_pointer, current_actor_pointer->animation_state->scale_y);
+ D_807FBB44->object_properties_bitfield |= 0x1400;
+ D_807FBB44->unk11C = current_actor_pointer;
+ D_807FBB44->noclip_byte = current_actor_pointer->noclip_byte;
+ D_807FBB44->object_properties_bitfield = current_actor_pointer->object_properties_bitfield;
+ arg0[arg1] = D_807FBB44;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_8002FF74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_9C60/func_80030888.s")
+
+/*
+// TODO: Not bad, EOF issue
+void func_8002FDF8(Actor*, u8, Actor*);
+void func_806319C4(Actor*, s32);
+void func_80724DB0(s32, s32, Actor*);
+
+void func_80030888(void) {
+ u8 phi_v0_2;
+ Actor* temp;
+
+ if ((current_actor_pointer->object_properties_bitfield & 0x10) == 0) {
+ func_80724DB0(2, 1, current_actor_pointer->unk11C);
+ }
+ //temp = current_actor_pointer->unk11C;
+ phi_v0_2 = 0U;
+ if (current_actor_pointer->unk15F == 1) {
+ phi_v0_2 = ((Actor178*)current_actor_pointer->unk11C->unk178)->unk14;
+ }
+ func_8002FDF8(current_actor_pointer->unk11C, phi_v0_2, current_actor_pointer->unk11C);
+ func_806319C4(current_actor_pointer, 0);
+}
+*/
diff --git a/src/boss/code_C920.c b/src/boss/code_C920.c
new file mode 100644
index 00000000..a245608a
--- /dev/null
+++ b/src/boss/code_C920.c
@@ -0,0 +1,104 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+s16 func_80665DE0(f32, f32, f32, f32);
+void func_8061C464(s32, Actor*, s32, s32, s32, s32, s32, s32, s32, s32, f32);
+void func_806086CC(f32, f32, f32, s32, s32, s32, s32, s32, f32, s32);
+f32 func_80612794(s16);
+void func_8063DA40(s32, s16);
+
+extern s32 D_807F5D10;
+extern f32 D_80036AB0;
+extern f32 D_80036AB4;
+extern f64 D_80036AB8;
+extern s32 D_807F5D10;
+
+typedef struct BossStruct3 {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+ u8 unk14; // Used
+} BossStruct3;
+
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_C920/func_80030920.s")
+
+/*
+// TODO: Regalloc :(
+void func_80030920(s32 arg0) {
+ extra_player_info_pointer->unk1FE = 1;
+ func_800290D4(1);
+ current_actor_pointer->noclip_byte = 0x24;
+ func_806EB0C0(0x19, current_actor_pointer, 0);
+ func_80724B5C(1, 8, ¤t_actor_pointer->x_position, ¤t_actor_pointer->y_position, ¤t_actor_pointer->z_position);
+ D_807FDC90->unkA = current_actor_pointer->x_position;
+ D_807FDC90->unkC = current_actor_pointer->y_position;
+ D_807FDC90->unkE = current_actor_pointer->z_position;
+ func_80724B5C(1, 0x20, &player_pointer->x_position, &player_pointer->y_position, &player_pointer->z_position);
+ player_pointer->y_rotation = func_80665DE0(current_actor_pointer->x_position, current_actor_pointer->z_position, player_pointer->x_position, player_pointer->z_position);
+ current_actor_pointer->unkEE = \
+ current_actor_pointer->y_rotation = player_pointer->y_rotation + 0x800;
+ func_80614EBC(current_actor_pointer, 0x3F9);
+ if (func_8061CB50()) {
+ func_8061D4E4(D_807F5D10);
+ }
+ func_8061C464(D_807F5D10, player_pointer, 4, 0x800, 0x5A, 0, 0x46, 0x64, 0x3A, 0, D_80036AB0);
+}
+*/
+
+void func_80030AE0(BossStruct3 *arg0) {
+ func_800290D4(0);
+ extra_player_info_pointer->unk1F4 = 0;
+ if (player_pointer->control_state != 0x36) {
+ func_806CFF9C(player_pointer);
+ }
+ func_806224CC(D_807F5D10, player_pointer);
+ extra_player_info_pointer->unk1D8 = D_80036AB4;
+ func_8063DA40(0xB, arg0->unk14 <= 0 ? 0 : 4);
+ func_8063DA40(0xC, arg0->unk14 < 2 ? 0 : 4);
+ func_8063DA40(0xD, arg0->unk14 < 3 ? 0 : 4);
+ func_8063DA40(0xE, arg0->unk14 < 4 ? 0 : 4);
+ func_8063DA40(0xA, 0xA);
+}
+
+void func_80030C30(f32 arg0) {
+ f64 temp_f0;
+
+ temp_f0 = D_80036AB8;
+ current_actor_pointer->x_position = ((player_pointer->x_position - D_807FDC90->unkA) * current_actor_pointer->unk160) + D_807FDC90->unkA;
+ current_actor_pointer->y_position = ((player_pointer->y_position - D_807FDC90->unkC) * current_actor_pointer->unk160) + D_807FDC90->unkC;
+ current_actor_pointer->z_position = ((player_pointer->z_position - D_807FDC90->unkE) * current_actor_pointer->unk160) + D_807FDC90->unkE;
+ current_actor_pointer->unk160 += arg0;
+ if (temp_f0 < current_actor_pointer->unk160) {
+ current_actor_pointer->unk160 = temp_f0;
+ }
+}
+
+void func_80030D50(void) {
+ s32 temp; // TODO: Can this be removed somehow? Messes up a stack offset
+ f32 sp20;
+
+ sp20 = func_80612794(current_actor_pointer->unk160 * 10240.0);
+ current_actor_pointer->x_position += 80.0f * func_80612794(current_actor_pointer->y_rotation + 0x400) * sp20;
+ sp20 = func_80612794(current_actor_pointer->unk160 * 10240.0);
+ current_actor_pointer->z_position += 80.0f * func_80612790(current_actor_pointer->y_rotation + 0x400) * sp20;
+}
+
+void func_80030E58() {
+ D_807FDC90->unk1A |= 1;
+ func_806086CC(current_actor_pointer->x_position,
+ current_actor_pointer->y_position,
+ current_actor_pointer->z_position,
+ 0x2E2, 0xFF, 0x65, 0, 0, 0.0f, 0);
+}
+
+// Jumptable, 3036 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_C920/func_80030EC4.s")
+
+// Jumptable, 4200 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_C920/func_80031AA0.s")
+
+// Quite an interesting Actor + float function, quite big but doable, but might need some struct and array definitions
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_C920/func_80032B08.s")
diff --git a/src/boss/code_F0D0.c b/src/boss/code_F0D0.c
new file mode 100644
index 00000000..c2b913aa
--- /dev/null
+++ b/src/boss/code_F0D0.c
@@ -0,0 +1,130 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+// Quite big but pretty doable, needs some struct/array definitions
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_F0D0/func_800330D0.s")
+
+void func_80614D90(Actor*);
+void func_8061EF4C(s32, s32, s32, f32, f32, f32, f32, f32);
+
+extern f64 D_80036C58;
+extern s32 D_8071720C; // TODO: Datatype
+extern void *D_8074E880[];
+extern f32 D_80036DB4;
+extern s32 D_807F5D10;
+
+typedef struct BossStruct0 {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 unk4;
+} BossStruct0;
+
+typedef struct BossStruct2 {
+ u8 pad0[0x14];
+ u8 unk14;
+ u8 unk15;
+ u8 unk16;
+} BossStruct2;
+
+void func_8003340C(BossStruct0 *arg0) {
+ if ((current_actor_pointer->animation_state->unk64 != 0x223) && (arg0->unk1 == arg0->unk3)) {
+ func_80614EBC(current_actor_pointer, 0x223);
+ func_80614D90(current_actor_pointer);
+ return;
+ }
+ if ((current_actor_pointer->animation_state->unk64 != 0x224) && (arg0->unk1 != arg0->unk3)) {
+ func_80614EBC(current_actor_pointer, 0x224);
+ func_80614D90(current_actor_pointer);
+ }
+}
+
+// Doable, needs some struct definitions
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_F0D0/func_800334A4.s")
+
+void func_800336C0(void) {
+ f32 sp24;
+
+ sp24 = current_actor_pointer->animation_state->scale_y / D_80036C58;
+ func_80714998(2);
+ func_8071498C(&D_8071720C);
+ func_807149B8(1);
+ func_80714950(1);
+ func_80714CC0(D_8074E880[((rand() >> 0xF) % 1000) % 3],
+ (f64)sp24,
+ current_actor_pointer->x_position,
+ current_actor_pointer->y_position,
+ current_actor_pointer->z_position);
+}
+
+// Oof, I had a crack at this one but it's very fiddly
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_F0D0/func_80033784.s")
+
+// Very doable, just gotta figure out some structs
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_F0D0/func_8003392C.s")
+
+/*
+void func_8003392C(void *arg0) {
+ void *temp_v0;
+ void *temp_v1;
+
+ func_80690814(current_actor_pointer, 1);
+ temp_v0 = D_807FDCA0->unk14 + (arg0->unk3 * 0xA);
+ func_80690A28(0x2C, 2, current_actor_pointer->animation_state->scale_y, temp_v0->unk0, temp_v0->unk2, temp_v0->unk4, 1200.0f, temp_v1);
+}
+*/
+
+u8 func_800339D8(BossStruct2 *arg0, u8 *arg1) {
+ if ((player_pointer->y_position < current_actor_pointer->y_position - 10.0f)) {
+ if (arg0->unk14 < 5) {
+ arg0->unk15 = arg0->unk16;
+ current_actor_pointer->control_state = arg1[arg0->unk15++];
+ current_actor_pointer->control_state_progress = 0;
+ func_80614EBC(current_actor_pointer, 0);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void func_80033A80(s8 arg0) {
+ current_actor_pointer->shadow_opacity += arg0;
+ if (current_actor_pointer->shadow_opacity < 0) {
+ current_actor_pointer->shadow_opacity = 0;
+ current_actor_pointer->control_state_progress++;
+ return;
+ }
+ if (current_actor_pointer->shadow_opacity >= 0x100) {
+ current_actor_pointer->shadow_opacity = 0xFF;
+ current_actor_pointer->control_state_progress++;
+ }
+}
+
+// Jumptable, 7276 bytes of code
+#pragma GLOBAL_ASM("asm/nonmatchings/boss/code_F0D0/func_80033AF0.s")
+
+void func_8003575C(void) {
+ f32 dx, dz;
+
+ switch (current_actor_pointer->control_state_progress) {
+ case 1:
+ if (current_actor_pointer->control_state == 0) {
+ dx = player_pointer->x_position - current_actor_pointer->x_position;
+ dz = player_pointer->z_position - current_actor_pointer->z_position;
+ if (((dx * dx) + (dz * dz)) < D_80036DB4) {
+ if (player_pointer->control_state != 0x31) {
+ func_806EB0C0(0x2E, current_actor_pointer, 0);
+ }
+ current_actor_pointer->control_state++;
+ }
+ }
+ break;
+ case 3:
+ func_806782C0(current_actor_pointer);
+ break;
+ }
+ func_8061EF4C(D_807F5D10, 5, 0x14, current_actor_pointer->x_position, current_actor_pointer->y_position, current_actor_pointer->z_position, 200.0f, 400.0f);
+ func_806319C4(current_actor_pointer, 0);
+}
diff --git a/src/dk64_boot/cosf.c b/src/dk64_boot/cosf.c
new file mode 100644
index 00000000..23863e00
--- /dev/null
+++ b/src/dk64_boot/cosf.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/cosf/cosf.s")
diff --git a/src/dk64_boot/dk64_boot_1050.c b/src/dk64_boot/dk64_boot_1050.c
new file mode 100644
index 00000000..05cb9815
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_1050.c
@@ -0,0 +1,165 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+typedef struct {
+ void *unk0;
+ void *unk4;
+ u8 pad8[0x10];
+} dk64_boot_struct_0;
+
+extern u8 D_1050;
+extern u8 D_11320;
+extern u8 D_113F0;
+extern u8 D_CBE70;
+extern u8 D_D4B00;
+extern u8 D_D6B00;
+extern u8 D_D9A40;
+extern u8 D_DF600;
+extern u8 D_E6780;
+extern u8 D_EA0B0;
+extern u8 D_F41A0;
+extern u8 D_FD2F0;
+extern u8 D_101A40;
+extern u8 romAssetBin;
+extern u8 D_188AF20;
+extern u8 D_1897860;
+extern u8 D_1A97280;
+extern u8 D_1ABCBF0;
+extern u8 D_1FED020;
+
+extern s8 D_8000DCB0;
+extern s32 D_8000DCB4;
+extern dk64_boot_struct_0 D_8000DCC4[];
+extern OSViMode D_8000EF20[];
+extern s32 D_8000DE74[3];
+
+extern OSMesg D_80011520;
+extern OSMesgQueue D_80011548;
+extern OSThread D_80011560;
+extern OSThread D_80012710;
+extern u32 D_800138C0;
+
+void func_80000450(s32 devAddr, s32 arg1, void *dramAddr) {
+ u32 size = arg1 - devAddr;
+ osInvalDCache(dramAddr, size);
+ osPiRawStartDma(OS_READ, devAddr, dramAddr, size);
+ do { } while(osPiGetStatus() & PI_STATUS_DMA_BUSY);
+}
+
+void func_800004B4(s32 *arg0, s32 *arg1) {
+ func_800024E0(arg0, arg1, 0x804FAE00);
+ func_800024E0(arg0, arg1, 0x804FAE00);
+}
+
+void func_800004F4(s32 arg0) {
+ OSMesg sp24;
+ void (*gaFunc)(OSMesgQueue *, s32);
+ osRecvMesg(&D_80011548, &sp24, OS_MESG_BLOCK);
+ switch((u32)sp24) {
+ case 0x29d://L80000538
+ if (D_8000DCB0) {
+ gaFunc = 0x805fb300;
+ gaFunc(&D_80011548, 2);
+ break;
+ }
+ osViBlack(1);
+ while(1);
+ case 0x309: //L80000570
+ osSetThreadPri(NULL, 0x12);
+ gaFunc = 0x805fb300;
+ gaFunc(&D_80011548, 1);
+ while(1);
+ }
+}
+
+#ifndef NONMATCHING
+void func_800005A8(s32 arg0);
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1050/func_800005A8.s")
+#else
+void func_800005A8(s32 arg0) {
+ u32 sp34;
+ u32 sp30;
+ s32 sp20[3] = D_8000DE74;
+
+ osCreateMesgQueue(&D_80011548, &D_80011520, OS_MESG_TYPE_LOOPBACK);
+ osSetEventMesg(OS_EVENT_PRENMI, &D_80011548, (OSMesg)0x29D);
+ osCreateThread(&D_80011560, 0xB, func_800004F4, NULL, &D_80012710, 0x64);
+ osStartThread(&D_80011560);
+ osCreateViManager(0xFE);
+ osViSetMode(D_8000EF20 + sp20[osTvType]);
+ osViBlack(1);
+ if (osMemSize < 0x80 || osTvType == OS_TV_PAL) {
+ D_8000DCC4[11].unk0 = &romAssetBin;
+ D_8000DCC4[11].unk4 = &D_188AF20;
+ func_80000A30();
+ } else {
+ func_80000450(&D_11320, &D_113F0, 0x805FB000);
+ D_8000DCB4 = func_80005070(0x5622);
+ bzero(0x805FB300, 0x204D00);
+ sp34 = 0x80020000;
+ sp30 = 0x805FB300;
+ func_80000450(&D_113F0, &D_CBE70, 0x80020000);
+ func_800004B4(&sp34, &sp30);
+ osInvalICache(0x805FB300, sp30 + 0x7FA04D00);
+ osWriteBackDCacheAll();
+ D_8000DCC4[0].unk4 = &D_11320;
+ D_8000DCC4[0].unk0 = &D_1050;
+ D_8000DCC4[1].unk4 = &D_CBE70;
+ D_8000DCC4[1].unk0 = &D_113F0;
+ D_8000DCC4[2].unk4 = &D_D6B00;
+ D_8000DCC4[2].unk0 = &D_D4B00;
+ D_8000DCC4[3].unk4 = &D_D9A40;
+ D_8000DCC4[3].unk0 = &D_D6B00;
+ D_8000DCC4[4].unk4 = &D_DF600;
+ D_8000DCC4[4].unk0 = &D_D9A40;
+ D_8000DCC4[5].unk4 = &D_E6780;
+ D_8000DCC4[5].unk0 = &D_DF600;
+ D_8000DCC4[6].unk4 = &D_EA0B0;
+ D_8000DCC4[6].unk0 = &D_E6780;
+ D_8000DCC4[6].unk4 = &D_EA0B0;
+ D_8000DCC4[6].unk0 = &D_E6780;
+ D_8000DCC4[7].unk4 = &D_F41A0;
+ D_8000DCC4[7].unk0 = &D_EA0B0;
+ D_8000DCC4[8].unk4 = &D_FD2F0;
+ D_8000DCC4[8].unk0 = &D_F41A0;
+ D_8000DCC4[9].unk4 = &D_101A40;
+ D_8000DCC4[9].unk0 = &D_FD2F0;
+ D_8000DCC4[10].unk0 = &D_CBE70;
+ D_8000DCC4[10].unk4 = &D_D4B00;
+ D_8000DCC4[11].unk0 = &romAssetBin;
+ D_8000DCC4[11].unk4 = &D_188AF20;
+ D_8000DCC4[12].unk0 = &D_101A40;
+ D_8000DCC4[12].unk4 = &romAssetBin;
+ D_8000DCC4[13].unk0 = &romAssetBin;
+ D_8000DCC4[13].unk4 = &romAssetBin;
+ D_8000DCC4[14].unk0 = &D_1897860;
+ D_8000DCC4[14].unk4 = &D_1A97280;
+ D_8000DCC4[15].unk4 = &D_1897860;
+ D_8000DCC4[15].unk0 = &D_188AF20;
+ D_8000DCC4[16].unk4 = &D_1ABCBF0;
+ D_8000DCC4[16].unk0 = &D_1A97280;
+ D_8000DCC4[17].unk4 = &D_1FED020;
+ D_8000DCC4[17].unk0 = &D_1ABCBF0;
+
+ osSetThreadPri(NULL, 0);
+ D_8000DCB0 = 1;
+ ((void (*)(OSMesgQueue *, s32))0x805FB300)(&D_80011548, 0);
+ }
+ while(1);
+}
+#endif
+
+void func_80000980(void) {
+ osCreateThread(&D_80012710, 1, func_800005A8, NULL, &D_800138C0, 0);
+ osStartThread(&D_80012710);
+}
+
+void func_800009D0(void) {
+ u32 *tmp_a0;
+ osInitialize();
+ tmp_a0 = 0xA02FE1C0;
+ while(0xAD170014 != *tmp_a0);
+ *tmp_a0 = 0xF0F0F0F0;
+ func_80000980();
+}
diff --git a/src/dk64_boot/dk64_boot_1630.c b/src/dk64_boot/dk64_boot_1630.c
new file mode 100644
index 00000000..804ac55b
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_1630.c
@@ -0,0 +1,108 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_80000AA0(void);
+void func_80000D8C(void *arg0);
+void func_80000E48(void *arg0, s32 arg1, s32 arg2, u8 *arg3);
+void func_80000EEC(s16* arg0[8][8], s32 arg1, s32 arg2, u8 arg3);
+void func_8000102C(s32 arg0, s32 arg1, void *arg2);
+
+extern u8 *D_8000DDCC;
+extern u8 D_8000ED24;
+extern u8 D_8000ED40;
+extern u8 D_8000ED58;
+extern u8 D_8000ED78;
+extern u8 D_8000ED9C;
+extern u8 D_8000EDC0;
+
+extern OSThread D_800138C0;
+extern void *D_80013A70[];
+
+extern u16 D_80100000[0];
+extern void *D_80133E80;
+
+typedef struct{
+ s32 unk0;
+ s32 unk4;
+} dk64_boot_struct_1_s;
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1630/func_80000A30.s")
+
+/*
+void func_80000A30(void) {
+ D_80013A70[0] = &D_80133E80;
+ osCreateThread(&D_800138C0, 2, func_80000AA0, NULL, &D_80133E80, 0xA);
+ osStartThread(&D_800138C0);
+ while (TRUE) {};
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1630/func_80000AA0.s")
+
+void func_80000CD4(void) {
+ s16 *tmp_v0 = 0x80100000;
+ int i;
+ s32 pad0;
+ void * sp38;
+ s32 sp34;
+ dk64_boot_struct_1_s *tmp_s0;
+ s32 pad1;
+ s32 pad2;
+
+ if (osTvType == OS_TV_PAL) {
+ i = 0;
+ do {
+ tmp_v0[i++] = 0;
+ } while(i < 0x12C00);
+ } else {
+ tmp_s0 = 0x80280000;
+ func_8000102C(0x38, 0x10, tmp_s0);
+ func_8000102C(tmp_s0->unk0 + 0x4C, 0x10, tmp_s0);
+ func_8000102C(tmp_s0->unk0, tmp_s0->unk4 - tmp_s0->unk0, tmp_s0);
+ sp38 = tmp_s0;
+ sp34 = 0x80380000;
+ func_800024E0(&sp38, &sp34, 0x803C0000);
+ func_80000D8C(0x80100000);
+ }
+}
+
+void func_80000D8C(void *arg0) {
+ if (osTvType != OS_TV_PAL) {
+ func_80000E48(arg0, 0x15, 0x8C, &D_8000ED24);
+ func_80000E48(arg0, 0x15, 0x96, &D_8000ED40);
+ func_80000E48(arg0, 0x15, 0xAA, &D_8000ED58);
+ func_80000E48(arg0, 0x15, 0xb4, &D_8000ED78);
+ func_80000E48(arg0, 0x15, 0xbe, &D_8000ED9C);
+ func_80000E48(arg0, 0x15, 0xc8, &D_8000EDC0);
+ }
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1630/func_80000E48.s")
+#else
+void func_80000E48(void *arg0, s32 arg1, s32 arg2, u8 *arg3) {
+ int i;
+ for (i = 0; arg3[i]; arg1 += 9, i++) {
+ if (0x20 != arg3[i]) {
+ func_80000EEC(arg0, arg1, arg2, arg3[i]);
+ } else {
+ arg1 -= 2;
+ }
+ }
+ osWritebackDCache(arg0, 0x25800);
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1630/func_80000EEC.s")
+
+void func_8000102C(s32 offset, s32 size, void *dramAddr) {
+ while(size & 0xf)
+ {
+ size++;
+ }
+ osWritebackDCache(dramAddr, size);
+ osPiRawStartDma(OS_READ, D_8000DDCC + offset, dramAddr, size);
+ do{}while(osPiGetStatus() & PI_STATUS_DMA_BUSY);
+ osInvalDCache(dramAddr, size);
+}
diff --git a/src/dk64_boot/dk64_boot_1CC0.c b/src/dk64_boot/dk64_boot_1CC0.c
new file mode 100644
index 00000000..88496142
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_1CC0.c
@@ -0,0 +1,18 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_800010C0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_80001700.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_80001AF4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_80001C48.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_80001DB0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_800022D4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_1CC0/func_800023F4.s")
diff --git a/src/dk64_boot/dk64_boot_30E0.c b/src/dk64_boot/dk64_boot_30E0.c
new file mode 100644
index 00000000..91573bb3
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_30E0.c
@@ -0,0 +1,60 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+void func_80002750(void);
+
+s32 D_8000EEE0;
+
+void *D_80013AB0;
+u8 *D_80013AC0;
+s32 D_80013AC4;
+s32 D_80013AD8;
+s32 D_80013ADC;
+s32 D_80013AE8;
+s32 D_80013AEC;
+s32 D_80013AF0;
+
+void func_800024E0(u8 **arg0, s32 *arg1, void *arg2) {
+ D_80013AC0 = *arg0;
+ D_80013AC4 = *arg1;
+ D_80013AB0 = arg2;
+ func_80002750();
+ if (D_80013AC0[D_80013AEC] != 0x1F) {
+ D_80013AEC++;
+ }
+ D_8000EEE0 = func_800025A4();
+ if (D_8000EEE0 >= 0) {
+ func_800023F4();
+ (*arg0) += D_80013AEC;
+ (*arg1) += D_80013AF0;
+ }
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_30E0/func_800025A4.s")
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_30E0/func_80002724.s")
+#else
+u32 func_80002724(u32 arg0, s32 arg1) {
+ u32 v1 = 0;
+ do {
+ v1 |= (arg0 & 1);
+ arg1--;
+ arg0 >>= 1;
+ v1 <<= 1;
+ } while (arg1 > 0);
+ return v1 >> 1;
+}
+#endif
+
+// Lol
+void func_80002750(void) {
+ D_80013AF0 = 0;
+ D_80013AE8 = \
+ D_80013AEC = 0;
+ D_80013AD8 = \
+ D_80013ADC = 0;
+}
diff --git a/src/dk64_boot/dk64_boot_3390.c b/src/dk64_boot/dk64_boot_3390.c
new file mode 100644
index 00000000..d6789614
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_3390.c
@@ -0,0 +1,38 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002790.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002828.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_800028E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_800029EC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002A30.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002A64.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002ABC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002B0C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002BB8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002C74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002CE8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002D60.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002DE4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002E98.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002ECC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002F18.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3390/func_80002F54.s")
diff --git a/src/dk64_boot/dk64_boot_3C00.c b/src/dk64_boot/dk64_boot_3C00.c
new file mode 100644
index 00000000..40fa22e6
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_3C00.c
@@ -0,0 +1,45 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3C00/memcpy.s")
+
+// TODO: Need some extra compiler flags to make it use ld instruction?
+/*
+void *memcpy(u32 dest, u32 src, u32 n)
+{
+ void* _dest = dest;
+ if (n != 0)
+ {
+ if ((((n | 7) ^ 7) != n) || (((dest | 7) ^ 7) != dest) || (((src | 7) ^ 7) != src))
+ {
+ if ((((n | 3) ^ 3) != n) || (((dest | 3) ^ 3) != dest) || (((src | 3) ^ 3) != src))
+ {
+ if ((((n | 1) ^ 1) != n) || (((dest | 1) ^ 1) != dest) || (((src | 1) ^ 1) != src))
+ {
+ while(n > 0) {
+ *((u8 *)dest)++ = *((u8 *)src)++;
+ n--;
+ }
+ } else {
+ while(n > 0) {
+ *((u16 *)dest)++ = *((u16 *)src)++;
+ n -= sizeof(u16);
+ }
+ }
+ } else {
+ while(n > 0) {
+ *((u32 *)dest)++ = *((u32 *)src)++;
+ n -= sizeof(u32);
+ }
+ }
+ } else {
+ while(n > 0) {
+ *((u64 *)dest)++ = *((u64 *)src)++;
+ n -= sizeof(u64);
+ }
+ }
+ }
+ return _dest;
+}
+*/
\ No newline at end of file
diff --git a/src/dk64_boot/dk64_boot_3D20.c b/src/dk64_boot/dk64_boot_3D20.c
new file mode 100644
index 00000000..b8c3b133
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_3D20.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3D20/func_80003120.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3D20/func_800031E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_3D20/func_8000320C.s")
diff --git a/src/dk64_boot/dk64_boot_5C70.c b/src/dk64_boot/dk64_boot_5C70.c
new file mode 100644
index 00000000..37701053
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_5C70.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_5C70/func_80005070.s")
diff --git a/src/dk64_boot/dk64_boot_61D0.c b/src/dk64_boot/dk64_boot_61D0.c
new file mode 100644
index 00000000..79bff25c
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_61D0.c
@@ -0,0 +1,30 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+extern u8 D_80015004;
+extern u8 D_80015005;
+extern u8 D_80015006;
+extern u8 D_80015007;
+extern u8 D_80015008;
+
+extern u8 D_8001507C;
+extern u8 D_8001507D;
+extern u8 D_8001507E;
+extern u8 D_8001507F;
+extern u8 D_80015080;
+
+void func_800055D0(void) {
+ D_80015004 = 7;
+ D_80015005 = IO_READ(PI_BSD_DOM1_LAT_REG);
+ D_80015008 = IO_READ(PI_BSD_DOM1_PWD_REG);
+ D_80015006 = IO_READ(PI_BSD_DOM1_PGS_REG);
+ D_80015007 = IO_READ(PI_BSD_DOM1_RLS_REG);
+
+ D_8001507C = 7;
+ D_8001507D = IO_READ(PI_BSD_DOM2_LAT_REG);
+ D_80015080 = IO_READ(PI_BSD_DOM2_PWD_REG);
+ D_8001507E = IO_READ(PI_BSD_DOM2_PGS_REG);
+ D_8001507F = IO_READ(PI_BSD_DOM2_RLS_REG);
+}
diff --git a/src/dk64_boot/dk64_boot_62F0.c b/src/dk64_boot/dk64_boot_62F0.c
new file mode 100644
index 00000000..f8c0d26a
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_62F0.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_62F0/func_800056F0.s")
diff --git a/src/dk64_boot/dk64_boot_63B0.c b/src/dk64_boot/dk64_boot_63B0.c
new file mode 100644
index 00000000..b73c1fc1
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_63B0.c
@@ -0,0 +1,26 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_800057B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_800057DC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005818.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005854.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005880.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_800058BC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005918.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005948.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_800059A8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005A44.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_63B0/func_80005A70.s")
diff --git a/src/dk64_boot/dk64_boot_7F60.c b/src/dk64_boot/dk64_boot_7F60.c
new file mode 100644
index 00000000..10aad31d
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_7F60.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_7F60/func_80007360.s")
diff --git a/src/dk64_boot/dk64_boot_7FD0.c b/src/dk64_boot/dk64_boot_7FD0.c
new file mode 100644
index 00000000..49a5efad
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_7FD0.c
@@ -0,0 +1,25 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern u8 __osContLastCmd;
+extern s32 *D_80014DC0;
+
+s32 func_800073D0(OSMesgQueue *arg0) {
+ s32 temp_v0;
+
+ __osSiGetAccess();
+ if (__osContLastCmd != 1) {
+ func_800074E0();
+ __osSiRawStartDma(1, &D_80014DC0);
+ osRecvMesg(arg0, NULL, 1);
+ }
+ temp_v0 = __osSiRawStartDma(0, &D_80014DC0);
+ __osContLastCmd = 1;
+ __osSiRelAccess();
+ return temp_v0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_7FD0/func_80007454.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_7FD0/func_800074E0.s")
diff --git a/src/dk64_boot/dk64_boot_CA20.c b/src/dk64_boot/dk64_boot_CA20.c
new file mode 100644
index 00000000..8dae5c87
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_CA20.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_CA20/func_8000BE20.s")
diff --git a/src/dk64_boot/dk64_boot_E790.c b/src/dk64_boot/dk64_boot_E790.c
new file mode 100644
index 00000000..36112b6f
--- /dev/null
+++ b/src/dk64_boot/dk64_boot_E790.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/dk64_boot_E790/func_8000DB90.s")
diff --git a/src/dk64_boot/gu/lookat.c b/src/dk64_boot/gu/lookat.c
new file mode 100644
index 00000000..384ec6d5
--- /dev/null
+++ b/src/dk64_boot/gu/lookat.c
@@ -0,0 +1,71 @@
+#include "guint.h"
+
+void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp)
+{
+ float len, xLook, yLook, zLook, xRight, yRight, zRight;
+
+ guMtxIdentF(mf);
+
+ xLook = xAt - xEye;
+ yLook = yAt - yEye;
+ zLook = zAt - zEye;
+
+ /* Negate because positive Z is behind us: */
+ len = -1.0 / sqrtf (xLook*xLook + yLook*yLook + zLook*zLook);
+ xLook *= len;
+ yLook *= len;
+ zLook *= len;
+
+ /* Right = Up x Look */
+
+ xRight = yUp * zLook - zUp * yLook;
+ yRight = zUp * xLook - xUp * zLook;
+ zRight = xUp * yLook - yUp * xLook;
+ len = 1.0 / sqrtf (xRight*xRight + yRight*yRight + zRight*zRight);
+ xRight *= len;
+ yRight *= len;
+ zRight *= len;
+
+ /* Up = Look x Right */
+
+ xUp = yLook * zRight - zLook * yRight;
+ yUp = zLook * xRight - xLook * zRight;
+ zUp = xLook * yRight - yLook * xRight;
+ len = 1.0 / sqrtf (xUp*xUp + yUp*yUp + zUp*zUp);
+ xUp *= len;
+ yUp *= len;
+ zUp *= len;
+
+ mf[0][0] = xRight;
+ mf[1][0] = yRight;
+ mf[2][0] = zRight;
+ mf[3][0] = -(xEye * xRight + yEye * yRight + zEye * zRight);
+
+ mf[0][1] = xUp;
+ mf[1][1] = yUp;
+ mf[2][1] = zUp;
+ mf[3][1] = -(xEye * xUp + yEye * yUp + zEye * zUp);
+
+ mf[0][2] = xLook;
+ mf[1][2] = yLook;
+ mf[2][2] = zLook;
+ mf[3][2] = -(xEye * xLook + yEye * yLook + zEye * zLook);
+
+ mf[0][3] = 0;
+ mf[1][3] = 0;
+ mf[2][3] = 0;
+ mf[3][3] = 1;
+}
+
+void guLookAt (Mtx *m, float xEye, float yEye, float zEye,
+ float xAt, float yAt, float zAt,
+ float xUp, float yUp, float zUp)
+{
+ Matrix mf;
+
+ guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp);
+
+ guMtxF2L(mf, m);
+}
diff --git a/src/dk64_boot/gu/mtxcatf.c b/src/dk64_boot/gu/mtxcatf.c
new file mode 100644
index 00000000..55952e62
--- /dev/null
+++ b/src/dk64_boot/gu/mtxcatf.c
@@ -0,0 +1,30 @@
+#include "guint.h"
+
+void guMtxCatF(float mf[4][4], float nf[4][4], float res[4][4])
+{
+ int i, j, k;
+ float temp[4][4];
+
+ for (i=0; i<4; i++) {
+ for (j=0; j<4; j++) {
+ temp[i][j] = 0.0;
+ for (k=0; k<4; k++) {
+ temp[i][j] += mf[i][k] * nf[k][j];
+ }
+ }
+ }
+
+ /* make sure we handle case where result is an input */
+ for (i=0; i<4; i++) {
+ for (j=0; j<4; j++) {
+ res[i][j] = temp[i][j];
+ }
+ }
+}
+
+void guMtxXFMF(float mf[4][4], float x, float y, float z, float *ox, float *oy, float *oz)
+{
+ *ox = mf[0][0]*x + mf[1][0]*y + mf[2][0]*z + mf[3][0];
+ *oy = mf[0][1]*x + mf[1][1]*y + mf[2][1]*z + mf[3][1];
+ *oz = mf[0][2]*x + mf[1][2]*y + mf[2][2]*z + mf[3][2];
+}
diff --git a/src/dk64_boot/gu/mtxcatl.c b/src/dk64_boot/gu/mtxcatl.c
new file mode 100644
index 00000000..8158b7b7
--- /dev/null
+++ b/src/dk64_boot/gu/mtxcatl.c
@@ -0,0 +1,22 @@
+#include "guint.h"
+
+void guMtxCatL(Mtx *m, Mtx *n, Mtx *res)
+{
+ float mf[4][4], nf[4][4], resf[4][4];
+
+ guMtxL2F(mf, m);
+ guMtxL2F(nf, n);
+
+ guMtxCatF(mf, nf, resf);
+
+ guMtxF2L(resf, res);
+}
+
+void guMtxXFML(Mtx *m, float x, float y, float z, float *ox, float *oy, float *oz)
+{
+ float mf[4][4];
+
+ guMtxL2F(mf, m);
+
+ guMtxXFMF(mf, x, y, z, ox, oy, oz);
+}
diff --git a/src/dk64_boot/gu/nonmatching/align.c b/src/dk64_boot/gu/nonmatching/align.c
new file mode 100644
index 00000000..ee53e3fa
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/align.c
@@ -0,0 +1,60 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/align/guAlignF.s")
+
+/*
+void guAlignF(float mf[4][4], float a, float x, float y, float z)
+{
+ static float dtor = 3.1415926f / 180.0f; // TODO: Need .rodata, .data, .bss defined? I don't really understand
+ float s, c, h, hinv;
+
+ guNormalize(&x, &y, &z);
+
+ a *= dtor;
+ s = sinf(a);
+ c = cosf(a);
+ h = sqrtf(x * x + z * z);
+
+ guMtxIdentF(mf);
+
+ if (h != 0) {
+ hinv = 1 / h;
+
+ mf[0][0] = (-z*c - s*y*x) * hinv;
+ mf[1][0] = (z*s - c*y*x) * hinv;
+ mf[2][0] = -x;
+ mf[3][0] = 0;
+
+ mf[0][1] = s*h;
+ mf[1][1] = c*h;
+ mf[2][1] = -y;
+ mf[3][1] = 0;
+
+ mf[0][2] = (c*x - s*y*z) * hinv;
+ mf[1][2] = (-s*x - c*y*z) * hinv;
+ mf[2][2] = -z;
+ mf[3][2] = 0;
+
+ mf[0][3] = 0;
+ mf[1][3] = 0;
+ mf[2][3] = 0;
+ mf[3][3] = 1;
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/align/guAlign.s")
+
+/*
+void guAlign(Mtx *m, f32 a, f32 x, f32 y, f32 z)
+{
+ f32 mf[4][4];
+
+ guAlignF(mf, a, x, y, z);
+
+ guMtxF2L(mf, m);
+}
+*/
diff --git a/src/dk64_boot/gu/nonmatching/lookathil.c b/src/dk64_boot/gu/nonmatching/lookathil.c
new file mode 100644
index 00000000..4ad48894
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/lookathil.c
@@ -0,0 +1,12 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/lookathil/guLookAtHiliteF.s")
+
+void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, float zUp, float xl1, float yl1, float zl1, float xl2, float yl2, float zl2, int twidth, int theight) {
+ float sp58[4][4];
+ guLookAtHiliteF(&sp58[0], l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, twidth, theight);
+ guMtxF2L(&sp58[0], m);
+}
diff --git a/src/dk64_boot/gu/nonmatching/mtxutil.c b/src/dk64_boot/gu/nonmatching/mtxutil.c
new file mode 100644
index 00000000..1bb3ad19
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/mtxutil.c
@@ -0,0 +1,66 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void guMtxF2L(f32 mf[4][4], Mtx *m) {
+ s32 r, c;
+ s32 tmp1;
+ s32 tmp2;
+ s32 *m1 = &m->m[0][0];
+ s32 *m2 = &m->m[2][0];
+ for (r = 0; r < 4; r++) {
+ for (c = 0; c < 2; c++) {
+ tmp1 = mf[r][2 * c] * 65536.0f;
+ tmp2 = mf[r][2 * c + 1] * 65536.0f;
+ *m1++ = (tmp1 & 0xffff0000) | ((tmp2 >> 0x10) & 0xffff);
+ *m2++ = ((tmp1 << 0x10) & 0xffff0000) | (tmp2 & 0xffff);
+ }
+ }
+}
+
+void guMtxIdentF(f32 (*mf)[4]) {
+ s32 r, c;
+ for (r = 0; r < 4; r++) {
+ for (c = 0; c < 4; c++) {
+ if (r == c) {
+ mf[r][c] = 1.0f;
+ } else {
+ mf[r][c] = 0.0f;
+ }
+ }
+ }
+}
+
+void guMtxIdent(Mtx *m) {
+ Mtx sp18;
+
+ guMtxIdentF(&sp18);
+ guMtxF2L(&sp18, m);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/mtxutil/guMtxL2F.s")
+
+/*
+void guMtxL2F(float mf[4][4], Mtx *m) {
+ int r, c;
+ u32 tmp1;
+ u32 tmp2;
+ u32 *m1;
+ u32 *m2;
+ s32 stmp1, stmp2;
+ m1 = (u32 *)&m->m[0][0];
+ m2 = (u32 *)&m->m[2][0];
+ for (r = 0; r < 4; r++)
+ {
+ for (c = 0; c < 2; c++)
+ {
+ tmp1 = (*m1 & 0xffff0000) | ((*m2 >> 0x10) & 0xffff);
+ tmp2 = ((*m1++ << 0x10) & 0xffff0000) | (*m2++ & 0xffff);
+ stmp1 = *(s32 *)&tmp1;
+ stmp2 = *(s32 *)&tmp2;
+ mf[r][c * 2 + 0] = stmp1 / 65536.0f;
+ mf[r][c * 2 + 1] = stmp2 / 65536.0f;
+ }
+ }
+}
+*/
\ No newline at end of file
diff --git a/src/dk64_boot/gu/nonmatching/position.c b/src/dk64_boot/gu/nonmatching/position.c
new file mode 100644
index 00000000..d437bd06
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/position.c
@@ -0,0 +1,18 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/position/guPositionF.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/position/guPosition.s")
+
+/*
+// TODO: Not sure why this doesn't match
+// Calling convention? Compiler flag?
+void guPosition(Mtx *m, float r, float p, float h, float s, float x, float y, float z) {
+ float mf[4][4];
+ guPositionF(&mf, r, p, h, s, x, y, z);
+ guMtxF2L(&mf, m);
+}
+*/
diff --git a/src/dk64_boot/gu/nonmatching/rotate.c b/src/dk64_boot/gu/nonmatching/rotate.c
new file mode 100644
index 00000000..e9f352eb
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/rotate.c
@@ -0,0 +1,16 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/rotate/guRotateF.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/rotate/guRotate.s")
+
+/*
+void guRotate(Mtx *m, float a, float x, float y, float z) {
+ float sp20[4][4];
+ guRotateF(&sp20, a, x, y, z);
+ guMtxF2L(&sp20, m);
+}
+*/
diff --git a/src/dk64_boot/gu/nonmatching/usprite.c b/src/dk64_boot/gu/nonmatching/usprite.c
new file mode 100644
index 00000000..a6968fea
--- /dev/null
+++ b/src/dk64_boot/gu/nonmatching/usprite.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/gu/nonmatching/usprite/guSprite2DInit.s")
diff --git a/src/dk64_boot/gu/normalize.c b/src/dk64_boot/gu/normalize.c
new file mode 100644
index 00000000..78addf96
--- /dev/null
+++ b/src/dk64_boot/gu/normalize.c
@@ -0,0 +1,11 @@
+#include "guint.h"
+
+void guNormalize(float *x, float *y, float *z)
+{
+ float m;
+
+ m = 1/sqrtf((*x)*(*x) + (*y)*(*y) + (*z)*(*z));
+ *x *= m;
+ *y *= m;
+ *z *= m;
+}
diff --git a/src/dk64_boot/gu/ortho.c b/src/dk64_boot/gu/ortho.c
new file mode 100644
index 00000000..ffc8e5b2
--- /dev/null
+++ b/src/dk64_boot/gu/ortho.c
@@ -0,0 +1,29 @@
+#include "guint.h"
+
+void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale)
+{
+ int i, j;
+
+ guMtxIdentF(mf);
+
+ mf[0][0] = 2/(r-l);
+ mf[1][1] = 2/(t-b);
+ mf[2][2] = -2/(f-n);
+ mf[3][0] = -(r+l)/(r-l);
+ mf[3][1] = -(t+b)/(t-b);
+ mf[3][2] = -(f+n)/(f-n);
+ mf[3][3] = 1;
+
+ for (i=0; i<4; i++)
+ for (j=0; j<4; j++)
+ mf[i][j] *= scale;
+}
+
+void guOrtho(Mtx *m, float l, float r, float b, float t, float n, float f, float scale)
+{
+ Matrix mf;
+
+ guOrthoF(mf, l, r, b, t, n, f, scale);
+
+ guMtxF2L(mf, m);
+}
diff --git a/src/dk64_boot/gu/perspective.c b/src/dk64_boot/gu/perspective.c
new file mode 100644
index 00000000..c2d0de75
--- /dev/null
+++ b/src/dk64_boot/gu/perspective.c
@@ -0,0 +1,43 @@
+#include "guint.h"
+#include
+
+void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
+{
+ float cot;
+ int i, j;
+
+ guMtxIdentF(mf);
+
+ fovy *= 3.1415926 / 180.0;
+ cot = cosf (fovy/2) / sinf (fovy/2);
+
+ mf[0][0] = cot / aspect;
+ mf[1][1] = cot;
+ mf[2][2] = (near + far) / (near - far);
+ mf[2][3] = -1;
+ mf[3][2] = (2 * near * far) / (near - far);
+ mf[3][3] = 0;
+
+ for (i=0; i<4; i++)
+ for (j=0; j<4; j++)
+ mf[i][j] *= scale;
+
+ if (perspNorm != (u16 *) NULL) {
+ if (near+far<=2.0) {
+ *perspNorm = (u16) 0xFFFF;
+ } else {
+ *perspNorm = (u16) ((2.0*65536.0)/(near+far));
+ if (*perspNorm<=0)
+ *perspNorm = (u16) 0x0001;
+ }
+ }
+}
+
+void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
+{
+ Matrix mf;
+
+ guPerspectiveF(mf, perspNorm, fovy, aspect, near, far, scale);
+
+ guMtxF2L(mf, m);
+}
diff --git a/src/dk64_boot/gu/scale.c b/src/dk64_boot/gu/scale.c
new file mode 100644
index 00000000..127e8a29
--- /dev/null
+++ b/src/dk64_boot/gu/scale.c
@@ -0,0 +1,20 @@
+#include "guint.h"
+
+void guScaleF(float mf[4][4], float x, float y, float z)
+{
+ guMtxIdentF(mf);
+
+ mf[0][0] = x;
+ mf[1][1] = y;
+ mf[2][2] = z;
+ mf[3][3] = 1;
+}
+
+void guScale(Mtx *m, float x, float y, float z)
+{
+ Matrix mf;
+
+ guScaleF(mf, x, y, z);
+
+ guMtxF2L(mf, m);
+}
diff --git a/src/dk64_boot/gu/translate.c b/src/dk64_boot/gu/translate.c
new file mode 100644
index 00000000..65e72855
--- /dev/null
+++ b/src/dk64_boot/gu/translate.c
@@ -0,0 +1,19 @@
+#include "guint.h"
+
+void guTranslateF(float mf[4][4], float x, float y, float z)
+{
+ guMtxIdentF(mf);
+
+ mf[3][0] = x;
+ mf[3][1] = y;
+ mf[3][2] = z;
+}
+
+void guTranslate(Mtx *m, float x, float y, float z)
+{
+ Matrix mf;
+
+ guTranslateF(mf, x, y, z);
+
+ guMtxF2L(mf, m);
+}
diff --git a/src/dk64_boot/io/ai.c b/src/dk64_boot/io/ai.c
new file mode 100644
index 00000000..529aba81
--- /dev/null
+++ b/src/dk64_boot/io/ai.c
@@ -0,0 +1,11 @@
+#include
+
+s32 __osAiDeviceBusy(void)
+{
+ register s32 status = IO_READ(AI_STATUS_REG);
+ if (status & AI_STATUS_FIFO_FULL)
+
+ return 1;
+
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/aigetlen.c b/src/dk64_boot/io/aigetlen.c
new file mode 100644
index 00000000..cdf329b6
--- /dev/null
+++ b/src/dk64_boot/io/aigetlen.c
@@ -0,0 +1,7 @@
+
+#include
+
+u32 osAiGetLength(void)
+{
+ return IO_READ(AI_LEN_REG);
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/aisetnextbuf.c b/src/dk64_boot/io/aisetnextbuf.c
new file mode 100644
index 00000000..5d54f005
--- /dev/null
+++ b/src/dk64_boot/io/aisetnextbuf.c
@@ -0,0 +1,24 @@
+#include
+#include
+#include "osint.h"
+
+u8 hdwrBugFlag = 0;
+
+s32 osAiSetNextBuffer(void *bufPtr, u32 size)
+{
+ char *bptr = bufPtr;
+ if (hdwrBugFlag != 0)
+ bptr -= 0x2000;
+
+ if ((((u32)bufPtr + size) & 0x1fff) == 0)
+ hdwrBugFlag = 1;
+ else
+ hdwrBugFlag = 0;
+
+ if (__osAiDeviceBusy())
+ return -1;
+
+ IO_WRITE(AI_DRAM_ADDR_REG, osVirtualToPhysical(bptr));
+ IO_WRITE(AI_LEN_REG, size);
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/conteeplongread.c b/src/dk64_boot/io/conteeplongread.c
new file mode 100644
index 00000000..951f26d2
--- /dev/null
+++ b/src/dk64_boot/io/conteeplongread.c
@@ -0,0 +1,16 @@
+#include
+#include "controller.h"
+
+s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int length)
+{
+ s32 ret;
+ ret = 0;
+ while (length > 0)
+ {
+ ERRCK(osEepromRead(mq, address, buffer));
+ length -= EEPROM_BLOCK_SIZE;
+ address++;
+ buffer += EEPROM_BLOCK_SIZE;
+ }
+ return ret;
+}
diff --git a/src/dk64_boot/io/conteepprobe.c b/src/dk64_boot/io/conteepprobe.c
new file mode 100644
index 00000000..3a81bd6e
--- /dev/null
+++ b/src/dk64_boot/io/conteepprobe.c
@@ -0,0 +1,4 @@
+#include "controller.h"
+#include "siint.h"
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepprobe/osEepromProbe.s")
diff --git a/src/dk64_boot/io/conteepread.c b/src/dk64_boot/io/conteepread.c
new file mode 100644
index 00000000..ae4ee9d2
--- /dev/null
+++ b/src/dk64_boot/io/conteepread.c
@@ -0,0 +1,8 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepread/osEepromRead.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepread/__osPackEepReadData.s")
diff --git a/src/dk64_boot/io/conteepwrite.c b/src/dk64_boot/io/conteepwrite.c
new file mode 100644
index 00000000..5f7eb4a9
--- /dev/null
+++ b/src/dk64_boot/io/conteepwrite.c
@@ -0,0 +1,70 @@
+#include
+#include "controller.h"
+#include "siint.h"
+#include
+
+void __osPackEepWriteData(u8 address, u8 *buffer);
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepwrite/osEepromWrite.s")
+#else
+s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer)
+{
+
+ s32 ret;
+ int i;
+ u32 type;
+ u8 *ptr;
+ __OSContEepromFormat eepromformat;
+ OSContStatus sdata;
+
+ ret = 0;
+ __osSiGetAccess();
+ ret = __osEepStatus(mq, &sdata);
+
+ if (!ret) {
+ type = sdata.type & (CONT_EEPROM | CONT_EEP16K);
+ switch (type) {
+ default:
+ ret = CONT_NO_RESPONSE_ERROR;
+ break;
+ case CONT_EEPROM://L800079B0
+ if (address >= EEPROM_MAXBLOCKS)
+ ret = -1;
+ break;
+ case CONT_EEPROM | CONT_EEP16K://L800079C4
+ if (address >= EEP16K_MAXBLOCKS)
+ ret = -1;
+ break;
+ }
+ }
+ if (ret) {
+ __osSiRelAccess();
+ return ret;
+ }
+
+ while (sdata.status & CONT_EEPROM_BUSY)
+ {
+ __osEepStatus(mq, &sdata);
+ }
+ __osPackEepWriteData(address, buffer);
+ __osSiRawStartDma(OS_WRITE, &__osEepPifRam); //send command to pif
+ osRecvMesg(mq, NULL, OS_MESG_BLOCK);
+ __osSiRawStartDma(OS_READ, &__osEepPifRam); //recv response
+ __osContLastCmd = CONT_CMD_WRITE_EEPROM;
+ osRecvMesg(mq, NULL, OS_MESG_BLOCK);
+
+ ptr = (u8*)__osEepPifRam.ramarray + 4;
+ eepromformat = *(__OSContEepromFormat *)ptr;
+
+ //probably indicates an error, from PIF
+ ret = CHNL_ERR(eepromformat); //TODO: remove magic constants
+
+ __osSiRelAccess();
+ return ret;
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepwrite/__osPackEepWriteData.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/conteepwrite/__osEepStatus.s")
diff --git a/src/dk64_boot/io/contpfs.c b/src/dk64_boot/io/contpfs.c
new file mode 100644
index 00000000..5f6a66c0
--- /dev/null
+++ b/src/dk64_boot/io/contpfs.c
@@ -0,0 +1,56 @@
+#include
+#include "controller.h"
+
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/__osSumcalc.s")
+#else
+u16 __osSumcalc(u8 *ptr, int length)
+{
+ int i;
+ u32 sum;
+ u8 *tmp;
+
+ sum = 0;
+ tmp = ptr;
+ for (i = 0; i < length; i++)
+ {
+ sum += *tmp++;
+ }
+ return sum & 0xffff;
+}
+#endif
+
+#ifndef NONMATHCING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/__osIdCheckSum.s")
+#else
+s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum)
+{
+ u16 data;
+ u32 j;
+ data = 0;
+ *icsum = 0;
+ *csum = *icsum;
+ for (j = 0; j < 28; j += 2)
+ {
+ //feels like this should be a compiler optimization not manual..
+ //but it doesn't match and I'm pretty sure this is just -O1
+ /* ^comment copies from libreultra, I'm pretty positive this file is NOT -O1 for DK64*/
+ data = *(u16 *)((u8 *)ptr + j);
+ //data = ptr[j];
+ *csum += data;
+ *icsum += ~data;
+ }
+ return 0;
+}
+#endif
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/__osRepairPackId.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/__osCheckPackId.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/__osGetId.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/func_8000D7E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contpfs/func_8000D8B4.s")
diff --git a/src/dk64_boot/io/contramread.c b/src/dk64_boot/io/contramread.c
new file mode 100644
index 00000000..643e3b2f
--- /dev/null
+++ b/src/dk64_boot/io/contramread.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contramread/__osContRamReadData.s")
diff --git a/src/dk64_boot/io/contramwrite.c b/src/dk64_boot/io/contramwrite.c
new file mode 100644
index 00000000..6d42dbc0
--- /dev/null
+++ b/src/dk64_boot/io/contramwrite.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contramwrite/__osContRamWrite.s")
diff --git a/src/dk64_boot/io/contramwritesafe.c b/src/dk64_boot/io/contramwritesafe.c
new file mode 100644
index 00000000..8a240bcc
--- /dev/null
+++ b/src/dk64_boot/io/contramwritesafe.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/contramwritesafe/__osPackRamWriteDataSafe.s")
diff --git a/src/dk64_boot/io/controller.c b/src/dk64_boot/io/controller.c
new file mode 100644
index 00000000..88826250
--- /dev/null
+++ b/src/dk64_boot/io/controller.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/controller/osContInit.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/controller/__osContGetInitData.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/controller/__osPackRequestData.s")
diff --git a/src/dk64_boot/io/crc.c b/src/dk64_boot/io/crc.c
new file mode 100644
index 00000000..ec80c092
--- /dev/null
+++ b/src/dk64_boot/io/crc.c
@@ -0,0 +1,6 @@
+#include
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/crc/__osContAddressCrc.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/crc/__osContDataCrc.s")
diff --git a/src/dk64_boot/io/devmgr.c b/src/dk64_boot/io/devmgr.c
new file mode 100644
index 00000000..535f15e5
--- /dev/null
+++ b/src/dk64_boot/io/devmgr.c
@@ -0,0 +1,5 @@
+#include
+#include "piint.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/devmgr/__osDevMgrMain.s")
diff --git a/src/dk64_boot/io/dpgetstat.c b/src/dk64_boot/io/dpgetstat.c
new file mode 100644
index 00000000..a612932d
--- /dev/null
+++ b/src/dk64_boot/io/dpgetstat.c
@@ -0,0 +1,6 @@
+#include
+#include
+
+u32 osDpGetStatus() {
+ return IO_READ(DPC_STATUS_REG);
+}
diff --git a/src/dk64_boot/io/dpsetstat.c b/src/dk64_boot/io/dpsetstat.c
new file mode 100644
index 00000000..dc33c498
--- /dev/null
+++ b/src/dk64_boot/io/dpsetstat.c
@@ -0,0 +1,7 @@
+ #include
+#include
+
+void osDpSetStatus(u32 data)
+{
+ IO_WRITE(DPC_STATUS_REG, data);
+}
diff --git a/src/dk64_boot/io/epirawread.c b/src/dk64_boot/io/epirawread.c
new file mode 100644
index 00000000..a0c6bca6
--- /dev/null
+++ b/src/dk64_boot/io/epirawread.c
@@ -0,0 +1,22 @@
+#include
+#include
+#include "piint.h"
+
+#define UPDATE_REG(reg, var) \
+ if (cHandle->var != pihandle->var) \
+ IO_WRITE(reg, pihandle->var);
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/epirawread/osEPiRawReadIo.s")
+#else
+s32 osEPiRawReadIo(OSPiHandle *pihandle, u32 devAddr, u32 *data)
+{
+ register u32 stat;
+ register u32 domain;
+
+ EPI_SYNC(pihandle,stat,domain);
+
+ *data = IO_READ(pihandle->baseAddress | devAddr);
+ return 0;
+}
+#endif
\ No newline at end of file
diff --git a/src/dk64_boot/io/epirawwrite.c b/src/dk64_boot/io/epirawwrite.c
new file mode 100644
index 00000000..4cdfb99b
--- /dev/null
+++ b/src/dk64_boot/io/epirawwrite.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/epirawwrite/osEPiRawWriteIo.s")
diff --git a/src/dk64_boot/io/motor.c b/src/dk64_boot/io/motor.c
new file mode 100644
index 00000000..ff71b7c4
--- /dev/null
+++ b/src/dk64_boot/io/motor.c
@@ -0,0 +1,124 @@
+#include
+#include "controller.h"
+#include "siint.h"
+
+extern u8 D_80014E00;
+extern OSPifRam D_80014E50[];
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/motor/osMotorStartStop.s")
+#else
+s32 osMotorStartStop(OSPfs *pfs, int arg1)
+{
+
+ int i;
+ s32 ret;
+ u8 *ptr;
+ __OSContRamReadFormat *ramreadformat;
+
+ ramreadformat = (__OSContRamReadFormat *) D_80014E50[pfs->channel].ramarray;
+
+ if (!(pfs->status & 0x8))
+ return PFS_ERR_INVALID;
+
+ __osSiGetAccess();
+ D_80014E50[pfs->channel].pifstatus = 1;
+
+ for (i = 0; i < 0x20; i++)
+ ramreadformat->data[i] = arg1;
+
+ D_80014E00 = CONT_CMD_END;
+ __osSiRawStartDma(OS_WRITE, D_80014E50[pfs->channel].ramarray);
+ osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK);
+ __osSiRawStartDma(OS_READ, D_80014E50[pfs->channel].ramarray);
+ osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK);
+ ret = ramreadformat->rxsize & CHNL_ERR_MASK;
+ if (ret == 0) {
+ if (!arg1) {
+ if (ramreadformat->datacrc != 0)
+ ret = PFS_ERR_CONTRFAIL;
+ } else {
+ if (ramreadformat->datacrc != 0xEB)
+ ret = PFS_ERR_CONTRFAIL;
+ }
+ }
+ __osSiRelAccess();
+ return ret;
+}
+#endif
+
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/motor/_MakeMotorData.s")
+#else
+static void _MakeMotorData(int channel, OSPifRam *mdata)
+{
+ u8 *ptr;
+ __OSContRamReadFormat ramreadformat;
+ int i;
+
+ ramreadformat.dummy = CONT_CMD_NOP;
+ ramreadformat.txsize = CONT_CMD_WRITE_MEMPACK_TX;
+ ramreadformat.rxsize = CONT_CMD_WRITE_MEMPACK_RX;
+ ramreadformat.cmd = CONT_CMD_WRITE_MEMPACK;
+ ramreadformat.unk4 = 0x600 >> 3;
+
+ ptr = (u8 *)mdata->ramarray;
+ ramreadformat.unk5 = (0x600 << 5) | __osContAddressCrc(0x600);
+
+ if (channel != 0)
+ {
+ for (i = 0; i < channel; i++)
+ {
+ *ptr++ = 0;
+ }
+ }
+ *(__OSContRamReadFormat *)ptr = ramreadformat;
+ ptr += sizeof(__OSContRamReadFormat);
+ ptr[0] = CONT_CMD_END;
+}
+#endif
+
+s32 osMotorInit(OSMesgQueue *mq, OSPfs *pfs, int channel)
+{
+ s32 ret;
+ u8 temp[32];
+ pfs->queue = mq;
+ pfs->channel = channel;
+ pfs->activebank = 0xff;
+ pfs->status = 0;
+
+ ret = __osPackRamWriteDataSafe(pfs, 254);
+ if (ret == 2) //TODO: remove magic constant
+ ret = __osPackRamWriteDataSafe(pfs, 128);
+ if (ret != 0)
+ return ret;
+
+ ret = __osContRamReadData(mq, channel, 1024, temp); // ret = __osContRamRead(mq, channel, 1024, temp);
+ if (ret == 2)
+ ret = PFS_ERR_CONTRFAIL; //is this right?
+ if (ret != 0)
+ return ret;
+ if (temp[31] == 254)
+ return PFS_ERR_DEVICE;
+
+ ret = __osPackRamWriteDataSafe(pfs, 128);
+ if (ret == 2) //TODO: remove magic constant
+ ret = PFS_ERR_CONTRFAIL;
+ if (ret != 0)
+ return ret;
+
+ ret = __osContRamReadData(mq, channel, 1024, temp); // ret = __osContRamRead(mq, channel, 1024, temp);
+ if (ret == 2)
+ ret = PFS_ERR_CONTRFAIL;
+ if (ret != 0)
+ return ret;
+ if (temp[31] != 128)
+ return PFS_ERR_DEVICE;
+
+ if (!(pfs->status & 0x8)) {
+ _MakeMotorData(channel, &D_80014E50[channel]);
+ }
+ pfs->status = 0x8;
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/pfsgetstatus.c b/src/dk64_boot/io/pfsgetstatus.c
new file mode 100644
index 00000000..f9b43ad0
--- /dev/null
+++ b/src/dk64_boot/io/pfsgetstatus.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsgetstatus/__osPfsGetStatus.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsgetstatus/__osPfsRequestOneChannel.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsgetstatus/__osPfsGetOneChannelData.s")
diff --git a/src/dk64_boot/io/pfsisplug.c b/src/dk64_boot/io/pfsisplug.c
new file mode 100644
index 00000000..2d285e6c
--- /dev/null
+++ b/src/dk64_boot/io/pfsisplug.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsisplug/osPfsIsPlug.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsisplug/__osPfsRequestData.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pfsisplug/__osPfsGetInitData.s")
diff --git a/src/dk64_boot/io/piacs.c b/src/dk64_boot/io/piacs.c
new file mode 100644
index 00000000..a0fc7fa6
--- /dev/null
+++ b/src/dk64_boot/io/piacs.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/piacs/__osPiCreateAccessQueue.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/piacs/__osPiGetAccess.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/piacs/__osPiRelAccess.s")
diff --git a/src/dk64_boot/io/pigetcmdq.c b/src/dk64_boot/io/pigetcmdq.c
new file mode 100644
index 00000000..2b630133
--- /dev/null
+++ b/src/dk64_boot/io/pigetcmdq.c
@@ -0,0 +1,13 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+extern OSDevMgr __osPiDevMgr;
+
+OSMesgQueue *osPiGetCmdQueue(void) {
+ if (!__osPiDevMgr.active)
+ return NULL;
+ return __osPiDevMgr.cmdQueue;
+
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/pigetstat.c b/src/dk64_boot/io/pigetstat.c
new file mode 100644
index 00000000..850b8238
--- /dev/null
+++ b/src/dk64_boot/io/pigetstat.c
@@ -0,0 +1,7 @@
+#include
+#include "piint.h"
+
+u32 osPiGetStatus()
+{
+ return IO_READ(PI_STATUS_REG);
+}
diff --git a/src/dk64_boot/io/pimgr.c b/src/dk64_boot/io/pimgr.c
new file mode 100644
index 00000000..97e9e5b9
--- /dev/null
+++ b/src/dk64_boot/io/pimgr.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/pimgr/osCreatePiManager.s")
diff --git a/src/dk64_boot/io/pirawdma.c b/src/dk64_boot/io/pirawdma.c
new file mode 100644
index 00000000..95c23f93
--- /dev/null
+++ b/src/dk64_boot/io/pirawdma.c
@@ -0,0 +1,22 @@
+#include
+#include "piint.h"
+
+s32 osPiRawStartDma(s32 direction, u32 devAddr, void *dramAddr, u32 size)
+{
+ register u32 stat;
+ WAIT_ON_IOBUSY(stat);
+ IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr));
+ IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS((u32)osRomBase | devAddr));
+ switch (direction)
+ {
+ case OS_READ:
+ IO_WRITE(PI_WR_LEN_REG, size - 1);
+ break;
+ case OS_WRITE:
+ IO_WRITE(PI_RD_LEN_REG, size - 1);
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
diff --git a/src/dk64_boot/io/pirawread.c b/src/dk64_boot/io/pirawread.c
new file mode 100644
index 00000000..d7145053
--- /dev/null
+++ b/src/dk64_boot/io/pirawread.c
@@ -0,0 +1,10 @@
+#include
+#include "piint.h"
+
+s32 osPiRawReadIo(u32 devAddr, u32 *data)
+{
+ register u32 stat;
+ WAIT_ON_IOBUSY(stat);
+ *data = IO_READ((u32)osRomBase | devAddr);
+ return 0;
+}
diff --git a/src/dk64_boot/io/piread.c b/src/dk64_boot/io/piread.c
new file mode 100644
index 00000000..e2e1c1e4
--- /dev/null
+++ b/src/dk64_boot/io/piread.c
@@ -0,0 +1,11 @@
+#include
+#include "piint.h"
+
+s32 osPiReadIo(u32 devAddr, u32 *data)
+{
+ register s32 ret;
+ __osPiGetAccess();
+ ret = osPiRawReadIo(devAddr, data);
+ __osPiRelAccess();
+ return ret;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/si.c b/src/dk64_boot/io/si.c
new file mode 100644
index 00000000..5f46fe85
--- /dev/null
+++ b/src/dk64_boot/io/si.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/si/__osSiDeviceBusy.s")
diff --git a/src/dk64_boot/io/siacs.c b/src/dk64_boot/io/siacs.c
new file mode 100644
index 00000000..31f22028
--- /dev/null
+++ b/src/dk64_boot/io/siacs.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/siacs/__osSiCreateAccessQueue.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/siacs/__osSiGetAccess.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/siacs/__osSiRelAccess.s")
diff --git a/src/dk64_boot/io/sirawdma.c b/src/dk64_boot/io/sirawdma.c
new file mode 100644
index 00000000..99ea28c7
--- /dev/null
+++ b/src/dk64_boot/io/sirawdma.c
@@ -0,0 +1,28 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/sirawdma/__osSiRawStartDma.s")
+#else
+s32 __osSiRawStartDma(s32 direction, void *dramAddr)
+{
+ if (IO_READ(SI_STATUS_REG) & (SI_STATUS_DMA_BUSY | SI_STATUS_RD_BUSY))
+ return -1;
+
+ if (direction == OS_WRITE)
+ osWritebackDCache(dramAddr, 64);
+
+ IO_WRITE(SI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr));
+
+ if (direction == OS_READ)
+ IO_WRITE(SI_PIF_ADDR_RD64B_REG, 0x1FC007C0);
+ else
+ IO_WRITE(SI_PIF_ADDR_WR64B_REG, 0x1FC007C0);
+
+ if (direction == OS_READ)
+ osInvalDCache(dramAddr, 64);//bzero(dramAddr, 64);
+
+ return 0;
+}
+#endif
\ No newline at end of file
diff --git a/src/dk64_boot/io/sirawread.c b/src/dk64_boot/io/sirawread.c
new file mode 100644
index 00000000..1e981259
--- /dev/null
+++ b/src/dk64_boot/io/sirawread.c
@@ -0,0 +1,9 @@
+#include
+
+s32 __osSiRawReadIo(u32 devAddr, u32 *data)
+{
+ if (__osSiDeviceBusy())
+ return -1;
+ *data = IO_READ(devAddr);
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/sirawwrite.c b/src/dk64_boot/io/sirawwrite.c
new file mode 100644
index 00000000..6152d19b
--- /dev/null
+++ b/src/dk64_boot/io/sirawwrite.c
@@ -0,0 +1,10 @@
+#include
+#include "osint.h"
+
+s32 __osSiRawWriteIo(u32 devAddr, u32 data)
+{
+ if (__osSiDeviceBusy())
+ return -1;
+ IO_WRITE(devAddr, data);
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/sp.c b/src/dk64_boot/io/sp.c
new file mode 100644
index 00000000..2e85015a
--- /dev/null
+++ b/src/dk64_boot/io/sp.c
@@ -0,0 +1,9 @@
+#include
+
+int __osSpDeviceBusy()
+{
+ register u32 stat = IO_READ(SP_STATUS_REG);
+ if (stat & (SP_STATUS_DMA_BUSY | SP_STATUS_DMA_FULL | SP_STATUS_IO_FULL))
+ return 1;
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/spgetstat.c b/src/dk64_boot/io/spgetstat.c
new file mode 100644
index 00000000..d0cecb35
--- /dev/null
+++ b/src/dk64_boot/io/spgetstat.c
@@ -0,0 +1,6 @@
+#include
+
+u32 __osSpGetStatus()
+{
+ return IO_READ(SP_STATUS_REG);
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/sprawdma.c b/src/dk64_boot/io/sprawdma.c
new file mode 100644
index 00000000..feaad912
--- /dev/null
+++ b/src/dk64_boot/io/sprawdma.c
@@ -0,0 +1,16 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+s32 __osSpRawStartDma(s32 direction, u32 devAddr, void *dramAddr, u32 size)
+{
+ if (__osSpDeviceBusy())
+ return -1;
+ IO_WRITE(SP_MEM_ADDR_REG, devAddr);
+ IO_WRITE(SP_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr));
+ if (direction == OS_READ)
+ IO_WRITE(SP_WR_LEN_REG, size - 1);
+ else
+ IO_WRITE(SP_RD_LEN_REG, size - 1);
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/spsetpc.c b/src/dk64_boot/io/spsetpc.c
new file mode 100644
index 00000000..fc956fbe
--- /dev/null
+++ b/src/dk64_boot/io/spsetpc.c
@@ -0,0 +1,15 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+s32 __osSpSetPc(u32 data)
+{
+ register u32 stat = IO_READ(SP_STATUS_REG);
+ if (!(stat & SP_STATUS_HALT))
+ return -1;
+ else
+ {
+ IO_WRITE(SP_PC_REG, data);
+ }
+ return 0;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/spsetstat.c b/src/dk64_boot/io/spsetstat.c
new file mode 100644
index 00000000..636a5fe8
--- /dev/null
+++ b/src/dk64_boot/io/spsetstat.c
@@ -0,0 +1,6 @@
+#include
+#include
+
+void __osSpSetStatus(u32 data) {
+ IO_WRITE(SP_STATUS_REG, data);
+}
diff --git a/src/dk64_boot/io/sptask.c b/src/dk64_boot/io/sptask.c
new file mode 100644
index 00000000..038d51f3
--- /dev/null
+++ b/src/dk64_boot/io/sptask.c
@@ -0,0 +1,66 @@
+#include
+#include
+#include
+#include
+#include "osint.h"
+
+#define _osVirtualToPhysical(ptr) \
+ if (ptr != NULL) \
+ { \
+ ptr = (void *)osVirtualToPhysical(ptr); \
+ }
+
+OSTask tmp_task;
+static OSTask *_VirtualToPhysicalTask(OSTask *intp)
+{
+ OSTask *tp;
+ tp = &tmp_task;
+ bcopy(intp, tp, sizeof(OSTask));
+
+ _osVirtualToPhysical(tp->t.ucode);
+ _osVirtualToPhysical(tp->t.ucode_data);
+ _osVirtualToPhysical(tp->t.dram_stack);
+ _osVirtualToPhysical(tp->t.output_buff);
+ _osVirtualToPhysical(tp->t.output_buff_size);
+ _osVirtualToPhysical(tp->t.data_ptr);
+ _osVirtualToPhysical(tp->t.yield_data_ptr);
+ return tp;
+}
+void osSpTaskLoad(OSTask *intp)
+{
+
+ OSTask *tp;
+ tp = _VirtualToPhysicalTask(intp);
+ if (tp->t.flags & OS_TASK_YIELDED)
+ {
+ tp->t.ucode_data = tp->t.yield_data_ptr;
+ tp->t.ucode_data_size = tp->t.yield_data_size;
+ intp->t.flags &= ~OS_TASK_YIELDED;
+ if (tp->t.flags & OS_TASK_LOADABLE)
+ tp->t.ucode = (u64 *)IO_READ((u32)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4);
+ }
+ osWritebackDCache(tp, sizeof(OSTask));
+ __osSpSetStatus(SP_CLR_YIELD | SP_CLR_YIELDED | SP_CLR_TASKDONE | SP_SET_INTR_BREAK);
+ while (__osSpSetPc(SP_IMEM_START) == -1)
+ ;
+
+ while (__osSpRawStartDma(1, (SP_IMEM_START - sizeof(*tp)), tp,
+ sizeof(OSTask)) == -1)
+ ;
+
+ while (__osSpDeviceBusy())
+ ;
+
+ while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot,
+ tp->t.ucode_boot_size) == -1)
+ ;
+}
+void osSpTaskStartGo(OSTask *tp)
+{
+
+ while (__osSpDeviceBusy())
+ ;
+
+ __osSpSetStatus(SP_SET_INTR_BREAK | SP_CLR_SSTEP | SP_CLR_BROKE | SP_CLR_HALT);
+
+}
diff --git a/src/dk64_boot/io/sptaskyield.c b/src/dk64_boot/io/sptaskyield.c
new file mode 100644
index 00000000..61d62f5c
--- /dev/null
+++ b/src/dk64_boot/io/sptaskyield.c
@@ -0,0 +1,7 @@
+#include
+#include
+
+void osSpTaskYield(void)
+{
+ __osSpSetStatus(SP_SET_YIELD);
+}
diff --git a/src/dk64_boot/io/sptaskyielded.c b/src/dk64_boot/io/sptaskyielded.c
new file mode 100644
index 00000000..f036be12
--- /dev/null
+++ b/src/dk64_boot/io/sptaskyielded.c
@@ -0,0 +1,20 @@
+#include
+#include
+#include
+
+OSYieldResult osSpTaskYielded(OSTask *tp)
+{
+ u32 status;
+ OSYieldResult result;
+ status = __osSpGetStatus();
+ if (status & SP_STATUS_YIELDED)
+ result = OS_TASK_YIELDED;
+ else
+ result = 0;
+ if (status & SP_STATUS_YIELD)
+ {
+ tp->t.flags |= result;
+ tp->t.flags &= ~(OS_TASK_DP_WAIT);
+ }
+ return result;
+}
diff --git a/src/dk64_boot/io/vi.c b/src/dk64_boot/io/vi.c
new file mode 100644
index 00000000..b957913a
--- /dev/null
+++ b/src/dk64_boot/io/vi.c
@@ -0,0 +1,39 @@
+#include
+#include "viint.h"
+
+extern s32 osTvType;
+extern OSViMode D_80010210;
+extern OSViMode D_80010260;
+extern OSViMode D_800102B0;
+
+static __OSViContext vi[2] = {0};
+__OSViContext *__osViCurr = &vi[0];
+__OSViContext *__osViNext = &vi[1];
+void __osViInit(void)
+{
+ bzero(vi, sizeof(vi));
+ __osViCurr = &vi[0];
+ __osViNext = &vi[1];
+ __osViNext->retraceCount = 1;
+ __osViCurr->retraceCount = 1;
+ __osViNext->framep = (void*)K0BASE;
+ __osViCurr->framep = (void*)K0BASE;
+ if (osTvType == OS_TV_TYPE_PAL)
+ {
+ __osViNext->modep = &D_80010210;
+ }
+ else if (osTvType == OS_TV_TYPE_MPAL)
+ {
+ __osViNext->modep = &D_80010260;
+ }
+ else
+ {
+ __osViNext->modep = &D_800102B0;
+ }
+ __osViNext->state = VI_STATE_BLACK;
+ __osViNext->control = __osViNext->modep->comRegs.ctrl;
+ while (IO_READ(VI_CURRENT_REG) > 10) //wait for vsync?
+ ;
+ IO_WRITE(VI_CONTROL_REG, 0); //pixel size blank (no data, no sync)
+ __osViSwapContext();
+}
diff --git a/src/dk64_boot/io/viblack.c b/src/dk64_boot/io/viblack.c
new file mode 100644
index 00000000..76cd0b29
--- /dev/null
+++ b/src/dk64_boot/io/viblack.c
@@ -0,0 +1,11 @@
+#include
+#include "viint.h"
+void osViBlack(u8 active)
+{
+ register u32 saveMask = __osDisableInt();
+ if (active)
+ __osViNext->state |= VI_STATE_BLACK;
+ else
+ __osViNext->state &= ~VI_STATE_BLACK;
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/io/vigetcurrcontext.c b/src/dk64_boot/io/vigetcurrcontext.c
new file mode 100644
index 00000000..50e372b2
--- /dev/null
+++ b/src/dk64_boot/io/vigetcurrcontext.c
@@ -0,0 +1,7 @@
+#include
+#include "viint.h"
+
+__OSViContext *__osViGetCurrentContext(void)
+{
+ return __osViCurr;
+}
\ No newline at end of file
diff --git a/src/dk64_boot/io/vigetcurrframebuf.c b/src/dk64_boot/io/vigetcurrframebuf.c
new file mode 100644
index 00000000..58942cd2
--- /dev/null
+++ b/src/dk64_boot/io/vigetcurrframebuf.c
@@ -0,0 +1,12 @@
+#include
+#include "viint.h"
+
+void *osViGetCurrentFramebuffer(void)
+{
+ register u32 saveMask;
+ void *framep;
+ saveMask = __osDisableInt();
+ framep = __osViCurr->framep;
+ __osRestoreInt(saveMask);
+ return framep;
+}
diff --git a/src/dk64_boot/io/vigetmode.c b/src/dk64_boot/io/vigetmode.c
new file mode 100644
index 00000000..5eb39f80
--- /dev/null
+++ b/src/dk64_boot/io/vigetmode.c
@@ -0,0 +1,12 @@
+#include
+#include "viint.h"
+
+u32 osViGetCurrentMode(void)
+{
+ register u32 savedMask;
+ register u32 modeType;
+ savedMask = __osDisableInt();
+ modeType = __osViCurr->modep->type;
+ __osRestoreInt(savedMask);
+ return modeType;
+}
diff --git a/src/dk64_boot/io/vigetnextframebuf.c b/src/dk64_boot/io/vigetnextframebuf.c
new file mode 100644
index 00000000..6a23fddd
--- /dev/null
+++ b/src/dk64_boot/io/vigetnextframebuf.c
@@ -0,0 +1,13 @@
+#include
+#include "viint.h"
+
+void *osViGetNextFramebuffer(void)
+{
+
+ register u32 saveMask;
+ void *framep;
+ saveMask = __osDisableInt();
+ framep = __osViNext->framep;
+ __osRestoreInt(saveMask);
+ return framep;
+}
diff --git a/src/dk64_boot/io/vimgr.c b/src/dk64_boot/io/vimgr.c
new file mode 100644
index 00000000..84d16519
--- /dev/null
+++ b/src/dk64_boot/io/vimgr.c
@@ -0,0 +1,12 @@
+#include
+#include
+#include "viint.h"
+#include "osint.h"
+
+OSDevMgr __osViDevMgr = {0};
+u32 D_8000EF1C = 0;
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/vimgr/osCreateViManager.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/vimgr/viMgrMain.s")
diff --git a/src/dk64_boot/io/visetmode.c b/src/dk64_boot/io/visetmode.c
new file mode 100644
index 00000000..f25ce5b2
--- /dev/null
+++ b/src/dk64_boot/io/visetmode.c
@@ -0,0 +1,13 @@
+#include
+#include "viint.h"
+
+void osViSetMode(OSViMode *modep)
+{
+ register u32 saveMask;
+ saveMask = __osDisableInt();
+ __osViNext->modep = modep;
+ __osViNext->state = VI_STATE_01;
+ __osViNext->control = __osViNext->modep->comRegs.ctrl;
+ __osRestoreInt(saveMask);
+}
+
diff --git a/src/dk64_boot/io/visetspecial.c b/src/dk64_boot/io/visetspecial.c
new file mode 100644
index 00000000..42b5f085
--- /dev/null
+++ b/src/dk64_boot/io/visetspecial.c
@@ -0,0 +1,38 @@
+#include
+#include
+#include "viint.h"
+
+void osViSetSpecialFeatures(u32 func) {
+
+ register u32 saveMask;
+ saveMask = __osDisableInt();
+ if ((func & OS_VI_GAMMA_ON) != 0) {
+ __osViNext->control |= VI_CTRL_GAMMA_ON;
+ }
+ if ((func & OS_VI_GAMMA_OFF) != 0) {
+ __osViNext->control &= ~VI_CTRL_GAMMA_ON;
+ }
+ if ((func & OS_VI_GAMMA_DITHER_ON) != 0) {
+ __osViNext->control |= VI_CTRL_GAMMA_DITHER_ON;
+ }
+ if ((func & OS_VI_GAMMA_DITHER_OFF) != 0) {
+ __osViNext->control &= ~VI_CTRL_GAMMA_DITHER_ON;
+ }
+ if ((func & OS_VI_DIVOT_ON) != 0) {
+ __osViNext->control |= VI_CTRL_DIVOT_ON;
+ }
+ if ((func & OS_VI_DIVOT_OFF) != 0) {
+ __osViNext->control &= ~VI_CTRL_DIVOT_ON;
+ }
+ if ((func & OS_VI_DITHER_FILTER_ON) != 0) {
+ __osViNext->control |= VI_CTRL_DITHER_FILTER_ON;
+ __osViNext->control &= ~VI_CTRL_ANTIALIAS_MASK;
+ }
+ if ((func & OS_VI_DITHER_FILTER_OFF) != 0) {
+ __osViNext->control &= ~VI_CTRL_DITHER_FILTER_ON;
+ __osViNext->control |= __osViNext->modep->comRegs.ctrl & VI_CTRL_ANTIALIAS_MASK;
+ }
+ __osViNext->state |= VI_STATE_08;
+
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/io/viswapbuf.c b/src/dk64_boot/io/viswapbuf.c
new file mode 100644
index 00000000..6e0f74f5
--- /dev/null
+++ b/src/dk64_boot/io/viswapbuf.c
@@ -0,0 +1,9 @@
+#include
+#include "viint.h"
+
+void osViSwapBuffer(void* frameBufPtr) {
+ u32 saveMask = __osDisableInt();
+ __osViNext->framep = frameBufPtr;
+ __osViNext->state |= VI_STATE_10;
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/io/viswapcontext.c b/src/dk64_boot/io/viswapcontext.c
new file mode 100644
index 00000000..4aaaece8
--- /dev/null
+++ b/src/dk64_boot/io/viswapcontext.c
@@ -0,0 +1,4 @@
+#include
+#include "viint.h"
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/io/viswapcontext/__osViSwapContext.s")
diff --git a/src/dk64_boot/libc/llcvt.c b/src/dk64_boot/libc/llcvt.c
new file mode 100644
index 00000000..4869cdca
--- /dev/null
+++ b/src/dk64_boot/libc/llcvt.c
@@ -0,0 +1,20 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/__ull_to_f.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_800075CC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_800075E8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_80007688.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_80007724.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_8000773C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_80007754.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/libc/llcvt/func_80007788.s")
diff --git a/src/dk64_boot/os/createmesgqueue.c b/src/dk64_boot/os/createmesgqueue.c
new file mode 100644
index 00000000..65d75da9
--- /dev/null
+++ b/src/dk64_boot/os/createmesgqueue.c
@@ -0,0 +1,12 @@
+#include
+#include "osint.h"
+
+void osCreateMesgQueue(OSMesgQueue *mq, OSMesg *msg, s32 msgCount)
+{
+ mq->mtqueue = (OSThread *)&__osThreadTail;
+ mq->fullqueue = (OSThread *)&__osThreadTail;
+ mq->validCount = 0;
+ mq->first = 0;
+ mq->msgCount = msgCount;
+ mq->msg = msg;
+}
diff --git a/src/dk64_boot/os/createthread.c b/src/dk64_boot/os/createthread.c
new file mode 100644
index 00000000..f3b8b242
--- /dev/null
+++ b/src/dk64_boot/os/createthread.c
@@ -0,0 +1,36 @@
+#include
+#include
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/os/createthread/osCreateThread.s")
+
+/*
+// TODO: Needs __osCleanupThread(void) address
+void __osCleanupThread(void);
+extern OSThread *__osActiveQueue;
+
+void osCreateThread(OSThread *t, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri p)
+{
+ register u32 saveMask;
+ OSIntMask mask;
+ t->id = id;
+ t->priority = p;
+ t->next = NULL;
+ t->queue = NULL;
+ t->context.pc = (u32)entry;
+ t->context.a0 = (u64)arg;
+ t->context.sp = (u64)sp - 16;
+ t->context.ra = (u64)__osCleanupThread;
+ mask = OS_IM_ALL;
+ t->context.sr = SR_IMASK | SR_EXL | SR_IE;
+ t->context.rcp = (mask & RCP_IMASK) >> RCP_IMASKSHIFT;
+ t->context.fpcsr = (u32)(FPCSR_FS | FPCSR_EV);
+ t->fp = 0;
+ t->state = OS_STATE_STOPPED;
+ t->flags = 0;
+ saveMask = __osDisableInt();
+ t->tlnext = __osActiveQueue;
+ __osActiveQueue = t;
+ __osRestoreInt(saveMask);
+}
+*/
diff --git a/src/dk64_boot/os/destroythread.c b/src/dk64_boot/os/destroythread.c
new file mode 100644
index 00000000..604ab716
--- /dev/null
+++ b/src/dk64_boot/os/destroythread.c
@@ -0,0 +1,45 @@
+#include
+#include "osint.h"
+
+void osDestroyThread(OSThread *t)
+{
+ register u32 saveMask;
+ register OSThread *pred;
+ register OSThread *succ;
+ saveMask = __osDisableInt();
+ if (t == NULL)
+ {
+ t = __osRunningThread;
+ }
+ else
+ {
+ if (t->state != OS_STATE_STOPPED)
+ {
+ __osDequeueThread(t->queue, t);
+ }
+ }
+ if (__osActiveQueue == t)
+ {
+ __osActiveQueue = __osActiveQueue->tlnext;
+ }
+ else
+ {
+ pred = __osActiveQueue;
+
+ while (pred->priority != -1)
+ {
+ succ = pred->tlnext;
+ if (succ == t)
+ {
+ pred->tlnext = t->tlnext;
+ break;
+ }
+ pred = succ;
+ }
+ }
+ if (t == __osRunningThread)
+ {
+ __osDispatchThread();
+ }
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/getthreadid.c b/src/dk64_boot/os/getthreadid.c
new file mode 100644
index 00000000..898c4504
--- /dev/null
+++ b/src/dk64_boot/os/getthreadid.c
@@ -0,0 +1,9 @@
+#include
+#include "osint.h"
+
+OSId osGetThreadId(OSThread *thread)
+{
+ if (thread == NULL)
+ thread = __osRunningThread;
+ return thread->id;
+}
diff --git a/src/dk64_boot/os/getthreadpri.c b/src/dk64_boot/os/getthreadpri.c
new file mode 100644
index 00000000..efeaf729
--- /dev/null
+++ b/src/dk64_boot/os/getthreadpri.c
@@ -0,0 +1,12 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern OSThread *__osRunningThread;
+
+OSPri osGetThreadPri(OSThread *thread)
+{
+ if (thread == NULL)
+ thread = __osRunningThread;
+ return thread->priority;
+}
diff --git a/src/dk64_boot/os/gettime.c b/src/dk64_boot/os/gettime.c
new file mode 100644
index 00000000..e7aa4f7a
--- /dev/null
+++ b/src/dk64_boot/os/gettime.c
@@ -0,0 +1,16 @@
+#include
+#include "osint.h"
+
+OSTime osGetTime()
+{
+ u32 tmptime;
+ u32 elapseCount;
+ OSTime currentCount;
+ register u32 saveMask;
+ saveMask = __osDisableInt();
+ tmptime = osGetCount();
+ elapseCount = tmptime - __osBaseCounter;
+ currentCount = __osCurrentTime;
+ __osRestoreInt(saveMask);
+ return currentCount + elapseCount;
+}
diff --git a/src/dk64_boot/os/initialize.c b/src/dk64_boot/os/initialize.c
new file mode 100644
index 00000000..e7b3cff3
--- /dev/null
+++ b/src/dk64_boot/os/initialize.c
@@ -0,0 +1,68 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/os/initialize/osInitialize.s")
+
+/*
+typedef struct
+{
+ unsigned int inst1; // 0x0
+ unsigned int inst2; // 0x4
+ unsigned int inst3; // 0x8
+ unsigned int inst4; // 0xC
+} __osExceptionVector;
+extern __osExceptionVector __osExceptionPreamble;
+
+extern OSTime osClockRate;// = OS_CLOCK_RATE;
+extern s32 osViClock;// = VI_NTSC_CLOCK;
+extern u32 __osShutdown;// = 0;
+extern u32 __OSGlobalIntMask;// = OS_IM_ALL;
+extern u32 __osFinalrom;
+
+void osInitialize()
+{
+ u32 pifdata;
+ u32 clock = 0;
+ __osFinalrom = TRUE;
+ __osSetSR(__osGetSR() | SR_CU1); //enable fpu
+ __osSetFpcCsr(FPCSR_FS | FPCSR_EV); //flush denorm to zero, enable invalid operation
+
+ while (__osSiRawReadIo(PIF_RAM_END - 3, &pifdata)) //last byte of joychannel ram
+ {
+ ;
+ }
+ while (__osSiRawWriteIo(PIF_RAM_END - 3, pifdata | 8))
+ {
+ ; //todo: magic contant
+ }
+ *(__osExceptionVector *)UT_VEC = __osExceptionPreamble;
+ *(__osExceptionVector *)XUT_VEC = __osExceptionPreamble;
+ *(__osExceptionVector *)ECC_VEC = __osExceptionPreamble;
+ *(__osExceptionVector *)E_VEC = __osExceptionPreamble;
+ osWritebackDCache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector));
+ osInvalICache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector));
+ osMapTLBRdb();
+ //osUnmapTLBAll(); // TODO: Which function is actually called here
+ //osUnmapTLBAll(); // TODO: Which function is actually called here
+ osPiRawReadIo(4, &clock); //TODO: remove magic constant;
+ clock &= ~0xf; //clear lower 4 bits
+ if (clock != 0)
+ {
+ osClockRate = clock;
+ }
+ //osClockRate = osClockRate * 3 / 4; // TODO: How do we do division/multiplication on a u64?
+ if (osResetType == 0) // cold reset
+ {
+ bzero(osAppNMIBuffer, OS_APP_NMI_BUFSIZE);
+ }
+ if (osTvType == OS_TV_PAL) {
+ osViClock = VI_PAL_CLOCK;
+ } else if (osTvType == OS_TV_MPAL) {
+ osViClock = VI_MPAL_CLOCK;
+ } else {
+ osViClock = VI_NTSC_CLOCK;
+ }
+}
+*/
diff --git a/src/dk64_boot/os/jammesg.c b/src/dk64_boot/os/jammesg.c
new file mode 100644
index 00000000..3c427517
--- /dev/null
+++ b/src/dk64_boot/os/jammesg.c
@@ -0,0 +1,30 @@
+#include
+#include "osint.h"
+
+s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag)
+{
+ register u32 saveMask = __osDisableInt();
+ while (mq->validCount >= mq->msgCount)
+ {
+ if (flag == OS_MESG_BLOCK)
+ {
+ __osRunningThread->state = OS_STATE_WAITING;
+ __osEnqueueAndYield(&mq->fullqueue);
+ }
+ else
+ {
+ __osRestoreInt(saveMask);
+ return -1;
+ }
+ }
+
+ mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount;
+ mq->msg[mq->first] = msg;
+ mq->validCount++;
+ if (mq->mtqueue->next != NULL)
+ {
+ osStartThread(__osPopThread(&mq->mtqueue));
+ }
+ __osRestoreInt(saveMask);
+ return 0;
+}
diff --git a/src/dk64_boot/os/pidma.c b/src/dk64_boot/os/pidma.c
new file mode 100644
index 00000000..c2fa377f
--- /dev/null
+++ b/src/dk64_boot/os/pidma.c
@@ -0,0 +1,32 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+extern OSDevMgr __osPiDevMgr;
+
+s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *dramAddr, u32 size, OSMesgQueue *mq)
+{
+ register s32 ret;
+ if (!__osPiDevMgr.active)
+ return -1;
+ if (direction == OS_READ)
+ mb->hdr.type = OS_MESG_TYPE_DMAREAD;
+ else
+ mb->hdr.type = OS_MESG_TYPE_DMAWRITE;
+ mb->hdr.pri = priority;
+ mb->hdr.retQueue = mq;
+ mb->dramAddr = dramAddr;
+ mb->devAddr = devAddr;
+ mb->size = size;
+ mb->piHandle = NULL;
+ if (priority == OS_MESG_PRI_HIGH)
+ {
+ ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
+ }
+ else
+ {
+ ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK);
+ }
+ return ret;
+}
diff --git a/src/dk64_boot/os/recvmesg.c b/src/dk64_boot/os/recvmesg.c
new file mode 100644
index 00000000..26509ad3
--- /dev/null
+++ b/src/dk64_boot/os/recvmesg.c
@@ -0,0 +1,32 @@
+#include
+#include "osint.h"
+
+s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flags)
+{
+ register u32 saveMask;
+ saveMask = __osDisableInt();
+
+ while (MQ_IS_EMPTY(mq))
+ {
+ if (flags == OS_MESG_NOBLOCK)
+ {
+ __osRestoreInt(saveMask);
+ return -1;
+ }
+ __osRunningThread->state = OS_STATE_WAITING;
+ __osEnqueueAndYield(&mq->mtqueue);
+ }
+
+ if (msg != NULL)
+ {
+ *msg = mq->msg[mq->first];
+ }
+ mq->first = (mq->first + 1) % mq->msgCount;
+ mq->validCount--;
+ if (mq->fullqueue->next != NULL)
+ {
+ osStartThread(__osPopThread(&mq->fullqueue));
+ }
+ __osRestoreInt(saveMask);
+ return 0;
+}
diff --git a/src/dk64_boot/os/resetglobalintmask.c b/src/dk64_boot/os/resetglobalintmask.c
new file mode 100644
index 00000000..181dbf83
--- /dev/null
+++ b/src/dk64_boot/os/resetglobalintmask.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/os/resetglobalintmask/__osResetGlobalIntMask.s")
diff --git a/src/dk64_boot/os/sendmesg.c b/src/dk64_boot/os/sendmesg.c
new file mode 100644
index 00000000..b0588ce4
--- /dev/null
+++ b/src/dk64_boot/os/sendmesg.c
@@ -0,0 +1,31 @@
+#include
+#include "osint.h"
+
+s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flags)
+{
+ register u32 saveMask;
+ register s32 last;
+ saveMask = __osDisableInt();
+ while (MQ_IS_FULL(mq))
+ {
+ if (flags == OS_MESG_BLOCK)
+ {
+ __osRunningThread->state = OS_STATE_WAITING;
+ __osEnqueueAndYield(&mq->fullqueue);
+ }
+ else
+ {
+ __osRestoreInt(saveMask);
+ return -1;
+ }
+ }
+ last = (mq->first + mq->validCount) % mq->msgCount;
+ mq->msg[last] = msg;
+ mq->validCount++;
+ if (mq->mtqueue->next != NULL)
+ {
+ osStartThread(__osPopThread(&mq->mtqueue));
+ }
+ __osRestoreInt(saveMask);
+ return 0;
+}
diff --git a/src/dk64_boot/os/setIntMask.c b/src/dk64_boot/os/setIntMask.c
new file mode 100644
index 00000000..9d9c0cff
--- /dev/null
+++ b/src/dk64_boot/os/setIntMask.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/os/setIntMask/osSetIntMask.s")
diff --git a/src/dk64_boot/os/seteventmesg.c b/src/dk64_boot/os/seteventmesg.c
new file mode 100644
index 00000000..a95b6158
--- /dev/null
+++ b/src/dk64_boot/os/seteventmesg.c
@@ -0,0 +1,14 @@
+#include
+#include "osint.h"
+
+__OSEventState __osEventStateTab[OS_NUM_EVENTS];
+void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg)
+{
+ register u32 saveMask = __osDisableInt();
+ __OSEventState *es;
+
+ es = &__osEventStateTab[event];
+ es->messageQueue = mq;
+ es->message = msg;
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/setglobalintmask.c b/src/dk64_boot/os/setglobalintmask.c
new file mode 100644
index 00000000..3fda389a
--- /dev/null
+++ b/src/dk64_boot/os/setglobalintmask.c
@@ -0,0 +1,9 @@
+#include
+#include
+
+void __osSetGlobalIntMask(OSHWIntr mask)
+{
+ register u32 saveMask = __osDisableInt();
+ __OSGlobalIntMask |= mask;
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/setthreadpri.c b/src/dk64_boot/os/setthreadpri.c
new file mode 100644
index 00000000..fe1e9be8
--- /dev/null
+++ b/src/dk64_boot/os/setthreadpri.c
@@ -0,0 +1,24 @@
+#include
+#include "osint.h"
+
+void osSetThreadPri(OSThread *t, OSPri pri)
+{
+ register u32 saveMask = __osDisableInt();
+ if (t == NULL)
+ t = __osRunningThread;
+ if (t->priority != pri)
+ {
+ t->priority = pri;
+ if (t != __osRunningThread && t->state != OS_STATE_STOPPED)
+ {
+ __osDequeueThread(t->queue, t);
+ __osEnqueueThread(t->queue, t);
+ }
+ if (__osRunningThread->priority < __osRunQueue->priority)
+ {
+ __osRunningThread->state = OS_STATE_RUNNABLE;
+ __osEnqueueAndYield(&__osRunQueue);
+ }
+ }
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/settime.c b/src/dk64_boot/os/settime.c
new file mode 100644
index 00000000..4238dc11
--- /dev/null
+++ b/src/dk64_boot/os/settime.c
@@ -0,0 +1,6 @@
+#include
+#include "osint.h"
+
+void osSetTime(OSTime time) {
+ __osCurrentTime = time;
+}
diff --git a/src/dk64_boot/os/settimer.c b/src/dk64_boot/os/settimer.c
new file mode 100644
index 00000000..5d168790
--- /dev/null
+++ b/src/dk64_boot/os/settimer.c
@@ -0,0 +1,19 @@
+#include
+#include "osint.h"
+
+int osSetTimer(OSTimer *t, OSTime value, OSTime interval, OSMesgQueue *mq, OSMesg msg)
+{
+ OSTime time;
+ t->next = NULL;
+ t->prev = NULL;
+ t->interval = interval;
+ if (value != 0) t->value = value;
+ else t->value = interval;
+ t->mq = mq;
+ t->msg = msg;
+ time = __osInsertTimer(t);
+ if (__osTimerList->next == t) {
+ __osSetTimerIntr(time);
+ }
+ return 0;
+}
diff --git a/src/dk64_boot/os/startthread.c b/src/dk64_boot/os/startthread.c
new file mode 100644
index 00000000..8103a989
--- /dev/null
+++ b/src/dk64_boot/os/startthread.c
@@ -0,0 +1,40 @@
+#include
+#include "osint.h"
+
+void osStartThread(OSThread *t)
+{
+ register u32 saveMask = __osDisableInt();
+ switch (t->state)
+ {
+ case OS_STATE_WAITING:
+ t->state = OS_STATE_RUNNABLE;
+ __osEnqueueThread(&__osRunQueue, t);
+ break;
+ case OS_STATE_STOPPED:
+ if (t->queue == NULL || t->queue == &__osRunQueue)
+ {
+ t->state = OS_STATE_RUNNABLE;
+ __osEnqueueThread(&__osRunQueue, t);
+ }
+ else
+ {
+ t->state = OS_STATE_WAITING;
+ __osEnqueueThread(t->queue, t);
+ __osEnqueueThread(&__osRunQueue, __osPopThread(t->queue));
+ }
+ break;
+ }
+ if (__osRunningThread == NULL)
+ {
+ __osDispatchThread();
+ }
+ else
+ {
+ if (__osRunningThread->priority < __osRunQueue->priority)
+ {
+ __osRunningThread->state = OS_STATE_RUNNABLE;
+ __osEnqueueAndYield(&__osRunQueue);
+ }
+ }
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/stopthread.c b/src/dk64_boot/os/stopthread.c
new file mode 100644
index 00000000..8095f486
--- /dev/null
+++ b/src/dk64_boot/os/stopthread.c
@@ -0,0 +1,30 @@
+
+#include
+#include "osint.h"
+
+void osStopThread(OSThread *t)
+{
+ register u32 saveMask = __osDisableInt();
+ register u16 state;
+ if (t == NULL)
+ {
+ state = OS_STATE_RUNNING;
+ }
+ else
+ {
+ state = t->state;
+ }
+ switch (state)
+ {
+ case OS_STATE_RUNNING:
+ __osRunningThread->state = OS_STATE_STOPPED;
+ __osEnqueueAndYield(NULL);
+ break;
+ case OS_STATE_RUNNABLE:
+ case OS_STATE_WAITING:
+ t->state = OS_STATE_STOPPED;
+ __osDequeueThread(t->queue, t);
+ break;
+ }
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/os/thread.c b/src/dk64_boot/os/thread.c
new file mode 100644
index 00000000..660b4495
--- /dev/null
+++ b/src/dk64_boot/os/thread.c
@@ -0,0 +1,21 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void __osDequeueThread(OSThread **queue, OSThread *t)
+{
+ register OSThread *pred;
+ register OSThread *succ;
+ pred = (OSThread *)queue; // This is actually legit..
+ succ = pred->next;
+
+ while (succ != NULL) {
+ if (succ == t) {
+ pred->next = t->next;
+ return;
+ }
+
+ pred = succ;
+ succ = pred->next;
+ }
+}
diff --git a/src/dk64_boot/os/timerintr.c b/src/dk64_boot/os/timerintr.c
new file mode 100644
index 00000000..d1b293e9
--- /dev/null
+++ b/src/dk64_boot/os/timerintr.c
@@ -0,0 +1,105 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern OSTime __osCurrentTime;
+extern u32 __osBaseCounter;
+extern u32 __osViIntrCount;
+extern u32 __osTimerCounter;
+extern OSTimer* __osTimerList;
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/os/timerintr/__osTimerServicesInit.s")
+
+/*
+// TODO: Very close, just issues with temp variables
+void __osTimerServicesInit(void) {
+ __osCurrentTime = 0;
+ __osBaseCounter = 0;
+ __osViIntrCount = 0;
+ __osTimerList->prev = __osTimerList;
+ __osTimerList->next = __osTimerList->prev;
+ __osTimerList->value = 0;
+ __osTimerList->interval = __osTimerList->value;
+ __osTimerList->mq = NULL;
+ __osTimerList->msg = NULL;
+}
+*/
+
+// TODO: Are these signatures correct?
+void __osSetCompare(u32 t);
+void __osSetTimerIntr(OSTime tim);
+OSTime __osInsertTimer(OSTimer* t);
+
+void __osTimerInterrupt(void) {
+ OSTimer* t;
+ u32 count;
+ u32 elapsed_cycles;
+ if (__osTimerList->next == __osTimerList) {
+ return;
+ }
+ while (1) {
+ t = __osTimerList->next;
+ if (t == __osTimerList) {
+ __osSetCompare(0);
+ __osTimerCounter = 0;
+ break;
+ }
+ count = osGetCount();
+ elapsed_cycles = count - __osTimerCounter;
+ __osTimerCounter = count;
+ if (elapsed_cycles < t->value) {
+ t->value -= elapsed_cycles;
+ __osSetTimerIntr(t->value);
+ return;
+ } else {
+ t->prev->next = t->next;
+ t->next->prev = t->prev;
+ t->next = NULL;
+ t->prev = NULL;
+ if (t->mq != NULL) {
+ osSendMesg(t->mq, t->msg, 0);
+ }
+ if (t->interval != 0) {
+ t->value = t->interval;
+ __osInsertTimer(t);
+ }
+ }
+ }
+}
+
+void __osSetTimerIntr(OSTime tim) {
+ OSTime NewTime;
+ u32 savedMask;
+
+ savedMask = __osDisableInt();
+
+ __osTimerCounter = osGetCount();
+ NewTime = __osTimerCounter + tim;
+ __osSetCompare(NewTime);
+ __osRestoreInt(savedMask);
+}
+
+OSTime __osInsertTimer(OSTimer* t) {
+ OSTimer* timep;
+ OSTime tim;
+ u32 savedMask;
+
+ savedMask = __osDisableInt();
+
+ for (timep = __osTimerList->next, tim = t->value; timep != __osTimerList && tim > timep->value;
+ tim -= timep->value, timep = timep->next) {
+ ;
+ }
+ t->value = tim;
+ if (timep != __osTimerList) {
+ timep->value -= tim;
+ }
+ t->next = timep;
+ t->prev = timep->prev;
+ timep->prev->next = t;
+ timep->prev = t;
+
+ __osRestoreInt(savedMask);
+
+ return tim;
+}
diff --git a/src/dk64_boot/os/virtualtophysical.c b/src/dk64_boot/os/virtualtophysical.c
new file mode 100644
index 00000000..824c46e3
--- /dev/null
+++ b/src/dk64_boot/os/virtualtophysical.c
@@ -0,0 +1,18 @@
+#include
+
+
+u32 osVirtualToPhysical(void *addr)
+{
+ if (IS_KSEG0(addr))
+ {
+ return K0_TO_PHYS(addr);
+ }
+ else if (IS_KSEG1(addr))
+ {
+ return K1_TO_PHYS(addr);
+ }
+ else
+ {
+ return __osProbeTLB(addr);
+ }
+}
\ No newline at end of file
diff --git a/src/dk64_boot/os/yieldthread.c b/src/dk64_boot/os/yieldthread.c
new file mode 100644
index 00000000..9e1aff6f
--- /dev/null
+++ b/src/dk64_boot/os/yieldthread.c
@@ -0,0 +1,9 @@
+#include
+#include "osint.h"
+
+void osYieldThread(void) {
+ register u32 saveMask = __osDisableInt();
+ __osRunningThread->state = OS_STATE_RUNNABLE;
+ __osEnqueueAndYield(&__osRunQueue);
+ __osRestoreInt(saveMask);
+}
diff --git a/src/dk64_boot/sinf.c b/src/dk64_boot/sinf.c
new file mode 100644
index 00000000..a7619610
--- /dev/null
+++ b/src/dk64_boot/sinf.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/dk64_boot/sinf/sinf.s")
diff --git a/src/global_asm/audio/event.c b/src/global_asm/audio/event.c
new file mode 100644
index 00000000..98fc2692
--- /dev/null
+++ b/src/global_asm/audio/event.c
@@ -0,0 +1,132 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items, s32 itemCount)
+
+{
+ s32 i;
+
+ evtq->eventCount = 0;
+ evtq->allocList.next = 0;
+ evtq->allocList.prev = 0;
+ evtq->freeList.next = 0;
+ evtq->freeList.prev = 0;
+
+ for (i = 0; i < itemCount; i++) {
+ alLink((ALLink *)&items[i], &evtq->freeList);
+ }
+}
+
+ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt)
+{
+ ALEventListItem *item;
+ ALMicroTime delta;
+ OSIntMask mask;
+
+ mask = osSetIntMask(OS_IM_NONE);
+
+ item = (ALEventListItem *)evtq->allocList.next;
+
+ if (item)
+ {
+ alUnlink((ALLink *)item);
+ bcopy(&item->evt, evt, sizeof(*evt));
+ alLink((ALLink *)item, &evtq->freeList);
+ delta = item->delta;
+ }
+ else
+ {
+ /* sct 11/28/95 - If we get here, most like we overflowed the event queue */
+ /* with non-self-perpetuating events. Eg. if we filled the evtq with volume */
+ /* events, then when the seqp is told to play it will handle all the events */
+ /* at once completely emptying out the queue. At this point this problem */
+ /* must be treated as an out of resource error and the evtq should be increased. */
+ evt->type = -1;
+ delta = 0;
+ }
+
+ osSetIntMask(mask);
+
+ return delta;
+}
+
+void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt, ALMicroTime delta)
+{
+ ALEventListItem *item;
+ ALEventListItem *nextItem;
+ ALLink *node;
+ s32 postAtEnd=0;
+ OSIntMask mask;
+
+ mask = osSetIntMask(OS_IM_NONE);
+
+ item = (ALEventListItem *)evtq->freeList.next;
+ if (!item) {
+ osSetIntMask(mask);
+ #ifdef _DEBUG
+ __osError(ERR_ALEVENTNOFREE, 0);
+ #endif
+ return;
+ }
+
+ alUnlink((ALLink *)item);
+ bcopy(evt, &item->evt, sizeof(*evt));
+
+ if (delta == AL_EVTQ_END)
+ postAtEnd = -1;
+
+ for (node = &evtq->allocList; node != 0; node = node->next) {
+ if (!node->next) { /* end of the list */
+ if (postAtEnd)
+ item->delta = 0;
+ else
+ item->delta = delta;
+ alLink((ALLink *)item, node);
+ break;
+ } else {
+ nextItem = (ALEventListItem *)node->next;
+
+ if (delta < nextItem->delta) {
+ item->delta = delta;
+ nextItem->delta -= delta;
+
+ alLink((ALLink *)item, node);
+ break;
+ }
+
+ delta -= nextItem->delta;
+
+ }
+ }
+
+ osSetIntMask(mask);
+}
+
+void alEvtqFlushType(ALEventQueue *evtq, s16 type)
+{
+ ALLink *thisNode;
+ ALLink *nextNode;
+ ALEventListItem *thisItem, *nextItem;
+ OSIntMask mask;
+
+ mask = osSetIntMask(OS_IM_NONE);
+
+ thisNode = evtq->allocList.next;
+ while( thisNode != 0 )
+ {
+ nextNode = thisNode->next;
+ thisItem = (ALEventListItem *)thisNode;
+ nextItem = (ALEventListItem *)nextNode;
+ if (thisItem->evt.type == type)
+ {
+ if (nextItem)
+ nextItem->delta += thisItem->delta;
+ alUnlink(thisNode);
+ alLink(thisNode, &evtq->freeList);
+ }
+ thisNode = nextNode;
+ }
+
+ osSetIntMask(mask);
+}
diff --git a/src/global_asm/audio/link.c b/src/global_asm/audio/link.c
new file mode 100644
index 00000000..a9251569
--- /dev/null
+++ b/src/global_asm/audio/link.c
@@ -0,0 +1,21 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+/* might want to make these macros */
+void alLink(ALLink *ln, ALLink *to)
+{
+ ln->next = to->next;
+ ln->prev = to;
+ if (to->next)
+ to->next->prev = ln;
+ to->next = ln;
+}
+
+void alUnlink(ALLink *ln)
+{
+ if (ln->next)
+ ln->next->prev = ln->prev;
+ if (ln->prev)
+ ln->prev->next = ln->next;
+}
diff --git a/src/global_asm/audio/n_sl.c b/src/global_asm/audio/n_sl.c
new file mode 100644
index 00000000..1c855e1d
--- /dev/null
+++ b/src/global_asm/audio/n_sl.c
@@ -0,0 +1,26 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern N_ALGlobals *n_alGlobals=0;
+extern N_ALSynth *n_syn;
+
+void n_alInit(N_ALGlobals *g, ALSynConfig *c)
+{
+ if (!n_alGlobals) { /* already initialized? */
+ n_alGlobals = g;
+ if (!n_syn) {
+ n_syn = &n_alGlobals->drvr;
+ n_alSynNew(c); //n_alSynNew(c);
+ }
+ }
+}
+
+void n_alClose(N_ALGlobals *glob)
+{
+ if (n_alGlobals) {
+ n_alSynDelete();//n_alSynDelete();
+ n_alGlobals = 0;
+ n_syn = 0;
+ }
+}
diff --git a/src/global_asm/audio/n_syndelete.c b/src/global_asm/audio/n_syndelete.c
new file mode 100644
index 00000000..608a2e77
--- /dev/null
+++ b/src/global_asm/audio/n_syndelete.c
@@ -0,0 +1,9 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern N_ALSynth *n_syn;
+
+void n_alSynDelete(void) {
+ n_syn->head = NULL;
+}
diff --git a/src/global_asm/audio/seqpsetseq.c b/src/global_asm/audio/seqpsetseq.c
new file mode 100644
index 00000000..bd8d88ef
--- /dev/null
+++ b/src/global_asm/audio/seqpsetseq.c
@@ -0,0 +1,13 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void alSeqpSetSeq(ALSeqPlayer *seqp, ALSeq *seq)
+{
+ ALEvent evt;
+
+ evt.type = AL_SEQP_SEQ_EVT;
+ evt.msg.spseq.seq = seq;
+
+ alEvtqPostEvent(&seqp->evtq, &evt, 0);
+}
diff --git a/src/global_asm/audio/seqpsetvol.c b/src/global_asm/audio/seqpsetvol.c
new file mode 100644
index 00000000..c8bdb5a9
--- /dev/null
+++ b/src/global_asm/audio/seqpsetvol.c
@@ -0,0 +1,13 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void alSepqSetVol(ALSeqPlayer *seqp, s16 vol)
+{
+ ALEvent evt;
+
+ evt.type = AL_SEQP_VOL_EVT;
+ evt.msg.spvol.vol = vol;
+
+ alEvtqPostEvent(&seqp->evtq, &evt, 0);
+}
diff --git a/src/global_asm/audio/seqpstop.c b/src/global_asm/audio/seqpstop.c
new file mode 100644
index 00000000..62fbfc0b
--- /dev/null
+++ b/src/global_asm/audio/seqpstop.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void alSeqpStop(ALSeqPlayer *seqp) {
+ ALEvent evt;
+
+ evt.type = AL_SEQP_STOPPING_EVT;
+ alEvtqPostEvent(&seqp->evtq, &evt, 0);
+}
diff --git a/src/global_asm/audio/synthesizer.c b/src/global_asm/audio/synthesizer.c
new file mode 100644
index 00000000..ac6a9ac2
--- /dev/null
+++ b/src/global_asm/audio/synthesizer.c
@@ -0,0 +1,92 @@
+#include
+#include "functions.h"
+#include "variables.h"
+#include "synthinternal.h"
+
+//n_alSynNew
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/audio/synthesizer/n_alSynNew.s")
+
+//n_alAudioFrame
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/audio/synthesizer/n_alAudioFrame.s")
+
+ALParam *__n_allocParam(void) {
+ ALParam *update = 0;
+
+ if (n_syn->paramList) {
+ update = n_syn->paramList;
+ n_syn->paramList = n_syn->paramList->next;
+ update->next = 0;
+ }
+ return update;
+}
+
+void __n_freeParam(ALParam *param)
+{
+ param->next = n_syn->paramList;
+ n_syn->paramList = param;
+}
+
+void _n_collectPVoices()
+{
+ ALLink *dl;
+ PVoice *pv;
+
+ while ((dl = n_syn->pLameList.next) != 0) {
+ pv = (PVoice *)dl;
+
+ /* ### remove from mixer */
+
+ alUnlink(dl);
+ alLink(dl, &n_syn->pFreeList);
+ }
+}
+
+void _n_freePVoice(PVoice *pvoice)
+{
+ /*
+ * move the voice from the allocated list to the lame list
+ */
+ alUnlink((ALLink *)pvoice);
+ alLink((ALLink *)pvoice, &n_syn->pLameList);
+}
+
+/*
+ Add 0.5 to adjust the average affect of
+ the truncation error produced by casting
+ a float to an int.
+*/
+s32 _n_timeToSamplesNoRound(s32 micros)
+{
+
+ f32 tmp = ((f32)micros) * n_syn->outputRate / 1000000.0f + 0.5f;
+
+ return (s32)tmp;
+}
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/audio/synthesizer/func_80739E24.s")
+#else
+// s32 _timeToSamples(ALSynth *synth, s32 micros)
+s32 func_80739E24(s32 micros)
+{ return _n_timeToSamplesNoRound(micros) & ~0xf;
+}
+#endif
+
+static s32 __n_nextSampleTime(ALPlayer **client)
+{
+ s32 pad;
+ ALMicroTime delta = 0x7fffffff; /* max delta for s32 */
+ ALPlayer *cl;
+
+ //assert(n_syn->head);
+ *client = 0;
+
+ for (cl = n_syn->head; cl != 0; cl = cl->next) {
+ if ((cl->samplesLeft - n_syn->curSamples) < delta) {
+ *client = cl;
+ delta = cl->samplesLeft - n_syn->curSamples;
+ }
+ }
+
+ return (*client)->samplesLeft;
+}
diff --git a/src/global_asm/code_0.c b/src/global_asm/code_0.c
new file mode 100644
index 00000000..f0d938fb
--- /dev/null
+++ b/src/global_asm/code_0.c
@@ -0,0 +1,693 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern s32 *D_8076A080;
+extern s32 D_807FF100;
+extern s32 D_8000DDE4;
+extern s32 D_8076A084;
+extern u8 D_807467CC;
+extern u8 D_8076A0B2;
+extern s32 D_80769018;
+extern u16 D_8076A09C;
+extern f32 D_807444B8;
+extern f32 D_807444BC;
+extern f32 D_807444C4;
+extern f32 D_807444C8;
+extern u8 D_8076A0B1; // map_state
+extern u8 D_8076A0B3; // cutscene_bar_state
+
+extern u8 D_80746830;
+extern s32 D_8076A090;
+extern s32 D_8076A094;
+extern s32 D_8076A098;
+extern u16 D_80750AC4;
+extern u8 D_8076A0A4;
+extern u8 D_807444FC;
+extern s32 D_8076A068;
+extern u16 *D_807ECDF4;
+extern s32 D_8076A06C;
+extern u8 D_80744500;
+extern u8 D_80750AC0; // number_of_players?
+extern s32 D_807F6010;
+extern s32 *D_8076A0A0;
+extern s16 D_8076A0AA;
+extern s32 next_exit;
+extern s32 D_806025AC;
+extern u8 D_807F6008;
+extern u8 D_80745BDC[]; // Might be a struct array
+extern f32 D_807565D8;
+extern f32 D_807FD888; // loading_zone_fadeout_progress
+extern f32 loading_zone_transition_speed;
+extern u8 D_807444F8;
+extern u8 loading_zone_transition_type;
+
+extern s32 D_80767E68;
+extern Mtx D_80767CE8;
+extern Mtx D_80768E98;
+
+f32 func_8062A850(void);
+void func_8060B140(s32, s32*, s32*, s32, s32, s32, s32);
+void func_8060AA04();
+void func_80631B80();
+void func_806C9AE0();
+void func_80731030();
+void func_805FF118();
+void func_8063DB0C();
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FB300.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FB5C4.s")
+
+extern s32 D_8000DDCC;
+extern OSIoMesg D_807ECE00;
+extern OSMesgQueue D_807655F0;
+extern OSMesg D_80765608;
+
+extern OSMesgQueue D_807656D0;
+extern OSMesg D_807656E8;
+
+extern OSMesgQueue D_807659E8;
+extern OSMesg D_80765A00;
+
+extern OSMesg D_8076A128;
+extern OSMesg D_8076A108;
+
+extern OSTimer D_8076A130;
+
+void func_805FB750(s32 arg0, s32 arg1, s32 arg2) {
+ s32 sp2C;
+
+ sp2C = D_8000DDCC;
+ osWritebackDCache(arg2, arg1);
+ osPiStartDma(&D_807ECE00, 0, 0, sp2C + arg0, arg2, arg1, &D_807655F0);
+ osRecvMesg(&D_807655F0, 0, 1);
+ osInvalDCache(arg2, arg1);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FB7E4.s")
+
+void func_805FB944(s32 arg0);
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FB944.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FBC5C.s")
+
+extern s32 D_8076A07C;
+extern OSMesgQueue D_8076A110;
+extern s32 D_8000DDE8;
+extern s32 D_8000DDE4;
+
+extern s32 D_80767A40;
+extern s32 D_80767CD8;
+
+/*
+// TODO: Pretty close
+void func_805FBC5C(void) {
+ // This might be a static struct field access
+ D_8076A084 = D_8000DDE8 - D_8000DDE4;
+ osCreateMesgQueue(&D_807655F0, &D_80765608, 0x32);
+ osCreateMesgQueue(&D_807656D0, &D_807656E8, 0xC0);
+ func_8060EC80(&D_80767A40, &D_80767A40, 0x19, osTvType, 1);
+ osCreateMesgQueue(&D_807659E8, &D_80765A00, 0x10);
+ func_8060ED6C(&D_80767A40, &D_80767CD8, &D_807659E8, 1, 1);
+ current_map = next_map;
+ func_805FB944(0);
+ D_8076A07C = 5;
+ func_8060FFF0();
+ func_8060A900();
+ func_80600D50();
+ setIntroStoryPlaying(0);
+ func_8073239C();
+ osWriteBackDCacheAll();
+ osCreateMesgQueue(&D_8076A110, &D_8076A108, 2);
+ osSetTimer(&D_8076A130, 0, 0xD693A4, &D_8076A110, D_8076A128);
+ playSound(0x23C, 0x7FFF, 63.0f, 1.0f, 0, 0);
+}
+*/
+
+void func_805FBE04(void) {
+ s32 stackpad1;
+ f32 FOV;
+
+ osWriteBackDCacheAll();
+ osInvalDCache(0x80000000, 0x800000);
+ D_8076A080 = &D_807FF100;
+ func_8060B140(D_8000DDE4, D_8076A080, &D_8076A084, 0, 0, 0, 0);
+ D_8076A0A4 = 0;
+ func_8060AA04();
+ object_timer = 0;
+ D_8076A068 = 0;
+ D_807467CC = 0;
+ current_exit = 4;
+ global_properties_bitfield = 0x30030;
+ D_8076A0B1 |= 1;
+ D_8076A0B2 = 0;
+ D_807FD888 = 31.0f; // loading_zone_fadeout_progress
+ D_8076A0B1 |= 4;
+ func_80631B80();
+ func_806C9AE0();
+ func_80731030();
+ func_805FF118();
+ func_8063DB0C();
+ FOV = func_8062A850(); // getFieldOfView()
+ guTranslate(&D_80767E68, 0.0f, 0.0f, 0.0f);
+ guTranslate(&D_80769018, 0.0f, 0.0f, 0.0f);
+ guPerspective(&D_80767CE8, &D_8076A09C, D_807444B8, D_807444BC * FOV, D_807444C8, D_807444C4, 1.0f);
+ guPerspective(&D_80768E98, &D_8076A09C, D_807444B8, D_807444BC * FOV, D_807444C8, D_807444C4, 1.0f);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FBFF4.s")
+
+extern s32 D_8076A070;
+extern s32 osTvType;
+extern s8 D_80744460;
+extern u16 D_8074682C;
+extern u8 D_80744504;
+extern u8 D_807F059C;
+extern u64 D_80761680;
+extern s32 D_807655E0;
+extern u8 D_807444F0;
+extern s32 D_80767CC0;
+
+void func_80732354(u8, s32, s32, s32);
+
+/*
+// TODO: Remarkably close, just missing some NOPs
+void func_805FBFF4(s32 arg0) {
+ s32 phi_s4;
+ OSMesg* sp38;
+
+ phi_s4 = 1;
+ if (osTvType == OS_TV_PAL) {
+ D_807444BC = 1.25f;
+ }
+ func_805FBC5C();
+ osViSetSpecialFeatures(0x42);
+ func_805FBE04();
+ D_8076A070 = D_80767CC0 - 2;
+ osRecvMesg(&D_8076A110, &sp38, 1);
+ while (TRUE) {
+ D_8074682C = 0xC8;
+
+ while (D_80744460) {}
+
+ if (D_8076A0B1 & 1 && !D_8076A0B2) {
+ func_805FE7FC();
+ if (D_807444F8 == 2) {
+ global_properties_bitfield |= 0x200;
+ D_80744504 = 8;
+ }
+ }
+
+ switch (is_cutscene_active) {
+ case 6:
+ func_8070A934(next_map, next_exit);
+ break;
+ case 3:
+ func_80024000();
+ break;
+ case 4:
+ func_80024000();
+ break;
+ case 5:
+ break;
+ default:
+ func_805FC2B0();
+ break;
+ }
+
+ func_80600B10();
+ func_8066AF40();
+ func_80610268(0x4D2);
+ if (D_807F059C) {
+ func_80610268(0x929);
+ }
+ func_80600674(); // calculateLagBoost()
+ if ((is_cutscene_active == 0) || (is_cutscene_active == 1) || (is_cutscene_active == 7)) {
+ func_80658CCC();
+ func_80700BF4();
+ }
+ func_80611730();
+ if (D_80761680 != 0x12345678) {
+ func_80732354(2, 0, 0, 0);
+ }
+ if (phi_s4) {
+ osSendMesg(D_807655E0, 0x309, 1);
+ phi_s4 = 0;
+ }
+ if (D_8076A0B1 & 1 && D_807FD888 == 31.0f) {
+ D_8076A0B2--;
+ }
+ D_807444F0 = is_cutscene_active;
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FC2B0.s")
+
+extern s32 *D_8076A048;
+extern s32 D_8076A050[];
+extern s32 D_8076A150;
+extern s32 D_8076A088;
+extern s32 D_8076A08C;
+void func_8068C2EC();
+
+/*
+void func_805FC2B0(void) {
+ s32 sp2C;
+ s32 sp28;
+ s32 temp_v0;
+ s32 phi_v0;
+
+ func_8060A9BC();
+ if (D_8076A0A4 != 0) {
+ phi_v0 = 0;
+ } else {
+ phi_v0 = 1;
+ }
+ //func_80610044(((*0x807444FC * 4) + 0x80770000)->unk-5FB0, D_8076A088, 3, phi_v0 & 0xFF, 0x4D2, 1);
+ if (D_8076A0A4 != 0) {
+ //func_80610044((D_807444FC * 0x11B0) + 0xDB0 + &D_80767CE8, D_8076A08C, 0, 1, 0x929, 1);
+ }
+ D_807444FC ^= 1;
+ object_timer++;
+ if ((global_properties_bitfield & 2) == 0) {
+ D_8076A068++;
+ }
+ *D_8076A048 = (D_807444FC * 0x11B0) + &D_80767CE8;
+ func_8060AC7C();
+ if (func_805FC668() != 0) {
+ func_8065D1AC();
+ func_806789E4();
+ func_80715270(1);
+ func_80603450();
+ func_806057F8();
+ func_806025D4();
+ func_805FCA94(D_8076A048);
+ } else {
+ func_8065A648();
+ func_806787CC();
+ func_805FCA94(D_8076A048);
+ func_8065D1AC();
+ func_8068A508();
+ func_8066CDD0();
+ func_8066CCD8();
+ func_80661054();
+ func_80678824();
+ func_80663A80();
+ func_80715270(0);
+ func_80603450();
+ func_806025D4();
+ func_806057F8();
+ func_806F6F28();
+ }
+ func_8070DD44();
+ temp_v0 = *(&D_8076A050 + (D_807444FC * 4));
+ //temp_v0 = D_8076A050[D_807444FC * 4];
+ D_8076A150 = temp_v0;
+ if (((D_8076A0B1 & 1) != 0) && (D_807FD888 == 31.0f)) {
+ sp2C = temp_v0;
+ sp28 = D_8076A048 + 0xDB0;
+ func_8068C2EC();
+ } else {
+ func_805FD088(D_8076A048, &sp2C, &sp28);
+ }
+ if ((global_properties_bitfield & 0x100) != 0) {
+ global_properties_bitfield &= ~0x100;
+ func_807094D0(2, &global_properties_bitfield);
+ } else if ((global_properties_bitfield & 0x200) != 0) {
+ D_80744504--;
+ if (D_80744504 == 0) {
+ global_properties_bitfield &= ~0x200;
+ func_807094D0(3, &global_properties_bitfield);
+ }
+ } else {
+ sp2C = func_80704484(sp2C, loading_zone_transition_type);
+ }
+ if ((D_8076A0A4 != 0) && (is_cutscene_active != 6)) {
+ func_805FE71C(sp2C, D_807444FC, &D_8076A088, 0);
+ func_805FE7B4(sp28, D_8076A048, &D_8076A08C, 1);
+ return;
+ }
+ func_805FE71C(sp2C, D_807444FC, &D_8076A088, 1);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FC668.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FC98C.s")
+
+u64 func_80005818(u64, f32, u32);
+u64 func_80005918(s32, u32, f32, u32);
+extern s32 D_807445B8; // OSTime?
+extern u32 D_807445BC;
+extern s32 D_807445C0; // OSTime?
+extern u32 D_807445C4;
+extern s32 D_80750AB0;
+
+/*
+// TODO: 64 bit nonsense
+s32 func_805FC98C(void) {
+ u32 sp1C;
+ s32 sp18;
+ s32 temp_t8;
+ u32 temp_t7;
+ u32 temp_t9;
+ OSTime currentTime;
+
+ currentTime = osGetTime();
+ temp_t8 = (currentTime - D_807445B8) - (currentTime < D_807445BC);
+ temp_t9 = currentTime - D_807445BC;
+ sp1C = temp_t9;
+ sp18 = temp_t8;
+ if (global_properties_bitfield & 2) {
+ temp_t9 = (temp_t9 - currentTime) + D_807445C4;
+ sp18 = (temp_t9 < D_807445C4) + ((temp_t8 - currentTime) - (temp_t9 < currentTime)) + D_807445C0;
+ sp1C = temp_t9;
+ }
+ return func_80005818(func_80005818(func_80005918(sp18, sp1C, 0, 0x40), 0, 3000), 0, 1000000) + D_80750AB0;
+}
+*/
+
+u8 func_805FCA64(void) { // getCutsceneBarState()
+ return !(D_8076A0B1 & 0x10) && !D_8076A0B3;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FCA94.s")
+
+extern u8 D_8074450C;
+
+/* rom */
+extern Gfx **D_1000020;
+extern Gfx **D_1000030;
+extern Gfx **D_1000068;
+extern Gfx **D_1000040;
+
+void *func_805FCFD8(Gfx *arg0) {
+ if (D_8074450C == 2) {
+ gSPDisplayList(arg0++, &D_1000068);
+ } else {
+ gSPDisplayList(arg0++, &D_1000040);
+ }
+ return arg0++;
+}
+
+void *func_805FD030(Gfx *arg0) {
+ if (D_8074450C == 2) {
+ gSPDisplayList(arg0++, &D_1000030);
+ } else {
+ gSPDisplayList(arg0++, &D_1000020);
+ }
+ return arg0++;
+}
+
+// display list something
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FD088.s")
+
+// display list something?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE398.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE4D4.s")
+
+extern s32 D_8076A058;
+
+void func_805FE544(u8 arg0) {
+ if (D_807FBB64 & 1) {
+ D_8076A058 = 6000;
+ } else {
+ D_8076A058 = arg0 * 3000;
+ }
+ D_8076A050[0] = malloc(D_8076A058 * 8);
+ D_8076A050[1] = malloc(D_8076A058 * 8);
+ func_805FE71C(func_805FE634(D_8076A050[0], 0), 0, &D_8076A088, 1);
+ func_805FE71C(func_805FE634(D_8076A050[1], 1), 1, &D_8076A088, 1);
+}
+
+// display list something?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE634.s")
+
+// display list something?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE71C.s")
+
+// display list something?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE7B4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_0/func_805FE7FC.s")
+
+void func_80712A40(void);
+void func_80605510(void);
+void func_8068C080(void);
+void func_8070F570(void);
+void func_80600950(void);
+
+void func_8060A4D0(s32 arg0, f32 arg1);
+
+void func_8066ADA0(void);
+void func_806FBB58(void);
+void func_806FD9A0(void);
+
+void func_807040E0(u8 arg0, u8 arg1, u8 arg2);
+void func_80704108(u8 arg0, u8 arg1, u8 arg2);
+
+void func_80705B30();
+void func_807215EC();
+void func_806F3760(s16 map);
+void func_8072ED90();
+void func_80658BD0();
+void func_80722E00(s32 map);
+
+void func_80630300();
+void func_80650E20(s32 arg0);
+void func_8062F050(s32 arg0);
+void func_8065D170();
+void func_806588E0(s32 arg0);
+void func_80688940();
+void func_80631C3C();
+void func_8063643C();
+
+void func_806C7C10(void);
+void func_806D0430(f32 arg0);
+void func_805FE544(u8 arg0);
+
+void func_80631FAC(Maps arg0, s32 arg1);
+void func_806886E0(s32 arg0, s32 arg1, s32 arg2);
+void func_80663DA0();
+void func_8065A570();
+void func_80677D80();
+void func_8068A7B0();
+void func_8072E740(s32 arg0);
+
+void func_80626264(s32);
+void func_8066B434(void*, s32, s32);
+void func_80712B80();
+void func_806C7D40(s32 arg0);
+void func_80714670();
+
+void func_80724C78(s32 arg0);
+void func_8061EA78();
+void func_806F4778();
+void func_8070E8C8();
+void func_8060098C(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
+
+void func_80026FD0(s32 arg0);
+void func_8002EC08(s32 arg0);
+
+void func_8066BDE0(void);
+
+void func_80701C90(void);
+void func_80629190(void);
+void func_80664CB0(s32 arg0);
+void func_80600590(s32 arg0);
+
+void func_806641A0();
+
+void func_80712BD4();
+void func_805FF670();
+
+/*
+// TODO: Regalloc, oof
+void func_805FE7FC(void) {
+ s32 *mapGeometry;
+ s32 *sp28;
+ s32 *mapSetup;
+ f32 phi_f0;
+
+ D_80746830 = 1;
+ D_8076A090 = 0;
+ D_8076A094 = 0;
+ D_8076A098 = 0;
+ global_properties_bitfield &= 0xFFEB3FFC;
+ func_80712A40();
+ D_80750AC4 = 0;
+ D_8076A0A4 = 0;
+ D_807444FC = 0;
+ object_timer = 0;
+ D_8076A068 = 0;
+ func_80605510();
+ enemies_killed = 0;
+ *D_807ECDF4 = 0;
+ func_8068C080();
+ D_8076A0B1 &= 0xFFCF;
+ func_8070F570();
+ if (is_cutscene_active == 1) {
+ is_cutscene_active = 0;
+ }
+ D_8076A06C = object_timer;
+ D_80744500 = 0;
+ func_80600950();
+ current_map = next_map;
+
+ if (current_map != MAP_MAIN_MENU) {
+ if (current_map != MAP_TITLE_SCREEN_NOT_FOR_RESALE_VERSION) {
+ global_properties_bitfield |= 0x30030;
+ } else {
+ global_properties_bitfield &= 0xFFFCFFCF;
+ }
+ } else {
+ global_properties_bitfield &= 0xFFFEFFCF;
+ }
+
+ if (current_map == MAP_DK_ARCADE) {
+ is_cutscene_active = 3;
+ } else if (current_map == MAP_JETPAC) {
+ is_cutscene_active = 4;
+ } else {
+ is_cutscene_active = 0;
+ }
+
+ func_805FB944(1);
+ // TODO: Proper bitfield syntax for D_807FBB64
+ if (D_80750AC0 >= 2 && D_807FBB64 << 5 >= 0) {
+ D_80750AC0 = 1;
+ }
+ func_806C7C10();
+ func_806D0430(0.0f);
+ func_805FE544(D_80750AC0);
+
+ if (current_map != MAP_ENGUARDE_ARENA) {
+ if (current_map == MAP_RAMBI_ARENA) {
+ current_character_index[0] = 6;
+ }
+ } else {
+ current_character_index[0] = 7;
+ }
+
+ D_807F6010 = 0;
+ func_8066ADA0();
+ func_806FBB58();
+ func_806FD9A0();
+ func_807040E0(0xFF, 0xFF, 0xFF);
+ func_80704108(0xFF, 0xFF, 0xFF);
+ if (!is_cutscene_active) {
+ D_8076A0A0 = getPointerTableFile(0x13, MAP_TEST_MAP, 1, 1);
+ func_80705B30();
+ func_807215EC();
+ func_806F3760(current_map); // Load autowalk file
+ func_8072ED90();
+ func_80658BD0();
+ func_80722E00(current_map); // Load path file
+ mapGeometry = getPointerTableFile(1, current_map, 1, 1);
+ func_80630300();
+ func_80650E20(mapGeometry);
+ func_8062F050(mapGeometry);
+ loadExits(current_map);
+ func_8065D170();
+ func_806588E0(current_map); // Load per map file, pointer table 20
+ func_80688940();
+ func_80631C3C();
+ func_8063643C();
+ mapSetup = getPointerTableFile(9, current_map, 1, 1);
+ func_80631FAC(current_map, 1);
+ func_806886E0(mapSetup, 0, 0);
+ func_80663DA0();
+ func_8065A570();
+ func_80677D80();
+ func_8068A7B0(); // spawnPersistentActors()
+ func_8072E740(current_map);
+ func_80626264(sp28 = getPointerTableFile(8, current_map, 1, 1));
+ if (sp28) {
+ func_8066B434(sp28, 0x8D0, 2);
+ }
+ func_80712B80();
+ func_806C7D40(next_exit);
+ func_80714670();
+ sp28 = getPointerTableFile(0x10, current_map, 1, 1);
+ func_80724C78(sp28);
+ if (sp28) {
+ func_8066B434(sp28, 0x8DD, 2);
+ }
+ func_8061EA78();
+ func_8068C2EC();
+ func_806F4778();
+ func_8070E8C8();
+ func_8060098C(&D_806025AC, 2, 0, 0, 0);
+ if (D_807FBB64 & 0x1000) {
+ sp28 = getPointerTableFile(0x16, current_map, 1, 1);
+ func_80026FD0(sp28);
+ if (sp28) {
+ func_8066B434(sp28, 0x8ED, 2);
+ }
+ }
+ if (D_807FBB64 & 0x2000) {
+ func_8002EC08(current_map);
+ }
+ func_8066BDE0();
+ D_807F6008 = 0;
+ if (!isIntroStoryPlaying() && is_cutscene_active != 2) {
+ if (current_map == MAP_HELM && isFlagSet(0x302, FLAG_TYPE_PERMANENT)) {
+ playSong(0x74, 1.0f);
+ } else {
+ phi_f0 = 1.0f;
+ if (D_80745BDC[current_map * 4] == 6 || D_80745BDC[current_map * 4] == 0x1F) {
+ phi_f0 = D_807565D8;
+ }
+ playSong(D_80745BDC[current_map * 4], phi_f0);
+ }
+ }
+ if (current_map == MAP_DK_ISLES_OVERWORLD || current_map == MAP_ENGUARDE_ARENA) {
+ playSong(0x60, 1.0f);
+ }
+ func_8060A4D0(0, 1.0f);
+ func_8060A4D0(1, 1.0f);
+ func_8060A4D0(2, 1.0f);
+ func_805FFEF8(current_map);
+ func_806641A0();
+ }
+ func_80712BD4();
+ func_805FF670();
+ D_8076A0B1 ^= 1;
+ D_807FD888 = 31.0f;
+ D_8076A0B1 |= 4;
+ loading_zone_transition_speed = -1.0f;
+ if (D_807444F8 != 2 && loading_zone_transition_type == 1) {
+ playSong(0x2B, 1.0f);
+ }
+ func_80701C90();
+ func_80629190();
+ func_80664CB0(D_8076A0AA);
+ func_80600590(current_map);
+ D_80746830 = 0;
+}
+*/
+
+extern u8 D_8074447C;
+extern u8 D_80744480;
+extern u8 D_80744484;
+extern u8 D_80744488;
+
+void func_805FEE84(u8 arg0, u8 arg1, u8 arg2, u8 arg3) {
+ D_8074447C = arg0;
+ D_80744480 = arg1;
+ D_80744484 = arg2;
+ D_80744488 = arg3;
+}
+
+void func_805FEEB8(s32 *arg0, s32 arg1) {
+ s32 temp_hi;
+
+ temp_hi = *arg0 % arg1;
+ if (temp_hi) {
+ *arg0 += arg1 - temp_hi;
+ }
+}
diff --git a/src/global_asm/code_100180.c b/src/global_asm/code_100180.c
new file mode 100644
index 00000000..8b673229
--- /dev/null
+++ b/src/global_asm/code_100180.c
@@ -0,0 +1,71 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_806FB480(void) {
+
+}
+
+void func_806FB488(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FB490.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FB714.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FB8B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FB914.s")
+
+extern s32 *D_807FD7F0; // Array of 43 texture pointers
+extern u8 *D_807FD7F4; // Array of 43 u8's
+
+void func_806FBB58() {
+ D_807FD7F0 = malloc(sizeof(s32) * 43);
+ func_80611690(D_807FD7F4 = malloc(sizeof(u8) * 43));
+}
+
+s32 func_806FBB9C(s16 textureIndex) {
+ if (!D_807FD7F4[textureIndex]) {
+ // Texture
+ D_807FD7F0[textureIndex] = getPointerTableFile(0xE, textureIndex, 1, 1);
+ D_807FD7F4[textureIndex] = 3;
+ } else {
+ D_807FD7F4[textureIndex] = 3;
+ }
+ return D_807FD7F0[textureIndex];
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FBC34.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FBD5C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FBEAC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FBEF0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FC530.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FCC88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FD094.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FD490.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FD7A8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_100180/func_806FD894.s")
+
+/*
+extern s32 D_80754A36;
+u8 func_806FD894(s16 arg0) {
+ s16 temp;
+
+ temp = arg0;
+ if (arg0 & 0x80) {
+ temp = (s16) (arg0 ^ 0x80);
+ }
+ return *(&D_80754A36 + (((temp * 4) - temp) * 2));
+}
+*/
diff --git a/src/global_asm/code_10130.c b/src/global_asm/code_10130.c
new file mode 100644
index 00000000..07bf43eb
--- /dev/null
+++ b/src/global_asm/code_10130.c
@@ -0,0 +1,148 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern s16 D_807463A0;
+extern void *D_807463A8; // DKTV Inputs - Camera + Stick
+extern s16 D_807463AC;
+extern s16 D_807463B0;
+extern s16 D_807463B4;
+
+extern u8 D_807ECE30;
+extern void *D_807ECE90; // DKTV Inputs - Buttons
+extern void *D_807ECE94;
+extern s16 *D_807ECE98;
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10130/func_8060B430.s")
+
+/*
+// Very doable, datatype nonsense
+void func_8060B430(void *arg0, void *arg1) {
+ void *temp_a1;
+
+ arg0->unk7C = arg1->unk0;
+ temp_a1 = arg1 + 0x12;
+ arg0->unk80 = arg1->unk4;
+ arg0->unk84 = temp_a1->unk-A;
+ arg0->unkE6 = temp_a1->unk-6;
+ memcpy(&D_807FC950->character_progress[temp_a1->unk-2], temp_a1, 0x5E);
+}
+*/
+
+s16 func_8060B49C(s32 arg0, s32 arg1) {
+ is_autowalking = 2;
+ func_8060B430(arg0, &D_807ECE20);
+ return D_807463B0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10130/func_8060B4D4.s")
+
+/*
+// Very doable, datatype nonsense
+void func_8060B4D4(void *arg0) {
+ if (D_807463AC < (D_807463B0 - 1)) {
+ arg0->unk2 = D_807ECE98->unk2;
+ arg0->unk3 = D_807ECE98->unk3;
+ if (D_807ECE98->unk0 & 0x8000) {
+ D_807463B4 = *D_807ECE94;
+ D_807ECE94 += 2;
+ }
+ arg0->unk0 = D_807463B4 & 0xEFFF;
+ }
+}
+*/
+
+void func_8060B55C(s16 *arg0) {
+ if (D_807463AC < (D_807463B0 - 1)) {
+ *arg0 = *D_807ECE98 & 0x7FFF;
+ D_807ECE98 += 2;
+ D_807463AC++;
+ return;
+ }
+ is_autowalking = 0;
+}
+
+void func_8060B5C0(u8 *file) {
+ s32 size;
+
+ // Allocate buffer for camera + stick inputs
+ if (!D_807463A8) {
+ D_807463A8 = malloc(1800 * sizeof(u32));
+ }
+ D_807ECE98 = D_807463A8;
+
+ // Allocate buffer for button inputs
+ if (!D_807ECE90) {
+ D_807ECE90 = malloc(1800 * sizeof(u16));
+ }
+ D_807ECE94 = D_807ECE90;
+
+ // Read the number of camera + stick inputs
+ memcpy(&D_807463B0, file, sizeof(u16));
+ file += sizeof(u16);
+ size = D_807463B0 * sizeof(u32);
+
+ // Read the camera + stick inputs
+ memcpy(D_807463A8, file, size);
+ file += size;
+
+ // Read the number of button inputs
+ memcpy(&D_807463A0, file, sizeof(u16));
+ file += sizeof(u16);
+ size = D_807463A0 * sizeof(u16);
+
+ // Read the button inputs
+ memcpy(D_807ECE90, file, size);
+ file += size;
+
+ // Read the extra data
+ memcpy(&D_807ECE20, file, 0x70);
+
+ // TODO: This is dumb, fix it
+ //[3:01 PM] I***: They wouldn't have written that right?
+ //[3:01 PM] M***: no, but they may have set size to that 0x70 in someway
+ //[3:02 PM] M***: or may have used a macro to advance the buffer pointer that would have referenced size and then never used it
+ if (size);
+}
+
+void func_8060B6CC(void) {
+ D_807463A8 = NULL;
+ D_807ECE90 = NULL;
+ D_807463AC = 0;
+ D_807463B0 = 0;
+ D_807463A0 = 0;
+ is_autowalking = 0;
+}
+
+void func_8060B700(void) {
+ if (D_807463A8) {
+ func_8061130C(D_807463A8);
+ }
+ if (D_807ECE90) {
+ func_8061130C(D_807ECE90);
+ }
+ func_8060B6CC();
+}
+
+void func_8060B750(s32 fileIndex) {
+ void* file;
+
+ // DK TV Inputs
+ file = getPointerTableFile(0x11, fileIndex, 1, 1);
+ func_8060B5C0(file);
+ func_8066B434(file, 0xF8, 0x33);
+ D_807ECE98 = D_807463A8;
+ D_807ECE94 = D_807ECE90;
+ D_807463AC = 0;
+ D_807463B4 = 0;
+}
+
+// This is assigned to current_character_index
+u8 func_8060B7C4(void) {
+ return D_807ECE30;
+}
+
+void func_8060B7D0(s32 *mapPointer, s32 *exitPointer) {
+ *mapPointer = D_807ECE20.map;
+ *exitPointer = D_807ECE20.exit;
+}
diff --git a/src/global_asm/code_1025E0.c b/src/global_asm/code_1025E0.c
new file mode 100644
index 00000000..a5e833ad
--- /dev/null
+++ b/src/global_asm/code_1025E0.c
@@ -0,0 +1,269 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FD8E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FD950.s")
+
+extern s16 D_80744490;
+extern s16 D_80744494;
+
+extern s32 D_80754AD0; // TODO: Might be an pointer to/array of structs of type GlobalASMStruct2
+extern u16 D_80754AD4;
+
+extern f32 D_8075DFB0;
+extern f32 D_8075DFB4;
+
+extern u8 D_807FD890;
+extern u16 D_807FD892;
+extern u8 D_807FD894;
+extern u8 D_807FD895;
+extern u8 D_807FD896;
+extern u8 D_807FD897;
+extern u8 D_807FD898;
+extern u8 D_807FD899;
+extern s32 D_807FD8A0;
+extern Mtx D_807FD928;
+extern f32 D_807FD968;
+extern s32 D_807FD978;
+
+void func_806FD9A0(void) {
+ D_80754AD0 = 0;
+ D_80754AD4 = 0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FD9B4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FD9FC.s")
+
+// TODO: Any overlap with existing/known structs?
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ u8 pad8[0x18 - 0x08];
+ f32 unk18;
+} GlobalASMStruct2;
+
+GlobalASMStruct2 *func_806FD9B4(s16);
+
+f32 func_806FDA8C(s16 arg0) {
+ return func_806FD9B4(arg0)->unk18;
+}
+
+void func_806FDAB8(s16 arg0, f32 arg1) {
+ func_806FD9B4(arg0)->unk18 = arg1;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FDAEC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FDB8C.s")
+
+void func_806FDF1C(s16 arg0, s32 arg1) {
+ func_80002A30(func_806FD9B4(arg0)->unk4, arg1);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FDF54.s")
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FE078.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FEDB0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FEF7C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FF01C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FF144.s")
+
+void func_806FF32C(s32 arg0, Actor *arg1) {
+ func_806FF144(func_806FEDB0(arg0, arg1->PaaD->unk1A4));
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FF358.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FF628.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FF75C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FFB2C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FFC04.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FFEAC.s")
+
+void func_806FFF5C(void) {
+ // Texture, maybe pulling it into cache?
+ getPointerTableFile(0x19, 0x138B, 1, 1);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_806FFF88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80700088.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807002AC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_8070033C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_8070068C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807007B8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807009F4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80700AE4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80700BF4.s")
+
+// displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80701098.s")
+
+void func_80701C90(void) {
+ D_807FD890 = 1;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80701CA0.s")
+
+// Yikes, lots of params. Perhaps it's passing a struct by value on the stack?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807023E8.s")
+
+// Yikes, lots of params. Perhaps it's passing a struct by value on the stack?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80702464.s")
+
+// displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807024E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80703374.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807035C4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80703850.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80703AB0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80703CF8.s")
+
+void func_807040D0(u16 arg0) {
+ D_807FD892 = arg0;
+}
+
+void func_807040E0(u8 arg0, u8 arg1, u8 arg2) {
+ D_807FD894 = arg0;
+ D_807FD895 = arg1;
+ D_807FD896 = arg2;
+}
+
+void func_80704108(u8 arg0, u8 arg1, u8 arg2) {
+ D_807FD897 = arg0;
+ D_807FD898 = arg1;
+ D_807FD899 = arg2;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704130.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704298.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704444.s")
+
+/*
+// TODO: REGALLOC'D
+typedef struct {
+ u16 unk0;
+ u16 unk2;
+ u16 unk4;
+ s16 unk6;
+ s16 unk8;
+ s16 unkA;
+} GlobalASMStruct3;
+
+void func_80704444(GlobalASMStruct3 *arg0, u16 arg1, u16 arg2, s16 arg3, s16 arg4, u8 arg5) {
+ arg0->unk0 = arg1;
+ arg0->unk2 = arg2;
+ arg0->unk4 = 1000;
+ arg0->unk8 = arg3 << arg5;
+ arg0->unkA = arg4 << arg5;
+}*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704484.s")
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704960.s")
+
+extern f32 D_807FD968;
+extern f32 D_807FD96C;
+extern f32 D_807FD970;
+
+void func_80704AFC(f32 arg0, f32 arg1, f32 arg2) {
+ D_807FD968 = arg0;
+ D_807FD96C = arg1;
+ D_807FD970 = arg2;
+}
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80704B20.s")
+
+typedef struct global_asm_struct_1 {
+ u8 unk0[0x0C];
+ u8 unkC;
+ u8 unkD;
+ u8 unkE;
+} GlobalASMStruct1;
+
+void func_80705B14(GlobalASMStruct1 *arg0, u8 arg1, u8 arg2, u8 arg3) {
+ arg0->unkC = arg1;
+ arg0->unkD = arg2;
+ arg0->unkE = arg3;
+}
+
+void func_80705B30(void) {
+ D_807FD8A0 = 0;
+ guOrtho(&D_807FD928,
+ 0.0f,
+ (D_80744490 * 16.0f) - 1.0,
+ (D_80744494 * 16.0f) - 1.0,
+ 0.0f,
+ D_8075DFB0,
+ D_8075DFB4,
+ 1.0f
+ );
+ D_807FD968 = -1.0f;
+ D_807FD978 = 0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80705C00.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80705F5C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807063B8.s")
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807065F8.s")
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_807069A4.s")
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80706F90.s")
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_8070770C.s")
+
+// Jumptable, 2524 bytes
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_80707980.s")
+
+// Displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1025E0/func_8070835C.s")
+
+extern f32 D_80754CE8;
+
+void func_80708574(f32 arg0) {
+ // TODO: Clamp macro?
+ if (arg0 < 0.0) {
+ arg0 = 0.0f;
+ }
+ if (arg0 > 1.0) {
+ arg0 = 1.0f;
+ }
+ D_80754CE8 = arg0;
+}
diff --git a/src/global_asm/code_104F0.c b/src/global_asm/code_104F0.c
new file mode 100644
index 00000000..2a76efeb
--- /dev/null
+++ b/src/global_asm/code_104F0.c
@@ -0,0 +1,419 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+u8 func_8060BBE0(u16, s32);
+s32 func_8060C6B8(s32 arg0, u8 arg1, u8 arg2, u8 fileIndex);
+void func_8060C758(u8, s32);
+void func_8060BCA0(s32, u8, u8, s16 *, s32);
+void func_8060BEA8(s32, u8, s16 *, s32);
+void func_8060BF84(s32, u8, s16 *, s32);
+u16 func_80631C20(u8);
+u32 func_806F8EDC(s32, s32); // getMaxItemCapacity(HUDItemIndex, playerIndex)
+
+extern s32 D_807EDEAC;
+extern s32 D_807ECCF0;
+extern u8 D_807467E0;
+extern OSMesg D_807EE0B0;
+extern OSMesgQueue D_807EE0D0;
+extern s32 D_807EE0E8;
+extern s32 D_807F0298;
+
+extern s8 D_80744460;
+extern void (*D_807467D0[])();
+extern s16 D_807ECEA0;
+extern u8 D_807EDEA8[4]; // EEPROM file mapping
+extern u8 D_807EDEB0[];
+extern u8 D_807ECEA8[];
+extern OSMesgQueue D_807F02B8;
+extern u8 D_807FC952;
+
+#define FILE_SIZE (((D_807ECEA0 + 0x6B7 & -64) + 0x27) & -8)
+#define FILE_SIZE_BYTES FILE_SIZE / 8
+
+void func_8060B7F0(void) {
+ s32 i;
+
+ D_807ECEA0 = 0;
+ for (i = 0; i < 8; i++) {
+ D_807ECEA0 += func_80631C20(i);
+ }
+}
+
+// Libultra 64 bit stuff, timer
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060B84C.s")
+
+void func_8060B8F8(s32 arg0) {
+ if (osGetThreadId(0) == 9) {
+ D_807467D0[arg0]();
+ return;
+ }
+ if (D_80744460 == 0) {
+ osSendMesg(&D_807F02B8, arg0, 0);
+ }
+}
+
+// Hmm, checksum?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060B968.s")
+
+u8 getEEPROMSaveSlot(s32 fileIndex) {
+ u8 i;
+ for (i = 0; i < 4; i++) {
+ if (fileIndex == D_807EDEA8[i]) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+// 2015 MMM Implications...
+void func_8060BA14(void) {
+ u8 currentFileSaveSlot = getEEPROMSaveSlot(current_file);
+ u8 temporaryFileSaveSlot = getEEPROMSaveSlot(3);
+
+ if ((gameIsInAdventureMode() || gameIsInQuitGameMode()) && (currentFileSaveSlot != temporaryFileSaveSlot)) {
+ void *src = &D_807ECEA8[FILE_SIZE_BYTES * currentFileSaveSlot];
+ void *dest = &D_807ECEA8[FILE_SIZE_BYTES * temporaryFileSaveSlot];
+ memcpy(dest, src, FILE_SIZE_BYTES);
+
+ // Switch the two file indexes in the file mapping array using the XOR trick
+ // It avoids using a temporary variable
+ D_807EDEA8[temporaryFileSaveSlot] = D_807EDEA8[currentFileSaveSlot] ^ D_807EDEA8[temporaryFileSaveSlot];
+ D_807EDEA8[currentFileSaveSlot] ^= D_807EDEA8[temporaryFileSaveSlot];
+ D_807EDEA8[temporaryFileSaveSlot] = D_807EDEA8[currentFileSaveSlot] ^ D_807EDEA8[temporaryFileSaveSlot];
+ }
+}
+
+// TODO: Double check signature
+u8 func_8060BB18(u32, u16, u8);
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060BB18.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060BBE0.s")
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060BCA0.s")
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060BEA8.s")
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060BF84.s")
+
+void func_8060C2C4(s32 arg0, s32 arg1, u8 arg2, u16 *arg3, s8 *arg4) {
+ s32 i;
+ *arg3 += 800;
+ for (i = 0; i < arg2; i++) {
+ *arg3 += func_80631C20(i);
+ }
+ *arg4 = 1;
+}
+
+void func_8060C340(s16 *arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5) {
+ *arg0 = arg5 * FILE_SIZE;
+ if (arg2 >= 0x11) {
+ func_8060BF84(arg2, arg4, arg0, arg1);
+ return;
+ }
+ if (arg2 >= 0xC) {
+ func_8060BEA8(arg2, arg4, arg0, arg1);
+ return;
+ }
+ if (arg2 > 0) {
+ func_8060BCA0(arg2, arg3, arg4, arg0, arg1);
+ return;
+ }
+ func_8060C2C4(arg2, arg3, arg4, arg0, arg1);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060C430.s")
+
+void func_8060C648(s32 arg0, u8 arg1, u8 arg2, u8 fileIndex, s32 arg4) {
+ u16 sp26;
+ u8 sp25;
+
+ func_8060C340(&sp26, &sp25, arg0, arg1, arg2, getEEPROMSaveSlot(fileIndex));
+ func_8060BB18(func_8060C430(arg0, arg4, 1), sp26, sp25);
+}
+
+s32 func_8060C6B8(s32 arg0, u8 arg1, u8 arg2, u8 fileIndex) {
+ s32 temp; // Pad
+ u16 sp22;
+ u8 sp21;
+
+ func_8060C340(&sp22, &sp21, arg0, arg1, arg2, getEEPROMSaveSlot(fileIndex));
+ return func_8060C430(arg0, func_8060BBE0(sp22, sp21), 0);
+}
+
+s32 func_8060C724(u8 fileIndex) {
+ return func_8060C6B8(0x10, 0, 0, fileIndex) + 1;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060C758.s")
+
+/*
+void func_8060C758(u8 fileIndex, s32 arg1) {
+ s32 temp_lo = getEEPROMSaveSlot(fileIndex) * FILE_SIZE_BYTES;
+ current_file = fileIndex;
+ bzero(&D_807ECEA8[temp_lo], FILE_SIZE_BYTES);
+ func_8060C648(0xC, 0, 0, fileIndex, 1);
+ func_8060C648(0xF, 0, 0, fileIndex, fileIndex);
+ if (arg1 != 0) {
+ func_8060B8F8(1);
+ }
+}
+*/
+
+void func_8060C830(u8 fileIndex, s32 arg1) {
+ current_file = fileIndex;
+ func_8060C758(fileIndex, 0);
+ if (func_8060C6B8(0xF, 0, 0, 3) == fileIndex) {
+ func_8060C758(3, 0);
+ }
+ if (arg1) {
+ func_8060B8F8(1);
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060C8AC.s")
+
+void func_8060CB74() {
+ clearGlobalFlags();
+ func_8060C8AC(0xFF);
+}
+
+void func_8060CB9C() {
+ func_8060B8F8(3);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060CBBC.s")
+
+void func_8060D0A8(void) {
+ s32 fileIndex;
+ s32 currentFileBackup;
+
+ currentFileBackup = current_file;
+ // Setup EEPROM file mapping in normal order: 0, 1, 2, 3
+ for (fileIndex = 0; fileIndex < 4; fileIndex++) {
+ D_807EDEA8[fileIndex] = fileIndex;
+ }
+ bzero(&D_807ECEA8, 0x800); // Clear the EEPROM copy
+ func_8060CB74();
+ for (fileIndex = 0; fileIndex < 4; fileIndex++) {
+ func_8060C758(fileIndex, fileIndex == 3);
+ }
+ current_file = currentFileBackup;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060D14C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060D2C8.s")
+
+void func_8060D768() {
+ func_8060D2C8(0);
+}
+
+void func_8060D788() {
+ func_8060D2C8(1);
+}
+
+void func_8060D7A8(void) {
+ s32 kongIndex;
+
+ if (func_806F6EDC()) {
+ D_807FC950[0].crystals = 0.5 * func_806F8EDC(5, 0);
+ }
+ // Training Grounds: Orange Barrel Completed
+ if (isFlagSet(0x184, FLAG_TYPE_PERMANENT)) {
+ D_807FC950[0].oranges = 0.5 * func_806F8EDC(4, 0);
+ }
+ // Camera/Shockwave Unlocked
+ if (isFlagSet(0x179, FLAG_TYPE_PERMANENT)) {
+ D_807FC950[0].film = 0.5 * func_806F8EDC(6, 0);
+ }
+ if (D_807FC952 != 0) {
+ D_807FC950[0].standardAmmo = 0.5 * func_806F8EDC(2, 0);
+ }
+ for (kongIndex = 0; kongIndex < 5; kongIndex++) {
+ current_character_index[0] = kongIndex;
+ if (D_807FC950[0].character_progress[kongIndex].instrument != 0) {
+ D_807FC950[0].character_progress[kongIndex].instrument_ammo = 0.5 * func_806F8EDC(7, 0);
+ }
+ }
+ current_character_index[0] = 0; // DK
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060DC3C.s")
+
+extern s8 D_80750AC0;
+extern u8 D_807ED6A8[];
+extern s32 D_80750AB0;
+
+/*
+// TODO: Very close
+// loadTheGame()
+void func_8060DC3C(u8 fileIndex, s32 arg1) {
+ CharacterProgress *phi_fp;
+ s32 levelIndex;
+ s32 kongIndex;
+ s32 byteIndex;
+
+ phi_fp = D_807FC950[0].character_progress;
+ D_80750AC0 = 1;
+ func_806C9AE0();
+ memcpy(&D_807ECEA8, &D_807ED6A8, 0x800);
+ current_file = fileIndex;
+ current_character_index[0] = 0; // DK
+ if (func_8060C6B8(0xD, 0, 0, fileIndex) == 0) {
+ func_8060C758(fileIndex, 0);
+ }
+ if (arg1 != 0) {
+ func_8060BA14();
+ }
+ cc_number_of_players = 0;
+ D_807FC950->melons = func_8060C6B8(0xC, 0, 0, fileIndex);
+ func_80709464(0);
+ func_806C7B00();
+ D_80750AB0 = func_8060C6B8(0xE, 0, 0, fileIndex);
+ for (kongIndex = 0; kongIndex < 5; kongIndex++) {
+ for (byteIndex = 0; byteIndex < 5; byteIndex++) {
+ ((u8*)phi_fp)[byteIndex] = func_8060C6B8(byteIndex + 4, kongIndex, 0, fileIndex);
+ }
+ phi_fp->coins = func_8060C6B8(9, kongIndex, 0, fileIndex);
+ phi_fp->unk5 = func_8060C6B8(0xA, kongIndex, 0, fileIndex);
+ if (func_8060C6B8(0xB, kongIndex, 0, fileIndex)) {
+ phi_fp->unk5 |= 0x80;
+ }
+ for (levelIndex = 0; levelIndex < 8; levelIndex++) {
+ phi_fp->coloured_bananas[levelIndex] = func_8060C6B8(1, kongIndex, levelIndex, fileIndex);
+ phi_fp->coloured_bananas_fed_to_tns[levelIndex] = func_8060C6B8(2, kongIndex, levelIndex, fileIndex);
+ phi_fp->golden_bananas[levelIndex] = func_8060C6B8(3, kongIndex, levelIndex, fileIndex);
+ }
+ phi_fp++;
+ }
+ if (arg1 != 0) {
+ func_8060D7A8();
+ }
+ current_character_index[0] = 0;
+}
+*/
+
+void func_8060DEA8(void) {
+ func_8060B8F8(2);
+}
+
+// saveTheGame()
+void func_8060DEC8(void) {
+ s32 kongIndex;
+ u32 temp_s1;
+ u32 phi_s0;
+ s32 byteIndex;
+ CharacterProgress *phi_s7;
+ s32 levelIndex;
+
+ if ((cc_number_of_players == 1) && (gameIsInQuitGameMode() || gameIsInAdventureMode())) {
+ phi_s7 = D_807FC950[0].character_progress;
+ phi_s0 = func_805FC98C();
+ temp_s1 = func_8060C724(current_file);
+ if (phi_s0 >= 0x400000) {
+ phi_s0 = -1;
+ }
+ func_8060C648(0xD, 0, 0, current_file, 1);
+ func_8060C648(0xE, 0, 0, current_file, phi_s0);
+ func_8060C648(0xC, 0, 0, current_file, D_807FC950[0].melons);
+ func_8060C648(0xF, 0, 0, current_file, current_file);
+ func_8060C648(0x10, 0, 0, current_file, temp_s1);
+ for (kongIndex = 0; kongIndex < 5; kongIndex++) {
+ for (byteIndex = 0; byteIndex < 5; byteIndex++) {
+ // TODO: Better way to match this?
+ func_8060C648(byteIndex + 4, kongIndex, 0, current_file, ((u8*)phi_s7)[byteIndex]);
+ }
+ func_8060C648(9, kongIndex, 0, current_file, phi_s7->coins);
+ func_8060C648(0xA, kongIndex, 0, current_file, phi_s7->unk5 & 0x7F);
+ func_8060C648(0xB, kongIndex, 0, current_file, (phi_s7->unk5 >> 7) & 1);
+ for (levelIndex = 0; levelIndex < 8; levelIndex++) {
+ func_8060C648(1, kongIndex, levelIndex, current_file, phi_s7->coloured_bananas[levelIndex]);
+ func_8060C648(2, kongIndex, levelIndex, current_file, phi_s7->coloured_bananas_fed_to_tns[levelIndex]);
+ func_8060C648(3, kongIndex, levelIndex, current_file, phi_s7->golden_bananas[levelIndex]);
+ }
+ phi_s7++;
+ }
+ func_8060B8F8(1);
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/func_8060E128.s")
+
+/*
+void func_8060E128(s32 arg0) {
+ s32 sp2C;
+
+ while (TRUE) {
+ osRecvMesg(&D_807F02B8, &sp2C, 1);
+ D_807467D0[sp2C]();
+ }
+}
+*/
+
+void func_8060E128(void); // forward declaration for function pointer
+
+void func_8060E1A8(void) {
+ func_8060B7F0();
+ D_807EDEAC = osEepromProbe(&D_807ECCF0);
+ osCreateMesgQueue(&D_807EE0D0, &D_807EE0B0, 8);
+ osCreateMesgQueue(&D_807F02B8, &D_807F0298, 8);
+ osCreateThread(&D_807EE0E8, 9, &func_8060E128, 0, &D_807F0298, 0xC);
+ osStartThread(&D_807EE0E8);
+ D_807467E0 = 1;
+ func_8060B8F8(0);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_104F0/getFlagBlockAddress.s")
+
+// TODO: Close
+/*
+// ./diff.sh 0x12F5C
+u8 *getFlagBlockAddress(u8 flagType) {
+ s32 temp_t6;
+ u8 *phi_v1;
+ phi_v1 = NULL;
+ switch (flagType) {
+ case FLAG_TYPE_PERMANENT:
+ if ((gameIsInDKTVMode()) || (cc_number_of_players >= 2)) {
+ func_80731030();
+ bzero(&D_807EDEB0, FILE_SIZE_BYTES);
+ phi_v1 = &D_807EDEB0;
+ } else {
+ phi_v1 = &D_807ECEA8[getEEPROMSaveSlot(current_file) * FILE_SIZE_BYTES];
+ }
+ break;
+ case FLAG_TYPE_GLOBAL:
+ phi_v1 = &D_807ECEA8[((((FILE_SIZE * 4) + 0x3F) & ~0x3F) / 8)];
+ break;
+ }
+ return phi_v1;
+}
+*/
+
+u8 func_8060E3B0(u16 arg0, u8 arg1) {
+ u8 phi_v1;
+ u16 sp24;
+ u8 sp23;
+
+ phi_v1 = 0;
+ if (gameIsInAdventureMode()) {
+ func_8060C340(&sp24, &sp23, 0, 0, arg1, getEEPROMSaveSlot(current_file));
+ phi_v1 = func_8060BBE0(sp24 + arg0, 1);
+ }
+ return phi_v1;
+}
+
+void func_8060E430(u16 arg0, u8 arg1, u8 arg2) {
+ u16 sp26;
+ u8 sp25;
+
+ if (gameIsInAdventureMode()) {
+ func_8060C340(&sp26, &sp25, 0, 0, arg2, getEEPROMSaveSlot(current_file));
+ func_8060BB18(arg1, sp26 + arg0, 1);
+ }
+}
diff --git a/src/global_asm/code_10D2D0.c b/src/global_asm/code_10D2D0.c
new file mode 100644
index 00000000..b4719c00
--- /dev/null
+++ b/src/global_asm/code_10D2D0.c
@@ -0,0 +1,112 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10D2D0/func_807085D0.s")
+
+typedef struct global_asm_struct_21 {
+ f32 unk0;
+ u16 unk4;
+ u16 unk6;
+ u8 unk8;
+ u8 unk9;
+ u8 unkA;
+} GlobalASMStruct21;
+
+void func_80708BB8(GlobalASMStruct21 *arg0) {
+ if ((D_807FBB64 & 0x800)) {
+ arg0->unk6 = 0x20;
+ } else {
+ arg0->unk6 = 1;
+ }
+ if (gameIsInDKTVMode()) {
+ arg0->unk6 = 0x20;
+ }
+ arg0->unkA = 0;
+ arg0->unk8 = 0;
+ arg0->unk4 = 0;
+ arg0->unk0 = 4.0f;
+}
+
+// TODO: arg1 might also be PlayerProgress*, needs some padding split apart though
+// Other than that this function looks doable
+void func_80708C24(s32 arg0, CharacterChange *arg1, PlayerProgress *arg2, s32 arg3);
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10D2D0/func_80708C24.s")
+
+void func_80026B0C(s32);
+s32 func_8070943C();
+
+/*
+// Regalloc :(
+void func_80708C24(s32 arg0, CharacterChange *arg1, PlayerProgress *arg2, s32 arg3) {
+ s32 temp_v1_2;
+ s32 temp_lo;
+ s32 pad;
+ u32 sp28;
+
+ sp28 = (u8)arg1->unk2E2;
+ if ((arg1->unk2E2 & 0x10)) {
+ arg1->unk2E2 ^= 0x10;
+ if (arg2->unk2FD > 0) {
+ temp_lo = arg2->melons * func_8070943C();
+ temp_v1_2 = arg2->health + arg2->unk2FD;
+ arg2->health = MIN(temp_v1_2, temp_lo);
+ } else if (arg2->unk2FD < 0) {
+ if (gameIsInAdventureMode() || gameIsInMysteryMenuMinigameMode()) {
+ arg2->health += arg2->unk2FD;
+ }
+ if (arg2->health <= 0) {
+ arg2->health = 0;
+ arg1->unk2E6 = 0xC;
+ if (cc_number_of_players >= 2) {
+ func_80026B0C(arg0);
+ }
+ } else {
+ playSound(0x24B, 0x7FFF, 63.0f, 1.0f, 0, 0);
+ }
+ }
+ arg2->unk2FD = 0;
+ }
+ if ((!(global_properties_bitfield & 2) && func_805FCA64()) || (sp28 & 0x80)) {
+ arg1->unk2E5--;
+ if (arg1->unk2E5 == 0) {
+ arg1->unk2E5 = 0x11;
+ arg1->unk2E4 = 3;
+ }
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10D2D0/func_80708DA4.s")
+
+extern s8 D_80744504;
+
+s16 func_80708DA4(s32, s16, CharacterChange*);
+
+s32 func_80709344(s32 arg0) {
+ s16 i;
+ for (i = 0; i < cc_number_of_players; i++) {
+ if (character_change_array[i].does_player_exist) {
+ if (!(character_change_array[i].unk2E2 & 0x20)
+ && (((character_change_array[i].unk2E4
+ || character_change_array[i].unk2E2)
+ && (D_80744504 == 0))
+ || (character_change_array[i].unk2E2 & 0x10))) {
+ arg0 = func_80708DA4(arg0, i, &character_change_array[i]);
+ }
+ }
+ }
+ return arg0;
+}
+
+// Segments per melon
+s32 func_8070943C(void) {
+ return cc_number_of_players > 1 ? 10 : 4;
+}
+
+void func_80709464(u8 playerIndex) {
+ PlayerProgress *temp = &D_807FC950[playerIndex];
+ temp->health = temp->melons * func_8070943C();
+ temp->unk2FD = 0;
+}
diff --git a/src/global_asm/code_10E1D0.c b/src/global_asm/code_10E1D0.c
new file mode 100644
index 00000000..50ce1aba
--- /dev/null
+++ b/src/global_asm/code_10E1D0.c
@@ -0,0 +1,168 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_807094D0.s")
+
+/*
+extern u8 D_807444F4;
+extern f32 D_807FD9C4;
+extern s8 D_807FD9BC;
+extern s8 D_807444F8;
+extern u8 D_807FD9BD;
+extern s32 D_8076D1F8;
+extern s32 D_807FD9C8;
+
+void func_80737638(s32, s32, s32, s32, f32, s32, s32);
+
+// TODO: Regalloc, and last function call is sus
+void func_807094D0(u8 arg0) {
+ D_807444F4 = is_cutscene_active;
+ switch (arg0) {
+ case 2:
+ D_807FD9C4 = 1.0f;
+ D_807FD9BC = 0;
+ D_807444F8 = 1;
+ is_cutscene_active = 6;
+ break;
+ case 3:
+ D_807FD9C4 = 0.5f;
+ D_807FD9BC = 0;
+ D_807444F8 = 2;
+ is_cutscene_active = 2;
+ D_807FD9BD = 6;
+ if ((D_807444F4 == 1) && (D_807FBB64 & 1)) {
+ func_80600BBC(0);
+ }
+ break;
+ }
+ func_80737638(D_8076D1F8, 0x1BC, 0x7FFF, 0x3F, 1.0f, 0, &D_807FD9C8);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_807095E4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_80709890.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_80709ACC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_80709BC4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070A220.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070A848.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070A934.s")
+
+/*
+s32 func_805FE71C(s32, u8, s32 *, ?);
+s32 func_805FE7B4(s32 *, s32 *, s32 *, ?);
+s32 func_80610044(s32, s32, ?, ?, s32, s32);
+s32 func_8061134C(s32);
+s32 func_8061CBCC();
+s32 func_8070AC74(s32, s32 *, u8 *);
+s32 func_8070AF24(s32 *, u8 *);
+s32 func_8070B7EC(s32 *, s32, s32);
+extern u8 D_807444F4;
+extern void *D_807FD9A8;
+extern s32 D_807FD9B0;
+extern s32 D_807FD9B4;
+extern s32 D_807FD9B8;
+extern u8 D_807FD9BC;
+extern u8 D_807FD9BD;
+
+// TODO: Made decent progress, cleaning up mips_to_c output, still needs some TLC though
+// Those array/struct lookups, oof
+// Also idk what's going on with the first switch case
+void func_8070A934(s32 nextMap, s32 nextExit) {
+ s32 sp34;
+ s32 *sp30;
+ s32 *temp_t7;
+ s32 temp_t5;
+ u8 temp_t1;
+ u8 temp_t1_2;
+ u8 temp_t5_2;
+
+ func_80610044(((D_807444FC * 4) + 0x80770000)->unk-5FB0, D_8076A088, 3, 1, 0x4D2, 1);
+ temp_t1 = D_807444FC ^ 1;
+ temp_t5 = (temp_t1 & 0xFF) * 0x11B0;
+ D_807444FC = temp_t1;
+ object_timer++;
+ temp_t7 = temp_t5 + &D_80767CE8;
+ D_8076A048 = temp_t7;
+ sp30 = temp_t7 + 0xDB0;
+ switch (D_807FD9BC) {
+ case 0:
+ D_807FD9BC = 1;
+ func_8070AF24(&object_timer, &D_807FD9BC);
+ break;
+ }
+ case 1:
+ if ((D_8076A0B1 & 1) && (D_807FD888 == 31.0f)) {
+ sp34 = ((D_807444FC * 4) + 0x80770000)->unk-5FB0;
+ if (D_8076A0B2 == 1) {
+ is_cutscene_active = D_807444F4;
+ }
+ } else {
+ func_8070AC74(*0x8076A048, &sp34, &D_8076A0B1);
+ if (func_8070B7EC(&sp34, D_807FD9B8, D_807FD9B0)) {
+ switch (D_807444F8) {
+ case 1:
+ osViBlack(1);
+ func_805FF378(nextMap, nextExit);
+ D_807FD888 = 31.0f;
+ D_807444F8 = 2;
+ break;
+ case 2:
+ func_8061134C(D_807FD9B0);
+ func_8061134C(D_807FD9A8->unk8);
+ func_8061134C(D_807FD9B4);
+ func_8061134C(D_807FD9A8->unk10);
+ func_8061134C(D_807FD9A8->unk14);
+ func_8066B434(D_807FD9B8, 0x24B, 0x4A);
+ is_cutscene_active = D_807444F4;
+ if ((is_cutscene_active == 1) && D_807FBB64 & 1) {
+ func_8061CBCC();
+ }
+ D_807444F8 = 3;
+ D_807FD888 = 0.0f;
+ break;
+ }
+ }
+ }
+ if (D_807FD9BD != 0) {
+ temp_t5_2 = D_807FD9BD - 1;
+ D_807FD9BD = temp_t5_2;
+ if ((temp_t5_2 & 0xFF) == 0) {
+ D_8076A0B1 |= 2;
+ }
+ }
+ if (D_8076A0A4 && (is_cutscene_active != 6)) {
+ func_805FE71C(sp34, D_807444FC, &D_8076A088, 0);
+ func_805FE7B4(sp30, D_8076A048, &D_8076A08C, 1);
+ return;
+ }
+ func_805FE71C(sp34, D_807444FC, &D_8076A088, 1);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070AC74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070AF24.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070B05C.s")
+
+extern u8 D_80755070; // intro_story_is_playing
+
+void setIntroStoryPlaying(u8 arg0) {
+ D_80755070 = arg0;
+}
+
+u8 isIntroStoryPlaying(void) {
+ return D_80755070;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070B324.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_10E1D0/func_8070B7EC.s")
diff --git a/src/global_asm/code_110F00.c b/src/global_asm/code_110F00.c
new file mode 100644
index 00000000..109c106c
--- /dev/null
+++ b/src/global_asm/code_110F00.c
@@ -0,0 +1,349 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_8070C89C(float (*mf)[4], f32, f32, f32);
+void func_8070C8F4(float (*mf)[4], f32, f32, f32);
+void func_8070C990(float (*mf)[4], f32, f32, f32);
+void func_8070CAB4(float (*mf)[4], f32);
+void func_8070CB2C(float (*mf)[4], f32);
+void func_8070CBA4(float (*mf)[4], f32);
+void func_8070CCC4(float (*mf)[4]);
+void func_8070CD44(float (*mf)[4], f32, f32, f32);
+void func_8070CDD0(f32 (*arg0)[4], f32 (*arg1)[4], f32 arg2, f32 arg3, f32 arg4);
+void func_8070D07C(Mtx*, Mtx*, f32, f32, f32, f32, f32, f32);
+
+extern f64 D_8075E470;
+extern f64 D_8075E478;
+extern f64 D_8075E480;
+
+f32 func_80612D1C(f32, f32);
+f32 func_80612D10(f32);
+
+// tiny, round float, can't auto decompile
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070C200.s")
+
+void func_8070C210(float (*mf)[4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
+ func_8070CCC4(mf);
+ mf[0][0] = arg1;
+ mf[1][1] = arg2;
+ mf[2][2] = arg3;
+ mf[3][3] = 1.0f;
+ mf[3][0] = arg4;
+ mf[3][1] = arg5;
+ mf[3][2] = arg6;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070C27C.s")
+
+/*
+void func_8070C210(Mtx*, f32, f32, f32, f32, f32, f32);
+
+// TODO: Something off here with stack/params
+void func_8070C27C(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
+ Mtx sp28;
+
+ func_8070C210(&sp28, arg1, arg2, arg4, arg5, arg6, arg7);
+ guMtxF2L(&sp28, arg0);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070C2D8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070C590.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070C808.s")
+
+/*
+// TODO: Order of operations nonsense
+void func_8070C808(float (*mf)[4], f32 *arg1, f32 *arg2, f32 *arg3) {
+ *arg1 = (*arg1 * mf[0][0]) + (*arg2 * mf[1][0]) + (*arg3 * mf[2][0]) + mf[3][0];
+ *arg2 = (*arg1 * mf[0][1]) + (*arg2 * mf[1][1]) + (*arg3 * mf[2][1]) + mf[3][1];
+ *arg3 = (*arg1 * mf[0][2]) + (*arg2 * mf[1][2]) + (*arg3 * mf[2][2]) + mf[3][2];
+}
+*/
+
+void func_8070C89C(float (*mf)[4], f32 arg1, f32 arg2, f32 arg3) {
+ f32 temp_f0;
+ f32 temp_f2;
+
+ func_8070CCC4(mf);
+ temp_f0 = arg2 / arg3;
+ temp_f2 = arg1 / arg3;
+ mf[1][1] = temp_f2;
+ mf[1][2] = temp_f0;
+ mf[2][1] = -temp_f0;
+ mf[2][2] = temp_f2;
+}
+
+void func_8070C8F4(float (*mf)[4], f32 arg1, f32 arg2, f32 arg3) {
+ f32 phi_f0;
+ f32 phi_f2;
+
+ phi_f0 = arg2 / arg3;
+ phi_f2 = arg1 / arg3;
+ if (arg2 == 0.0) {
+ phi_f0 = 0.0f;
+ }
+ if (arg1 == 0.0) {
+ phi_f2 = 0.0f;
+ }
+ func_8070CCC4(mf);
+ mf[2][0] = phi_f0;
+ mf[0][2] = -phi_f0;
+ mf[0][0] = phi_f2;
+ mf[2][2] = phi_f2;
+}
+
+void func_8070C990(float (*mf)[4], f32 arg1, f32 arg2, f32 arg3) {
+ f32 temp_f0;
+ f32 temp_f2;
+
+ func_8070CCC4(mf);
+ temp_f0 = arg2 / arg3;
+ temp_f2 = arg1 / arg3;
+ mf[0][0] = temp_f2;
+ mf[0][1] = temp_f0;
+ mf[1][1] = temp_f2;
+ mf[1][0] = -temp_f0;
+}
+
+void func_8070C9E8(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3) {
+ Mtx sp18;
+
+ func_8070C89C(&sp18, arg1, arg2, arg3);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CA2C(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3) {
+ Mtx sp18;
+
+ func_8070C8F4(&sp18, arg1, arg2, arg3);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CA70(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3) {
+ Mtx sp18;
+
+ func_8070C990(&sp18, arg1, arg2, arg3);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CAB4(float (*mf)[4], f32 arg1) {
+ f32 pad; // TODO: Get rid of this if possible
+ f32 temp_f0;
+ f32 sp24;
+ f32 temp_f12;
+
+ temp_f12 = arg1 * D_8075E470;
+ temp_f0 = func_80612D1C(temp_f12, arg1);
+ sp24 = func_80612D10(temp_f12);
+ func_8070CCC4(mf);
+ mf[1][2] = temp_f0;
+ mf[2][1] = -temp_f0;
+ mf[1][1] = sp24;
+ mf[2][2] = sp24;
+}
+
+void func_8070CB2C(float (*mf)[4], f32 arg1) {
+ f32 pad; // TODO: Get rid of this if possible
+ f32 temp_f0;
+ f32 sp24;
+ f32 temp_f12;
+
+ temp_f12 = arg1 * D_8075E478;
+ temp_f0 = func_80612D1C(temp_f12, arg1);
+ sp24 = func_80612D10(temp_f12);
+ func_8070CCC4(mf);
+ mf[2][0] = temp_f0;
+ mf[0][2] = -temp_f0;
+ mf[0][0] = sp24;
+ mf[2][2] = sp24;
+}
+
+void func_8070CBA4(float (*mf)[4], f32 arg1) {
+ f32 pad; // TODO: Get rid of this if possible
+ f32 temp_f0;
+ f32 sp24;
+ f32 temp_f12;
+
+ temp_f12 = arg1 * D_8075E480;
+ temp_f0 = func_80612D1C(temp_f12, arg1);
+ sp24 = func_80612D10(temp_f12);
+ func_8070CCC4(mf);
+ mf[0][1] = temp_f0;
+ mf[1][0] = -temp_f0;
+ mf[0][0] = sp24;
+ mf[1][1] = sp24;
+}
+
+void func_8070CC1C(Mtx *arg0, f32 arg1) {
+ Mtx sp18;
+
+ func_8070CAB4(&sp18, arg1);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CC54(Mtx *arg0, f32 arg1) {
+ Mtx sp18;
+
+ func_8070CB2C(&sp18, arg1);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CC8C(Mtx *arg0, f32 arg1) {
+ Mtx sp18;
+
+ func_8070CBA4(&sp18, arg1);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CCC4(float (*mf)[4]) {
+ mf[0][0] = 1.0f;
+ mf[1][0] = 0.0f;
+ mf[2][0] = 0.0f;
+ mf[3][0] = 0.0f;
+ mf[0][1] = 0.0f;
+ mf[1][1] = 1.0f;
+ mf[2][1] = 0.0f;
+ mf[3][1] = 0.0f;
+ mf[0][2] = 0.0f;
+ mf[1][2] = 0.0f;
+ mf[2][2] = 1.0f;
+ mf[3][2] = 0.0f;
+ mf[0][3] = 0.0f;
+ mf[1][3] = 0.0f;
+ mf[2][3] = 0.0f;
+ mf[3][3] = 1.0f;
+}
+
+void func_8070CD14(Mtx *arg0) {
+ Mtx sp18;
+
+ func_8070CCC4(&sp18);
+ guMtxF2L(&sp18, arg0);
+}
+
+void func_8070CD44(float (*mf)[4], f32 arg1, f32 arg2, f32 arg3) {
+ func_8070CCC4(mf);
+ mf[3][0] = arg1;
+ mf[3][1] = arg2;
+ mf[3][2] = arg3;
+}
+
+void func_8070CD8C(Mtx *arg0, f32 arg1, f32 arg2, f32 arg3) {
+ float sp18[4][4];
+
+ func_8070CD44(&sp18, arg1, arg2, arg3);
+ guMtxF2L(&sp18, arg0);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070CDD0.s")
+
+/*
+// TODO: Surprisingly close but very fiddly
+void func_8070CDD0(f32 (*arg0)[4], f32 (*arg1)[4], f32 arg2, f32 arg3, f32 arg4) {
+ f32 sp30;
+ f32 sp2C;
+ f32 sp24;
+ f32 temp_f0;
+ f32 temp_f16;
+ f32 temp_f16_2;
+ f32 temp_f20;
+ f32 temp_f8;
+ f32 phi_f12;
+ f32 phi_f14;
+ f32 phi_f16;
+ f32 phi_f18;
+ f32 phi_f20;
+
+ if ((arg2 == 0.0f) && (arg4 == 0.0f)) {
+ if (arg3 == 0.0f) {
+ func_8070CCC4(arg0);
+ func_8070CCC4(arg1);
+ return;
+ }
+ sp24 = 0.0f;
+ sp2C = 0.0f;
+ sp30 = 1.0f;
+ phi_f12 = 1.0f;
+ phi_f14 = 0.0f;
+ phi_f16 = 0.0f;
+ phi_f18 = 0.0f;
+ phi_f20 = -1.0f;
+ } else {
+ temp_f16 = 1.0 / sqrtf(arg2 * arg2 + (arg3 * arg3) + (arg4 * arg4));
+ temp_f20 = arg3 * temp_f16;
+ arg2 *= temp_f16;
+ arg4 *= temp_f16;
+ temp_f0 = sqrtf((arg2 * arg2) + (arg4 * arg4));
+ temp_f16_2 = 1.0 / temp_f0;
+ temp_f8 = -arg4 * temp_f16_2;
+ sp24 = -arg2 * temp_f16_2;
+ sp2C = -arg4;
+ sp30 = temp_f20 * temp_f8;
+ phi_f12 = temp_f8;
+ phi_f14 = temp_f20 * sp24;
+ phi_f16 = -arg2;
+ phi_f18 = temp_f0;
+ phi_f20 = -temp_f20;
+ }
+
+ // Setup matrix 1
+ arg0[0][0] = phi_f12;
+ arg0[1][0] = phi_f14;
+ arg0[2][0] = phi_f16;
+ arg0[3][0] = 0.0f;
+ arg0[0][1] = 0.0f;
+ arg0[1][1] = phi_f18;
+ arg0[2][1] = phi_f20;
+ arg0[3][1] = 0.0f;
+ arg0[0][2] = -sp24;
+ arg0[1][2] = sp30;
+ arg0[3][2] = 0.0f;
+ arg0[0][3] = 0.0f;
+ arg0[1][3] = 0.0f;
+ arg0[2][3] = 0.0f;
+ arg0[3][3] = 1.0f;
+ arg0[2][2] = sp2C;
+
+ // Setup matrix 2
+ arg1[0][0] = phi_f12;
+ arg1[1][0] = 0.0f;
+ arg1[3][0] = 0.0f;
+ arg1[0][1] = phi_f14;
+ arg1[1][1] = phi_f18;
+ arg1[2][0] = -sp24;
+ arg1[3][1] = 0.0f;
+ arg1[0][2] = phi_f16;
+ arg1[1][2] = phi_f20;
+ arg1[2][1] = sp30;
+ arg1[3][2] = 0.0f;
+ arg1[0][3] = 0.0f;
+ arg1[1][3] = 0.0f;
+ arg1[2][3] = 0.0f;
+ arg1[3][3] = 1.0f;
+ arg1[2][2] = sp2C;
+}
+*/
+
+void func_8070D020(Mtx *arg0, Mtx *arg1, f32 arg2, f32 arg3, f32 arg4) {
+ Mtx sp60;
+ Mtx sp20;
+
+ func_8070CDD0(&sp60, &sp20, arg2, arg3, arg4);
+ guMtxF2L(&sp60, arg0);
+ guMtxF2L(&sp20, arg1);
+}
+
+// TODO: It's going to be very similar to func_8070CDD0, better match that one first to get familiar with what it's doing
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_110F00/func_8070D07C.s")
+
+void func_8070D300(Mtx *arg0, Mtx *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
+ Mtx sp68;
+ Mtx sp28;
+
+ func_8070D07C(&sp68, &sp28, arg2, arg3, arg4, arg5, arg6, arg7);
+ guMtxF2L(&sp68, arg0);
+ guMtxF2L(&sp28, arg1);
+}
diff --git a/src/global_asm/code_112080.c b/src/global_asm/code_112080.c
new file mode 100644
index 00000000..f2a4a5a6
--- /dev/null
+++ b/src/global_asm/code_112080.c
@@ -0,0 +1,197 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+typedef struct Temp8070D6D8 {
+ s32 unk0;
+ s32 unk4;
+ u16 unk8; // Size
+ u16 unkA;
+ void *unkC; // Next?
+} Temp8070D6D8;
+
+// TODO: What the
+void func_8070D380(u32 arg0, Temp8070D6D8 *arg1, u8 **arg2) {
+ memcpy(arg1, *arg2, arg0);
+ *arg2 += arg0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D3CC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D464.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D568.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D654.s")
+
+Temp8070D6D8 *func_8070D6D8(void *arg0) {
+ Temp8070D6D8 *temp_s0;
+ s32 size;
+
+ temp_s0 = malloc(0x10);
+ func_8070D380(1, temp_s0, &arg0);
+ func_8070D654(temp_s0, &arg0);
+ func_8070D380(2, &temp_s0->unk8, &arg0);
+ size = temp_s0->unk8;
+ temp_s0->unkC = malloc(size);
+ memcpy(temp_s0->unkC, arg0, size);
+ return temp_s0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D754.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D82C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D8C0.s")
+
+extern u8 D_807550CC;
+
+/*
+// TODO: What type does func_8070D754 return?
+void func_8070D8C0(Actor *arg0, u16 arg1, u8 arg2) {
+ void *temp_a0;
+ void *temp_v0;
+
+ temp_v0 = func_8070D754();
+ temp_a0 = temp_v0;
+ temp_v0->unk4->unk174->unk54 = D_807550CC;
+ D_807550CC = 0;
+ func_8070D82C(temp_a0, arg1, arg2, &D_807550CC);
+ arg0->object_properties_bitfield |= 0x02000000;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D928.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D970.s")
+
+/*
+// TODO: Which struct is this?
+void func_8070D970(s32 arg0) {
+ void *temp_v0;
+
+ temp_v0 = func_8070D928(arg0 & 0xFFFF);
+ if (temp_v0 != 0) {
+ temp_v0->unk2--;
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070D9AC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DA28.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DA74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DB7C.s")
+
+/*
+// TODO: Which struct is this?
+void func_8070DB7C(void *arg0) {
+ func_8061134C(arg0->unk4);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DB9C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DC40.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DCA4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DD18.s")
+
+/*
+// TODO: Which struct is this?
+void func_8070DD18(void *arg0) {
+ func_8070DCA4(arg0->unk4);
+ func_8061134C(arg0);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DD44.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DDDC.s")
+
+/*
+s32 func_8070D6D8(void *);
+void *func_8070D928(u16);
+extern void *D_807550C0;
+
+// TODO: Nice little puzzle to solve...
+s32 func_8070DDDC(u16 arg0, s32 arg1) {
+ s32 sp20;
+ u8 temp_v1_2;
+ void **temp_v1;
+ void *temp_a0;
+ void *temp_v0;
+ void *temp_v0_2;
+ void *temp_v0_3;
+ void *phi_v0;
+ void **phi_v1;
+ void *phi_v0_2;
+ void *phi_a0;
+
+ temp_v0 = func_8070D928(arg0);
+ phi_v0_2 = temp_v0;
+ phi_a0 = temp_v0;
+ if (temp_v0 == 0) {
+ // TEXT!!!
+ temp_a0 = getPointerTableFile(0xC, arg0, 1, 1);
+ phi_v1 = &D_807550C0;
+ if (D_807550C0 != 0) {
+ phi_v0 = D_807550C0;
+ do {
+ temp_v1 = phi_v0 + 0xC;
+ temp_v0_2 = *temp_v1;
+ phi_v0 = temp_v0_2;
+ phi_v1 = temp_v1;
+ } while (temp_v0_2 != 0);
+ }
+ sp20 = func_8070D6D8(temp_a0);
+ func_8066B434(temp_a0, 0x1F1, 0x50);
+ temp_v0_3 = malloc(0x10);
+ *phi_v1 = temp_v0_3;
+ temp_v0_3->unk4 = sp20;
+ temp_v0_3->unk0 = arg0;
+ temp_v0_3->unk2 = 0;
+ temp_v0_3->unkC = 0;
+ temp_v0_3->unk8 = arg1;
+ phi_v0_2 = temp_v0_3;
+ phi_a0 = temp_v0_3;
+ }
+ temp_v1_2 = phi_v0_2->unk8;
+ if (temp_v1_2 != 0) {
+ if (temp_v1_2 == 1) {
+ phi_v0_2->unk2 = 2;
+ }
+ } else {
+ phi_v0_2->unk2++;
+ }
+ return phi_a0->unk4;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070DED4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070E2AC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070E34C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070E548.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070E750.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_112080/func_8070E808.s")
+
+extern s32 D_807550C0;
+extern s32 D_807550C4;
+extern u8 D_807550CC;
+
+void func_8070E8C8(void) {
+ D_807550C0 = 0;
+ D_807550C4 = 0;
+}
+
+void func_8070E8DC(u8 arg0) {
+ D_807550CC = arg0;
+}
diff --git a/src/global_asm/code_1135F0.c b/src/global_asm/code_1135F0.c
new file mode 100644
index 00000000..3bc0eacc
--- /dev/null
+++ b/src/global_asm/code_1135F0.c
@@ -0,0 +1,73 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+extern uSprite *D_807550D0;
+
+extern s16 D_807FD9D0; //sx
+extern s16 D_807FD9D2; //sy
+extern u8 D_807FD9D4; //fx
+extern u8 D_807FD9D5; //fy
+
+#ifndef NONMATCHING
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1135F0/func_8070E8F0.s")
+#else
+void func_8070E8F0(Gfx **arg0, uSprite *arg1) {
+ D_807550D0 = arg1;
+ D_807FD9D0 = 0x400;
+ D_807FD9D2 = 0x400;
+ D_807FD9D4 = 0;
+ D_807FD9D5 = 0;
+ switch(D_807550D0->s.SourceImageBitSize) {
+ case G_IM_SIZ_8b: //L8070E96C
+ if ((D_807550D0->s.Stride & 7) == 0) {
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_8b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ } else {//L8070EB34
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_8b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ }
+ break;
+ case G_IM_SIZ_16b: //L8070EC7C
+ if ((D_807550D0->s.Stride & 3) == 0) {
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_16b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ } else {//L8070EB34
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_8b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ }
+ break;
+ case G_IM_SIZ_32b: //L8070EF94
+ if ((D_807550D0->s.Stride & 3) == 0) {
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_32b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ } else {
+ gDPLoadTextureBlock((*arg0)++,D_807550D0->s.SourceImagePointer, D_807550D0->s.SourceImageType, G_IM_SIZ_8b,
+ D_807550D0->s.SubImageWidth, D_807550D0->s.SubImageHeight,
+ D_807550D0->s.TlutPointer, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD
+ );
+ }
+ break;
+ }
+}
+#endif
+
+void func_8070F2C8(s16 arg0, s16 arg1, u8 arg2, u8 arg3) {
+ D_807FD9D0 = arg0;
+ D_807FD9D2 = arg1;
+ D_807FD9D4 = arg2;
+ D_807FD9D5 = arg3;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1135F0/func_8070F2FC.s")
diff --git a/src/global_asm/code_114270.c b/src/global_asm/code_114270.c
new file mode 100644
index 00000000..63d4bce5
--- /dev/null
+++ b/src/global_asm/code_114270.c
@@ -0,0 +1,566 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern s16 D_80744490;
+extern OSTime D_807445B8;
+extern u32 D_807445BC;
+
+extern s8 D_80750754;
+extern s8 D_80750AB8;
+extern u8 D_80750AC0;
+
+extern u16 *D_807550E0;
+extern s32 D_807552EC;
+extern u16 D_80755308; // buttons_enabled
+extern u8 D_8075530C; // joystick_x_bits_enabled
+extern u8 D_80755310; // joystick_y_bits_enabled
+extern u16 D_8075531C;
+extern u8 D_80755324;
+extern u8 D_80755328; // index into D_8075E5C0[]
+extern u8 D_8075532C;
+extern s8 D_80755330; // prevent_transition
+extern s32 D_80755334;
+extern s32 D_80755338; // cutscene_will_play_next_map
+extern s32 D_8075533C; // cutscene_to_play_next_map
+extern f32 D_80755348; // helm_timer
+extern u8 D_80755350;
+extern s8 D_8075536C; // Exit
+extern s32 D_80755384[];
+
+extern u8 D_8075E5C0[];
+
+extern s32 D_807FBB68;
+
+extern u8 D_807FDA1A;
+extern u8 D_807FDA1C;
+
+extern u8 D_807FDA28;
+extern s8 D_807FDA30[];
+
+void func_80026D40(Actor *arg0, s32 arg1);
+void func_80709464(u8);
+void func_8060AC34(GlobalASMStruct12*);
+
+void func_8070F570(void) {
+ s16 i;
+
+ *D_807550E0 = 0;
+ D_807FDA1C = 6;
+ for (i = 0; i < 0x80; i++) {
+ D_807FDA30[i] = i;
+ }
+ D_807FDA1A = 0x7F;
+ D_807FDA28 = 0;
+}
+
+// Doable, needs some structs defined though
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8070F5CC.s")
+
+// Doable, needs some structs defined though (arg0)
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8070FA58.s")
+
+// Doable, needs some structs defined though (arg0)
+// % 320 on a float?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8070FC40.s")
+
+// Big, need structs
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8070FCCC.s")
+
+// Need arg0 struct
+// f32 unkC;
+// f32 unk10;
+// u8 unkB0;
+// u8 unkB1;
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8071006C.s")
+
+// Need arg0 struct
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80710174.s")
+
+// Need arg0 struct
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807102AC.s")
+
+// Need arg0 struct
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807103E0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807105D4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80710CA0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80711410.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80711950.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80711BD0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80711F90.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807122B4.s")
+
+void func_80712490(Maps newMap, s32 newExit, u8 newGameMode) {
+ func_805FF378(newMap, newExit);
+ game_mode = newGameMode;
+}
+
+void func_807124B8(Maps newMap, s32 cutsceneIndex, u8 newGameMode) {
+ if (!func_80712798()) {
+ func_805FF158(0);
+ func_80712490(newMap, D_8075536C, newGameMode);
+ D_80755338 = 1;
+ D_8075533C = cutsceneIndex;
+ D_8075536C = 0;
+ }
+}
+
+void func_80712524(Maps newMap, s32 cutsceneIndex) {
+ func_807124B8(newMap, cutsceneIndex, game_mode);
+}
+
+// getHelmTimerStartTime()
+s32 func_80712548(void) {
+ // Count blueprints turned + 10
+ return func_80731AA8(0x1FD, 40, FLAG_TYPE_PERMANENT) + 10;
+}
+
+// loopy libultra stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80712574.s")
+
+void func_8071261C(void) {
+ D_80755350 = 0;
+}
+
+u8 func_80712628(void) {
+ return D_80755350;
+}
+
+void func_80712634(Maps newMap, s32 arg1) {
+ func_807124B8(newMap, arg1, GAME_MODE_DK_THEATRE);
+ D_80755330 = 0;
+}
+
+// TODO: Why can't this return s32?
+int gameIsInDKTheatreMode(void) {
+ return game_mode_copy == GAME_MODE_DK_THEATRE || game_mode == GAME_MODE_DK_THEATRE;
+}
+
+void func_8071268C(void) {
+ if (game_mode_copy == GAME_MODE_DK_THEATRE) {
+ D_80755330 = 1;
+ }
+}
+
+void func_807126B0(Maps newMap, s32 newExit, s32 characterIndex, s8 moves, s8 simianSlam, s8 instrument, s8 melons) {
+ s32 kongIndex;
+
+ current_character_index[0] = characterIndex;
+ D_807FC950[0].melons = melons;
+ D_807FC950[0].health = melons * 4;
+
+ for (kongIndex = 0; kongIndex < 5; kongIndex++) {
+ D_807FC950[0].character_progress[kongIndex].moves = moves;
+ D_807FC950[0].character_progress[kongIndex].simian_slam = simianSlam;
+ D_807FC950[0].character_progress[kongIndex].instrument = instrument;
+ }
+
+ func_80712490(newMap, newExit, GAME_MODE_MYSTERY_MENU_MINIGAME);
+}
+
+void func_80712774(Maps newMap) {
+ func_80712490(newMap, 0, GAME_MODE_SNIDES_BONUS_GAME);
+}
+
+s32 func_80712798(void) {
+ return game_mode_copy != game_mode;
+}
+
+void func_807127B4(void) {
+ func_805FFFC8();
+ // Unknown flag block right after Aztec Caption Seen
+ setFlag(0x314, TRUE, FLAG_TYPE_PERMANENT);
+ func_807124B8(MAP_HELM_LEVEL_INTROS_GAME_OVER, 0x17, GAME_MODE_QUIT_GAME); // initMapFade()
+}
+
+void func_807127F4(s32 isDKTheatre) {
+ u8 newGameMode;
+
+ if (!isDKTheatre) {
+ newGameMode = GAME_MODE_END_SEQUENCE;
+ } else {
+ newGameMode = GAME_MODE_END_SEQUENCE_DK_THEATRE;
+ }
+ func_807124B8(MAP_DK_ISLES_DK_THEATRE, 0xB, newGameMode); // initMapFade()
+ D_80750754 = -2;
+}
+
+void func_80712830(Actor *arg0, s32 exit) {
+ Actor *temp_a2; // TODO: This is just padding too... hmm
+ Maps map;
+ s32 stackpad;
+ Maps sp20;
+ s32 sp1C;
+
+ func_80709464(exit);
+ if (D_807FBB64 & 1) {
+ arg0->control_state_progress++;
+ if (D_807FBB68 & 2) {
+ // K. Rool: Reset Tiny Phase Progress Flags and Round Counter
+ setFlag(0x5C, TRUE, FLAG_TYPE_TEMPORARY);
+ map = MAP_DK_ISLES_OVERWORLD;
+ exit = 0xC;
+ } else {
+ map = MAP_TROFF_N_SCOFF;
+ if (current_map == MAP_FUNGI_SPIDER) {
+ map = MAP_FUNGI_REAR_PART_OF_MILL;
+ exit = 1;
+ } else {
+ exit = 2;
+ }
+ }
+ func_805FF378(map, exit);
+ return;
+ }
+ if (D_807FBB64 & 0x400) {
+ arg0->control_state_progress++;
+ func_805FF800(&sp20, &sp1C);
+ func_805FF378(sp20, sp1C);
+ return;
+ }
+ if (cc_number_of_players >= 2) {
+ func_80026D40(arg0, exit);
+ return;
+ }
+ func_805FF1B0(exit);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80712944.s")
+
+/*
+// TODO: Regalloc
+void func_80712944(GlobalASMStruct12 *arg0) {
+ func_8060AC34(arg0); // wrapper for subdragHookFunction()
+ arg0->unk2 &= D_8075530C;
+ arg0->unk3 &= D_80755310;
+ arg0->unk0 &= D_80755308;
+ arg0->unk8 &= D_8075530C;
+ arg0->unk9 &= D_80755310;
+ arg0->unk6 &= D_80755308;
+ arg0->unkE &= D_8075530C;
+ arg0->unkF &= D_80755310;
+ arg0->unkC &= D_80755308;
+ arg0->unk14 &= D_8075530C;
+ arg0->unk15 &= D_80755310;
+ arg0->unk12 &= D_80755308;
+}
+*/
+
+// osGetTime stuff, probably timestamp maths
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80712A40.s")
+
+void func_80712B80(void) {
+ if (game_mode == GAME_MODE_DK_TV) {
+ func_8060B750(D_8075E5C0[D_80755328 * 4]);
+ current_character_index[0] = func_8060B7C4();
+ }
+}
+
+// Jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80712BD4.s")
+
+void func_80712EDC(void) {
+ D_80750AC0 = 1;
+ func_80712490(MAP_MAIN_MENU, 0, GAME_MODE_MAIN_MENU);
+}
+
+void func_80712F10(Maps *arg0, s32 *arg1) {
+ if ((game_mode_copy == GAME_MODE_MYSTERY_MENU_MINIGAME)
+ && (((D_807FBB68 & 2) == 0)
+ || (current_map == MAP_KROOL_FIGHT_CHUNKY_PHASE)
+ || (*arg0 == MAP_DK_ISLES_OVERWORLD))) {
+ *arg0 = MAP_MAIN_MENU;
+ *arg1 = 0;
+ game_mode = GAME_MODE_MAIN_MENU;
+ return;
+ }
+ if ((game_mode_copy == GAME_MODE_SNIDES_BONUS_GAME) && (current_map != *arg0)) {
+ *arg0 = MAP_SNIDES_HQ;
+ *arg1 = 0;
+ game_mode = GAME_MODE_ADVENTURE;
+ return;
+ }
+ if (D_80755330 != 0) {
+ *arg0 = -1;
+ }
+}
+
+void func_80712FC8(void) {
+ Maps map;
+ s32 exit;
+
+ if ((D_80755334 >= 0x5A) && (newly_pressed_input & START_BUTTON)) {
+ func_80712EDC();
+ return;
+ }
+ if (D_8075531C == 0) {
+ if (D_8075532C >= 3) {
+ func_807124B8(MAP_NINTENDO_LOGO, 0, GAME_MODE_OPENING_CUTSCENE);
+ return;
+ }
+ func_8060B750(D_8075E5C0[D_80755328 * 4]);
+ func_8060B7D0(&map, &exit);
+ func_805FF158(1);
+ func_805FF378(map, exit);
+ }
+}
+
+void func_80713088(void) {
+ D_8075531C = 0x1E;
+ if (newly_pressed_input_copy & A_BUTTON) {
+ setIntroStoryPlaying(0);
+ func_80712490(MAP_MAIN_MENU, 0, GAME_MODE_MAIN_MENU);
+ }
+}
+
+void func_807130D4(void) {
+ if (func_8061CB50()) {
+ D_8075531C = 0x1E;
+ }
+ if ((D_80755330 == 1) || (D_8075531C == 0) || (newly_pressed_input_copy & A_BUTTON)) {
+ setIntroStoryPlaying(0);
+ D_80755330 = 0;
+ func_80712490(MAP_MAIN_MENU, 0, GAME_MODE_MAIN_MENU);
+ D_80755330 = 2;
+ }
+}
+
+void func_80713168(void) {
+ if ((D_80755334 < 0x1E) || ((newly_pressed_input_copy & (A_BUTTON | START_BUTTON)) == 0)) {
+ if (D_8075531C == 0) {
+ block_3:
+ func_807124B8(MAP_NINTENDO_LOGO, 0, GAME_MODE_OPENING_CUTSCENE);
+ }
+ } else {
+ goto block_3; // TODO: Yikes, this matches, but we should remove this goto
+ }
+}
+
+void func_807131BC(void) {
+ Maps map;
+ s32 exit;
+
+ D_8075532C = 0;
+ func_8060B750(D_8075E5C0[D_80755328 * 4]);
+ func_8060B7D0(&map, &exit);
+ func_805FF158(1);
+ func_80712490(map, exit, GAME_MODE_DK_TV);
+}
+
+void func_8071321C(void) {
+ if ((D_8075531C == 0) || ((D_80755334 >= 0xA) && (newly_pressed_input & START_BUTTON))) {
+ func_807131BC();
+ }
+}
+
+void func_80713270(void) {
+ if ((D_80755324 != 0) || ((game_mode_copy == GAME_MODE_OPENING_CUTSCENE) && (D_80755334 >= 0x5A) && newly_pressed_input & START_BUTTON)) {
+ func_807124B8(MAP_DK_RAP, 0, GAME_MODE_DK_RAP);
+ }
+}
+
+// displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807132DC.s")
+
+s32 *func_805FD030(s32 *arg0);
+s32 *func_807132DC(s32 *arg0); // get displaylist?
+
+/*
+s32 *func_807132DC(s32 *arg0) {
+ s32 *temp_v0;
+
+ temp_v0 = func_805FD030(arg0); // displayList.start()
+ temp_v0[0] = 0x01000118;
+ temp_v0[1] = 0xDA380007;
+ temp_v0[2] = 0xDE000000;
+ temp_v0[3] = 0x020000C0;
+ temp_v0[4] = 0xDA380003;
+ temp_v0[5] = 0x02000180;
+ temp_v0[6] = 0xE7000000;
+ temp_v0[7] = 0x00000000;
+ temp_v0[8] = 0xFFFFF7FB;
+ temp_v0[9] = 0xFC11FE23;
+ temp_v0[0xA] = 0xFA000000;
+ temp_v0[0xB] = 0xFFFFFFFF;
+ temp_v0[0xC] = 0x004D4394;
+ temp_v0[0xD] = 0xED028028;
+ return &temp_v0[0xE];
+}
+*/
+
+// display list something? probably doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_8071338C.s")
+
+// display list something? probably doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713438.s")
+
+// display list something? probably doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807135B4.s")
+
+s32 func_8071375C(s32 arg0) {
+ return arg0;
+}
+
+// display list something? probably doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713764.s")
+
+// TODO: This might return a displaylist
+void func_807138A4(s32 *arg0) {
+ func_807135B4(func_807132DC(arg0));
+}
+
+// display list something? float
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_807138CC.s")
+
+// display list something? probably doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713AA8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713B40.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713C8C.s")
+
+s32 func_8068E7B4(Gfx* arg0, f32, f32, f32);
+
+// TODO: Gfx* passed in?
+s32 func_80713DFC(s32 arg0) { // displayHelmTimer()
+ s32 stackPad0;
+ s32 stackPad1;
+ s32 stackPad2;
+ s32 stackPad3;
+ s32 stackPad4;
+ s32 stackPad5;
+ s32 stackPad6;
+ s32 stackPad7;
+ f32 sp1C;
+ Gfx* dl;
+
+ if (func_80712628()) {
+ if (!(global_properties_bitfield & 3)) {
+ sp1C = D_80744490 * 0.5f;
+ dl = func_807132DC(arg0);
+ gDPSetCombineMode(dl++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+ gDPSetPrimColor(dl++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
+ arg0 = func_8068E7B4(dl++, sp1C, 214.0f, D_80755348); // drawHelmTimer()
+ }
+ }
+ return arg0;
+}
+
+s32 func_80713EA8(s32 arg0) {
+ return arg0;
+}
+
+// GAME_MODE_END_SEQUENCE_DK_THEATRE, structs
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80713EB0.s")
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_114270/func_80714060.s")
+
+// extern s32 (*D_8075E628[])(void);
+// extern s32 (*D_8075E664[])(void);
+
+// TODO: Why can't these return s32?
+int gameIsInDKTVMode(void) {
+ return game_mode == GAME_MODE_DK_TV
+ || game_mode == GAME_MODE_UNKNOWN_4
+ || game_mode_copy == GAME_MODE_DK_TV
+ || game_mode_copy == GAME_MODE_UNKNOWN_4;
+}
+
+int gameIsInAdventureMode(void) {
+ return game_mode_copy == GAME_MODE_ADVENTURE || game_mode == GAME_MODE_ADVENTURE;
+}
+
+int func_80714360(void) {
+ return game_mode_copy == GAME_MODE_UNKNOWN_8 || game_mode == GAME_MODE_UNKNOWN_8;
+}
+
+int gameIsInQuitGameMode(void) {
+ return (game_mode_copy == GAME_MODE_QUIT_GAME || game_mode == GAME_MODE_QUIT_GAME) || (game_mode_copy == GAME_MODE_GAME_OVER || game_mode == GAME_MODE_GAME_OVER);
+}
+
+int gameIsInSnidesBonusGameMode(void) {
+ return game_mode_copy == GAME_MODE_SNIDES_BONUS_GAME || game_mode == GAME_MODE_SNIDES_BONUS_GAME;
+}
+
+int gameIsInMysteryMenuMinigameMode(void) {
+ return game_mode_copy == GAME_MODE_MYSTERY_MENU_MINIGAME || game_mode == GAME_MODE_MYSTERY_MENU_MINIGAME;
+}
+
+int gameIsInMainMenuMode(void) {
+ return game_mode_copy == GAME_MODE_MAIN_MENU;
+}
+
+int func_80714464(void) {
+ return game_mode_copy == GAME_MODE_END_SEQUENCE
+ || game_mode_copy == GAME_MODE_END_SEQUENCE_DK_THEATRE
+ || game_mode == GAME_MODE_END_SEQUENCE
+ || game_mode == GAME_MODE_END_SEQUENCE_DK_THEATRE;
+}
+
+void func_807144B8(u8 arg0) {
+ Maps map;
+ s32 exit;
+
+ D_807445B8 = osGetTime();
+ D_80755350 = 0;
+ func_806C9AE0();
+ func_80731030();
+ func_8060DC3C(arg0, 1);
+ current_character_index[0] = 0; // DK
+ if (func_8060C6B8(0xD, 0, 0, current_file) || story_skip) {
+ // Flag: Isles: Escape Cutscene
+ if (isFlagSet(0x186, FLAG_TYPE_PERMANENT)) {
+ map = MAP_DK_ISLES_OVERWORLD;
+ exit = 0;
+ } else {
+ map = MAP_TRAINING_GROUNDS;
+ exit = 1;
+ }
+ } else {
+ D_80755338 = 1;
+ map = MAP_DK_ISLES_DK_THEATRE;
+ D_8075533C = 0;
+ exit = 0;
+ }
+ func_805FF4D8(map, exit); // initMapChange()
+ game_mode = GAME_MODE_ADVENTURE;
+}
+
+void func_8071458C(void) {
+ s32 map;
+
+ func_806C9AE0();
+ D_80750AB8 = 0;
+ if (D_807552E4.unk0 == 0) {
+ D_80750AB8 = 1;
+ map = MAP_KONG_BATTLE_BATTLE_ARENA;
+ } else {
+ map = D_80755384[D_807552E4.unk20];
+ }
+ func_80712490(map, 0, GAME_MODE_ADVENTURE);
+}
+
+void func_807145F8(void) {
+ D_80755324 = 1;
+}
+
+int func_80714608(s32 arg0) {
+ return (cc_number_of_players >= 2) && arg0 == D_807552E4.unk0;
+}
+
+void func_80714638(void) {
+ func_80712EDC();
+ D_807552EC = 3;
+}
+
+void func_80714660(void) {
+
+}
diff --git a/src/global_asm/code_119370.c b/src/global_asm/code_119370.c
new file mode 100644
index 00000000..db6b7796
--- /dev/null
+++ b/src/global_asm/code_119370.c
@@ -0,0 +1,433 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern u8 D_8074450C;
+
+// TODO: Is this a huge static struct?
+// If so, we can match this whole file pre much
+extern s32 D_807FDB00;
+extern s32 D_807FDB04;
+extern s32 D_807FDB08;
+extern u8 D_807FDB0C;
+extern u8 D_807FDB0D;
+extern u8 D_807FDB0E;
+extern u8 D_807FDB0F;
+extern s32 D_807FDB10;
+extern s32 D_807FDB14;
+extern u8 D_807FDB18;
+extern u16 D_807FDB1A;
+extern u8 D_807FDB1C;
+extern u8 D_807FDB1D;
+extern f32 D_807FDB20;
+extern f32 D_807FDB24;
+extern u8 D_807FDB28;
+extern s32 D_807FDB2C;
+extern s32 D_807FDB30;
+extern u16 D_807FDB34;
+extern u16 D_807FDB36;
+extern s16 D_807FDB38;
+extern u16 D_807FDB3A;
+extern s16 D_807FDB3C;
+extern s16 D_807FDB3E;
+extern s16 D_807FDB40;
+extern s16 D_807FDB42;
+
+void func_80714A9C(void);
+
+void func_80714670(void) {
+ D_807FDB00 = 0;
+ D_807FDB04 = 0;
+ D_807FDB08 = 0;
+ func_80714A9C();
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807146A4.s")
+
+// TODO: Struct?
+void func_807146E0(u8 *arg0, u8 *arg1, u8 *arg2) {
+ *arg1 = arg0[4];
+ *arg2 = arg0[5];
+}
+
+// TODO: Struct?
+void func_807146F4(s16 *arg0, s16 *arg1, s16 *arg2) {
+ *arg1 = arg0[7];
+ *arg2 = arg0[8];
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80714708.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80714778.s")
+
+void func_80714944(s32 arg0) {
+ D_807FDB30 = arg0;
+}
+
+void func_80714950(s32 arg0) {
+ D_807FDB2C = arg0;
+}
+
+void func_8071495C(void) {
+ D_807FDB1D = 1;
+}
+
+void func_8071496C(u16 arg0) {
+ D_807FDB1A = arg0;
+}
+
+void func_8071497C(u16 arg0) {
+ D_807FDB34 = arg0;
+}
+
+void func_8071498C(s32 arg0) {
+ D_807FDB14 = arg0;
+}
+
+void func_80714998(u8 arg0) {
+ D_807FDB1C = arg0;
+}
+
+void func_807149A8(u16 arg0) {
+ D_807FDB3A = arg0;
+}
+
+void func_807149B8(u8 arg0) {
+ D_807FDB18 = arg0;
+}
+
+void func_807149C8(u8 arg0, u8 arg1, u8 arg2, u8 arg3) {
+ D_807FDB0C = arg0;
+ D_807FDB0D = arg1;
+ D_807FDB0E = arg2;
+ D_807FDB0F = arg3;
+}
+
+void func_807149FC(s32 arg0) {
+ D_807FDB10 = arg0;
+}
+
+void func_80714A08(f32 arg0, f32 arg1) {
+ D_807FDB20 = arg0;
+ D_807FDB24 = arg1;
+ D_807FDB28 = 1;
+}
+
+void func_80714A28(u16 arg0) {
+ D_807FDB36 = arg0;
+}
+
+void func_80714A38(u8 arg0) {
+ D_807FDB36 |= arg0;
+}
+
+void func_80714A58(u16 arg0) {
+ D_807FDB38 = arg0;
+}
+
+void func_80714A68(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {
+ D_807FDB3C = arg0;
+ D_807FDB3E = arg1;
+ D_807FDB40 = arg2;
+ D_807FDB42 = arg3;
+}
+
+void func_80714A9C(void) {
+ D_807FDB0F = 0;
+ D_807FDB10 = 1;
+ D_807FDB14 = 0;
+ D_807FDB18 = 0;
+ D_807FDB1C = 1;
+ D_807FDB1A = 0;
+ D_807FDB1D = 0;
+ D_807FDB28 = 0;
+ D_807FDB2C = 0;
+ D_807FDB30 = 0;
+ D_807FDB36 = 0;
+ D_807FDB38 = -1;
+ D_807FDB3C = D_8074450C * 0xA;
+ D_807FDB3E = D_8074450C * 0xA;
+ D_807FDB40 = D_8074450C * 0x135;
+ D_807FDB42 = D_8074450C * 0xE5;
+ D_807FDB3A = 0x258;
+}
+
+s32 func_80714D08(void*, f32, f32, f32, f32, s32, s32, s32, s32);
+
+void func_80714B84(s32 arg0, f32 arg1, s32 arg2, s32 arg3, u8 arg4) {
+ f32 sp3C;
+ f32 sp38;
+ f32 sp34;
+
+ func_806335B0(arg2, 1, arg3, &sp3C, &sp38, &sp34);
+ func_80714D08(arg0, arg1, sp3C, sp38, sp34, 0, arg2, arg3, arg4);
+}
+
+s32 func_80714C08(s32 arg0, f32 arg1, Actor *arg2, s32 arg3, u8 arg4) {
+ f32 sp3C;
+ f32 sp38;
+ f32 sp34;
+
+ func_80671C0C(arg2, arg3, &sp3C, &sp38, &sp34);
+ if (!(arg2->object_properties_bitfield & 0x200) && (arg2->animation_state != NULL) && (D_807FDB36 & 0x80)) {
+ func_80714A38(0x40);
+ }
+ return func_80714D08(arg0, arg1, sp3C, sp38, sp34, arg2, 0, arg3, arg4);
+}
+
+s32 func_80714CC0(void* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
+ return func_80714D08(arg0, arg1, arg2, arg3, arg4, 0, 0, 0, 0);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80714D08.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071509C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80715270.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071586C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807158C0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80715908.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80715A3C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80715B30.s")
+
+void func_80715E38(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) {
+ f32 temp_f0;
+ f32 temp_f16;
+ f32 temp_f2;
+
+ temp_f0 = arg0 - arg3;
+ temp_f2 = arg1 - arg4;
+ temp_f16 = arg2 - arg5;
+ sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f16 * temp_f16));
+}
+
+// displaylist stuff
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80715E94.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80716F10.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80716FB4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717100.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071720C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717404.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717760.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717814.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717930.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717B64.s")
+
+// Very doable, possibly same struct as func_8071C818
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717CE8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717D4C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717D84.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717DB4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80717F1C.s")
+
+// Doable, large struct, that sprite thing?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80718080.s")
+
+void func_807180F4(s32 arg0, s32 arg1) {
+ func_80717D4C();
+ func_80716FB4(arg0, arg1);
+}
+
+extern s32 D_80718380; // Function pointer?
+extern s32 D_8071FEF4;
+
+void func_80718124(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
+ func_807149B8(1);
+ func_80714998(3);
+ func_8071498C(&D_80718380);
+ func_80714CC0(&D_8071FEF4, arg0, arg1, arg2, arg3);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80718188.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071827C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80718380.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807184F4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807186C8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807189BC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80718BF4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071910C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807195D4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_807197B4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80719A0C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80719B88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80719C00.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_80719EF4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071A038.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071A1E4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071A440.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071A674.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071A8B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071AADC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071ABDC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071AF30.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B1AC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B24C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B2EC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B44C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B520.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B758.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B89C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071B8EC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071BB14.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071BC80.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071BE04.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C004.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C24C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C48C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C620.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C818.s")
+
+/*
+// TODO: Is this a different struct?
+// 0x35C is alpha in this function
+extern u8 D_807444FC;
+extern f64 D_8075E9C8;
+
+void func_8071C818(otherSpriteControl *arg0, s8 *arg1) {
+ float sp70[4][4];
+ float sp30[4][4];
+ f64 temp_f2;
+
+ temp_f2 = D_8075E9C8;
+ arg0->xScale -= temp_f2;
+ arg0->yScale -= temp_f2;
+ if (arg0->xScale <= 0.0f) {
+ *arg1 = 1;
+ }
+ arg0->unk35C += 5;
+ guScaleF(&sp70, arg0->xScale, arg0->yScale, 0.0f);
+ guRotateF(&sp30, arg0->unk35C, 0.0f, 0.0f, 1.0f);
+ guMtxCatF(&sp70, &sp30, &sp70);
+ guMtxF2L(&sp70, arg0 + (D_807444FC << 6) + 0x128);
+ arg0->unk32C = 2;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C914.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071C9E8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071CDE0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D0F0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D260.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D28C.s")
+
+// More sprite stuff?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D5BC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D784.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071D94C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071DB74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071DC90.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071E028.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071E110.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071E1C8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071E3EC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071E864.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EA24.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EB70.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EDEC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EEA4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EEE0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071EFDC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F034.s")
+
+/*
+// TODO: Which struct is this.. otherSpriteControl?
+void func_8071F034(void *arg0, s32 arg1) {
+ if (arg0->unk34E == 0) {
+ arg0->unk340 = player_pointer->x_position;
+ arg0->unk344 = player_pointer->y_position;
+ arg0->unk348 = player_pointer->z_position;
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F078.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F1D0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F2F8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F3C0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F444.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F660.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F758.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_119370/func_8071F8E4.s")
diff --git a/src/global_asm/code_127B00.c b/src/global_asm/code_127B00.c
new file mode 100644
index 00000000..1f94d802
--- /dev/null
+++ b/src/global_asm/code_127B00.c
@@ -0,0 +1,119 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_80722E00(s32 map) {
+ void *paths;
+
+ paths = getPointerTableFile(0xF, map, 1, 1);
+ func_80722E48(paths);
+ func_8066B434(paths, 0x47, 0x27);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80722E48.s")
+
+// Used in func_80722FEC as well as func_807245D8.
+typedef struct global_asm_struct_3 {
+ s32 unk0; // Pointer
+ s16 unk4; // Unknown, seen value of 2
+} GlobalASMStruct3;
+
+extern GlobalASMStruct3 *D_807FDB90[];
+
+s32 func_80722FEC(u8 arg0) {
+ if (D_807FDB90[arg0]) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80723020.s")
+
+typedef struct {
+ u8 pad0[0x14];
+ s8 unk14;
+ s8 unk15;
+ s8 unk16;
+ s8 unk17;
+ s32 unk18;
+ s32 unk1C;
+ s8 unk20;
+ s8 unk21;
+} GlobalASMStruct00;
+
+extern GlobalASMStruct00* D_807FDBF8[];
+
+void func_80723284(s32 arg0, u8 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk20 = arg1;
+ }
+}
+
+void func_807232B8(s32 arg0, u8 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk16 = arg1;
+ }
+}
+
+void func_807232EC(s32 arg0, u8 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk15 = arg1;
+ }
+}
+
+void func_80723320(s32 arg0, s32 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk18 = arg1;
+ }
+}
+
+void func_8072334C(s32 arg0, u8 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk21 = arg1;
+ }
+}
+
+void func_80723380(s32 arg0, u8 arg1) {
+ if (arg0 != -1 && D_807FDBF8[arg0]) {
+ D_807FDBF8[arg0]->unk14 = arg1;
+ }
+}
+
+// TODO: Very doable, loop thingy, might need a pointer defined
+// Actor* arg0
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_807233B4.s")
+
+void func_80723428(s32 arg0) {
+ if (arg0 == -1 || D_807FDBF8[arg0]) {
+ func_8061130C(D_807FDBF8[arg0]);
+ D_807FDBF8[arg0] = NULL;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80723484.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_807238D4.s")
+
+u8 func_80723C98(s32 arg0) {
+ if (arg0 == -1 || !D_807FDBF8[arg0]) {
+ return 0;
+ }
+ return D_807FDBF8[arg0]->unk21;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80723CCC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80723F88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80724154.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80724308.s")
+
+s16 func_807245D8(s32 arg0) {
+ return D_807FDB90[arg0]->unk4;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_807245F0.s")
+
+// Unknown struct arg0, only function that calls it is a jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_127B00/func_80724874.s")
diff --git a/src/global_asm/code_1295B0.c b/src/global_asm/code_1295B0.c
new file mode 100644
index 00000000..e3a0866b
--- /dev/null
+++ b/src/global_asm/code_1295B0.c
@@ -0,0 +1,254 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807248B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724994.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724A20.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724A9C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724B5C.s")
+
+void func_80724C2C(s16 arg0) {
+ current_actor_pointer->y_rotation = \
+ current_actor_pointer->unkEE = D_807FBD6C->unkEE + 0x800 & 0xFFF;
+ current_actor_pointer->unkB8 = arg0;
+}
+
+extern s32 D_80755690;
+
+typedef struct {
+ s16 count;
+ s16 unk2;
+ EnemySpawner *firstSpawner;
+} EnemySpawnerLocator;
+
+extern EnemySpawnerLocator *D_80755694;
+
+void func_80724C78(s32 arg0) {
+ func_80728300(arg0, D_80755690, D_80755694);
+}
+
+// TODO: Very doable, just need to define ActorAnimationState->unk1C as an array of 0x8 big structs
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724CA4.s")
+
+// TODO: Doable, more struct definitions needed
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724D28.s")
+
+// TODO: ActorAnimationState->unk20
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724DB0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80724E48.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807255A8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80725B38.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80725BA4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80725DC0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80725ED4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80726164.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807264B0.s")
+
+typedef struct global_asm_struct_8 {
+ s16 unk0;
+ s16 unk2;
+ s16 unk4;
+ s16 unk6;
+ s16 unk8;
+} GlobalASMStruct8;
+
+void func_807266E8(Actor *arg0, GlobalASMStruct8 *arg1) {
+ arg0->x_position = arg1->unk4;
+ arg0->y_position = arg1->unk6;
+ arg0->unk8C = arg1->unk6;
+ arg0->z_position = arg1->unk8;
+ arg0->y_rotation = arg1->unk2;
+}
+
+// Jumptable, references the cutscene model mapping table at D_8075570C
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80726744.s")
+
+u8 func_80726DEC(u8, s32);
+
+u8 func_80726D7C(u8 arg0) {
+ return func_80726DEC(arg0, 5) || func_80726DEC(arg0, 6);
+}
+
+u8 func_80726DC0(u8 arg0) {
+ return func_80726DEC(arg0, 7);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80726DEC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80726E60.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80726EE0.s")
+
+Actor *func_807270C0(s16, u16); // getSpawnerTiedActor()
+void func_80678428(Actor*);
+
+void func_8072707C(s16 arg0, u8 arg1, u16 arg2) {
+ Actor *actor = func_807270C0(arg0, arg2);
+ if (actor) {
+ actor->control_state = arg1;
+ actor->control_state_progress = 0;
+ }
+}
+
+// getSpawnerTiedActor()
+Actor *func_807270C0(s16 spawn_trigger, u16 arg1) {
+ s16 i;
+ EnemySpawner *var_v1;
+
+ var_v1 = D_80755694->firstSpawner;
+ i = 0;
+ while (i < D_80755694->count) {
+ if (spawn_trigger == var_v1->spawn_trigger) {
+ if (var_v1->spawn_state == 5) {
+ var_v1->properties_bitfield |= arg1;
+ return var_v1->tied_actor;
+ }
+ if ((var_v1->spawn_state == 6) && (arg1 & 0x400)) {
+ func_80678428(var_v1->tied_actor);
+ var_v1->spawn_state = 5;
+ return var_v1->tied_actor;
+ }
+ }
+ i++;
+ var_v1++;
+ }
+ return NULL;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80727194.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807271F4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807273A8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_8072752C.s")
+
+/*
+s16 func_80665DE0(f32, f32, f32, f32);
+s32 func_807271F4(s16, s16, s16, s16, s32, s32, s32);
+
+// TODO: Everything matches apart from stack offset
+void func_8072752C(s16 arg0, s16 x1, s16 y1, s16 z1, s16 x2, s16 y2, s16 z2, s16 arg7, s16 arg8) {
+ s16 sp46;
+ f32 sp40;
+ s32 dx, dy, dz;
+ // s32 temp;
+
+ dx = (x2 - x1) * (x2 - x1);
+ dy = (y2 - y1) * (y2 - y1);
+ dz = (z2 - z1) * (z2 - z1);
+ sp46 = func_80665DE0(x2, z2, x1, z1);
+ sp40 = sqrtf(dx + dy + dz);
+ if (func_807271F4(arg0, x1, y1, z1, sp46, sqrtf(dx + dz) / (sp40 / arg7), arg8)) {
+ D_807FBB44->control_state = 0x17;
+ D_807FBB44->control_state_progress = 0;
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80727678.s")
+
+// Unknown struct arg0
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807278C0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80727958.s")
+
+// TODO: Regalloc v1 a3
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80727F20.s")
+
+extern u8 D_80755698[];
+
+u8 func_80652F24(s16, s16);
+
+/*
+// TODO: Regalloc v1 a3
+u8 func_80727F20(EnemyInfo *arg0, s32 arg1) {
+ f32 dz, dy, dx;
+
+ dz = character_change_array[0].look_at_eye_z - arg0->z_position;
+ dx = character_change_array[0].look_at_eye_x - arg0->x_position;
+ dy = character_change_array[0].look_at_eye_y - arg0->y_position;
+
+ return ((dz * dz) + ((dx * dx) + (dy * dy)) < arg1)
+ && ((D_80755698[arg0->unk44] == 6) || (arg0->unk46 & 0x20) || func_80652F24(0, arg0->unk40));
+}
+*/
+
+// Very doable, dx,dy,dz and a large conditional check at the end that will need to be simplified
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80728004.s")
+
+// Very doable, dx,dy,dz and a large conditional check at the end that will need to be simplified
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807280C8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_8072818C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_8072827C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_80728300.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_8072881C.s")
+
+void func_806883F4(Actor *arg0, s32 arg1, s32 arg2, f32 arg3);
+void func_8068842C(Actor *arg0, s32 arg1, s32 arg2);
+void func_80688460(Actor *arg0, s32 arg1, s32 arg2);
+void func_80688370(Actor*, u8, f32);
+
+//s32 func_80688540(Actor*, u8);
+
+/*
+// TODO: Pretty close, might be missing a temp variable?
+// Datatypes could also differ for the & 0x7F function calls
+u8 func_8072881C(s32 arg0, u32 *arg1) {
+ u8 phi_v1 = FALSE;
+ if ((arg0 & 0x80)
+ || (*arg1 + 50 < object_timer
+ && (((rand() >> 0xF) % 1000) < 0x3C1) == 0
+ && !func_80688540(current_actor_pointer, arg0))) {
+ func_80688370(current_actor_pointer, arg0 & 0x7F, 1.0f);
+ func_806883C8(current_actor_pointer, arg0 & 0x7F, 1);
+ func_8068839C(current_actor_pointer, arg0 & 0x7F, 0);
+ func_806884B8(current_actor_pointer, arg0 & 0x7F, 3);
+ func_80688514(current_actor_pointer, arg0 & 0x7F);
+ func_806883F4(current_actor_pointer, arg0 & 0x7F, 0, 0);
+ func_8068842C(current_actor_pointer, arg0 & 0x7F, 2);
+ *arg1 = object_timer;
+ phi_v1 = TRUE;
+ }
+ return phi_v1;
+}
+*/
+
+void func_80728950(u8 arg0) {
+ func_8068842C(current_actor_pointer, arg0, 1);
+ func_80688460(current_actor_pointer, arg0, 1);
+ func_806883F4(current_actor_pointer, arg0, 2, 0);
+}
+
+void func_807289B0(u8 arg0, u8 arg1) {
+ func_806883F4(current_actor_pointer, arg0, arg1, 0);
+}
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1295B0/func_807289E8.s")
+
+void func_80729AA4(u8 arg0) {
+ Actor *actor = func_807270C0(arg0, 0); // getSpawnerTiedActor()
+ if (!actor) {
+ actor = player_pointer;
+ }
+ actor->unk6A |= 0x100;
+}
diff --git a/src/global_asm/code_12E800.c b/src/global_asm/code_12E800.c
new file mode 100644
index 00000000..39e1834c
--- /dev/null
+++ b/src/global_asm/code_12E800.c
@@ -0,0 +1,327 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_80614D00(Actor *, f32, f32);
+extern s32 D_8071FB34;
+extern s32 D_80717D4C;
+extern s32 D_8071FF18;
+extern f64 D_8075FF20;
+void func_806A5DF0(s32, f32, f32, f32, s32, s32, s32, s32);
+void func_806F8BC4(s32, s32, s32);
+void func_806F91B4(u8, u8, s16);
+s16 func_806CC190(s16, s16, f32);
+s32 func_80665DE0(f32, f32, f32, f32);
+s16 func_806CC190(s16, s16, f32);
+
+extern f64 D_8075FF38;
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_80729B00.s")
+
+void func_80729E6C(void) {
+ current_actor_pointer->y_velocity += current_actor_pointer->y_acceleration;
+ if (current_actor_pointer->y_velocity < current_actor_pointer->terminal_velocity) {
+ current_actor_pointer->y_velocity = current_actor_pointer->terminal_velocity;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_80729EB0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072A450.s")
+
+extern f64 D_8075FD28;
+extern s32 D_80720120; // TODO: Datatype
+
+// killEnemy
+void func_8072A714(void) {
+ if ((current_actor_pointer->interactable & 2) && (func_80666A94() || func_80666AA0())) {
+ if (func_80666AA0()) {
+ func_80714CC0(
+ &D_80720120,
+ current_actor_pointer->animation_state->scale_y * D_8075FD28,
+ current_actor_pointer->x_position,
+ current_actor_pointer->y_position,
+ current_actor_pointer->z_position
+ );
+ }
+ current_actor_pointer->control_state = 0x40;
+ enemies_killed++;
+ }
+}
+
+void func_8072A7DC(void) {
+ if ((D_807FDC90->unk1A & 0x40) == 0) {
+ if ((current_actor_pointer->x_position == current_actor_pointer->unk88) && (current_actor_pointer->z_position == current_actor_pointer->unk90)) {
+ D_807FDC90->unk38++;
+ if (D_807FDC90->unk38 >= 0x1F) {
+ D_807FDC90->unk1A |= 0x40;
+ }
+ } else {
+ D_807FDC90->unk38 = 0;
+ }
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072A86C.s")
+
+f32 func_80612794(s16);
+void func_8072AB74(u8, f32, f32, u16, f32);
+
+/*
+// TODO: t8 a3 regalloc? Odd one
+void func_8072A86C(u8 arg0, f32 arg1, f32 arg2, f32 arg3, u16 arg4) {
+ current_actor_pointer->y_velocity = func_80612794(current_actor_pointer->unkF0) * -arg3;
+ func_8072AB74(arg0, arg1, arg2, (arg4 | 0x1080) & 0xFFFF, current_actor_pointer->unk15E * 0.5);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072A920.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072AA80.s")
+
+/*
+// TODO: Surprisingly close, might have type conflicts with D_807FDC9C[0].unkA
+void func_8072AA80(void) {
+ s16 phi_a0;
+
+ if (D_807FDC9C[0].unkA) {
+ phi_a0 = D_807FDC9C[0].unk6 + current_actor_pointer->unk15E + D_807FDC9C[0].unkA;
+ } else {
+ phi_a0 = (s16)current_actor_pointer->unkAC - current_actor_pointer->unk15E;
+ }
+ D_807FDC90->unkC = (((rand(phi_a0) >> 0xF) % 32767)
+ % ((phi_a0 - D_807FDC9C[0].unk6 + current_actor_pointer->unk15E) + 1))
+ + D_807FDC9C[0].unk6 + current_actor_pointer->unk15E;
+}
+*/
+
+// TODO: Huge, and actually seems super doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072AB74.s")
+
+void func_8072B324(Actor *arg0, s32 arg1) {
+ PlayerAdditionalActorData *PaaD = arg0->PaaD;
+ PaaD->unk26 = arg1;
+}
+
+void func_8072B330(u16 arg0) {
+ f32 phi_f2 = MIN(3.0, current_actor_pointer->unkB8 * D_807FDC98->unk38);
+
+ if (current_actor_pointer->unk6A & 4) {
+ phi_f2 *= 0.5;
+ }
+ if (!(D_807FDC98->unk3C < phi_f2)) {
+ phi_f2 = D_807FDC98->unk3C;
+ }
+ if ((!(arg0 & 0x400) || !(phi_f2 < 1.0)) && !(arg0 & 0x200) && (phi_f2 != current_actor_pointer->animation_state->unk48)) {
+ func_80614D00(current_actor_pointer, phi_f2, 0);
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072B438.s")
+
+void func_8072B59C(u8 arg0, s16 arg1, s32 arg2) {
+ current_actor_pointer->control_state = arg0;
+ current_actor_pointer->control_state_progress = 0;
+ if (arg2 != current_actor_pointer->animation_state->unk64) {
+ func_80614EBC(current_actor_pointer, arg2);
+ }
+ func_8072B324(current_actor_pointer, arg1);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072B608.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072B79C.s")
+
+/*
+// Regalloc
+void func_8072B79C(s16 arg0, u16 arg1, s16 arg2) {
+ D_807FDC98->unk26 = arg0;
+ D_807FDC98->unk28 = arg1;
+ D_807FDC98->unk2A = arg2;
+}
+*/
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072B7CC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072C670.s")
+
+void func_8072C870(u8 arg0, u8 arg1, s32 arg2) {
+ if (arg0 == 7) {
+ if (func_80725ED4(1, current_actor_pointer, D_807FDCA0, &D_807FDC90->unkA, &D_807FDC90->unkC, &D_807FDC90->unkE) == 0) {
+ arg0 = 0x10;
+ func_8072B324(current_actor_pointer, D_807FDC9C[0].unkD);
+ }
+ }
+ D_807FDC90->unk36 = arg0;
+ func_8072B59C(arg0, arg1, arg2);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072C918.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072CFE8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072D08C.s")
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072D13C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072D714.s")
+
+void func_8072D99C(void) {
+ current_actor_pointer->noclip_byte = 1;
+ current_actor_pointer->control_state = 0x40;
+ enemies_killed++;
+}
+
+void func_8072D9D4(void) {
+ func_80714CC0(&D_8071FB34, 0.55f, current_actor_pointer->x_position, current_actor_pointer->y_position + (current_actor_pointer->unk15E * 0.5), current_actor_pointer->z_position);
+}
+
+void func_8072DA60(void) {
+ func_80714CC0(&D_8071FB34,
+ 0.55f,
+ D_807FBD6C->x_position,
+ D_807FBD6C->y_position,
+ D_807FBD6C->z_position);
+}
+
+void func_8072DAA4(void) {
+ func_80714998(2);
+ func_807149B8(1);
+ func_8071498C(&D_80717D4C);
+ func_80714950(-0x28 - ((rand() >> 0xF) % 15));
+ func_80714CC0(&D_8071FF18,
+ (((rand() >> 0xF) % 1000) / D_8075FF20) + 0.5,
+ current_actor_pointer->x_position,
+ current_actor_pointer->y_position,
+ current_actor_pointer->z_position);
+}
+
+void func_8072DB68(s32 arg0) {
+ u8 phi_v1;
+ s16 phi_s0;
+
+ if (func_806F8AD4(0xB, cc_player_index) >= 4) {
+ phi_v1 = 3;
+ } else {
+ phi_v1 = func_806F8AD4(0xB, cc_player_index);
+ }
+ func_806F91B4(0xB, cc_player_index, -phi_v1);
+ func_806F8BC4(0xB, 0, 0);
+ playSong(0x41, 1.0f);
+ for (phi_s0 = 0; phi_s0 < phi_v1; phi_s0++) {
+ func_806A5DF0(0x36, player_pointer->x_position, player_pointer->y_position, player_pointer->z_position, (player_pointer->y_rotation + (phi_s0 * 0xC8)) - 0xC8, 1, -1, 0);
+ }
+}
+
+void func_8072DC7C(u8 arg0) {
+ func_8072AB74(0x37, 0.0f, 0.0f, 0x32, 0.0f);
+ current_actor_pointer->shadow_opacity -= arg0;
+ if (current_actor_pointer->shadow_opacity < 0) {
+ current_actor_pointer->control_state_progress++;
+ current_actor_pointer->shadow_opacity = 0;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072DCF4.s")
+
+/*
+s32 func_8061CB50(f64, s32); // TODO: This signature is sus
+f32 func_80665AE4(s32, s32, s32, s32);
+extern f64 D_8075FF28;
+extern f64 D_8075FF30;
+
+s32 func_8072DCF4(Actor *arg0, Actor *arg1, u16 arg2) {
+ s16 temp_f6;
+ s16 temp_f8;
+ s32 phi_a0;
+
+ temp_f8 = ((D_8075FF28 - func_80665AE4(arg1->x_position, arg1->z_position, arg0->x_position, arg0->z_position)) / D_8075FF28) * 65536.0;
+ temp_f6 = (arg0->y_rotation / D_8075FF30) * 65536.0;
+ if (temp_f6 < temp_f8) {
+ phi_a0 = temp_f8 - temp_f6;
+ } else {
+ phi_a0 = temp_f6 - temp_f8;
+ }
+ if ((phi_a0 < arg2) && !func_8061CB50(D_8075FF28, phi_a0)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+*/
+
+void func_8072DE10(u16 arg0) {
+ func_8072DCF4(current_actor_pointer, D_807FDC94, arg0);
+}
+
+void func_8072DE44(s32 arg0) {
+ current_actor_pointer->control_state = D_807FDC9C[0].unk10;
+ current_actor_pointer->control_state_progress = 0;
+ func_80614EBC(current_actor_pointer, arg0);
+ func_8072B324(current_actor_pointer, D_807FDC9C[0].unkC);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072DEA8.s")
+
+void func_8072E02C(void) {
+ current_actor_pointer->z_rotation = func_806CC190(current_actor_pointer->z_rotation, 0, 5.0f);
+ current_actor_pointer->x_rotation += (-current_actor_pointer->x_rotation * D_8075FF38);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072E0A8.s")
+
+/*
+// Quite close, float regalloc and stack/datatype issues
+u8 func_8072E0A8(s32 arg0, s16 arg1) {
+ u8 sp1F;
+ f32 dx;
+ f32 dz;
+ s32 temp_v0_2;
+ s16 phi_v1;
+
+ dz = D_807FDC94->z_position - current_actor_pointer->z_position;
+ dx = D_807FDC94->x_position - current_actor_pointer->x_position;
+ sp1F = FALSE;
+ if (((dx * dx) + (dz * dz)) < (arg0 * arg0)) {
+ sp1F = TRUE;
+ }
+ temp_v0_2 = func_80665DE0(D_807FDC94->x_position, D_807FDC94->z_position, current_actor_pointer->x_position, current_actor_pointer->z_position);
+ if (temp_v0_2 < current_actor_pointer->y_rotation) {
+ phi_v1 = current_actor_pointer->y_rotation - temp_v0_2;
+ } else {
+ phi_v1 = temp_v0_2 - current_actor_pointer->y_rotation;
+ }
+ if (phi_v1 > 0x800) {
+ phi_v1 = 0x1000 - phi_v1;
+ }
+ return phi_v1 < arg1
+ && sp1F
+ && D_807FDC94->control_state != 0x42;
+}
+*/
+
+void func_8072E1A4(u8 arg0, Actor *arg1) {
+ current_actor_pointer->y_rotation = func_806CC190(current_actor_pointer->y_rotation, func_80665DE0(arg1->x_position, arg1->z_position, current_actor_pointer->x_position, current_actor_pointer->z_position), arg0);
+}
+
+u8 func_8072E22C(u16 arg0) {
+ f32 dx = current_actor_pointer->x_position - D_807FDC94->x_position;
+ f32 dy = current_actor_pointer->y_position - D_807FDC94->y_position;
+ f32 dz = current_actor_pointer->z_position - D_807FDC94->z_position;
+ return ((dx * dx) + (dy * dy) + (dz * dz)) < (arg0 * arg0);
+}
+
+void func_8072E2B0(Actor *arg0, f32 *arg1, f32 *arg2, f32 *arg3) {
+ if (arg0->unkCC) {
+ func_80671C0C(arg0, arg0->unkCC, arg1, arg2, arg3);
+ } else {
+ *arg1 = arg0->x_position;
+ *arg2 = arg0->y_position;
+ *arg3 = arg0->z_position;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072E320.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_12E800/func_8072E54C.s")
diff --git a/src/global_asm/code_131B0.c b/src/global_asm/code_131B0.c
new file mode 100644
index 00000000..229541d4
--- /dev/null
+++ b/src/global_asm/code_131B0.c
@@ -0,0 +1,313 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_8060EC54(s32);
+void func_8060E6E8(s32);
+u8 func_8060AC28();
+void func_8060E4D0(u8);
+void func_8060E664(u8);
+void func_8060EC54(s32);
+void func_8060E8CC(Struct807F0470*);
+u8 func_8060AB38(s32);
+
+extern s32 D_80746810;
+extern u8 D_80746818;
+extern u8 D_8076A0B1;
+extern u8 D_807ECD09;
+extern OSMesgQueue D_807ECCF0;
+
+void func_8060E4B0(Struct807F0470 *arg0) {
+ bzero(arg0, sizeof(Struct807F0470));
+}
+
+void func_8060E4D0(u8 arg0) {
+ Struct807F0470 *temp = &D_807F0470[arg0];
+
+ if (osMotorStartStop(&D_807F02D0[arg0], 1) == 4) {
+ func_8060E4B0(temp);
+ temp->unk0 = 3;
+ } else {
+ temp->unk4 = 1;
+ }
+}
+
+void func_8060E574(u8 arg0) {
+ OSPfs *temp_a1;
+
+ switch (osMotorInit(&D_807ECCF0, &D_807F02D0[arg0], arg0)) {
+ case 0:
+ D_807F0470[arg0].unk0 = 1;
+ return;
+ case 1:
+ D_807F0470[arg0].unk0 = 0;
+ return;
+ case 11:
+ D_807F0470[arg0].unk0 = 2;
+ return;
+ case 4:
+ D_807F0470[arg0].unk0 = 3;
+ return;
+ }
+}
+
+void func_8060E664(u8 arg0) {
+ func_8060E574(arg0);
+ osMotorStartStop(&D_807F02D0[arg0], 0);
+ osMotorStartStop(&D_807F02D0[arg0], 0);
+ osMotorStartStop(&D_807F02D0[arg0], 0);
+ D_807F0470[arg0].unk4 = 0;
+}
+
+void func_8060E6E8(s32 arg0) {
+ s32 phi_s0;
+ s32 phi_s3;
+
+ for (phi_s3 = 0; phi_s3 < 4; phi_s3++) {
+ func_8060E4B0(&D_807F0470[phi_s3]);
+ D_807F0470[phi_s3].unk0 = 0;
+ if (D_807ECD09 & (1 << phi_s3)) {
+ for (phi_s0 = 0; phi_s0 < 2; phi_s0++) {
+ func_8060E664(phi_s3);
+ }
+ }
+ }
+}
+
+s32 func_8060E79C(u8 arg0) {
+ if (arg0 >= 4) {
+ return 0;
+ }
+ return D_807F0470[func_8060AB38(arg0)].unk0;
+}
+
+// TODO: Cleanup, get rid of the block label
+void func_8060E7EC(u8 arg0, u8 arg1, s32 arg2) {
+ Struct807F0470 *temp_a0 = &D_807F0470[func_8060AB38(arg0)];
+
+ if ((D_80746810 != 1)
+ && (temp_a0->unk0 == 1)
+ && (character_change_array[arg0].unk2EB == 0)
+ && (gameIsInAdventureMode() || gameIsInMysteryMenuMinigameMode())
+ ) {
+ if (temp_a0->unk12 != 0) {
+ if (temp_a0->unk10 < 0x1F) {
+ temp_a0->unk12 = 0;
+ temp_a0->unk10 = 0;
+ goto block_8;
+ }
+ } else {
+block_8:
+ temp_a0->unkC = arg2;
+ temp_a0->unk5 = arg1;
+ }
+ }
+}
+
+void func_8060E8CC(Struct807F0470 *arg0) {
+ if (arg0->unk0 == 1) {
+ arg0->unk5 = 0;
+ arg0->unkC = 0;
+ }
+}
+
+void func_8060E8EC(u8 arg0) {
+ func_8060E8CC(&D_807F0470[func_8060AB38(arg0)]);
+}
+
+void func_8060E930() {
+ func_8060E6E8(1);
+ func_8060EC54(1);
+}
+
+void func_8060E958() {
+ func_8060E6E8(0);
+ func_8060EC54(1);
+}
+
+// TODO: Why can't this be s32 and still match?
+int func_8060E980(void) {
+ return (global_properties_bitfield & 0x4002)
+ || (D_8076A0B1 & 1)
+ || func_8062919C()
+ || func_8061CB50()
+ || (!gameIsInAdventureMode() && !gameIsInMysteryMenuMinigameMode() && !gameIsInSnidesBonusGameMode());
+}
+
+void func_8060EA28(void) {
+ Struct807F0470 *phi_s0;
+ s32 temp;
+ s32 phi_s1;
+ u8 sp23;
+
+ phi_s0 = &D_807F0470[0];
+ if (D_80746810 == 1) {
+ if (!func_8060E980()) {
+ func_8060EC54(0);
+ }
+ } else if (func_8060E980()) {
+ func_8060EC54(1);
+ }
+ if (D_80746818) {
+ func_8060E6E8(0);
+ }
+ D_80746818 = 0;
+ if (D_80746810 != 1) {
+ sp23 = func_8060AC28();
+ for (phi_s1 = 0; phi_s1 < 4; phi_s1++) {
+ if (phi_s0->unk0 != 1) {
+ if (((D_807ECD09 & (1 << phi_s1))) && ((sp23 & (1 << phi_s1))) && ((object_timer % 15U) == 0)) {
+ func_8060E664(phi_s1);
+ }
+ } else {
+ if (phi_s0->unk12 == 0) {
+ phi_s0->unk12 = (phi_s0->unk10 >= 0x33);
+ }
+ if ((phi_s0->unkC == 0) && (phi_s0->unk5 == 0)) {
+ if (phi_s0->unk10 != 0) {
+ phi_s0->unk10--;
+ }
+ }
+ if (phi_s0->unk5 == 0) {
+ if (phi_s0->unk4) {
+ func_8060E664(phi_s1);
+ }
+ } else {
+ if (phi_s0->unkC) {
+ phi_s0->unkC--;
+ phi_s0->unk10++;
+ }
+ if ((phi_s0->unkC == 0) || phi_s0->unk12) {
+ func_8060E8CC(phi_s0);
+ } else {
+ if (phi_s0->unk8 >= 0x100U) {
+ if (phi_s0->unk4 == 0) {
+ func_8060E4D0(phi_s1);
+ }
+ phi_s0->unk8 -= 0x100;
+ } else {
+ temp = phi_s0->unk5;
+ phi_s0->unk8 += temp * 4;
+ if (phi_s0->unk4) {
+ func_8060E664(phi_s1);
+ }
+ }
+ }
+ }
+ }
+ phi_s0++;
+ }
+ }
+}
+
+void func_8060EC54(s32 arg0) {
+ if (arg0 != D_80746810) {
+ D_80746810 = arg0;
+ D_80746818 = 1;
+ }
+}
+
+// osCreateThread, osStartThread, function pointer, neat
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060EC80.s")
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10;
+} GlobalASMStruct6;
+
+typedef struct {
+ u8 pad0[0x260 - 0x0];
+ s32 unk260;
+ s32 unk264;
+ s32 unk268;
+ GlobalASMStruct6 *unk26C;
+ s32 unk270;
+ s32 unk274;
+} GlobalASMStruct87;
+
+void func_8060ED6C(GlobalASMStruct87 *arg0, GlobalASMStruct6 *arg1, s32 arg2, s32 arg3, s32 arg4) {
+ OSIntMask oldInterruptMask = osSetIntMask(OS_IM_NONE);
+ arg1->unk4 = arg2;
+ arg1->unk0 = arg0->unk260;
+ arg0->unk260 = arg1;
+ arg1->unk8 = arg3;
+ arg1->unkC = arg4;
+ osSetIntMask(oldInterruptMask);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060EDD0.s")
+
+s32 func_8060EE58(s32 arg0) {
+ return arg0 + 0x58;
+}
+
+// Jumptable, appears to be the main function of a thread
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060EE60.s")
+
+s32 func_8060F928(GlobalASMStruct87*, GlobalASMStruct6*);
+
+void func_8060F1D0(GlobalASMStruct87 *arg0, GlobalASMStruct6 *arg1) {
+ func_8060F928(arg0, arg1);
+ if (arg0->unk274 == 0) {
+ func_8060F960(arg0, 1);
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F208.s")
+
+/*
+// TODO: Which types are these?
+void func_8060F208(void *arg0) {
+ if (arg0->unk274 != 0) {
+ func_8060FA5C();
+ return;
+ }
+ D_807F04D0.unk0 = 0;
+ D_807F04D0.unk4D4 = 0;
+ func_8060F960(0);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F254.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F54C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F730.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F854.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F928.s")
+
+/*
+s32 func_8060F928(GlobalASMStruct87 *arg0, GlobalASMStruct6 *arg1) {
+ s32 temp_v0;
+
+ temp_v0 = arg1->unk10;
+ if (temp_v0 == 2) {
+ //*arg0->unk26C = arg1;
+ arg0->unk26C = arg1;
+ } else {
+ //*arg0->unk270 = arg1;
+ arg0->unk270 = arg1;
+ }
+ arg1->unk0 = 0;
+ arg1->unk4 = 2;
+ return temp_v0;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060F960.s")
+
+// D_807F04C0.unk4C4
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060FA5C.s")
+
+void func_8060FAA4(OSMesgQueue *arg0, OSMesg arg1, s32 arg2) {
+ osGetTime();
+ osGetTime();
+ osSendMesg(arg0, arg1, arg2);
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_131B0/func_8060FAE4.s")
diff --git a/src/global_asm/code_1332B0.c b/src/global_asm/code_1332B0.c
new file mode 100644
index 00000000..85d37140
--- /dev/null
+++ b/src/global_asm/code_1332B0.c
@@ -0,0 +1,52 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+u8 func_8072E5B0(void) {
+ return !(player_pointer->unk6A & 1)
+ && !(player_pointer->locked_to_pad == 1)
+ && !(player_pointer->control_state == 0x63); // Rocketbarrel
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072E5FC.s")
+
+typedef struct {
+ s16 unk0;
+ s16 unk2;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+} GlobalASMStruct67;
+
+extern GlobalASMStruct67 D_807557A0[];
+
+// TODO: This stack is super sus, fake match?
+void func_8072E740(Maps map) {
+ s32 i;
+ void *loadingZones;
+ s32 temp;
+ s32 temp2 = 0x27;
+ s32 temp3;
+ s32 sp30;
+
+ // Loading zones
+ loadingZones = getPointerTableFile(0x12, map, 1, 0);
+ func_8072E5FC(loadingZones);
+ if (loadingZones) {
+ func_8066B434(loadingZones, 0xC1, 0x3D);
+ }
+ for (i = 0; i < temp2; i++) {
+ func_8072E7DC(D_807557A0[i].unk2, &sp30);
+ D_807557A0[i].unk8 = sp30;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072E7DC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072E868.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072EA90.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072EC94.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1332B0/func_8072ECFC.s")
diff --git a/src/global_asm/code_133A90.c b/src/global_asm/code_133A90.c
new file mode 100644
index 00000000..734dd894
--- /dev/null
+++ b/src/global_asm/code_133A90.c
@@ -0,0 +1,139 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+void func_8061134C(s32);
+s32 func_8063367C(s32, s32, s32);
+s32 func_80671D64(s32, s32);
+s32 func_806725E4(s16, s16, s16, s32);
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ s32 unk8;
+ s32 unkC;
+ s16 unk10;
+ s16 unk12;
+ s16 unk14;
+ s16 unk16;
+ s32 unk18;
+} Unk34;
+
+typedef struct {
+ s32 unk0; // Used
+ u8 unk4; // Used
+ u8 unk5;
+ u16 unk6;
+ s32 unk8;
+ s32 unkC;
+ s32 unk10[4];
+ s32 unk20[4];
+ s32 unk30;
+ Unk34 *unk34;
+} GlobalASMStruct82; // TODO: Might be D_807FDCC0
+
+extern s32 D_807FDCC0;
+
+void func_8072ED90(void) {
+ D_807FDCC0 = 0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072ED9C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072EE0C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072EE7C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072EF7C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072F09C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072F120.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072F230.s")
+
+u8 func_8072F4A8(Actor *arg0, u8 arg1, f32 *arg2, f32 *arg3, f32 *arg4) {
+ s16 model2ArrayIndex;
+ u8 phi_t0;
+
+ phi_t0 = FALSE;
+ switch (arg1) {
+ case 0:
+ *arg2 = arg0->x_position;
+ *arg3 = arg0->y_position;
+ *arg4 = arg0->z_position;
+ break;
+ case 1:
+ case 2:
+ model2ArrayIndex = func_80659470(arg0);
+ *arg2 = D_807F6000[model2ArrayIndex].x_position;
+ *arg3 = D_807F6000[model2ArrayIndex].y_position;
+ *arg4 = D_807F6000[model2ArrayIndex].z_position;
+ // TODO: Better way to match this once proper type is known
+ // It'll probably be D_807F6000[model2ArrayIndex].unk24->unk0
+ if (*((s32*)D_807F6000[model2ArrayIndex].unk24) & 1) {
+ phi_t0 = TRUE;
+ }
+ break;
+ }
+ return phi_t0;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072F59C.s")
+
+s32 func_8072F8D4(GlobalASMStruct82 *arg0, s32 arg1, s16 arg2) {
+ s16 model2ArrayIndex;
+ s32 angle;
+
+ if (!arg0->unk4) {
+ return TRUE;
+ }
+ model2ArrayIndex = func_80659470(arg0->unk0);
+ switch (D_807F6000[model2ArrayIndex].object_type) {
+ case 0xC9: // Ladder
+ case 0xCA: // Ladder
+ case 0x1CB: // Ladder (Fungi)
+ case 0x1F7: // Ladder (Fungi)
+ case 0x1F8: // Ladder (Fungi)
+ break;
+ default:
+ return TRUE;
+ }
+ angle = D_807F6000[model2ArrayIndex].y_rotation * 4096.0f / 360.0f;
+ if (func_806725E4((arg0->unk34[arg1].unk10 + angle) & 0xFFF, (arg0->unk34[arg1].unk14 + angle) & 0xFFF, arg2, 0)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072FA14.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072FCC4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072FDD4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_8072FE60.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_807300BC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_80730408.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_80730AEC.s")
+
+void func_80730D60(s32 arg0, u8 arg1, u8 arg2, u8 arg3, s32 *arg4, s32 *arg5) {
+ switch (arg1) {
+ case 0:
+ *arg4 = func_80671D64(arg0, arg2);
+ *arg5 = func_80671D64(arg0, arg3);
+ break;
+ case 1:
+ case 2:
+ *arg4 = func_8063367C(arg0, 1, arg2);
+ func_8061134C(*arg4);
+ *arg5 = func_8063367C(arg0, 1, arg3);
+ func_8061134C(*arg5);
+ break;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_133A90/func_80730E18.s")
diff --git a/src/global_asm/code_135D30.c b/src/global_asm/code_135D30.c
new file mode 100644
index 00000000..cc8afcbf
--- /dev/null
+++ b/src/global_asm/code_135D30.c
@@ -0,0 +1,297 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern u8 temporary_flag_block[];
+u8* getFlagBlockAddress(u8 flagType); // TODO: Can we use the FlagTypes enum? Needs to be a u8 to match
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_80731030.s")
+
+/*
+// TODO: Not sure why this doesn't match, maybe turn it into a while loop?
+void func_80731030(void) { // clearTemporaryFlags()
+ s32 flagIndex;
+ for (flagIndex = 0; flagIndex != 0xE; flagIndex++) {
+ temporary_flag_block[flagIndex] = 0;
+ }
+}
+*/
+
+void clearPermanentFlags(void) {
+ s32 flagIndex;
+ for (flagIndex = 0; flagIndex < 0x316; flagIndex++) {
+ setFlag(flagIndex, FALSE, FLAG_TYPE_PERMANENT);
+ }
+}
+
+void clearGlobalFlags(void) {
+ s32 flagIndex;
+ for (flagIndex = 0; flagIndex < 0x2C; flagIndex++) {
+ setFlag(flagIndex, FALSE, FLAG_TYPE_GLOBAL);
+ }
+}
+
+u8 isFlagSet(s16 flagIndex, u8 flagType) { // TODO: Can we use the FlagTypes enum? Needs to be a u8 to match
+ u8 *flagBlock;
+ s16 flagByte;
+
+ if (flagIndex == -1) {
+ return 0;
+ }
+ switch (flagType) {
+ case FLAG_TYPE_PERMANENT:
+ case FLAG_TYPE_GLOBAL:
+ flagBlock = getFlagBlockAddress(flagType);
+ break;
+ case FLAG_TYPE_TEMPORARY:
+ flagBlock = &temporary_flag_block;
+ }
+ flagByte = flagIndex >> 3;
+ return flagBlock[flagByte] >> (s16)(flagIndex - flagByte * 8) & 1;
+}
+
+// Doable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_807311C4.s")
+
+typedef struct {
+ s16 unk0; // Start Permanent Flag Index
+ s16 unk2; // End Permanent Flag Index
+ s16 unk4; // Flag Count Required
+ s16 unk6; // Global Flag To Set
+} Struct80756024;
+extern Struct80756024 D_80756024[];
+
+void func_807311C4(s16, s32);
+
+/*
+void func_807311C4(s16 arg0, s32 arg1) {
+ u32 i;
+ s32 chosenFlag;
+
+ chosenFlag = -1;
+ i = 0;
+ do {
+ if (arg0 >= D_80756024[i].unk0 && D_80756024[i].unk2 >= arg0) {
+ if (func_80731AA8(D_80756024[i].unk0, (D_80756024[i].unk2 - D_80756024[i].unk0) + 1, FLAG_TYPE_PERMANENT) == D_80756024[i].unk4) {
+ chosenFlag = D_80756024[i].unk6;
+ }
+ }
+ i++;
+ } while (i < 0x21 && chosenFlag == -1);
+
+ if (chosenFlag >= 0) {
+ setFlag(chosenFlag, TRUE, FLAG_TYPE_GLOBAL);
+ }
+}
+*/
+
+void setFlag(s16 flagIndex, u8 newValue, u8 flagType) {
+ u8 *flagBlock;
+ s16 flagByte;
+ s32 sp2C; // This is load bearing, cannot remove
+
+ if (flagIndex != -1) {
+ switch (flagType) {
+ case FLAG_TYPE_PERMANENT:
+ case FLAG_TYPE_GLOBAL:
+ flagBlock = getFlagBlockAddress(flagType);
+ break;
+ case FLAG_TYPE_TEMPORARY:
+ flagBlock = &temporary_flag_block;
+ break;
+ }
+ flagByte = flagIndex >> 3;
+ if (newValue) {
+ flagBlock[flagByte] |= 1 << (s16)(flagIndex - (flagByte * 8));
+ } else {
+ flagBlock[flagByte] &= ~(1 << (s16)(flagIndex - (flagByte * 8)));
+ }
+ if (newValue && (flagType == FLAG_TYPE_PERMANENT)) {
+ func_807311C4(flagIndex, flagType);
+ }
+ }
+}
+
+typedef struct {
+ u8 unk0;
+ u8 unk1;
+ s16 unk2;
+ s16 unk4; // Used, permanent flag index
+ s16 unk6;
+} Struct80755A20;
+
+extern Struct80755A20 D_80755A20[];
+
+typedef struct {
+ u8 unk0; // Used, likely map
+ u8 unk1;
+ s16 unk2; // Used
+ u16 unk4; // Used
+ u8 unk6; // Used
+ u8 unk7; // Used
+} Struct807FDCD0;
+
+extern Struct807FDCD0 D_807FDCD0[];
+
+void func_807313BC(void) {
+ s32 i;
+
+ for (i = 0; i < 24; i++) {
+ if (!func_805FF938(D_807FDCD0[i].unk0)) {
+ D_807FDCD0[i].unk7 = 0;
+ }
+ }
+}
+
+void func_80731410(s16 arg0, s16 arg1, s16 arg2, u8 arg3) {
+ s32 i;
+
+ for (i = 0; i < 24; i++) {
+ if (D_807FDCD0[i].unk7 == 0) {
+ D_807FDCD0[i].unk0 = arg0;
+ D_807FDCD0[i].unk2 = arg1;
+ D_807FDCD0[i].unk4 = arg2;
+ D_807FDCD0[i].unk6 = arg3;
+ D_807FDCD0[i].unk7 = 1;
+ return;
+ }
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_807314F4.s")
+
+/*
+// Not sure why this doesn't match
+void func_807314F4(s16 arg0, s16 arg1) {
+ s32 i;
+ s32 j;
+
+ for (i = 0; i < 0x71; i++) {
+ if ((arg0 == D_80755A20[i].unk0) && (arg1 == D_80755A20[i].unk2)) {
+ setFlag(D_80755A20[i].unk4, TRUE, FLAG_TYPE_PERMANENT);
+ return;
+ }
+ }
+
+ for (j = 0; j < 24; j++) {
+ if (D_807FDCD0[j].unk7 && arg0 == D_807FDCD0[j].unk0 && arg1 == D_807FDCD0[j].unk2) {
+ setFlag(D_807FDCD0[j].unk4, TRUE, FLAG_TYPE_PERMANENT);
+ D_807FDCD0[j].unk7 = 0;
+ return;
+ }
+ }
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_807315D4.s")
+
+/*
+// Not sure why this doesn't work
+u8 func_807315D4(s16 arg0, s16 arg1) {
+ s32 i;
+ for (i = 0; i < 0x71; i++) {
+ if ((arg0 == D_80755A20[i].unk0) && (arg1 == D_80755A20[i].unk2)) {
+ return isFlagSet(D_80755A20[i].unk4, FLAG_TYPE_PERMANENT);
+ }
+ }
+ return FALSE;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_80731654.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_80731784.s")
+
+typedef struct {
+ u8 map;
+ s8 unk1;
+ s16 spawnerID;
+ s16 flagIndex;
+ s8 unk6;
+ s8 unk7;
+} Struct80755DA8;
+
+extern Struct80755DA8 D_80755DA8[]; // 0x1F
+
+/*
+// TODO: Close
+s16 func_80731784(s16 map, s16 spawnerID, s32 *arg2) {
+ s16 i;
+
+ *arg2 = 0;
+ i = 0;
+ while (i < 0x1F) {
+ if (map == D_80755DA8[i].map) {
+ if (spawnerID == D_80755DA8[i].spawnerID) {
+ *arg2 = i;
+ return D_80755DA8[i].flagIndex;
+ }
+ }
+ i++;
+ }
+ return -1;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_807317FC.s")
+
+// Seems doable, but stack/datatype/address issues, hmm
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_807318AC.s")
+
+typedef struct {
+ s16 unk0;
+ s16 unk2;
+} Struct80755F4C;
+
+extern Struct80755F4C D_80755F4C[];
+
+// TODO: This might not be right, the struct array is not used anywhere else
+s16 func_8073195C(s16 arg0) {
+ if (arg0 == 0) {
+ return -1;
+ }
+ return D_80755F4C[arg0].unk0;
+}
+
+// Doable, unrolled loop, struct array
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_135D30/func_8073198C.s")
+
+// Returns a permanent flag index
+s32 func_807319D8(s32 arg0, s32 arg1, s32 arg2) {
+ s32 tmp = -1;
+ if (arg1 < 8) {
+ if (arg2 < 5) {
+ tmp = (arg1 * 5) + arg0 + arg2;
+ }
+ }
+ return tmp;
+}
+
+s32 func_80731A04(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
+ s32 flagIndex;
+ s32 i;
+ s32 count;
+
+ count = 0;
+ if (arg3 >= 5) {
+ return 0;
+ }
+
+ for (i = arg1; i <= arg2; i++) {
+ flagIndex = func_807319D8(arg0, i, arg3);
+ if (flagIndex >= 0) {
+ count += isFlagSet(flagIndex, FLAG_TYPE_PERMANENT);
+ }
+ }
+ return count;
+}
+
+// countSetFlags(startIndex, length, flagType);
+s32 func_80731AA8(s32 startIndex, s32 length, u8 flagType) {
+ s32 flagIndex;
+ s32 count = 0;
+ for (flagIndex = startIndex; flagIndex < startIndex + length; flagIndex++) {
+ count += isFlagSet(flagIndex, flagType);
+ }
+ return count;
+}
diff --git a/src/global_asm/code_136820.c b/src/global_asm/code_136820.c
new file mode 100644
index 00000000..959e3fb1
--- /dev/null
+++ b/src/global_asm/code_136820.c
@@ -0,0 +1,144 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+extern s32 D_80744470[];
+
+extern s8 D_807563B0;
+extern u8 D_807563B4;
+
+extern OSThread D_807FDDA0;
+
+extern OSMesgQueue D_807FEF58;
+extern s32 D_807FEF70;
+extern s32 D_807FEF74;
+extern s32 D_807FEF78;
+extern s32 D_807FEF80;
+extern u16 D_807FEF84;
+extern s16 D_807FEF86;
+
+extern OSMesgQueue D_807FEF58;
+extern s32 D_807FEF80;
+
+extern u8 D_807FF01C;
+extern s32 D_807FF020;
+extern s32 D_807FF024;
+extern s32 D_807FF028;
+
+void func_80732280(void *);
+extern void *D_807FEF50;
+
+void func_80731B20(s32 arg0, s32 arg1, s32 arg2) {
+ D_807FEF80 = arg0;
+ D_807FEF78 = 2;
+ D_807FEF84 = 0xFFFF;
+ D_807FEF86 = 1;
+ D_807FEF70 = arg1;
+ D_807FEF74 = arg2;
+}
+
+void func_80731B60(s32 arg0) {
+ if (!arg0) {
+ D_807FEF84 = 0xFFFF;
+ } else {
+ D_807FEF84 = 0xF801;
+ }
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80731B88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80731D20.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80731E68.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_8073202C.s")
+
+/*
+s32 func_8073202C(s32 arg0, s32 *arg1, s32 *arg2) {
+ if ((arg0 & 0xFFFF0000) == 0x8FBF0000) {
+ *arg2 = arg1[(s16)arg0];
+ return TRUE;
+ }
+ return FALSE;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80732064.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_8073209C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80732158.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80732280.s")
+
+/*
+// TODO: Matches except for some extra NOPs being inserted in this version
+// No idea why
+void func_80732280(void* arg0) {
+ OSMesg *sp3C;
+ s32 *temp_s0;
+ s32 temp_s1;
+ s32 temp;
+
+ osSetEventMesg(0xC, &D_807FEF58, 0x10);
+ do {
+ do {
+ osRecvMesg(&D_807FEF58, &sp3C, 1);
+ } while (!D_807563B4);
+ temp_s1 = func_80005A70();
+ } while (!temp_s1);
+
+ while (TRUE) {
+ for (temp = 0; temp < 2; temp++) {
+ osViBlack(0);
+ D_807FEF80 = D_80744470[temp];
+ func_80731E68(temp_s1);
+ func_80731E68(temp_s1);
+ }
+ }
+}
+*/
+
+void func_80732354(u8 arg0, s32 arg1, s32 arg2, s32 arg3) {
+ D_807FF01C = arg0;
+ D_807FF020 = arg1;
+ D_807FF024 = arg2;
+ D_807FF028 = arg3;
+ func_8061D4E4(0);
+}
+
+void func_8073239C(void) {
+ __osSetFpcCsr(__osGetFpcCsr() | FPCSR_EZ);
+ osCreateMesgQueue(&D_807FEF58, &D_807FEF50, 1);
+ osCreateThread(&D_807FDDA0, 8, func_80732280, NULL, &D_807FEF50, 0x32);
+ osStartThread(&D_807FDDA0);
+ D_807563B0 = 1;
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80732420.s")
+
+/*
+typedef struct global_asm_struct_2 {
+ u32 unk0;
+ u32 unk4;
+ u32 unk8;
+ u32 unkC;
+} GlobalASMStruct2;
+
+void func_80732420(u32 *arg0, u32 arg1, u32 arg2) {
+ arg0[0] = arg1;
+ arg0[2] = arg2;
+ arg0[1] = arg0[0];
+ arg0[3] = 0;
+ //arg0->unk0 = arg1;
+ //arg0->unk8 = arg2;
+ //arg0->unkC = 0;
+ //arg0->unk4 = arg0->unk0;
+}
+*/
+
+void func_8073243C(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_136820/func_80732444.s")
diff --git a/src/global_asm/code_1371D0.c b/src/global_asm/code_1371D0.c
new file mode 100644
index 00000000..c6bc59ac
--- /dev/null
+++ b/src/global_asm/code_1371D0.c
@@ -0,0 +1,54 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_807324D0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_80732534.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_80732618.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_80732730.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_807327F4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_1371D0/func_80732894.s")
+
+typedef struct {
+ s32 unk0;
+ s32 unk4;
+ u8 unk8;
+ u8 unk9;
+ s16 unkA;
+ s32 unkC;
+ s32 unk10;
+} GlobalASMStruct69;
+
+/*
+// Not sure what's wrong here, some compiler flag maybe?
+void func_80732894(GlobalASMStruct69 *arg0, s32 arg1, s32 arg2) {
+ if (arg0->unk9 != 0) {
+ return;
+ }
+ arg0->unk9 = 1;
+ arg0->unk0 += arg2;
+ switch (arg0->unk8) {
+ case 0:
+ arg0->unk10 += arg1;
+ if (arg0->unkC != 0) {
+ arg0->unkC += arg1;
+ }
+ break;
+ case 1:
+ if (arg0->unkC != 0) {
+ arg0->unkC += arg1;
+ }
+ break;
+ }
+}
+*/
+
+void func_80732924(void) {
+
+}
diff --git a/src/global_asm/code_137630.c b/src/global_asm/code_137630.c
new file mode 100644
index 00000000..129714e9
--- /dev/null
+++ b/src/global_asm/code_137630.c
@@ -0,0 +1,48 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_80732930.s")
+
+/*
+extern f32 D_80760190;
+
+// No idea why this doesn't match, compiler flag?
+f32 func_80732930(u8 arg0) {
+ f32 sp4;
+ f32 sp0;
+
+ sp4 = D_80760190;
+ sp0 = 1.0f;
+ while (arg0) {
+ if (arg0 & 1) {
+ sp0 *= sp4;
+ }
+ sp4 *= sp4;
+ arg0 = (arg0 >> 1);
+ }
+ return sp0;
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_807329AC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_80732B3C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_80732D80.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_80732DAC.s")
+
+/*
+extern f32 D_8076019C;
+
+void func_80612D1C(f32);
+
+// TODO: No idea why this doesn't match
+void func_80732DAC(f32 arg0) {
+ func_80612D1C(arg0 / D_8076019C);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137630/func_80732DEC.s")
diff --git a/src/global_asm/code_137C10.c b/src/global_asm/code_137C10.c
new file mode 100644
index 00000000..eabd4097
--- /dev/null
+++ b/src/global_asm/code_137C10.c
@@ -0,0 +1,32 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80732F10.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80733180.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80733A88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80733B88.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80733C34.s")
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80733D8C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80735624.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80735864.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80735958.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_807359A0.s")
+
+// struct 0x88
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_137C10/func_80735A34.s")
+
+void func_80735A44(void) {
+
+}
diff --git a/src/global_asm/code_13A750.c b/src/global_asm/code_13A750.c
new file mode 100644
index 00000000..c527228b
--- /dev/null
+++ b/src/global_asm/code_13A750.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A750/func_80735A50.s")
diff --git a/src/global_asm/code_13A7A0.c b/src/global_asm/code_13A7A0.c
new file mode 100644
index 00000000..092fe3a9
--- /dev/null
+++ b/src/global_asm/code_13A7A0.c
@@ -0,0 +1,86 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80735AA0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80735CF4.s")
+
+// jumptable
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80735DBC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80736FB8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737028.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_807370A4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737198.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_8073726C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_8073749C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_807375E0.s")
+
+/*
+// TODO: Which struct is passed in?
+void func_807375E0(void *arg0, s32 arg1) {
+ if (arg0 != 0) {
+ arg0->unk40 = arg1 & 0xFF;
+ }
+}
+*/
+
+void func_80737600(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737608.s")
+
+void func_80737630(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737638.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737924.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737990.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737A4C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737A74.s")
+
+/*
+// TODO: Wtf
+void func_80737A74(void) {
+ func_80737990(0x11);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737A9C.s")
+
+// Audio stuff, ALEvent struct on the stack?
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737AC4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737B2C.s")
+
+/*
+extern u16 D_807FF0E4[];
+
+u16 func_80737B2C(s32 arg0) {
+ return D_807FF0E4[arg0 & 0xFF];
+}
+*/
+
+void func_80737B48(void) {
+
+}
+
+void func_80737B50(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13A7A0/func_80737B58.s")
diff --git a/src/global_asm/code_13C920.c b/src/global_asm/code_13C920.c
new file mode 100644
index 00000000..23054947
--- /dev/null
+++ b/src/global_asm/code_13C920.c
@@ -0,0 +1,41 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13C920/func_80737C20.s")
+
+/*
+extern s8 D_807FF0F0;
+extern s8 D_807FF0F1;
+extern s8 D_807FF0F2;
+
+// TODO: Sus, maybe mips3?
+void func_80737C20(u8 arg0) {
+ s32 sp24;
+ s32 temp_t0;
+
+ D_807FF0F0 = 0;
+ D_807FF0F1 = 0;
+ D_807FF0F2 = 0;
+ switch (arg0) {
+ case 1:
+ D_807FF0F1 = 1;
+ break;
+ case 3:
+ D_807FF0F2 = 1;
+ break;
+ case 4:
+ D_807FF0F0 = 1;
+ break;
+ }
+ sp24 = 0;
+ do {
+ func_80737CF4(sp24, 0);
+ temp_t0 = sp24 + 1;
+ sp24 = temp_t0;
+ } while (temp_t0 < 2);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13C920/func_80737CF4.s")
diff --git a/src/global_asm/code_13CB30.c b/src/global_asm/code_13CB30.c
new file mode 100644
index 00000000..e30b17da
--- /dev/null
+++ b/src/global_asm/code_13CB30.c
@@ -0,0 +1,15 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+s32 func_80737E30(s32 *arg0) {
+ return arg0[0xB];
+}
+
+void func_80737E38(void) {
+
+}
+
+void func_80737E40(void) {
+
+}
diff --git a/src/global_asm/code_13CB50.c b/src/global_asm/code_13CB50.c
new file mode 100644
index 00000000..850ae590
--- /dev/null
+++ b/src/global_asm/code_13CB50.c
@@ -0,0 +1,43 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+// Audio stuff, weird stack things going on
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737E50.s")
+
+// struct s32 into 0x84
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737E90.s")
+
+void func_80737E9C(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737EA4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737F0C.s")
+
+void func_80737F38(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737F40.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80737FD8.s")
+
+/*
+void func_807382A0(s32, s32, u8, u8);
+
+// TODO: Wtf
+void func_80737FD8(s32 arg0, s32 arg1, s32 arg2) {
+ func_807382A0(arg0, 0, arg1 | 0xB0, 0xFF);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_8073801C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80738080.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_807380CC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CB50/func_80738118.s")
diff --git a/src/global_asm/code_13CE70.c b/src/global_asm/code_13CE70.c
new file mode 100644
index 00000000..71c8bfe5
--- /dev/null
+++ b/src/global_asm/code_13CE70.c
@@ -0,0 +1,10 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CE70/func_80738170.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CE70/func_807381D8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CE70/func_80738230.s")
diff --git a/src/global_asm/code_13CFA0.c b/src/global_asm/code_13CFA0.c
new file mode 100644
index 00000000..e49efeb5
--- /dev/null
+++ b/src/global_asm/code_13CFA0.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13CFA0/func_807382A0.s")
diff --git a/src/global_asm/code_13D020.c b/src/global_asm/code_13D020.c
new file mode 100644
index 00000000..c9ac5ca1
--- /dev/null
+++ b/src/global_asm/code_13D020.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D020/func_80738320.s")
diff --git a/src/global_asm/code_13D0B0.c b/src/global_asm/code_13D0B0.c
new file mode 100644
index 00000000..870de8a0
--- /dev/null
+++ b/src/global_asm/code_13D0B0.c
@@ -0,0 +1,24 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D0B0/func_807383B0.s")
+
+/*
+// TODO ???
+s32 func_807383B0(GlobalASMStruct20 *arg0) {
+ if (!arg0->unk18) {
+ return 0;
+ }
+ return arg0->unk24 / arg0->unk18->unk8;
+}
+*/
+
+void func_807383EC(void) {
+
+}
+
+void func_807383F4(void) {
+
+}
diff --git a/src/global_asm/code_13D100.c b/src/global_asm/code_13D100.c
new file mode 100644
index 00000000..48dc248d
--- /dev/null
+++ b/src/global_asm/code_13D100.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D100/func_80738400.s")
diff --git a/src/global_asm/code_13D170.c b/src/global_asm/code_13D170.c
new file mode 100644
index 00000000..d98af2f9
--- /dev/null
+++ b/src/global_asm/code_13D170.c
@@ -0,0 +1,35 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80738470.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_807385F0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_8073876C.s")
+
+s32 func_80738BA0(s32 *arg0) {
+ return arg0[3];
+}
+
+void func_80738BA8(void) {
+
+}
+
+void func_80738BB0(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80738BB8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80738C6C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80738D20.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80738E58.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_80739098.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13D170/func_8073928C.s")
+
diff --git a/src/global_asm/code_13ECE0.c b/src/global_asm/code_13ECE0.c
new file mode 100644
index 00000000..fbecd371
--- /dev/null
+++ b/src/global_asm/code_13ECE0.c
@@ -0,0 +1,40 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_80739FE0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A070.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A130.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A2A4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A3C4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A488.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A518.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A690.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A7B8.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A8BC.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A900.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073A98C.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073AA74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073AB00.s")
+
+void func_8073AD48(void) {
+
+}
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073AD50.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_13ECE0/func_8073B08C.s")
diff --git a/src/global_asm/code_140260.c b/src/global_asm/code_140260.c
new file mode 100644
index 00000000..2c599ec6
--- /dev/null
+++ b/src/global_asm/code_140260.c
@@ -0,0 +1,38 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140260/func_8073B560.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140260/func_8073B5D0.s")
+
+/*
+void func_8073B5D0(ALPlayer *arg0) {
+ OSIntMask sp1C;
+
+ sp1C = osSetIntMask(1);
+ arg0->samplesLeft = n_syn->curSamples;
+ arg0->next = n_syn->head;
+ n_syn->head = arg0;
+ osSetIntMask(sp1C);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140260/func_8073B640.s")
+
+/*
+void func_8073B640(ALPlayer *arg0) {
+ OSIntMask sp1C;
+
+ sp1C = osSetIntMask(1);
+ arg0->samplesLeft = n_syn->curSamples;
+ arg0->next = n_syn->head;
+ n_syn->head = arg0;
+ osSetIntMask(sp1C);
+}
+*/
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140260/func_8073B6B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140260/func_8073B750.s")
diff --git a/src/global_asm/code_140530.c b/src/global_asm/code_140530.c
new file mode 100644
index 00000000..b6da95c5
--- /dev/null
+++ b/src/global_asm/code_140530.c
@@ -0,0 +1,6 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140530/func_8073B830.s")
diff --git a/src/global_asm/code_140600.c b/src/global_asm/code_140600.c
new file mode 100644
index 00000000..197e4e1c
--- /dev/null
+++ b/src/global_asm/code_140600.c
@@ -0,0 +1,22 @@
+#include
+#include "functions.h"
+#include "variables.h"
+
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073B900.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073B9B0.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073BA60.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073BB10.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073BC74.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073BDC4.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073BE54.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073C040.s")
+
+#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_140600/func_8073C604.s")
diff --git a/src/global_asm/code_141520.c b/src/global_asm/code_141520.c
new file mode 100644
index 00000000..e80222bb
--- /dev/null
+++ b/src/global_asm/code_141520.c
@@ -0,0 +1,14 @@
+#include