Initial Commit

This commit is contained in:
Donkey Kong 2023-02-23 16:02:14 +10:30
parent 0a8502c843
commit 29119d6876
508 changed files with 98386 additions and 73 deletions

40
.gitattributes vendored Normal file
View File

@ -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

66
.gitignore vendored Normal file
View File

@ -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

6
.gitmodules vendored Normal file
View File

@ -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

3
Build Docker Image.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
docker build . -t donkeykong64
pause

24
Dockerfile Normal file
View File

@ -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

121
LICENSE.md Normal file
View File

@ -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.

471
Makefile Normal file
View File

@ -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) </dev/null) $(NEW_C_SRCS)
# Build folders
C_DIRS := $(sort $(dir $(ALL_C_SRCS) $(NEW_C_SRCS)))
ASM_DIRS := $(sort $(dir $(ALL_ASM_SRCS) $(NEW_ASM_SRCS)))
BIN_DIRS := $(sort $(dir $(ALL_BINS) $(NEW_BINS)))
IMG_DIRS := $(sort $(dir $(ALL_IMGS) $(NEW_IMGS)))
C_BUILD_DIRS := $(addprefix $(BUILD_DIR)/,$(C_DIRS))
ASM_BUILD_DIRS := $(addprefix $(BUILD_DIR)/,$(ASM_DIRS))
BIN_BUILD_DIRS := $(addprefix $(BUILD_DIR)/,$(BIN_DIRS))
IMG_BUILD_DIRS := $(addprefix $(BUILD_DIR)/,$(IMG_DIRS))
ALL_DIRS := $(C_BUILD_DIRS) $(ASM_BUILD_DIRS) $(BIN_BUILD_DIRS) $(BUILD_DIR) $(IMG_BUILD_DIRS)
# Build files
BASEROM := baserom.$(VERSION).z64
C_OBJS := $(addprefix $(BUILD_DIR)/,$(ALL_C_SRCS:.c=.c.o))
GLOBAL_ASM_C_OBJS := $(addprefix $(BUILD_DIR)/,$(GLOBAL_ASM_C_SRCS:.c=.c.o))
C_DEPS := $(C_OBJS:.o=.d)
ASM_OBJS := $(addprefix $(BUILD_DIR)/,$(ALL_ASM_SRCS:.s=.s.o) $(NEW_ASM_SRCS:.s=.s.o))
BIN_OBJS := $(addprefix $(BUILD_DIR)/,$(ALL_BINS:.bin=.bin.o) $(NEW_BINS:.bin=.bin.o))
IMG_BINS := $(addprefix $(BUILD_DIR)/,$(ALL_IMGS:.png=.png.bin) $(NEW_IMGS:.png=.png.bin))
IMG_OBJS := $(IMG_BINS:.bin=.o)
Z64 := $(addprefix $(BUILD_DIR)/,$(BASENAME).$(VERSION).z64)
ELF := $(Z64:.z64=.elf)
LD_SCRIPT := $(BASENAME).ld
OVERLAY_ELFS := $(addprefix $(BUILD_DIR)/,$(addsuffix .elf,$(OVERLAYS)))
OVERLAY_CODE_BINS := $(OVERLAY_ELFS:.elf=.code)
OVERLAY_DATA_BINS := $(OVERLAY_ELFS:.elf=.data)
OVERLAY_BINS := $(addprefix $(BUILD_DIR)/,$(addsuffix .$(VERSION).bin,$(OVERLAYS)))
OVERLAY_RZIPS := $(addprefix $(BIN_ROOT)/,$(addsuffix .$(VERSION).rzip.bin,$(OVERLAYS)))
OVERLAY_RZIP_OUTS := $(addprefix $(BUILD_DIR)/,$(addsuffix .rzip.bin,$(OVERLAYS)))
OVERLAY_RZIP_OBJS := $(addprefix $(BUILD_DIR)/$(BIN_ROOT)/,$(addsuffix .$(VERSION).rzip.bin.o,$(OVERLAYS)))
BIN_OBJS := $(filter-out $(OVERLAY_RZIP_OBJS),$(BIN_OBJS))
ALL_OBJS := $(C_OBJS) $(ASM_OBJS) $(BIN_OBJS) $(OVERLAY_RZIP_OBJS)
SYMBOL_ADDRS := symbol_addrs.$(VERSION).txt
SYMBOL_ADDR_FILES := $(filter-out $(SYMBOL_ADDRS), $(wildcard symbol_addrs.*.$(VERSION).txt))
MIPS3_OBJS := $(BUILD_DIR)/$(SRC_ROOT)/done/ll.c.o $(BUILD_DIR)/$(SRC_ROOT)/global_asm/done/ll.c.o
# Object files for the rom itself
MAIN_C_OBJS := $(addprefix $(BUILD_DIR)/,$(MAIN_C_SRCS:.c=.c.o))
MAIN_ASM_OBJS := $(addprefix $(BUILD_DIR)/,$(MAIN_ASM_SRCS:.s=.s.o))
MAIN_BIN_OBJS := $(addprefix $(BUILD_DIR)/,$(MAIN_BINS:.bin=.bin.o))
MAIN_IMG_OBJS := $(addprefix $(BUILD_DIR)/,$(MAIN_IMGS:.png=.png.o))
MAIN_OBJS := $(MAIN_C_OBJS) $(MAIN_ASM_OBJS) $(MAIN_BIN_OBJS) $(MAIN_IMG_OBJS)
# Includes the build artifacts of any files to be extracted
MAIN_ALL_OBJS := $(MAIN_OBJS) $(addprefix $(BUILD_DIR)/, $(addsuffix .o, $(MAIN_NEW_FILES)))
# Progress files
MAIN_PROG_CSV := progress/progress.dk64_boot.csv
MAIN_PROG_SVG := progress/progress_dk64_boot.svg
TOTAL_PROG_CSV := progress/progress.total.csv
TOTAL_PROG_SVG := progress/progress_total.svg
OVERLAY_PROG_CSVS := $(addprefix progress/progress., $(addsuffix .csv, $(OVERLAYS)))
OVERLAY_PROG_SVGS := $(addprefix progress/progress_, $(addsuffix .svg, $(OVERLAYS)))
# Creates a list of all the object files for the given overlay
define get_overlay_objects
$(1)_C_OBJS := $(addprefix $(BUILD_DIR)/,$($(1)_C_SRCS:.c=.c.o))
$(1)_ASM_OBJS := $(addprefix $(BUILD_DIR)/,$($(1)_ASM_SRCS:.s=.s.o))
$(1)_BIN_OBJS := $(addprefix $(BUILD_DIR)/,$($(1)_BINS:.bin=.bin.o))
$(1)_IMG_OBJS := $(addprefix $(BUILD_DIR)/,$($(1)_IMGS:.png=.png.o))
$(1)_OBJS := $$($(1)_C_OBJS) $$($(1)_ASM_OBJS) $$($(1)_BIN_OBJS) $$($(1)_IMG_OBJS)
$(1)_ALL_OBJS := $$($(1)_OBJS) $$(addprefix $(BUILD_DIR)/, $$(addsuffix .o, $$($(1)_NEW_FILES)))
OVERLAY_OBJS += $$($(1)_OBJS)
endef
$(foreach overlay,$(OVERLAYS),$(eval $(call get_overlay_objects,$(overlay))))
### Functions ###
# Colorful text printing
NO_COL := \033[0m
RED := \033[0;31m
GREEN := \033[0;32m
BLUE := \033[0;34m
YELLOW := \033[0;33m
BLINK := \033[33;5m
# Print message with zero arguments (i.e. message)
define print0
@$(PRINT) "$(GREEN)$(1)$(NO_COL)\n"
endef
# Print message with one argument (i.e. message arg)
define print1
@$(PRINT) "$(GREEN)$(1) $(BLUE)$(2)$(NO_COL)\n"
endef
# Print message with two arguments (i.e. message arg1 -> 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

135
README.md
View File

@ -1,92 +1,81 @@
# dk64
# donkey
<img src="./progress/progress_total.svg">
- <img src="./progress/progress_dk64_boot.svg">
- <img src="./progress/progress_global_asm.svg">
- <img src="./progress/progress_arcade.svg">
- <img src="./progress/progress_jetpac.svg">
- <img src="./progress/progress_bonus.svg">
- <img src="./progress/progress_boss.svg">
- <img src="./progress/progress_menu.svg">
- <img src="./progress/progress_minecart.svg">
- <img src="./progress/progress_multiplayer.svg">
- <img src="./progress/progress_race.svg">
- <img src="./progress/progress_water.svg">
## 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 <module_id>
```
- [ ] [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 `<module_id>`
- `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.<version>.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
```

3
Start Docker Image.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
docker run --rm -ti -v %cd%:/donkeykong64 donkeykong64
pause

3
diff.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
python3 ./tools/asm-differ/diff.py -wm3 $1

249
donkeykong64.us.yaml Normal file
View File

@ -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 <ultra64.h>
#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]

4
find_first_diff.sh Executable file
View File

@ -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)

BIN
ido/ido5.3_recomp/as1 Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/cc Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/cfe Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
ido/ido5.3_recomp/ugen Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/ujoin Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/uld Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/umerge Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/uopt Executable file

Binary file not shown.

BIN
ido/ido5.3_recomp/usplit Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/as1 Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/cc Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/cfe Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
ido/ido7.1_recomp/ugen Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/ujoin Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/uld Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/umerge Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/uopt Executable file

Binary file not shown.

BIN
ido/ido7.1_recomp/usplit Executable file

Binary file not shown.

125
include/2.0L/PR/PRimage.h Executable file
View File

@ -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__ */

453
include/2.0L/PR/R4300.h Executable file
View File

@ -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 <PR/ultratypes.h>
/*
* 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 */

410
include/2.0L/PR/abi.h Executable file
View File

@ -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_ */

4378
include/2.0L/PR/gbi.h Executable file

File diff suppressed because it is too large Load Diff

364
include/2.0L/PR/gs2dex.h Executable file
View File

@ -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 ========*/

363
include/2.0L/PR/gt.h Executable file
View File

@ -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 <PR/gtoff.h>
#endif /* _LANGUAGE_ASSEMBLY */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif /* _LANGUAGE_C_PLUS_PLUS */
#ifdef _LANGUAGE_MAKEROM
#endif /* _LANGUAGE_MAKEROM */
#endif /* _GT_H_ */

266
include/2.0L/PR/gu.h Executable file
View File

@ -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 <PR/mbi.h>
#include <PR/ultratypes.h>
#include <PR/sptask.h>
#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_ */

947
include/2.0L/PR/libaudio.h Executable file
View File

@ -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 <PR/ultratypes.h>
#include <PR/mbi.h>
/***********************************************************************
* 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__ */

98
include/2.0L/PR/mbi.h Executable file
View File

@ -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 <PR/gbi.h>
/**************************************************************************
*
* Audio Binary Interface
*
**************************************************************************/
#include <PR/abi.h>
/**************************************************************************
*
* 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_ */

122
include/2.0L/PR/n_abi.h Normal file
View File

@ -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__ */

View File

@ -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 <PR/libaudio.h>
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include <PR/mbi.h>
/*
* 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__ */

View File

@ -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

1000
include/2.0L/PR/os.h Executable file

File diff suppressed because it is too large Load Diff

118
include/2.0L/PR/os_internal.h Executable file
View File

@ -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 <PR/os.h>
#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 */

113
include/2.0L/PR/ramrom.h Executable file
View File

@ -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 */

882
include/2.0L/PR/rcp.h Executable file
View File

@ -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 <PR/R4300.h>
#include <PR/ultratypes.h>
/**********************************************************************
*
* 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_ */

93
include/2.0L/PR/rdb.h Executable file
View File

@ -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 */

123
include/2.0L/PR/region.h Executable file
View File

@ -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 <PR/ultratypes.h>
/***************************************
*
* 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_ */

39
include/2.0L/PR/rmon.h Executable file
View File

@ -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 <PR/ultratypes.h>
#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 */

115
include/2.0L/PR/sched.h Executable file
View File

@ -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 <ultra64.h>
#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

177
include/2.0L/PR/sp.h Executable file
View File

@ -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 <PR/mbi.h>
#include <PR/ultratypes.h>
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_ */

201
include/2.0L/PR/sptask.h Executable file
View File

@ -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 <PR/ultratypes.h>
#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 <PR/sptaskoff.h>
#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 */

186
include/2.0L/PR/ucode.h Executable file
View File

@ -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 <PR/ultratypes.h>
#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 */

165
include/2.0L/PR/ultraerror.h Executable file
View File

@ -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 <PR/ultratypes.h>
#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__ */

74
include/2.0L/PR/ultralog.h Executable file
View File

@ -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 <PR/ultratypes.h>
#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

90
include/2.0L/PR/ultratypes.h Executable file
View File

@ -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_ */

134
include/2.0L/PR/uportals.h Executable file
View File

@ -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 <ultra64.h>
#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

54
include/2.0L/assert.h Executable file
View File

@ -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__ */

36
include/2.0L/bstring.h Executable file
View File

@ -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__ */

85
include/2.0L/make/PRdefs Executable file
View File

@ -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)

45
include/2.0L/regdef.h Executable file
View File

@ -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 <sys/regdef.h>
/*#include <sys/fpregdef.h>*/
#endif /* mips */
#ifdef __cplusplus
}
#endif
#endif /* !__REGDEF_H__ */

189
include/2.0L/sgidefs.h Executable file
View File

@ -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__ */

42
include/2.0L/stdarg.h Executable file
View File

@ -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

21
include/2.0L/stdlib.h Executable file
View File

@ -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__ */

55
include/2.0L/string.h Executable file
View File

@ -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__ */

704
include/2.0L/sys/asm.h Executable file
View File

@ -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__ */

104
include/2.0L/sys/regdef.h Executable file
View File

@ -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__ */

131
include/2.0L/sys/u64driver.h Executable file
View File

@ -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 <PR/rdb.h>
#include <PR/ramrom.h>
#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__ */

110
include/2.0L/sys/u64gio.h Executable file
View File

@ -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__ */

68
include/2.0L/tinymon.h Executable file
View File

@ -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

41
include/2.0L/ultra64.h Executable file
View File

@ -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 <PR/ultratypes.h>
#include <PR/rcp.h>
#include <PR/os.h>
#include <PR/region.h>
#include <PR/rmon.h>
#include <PR/sptask.h>
#include <PR/mbi.h>
#include <PR/libaudio.h>
#include <PR/n_libaudio.h>
#include <PR/gu.h>
#include <PR/ramrom.h>
#include <PR/sp.h>
#include <PR/ucode.h>
#include <PR/ultraerror.h>
#include <PR/ultralog.h>
#endif

58
include/2.0L/ultrahost.h Executable file
View File

@ -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 */

362
include/arcade_int.h Normal file
View File

@ -0,0 +1,362 @@
#ifndef ARCADE_INTERNAL_H
#define ARCADE_INTERNAL_H
#include <ultra64.h>
#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 */

210
include/controller.h Executable file
View File

@ -0,0 +1,210 @@
#ifndef _CONTROLLER_H
#define _CONTROLLER_H
#include <os_internal.h>
#include <rcp.h>
//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;

620
include/enums.h Normal file
View File

@ -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

82
include/functions.h Normal file
View File

@ -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

42
include/guint.h Executable file
View File

@ -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 <mbi.h>
#include <gu.h>
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;

20
include/macro.inc Normal file
View File

@ -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

48
include/osint.h Normal file
View File

@ -0,0 +1,48 @@
#ifndef _OSINT_H
#define _OSINT_H
#include <os_internal.h>
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

145
include/piint.h Normal file
View File

@ -0,0 +1,145 @@
#ifndef _PIINT_H
#define _PIINT_H
#include <os_internal.h>
#include <rcp.h>
//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

10
include/siint.h Executable file
View File

@ -0,0 +1,10 @@
#ifndef _SIINT_H
#define _SIINT_H
#include <os_internal.h>
#include <rcp.h>
void __osSiGetAccess(void);
void __osSiRelAccess(void);
int __osSiDeviceBusy(void);
void __osSiCreateAccessQueue(void);
#endif

1400
include/structs.h Normal file

File diff suppressed because it is too large Load Diff

335
include/synthinternal.h Normal file
View File

@ -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 <libaudio.h>
/*
* 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

297
include/variables.h Normal file
View File

@ -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

70
include/viint.h Executable file
View File

@ -0,0 +1,70 @@
#ifndef _VIINT_H
#define _VIINT_H
#include <os_internal.h>
#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

View File

@ -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
1 version section function length matching
2 us .code func_80030C70 124 yes
3 us .code func_80024764 84 yes
4 us .code func_8002451C 296 yes
5 us .code arcade_nintendo_coin_update 316 yes
6 us .code func_8002B390 1292 no
7 us .code func_80029ACC 516 yes
8 us .code arcade_pie_update 360 yes
9 us .code func_8002AF2C 120 yes
10 us .code func_80030FEC 500 yes
11 us .code arcade_75m_setup 1792 yes
12 us .code func_8002E3D4 780 no
13 us .code func_800252D8 452 yes
14 us .code func_8002F82C 1532 no
15 us .code arcade_100m_setup 1460 yes
16 us .code arcade_25m_setup 1328 yes
17 us .code func_80030CEC 708 no
18 us .code arcade_help_text_update 356 yes
19 us .code func_8002628C 352 yes
20 us .code func_800244E4 36 yes
21 us .code func_80024320 236 yes
22 us .code func_80029CD0 556 no
23 us .code func_800319D4 2124 no
24 us .code func_800263EC 300 yes
25 us .code func_80027A38 1108 no
26 us .code func_800255A8 76 yes
27 us .code func_80029968 356 yes
28 us .code func_80024508 20 yes
29 us .code func_8002419C 388 yes
30 us .code func_800268AC 1608 no
31 us .code func_800246EC 120 yes
32 us .code arcade_pauline_bottom_update 268 yes
33 us .code arcade_bonus_item_update 260 yes
34 us .code func_800247B8 56 yes
35 us .code func_8002AFA4 796 yes
36 us .code func_80024E84 852 yes
37 us .code func_8002AC54 728 yes
38 us .code arcade_rivet_update 388 yes
39 us .code func_8002440C 216 yes
40 us .code func_800247F0 56 yes
41 us .code arcade_get_object_type_count 104 yes
42 us .code func_800259D0 568 yes
43 us .code __arcade_abs_w 24 yes
44 us .code arcade_dk_50m_update 460 yes
45 us .code func_8002A390 120 yes
46 us .code func_8002B89C 4924 no
47 us .code arcade_dk_title_update 692 yes
48 us .code func_80027E8C 128 yes
49 us .code func_8002D6FC 2652 no
50 us .code func_8002A264 300 no
51 us .code func_800251D8 104 yes
52 us .code func_800311E0 472 no
53 us .code func_80024CF8 152 yes
54 us .code func_80030734 332 yes
55 us .code func_80025C08 1096 yes
56 us .code func_8002B2C0 184 yes
57 us .code func_8002CBD8 396 yes
58 us .code func_80026EF4 1516 no
59 us .code func_80025240 100 yes
60 us .code func_80029EFC 872 no
61 us .code func_80024000 412 yes
62 us .code func_8002EEB8 2420 no
63 us .code func_800257D8 392 yes
64 us .code func_80024C34 196 yes
65 us .code func_80024644 48 yes
66 us .code func_800255F4 484 yes
67 us .code func_80025960 112 yes
68 us .code arcade_barrel_stack_update 60 yes
69 us .code func_80026518 360 yes
70 us .code func_80026050 572 yes
71 us .code func_80024A50 180 no
72 us .code func_800274E0 264 no
73 us .code func_8002E158 636 no
74 us .code arcade_pulley_update 196 yes
75 us .code func_8002549C 268 yes
76 us .code func_80026680 556 yes
77 us .code func_80030A04 260 no
78 us .code func_8002A734 752 yes
79 us .code func_800252A4 52 yes
80 us .code func_80024828 56 yes
81 us .code func_80024D90 244 yes
82 us .code func_800275E8 1104 no
83 us .code arcade_50m_setup 2168 yes
84 us .code func_8003159C 940 yes
85 us .code func_8002CD64 2456 no
86 us .code func_8002AA24 560 yes
87 us .code func_8002FE28 540 no
88 us .code arcade_add_points_to_score 84 yes
89 us .code arcade_hammer_update 892 yes
90 us .code func_8002A474 704 yes
91 us .code arcade_pauline_top_update 180 yes
92 us .code func_80024940 272 no
93 us .code func_80031948 140 yes
94 us .code func_8002A408 108 no
95 us .code func_800313B8 484 yes
96 us .code func_80024B04 304 no
97 us .code arcade_points_text_update 164 yes
98 us .code func_80024860 120 yes
99 us .code func_800246C8 36 yes

View File

@ -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
1 version section function length matching
2 us .code func_8002AED8 2632 no
3 us .code func_80027308 52 yes
4 us .code func_8002BF98 2388 no
5 us .code func_8002563C 136 yes
6 us .code func_8002881C 1568 no
7 us .code func_800264E0 224 yes
8 us .code func_80024E38 1128 no
9 us .code func_80024D8C 172 no
10 us .code func_8002BE44 340 no
11 us .code func_8002D7E8 112 yes
12 us .code func_800240F0 104 yes
13 us .code func_800256C4 72 no
14 us .code func_8002D2F0 1032 no
15 us .code func_800277F8 1820 no
16 us .code func_800284C0 392 no
17 us .code func_80026CF0 1220 no
18 us .code func_80028648 468 no
19 us .code func_80025480 48 no
20 us .code func_800271B4 340 no
21 us .code func_8002CC08 1032 no
22 us .code func_80024D3C 80 no
23 us .code func_8002B920 1316 no
24 us .code func_80024158 3044 no
25 us .code func_8002A398 1804 no
26 us .code func_8002AAA4 620 no
27 us .code func_80028E3C 1320 no
28 us .code func_800261B8 808 no
29 us .code func_80029B9C 696 no
30 us .code func_80029364 2104 no
31 us .code func_8002733C 356 no
32 us .code func_80024000 240 no
33 us .code func_8002AD10 456 no
34 us .code func_8002C8EC 796 no
35 us .code func_800265C0 200 yes
36 us .code func_8002D010 736 no
37 us .code func_8002570C 2732 no
38 us .code func_80026940 944 no
39 us .code func_800253E4 156 yes
40 us .code func_800274A0 168 yes
41 us .code func_80029E54 444 no
42 us .code func_80026690 688 no
43 us .code func_800254B0 396 no
44 us .code func_8002D6F8 240 no
45 us .code func_800252A0 324 no
46 us .code func_80027F14 1452 no
47 us .code func_8002A010 904 no
48 us .code func_80027548 688 no

View File

@ -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
1 version section function length matching
2 us .code func_8002920C 160 yes
3 us .code func_80033AF0 7276 no
4 us .code func_80033A80 112 yes
5 us .code func_80028478 520 no
6 us .code func_80029140 204 yes
7 us .code func_8002C748 132 yes
8 us .code func_800254D0 8864 no
9 us .code func_8003340C 152 yes
10 us .code func_8002531C 72 yes
11 us .code func_80024EAC 252 yes
12 us .code func_80024300 524 no
13 us .code func_8002C5F4 340 yes
14 us .code func_80027A30 376 no
15 us .code func_80030C30 288 yes
16 us .code func_8002E82C 396 yes
17 us .code func_80030D50 264 yes
18 us .code func_8002FEC0 180 yes
19 us .code func_8002DCE0 156 yes
20 us .code func_8002A5CC 748 yes
21 us .code func_80024568 2372 no
22 us .code func_80028878 2140 no
23 us .code func_8002E9B8 92 yes
24 us .code func_8002FC98 352 no
25 us .code func_8002DD7C 136 yes
26 us .code func_8003392C 172 no
27 us .code func_8002EA7C 1668 no
28 us .code func_8002DC60 128 yes
29 us .code func_80031AA0 4200 no
30 us .code func_8002C520 212 yes
31 us .code func_8002FDF8 200 yes
32 us .code func_80030888 152 no
33 us .code func_8002EA14 104 yes
34 us .code func_8002C964 2252 no
35 us .code func_80028458 32 yes
36 us .code func_8002FF74 2324 no
37 us .code func_8002450C 24 no
38 us .code func_800251A0 380 yes
39 us .code func_800292B0 272 yes
40 us .code func_80024FA8 504 yes
41 us .code func_8002A8B8 116 yes
42 us .code func_80030AE0 336 yes
43 us .code func_80025364 72 yes
44 us .code func_800336C0 196 yes
45 us .code func_8002FC48 80 yes
46 us .code func_80028818 8 yes
47 us .code func_80030EC4 3036 no
48 us .code func_800253AC 292 no
49 us .code func_80032B08 1480 no
50 us .code func_80029468 3544 no
51 us .code func_80027840 180 no
52 us .code func_800290D4 108 yes
53 us .code func_800334A4 540 no
54 us .code func_80024000 316 no
55 us .code func_8002D230 2608 no
56 us .code func_80027950 224 no
57 us .code func_80030920 448 no
58 us .code func_8002A92C 7156 no
59 us .code func_80028820 88 yes
60 us .code func_80030E58 108 yes
61 us .code func_8002FB7C 204 yes
62 us .code func_8002A41C 320 yes
63 us .code func_800278F4 92 yes
64 us .code func_80024524 68 no
65 us .code func_8002E7A0 140 yes
66 us .code func_8002A240 476 no
67 us .code func_800330D0 828 no
68 us .code func_8002A55C 112 yes
69 us .code func_800293C0 168 yes
70 us .code func_8002C8B4 176 yes
71 us .code func_80027BA8 2224 no
72 us .code func_8002C7CC 232 yes
73 us .code func_800339D8 168 yes
74 us .code func_8003575C 328 yes
75 us .code func_800286B8 352 no
76 us .code func_8002413C 452 no
77 us .code func_8002DE04 2460 no
78 us .code func_8002F100 2684 no
79 us .code func_80033784 424 no
80 us .code func_80028680 56 yes
81 us .code func_80027770 208 no

View File

@ -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
1 version section function length matching
2 us boot func_80005A70 16 no
3 us boot func_800058BC 92 no
4 us boot osDestroyThread 260 yes
5 us boot guSprite2DInit 80 no
6 us boot func_8000102C 144 yes
7 us boot osRecvMesg 312 yes
8 us boot osGetThreadId 24 yes
9 us boot osCreateViManager 384 no
10 us boot func_80002F18 60 no
11 us boot func_80002750 52 yes
12 us boot __osContDataCrc 160 no
13 us boot func_80002ECC 76 no
14 us boot __osSetCompare 16 yes
15 us boot guMtxL2F 184 no
16 us boot __osPiCreateAccessQueue 80 no
17 us boot func_800005A8 984 no
18 us boot func_80007360 112 no
19 us boot __osDispatchThread 396 yes
20 us boot guTranslate 84 yes
21 us boot func_80000D8C 188 yes
22 us boot __osAiDeviceBusy 48 yes
23 us boot osEepromLongRead 140 yes
24 us boot func_80001700 1012 no
25 us boot func_80002790 152 no
26 us boot func_800022D4 288 no
27 us boot func_80002724 44 no
28 us boot __osPackRamWriteDataSafe 128 no
29 us boot func_80005948 96 no
30 us boot func_80005818 60 no
31 us boot osDpGetStatus 12 yes
32 us boot func_8000BE20 480 no
33 us boot osEPiRawReadIo 352 no
34 us boot __osEepStatus 428 no
35 us boot guLookAtHiliteF 1848 no
36 us boot osMotorStartStop 360 no
37 us boot osViGetCurrentFramebuffer 64 yes
38 us boot __osDevMgrMain 1168 no
39 us boot guAlign 80 no
40 us boot __osExceptionPreamble 16 yes
41 us boot __osSpSetStatus 12 yes
42 us boot func_80002D60 132 no
43 us boot func_800075CC 28 no
44 us boot func_800010C0 1600 no
45 us boot func_800004F4 180 yes
46 us boot func_800075E8 160 no
47 us boot osSendMesg 332 yes
48 us boot func_8000DB90 288 no
49 us boot sqrtf 16 yes
50 us boot __osPfsGetStatus 208 no
51 us boot __osSetGlobalIntMask 76 yes
52 us boot osUnmapTLBAll 80 yes
53 us boot __osPiGetAccess 68 no
54 us boot osSetThreadPri 224 yes
55 us boot __osSpGetStatus 12 yes
56 us boot memcpy 288 no
57 us boot func_800024E0 196 yes
58 us boot osMotorInit 348 yes
59 us boot osVirtualToPhysical 124 yes
60 us boot guMtxIdent 48 yes
61 us boot osEepromRead 452 no
62 us boot _MakeMotorData 268 no
63 us boot func_80007754 52 no
64 us boot osYieldThread 76 yes
65 us boot osPiReadIo 64 yes
66 us boot func_80002A64 88 no
67 us boot func_80002ABC 80 no
68 us boot __ull_to_f 28 no
69 us boot osViSwapBuffer 80 yes
70 us boot func_80005918 48 no
71 us boot __osContRamWrite 592 no
72 us boot func_80000980 80 yes
73 us boot osEepromProbe 112 no
74 us boot __osSetTimerIntr 116 yes
75 us boot guOrthoF 340 yes
76 us boot __osSetSR 16 yes
77 us boot osStartThread 336 yes
78 us boot guLookAtHilite 184 yes
79 us boot func_800057B0 44 no
80 us boot osSetIntMask 160 no
81 us boot func_80007724 24 no
82 us boot osGetCount 16 yes
83 us boot osContInit 368 no
84 us boot osPiStartDma 268 yes
85 us boot __osSumcalc 116 no
86 us boot func_80002E98 52 no
87 us boot bzero 160 yes
88 us boot __osInsertTimer 392 yes
89 us boot __osEnqueueAndYield 256 yes
90 us boot __osSpDeviceBusy 44 yes
91 us boot cosf 368 no
92 us boot osSpTaskYield 32 yes
93 us boot guMtxCatF 360 yes
94 us boot __osPopThread 16 yes
95 us boot func_80000AA0 564 no
96 us boot osGetTime 132 yes
97 us boot osCreateMesgQueue 44 yes
98 us boot guLookAt 120 yes
99 us boot func_800025A4 384 no
100 us boot __osSpRawStartDma 140 yes
101 us boot guPerspective 88 yes
102 us boot __osSiRawReadIo 80 yes
103 us boot __osIdCheckSum 252 no
104 us boot osViGetCurrentMode 72 yes
105 us boot func_8000320C 4884 no
106 us boot func_800057DC 60 no
107 us boot guOrtho 104 yes
108 us boot func_80002BB8 188 no
109 us boot func_80005880 60 no
110 us boot guNormalize 132 yes
111 us boot __osRestoreInt 32 yes
112 us boot __osViGetCurrentContext 12 yes
113 us boot osSetTime 36 yes
114 us boot osViSetMode 104 yes
115 us boot __osPiRelAccess 44 no
116 us boot func_80002DE4 180 no
117 us boot osInitialize 704 no
118 us boot func_800031E0 44 no
119 us boot func_80002828 184 no
120 us boot __osPackEepWriteData 172 no
121 us boot osPfsIsPlug 416 no
122 us boot send_mesg 232 yes
123 us boot __osEnqueueThread 72 yes
124 us boot osEPiRawWriteIo 352 no
125 us boot guLookAtF 696 yes
126 us boot guAlignF 448 no
127 us boot __osTimerInterrupt 376 yes
128 us boot osPiGetCmdQueue 40 yes
129 us boot __osProbeTLB 192 yes
130 us boot bcopy 784 yes
131 us boot osPiRawReadIo 84 yes
132 us boot func_80003120 192 no
133 us boot osSpTaskYielded 128 yes
134 us boot osGetThreadPri 24 yes
135 us boot guTranslateF 72 yes
136 us boot osInvalICache 128 yes
137 us boot osSetEventMesg 104 yes
138 us boot func_800023F4 236 no
139 us boot guRotateF 404 no
140 us boot guMtxCatL 88 yes
141 us boot func_80002CE8 120 no
142 us boot __osSiCreateAccessQueue 80 no
143 us boot __osSiDeviceBusy 48 no
144 us boot func_80005070 336 no
145 us boot __osTimerServicesInit 140 no
146 us boot func_80001AF4 340 no
147 us boot __osPfsRequestOneChannel 196 no
148 us boot __osSiRawWriteIo 76 yes
149 us boot guRotate 92 no
150 us boot osAiGetLength 12 yes
151 us boot func_8000D7E0 212 no
152 us boot osInvalDCache 176 yes
153 us boot __osPfsGetOneChannelData 156 no
154 us boot osJamMesg 336 yes
155 us boot __osSpSetPc 52 yes
156 us boot func_80007788 56 no
157 us boot func_80001C48 360 no
158 us boot osViGetNextFramebuffer 64 yes
159 us boot guPosition 112 no
160 us boot func_80000EEC 320 no
161 us boot __osResetGlobalIntMask 96 no
162 us boot __osException 1316 yes
163 us boot __osContGetInitData 208 no
164 us boot __osGetFpcCsr 16 yes
165 us boot __osSiRawStartDma 176 no
166 us boot guScale 72 yes
167 us boot osAiSetNextBuffer 164 yes
168 us boot __osDisableInt 32 yes
169 us boot __osViInit 316 yes
170 us boot func_80001DB0 1316 no
171 us boot func_80000E48 164 no
172 us boot __osPackRequestData 256 no
173 us boot osPiRawStartDma 224 yes
174 us boot func_800004B4 64 yes
175 us boot osStopThread 192 yes
176 us boot guMtxXFMF 160 yes
177 us boot __osRepairPackId 848 no
178 us boot func_80007688 156 no
179 us boot func_800028E0 268 no
180 us boot func_800073D0 132 yes
181 us boot osPiGetStatus 12 yes
182 us boot osSpTaskStartGo 64 yes
183 us boot func_80000CD4 184 yes
184 us boot sinf 448 no
185 us boot __osPfsRequestData 208 no
186 us boot func_80005A44 44 no
187 us boot func_800029EC 68 no
188 us boot func_800074E0 208 no
189 us boot func_800009D0 88 yes
190 us boot guMtxXFML 96 yes
191 us boot func_80000450 100 yes
192 us boot osSetTimer 212 yes
193 us boot osMapTLBRdb 96 yes
194 us boot func_80005854 44 no
195 us boot __osGetId 428 no
196 us boot osCreatePiManager 368 no
197 us boot func_80000A30 112 no
198 us boot func_8000D8B4 732 no
199 us boot osCreateThread 336 no
200 us boot func_800059A8 156 no
201 us boot osViBlack 112 yes
202 us boot func_80002C74 116 no
203 us boot func_800055D0 156 yes
204 us boot func_8000773C 24 no
205 us boot __osPackEepReadData 140 no
206 us boot osEepromWrite 376 no
207 us boot func_80002F54 172 no
208 us boot osWritebackDCache 128 yes
209 us boot osDpSetStatus 12 yes
210 us boot __osSetFpcCsr 16 yes
211 us boot __osSiRelAccess 44 no
212 us boot osSpTaskLoad 400 yes
213 us boot osViSetSpecialFeatures 440 yes
214 us boot __osGetSR 16 yes
215 us boot guMtxIdentF 136 yes
216 us boot func_80007454 140 no
217 us boot __osPfsGetInitData 208 no
218 us boot __osViSwapContext 768 no
219 us boot viMgrMain 400 no
220 us boot __osContRamReadData 560 no
221 us boot guMtxF2L 256 yes
222 us boot func_800056F0 112 no
223 us boot guPerspectiveF 560 yes
224 us boot func_80002B0C 172 no
225 us boot __osSiGetAccess 68 no
226 us boot guScaleF 84 yes
227 us boot func_80002A30 52 no
228 us boot __osCheckPackId 356 no
229 us boot __osContAddressCrc 208 no
230 us boot func_80000400 80 yes
231 us boot osWriteBackDCacheAll 48 yes
232 us boot __osDequeueThread 64 yes
233 us boot guPositionF 432 no

File diff suppressed because it is too large Load Diff

View File

@ -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
1 version section function length matching
2 us .code func_800274C0 80 yes
3 us .code func_80025B70 72 yes
4 us .code func_80029F7C 728 no
5 us .code func_80025FC4 280 no
6 us .code func_8002A8F0 84 no
7 us .code func_8002ABDC 432 no
8 us .code func_8002976C 280 no
9 us .code func_8002466C 564 no
10 us .code func_80025904 348 no
11 us .code func_80025A60 272 no
12 us .code func_80028FC0 164 no
13 us .code func_8002AEC8 52 yes
14 us .code func_80026D48 128 no
15 us .code func_80029AF8 152 yes
16 us .code func_80024390 120 no
17 us .code func_800298C8 100 yes
18 us .code func_80024A4C 64 yes
19 us .code func_800292C4 396 no
20 us .code func_8002A374 444 no
21 us .code func_80027728 1216 no
22 us .code func_80029C1C 496 no
23 us .code func_80024408 564 no
24 us .code func_80028BD0 108 yes
25 us .code func_80029E0C 368 no
26 us .code func_80026A3C 116 yes
27 us .code func_80028CF8 268 no
28 us .code func_80025C40 96 no
29 us .code func_80028E88 312 no
30 us .code func_80029064 328 no
31 us .code func_8002A2DC 152 no
32 us .code func_80024A8C 516 no
33 us .code func_80028C3C 188 yes
34 us .code func_80027510 228 no
35 us .code func_80025368 248 no
36 us .code func_800260DC 572 no
37 us .code func_8002419C 500 no
38 us .code func_80027D64 348 no
39 us .code func_80027108 264 yes
40 us .code func_8002A530 332 no
41 us .code func_80026FE0 48 yes
42 us .code func_8002AD8C 116 no
43 us .code func_80024F64 56 yes
44 us .code func_8002992C 96 yes
45 us .code func_800250A0 200 yes
46 us .code func_80027410 108 yes
47 us .code func_80027060 168 yes
48 us .code func_800254B8 284 no
49 us .code func_8002463C 48 yes
50 us .code func_800291AC 88 yes
51 us .code func_80027480 64 yes
52 us .code func_80026318 1828 no
53 us .code func_80028E04 132 no
54 us .code func_8002998C 364 no
55 us .code func_80028544 152 no
56 us .code func_80025F48 124 no
57 us .code func_80028340 172 no
58 us .code func_80028B54 124 no
59 us .code func_8002A944 48 yes
60 us .code func_80025BB8 136 no
61 us .code func_8002A6C0 152 yes
62 us .code func_80025168 512 no
63 us .code func_800285DC 88 yes
64 us .code func_8002A67C 68 yes
65 us .code func_8002A758 408 no
66 us .code func_8002A2AC 48 no
67 us .code func_80029884 68 no
68 us .code func_80024E70 180 no
69 us .code func_800286D0 640 no
70 us .code func_800289EC 360 no
71 us .code func_80024000 412 no
72 us .code func_8002A974 352 no
73 us .code func_800275F4 308 no
74 us .code func_8002AE00 148 no
75 us .code func_80027010 72 yes
76 us .code func_80024F9C 260 no
77 us .code func_8002A254 88 yes
78 us .code func_80029450 156 no
79 us .code func_80029B90 140 yes
80 us .code func_80026CEC 92 no
81 us .code func_80026AB0 500 no
82 us .code func_800248A0 72 yes
83 us .code func_8002AAD4 264 no
84 us .code func_80027EC0 1152 no
85 us .code func_800283EC 344 no
86 us .code func_80026DC8 536 no
87 us .code func_80027BE8 380 no
88 us .code func_80027210 64 yes
89 us .code func_80029640 300 no
90 us .code func_80027250 224 no
91 us .code func_80024C90 184 yes
92 us .code func_8002AEFC 404 no
93 us .code func_80028950 156 no
94 us .code func_80024D48 296 no
95 us .code func_80025CB0 664 no
96 us .code func_80028634 156 no
97 us .code func_800294EC 340 no
98 us .code func_80027380 72 yes
99 us .code func_800273C8 72 yes
100 us .code func_80026CA4 72 yes
101 us .code func_800255D4 300 yes
102 us .code func_80027330 80 yes
103 us .code func_80025CA0 16 yes
104 us .code func_80025700 516 no
105 us .code func_80029204 192 yes
106 us .code func_800248E8 356 no
107 us .code func_80024F24 64 no
108 us .code func_8002AE94 52 yes
109 us .code func_80025460 88 yes

115
progress/progress.menu.csv Normal file
View File

@ -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
1 version section function length matching
2 us .code func_80028C18 8 yes
3 us .code func_8002A36C 252 yes
4 us .code func_8003264C 736 no
5 us .code func_8002AB80 340 no
6 us .code func_8003292C 1572 no
7 us .code func_80025B64 432 no
8 us .code func_80026250 64 yes
9 us .code func_800270E0 1292 no
10 us .code func_80031980 220 no
11 us .code func_80026B28 644 no
12 us .code func_8002AD50 120 no
13 us .code func_8002C584 176 yes
14 us .code func_8002ECE8 304 no
15 us .code func_80030258 232 no
16 us .code func_80027E60 212 yes
17 us .code func_8002EF68 796 no
18 us .code func_800297A8 16 yes
19 us .code func_8002E420 1176 no
20 us .code func_80025D44 72 yes
21 us .code func_800291CC 1500 no
22 us .code func_80030250 8 yes
23 us .code func_80026290 24 yes
24 us .code func_8002AB28 88 no
25 us .code func_80024BFC 180 yes
26 us .code func_8002D520 716 no
27 us .code func_80026874 692 no
28 us .code func_80024EF0 956 no
29 us .code func_80026DAC 636 no
30 us .code func_80028C20 284 yes
31 us .code func_8002F980 520 no
32 us .code func_80032550 252 yes
33 us .code func_8002D8AC 816 no
34 us .code func_80025FB4 524 no
35 us .code func_8002FC1C 284 yes
36 us .code func_80024154 148 yes
37 us .code func_800322D0 52 yes
38 us .code func_80029EF8 400 yes
39 us .code func_80025E04 432 yes
40 us .code func_8002AA98 144 no
41 us .code func_8002B708 2496 no
42 us .code func_800241E8 60 yes
43 us .code func_80027F34 12 yes
44 us .code func_8002F6C8 148 yes
45 us .code func_80026684 108 yes
46 us .code func_800317E8 408 no
47 us .code func_80027E10 80 yes
48 us .code func_8002DEE8 192 yes
49 us .code func_8002FE08 180 yes
50 us .code func_8002A638 1120 no
51 us .code func_8002F8EC 148 yes
52 us .code func_8002A468 464 yes
53 us .code func_8002CFA4 1404 no
54 us .code func_8002C634 744 no
55 us .code func_8002CB18 1164 no
56 us .code func_8002FB88 148 no
57 us .code func_800266F0 276 yes
58 us .code func_8003155C 652 no
59 us .code func_800275FC 316 no
60 us .code func_80024CB0 576 no
61 us .code func_8002907C 152 no
62 us .code func_800261C0 144 yes
63 us .code func_8002DBDC 780 no
64 us .code func_80026804 112 yes
65 us .code func_80030A90 388 no
66 us .code func_80025AE0 8 yes
67 us .code func_8002ADC8 2368 no
68 us .code func_8002F284 1092 no
69 us .code func_80028D3C 364 no
70 us .code func_800252AC 2100 no
71 us .code func_80030340 1364 no
72 us .code func_80027738 208 no
73 us .code func_80031B08 1308 no
74 us .code func_800275EC 16 yes
75 us .code func_80029AAC 264 yes
76 us .code func_80024000 188 no
77 us .code func_800244EC 668 no
78 us .code func_8002FEBC 916 no
79 us .code func_80025D8C 120 yes
80 us .code func_8002C91C 508 no
81 us .code func_80027028 184 yes
82 us .code func_80027FAC 1820 no
83 us .code func_80025AF0 116 no
84 us .code func_800240BC 152 yes
85 us .code func_80032304 456 no
86 us .code func_80029D30 456 no
87 us .code func_80027DEC 32 yes
88 us .code func_8002E8B8 1072 no
89 us .code func_800324CC 132 no
90 us .code func_80032024 684 no
91 us .code func_80029BB4 380 no
92 us .code func_8002ACD4 124 no
93 us .code func_8002C0C8 1212 no
94 us .code func_80027808 384 no
95 us .code func_8002D7EC 192 yes
96 us .code func_80024788 1140 no
97 us .code func_80028EA8 468 yes
98 us .code func_8002FD38 208 yes
99 us .code func_80025D14 48 yes
100 us .code func_80030894 508 no
101 us .code func_80027988 1124 no
102 us .code func_80031A5C 172 no
103 us .code func_80028834 996 no
104 us .code func_80024224 500 no
105 us .code func_8002EE18 336 yes
106 us .code func_8002F75C 400 no
107 us .code func_8002DFA8 1144 no
108 us .code func_8002A088 740 no
109 us .code func_800286C8 364 no
110 us .code func_80029114 184 yes
111 us .code func_80027F40 108 yes
112 us .code func_800262A8 988 no
113 us .code func_800297B8 756 no
114 us .code func_80024418 212 yes
115 us .code func_80030C14 2376 no

View File

@ -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
1 version section function length matching
2 us .code func_8002430C 1116 no
3 us .code func_80024B00 888 no
4 us .code func_80024768 296 yes
5 us .code func_80024E78 344 no
6 us .code func_80024914 492 no
7 us .code func_80027E04 228 no
8 us .code func_80024254 184 no
9 us .code func_80027778 1404 no
10 us .code func_80026DA8 2512 no
11 us .code func_8002835C 912 no
12 us .code func_800286EC 1188 no
13 us .code func_800241A0 180 yes
14 us .code func_800253C0 4656 no
15 us .code func_80027CF4 172 no
16 us .code func_80026C54 340 yes
17 us .code func_80027EE8 468 no
18 us .code func_800280BC 672 no
19 us .code func_80024000 220 yes
20 us .code func_800240DC 196 yes
21 us .code func_80027DA0 100 no
22 us .code func_800265F0 1404 no
23 us .code func_80026B6C 232 yes
24 us .code func_8002538C 52 yes
25 us .code func_80024FD0 956 no
26 us .code func_80024890 132 no

View File

@ -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
1 version section function length matching
2 us .code func_800245B0 316 no
3 us .code func_8002698C 60 yes
4 us .code func_80025654 320 no
5 us .code func_80025B48 416 no
6 us .code func_800253C8 60 yes
7 us .code func_80025CE8 668 no
8 us .code func_80026E20 336 no
9 us .code func_80024254 168 no
10 us .code func_80025FFC 152 no
11 us .code func_80026BD8 360 no
12 us .code func_800246EC 748 no
13 us .code func_80025608 76 no
14 us .code func_80024CA4 1472 no
15 us .code func_80026B0C 204 yes
16 us .code func_8002452C 132 yes
17 us .code func_80025794 948 no
18 us .code func_800242FC 204 yes
19 us .code func_80025264 276 no
20 us .code func_800243C8 212 no
21 us .code func_80024000 500 no
22 us .code func_80025404 516 no
23 us .code func_80026D40 224 yes
24 us .code func_800268C0 28 yes
25 us .code func_80026094 2092 no
26 us .code func_800269C8 324 no
27 us .code func_800249D8 716 no
28 us .code func_800241F4 96 no
29 us .code func_80025378 80 no
30 us .code func_80025F84 120 no
31 us .code func_800268DC 176 no
32 us .code func_8002449C 144 yes

114
progress/progress.race.csv Normal file
View File

@ -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
1 version section function length matching
2 us .code func_800274C0 496 no
3 us .code func_8002D2C0 120 no
4 us .code func_8002DD70 48 yes
5 us .code func_80027AF8 56 yes
6 us .code func_8002CAC8 292 no
7 us .code func_800282D8 252 no
8 us .code func_800294A8 740 no
9 us .code func_80024634 92 yes
10 us .code func_8002D40C 148 no
11 us .code func_8002578C 24 yes
12 us .code func_8002F420 112 no
13 us .code func_8002DF38 656 no
14 us .code func_8002E960 76 no
15 us .code func_8002B6C8 44 yes
16 us .code func_80026B20 392 no
17 us .code func_8002B6F4 120 yes
18 us .code func_8002DE78 192 no
19 us .code func_8002D338 40 yes
20 us .code func_80027710 368 no
21 us .code func_80024690 4320 no
22 us .code func_8002A7F8 1652 no
23 us .code castleCarRaceSetup 76 yes
24 us .code func_80027BD0 144 no
25 us .code func_8002DC24 204 no
26 us .code func_8002D72C 40 yes
27 us .code func_80026F04 1468 no
28 us .code func_80029F88 248 no
29 us .code func_80026EE4 32 yes
30 us .code func_8002AE6C 48 yes
31 us .code func_8002F490 756 no
32 us .code func_8002D360 172 no
33 us .code func_80026354 1996 no
34 us .code func_80027C60 136 yes
35 us .code func_8002F0AC 468 no
36 us .code func_8002DDA0 216 no
37 us .code func_8002D224 156 no
38 us .code func_8002DB90 148 yes
39 us .code func_80028E20 564 no
40 us .code func_80027CE8 1024 no
41 us .code func_8002E1C8 256 no
42 us .code sealRaceSetup 32 yes
43 us .code func_8002ECD4 48 yes
44 us .code func_8002F280 132 no
45 us .code func_8002E2C8 412 no
46 us .code func_8002E9AC 76 no
47 us .code func_8002BBD0 92 yes
48 us .code func_8002D0B0 76 yes
49 us .code func_80026D2C 440 no
50 us .code func_800283D4 108 no
51 us .code func_8002F304 104 yes
52 us .code func_80027B30 160 no
53 us .code func_8002BDDC 268 no
54 us .code func_8002F90C 68 yes
55 us .code func_800292B0 32 yes
56 us .code func_80026004 76 yes
57 us .code func_80029054 604 no
58 us .code func_8002978C 2044 no
59 us .code func_8002CFF0 116 yes
60 us .code func_800292D0 440 no
61 us .code func_80025FDC 40 yes
62 us .code setupRaceOnMapLoad 204 yes
63 us .code func_800280E8 496 no
64 us .code func_8002BCD4 264 no
65 us .code func_8002E464 32 yes
66 us .code func_8002A0AC 1444 no
67 us .code func_8002A080 44 yes
68 us .code func_800276B0 96 no
69 us .code func_80024000 1588 no
70 us .code func_8002597C 1312 no
71 us .code func_80026CA8 132 yes
72 us .code func_8002F36C 180 no
73 us .code func_8002D0FC 76 yes
74 us .code func_8002B180 920 no
75 us .code func_8002B610 184 no
76 us .code func_8002C63C 304 no
77 us .code func_80026050 72 yes
78 us .code func_800261E0 372 no
79 us .code func_8002DCF0 128 no
80 us .code func_80027880 160 no
81 us .code func_80025770 28 yes
82 us .code func_8002F950 448 no
83 us .code func_8002CBEC 1028 no
84 us .code func_8002B76C 504 no
85 us .code func_80028AD0 848 no
86 us .code func_8002AE9C 740 no
87 us .code func_8002F04C 96 no
88 us .code func_8002E8EC 116 no
89 us .code func_8002BEE8 612 no
90 us .code func_8002B518 248 no
91 us .code func_8002F784 392 no
92 us .code func_8002E9F8 528 no
93 us .code func_8002EDD4 632 no
94 us .code func_8002D148 220 no
95 us .code func_8002D754 36 yes
96 us .code func_8002B964 620 no
97 us .code func_80026098 328 no
98 us .code func_80028440 1680 no
99 us .code func_8002D524 520 no
100 us .code func_8002BC2C 132 no
101 us .code func_8002ED04 208 yes
102 us .code func_8002E484 448 no
103 us .code func_80025E9C 320 no
104 us .code func_80027920 472 no
105 us .code initializeCastleCarRace 424 no
106 us .code func_8002C14C 412 no
107 us .code func_8002C76C 860 no
108 us .code func_800257A4 472 no
109 us .code func_8002DA68 296 yes
110 us .code func_8002C2E8 852 no
111 us .code func_8002BCB0 36 no
112 us .code func_8002D778 752 no
113 us .code func_8002E644 680 no
114 us .code func_8002D4A0 132 yes

4216
progress/progress.total.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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
1 version section function length matching
2 us .code func_8002658C 744 no
3 us .code func_800255C4 528 no
4 us .code func_80027118 552 no
5 us .code func_800247F4 900 no
6 us .code func_80024C88 672 no
7 us .code func_800288A8 500 no
8 us .code func_8002904C 196 no
9 us .code func_80027340 264 no
10 us .code func_80029110 8 yes
11 us .code func_80026874 144 no
12 us .code func_80025DB8 388 no
13 us .code func_80024578 64 yes
14 us .code func_80025F8C 144 yes
15 us .code func_80025F3C 80 yes
16 us .code func_80025A3C 148 no
17 us .code func_80025500 196 no
18 us .code func_80026530 92 yes
19 us .code func_80024154 296 no
20 us .code func_80028840 104 yes
21 us .code func_80026410 92 yes
22 us .code func_80026B78 292 no
23 us .code func_800296DC 276 no
24 us .code func_80026E0C 452 no
25 us .code func_80026C9C 368 no
26 us .code func_80028EE8 356 no
27 us .code func_80026298 40 yes
28 us .code func_80024518 96 no
29 us .code func_80029118 1476 no
30 us .code func_80027DC0 864 no
31 us .code func_80028DE8 256 no
32 us .code func_80028120 1824 no
33 us .code func_80026904 344 no
34 us .code func_80025AD0 588 no
35 us .code func_8002427C 528 no
36 us .code func_800245B8 572 no
37 us .code func_80026338 216 yes
38 us .code func_8002601C 636 no
39 us .code func_80024000 156 no
40 us .code func_80024F28 580 no
41 us .code func_80028A9C 844 no
42 us .code func_8002516C 916 no
43 us .code func_80026A5C 284 yes
44 us .code func_80024B78 272 no
45 us .code func_80025D1C 156 no
46 us .code func_800262C0 120 no
47 us .code func_8002646C 196 yes
48 us .code func_80026FD0 100 yes
49 us .code func_800257D4 220 no
50 us .code func_80027448 2424 no
51 us .code func_8002448C 140 no
52 us .code func_800258B0 396 no
53 us .code func_80027034 88 yes
54 us .code func_8002708C 140 no
55 us .code func_800240EC 104 yes
56 us .code func_8002409C 80 yes

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="118" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="anybadge_1">
<rect width="118" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h51v20H0z"/>
<path fill="#e0e000" d="M51 0h67v20H51z"/>
<path fill="url(#b)" d="M0 0h118v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="26.5" y="15" fill="#010101" fill-opacity=".3">arcade</text>
<text x="25.5" y="14">arcade</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="85.5" y="15" fill="#010101" fill-opacity=".3">49.9240%</text>
<text x="84.5" y="14">49.9240%</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More