mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Overhaul the build system (#234)
* wip * fix * add disassembler * Disasm builds OK * Variable addends * More wip * Rodata migration implemented * Cleanup old tools * Try fix submodule -> subrepo merge * git subrepo pull --force --remote=https://github.com/zeldaret/ZAPD.git tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "602e609" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "602e609" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Builds again but assets are totally broken * git subrepo pull --force tools/asm-processor subrepo: subdir: "tools/asm-processor" merged: "1ffdb08a" upstream: origin: "https://github.com/simonlindholm/asm-processor.git" branch: "master" commit: "1ffdb08a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * More cleanup, move functions.txt and variables.txt to tools/disasm and rm tables * rm z64compress in preparation for subrepo * git subrepo clone (merge) https://github.com/z64me/z64compress.git tools/z64compress subrepo: subdir: "tools/z64compress" merged: "eb11085c" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "eb11085c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Fix asset extraction * Fix diff-init make rule * Split code bss * Split assumed linker bug padding from assembly files * add filelists for mm.us.rev1 * Maybe working, but I'm not sure * add overlays to spec * Add rodata to actos * Everything compiles * Make a lot of C files for code * Add almost every file in code to spec * whoops * 3 code files left * add scenes to spec * More progress on progress.py * Fix skelanime in spec * audio files! * Fix merge issues * Fix some C files in code * Fix remaining code files * Use existing O1 C files in spec * reorder boot order in spec * update spec * fault.c * Convert relocs on completed actors, fixbaserom uses current rom name * more boot files * Add VT macros and script * finish already existing boot files * most of libultra * fix 64bits libultra files * Use C files for libultra, wrap some functions in NON_MATCHING * Remove duplicate of OS_CLOCK_RATE from fault.c * C files for fbdemos * delete dumb files * bootstrap C files, still need to add them to the spec * update fixbaserom * boot OK? * I forgot to commit the spec * C for gamestates * C for kaleido * Change all includes to "" * copy actor sizes script from oot * I forgot to delete those files * Basic C files for effects * Add effects initvars names * Remove mislabelled boot functions from header/txt * Begin porting bootstrap_fx, some sizes * Fix <> * Fix enum * Fix diff.py * fix libultra stuff * update regconvert * update setup warnings * add some missing ; * Fix some makefile stuff and other fixes on some non_matching functions * add executable flag in extract_baserom and fixbaserom * fix relative path * copy assist from oot * fix map path * another assist path fix * Delete C files for handwritten files * add code_801A51F0 to spec * add gfxbuffers to spec * Move rodata to top of each file when possible * UNK_TYPEs for func_801A51F0 * Remove kaleido rodata from spec * Update spec and undefined_syms for recent merge * GCC warnings and fix errors in nonmatchings, * round percentage numbers * progress script: format changes * progress: error on non-existing files * fix warning in z_scene_table * Match 2 nonmatchings in z_actor * Warnings in lightswitch and invadepoh * Fix warning in z_actor_dlftbls * I though I fixed this one * whoops * Comment out CC_CHECK * Removed redundant ultra64.h includes * Update asm_processor, sorted boot_O1 into other folders, completed the fbdemo bootstrap, cleaned up undefined_syms * Completed gamestates bootstrap * Split kaleido_scope * Remove section.h and segment.h, move keep object externs to a common location in variables.h * Completed effects bootstrap * Segmented address externs for effects, fbdemos, gamestates and kaleido * Move actor data externs out of the if 0 * Segmented address externs for actors * Prepare actionfunc detection * fix script, how did it even work before * Fix actionfunc script again, re-introduce some more intermediate prints to the disassembler * Automated actionFunc detection in actors * Segmented addresses from player .text * rm old segment addrs script and fix build * Move sizes folder to tools * Make build.py executable * New Jenkinsfile Prayge * Remove numpy dependencies * Add warnings_disasm_current.txt * my bad * Update spec and undefined_syms * Add z_eff_ss_hahen to pametfrog * git subrepo pull (merge) --force tools/z64compress subrepo: subdir: "tools/z64compress" merged: "163ca2af" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "163ca2af" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Make z64compress print to stdout * sneeky commit to update warnings tooling * test * Another test * Mark fixing overlay reloc generating as a TODO * Update warnings stuff * Communicate the return code from running z64compress back to the Makefile through the wrapper * Run formatter, remove extra commented copy of function * Re-fix some includes * Convert atan to hex to conform to decided style * Some tidying up, remove c for fp and the other two handwritten code files * BSS in z_collision_check & z_scene_proc * add static back in * Fix timerintr bss, add file to spec, some cleanup * Remove externs * Newline * Readd enums * Typo * Colours * Comments for hitmark enum values Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Improvements and suggestions * Organize and remove unused imports and use env for python3 scripts, delete unused overlay.py Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com> Co-authored-by: engineer124 <engineer124engineer124@gmail.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
This commit is contained in:
co-authored by
angie
Elliptic Ellipsis
engineer124
EllipticEllipsis
parent
60ff207982
commit
7743e5a2c4
@@ -20,6 +20,7 @@ build/
|
||||
baserom/
|
||||
decomp/
|
||||
asm/
|
||||
data/
|
||||
expected/
|
||||
nonmatchings/
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v) {
|
||||
// ...
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_collision_check/CollisionCheck_SpawnWaterDroplets.asm")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/CollisionCheck_SpawnWaterDroplets.s")
|
||||
#endif
|
||||
```
|
||||
|
||||
|
||||
Vendored
+10
@@ -20,6 +20,16 @@ pipeline {
|
||||
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_setup_current.txt tools/warnings_count/warnings_setup_new.txt'
|
||||
}
|
||||
}
|
||||
stage('Disasm') {
|
||||
steps {
|
||||
sh 'bash -c "make -j disasm 2> >(tee tools/warnings_count/warnings_disasm_new.txt)"'
|
||||
}
|
||||
}
|
||||
stage('Check disasm warnings') {
|
||||
steps {
|
||||
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_disasm_current.txt tools/warnings_count/warnings_disasm_new.txt'
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'bash -c "make -j all 2> >(tee tools/warnings_count/warnings_build_new.txt)"'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
|
||||
|
||||
# If COMPARE is 1, check the output md5sum after building
|
||||
COMPARE ?= 1
|
||||
# If NON_MATCHING is 1, define the NON_MATCHING C flag when building
|
||||
@@ -13,31 +15,41 @@ ifeq ($(NON_MATCHING),1)
|
||||
COMPARE := 0
|
||||
endif
|
||||
|
||||
PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
MAKE = make
|
||||
CPPFLAGS += -P
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
DETECTED_OS=windows
|
||||
DETECTED_OS=windows
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
DETECTED_OS=linux
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
DETECTED_OS=macos
|
||||
MAKE=gmake
|
||||
CPPFLAGS += -xc++
|
||||
endif
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
DETECTED_OS=linux
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
DETECTED_OS=macos
|
||||
MAKE=gmake
|
||||
CPPFLAGS += -xc++
|
||||
endif
|
||||
endif
|
||||
|
||||
# Threads to compress and extract assets with, TODO improve later
|
||||
ifeq ($(DETECTED_OS),linux)
|
||||
N_THREADS ?= $(shell nproc)
|
||||
else
|
||||
N_THREADS ?= 1
|
||||
endif
|
||||
|
||||
#### Tools ####
|
||||
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
MIPS_BINUTILS_PREFIX := mips-linux-gnu-
|
||||
else
|
||||
MIPS_BINUTILS_PREFIX := mips64-elf-
|
||||
$(error Please install or build mips-linux-gnu)
|
||||
endif
|
||||
|
||||
CC := tools/ido_recomp/$(DETECTED_OS)/7.1/cc
|
||||
CC_OLD := tools/ido_recomp/$(DETECTED_OS)/5.3/cc
|
||||
GCC := gcc
|
||||
QEMU_IRIX ?= ./tools/qemu-mips
|
||||
|
||||
# if ORIG_COMPILER is 1, check that either QEMU_IRIX is set or qemu-irix package installed
|
||||
ifeq ($(ORIG_COMPILER),1)
|
||||
@@ -51,66 +63,75 @@ ifeq ($(ORIG_COMPILER),1)
|
||||
CC_OLD = $(QEMU_IRIX) -L tools/ido5.3_compiler tools/ido5.3_compiler/usr/bin/cc
|
||||
endif
|
||||
|
||||
AS := $(MIPS_BINUTILS_PREFIX)as
|
||||
LD := $(MIPS_BINUTILS_PREFIX)ld
|
||||
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
|
||||
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
|
||||
AS := $(MIPS_BINUTILS_PREFIX)as
|
||||
LD := $(MIPS_BINUTILS_PREFIX)ld
|
||||
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
|
||||
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
|
||||
|
||||
ZAPD := tools/ZAPD/ZAPD.out
|
||||
# Check code syntax with host compiler
|
||||
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-label
|
||||
CC_CHECK := gcc -fno-builtin -fsyntax-only -fsigned-char -std=gnu90 -D _LANGUAGE_C -D NON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -include stdarg.h $(CHECK_WARNINGS)
|
||||
|
||||
CPP := cpp
|
||||
ELF2ROM := tools/buildtools/elf2rom
|
||||
MKLDSCRIPT := tools/buildtools/mkldscript
|
||||
YAZ0 := tools/buildtools/yaz0
|
||||
ZAPD := tools/ZAPD/ZAPD.out
|
||||
|
||||
OPTFLAGS := -O2 -g3
|
||||
ASFLAGS := -march=vr4300 -32
|
||||
ASFLAGS := -march=vr4300 -32 -Iinclude
|
||||
MIPS_VERSION := -mips2
|
||||
|
||||
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
|
||||
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I./ -Isrc -Wab,-r4300_mul -woff 624,649,838,712
|
||||
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 624,649,838,712
|
||||
|
||||
ifeq ($(shell getconf LONG_BIT), 32)
|
||||
# Work around memory allocation bug in QEMU
|
||||
export QEMU_GUEST_BASE := 1
|
||||
else
|
||||
# Ensure that gcc treats the code as 32-bit
|
||||
CC_CHECK += -m32
|
||||
endif
|
||||
|
||||
#### Files ####
|
||||
|
||||
# ROM image
|
||||
MM_BASEROM ?= baserom.mm.us.rev1.z64
|
||||
MM_ROM_NAME ?= mm.us.rev1.rom
|
||||
ROM := $(MM_ROM_NAME).z64
|
||||
UNCOMPRESSED_ROM := $(MM_ROM_NAME)_uncompressed.z64
|
||||
ELF := $(MM_ROM_NAME).elf
|
||||
ROMC := mm.us.rev1.rom.z64
|
||||
ROM := $(ROMC:.rom.z64=.rom_uncompressed.z64)
|
||||
ELF := $(ROM:.z64=.elf)
|
||||
# description of ROM segments
|
||||
SPEC := spec
|
||||
|
||||
# create asm directories
|
||||
$(shell mkdir -p asm data)
|
||||
|
||||
SRC_DIRS := $(shell find src -type d)
|
||||
ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell find data -type d)
|
||||
ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")
|
||||
BASEROM_DIRS := $(shell find baserom -type d 2>/dev/null)
|
||||
COMP_DIRS := $(BASEROM_DIRS:baserom%=comp%)
|
||||
BINARY_DIRS := $(BASEROM_DIRS:baserom%=binary%)
|
||||
ASSET_C_FILES := $(shell find assets/ -type f -name "*.c")
|
||||
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
|
||||
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
|
||||
|
||||
# Because we may not have disassembled the code files yet, there might not be any assembly files.
|
||||
# Instead, generate a list of assembly files based on what's listed in the linker script.
|
||||
S_FILES := $(shell grep build/asm ./linker_scripts/code_script.txt | sed 's/\s*build\///g; s/\.o(\..*)/\.asm/g')
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
|
||||
C_O_FILES := $(C_FILES:%.c=build/%.o)
|
||||
S_O_FILES := $(S_FILES:asm/%.asm=build/asm/%.o)
|
||||
ASSET_O_FILES := $(ASSET_C_FILES:%.c=build/%.o)
|
||||
O_FILES := $(C_O_FILES) $(S_O_FILES) $(ASSET_O_FILES)
|
||||
|
||||
## Assets binaries (PNGs, JPGs, etc)
|
||||
TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png))
|
||||
TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
|
||||
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \
|
||||
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \
|
||||
|
||||
# create build directories
|
||||
$(shell mkdir -p build/linker_scripts build/asm build/asm/boot build/asm/code build/asm/overlays $(foreach dir, $(COMP_DIRS) $(BINARY_DIRS) $(SRC_DIRS) $(ASSET_BIN_DIRS),$(shell mkdir -p build/$(dir))))
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
|
||||
O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \
|
||||
$(foreach f,$(wildcard baserom/*),build/$f.o) \
|
||||
$(foreach f,$(C_FILES:.c=.o),build/$f) \
|
||||
$(foreach f,$(ASSET_C_FILES:.c=.o),build/$f)
|
||||
|
||||
# This file defines `ROM_FILES`, `UNCOMPRESSED_ROM_FILES`, and rules for generating `.yaz0` files
|
||||
ifneq ($(MAKECMDGOALS), clean)
|
||||
ifneq ($(MAKECMDGOALS), distclean)
|
||||
$(shell tools/dmadata_dependencies.py \
|
||||
--dmadata-table=tables/dmadata_table.txt \
|
||||
--output-deps=build/rom_dependencies.d)
|
||||
-include build/rom_dependencies.d
|
||||
endif
|
||||
endif
|
||||
# Automatic dependency files
|
||||
# (Only asm_processor dependencies are handled for now)
|
||||
DEP_FILES := $(O_FILES:.o=.asmproc.d)
|
||||
|
||||
# create build directories
|
||||
$(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(ASSET_BIN_DIRS),build/$(dir)))
|
||||
|
||||
build/src/libultra/os/%: OPTFLAGS := -O1
|
||||
build/src/libultra/voice/%: OPTFLAGS := -O2
|
||||
@@ -120,181 +141,134 @@ build/src/libultra/libc/ll%: OPTFLAGS := -O1
|
||||
build/src/libultra/libc/ll%: MIPS_VERSION := -mips3 -32
|
||||
build/src/libultra/gu/%: OPTFLAGS := -O2
|
||||
build/src/libultra/rmon/%: OPTFLAGS := -O2
|
||||
build/src/boot_O1/%: OPTFLAGS := -O1
|
||||
build/src/boot_O2/%: OPTFLAGS := -O2
|
||||
build/src/boot_O2_g3/%: OPTFLAGS := -O2 -g3
|
||||
build/src/boot_O2_g3_trapuv/%: OPTFLAGS := -O2 -g3
|
||||
build/src/boot_O2_g3_trapuv/%: CFLAGS := $(CFLAGS) -trapuv
|
||||
|
||||
build/src/boot_O2_g3/fault.o: CFLAGS += -trapuv
|
||||
build/src/boot_O2_g3/fault_drawer.o: CFLAGS += -trapuv
|
||||
|
||||
build/src/libultra/%: CC := $(CC_OLD)
|
||||
build/src/libultra/io/%: CC := ./tools/preprocess.py $(CC_OLD) -- $(AS) $(ASFLAGS) --
|
||||
build/src/libultra/voice/%: CC := ./tools/preprocess.py $(CC_OLD) -- $(AS) $(ASFLAGS) --
|
||||
build/src/libultra/io/%: CC := python3 tools/asm-processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) --
|
||||
build/src/libultra/os/%: CC := python3 tools/asm-processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) --
|
||||
build/src/libultra/voice/%: CC := python3 tools/asm-processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
CC := ./tools/preprocess.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
CC := python3 tools/asm-processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
.PHONY: all clean setup diff-init init assetclean distclean assembly
|
||||
# make will delete any generated assembly files that are not a prerequisite for anything, so keep it from doing so
|
||||
.PRECIOUS: asm/%.asm
|
||||
.DEFAULT_GOAL := $(UNCOMPRESSED_ROM)
|
||||
#### Main Targets ###
|
||||
|
||||
# just using build/baserom still probably has some race condiction/dependency bug, but since
|
||||
# it is first and should be completed relatively fast, it should not occur all that often.
|
||||
$(UNCOMPRESSED_ROM): build/baserom $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(UNCOMPRESSED_ROM_FILES)
|
||||
./tools/makerom.py ./tables/dmadata_table.txt $@
|
||||
uncompressed: $(ROM)
|
||||
ifeq ($(COMPARE),1)
|
||||
@md5sum $(UNCOMPRESSED_ROM)
|
||||
@md5sum $(ROM)
|
||||
@md5sum -c checksum_uncompressed.md5
|
||||
endif
|
||||
|
||||
$(ROM): build/baserom $(ROM_FILES)
|
||||
./tools/makerom.py ./tables/dmadata_table.txt $@ -c
|
||||
compressed: $(ROMC)
|
||||
ifeq ($(COMPARE),1)
|
||||
@md5sum $(ROM)
|
||||
@md5sum $(ROMC)
|
||||
@md5sum -c checksum.md5
|
||||
endif
|
||||
|
||||
all: $(UNCOMPRESSED_ROM) $(ROM) ;
|
||||
.PHONY: all uncompressed compressed clean assetclean distclean disasm init setup
|
||||
.DEFAULT_GOAL := uncompressed
|
||||
all: uncompressed compressed
|
||||
|
||||
build/code.elf: $(O_FILES) build/linker_scripts/code_script.ld undef.txt build/linker_scripts/object_script.ld build/dmadata_script.ld
|
||||
$(LD) -T build/linker_scripts/code_script.ld -T undef.txt -T build/linker_scripts/object_script.ld -T build/dmadata_script.ld --no-check-sections --accept-unknown-input-arch -Map build/mm.map -N -o $@
|
||||
$(ROM): $(ELF)
|
||||
$(ELF2ROM) -cic 6105 $< $@
|
||||
|
||||
build/code_pre_dmadata.elf: $(O_FILES) build/linker_scripts/code_script.ld undef.txt build/linker_scripts/object_script.ld
|
||||
$(LD) -r -T build/linker_scripts/code_script.ld -T undef.txt -T build/linker_scripts/object_script.ld --no-check-sections --accept-unknown-input-arch -N -o $@
|
||||
$(ROMC): $(ROM)
|
||||
python3 tools/z64compress_wrapper.py --mb 32 --matching --threads $(N_THREADS) $< $@ $(ELF) build/$(SPEC)
|
||||
|
||||
build/dmadata_script.txt: tables/dmadata_table.txt build/code_pre_dmadata.elf
|
||||
./tools/dmadata.py ./tables/dmadata_table.txt /dev/null -u -l $@ -e build/code_pre_dmadata.elf
|
||||
|
||||
build/dmadata: $(ROM_FILES:build/dmadata=)
|
||||
./tools/dmadata.py ./tables/dmadata_table.txt $@
|
||||
|
||||
build/uncompressed_dmadata: $(UNCOMPRESSED_ROM_FILES:build/uncompressed_dmadata=)
|
||||
./tools/dmadata.py ./tables/dmadata_table.txt $@ -u
|
||||
|
||||
build/binary/boot build/binary/code: build/code.elf
|
||||
$(OBJCOPY) --dump-section $(notdir $@)=$@ $< /dev/null
|
||||
|
||||
build/binary/assets/scenes/%: build/code.elf
|
||||
$(OBJCOPY) --dump-section $*=$@ $< /dev/null
|
||||
|
||||
build/binary/overlays/%: build/code.elf
|
||||
$(OBJCOPY) --dump-section $*=$@ $< /dev/null
|
||||
|
||||
|
||||
#### ASM rules ####
|
||||
|
||||
# Use an empty sentinel file (dep) to track the directory as a dependency, and
|
||||
# emulate GNU Make's order-only dependency.
|
||||
# The `touch $@; action || rm $@` pattern ensures that the `dep` file is older
|
||||
# than the output files from `action`, and only exists if `action` succeeds.
|
||||
asm/non_matchings/%/dep: asm/%.asm
|
||||
@mkdir -p $(dir $@)
|
||||
@touch $@
|
||||
./tools/split_asm.py $< asm/non_matchings/$* || rm $@
|
||||
|
||||
asm/%.asm: asm/disasm.dep ;
|
||||
|
||||
asm/disasm.dep: tables/files.txt tables/functions.txt tables/objects.txt tables/variables.txt tables/vrom_variables.txt
|
||||
@mkdir -p asm
|
||||
@touch $@
|
||||
./tools/disasm.py -d ./asm -l ./tables/files.txt -f ./tables/functions.txt -o ./tables/objects.txt -v ./tables/variables.txt -v ./tables/vrom_variables.txt || rm $@
|
||||
$(ELF): $(TEXTURE_FILES_OUT) $(OVERLAY_RELOC_FILES) $(O_FILES) build/ldscript.txt build/undefined_syms.txt
|
||||
$(LD) -T build/undefined_syms.txt -T build/ldscript.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map build/mm.map -o $@
|
||||
|
||||
|
||||
#### Main commands ####
|
||||
|
||||
## Cleaning ##
|
||||
clean:
|
||||
$(RM) -rf $(ROM) $(UNCOMPRESSED_ROM) build
|
||||
$(RM) -rf $(ROMC) $(ROM) $(ELF) build
|
||||
|
||||
assetclean:
|
||||
$(RM) -rf $(ASSET_BIN_DIRS)
|
||||
$(RM) -rf build/assets
|
||||
$(RM) -rf .extracted-assets.json
|
||||
|
||||
distclean: assetclean clean
|
||||
$(RM) -rf baserom/ asm/ expected/
|
||||
$(RM) -rf asm baserom data
|
||||
$(MAKE) -C tools clean
|
||||
|
||||
## Extraction step
|
||||
setup:
|
||||
$(MAKE) -C tools
|
||||
./tools/extract_rom.py $(MM_BASEROM)
|
||||
python3 extract_assets.py
|
||||
python3 tools/fixbaserom.py
|
||||
python3 tools/extract_baserom.py
|
||||
python3 extract_assets.py -t $(N_THREADS)
|
||||
|
||||
## Assembly generation
|
||||
assembly: $(S_FILES)
|
||||
@echo "Assembly generated."
|
||||
disasm:
|
||||
$(RM) -rf asm data
|
||||
python3 tools/disasm/disasm.py
|
||||
|
||||
diff-init: all
|
||||
$(RM) -rf expected/
|
||||
mkdir -p expected/
|
||||
cp -r build expected/build
|
||||
cp $(UNCOMPRESSED_ROM) expected/$(UNCOMPRESSED_ROM)
|
||||
cp $(ROM) expected/$(ROM)
|
||||
|
||||
init:
|
||||
$(MAKE) distclean
|
||||
$(MAKE) setup
|
||||
$(MAKE) assembly
|
||||
$(MAKE) disasm
|
||||
$(MAKE) all
|
||||
$(MAKE) diff-init
|
||||
|
||||
# Recipes
|
||||
|
||||
build/baserom:
|
||||
cp -r baserom/ build/baserom/
|
||||
|
||||
# FIXME: The process of splitting rodata changes the assembly files, so we must avoid making .o files for them until that is done.
|
||||
# The simplest way to do that is to give them an order dependency on .c files' .o files
|
||||
build/asm/%.o: asm/%.asm | $(C_O_FILES)
|
||||
iconv --from UTF-8 --to EUC-JP $^ | $(AS) $(ASFLAGS) -o $@
|
||||
|
||||
build/src/overlays/%.o: src/overlays/%.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
./tools/overlay.py $@ build/src/overlays/$*_overlay.s
|
||||
$(AS) $(ASFLAGS) build/src/overlays/$*_overlay.s -o build/src/overlays/$*_overlay.o
|
||||
|
||||
build/%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
|
||||
build/assets/%.o: assets/%.c
|
||||
$(CC) -I build/ -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
|
||||
#### Various Recipes ####
|
||||
|
||||
build/undefined_syms.txt: undefined_syms.txt
|
||||
$(CPP) $(CPPFLAGS) $< > build/undefined_syms.txt
|
||||
|
||||
build/ldscript.txt: $(SPEC)
|
||||
$(CPP) $(CPPFLAGS) $< > build/spec
|
||||
$(MKLDSCRIPT) build/spec $@
|
||||
|
||||
build/baserom/%.o: baserom/%
|
||||
$(OBJCOPY) -I binary -O elf32-big $< $@
|
||||
|
||||
build/asm/%.o: asm/%.s
|
||||
$(AS) $(ASFLAGS) $< -o $@
|
||||
|
||||
build/data/%.o: data/%.s
|
||||
iconv --from UTF-8 --to EUC-JP $< | $(AS) $(ASFLAGS) -o $@
|
||||
|
||||
build/src/overlays/%.o: src/overlays/%.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
# TODO: `() || true` is currently necessary to suppress `Error 1 (ignored)` make warnings caused by `test`, but this will go away if
|
||||
# the following is moved to a separate rule that is only run once when all the required objects have been compiled.
|
||||
$(ZAPD) bovl -eh -i $@ -cfg $< --outputpath $(@D)/$(notdir $(@D))_reloc.s
|
||||
(test -f $(@D)/$(notdir $(@D))_reloc.s && $(AS) $(ASFLAGS) $(@D)/$(notdir $(@D))_reloc.s -o $(@D)/$(notdir $(@D))_reloc.o) || true
|
||||
|
||||
build/src/%.o: src/%.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
build/src/libultra/libc/ll.o: src/libultra/libc/ll.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
@./tools/set_o32abi_bit.py $@
|
||||
# $(CC_CHECK) $<
|
||||
python3 tools/set_o32abi_bit.py $@
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
@./tools/set_o32abi_bit.py $@
|
||||
|
||||
build/comp/%.yaz0: build/binary/%
|
||||
./tools/yaz0 $< $@
|
||||
|
||||
build/comp/assets/audio/%.yaz0: build/baserom/assets/audio/%
|
||||
./tools/yaz0 $< $@
|
||||
|
||||
build/comp/assets/misc/%.yaz0: build/baserom/assets/misc/%
|
||||
./tools/yaz0 $< $@
|
||||
|
||||
build/comp/assets/objects/%.yaz0: build/baserom/assets/objects/%
|
||||
./tools/yaz0 $< $@
|
||||
|
||||
build/comp/assets/textures/%.yaz0: build/baserom/assets/textures/%
|
||||
./tools/yaz0 $< $@
|
||||
|
||||
build/%.d: %.c
|
||||
./tools/depend.py $< $@
|
||||
|
||||
build/dmadata_script.ld: build/dmadata_script.txt
|
||||
$(GCC) -E -CC -x c -Iinclude $< | grep -v '^#' > $@
|
||||
|
||||
build/linker_scripts/%.ld: linker_scripts/%.txt
|
||||
$(GCC) -E -CC -x c -Iinclude $< | grep -v '^#' > $@
|
||||
|
||||
build/assets/%.d: assets/%.c
|
||||
$(GCC) $< -Iinclude -I./ -MM -MT 'build/assets/$*.o' > $@
|
||||
|
||||
## Build C files from assets
|
||||
# $(CC_CHECK) $<
|
||||
python3 tools/set_o32abi_bit.py $@
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
# Build C files from assets
|
||||
build/%.inc.c: %.png
|
||||
$(ZAPD) btex -eh -tt $(lastword ,$(subst ., ,$(basename $<))) -i $< -o $@
|
||||
|
||||
@@ -304,9 +278,4 @@ build/assets/%.bin.inc.c: assets/%.bin
|
||||
build/assets/%.jpg.inc.c: assets/%.jpg
|
||||
$(ZAPD) bren -eh -i $< -o $@
|
||||
|
||||
# Checks headers dependencies of each C file
|
||||
ifneq ($(MAKECMDGOALS), clean)
|
||||
ifneq ($(MAKECMDGOALS), distclean)
|
||||
-include $(C_FILES:%.c=build/%.d)
|
||||
endif
|
||||
endif
|
||||
-include $(DEP_FILES)
|
||||
|
||||
@@ -1 +1 @@
|
||||
7c6bfd6daf33ebfc0145a97c611cb3d8 mm.us.rev1.rom_uncompressed.z64
|
||||
F46493EAA0628827DBD6AD3ECD8D65D6 mm.us.rev1.rom_uncompressed.z64
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
def apply(config, args):
|
||||
config['baseimg'] = 'baserom.mm.us.rev1.z64'
|
||||
config['myimg'] = 'mm.us.rev1.rom.z64'
|
||||
config['baseimg'] = 'baserom_uncompressed.z64'
|
||||
config['myimg'] = 'mm.us.rev1.rom_uncompressed.z64'
|
||||
config['mapfile'] = 'build/mm.map'
|
||||
config['source_directories'] = ['./src','./include']
|
||||
|
||||
+10
-16
@@ -1,11 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
from multiprocessing import Pool, cpu_count, Event, Manager
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import signal
|
||||
import argparse, json, os, signal, time
|
||||
from multiprocessing import Pool, Event, Manager
|
||||
|
||||
EXTRACTED_ASSETS_NAMEFILE = ".extracted-assets.json"
|
||||
|
||||
@@ -14,13 +10,13 @@ def SignalHandler(sig, frame):
|
||||
mainAbort.set()
|
||||
# Don't exit immediately to update the extracted assets file.
|
||||
|
||||
def ExtractFile(xmlPath, basromPath, outputPath, outputSourcePath):
|
||||
def ExtractFile(xmlPath, outputPath, outputSourcePath):
|
||||
if globalAbort.is_set():
|
||||
# Don't extract if another file wasn't extracted properly.
|
||||
return
|
||||
|
||||
execStr = "tools/ZAPD/ZAPD.out e -eh -i %s -b %s -o %s -osf %s -gsf 1 -rconf tools/ZAPDConfigs/MM/Config.xml" % (xmlPath, basromPath, outputPath, outputSourcePath)
|
||||
# execStr = "tools/ZAPD/ZAPD.out e -eh -i %s -b baserom/ -o %s -osf %s -gsf 1 -rconf tools/ZAPDConfigs/MM/Config.xml" % (xmlPath, outputPath, outputSourcePath)
|
||||
execStr = "tools/ZAPD/ZAPD.out e -eh -i %s -b baserom/ -o %s -osf %s -gsf 1 -rconf tools/ZAPDConfigs/MM/Config.xml" % (xmlPath, outputPath, outputSourcePath)
|
||||
|
||||
if globalUnaccounted:
|
||||
execStr += " -wu"
|
||||
|
||||
@@ -42,11 +38,6 @@ def ExtractFunc(fullPath):
|
||||
else:
|
||||
outPath = os.path.join("assets", *pathList[2:], objectName)
|
||||
outSourcePath = outPath
|
||||
# TODO: remove condition when NBS is merged
|
||||
if "overlays" in pathList:
|
||||
basromPath = os.path.join("baserom", *pathList[2:])
|
||||
else:
|
||||
basromPath = os.path.join("baserom", "assets", *pathList[2:-1])
|
||||
|
||||
if fullPath in globalExtractedAssetsTracker:
|
||||
timestamp = globalExtractedAssetsTracker[fullPath]["timestamp"]
|
||||
@@ -57,7 +48,7 @@ def ExtractFunc(fullPath):
|
||||
|
||||
currentTimeStamp = int(time.time())
|
||||
|
||||
ExtractFile(fullPath, basromPath, outPath, outSourcePath)
|
||||
ExtractFile(fullPath, outPath, outSourcePath)
|
||||
|
||||
if not globalAbort.is_set():
|
||||
# Only update timestamp on succesful extractions
|
||||
@@ -78,6 +69,7 @@ def initializeWorker(abort, unaccounted: bool, extractedAssetsTracker: dict, man
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="baserom asset extractor")
|
||||
parser.add_argument("-s", "--single", help="asset path relative to assets/, e.g. objects/gameplay_keep")
|
||||
parser.add_argument("-t", "--threads", help="Number of cpu cores to extract with.")
|
||||
parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones.", action="store_true")
|
||||
parser.add_argument("-u", "--unaccounted", help="Enables ZAPD unaccounted detector warning system.", action="store_true")
|
||||
args = parser.parse_args()
|
||||
@@ -112,7 +104,9 @@ def main():
|
||||
if file.endswith(".xml"):
|
||||
xmlFiles.append(fullPath)
|
||||
|
||||
numCores = cpu_count()
|
||||
numCores = int(args.threads or 0)
|
||||
if numCores <= 0:
|
||||
numCores = 1
|
||||
print("Extracting assets with " + str(numCores) + " CPU cores.")
|
||||
with Pool(numCores, initializer=initializeWorker, initargs=(mainAbort, args.unaccounted, extractedAssetsTracker, manager)) as p:
|
||||
p.map(ExtractFunc, xmlFiles)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -lt "2" ];
|
||||
then
|
||||
echo "usage: $0 file_name src_path [non_matching_path]"
|
||||
echo "e.g. $0 z_actor code"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
code_file=$1
|
||||
code_path=$2
|
||||
|
||||
# If there are only two arguments, then we will use the non_matchings path to be the same as src_path
|
||||
if [ "$#" -eq "2" ];
|
||||
then
|
||||
code_bucket=$code_path
|
||||
else
|
||||
code_bucket=$3
|
||||
fi
|
||||
|
||||
echo "split_asm : $code_file : $code_path : $code_bucket"
|
||||
|
||||
# Split asm file and create base c file
|
||||
tools/split_asm.py -c "./src/$code_path/$code_file.c" "./asm/$code_bucket/$code_file.asm" "./asm/non_matchings/$code_bucket/$code_file"
|
||||
|
||||
# Edit linker script to use new .c file
|
||||
sed -i "s/asm\/$code_file.o/src\/${2//\//\\\/}\/$code_file.o/g" linker_scripts/code_script.txt
|
||||
|
||||
# Build with new file
|
||||
make -j diff-init
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os.path
|
||||
import argparse
|
||||
import os.path
|
||||
from subprocess import check_call
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -34,7 +34,7 @@ diff_count = args.count
|
||||
if args.make:
|
||||
check_call(["make", "-j4", "COMPARE=0"])
|
||||
|
||||
baseimg = f"expected/mm.us.rev1.rom_uncompressed.z64"
|
||||
baseimg = f"baserom_uncompressed.z64"
|
||||
basemap = f"expected/build/mm.map"
|
||||
|
||||
myimg = f"mm.us.rev1.rom_uncompressed.z64"
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/gbi.h>
|
||||
#include "PR/gbi.h"
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
@@ -66,7 +66,7 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/abi.h>
|
||||
#include "PR/abi.h"
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#ifndef _SCHED_H_
|
||||
#define _SCHED_H_
|
||||
|
||||
#include <os.h>
|
||||
#include <sptask.h>
|
||||
#include "os.h"
|
||||
#include "sptask.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ short type;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _COLOR_H_
|
||||
#define _COLOR_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 r;
|
||||
|
||||
+95
-108
@@ -1,7 +1,7 @@
|
||||
#ifndef _FUNCTIONS_H_
|
||||
#define _FUNCTIONS_H_
|
||||
|
||||
#include <z64.h>
|
||||
#include "z64.h"
|
||||
|
||||
float fabsf(float f);
|
||||
#pragma intrinsic(fabsf)
|
||||
@@ -55,9 +55,9 @@ void CIC6105_PrintRomInfo(void);
|
||||
void CIC6105_AddRomInfoFaultPage(void);
|
||||
void CIC6105_RemoveRomInfoFaultPage(void);
|
||||
void func_800818F4(void);
|
||||
void Fault_Nop80081920(UNK_TYPE4 param_1, ...);
|
||||
void Fault_Log(char* str, ...);
|
||||
void Fault_Nop80081958(UNK_TYPE4 param_1, ...);
|
||||
void __osSyncVPrintf(UNK_TYPE4 param_1, ...);
|
||||
void osSyncPrintf(char* str, ...);
|
||||
void rmonPrintf(UNK_TYPE4 param_1, ...);
|
||||
void Fault_SleepImpl(u32 duration);
|
||||
void Fault_AddClient(FaultClient* client, fault_client_func callback, void* param0, void* param1);
|
||||
void Fault_RemoveClient(FaultClient* client);
|
||||
@@ -74,11 +74,11 @@ void Fault_FillScreenBlack(void);
|
||||
void Fault_FillScreenRed(void);
|
||||
void Fault_DrawCornerRec(u16 color);
|
||||
void Fault_PrintFReg(s32 idx, f32* value);
|
||||
void Fault_LogFReg(s32 idx, f32* value);
|
||||
void osSyncPrintfFReg(s32 idx, f32* value);
|
||||
void Fault_PrintFPCR(u32 value);
|
||||
void Fault_LogFPCR(u32 value);
|
||||
void osSyncPrintfFPCR(u32 value);
|
||||
void Fault_PrintThreadContext(OSThread* t);
|
||||
void Fault_LogThreadContext(OSThread* t);
|
||||
void osSyncPrintfThreadContext(OSThread* t);
|
||||
OSThread* Fault_FindFaultedThread(void);
|
||||
void Fault_Wait5Seconds(void);
|
||||
void Fault_WaitForButtonCombo(void);
|
||||
@@ -86,7 +86,7 @@ void Fault_DrawMemDumpPage(char* title, u32* addr, u32 param_3);
|
||||
void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1);
|
||||
void Fault_FindNextStackCall(u32** sp, u32** pc, u32** ra);
|
||||
void Fault_DrawStackTrace(OSThread* t, u32 flags);
|
||||
void Fault_LogStackTrace(OSThread* t, u32 flags);
|
||||
void osSyncPrintfStackTrace(OSThread* t, u32 flags);
|
||||
void Fault_ResumeThread(OSThread* t);
|
||||
void Fault_CommitFB(void);
|
||||
void Fault_ProcessClients(void);
|
||||
@@ -164,7 +164,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c);
|
||||
// void GfxPrint_Printf(void);
|
||||
// void MtxConv_F2L(void);
|
||||
// void MtxConv_L2F(void);
|
||||
void assert_fail(const char* file, u32 lineNum);
|
||||
void __assert(const char* file, u32 lineNum);
|
||||
// void func_800862B4(void);
|
||||
void* StartHeap_AllocMin1(u32 size);
|
||||
void StartHeap_FreeNull(void* pvParm1);
|
||||
@@ -229,7 +229,7 @@ f32 Rand_Centered_Variable(u32* param_1);
|
||||
void ArenaImpl_LockInit(Arena* heap);
|
||||
void ArenaImpl_Lock(Arena* heap);
|
||||
void ArenaImpl_Unlock(Arena* heap);
|
||||
ArenaNode* heap_get_tail(Arena* param_1);
|
||||
ArenaNode* ArenaImpl_GetLastBlock(Arena* param_1);
|
||||
void __osMallocInit(Arena* heap, void* heapBase, u32 heapSize);
|
||||
void __osMallocAddBlock(Arena* heap, void* start, s32 size);
|
||||
void __osMallocCleanup(Arena* heap);
|
||||
@@ -243,17 +243,17 @@ u32 __osCheckArena(Arena* heap);
|
||||
void* proutSprintf(void* s, char* buf, size_t n);
|
||||
s32 vsprintf(char* dst, char* fmt, va_list args);
|
||||
s32 sprintf(char* s, char* fmt, ...);
|
||||
void func_80087900(void* callback, const char* fmt, va_list args);
|
||||
// void func_80087934(void);
|
||||
void PrintUtils_VPrintf(void* callback, const char* fmt, va_list args);
|
||||
// void PrintUtils_Printf(void);
|
||||
void Sleep_Cycles(OSTime time);
|
||||
// void func_800879CC(void);
|
||||
void func_80087A1C(s32);
|
||||
void func_80087A6C(u32 param_1);
|
||||
// void func_80087AC0(void);
|
||||
// void Sleep_Nsec(void);
|
||||
void Sleep_Usec(s32);
|
||||
void Sleep_Msec(u32 param_1);
|
||||
// void Sleep_Sec(void);
|
||||
// void __osSetCause(void);
|
||||
s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flags);
|
||||
// void func_80087C60(void);
|
||||
void func_80087E00(u32 param_1);
|
||||
// void osPfsFreeBlocks(void);
|
||||
void osViExtendVStart(u32 param_1);
|
||||
void osStopThread(OSThread* t);
|
||||
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flags);
|
||||
OSIntMask osSetIntMask(OSIntMask im);
|
||||
@@ -277,30 +277,21 @@ long long __ll_mod(long long left, long long right);
|
||||
long long __ll_rshift(long long left, long long right);
|
||||
void __osExceptionPreamble(void);
|
||||
void __osException(void);
|
||||
// void func_80088D48(void);
|
||||
// void func_80088D54(void);
|
||||
// void func_80088D60(void);
|
||||
// void func_80088D80(void);
|
||||
// void func_80088DC4(void);
|
||||
// void func_80088F2C(void);
|
||||
// void func_80088F88(void);
|
||||
// void func_80088FA8(void);
|
||||
// void func_80088FE0(void);
|
||||
// void send_mesg(void);
|
||||
// void handle_CpU(void);
|
||||
void __osEnqueueAndYield(OSThread** param_1);
|
||||
void __osEnqueueThread(OSThread** param_1, OSThread* param_2);
|
||||
OSThread* __osPopThread(OSThread** param_1);
|
||||
// void func_8008929c(void);
|
||||
// void __osNop(void);
|
||||
void __osDispatchThread(void);
|
||||
void __osCleanupThread(void);
|
||||
void __osDequeueThread(OSThread** param_1, OSThread* param_2);
|
||||
void osDestroyThread(OSThread* puParm1);
|
||||
// void __osVoiceCheckResult(void);
|
||||
void bzero(void* begin, s32 length);
|
||||
// void func_800896D0(void);
|
||||
// void func_80089838(void);
|
||||
// void func_80089944(void);
|
||||
// void osSetRumble(void);
|
||||
// void osSetUpMempakWrite(void);
|
||||
// void osProbeRumblePak(void);
|
||||
void __osSiCreateAccessQueue(void);
|
||||
void __osSiGetAccess(void);
|
||||
void __osSiRelAccess(void);
|
||||
@@ -311,37 +302,37 @@ void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPr
|
||||
s32 osContStartReadData(OSMesgQueue* mq);
|
||||
void osContGetReadData(OSContPad* data);
|
||||
void __osPackReadData(void);
|
||||
// void func_8008A170(void);
|
||||
// void osVoiceGetReadData(void);
|
||||
uintptr_t osVirtualToPhysical(void* vaddr);
|
||||
u32 __osGetSR(void);
|
||||
void __osSetSR(u32 value);
|
||||
void osWritebackDCache(void* vaddr, s32 nbytes);
|
||||
void func_8008A660(void);
|
||||
void __createSpeedParam(void);
|
||||
void osInitialize(void);
|
||||
void func_8008A9A8(void);
|
||||
void __osInitialize_autodetect(void);
|
||||
void* osViGetNextFramebuffer(void);
|
||||
void guPerspectiveF(float mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
|
||||
void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
|
||||
s32 __osSpRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size);
|
||||
s32 __osSiRawStartDma(s32 direction, void* dramAddr);
|
||||
// void func_8008AE20(void);
|
||||
// void osEPiLinkHandle(void);
|
||||
void osViBlack(u8 active);
|
||||
s32 __osSiRawReadIo(u32 devAddr, u32* data);
|
||||
OSId osGetThreadId(OSThread* t);
|
||||
void osSpTaskYield(void);
|
||||
s32 __osPfsRWInode(OSPfs* param_1, __OSInode* param_2, u8 param_3, u8 param_4);
|
||||
s32 __osPfsGetNextPage(OSPfs* param_1, __OSInode* param_2, u8 param_3, u8 param_4);
|
||||
s32 osPfsReadWriteFile(OSPfs* pfs, s32 file_no, u8 flag, s32 offset, s32 size_in_bytes, u8* data_buffer);
|
||||
// void func_8008B3C0(void);
|
||||
// void func_8008B490(void);
|
||||
// void func_8008B554(void);
|
||||
// void __osPfsGetStatus(void);
|
||||
// void __osPfsRequestOneChannel(void);
|
||||
// void __osPfsGetOneChannelData(void);
|
||||
void guMtxIdentF(float mf[4][4]);
|
||||
void osViSetMode(OSViMode* modep);
|
||||
// void __osGetConfig(void);
|
||||
// void __osSetConfig(void);
|
||||
void guLookAtF(float mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp);
|
||||
void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp);
|
||||
// void func_8008B9F0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void func_8008BD24(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void osPfsAllocateFile(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void __osPfsDeclearPage(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
s32 osStopTimer(OSTimer* t);
|
||||
u32 __osProbeTLB(void* param_1);
|
||||
void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt);
|
||||
@@ -351,17 +342,17 @@ void __osPiRelAccess(void);
|
||||
void __osDevMgrMain(void* arg);
|
||||
// void func_8008C640(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE1 param_6, UNK_TYPE1 param_7, UNK_TYPE1 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12, UNK_TYPE4 param_13, UNK_TYPE4 param_14, UNK_TYPE4 param_15, UNK_TYPE4 param_16, UNK_TYPE4 param_17, UNK_TYPE4 param_18);
|
||||
s32 osPiRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size);
|
||||
// void func_8008C740(void);
|
||||
// void func_8008C7B4(void);
|
||||
// void func_8008C8B0(void);
|
||||
// void func_8008CC00(void);
|
||||
// void func_8008CD64(void);
|
||||
// void func_8008CF10(void);
|
||||
// void func_8008CFE4(void);
|
||||
// void __osSumcalc(void);
|
||||
// void __osIdCheckSum(void);
|
||||
// void __osRepairPackId(void);
|
||||
// void __osCheckPackId(void);
|
||||
// void __osGetId(void);
|
||||
// void __osCheckId(void);
|
||||
// void __osPfsRWInode(void);
|
||||
u32 osGetCount(void);
|
||||
void guMtxL2F(MtxF* m1, Mtx* m2);
|
||||
u32 osGetMemSize(void);
|
||||
// void func_8008D470(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||
// void osPfsFindFile(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||
void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg m);
|
||||
f32 sqrtf(f32 __x);
|
||||
s32 osAfterPreNMI(void);
|
||||
@@ -371,11 +362,11 @@ void guLookAtHiliteF(float mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f
|
||||
void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 twidth, s32 theight);
|
||||
s32 _Printf(printf_func pfn, void* arg, const char* fmt, va_list ap);
|
||||
void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac);
|
||||
// void func_8008ED30(void);
|
||||
// void osVoiceClearDictionary(void);
|
||||
void osUnmapTLBAll(void);
|
||||
s32 osEPiStartDma(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
|
||||
// void func_8008EED0(void);
|
||||
// void func_8008F100(void);
|
||||
// void __osVoiceContRead2(void);
|
||||
// void __osVoiceContDataCrc(void);
|
||||
u8* strchr(u8* __s, s32 __c);
|
||||
size_t strlen(u8* __s);
|
||||
void* memcpy(void* __dest, void* __src, size_t __n);
|
||||
@@ -386,30 +377,30 @@ void __osTimerServicesInit(void);
|
||||
void __osTimerInterrupt(void);
|
||||
void __osSetTimerIntr(OSTime tim);
|
||||
OSTime __osInsertTimer(OSTimer* t);
|
||||
// void func_8008F7D0(void);
|
||||
// void __osVoiceContRead36(void);
|
||||
s32 __osSpDeviceBusy(void);
|
||||
s32 __osSiDeviceBusy(void);
|
||||
// void func_8008FA60(void);
|
||||
// void guMtxIdent(void);
|
||||
s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag);
|
||||
void osSetThreadPri(OSThread* t, OSPri pri);
|
||||
OSPri osGetThreadPri(OSThread* t);
|
||||
s32 __osEPiRawReadIo (OSPiHandle* handle, u32 devAddr, u32* data);
|
||||
s32 osEPiRawReadIo (OSPiHandle* handle, u32 devAddr, u32* data);
|
||||
void osViSwapBuffer(void* frameBufPtr);
|
||||
void guPositionF(float mf[4][4], f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z);
|
||||
void guPosition(Mtx* m, f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z);
|
||||
void func_800900C0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
void osEPiRawStartDma(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
OSYieldResult osSpTaskYielded(OSTask* task);
|
||||
s32 memcmp(void* __s1, void* __s2, size_t __n);
|
||||
OSTime osGetTime(void);
|
||||
void guRotateF(float mf[4][4], f32 a, f32 x, f32 y, f32 z);
|
||||
void guRotate(Mtx* m, f32 a, f32 x, f32 y, f32 z);
|
||||
void __osSetGlobalIntMask(u32 mask);
|
||||
// void func_800906D0(void);
|
||||
// void func_80090810(void);
|
||||
// void func_80090900(void);
|
||||
// void osVoiceInit(void);
|
||||
// void __osContChannelReset(void);
|
||||
// void __osVoiceSetADConverter(void);
|
||||
s32 osAiSetFrequency(u32 frequency);
|
||||
s32 __osContRamRead(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer);
|
||||
// void func_80090E70(void);
|
||||
// void __osVoiceContWrite20(void);
|
||||
u8 __osContAddressCrc(u16 addr);
|
||||
u8 __osContDataCrc(u8* data);
|
||||
OSThread* __osGetActiveQueue(void);
|
||||
@@ -420,8 +411,8 @@ u32 osDpGetStatus(void);
|
||||
void osDpSetStatus(u32 data);
|
||||
void bcopy(void* __src, void* __dest, size_t __n);
|
||||
void __osResetGlobalIntMask(u32 mask);
|
||||
// void func_80091630(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_80091808(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void osPfsDeleteFile(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void __osPfsReleasePages(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
void guOrthoF(float mf[4][4], f32 l, f32 r, f32 b, f32 t, f32 n, f32 f, f32 scale);
|
||||
void guOrtho(Mtx* m, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f, f32 scale);
|
||||
OSIntMask __osDisableInt(void);
|
||||
@@ -430,33 +421,33 @@ void __osViInit(void);
|
||||
void __osViSwapContext(void);
|
||||
OSMesgQueue* osPiGetCmdQueue(void);
|
||||
f32 __cosf(f32 __x);
|
||||
// void func_800920B0(void);
|
||||
// void osEPiReadIo(void);
|
||||
void osViSetSpecialFeatures(u32 func);
|
||||
s16 coss(u16 x);
|
||||
void osSetTime(OSTime ticks);
|
||||
// void func_800922C0(void);
|
||||
// void osVoiceStopReadData(void);
|
||||
void osViSetEvent(OSMesgQueue* mq, OSMesg m, u32 retraceCount);
|
||||
s32 osPfsIsPlug(OSMesgQueue* queue, u8* pattern);
|
||||
// void func_800925CC(void);
|
||||
// void func_80092680(void);
|
||||
// void __osPfsRequestData(void);
|
||||
// void __osPfsGetInitData(void);
|
||||
s32 __osVoiceGetStatus(OSMesgQueue* mq, s32 port, u8* status);
|
||||
OSPiHandle* osCartRomInit(void);
|
||||
// void func_80092A80(void);
|
||||
// void guS2DInitBg(void);
|
||||
// s32 __osPfsSelectBank(OSPfs* pfs, UNK_TYPE4 param_2);
|
||||
s32 osContSetCh(u8 ch);
|
||||
u32 __osSetFpcCsr(u32 value);
|
||||
u32 __osGetFpcCsr(void);
|
||||
// void func_80092D00(void);
|
||||
// void func_80092EE0(void);
|
||||
// void func_800930E8(void);
|
||||
// void func_800931F0(void);
|
||||
// void func_80093728(void);
|
||||
// void func_80093A00(void);
|
||||
// void osPfsFileState(void);
|
||||
// void osPfsInitPak(void);
|
||||
// void __osPfsCheckRamArea(void);
|
||||
// void osPfsChecker(void);
|
||||
// void corrupted_init(void);
|
||||
// void corrupted(void);
|
||||
u32 osAiGetLength(void);
|
||||
// void func_80093BB0(void);
|
||||
// void osEPiWriteIo(void);
|
||||
void osMapTLBRdb(void);
|
||||
void osYieldThread(void);
|
||||
// void func_80093CC0(void);
|
||||
// void guTranslate(void);
|
||||
u32 __osGetCause(void);
|
||||
s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force);
|
||||
s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
|
||||
@@ -475,7 +466,7 @@ void viMgrMain(OSDevMgr* iParm1);
|
||||
__OSViContext* __osViGetCurrentContext(void);
|
||||
void osWritebackDCacheAll(void);
|
||||
OSThread* __osGetCurrFaultedThread(void);
|
||||
// void func_80095600(void);
|
||||
// void osVoiceMaskDictionary(void);
|
||||
void guMtxF2L(float mf[4][4], Mtx* m);
|
||||
void osStartThread(OSThread* param_1);
|
||||
void osViSetYScale(f32 value);
|
||||
@@ -488,21 +479,21 @@ double __ll_to_d(long long l);
|
||||
float __ll_to_f(long long l);
|
||||
double __ull_to_d(unsigned long long l);
|
||||
float __ull_to_f(unsigned long long l);
|
||||
// void func_80095C70(void);
|
||||
// void func_80096360(void);
|
||||
// void func_80096410(void);
|
||||
// void func_800964D0(void);
|
||||
// void osVoiceCheckWord(void);
|
||||
// void osVoiceControlGain(void);
|
||||
// void osVoiceStartReadData(void);
|
||||
// void osViGetCurrentFramebuffer(void);
|
||||
s32 __osSpSetPc(u32 data);
|
||||
// void func_80096540(void);
|
||||
// void __osVoiceContWrite4(void);
|
||||
void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg);
|
||||
// void func_800967A0(void);
|
||||
// void __osSetHWIntrRoutine(void);
|
||||
// u32 __osGetWatchLo(void);
|
||||
void __osSetWatchLo(u32 value);
|
||||
f32 func_80096830(f32 param_1, f32 param_2);
|
||||
void* func_80096880(void* param_1, u8 param_2, s32 param_3);
|
||||
s32 func_800968B0(const char* str1, const char* str2);
|
||||
char* func_800968f0(char* param_1, char* param_2);
|
||||
// void func_80096930(void);
|
||||
f32 fmodf(f32 param_1, f32 param_2);
|
||||
void* __osMemset(void* param_1, u8 param_2, s32 param_3);
|
||||
s32 __osMemcmp(const char* str1, const char* str2);
|
||||
char* __osStrcpy(char* param_1, char* param_2);
|
||||
// void __osMemcpy(void);
|
||||
void EnAObj_Init(ActorEnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* globalCtx);
|
||||
@@ -2985,23 +2976,23 @@ void func_80163A38(GlobalContext* globalCtx);
|
||||
// void func_80164678(void);
|
||||
// void func_801647AC(void);
|
||||
// UNK_TYPE4 func_801647B8(void);
|
||||
// void func_801647D0(void);
|
||||
void* func_8016482C(void* param_1);
|
||||
// void func_80164858(void);
|
||||
// void func_80164864(void);
|
||||
// void func_801649F4(void);
|
||||
// void func_80164A80(void);
|
||||
// void func_80164A8C(void);
|
||||
// void func_80164A98(void);
|
||||
// void func_80164AF0(void);
|
||||
// void func_80164B40(void);
|
||||
// void func_80164B94(void);
|
||||
// void func_80164BA0(void);
|
||||
// void func_80164BD4(void);
|
||||
// void func_80164BE0(void);
|
||||
// void TransitionFade_Start(void);
|
||||
void* TransitionFade_Init(void* param_1);
|
||||
// void TransitionFade_Destroy(void);
|
||||
// void TransitionFade_Update(void);
|
||||
// void TransitionFade_Draw(void);
|
||||
// void TransitionFade_IsDone(void);
|
||||
// void TransitionFade_SetColor(void);
|
||||
// void TransitionFade_SetType(void);
|
||||
// void TransitionCircle_Start(void);
|
||||
// void TransitionCircle_Init(void);
|
||||
// void TransitionCircle_Destroy(void);
|
||||
// void TransitionCircle_Update(void);
|
||||
// void TransitionCircle_SetColor(void);
|
||||
// void TransitionCircle_SetType(void);
|
||||
// void func_80164C14(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void func_80165044(void);
|
||||
// void func_80165198(void);
|
||||
// void TransitionCircle_Draw(void);
|
||||
// void TransitionCircle_IsDone(void);
|
||||
// void func_801651B0(void);
|
||||
// void func_80165224(void);
|
||||
// void func_80165288(void);
|
||||
@@ -3991,7 +3982,7 @@ void func_801A4D00(void);
|
||||
// void func_801A5080(void);
|
||||
// void func_801A5100(void);
|
||||
// void func_801A5118(void);
|
||||
// void func_801A51F0(void);
|
||||
UNK_TYPE func_801A51F0(UNK_TYPE arg0);
|
||||
// void func_801A5228(void);
|
||||
// void func_801A5390(void);
|
||||
// void func_801A53E8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
@@ -4056,8 +4047,4 @@ void func_801AA624(GlobalContext* globalCtx);
|
||||
// void func_801AA68C(UNK_TYPE4 ctxt);
|
||||
void nop_801AAAA0(GlobalContext* globalCtx);
|
||||
|
||||
// overlays
|
||||
|
||||
void Title_Init(TitleContext* titleCtx);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _CONTROLLER_H_
|
||||
#define _CONTROLLER_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/pfs.h"
|
||||
|
||||
#define SIAccessQueueSize 2
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
.macro glabel label
|
||||
.global \label
|
||||
\label:
|
||||
.endm
|
||||
|
||||
# COP0 register aliases
|
||||
|
||||
.set Index, $0
|
||||
.set Random, $1
|
||||
.set EntryLo0, $2
|
||||
.set EntryLo1, $3
|
||||
.set Context, $4
|
||||
.set PageMask, $5
|
||||
.set Wired, $6
|
||||
.set Reserved07, $7
|
||||
.set BadVaddr, $8
|
||||
.set Count, $9
|
||||
.set EntryHi, $10
|
||||
.set Compare, $11
|
||||
.set Status, $12
|
||||
.set Cause, $13
|
||||
.set EPC, $14
|
||||
.set PRevID, $15
|
||||
.set Config, $16
|
||||
.set LLAddr, $17
|
||||
.set WatchLo, $18
|
||||
.set WatchHi, $19
|
||||
.set XContext, $20
|
||||
.set Reserved21, $21
|
||||
.set Reserved22, $22
|
||||
.set Reserved23, $23
|
||||
.set Reserved24, $24
|
||||
.set Reserved25, $25
|
||||
.set PErr, $26
|
||||
.set CacheErr, $27
|
||||
.set TagLo, $28
|
||||
.set TagHi, $29
|
||||
.set ErrorEPC, $30
|
||||
.set Reserved31, $31
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _MATH_H_
|
||||
#define _MATH_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#define M_SQRT2 1.41421356237309504880f
|
||||
|
||||
+46
-46
@@ -1,7 +1,7 @@
|
||||
#ifndef _OS_H_
|
||||
#define _OS_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef s32 OSPri;
|
||||
|
||||
@@ -100,31 +100,31 @@ typedef u32 OSPageMask;
|
||||
typedef void* OSMesg;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ OSThread* mtqueue;
|
||||
/* 0x4 */ OSThread* fullqueue;
|
||||
/* 0x8 */ s32 validCount;
|
||||
/* 0xC */ s32 first;
|
||||
/* 0x00 */ OSThread* mtqueue;
|
||||
/* 0x04 */ OSThread* fullqueue;
|
||||
/* 0x08 */ s32 validCount;
|
||||
/* 0x0C */ s32 first;
|
||||
/* 0x10 */ s32 msgCount;
|
||||
/* 0x14 */ OSMesg* msg;
|
||||
} OSMesgQueue;
|
||||
} OSMesgQueue; // size = 0x20
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 errStatus;
|
||||
/* 0x4 */ void* dramAddr;
|
||||
/* 0x8 */ void* C2Addr;
|
||||
/* 0xC */ u32 sectorSize;
|
||||
/* 0x00 */ u32 errStatus;
|
||||
/* 0x04 */ void* dramAddr;
|
||||
/* 0x08 */ void* C2Addr;
|
||||
/* 0x0C */ u32 sectorSize;
|
||||
/* 0x10 */ u32 C1ErrNum;
|
||||
/* 0x14 */ u32 C1ErrSector[4];
|
||||
} __OSBlockInfo;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 cmdType;
|
||||
/* 0x4 */ u16 transferMode;
|
||||
/* 0x6 */ u16 blockNum;
|
||||
/* 0x8 */ s32 sectorNum;
|
||||
/* 0xC */ u32 devAddr;
|
||||
/* 0x00 */ u32 cmdType;
|
||||
/* 0x04 */ u16 transferMode;
|
||||
/* 0x06 */ u16 blockNum;
|
||||
/* 0x08 */ s32 sectorNum;
|
||||
/* 0x0C */ u32 devAddr;
|
||||
/* 0x10 */ u32 bmCtlShadow;
|
||||
/* 0x14 */ u32 seqCtlShadow;
|
||||
/* 0x18 */ __OSBlockInfo block[2];
|
||||
@@ -132,14 +132,14 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct OSPiHandle_s {
|
||||
/* 0x0 */ struct OSPiHandle_s* next;
|
||||
/* 0x4 */ u8 type;
|
||||
/* 0x5 */ u8 latency;
|
||||
/* 0x6 */ u8 pageSize;
|
||||
/* 0x7 */ u8 relDuration;
|
||||
/* 0x8 */ u8 pulse;
|
||||
/* 0x9 */ u8 domain;
|
||||
/* 0xC */ u32 baseAddress;
|
||||
/* 0x00 */ struct OSPiHandle_s* next;
|
||||
/* 0x04 */ u8 type;
|
||||
/* 0x05 */ u8 latency;
|
||||
/* 0x06 */ u8 pageSize;
|
||||
/* 0x07 */ u8 relDuration;
|
||||
/* 0x08 */ u8 pulse;
|
||||
/* 0x09 */ u8 domain;
|
||||
/* 0x0C */ u32 baseAddress;
|
||||
/* 0x10 */ u32 speed;
|
||||
/* 0x14 */ __OSTranxInfo transferInfo;
|
||||
} OSPiHandle;
|
||||
@@ -160,30 +160,30 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ OSIoMesgHdr hdr;
|
||||
/* 0x8 */ void* dramAddr;
|
||||
/* 0xC */ u32 devAddr;
|
||||
/* 0x00 */ OSIoMesgHdr hdr;
|
||||
/* 0x08 */ void* dramAddr;
|
||||
/* 0x0C */ u32 devAddr;
|
||||
/* 0x10 */ u32 size;
|
||||
/* 0x14 */ OSPiHandle* piHandle;
|
||||
} OSIoMesg;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s32 active;
|
||||
/* 0x4 */ OSThread* thread;
|
||||
/* 0x8 */ OSMesgQueue* cmdQueue;
|
||||
/* 0xC */ OSMesgQueue* evtQueue;
|
||||
/* 0x00 */ s32 active;
|
||||
/* 0x04 */ OSThread* thread;
|
||||
/* 0x08 */ OSMesgQueue* cmdQueue;
|
||||
/* 0x0C */ OSMesgQueue* evtQueue;
|
||||
/* 0x10 */ OSMesgQueue* acsQueue;
|
||||
/* 0x14 */ s32 (*dma)(void);
|
||||
/* 0x14 */ s32 (*unk18)(void);
|
||||
/* 0x18 */ s32 (*unk18)(void);
|
||||
} OSDevMgr;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 ctrl;
|
||||
/* 0x4 */ u32 width;
|
||||
/* 0x8 */ u32 burst;
|
||||
/* 0xC */ u32 vSync;
|
||||
/* 0x00 */ u32 ctrl;
|
||||
/* 0x04 */ u32 width;
|
||||
/* 0x08 */ u32 burst;
|
||||
/* 0x0C */ u32 vSync;
|
||||
/* 0x10 */ u32 hSync;
|
||||
/* 0x14 */ u32 leap;
|
||||
/* 0x18 */ u32 hStart;
|
||||
@@ -193,17 +193,17 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 origin;
|
||||
/* 0x4 */ u32 yScale;
|
||||
/* 0x8 */ u32 vStart;
|
||||
/* 0xC */ u32 vBurst;
|
||||
/* 0x00 */ u32 origin;
|
||||
/* 0x04 */ u32 yScale;
|
||||
/* 0x08 */ u32 vStart;
|
||||
/* 0x0C */ u32 vBurst;
|
||||
/* 0x10 */ u32 vIntr;
|
||||
} OSViFieldRegs;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x4 */ OSViCommonRegs comRegs;
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x04 */ OSViCommonRegs comRegs;
|
||||
/* 0x28 */ OSViFieldRegs fldRegs[2];
|
||||
} OSViMode;
|
||||
|
||||
@@ -211,9 +211,9 @@ typedef u64 OSTime;
|
||||
|
||||
|
||||
typedef struct OSTimer_s {
|
||||
/* 0x0 */ struct OSTimer_s* next;
|
||||
/* 0x4 */ struct OSTimer_s* prev;
|
||||
/* 0x8 */ OSTime interval;
|
||||
/* 0x00 */ struct OSTimer_s* next;
|
||||
/* 0x04 */ struct OSTimer_s* prev;
|
||||
/* 0x08 */ OSTime interval;
|
||||
/* 0x10 */ OSTime value;
|
||||
/* 0x18 */ OSMesgQueue* mq;
|
||||
/* 0x1C */ OSMesg msg;
|
||||
@@ -236,8 +236,8 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ void* address;
|
||||
/* 0x4 */ u8 databuffer[32];
|
||||
/* 0x00 */ void* address;
|
||||
/* 0x04 */ u8 databuffer[32];
|
||||
/* 0x24 */ u8 addressCrc;
|
||||
/* 0x25 */ u8 dataCrc;
|
||||
/* 0x26 */ u8 errno;
|
||||
|
||||
+6
-6
@@ -3,12 +3,12 @@
|
||||
|
||||
// TODO should be in libultra/os
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <os.h>
|
||||
#include <os_internal.h>
|
||||
#include <ultraerror.h>
|
||||
#include <ultralog.h>
|
||||
#include <sptask.h>
|
||||
#include "stdarg.h"
|
||||
#include "os.h"
|
||||
#include "os_internal.h"
|
||||
#include "ultraerror.h"
|
||||
#include "ultralog.h"
|
||||
#include "sptask.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ OSMesgQueue* messageQueue;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _RAMROM_H_
|
||||
#define _RAMROM_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ long type;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef _SECTION_H_
|
||||
#define _SECTION_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
extern u32 boot_text_start;
|
||||
extern u32 boot_text_end;
|
||||
|
||||
extern u32 boot_data_start;
|
||||
extern u32 boot_data_end;
|
||||
|
||||
extern u32 boot_rodata_start;
|
||||
extern u32 boot_rodata_end;
|
||||
|
||||
extern u32 boot_bss_start;
|
||||
extern u32 boot_bss_end;
|
||||
|
||||
extern u32 code_text_start;
|
||||
extern u32 code_text_end;
|
||||
|
||||
extern u32 code_data_start;
|
||||
extern u32 code_data_end;
|
||||
|
||||
extern u32 code_rodata_start;
|
||||
extern u32 code_rodata_end;
|
||||
|
||||
extern u32 code_bss_start;
|
||||
extern u32 code_bss_end;
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user