Port libultra and yay0 (shindou is broken currently)

This commit is contained in:
CrashOveride95 committed 2020-12-03 20:19:03 -05:00
1 parent 6a80548e8f
commit 15c0bfedbb
296 files changed
+9453 -11420

No files matched your search

+6
View File
@@ -70,3 +70,9 @@ build/*
!/sound/**/*custom*/**/*.aiff
!/assets/**/*custom*.bin
!/assets/**/*custom*/**/*.bin
# libultra
!/lib/*.a
!/lib/PR/hvqm/*.o
+28 -24
View File
@@ -38,22 +38,22 @@ $(eval $(call validate-option,VERSION,jp us eu sh))
ifeq ($(VERSION),jp)
DEFINES += VERSION_JP=1
OPT_FLAGS := -g
GRUCODE ?= f3d_old
GRUCODE ?= f3dzex
VERSION_JP_US ?= true
else ifeq ($(VERSION),us)
DEFINES += VERSION_US=1
OPT_FLAGS := -g
GRUCODE ?= f3d_old
GRUCODE ?= f3dzex
VERSION_JP_US ?= true
else ifeq ($(VERSION),eu)
DEFINES += VERSION_EU=1
OPT_FLAGS := -O2
GRUCODE ?= f3d_new
GRUCODE ?= f3dzex
VERSION_JP_US ?= false
else ifeq ($(VERSION),sh)
DEFINES += VERSION_SH=1
OPT_FLAGS := -O2
GRUCODE ?= f3d_new
GRUCODE ?= f3dzex
VERSION_JP_US ?= false
endif
@@ -66,6 +66,7 @@ TARGET := sm64.$(VERSION)
# f3dex -
# f3dex2 -
# f3dzex - newer, experimental microcode used in Animal Crossing
# super3d - extremely experimental version of Fast3D lacking many features for speed
$(eval $(call validate-option,GRUCODE,f3d_old f3dex f3dex2 f3d_new f3dzex))
ifeq ($(GRUCODE),f3d_old)
@@ -74,11 +75,13 @@ else ifeq ($(GRUCODE),f3d_new) # Fast3D 2.0H
DEFINES += F3D_NEW=1
else ifeq ($(GRUCODE),f3dex) # Fast3DEX
DEFINES += F3DEX_GBI=1 F3DEX_GBI_SHARED=1
else ifeq ($(GRUCODE), f3dex2) # Fast3DEX2
else ifeq ($(GRUCODE),f3dex2) # Fast3DEX2
DEFINES += F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1
else ifeq ($(GRUCODE),f3dzex) # Fast3DZEX (2.0J / Animal Forest - Dōbutsu no Mori)
$(warning Fast3DZEX is experimental. Try at your own risk.)
else ifeq ($(GRUCODE),f3dzex) # Fast3DZEX (2.08J / Animal Forest - Dōbutsu no Mori)
DEFINES += F3DZEX_GBI_2=1 F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1
else ifeq ($(GRUCODE),super3d) # Super3D
$(warning Super3D is experimental. Try at your own risk.)
DEFINES += SUPER3D_GBI=1 F3D_NEW=1
endif
@@ -108,7 +111,7 @@ endif
# NON_MATCHING - whether to build a matching, identical copy of the ROM
# 1 - enable some alternate, more portable code that does not produce a matching ROM
# 0 - build a matching ROM
NON_MATCHING ?= 0
NON_MATCHING ?= 1
$(eval $(call validate-option,NON_MATCHING,0 1))
ifeq ($(TARGET_N64),0)
@@ -168,6 +171,9 @@ endif
TOOLS_DIR := tools
# Location of official N64 libraries
N64_LIBS_DIR ?= lib
# (This is a bit hacky, but a lot of rules implicitly depend
# on tools and assets, and we use directory globs further down
# in the makefile that we want should cover assets.)
@@ -205,9 +211,8 @@ BUILD_DIR_BASE := build
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)
ROM := $(BUILD_DIR)/$(TARGET).z64
ELF := $(BUILD_DIR)/$(TARGET).elf
LIBULTRA := $(BUILD_DIR)/libultra.a
LD_SCRIPT := sm64.ld
MIO0_DIR := $(BUILD_DIR)/bin
YAY0_DIR := $(BUILD_DIR)/bin
SOUND_BIN_DIR := $(BUILD_DIR)/sound
TEXTURE_DIR := textures
ACTOR_DIR := actors
@@ -217,9 +222,6 @@ LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets asm lib sound
BIN_DIRS := bin bin/$(VERSION)
ULTRA_SRC_DIRS := lib/src lib/src/math lib/asm lib/data
ULTRA_BIN_DIRS := lib/bin
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
# File dependencies and variables for specific files
@@ -288,6 +290,8 @@ else
$(error Unable to detect a suitable MIPS toolchain installed)
endif
export LD_LIBRARY_PATH=./tools
AS := $(CROSS)as
ifeq ($(COMPILER),gcc)
CC := $(CROSS)gcc
@@ -310,7 +314,7 @@ ifneq (,$(call find-command,cpp-10))
else
CPP := cpp
endif
LD := $(CROSS)ld
LD := tools/mips64-elf-ld
AR := $(CROSS)ar
OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
@@ -362,7 +366,7 @@ export LANG := C
#==============================================================================#
# N64 tools
MIO0TOOL := $(TOOLS_DIR)/mio0
YAY0TOOL := $(TOOLS_DIR)/slienc
N64CKSUM := $(TOOLS_DIR)/n64cksum
N64GRAPHICS := $(TOOLS_DIR)/n64graphics
N64GRAPHICS_CI := $(TOOLS_DIR)/n64graphics_ci
@@ -469,7 +473,7 @@ else
endif
endif
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(MIO0_DIR) $(addprefix $(MIO0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
# Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)
@@ -529,13 +533,13 @@ $(BUILD_DIR)/levels/%/leveldata.bin: $(BUILD_DIR)/levels/%/leveldata.elf
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
# Compress binary file
$(BUILD_DIR)/%.mio0: $(BUILD_DIR)/%.bin
$(BUILD_DIR)/%.szp: $(BUILD_DIR)/%.bin
$(call print,Compressing:,$<,$@)
$(V)$(MIO0TOOL) $< $@
$(V)$(YAY0TOOL) $< $@
# convert binary mio0 to object file
$(BUILD_DIR)/%.mio0.o: $(BUILD_DIR)/%.mio0
$(call print,Converting MIO0 to ELF:,$<,$@)
# convert binary szp to object file
$(BUILD_DIR)/%.szp.o: $(BUILD_DIR)/%.szp
$(call print,Converting YAY0 to ELF:,$<,$@)
$(V)printf ".section .data\n\n.incbin \"$<\"\n" | $(AS) $(ASFLAGS) -o $@
@@ -744,9 +748,9 @@ $(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
$(V)$(AR) rcs -o $@ $(GODDARD_O_FILES)
# Link SM64 ELF file
$(ELF): $(O_FILES) $(MIO0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.a $(BUILD_DIR)/libgoddard.a
$(ELF): $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.a $(BUILD_DIR)/libgoddard.a
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
$(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -lultra -lgoddard
$(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L $(N64_LIBS_DIR) -lultra_rom -lgoddard
# Build ROM
$(ROM): $(ELF)
@@ -759,7 +763,7 @@ $(BUILD_DIR)/$(TARGET).objdump: $(ELF)
.PHONY: all clean distclean default diff test load libultra
.PHONY: all clean distclean default diff test load
# with no prerequisites, .SECONDARY causes no intermediate target to be removed
.SECONDARY:
+5 -5
View File
@@ -44,12 +44,12 @@ SEG_FILES := \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.elf) \
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.elf)
MIO0_FILES := \
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.mio0) \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.mio0) \
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.mio0)
YAY0_FILES := \
$(SEGMENTS:%=$(BUILD_DIR)/bin/%.szp) \
$(ACTOR_GROUPS:%=$(BUILD_DIR)/actors/%.szp) \
$(LEVEL_FILES:%=$(BUILD_DIR)/levels/%.szp)
MIO0_OBJ_FILES := $(MIO0_FILES:.mio0=.mio0.o)
YAY0_OBJ_FILES := $(YAY0_FILES:.szp=.szp.o)
# --------------------------------------
-149
View File
@@ -1,149 +0,0 @@
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
# This file is handwritten.
glabel decompress
.if VERSION_SH == 1
lw $a3, 8($a0)
lw $t9, 0xc($a0)
lw $t8, 4($a0)
add $a3, $a3, $a0
add $t9, $t9, $a0
move $a2, $zero
addi $a0, $a0, 0x10
add $t8, $t8, $a1
.L802772C0:
bnel $a2, $zero, .L802772D8
slt $t1, $t0, $zero
lw $t0, ($a0)
li $a2, 32
addi $a0, $a0, 4
slt $t1, $t0, $zero
.L802772D8:
beql $t1, $zero, .L802772F8
lhu $t2, ($a3)
lb $t2, ($t9)
addi $t9, $t9, 1
addi $a1, $a1, 1
b .L80277324
sb $t2, -1($a1)
lhu $t2, ($a3)
.L802772F8:
addi $a3, $a3, 2
srl $t3, $t2, 0xc
andi $t2, $t2, 0xfff
sub $t1, $a1, $t2
addi $t3, $t3, 3
.L8027730C:
lb $t2, -1($t1)
addi $t3, $t3, -1
addi $t1, $t1, 1
addi $a1, $a1, 1
bnez $t3, .L8027730C
sb $t2, -1($a1)
.L80277324:
sll $t0, $t0, 1
bne $a1, $t8, .L802772C0
addi $a2, $a2, -1
jr $ra
nop
.elseif VERSION_EU == 1
lw $a3, 8($a0)
lw $t9, 0xc($a0)
lw $t8, 4($a0)
add $a3, $a3, $a0
add $t9, $t9, $a0
move $a2, $zero
addi $a0, $a0, 0x10
add $t8, $t8, $a1
.L8026ED80:
bnezl $a2, .L8026ED98
slt $t1, $t0, $zero
lw $t0, ($a0)
li $a2, 32
addi $a0, $a0, 4
slt $t1, $t0, $zero
.L8026ED98:
beql $t1, $zero, .L8026EDB8
lhu $t2, ($a3)
lb $t2, ($t9)
addi $t9, $t9, 1
addi $a1, $a1, 1
b .L8026EDE4
sb $t2, -1($a1)
lhu $t2, ($a3)
.L8026EDB8:
addi $a3, $a3, 2
srl $t3, $t2, 0xc
andi $t2, $t2, 0xfff
sub $t1, $a1, $t2
addi $t3, $t3, 3
.L8026EDCC:
lb $t2, -1($t1)
addi $t3, $t3, -1
addi $t1, $t1, 1
addi $a1, $a1, 1
bnez $t3, .L8026EDCC
sb $t2, -1($a1)
.L8026EDE4:
sll $t0, $t0, 1
bne $a1, $t8, .L8026ED80
addi $a2, $a2, -1
jr $ra
nop
.else
lw $t8, 4($a0)
lw $a3, 8($a0)
lw $t9, 0xc($a0)
move $a2, $zero
add $t8, $t8, $a1
add $a3, $a3, $a0
add $t9, $t9, $a0
addi $a0, $a0, 0x10
.L8027EF50:
bnez $a2, .L8027EF64
nop
lw $t0, ($a0)
li $a2, 32
addi $a0, $a0, 4
.L8027EF64:
slt $t1, $t0, $zero
beqz $t1, .L8027EF88
nop
lb $t2, ($t9)
addi $t9, $t9, 1
sb $t2, ($a1)
addi $a1, $a1, 1
b .L8027EFBC
nop
.L8027EF88:
lhu $t2, ($a3)
addi $a3, $a3, 2
srl $t3, $t2, 0xc
andi $t2, $t2, 0xfff
sub $t1, $a1, $t2
addi $t3, $t3, 3
.L8027EFA0:
lb $t2, -1($t1)
addi $t3, $t3, -1
addi $t1, $t1, 1
sb $t2, ($a1)
addi $a1, $a1, 1
bnez $t3, .L8027EFA0
nop
.L8027EFBC:
sll $t0, $t0, 1
addi $a2, $a2, -1
bne $a1, $t8, .L8027EF50
nop
jr $ra
nop
.endif
File renamed without changes.
+59
View File
@@ -0,0 +1,59 @@
/******************************
* Data Decompress Ver1.10 *
* Programmed By Melody-Yoshi *
******************************/
/* How to use this function.
void slidstart(unsigned char *,unsigned char *);
first argument is top address of compress data.(align 4)
next argument is top address of decompress.
*/
.align 4
.text
.globl slidstart
.ent slidstart
.set reorder
/* ===== START! ===== */
slidstart: lw $24,4($4) ## R24=Output size
lw $7,8($4)
lw $25,12($4)
move $6,$0 ## flags=0
add $24,$5
add $7,$4
add $25,$4
add $4,16
/* ===== MAIN LOOP ===== */
slidemain2: bne $6,$0,codecheck2
lw $8,($4)
li $6,32
add $4,4
codecheck2: slt $9,$8,$0 ## Check MSB
beq $9,$0,pressdata2
lb $10,($25)
add $25,1
sb $10,($5)
add $5,1
b loopend2
pressdata2: lhu $10,($7)
add $7,2
srl $11,$10,12
and $10,0xfff
sub $9,$5,$10 ## R9=DIST
beq $11,$0,pressloop3
add $11,2
pressloop2: lb $10,-1($9)
sub $11,1
add $9,1
sb $10,($5)
add $5,1
bne $11,$0,pressloop2
loopend2: sll $8,1
sub $6,1
bne $5,$24,slidemain2
jr $31
pressloop3: lbu $11,($25)
add $25,1
add $11,18
b pressloop2
.end
+1 -1
View File
@@ -110,7 +110,7 @@ index a130cc04..926c0d09 100644
+const LevelScript level_intro_entry_error_screen[] = {
+ INIT_LEVEL(),
+ FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
+ LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
+ LOAD_YAY0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
+ ALLOC_LEVEL_POOL(),
+
+ AREA(/*index*/ 1, intro_geo_error_screen),
+126
View File
@@ -0,0 +1,126 @@
/**************************************************************************
*
* $Revision: 1.4 $
* $Date: 1997/11/26 00:30:50 $
* $Source: /exdisk2/cvs/N64OS/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!
*
*/
#include <stdio.h>
#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__ */
+1 -1
View File
@@ -14,7 +14,7 @@
*
* $Revision: 1.13 $
* $Date: 1997/02/11 08:15:34 $
* $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/R4300.h,v $
*
**************************************************************************/
+235 -664
View File
File diff suppressed because it is too large. Load diff
+129
View File
@@ -0,0 +1,129 @@
#ifndef _GBI_POSLIGHT_H_
#define _GBI_POSLIGHT_H_
/* version 990705 */
#define G_LIGHTING_POSITIONAL 0x00400000
#ifdef _LANGUAGE_ASSEMBLY
#define G_LIGHTING_POSITIONAL_H (G_LIGHTING_POSITIONAL/0x10000)
#endif
typedef struct {
unsigned char col[3]; /* diffuse light value (rgba) */
unsigned char kc; /* positional lighting enable flag & constant attenuation Kc */
unsigned char colc[3]; /* copy of diffuse light value (rgba) */
unsigned char kl; /* linear attenuation Kl */
short pos[3]; /* light position x, y, z */
unsigned char kq; /* quadratic attenuation Kq */
char reserved1;
} PosLight_t;
typedef union {
PosLight_t p;
Light_t l;
long long int force_structure_alignment[2];
} PosLight;
typedef struct {
Ambient a;
PosLight l[7];
} PosLightsn;
typedef struct {
Ambient a;
PosLight l[1];
} PosLights0;
typedef struct {
Ambient a;
PosLight l[1];
} PosLights1;
typedef struct {
Ambient a;
PosLight l[2];
} PosLights2;
typedef struct {
Ambient a;
PosLight l[3];
} PosLights3;
typedef struct {
Ambient a;
PosLight l[4];
} PosLights4;
typedef struct {
Ambient a;
PosLight l[5];
} PosLights5;
typedef struct {
Ambient a;
PosLight l[6];
} PosLights6;
typedef struct {
Ambient a;
PosLight l[7];
} PosLights7;
#define _gSPLightColor2(pkt, n, col1, col2) \
{\
gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_a##n, col1);\
gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_b##n, col2);\
}
#define _gsSPLightColor2(n, col1, col2) \
gsMoveWd(G_MW_LIGHTCOL, G_MWO_a##n, col1),\
gsMoveWd(G_MW_LIGHTCOL, G_MWO_b##n, col2)
#define _gdSPDefAmbient(ar,ag,ab) {{ {ar,ag,ab},0,{ar,ag,ab},0}}
#define _gdSPDefPosLight(r,g,b,x,y,z,c,l,q) {{ {r,g,b},c,{r,g,b},l,{x,y,z},q,0 }}
#define _gdSPDefInfLight(r,g,b,x,y,z) {{ {r,g,b},0,{r,g,b},0,{((x)<<8)|((y)&0xff),(z)<<8,0},0,0}}
#define gdSPDefPosLights0(ar,ag,ab) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(0,0,0,0,0,0,0,0,0)} }
#define gdSPDefPosLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1)} }
#define gdSPDefPosLights2(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2)} }
#define gdSPDefPosLights3(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2,r3,g3,b3,x3,y3,z3,c3,l3,q3) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2), \
_gdSPDefPosLight(r3,g3,b3,x3,y3,z3,c3,l3,q3)} }
#define gdSPDefPosLights4(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2,r3,g3,b3,x3,y3,z3,c3,l3,q3,r4,g4,b4,x4,y4,z4,c4,l4,q4) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2), \
_gdSPDefPosLight(r3,g3,b3,x3,y3,z3,c3,l3,q3), \
_gdSPDefPosLight(r4,g4,b4,x4,y4,z4,c4,l4,q4)} }
#define gdSPDefPosLights5(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2,r3,g3,b3,x3,y3,z3,c3,l3,q3,r4,g4,b4,x4,y4,z4,c4,l4,q4,r5,g5,b5,x5,y5,z5,c5,l5,q5) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2), \
_gdSPDefPosLight(r3,g3,b3,x3,y3,z3,c3,l3,q3), \
_gdSPDefPosLight(r4,g4,b4,x4,y4,z4,c4,l4,q4), \
_gdSPDefPosLight(r5,g5,b5,x5,y5,z5,c5,l5,q5)} }
#define gdSPDefPosLights6(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2,r3,g3,b3,x3,y3,z3,c3,l3,q3,r4,g4,b4,x4,y4,z4,c4,l4,q4,r5,g5,b5,x5,y5,z5,c5,l5,q5,r6,g6,b6,x6,y6,z6,c6,l6,q6) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2), \
_gdSPDefPosLight(r3,g3,b3,x3,y3,z3,c3,l3,q3), \
_gdSPDefPosLight(r4,g4,b4,x4,y4,z4,c4,l4,q4), \
_gdSPDefPosLight(r5,g5,b5,x5,y5,z5,c5,l5,q5), \
_gdSPDefPosLight(r6,g6,b6,x6,y6,z6,c6,l6,q6)} }
#define gdSPDefPosLights7(ar,ag,ab,r1,g1,b1,x1,y1,z1,c1,l1,q1,r2,g2,b2,x2,y2,z2,c2,l2,q2,r3,g3,b3,x3,y3,z3,c3,l3,q3,r4,g4,b4,x4,y4,z4,c4,l4,q4,r5,g5,b5,x5,y5,z5,c5,l5,q5,r6,g6,b6,x6,y6,z6,c6,l6,q6,r7,g7,b7,x7,y7,z7,c7,l7,q7) \
{ _gdSPDefAmbient(ar,ag,ab), \
{ _gdSPDefPosLight(r1,g1,b1,x1,y1,z1,c1,l1,q1), \
_gdSPDefPosLight(r2,g2,b2,x2,y2,z2,c2,l2,q2), \
_gdSPDefPosLight(r3,g3,b3,x3,y3,z3,c3,l3,q3), \
_gdSPDefPosLight(r4,g4,b4,x4,y4,z4,c4,l4,q4), \
_gdSPDefPosLight(r5,g5,b5,x5,y5,z5,c5,l5,q5), \
_gdSPDefPosLight(r6,g6,b6,x6,y6,z6,c6,l6,q6), \
_gdSPDefPosLight(r7,g7,b7,x7,y7,z7,c7,l7,q7)} }
#endif /* _GBI_POSLIGHT_H_ */
+8 -4
View File
@@ -2477,11 +2477,11 @@ typedef union {
gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
#define gSPLoadUcodeL(pkt, ucode) \
gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&##ucode##TextStart), \
OS_K0_TO_PHYSICAL(&##ucode##DataStart))
gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&ucode##TextStart), \
OS_K0_TO_PHYSICAL(&ucode##DataStart))
#define gsSPLoadUcodeL(ucode) \
gsSPLoadUcode(OS_K0_TO_PHYSICAL(&##ucode##TextStart), \
OS_K0_TO_PHYSICAL(&##ucode##DataStart))
gsSPLoadUcode(OS_K0_TO_PHYSICAL(&ucode##TextStart), \
OS_K0_TO_PHYSICAL(&ucode##DataStart))
#endif
#ifdef F3DEX_GBI_2
@@ -4795,6 +4795,10 @@ typedef union {
#define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag)
#define gsDPNoOpTag(tag) gsDPParam(G_NOOP, tag)
#if defined(F3DZEX_GBI_2) || defined(F3DZEX_NON_GBI_2) || defined(L3DZEX_GBI)
#include "gbi-poslight.h"
#endif
#endif /* _LANGUAGE_C */
+365
View File
@@ -0,0 +1,365 @@
/*
* 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.16 $
* $Date: 1998/05/28 00:14:50 $
* $Source: /exdisk2/cvs/N64OS/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 */
#include <PR/ultratypes.h>
/* 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_ */
+12
View File
@@ -0,0 +1,12 @@
/* GENERATED FILE, DO NOT EDIT! */
/* gtState_t structure offsets for assembly language: */
#define GT_STATE_SIZE 176
#define GT_STATE_OFF_RENDSTATE 0x00
#define GT_STATE_OFF_TEXSTATE 0x08
#define GT_STATE_OFF_VTXCOUNT 0x10
#define GT_STATE_OFF_VTXV0 0x11
#define GT_STATE_OFF_TRICOUNT 0x12
#define GT_STATE_OFF_RDPCMDS 0x18
#define GT_STATE_OFF_OTHERMODE 0x20
#define GT_STATE_OFF_TRANSFORM 0x30
+264 -24
View File
@@ -1,29 +1,269 @@
#ifndef _ULTRA64_GU_H_
#define _ULTRA64_GU_H_
#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.48 $
* $Date: 1999/07/13 08:00:20 $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gu.h,v $
*
**************************************************************************/
#include <PR/mbi.h>
#include <PR/ultratypes.h>
#include <PR/sptask.h>
#define GU_PI 3.1415926
/* Functions */
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect,
float near, float far, float scale);
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near,
float far, float scale);
void guOrtho(Mtx *m, float left, float right, float bottom, float top,
float near, float far, float scale);
void guTranslate(Mtx *m, float x, float y, float z);
void guRotate(Mtx *m, float a, float x, float y, float z);
void guScale(Mtx *m, float x, float y, float z);
void guMtxF2L(float mf[4][4], Mtx *m);
void guMtxIdent(Mtx *m);
void guMtxIdentF(float mf[4][4]);
void guMtxL2F(float mf[4][4], Mtx *m);
void guNormalize(float *, float *, float *);
/* Used only in Fast3DEX2 */
void guLookAtReflect (Mtx *m, LookAt *l, float xEye, float yEye, float zEye,
float xAt, float yAt, float zAt,
float xUp, float yUp, float zUp);
#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);
#ifdef __sgi
#pragma intrinsic(sqrtf);
#endif
/*
* 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_ */
+631
View File
@@ -0,0 +1,631 @@
/*---------------------------------------------------------------------*
Copyright (C) 1997-1998, Nintendo.
File gzsort.h
Coded by Yoshitaka Yasumoto. Jun 16, 1997.
$Id: gzsort.h,v 1.11 1998/01/06 01:28:21 yasu Exp $
*---------------------------------------------------------------------*/
#ifndef _GZSORT_H_
#define _GZSORT_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
/*===========================================================================*
* GBI Commands for ZSort microcode
*===========================================================================*/
/* GBI Header */
#define G_ZS_ZOBJ 0x80
#define G_ZS_RDPCMD 0x81
#define G_ZS_MOVEMEM 0xdc
#define G_ZS_SENDSIGNAL 0xda
#define G_ZS_WAITSIGNAL 0xd9
#define G_ZS_SETSUBDL 0xd8
#define G_ZS_LINKSUBDL 0xd7
#define G_ZS_MULT_MPMTX 0xd6
#define G_ZS_MTXCAT 0xd5
#define G_ZS_MTXTRNSP 0xd4
#define G_ZS_LIGHTING_L 0xd3 /* Not use */
#define G_ZS_LIGHTING 0xd2
#define G_ZS_XFMLIGHT 0xd1
#define G_ZS_INTERPOLATE 0xd0
/*------------------------------------------------------------------------*
* case_G_ZOBJ
* +--------+--------+--------+--------+
* | Pointr for zobj0:32 |
* +--------+--------+--------+--------+
* | Pointr for zobj1:32 |
* +--------+--------+--------+--------+
* Draw zobject links
*/
#define gSPZObject(pkt, objA, objB) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = (unsigned int)(objA); \
_g->words.w1 = (unsigned int)(objB); \
}
#define gsSPZObject(objA, objB) \
{ \
(unsigned int)(objA), (unsigned int)(objB) \
}
/*------------------------------------------------------------------------*
* case_G_RDPCMD
* +--------+--------+--------+--------+
* | RDPCMD | 0 |
* +--------+--------+--------+--------+
* | Pointr for rdpcmd:32 |
* +--------+--------+--------+--------+
* Submit rdp cmd
*/
#define gSPZRdpCmd(pkt, cmd) gImmp1((pkt), G_ZS_RDPCMD, (cmd))
#define gsSPZRdpCmd(cmd) gsImmp1(G_ZS_RDPCMD, (cmd))
/*------------------------------------------------------------------------*
* case_G_MOVEMEM
* +--------+--------++-------+-+----+-+
* |MOVEMEM | Len:9 | Ofs:9 |ID:5|F|
* +--------+--------++-------+-+----+-+
* | Pointr for RDRAM:32 |
* +--------+--------+--------+--------+
* Read/Write DMEM
*/
#define GZM_USER0 0
#define GZM_USER1 2
#define GZM_MMTX 4
#define GZM_PMTX 6
#define GZM_MPMTX 8
#define GZM_OTHERMODE 10
#define GZM_VIEWPORT 12
#define GZF_LOAD 0
#define GZF_SAVE 1
#define gSPZMoveMem(pkt, id, ofs, len, buffer, flag) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_MOVEMEM, 24, 8)| \
_SHIFTL(((len)-1)>>3, 15, 9)| \
_SHIFTL((ofs)>>3, 6, 9)|(id)|(flag); \
_g->words.w1 = (unsigned int)(buffer); \
}
#define gsSPZMoveMem(id, ofs, len, buffer, flag) \
{ \
_SHIFTL(G_ZS_MOVEMEM, 24, 8)| \
_SHIFTL(((len)-1)>>3, 15, 9)| \
_SHIFTL((ofs)>>3, 6, 9)|(id)|(flag), \
(unsigned int)(buffer) \
}
/*------------------------------------------------------------------------*/
#define gSPZSetUMem(pkt, umem, size, adrs) \
gSPZMoveMem((pkt),GZM_USER0,(umem),(size),(adrs),GZF_LOAD)
#define gsSPZSetUMem(umem, size, adrs) \
gsSPZMoveMem(GZM_USER0,(umem),(size),(adrs),GZF_LOAD)
#define gSPZGetUMem(pkt, umem, size, adrs) \
gSPZMoveMem((pkt),GZM_USER0,(umem),(size),(adrs),GZF_SAVE)
#define gsSPZGetUMem(umem, size, adrs) \
gsSPZMoveMem(GZM_USER0,(umem),(size),(adrs),GZF_SAVE)
/*------------------------------------------------------------------------*/
#define gSPZSetMtx(pkt, mid, mp) \
gSPZMoveMem((pkt), (mid), 0, sizeof(Mtx), (mp), GZF_LOAD)
#define gsSPZSetMtx(mid, mp) \
gsSPZMoveMem((mid), 0, sizeof(Mtx), (mp), GZF_LOAD)
/*------------------------------------------------------------------------*/
#define gSPZGetMtx(pkt, mid, mp) \
gSPZMoveMem((pkt), (mid), 0, sizeof(Mtx), (mp), GZF_SAVE)
#define gsSPZGetMtx(mid, mp) \
gsSPZMoveMem((mid), 0, sizeof(Mtx), (mp), GZF_SAVE)
/*------------------------------------------------------------------------*/
#define gSPZSetAmbient(pkt, umem, lights) \
gSPZSetUMem((pkt),(umem),ZSIZE_AMBIENT,(lights))
#define gsSPZSetAmbient(umem, lights) \
gsSPZSetUMem((umem),ZSIZE_AMBIENT,(lights))
/*------------------------------------------------------------------------*/
#define gSPZSetDefuse(pkt, umem, lid, lights) \
gSPZSetUMem((pkt),(umem)+ZSIZE_AMBIENT+(lid)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, (lights))
#define gsSPZSetDefuse(umem, lid, lights) \
gsSPZSetUMem((umem)+ZSIZE_AMBIENT+(lid)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, (lights))
/*------------------------------------------------------------------------*/
#define gSPZSetLookAt(pkt, umem, lid, lookat) \
{ gSPZSetUMem((pkt), (umem)+ZSIZE_AMBIENT+((lid)+0)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, \
((u32)(lookat))+sizeof(Light)*0); \
gSPZSetUMem((pkt), (umem)+ZSIZE_AMBIENT+((lid)+1)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, \
((u32)(lookat))+sizeof(Light)*1); }
#define gsSPZSetLookAt(umem, lid, lookat) \
gsSPZSetUMem((umem)+ZSIZE_AMBIENT+((lid)+0)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, \
((u32)(lookat))+sizeof(Light)*0), \
gsSPZSetUMem((umem)+ZSIZE_AMBIENT+((lid)+1)*ZSIZE_LIGHT, \
ZSIZE_DEFUSE, \
((u32)(lookat))+sizeof(Light)*1)
/*------------------------------------------------------------------------*/
#define gSPZViewport(pkt, v) \
gSPZMoveMem((pkt), GZM_VIEWPORT, 0, 16, (v), GZF_LOAD)
#define gsSPZViewport(v) \
gsSPZMoveMem(GZM_VIEWPORT, 0, 16, (v), GZF_LOAD)
#define GZ_VIEWPORT_FOG_S(in, out) (0x400000/((out)-(in)))
#define GZ_VIEWPORT_FOG_T(in, out) ((0x200*(out))/((in)-(out)))
/*------------------------------------------------------------------------*
* case_G_SENDSIGNAL
* +--------+--------+--------+--------+
* |Send SIG| Parameter1:24 |
* +--------+--------+--------+--------+
* | Parameter2:32 |
* +--------+--------+--------+--------+
* Send signal to CPU
*/
#define GZ_INTR_SPBRK1 SP_STATUS_RSPSIGNAL
#define GZ_INTR_SPBRK2 \
(SP_SET_RSPSIGNAL|SP_CLR_TASKDONE|SP_CLR_YIELDED|SP_SET_INTR)
#define gSPZSendMessage(pkt) \
gDma0p((pkt), G_ZS_SENDSIGNAL, GZ_INTR_SPBRK2, GZ_INTR_SPBRK1)
#define gsSPZSendMessage() \
gsDma0p(G_ZS_SENDSIGNAL, GZ_INTR_SPBRK2, GZ_INTR_SPBRK1)
/*------------------------------------------------------------------------*
* case_G_WAITSIGNAL
* +--------+--------+--------+--------+
* |Wait SIG| Phy Adrs of signal buf:24|
* +--------+--------+--------+--------+
* | Parameter:32 |
* +--------+--------+--------+--------+
* Wait signal from CPU
*/
#define gSPZWaitSignal(pkt, adrs, param) \
gDma0p((pkt), G_ZS_WAITSIGNAL, (param), (adrs))
#define gsSPZWaitSignal(adrs, param) \
{ \
(unsigned int)((char *)(adrs)+((G_ZS_WAITSIGNAL-0x80)<<24)), \
(unsigned int)(param) \
}
#define GZ_SENDSIGNAL(adrs,val) { \
IO_WRITE(&(((zSignal *)(adrs))->t.signal), (val)); \
IO_WRITE(SP_STATUS_REG, SP_SET_CPUSIGNAL); \
}
/*------------------------------------------------------------------------*
* case_G_SETSUBDL
* +--------+--------+--------+--------+
* |SETSUBDL| 0 |
* +--------+--------+--------+--------+
* | DL:32 |
* +--------+--------+--------+--------+
*/
#define gSPZSetSubDL(pkt, dl) gImmp1((pkt), G_ZS_SETSUBDL, (u32)(dl))
#define gsSPZSetSubDL(dl) gsImmp1(G_ZS_SETSUBDL, (u32)(dl))
/*------------------------------------------------------------------------*
* case_G_LINKSUBDL
* +--------+--------+--------+--------+
* |LINKSUBD| 0 |
* +--------+--------+--------+--------+
* | 0 |
* +--------+--------+--------+--------+
*/
#define gSPZLinkSubDL(pkt) gImmp0((pkt), G_ZS_LINKSUBDL)
#define gsSPZLinkSubDL() gsImmp0(G_ZS_LINKSUBDL)
/*------------------------------------------------------------------------*
* case_G_MULT_MPMTX
* +--------+--------+--------+--------+
* |MULT_MPM| 0 | Mid:8 |
* +--------+--------+----+---+--------+
* | Num:8 | Src:12 | Dest:12 |
* +--------+-------------+------------+
*/
#define gSPZMultMPMtx(pkt, mid, src, num, dest) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_MULT_MPMTX,24,8)|_SHIFTL((mid),0,8); \
_g->words.w1 = _SHIFTL(((num)-1), 24, 8)| \
_SHIFTL((src)+1024,12,12)|_SHIFTL((dest)+1024, 0,12); \
}
#define gsSPZMultMPMtx(mid, src, num, dest) \
{ \
_SHIFTL(G_ZS_MULT_MPMTX,24,8)|_SHIFTL((mid),0, 8), \
_SHIFTL(((num)-1), 24, 8)| \
_SHIFTL((src)+1024,12,12)|_SHIFTL((dest)+1024,0,12) \
}
/*------------------------------------------------------------------------*
* case_G_MTXCAT
* +--------+--------+--------+--------+
* | MTXCAT | 0 | 0 | MidS:8 |
* +--------+--------+--------+--------+
* | 0 | MidT:8 | 0 | MidD:8 |
* +--------+--------+--------+--------+
*/
#define gSPZMtxCat(pkt, midS, midT, midD) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_MTXCAT,24,8)|_SHIFTL((midS), 0,8); \
_g->words.w1 = _SHIFTL((midT), 16,8)|_SHIFTL((midD), 0,8); \
}
#define gsSPZMtxCat(midS, midT, midD) \
{ \
_SHIFTL(G_ZS_MTXCAT,24,8)|_SHIFTL((midS), 0,8), \
_SHIFTL((midT), 16,8)|_SHIFTL((midD), 0,8) \
}
/*------------------------------------------------------------------------*
* case_G_MTXTRNSP
* +--------+--------+--------+--------+
* |MTXTRNSP| 0 | 0 | 0 |
* +--------+--------+--------+--------+
* | 0 | 0 | 0 | Mid:8 |
* +--------+--------+--------+--------+
*/
#define gSPZMtxTrnsp3x3(pkt, mid) gImmp1((pkt), G_ZS_MTXTRNSP, (mid))
#define gsSPZMtxTrnsp3x3(mid) gsImmp1(G_ZS_MTXTRNSP, (mid))
/*------------------------------------------------------------------------*
* case_G_XFMLIGHT
* +--------+--------+--------+--------+
* |XFMLIGHT| 0 | Mid:8 |
* +--------+----+---+----+---+--------+
* | 0 | Lnum:8 | Lptr:12 |
* +--------+----+---+----+---+--------+
*/
#define gSPZXfmLights(pkt, mid, umem, lnum) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_XFMLIGHT,24,8)|(mid); \
_g->words.w1 = _SHIFTL((lnum)-1,12,8)|_SHIFTL((umem)+1024, 0,12); \
}
#define gsSPZXfmLights(mid, umem, lnum) \
{ \
_SHIFTL(G_ZS_XFMLIGHT,24,8)|(mid), \
_SHIFTL((lnum)-1,12,8)|_SHIFTL((umem)+1024, 0,12) \
}
/*------------------------------------------------------------------------*
* case_G_LIGHTING
* +--------+-------------+------------+
* |LIGHTING| Color:12 | Norm:12 |
* +--------+-------------+------------+
* | Num:8 | DestColor:12| DestTxtr:12|
* +--------+-------------+------------+
* gSPZLight/gSPZLightMaterial
*/
#define gSPZLightMaterial(pkt, csrc, nsrc, num, cdest, tdest) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_LIGHTING,24,8)| \
_SHIFTL((csrc)+1024, 12,12)|_SHIFTL((nsrc) +1024,0,12);\
_g->words.w1 = _SHIFTL((num)-1, 24, 8)| \
_SHIFTL((cdest)+1024,12,12)|_SHIFTL((tdest)+1024,0,12);\
}
#define gsSPZLightMaterial(csrc, nsrc, num, cdest, tdest) \
{ \
_SHIFTL(G_ZS_LIGHTING,24,8)| \
_SHIFTL((csrc)+1024, 12,12)|_SHIFTL((nsrc) +1024,0,12), \
_SHIFTL((num)-1, 24, 8)| \
_SHIFTL((cdest)+1024,12,12)|_SHIFTL((tdest)+1024,0,12) \
}
#define gSPZLight(pkt, nsrc, num, cdest, tdest) \
gSPZLightMaterial((pkt),-16,(nsrc),(num),(cdest),(tdest))
#define gsSPZLight(nsrc, num, cdest, tdest) \
gsSPZLightMaterial(-16,(nsrc),(num),(cdest),(tdest))
/*------------------------------------------------------------------------*
* case_G_INTERPOLATE
* +--------+--------+-----------------+
* |INTERPLT| Type:8 | Factor:16 |
* +--------+--------+----+------------+
* | Num:8 | Src1/Dest:12| Src2:12 |
* +--------+-------------+------------+
*/
#define GZ_INTRP_S16 0
#define GZ_INTRP_S8 2
#define GZ_INTRP_U8 4
#define gSPZMix(pkt, src1, src2, num, factor, type) \
{ \
Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_ZS_INTERPOLATE,24,8)| \
_SHIFTL((type),16, 8)|_SHIFTL((factor),0,16); \
_g->words.w1 = _SHIFTL((num)/8-1,24,8)| \
_SHIFTL((src1),12,12)|_SHIFTL((src2), 0,12); \
}
#define gsSPZMix(src1, src2, num, factor, type) \
{ \
_SHIFTL(G_ZS_INTERPOLATE,24,8)| \
_SHIFTL((type),16, 8)|_SHIFTL((factor),0,16), \
_SHIFTL(((num)-1)/8,24,8)| \
_SHIFTL((src1),12,12)|_SHIFTL((src2), 0,12) \
}
#define gSPZMixS16(pkt, src1, src2, num, factor) \
gSPZMix((pkt), (src1), (src2), (num), (factor), GZ_INTRP_S16)
#define gSPZMixS8(pkt, src1, src2, num, factor) \
gSPZMix((pkt), (src1), (src2), (num), (factor), GZ_INTRP_S8)
#define gSPZMixU8(pkt, src1, src2, num, factor) \
gSPZMix((pkt), (src1), (src2), (num), (factor), GZ_INTRP_U8)
#define gsSPZMixS16(src1, src2, num, factor) \
gsSPZMix((src1), (src2), (num), (factor), GZ_INTRP_S16)
#define gsSPZMixS8(src1, src2, num, factor) \
gsSPZMix((src1), (src2), (num), (factor), GZ_INTRP_S8)
#define gsSPZMixU8(src1, src2, num, factor) \
gsSPZMix((src1), (src2), (num), (factor), GZ_INTRP_U8)
/*------------------------------------------------------------------------*
* Compatible GBIs
*------------------------------------------------------------------------*/
#define gSPZSegment(pkt, segment, base) gSPSegment((pkt), (segment), (base))
#define gsSPZSegment(segment, base) gsSPSegment((segment), (base))
#define gSPZPerspNormalize(pkt, s) gSPPerspNormalize((pkt), (s))
#define gsSPZPerspNormalize(s) gsSPPerspNormalize(s)
#define gSPZDisplayList(pkt, dl) gSPDisplayList((pkt), (dl))
#define gsSPZDisplayList(dl) gsSPDisplayList(dl)
#define gSPZEndDisplayList(pkt) gSPEndDisplayList(pkt)
#define gsSPZEndDisplayList() gsSPEndDisplayList()
/*===========================================================================*
* Data structures for ZSort microcode
*===========================================================================*/
#define G_ZOBJ_NONE 0x80000000
/* ZObject IDs */
#define ZH_NULL 0
#define ZH_SHTRI 1
#define ZH_TXTRI 2
#define ZH_SHQUAD 3
#define ZH_TXQUAD 4
#define ZHDR(pointer, type) ((type)+((u32)(pointer)))
/*===========================================================================*
* Useful MACRO
*===========================================================================*/
#define guZFixLookAt(lp) \
{ (lp)->l[1].l.col[1] = (lp)->l[1].l.colc[1] = 0x00; }
#if (defined(_LANGUAGE_C)||defined(_LANGUAGE_C_PLUS_PLUS))
/*------------------------------------------------------------------------*/
/* ZMath: Vertex structure format */
/*-----------------------------------------------------*/
#define ZSIZE_VSRC 6
typedef struct { s16 x,y,z; } zVtxSrc;
/*-----------------------------------------------------*/
#define ZSIZE_VDEST 16
typedef struct {
s16 sx, sy;
s32 invw;
s16 xi, yi;
u8 cc;
u8 fog;
s16 wi;
} zVtxDest;
#define GZ_CC_RIGHT 0x01
#define GZ_CC_TOP 0x02
#define GZ_CC_NEAR 0x04
#define GZ_CC_LEFT 0x10
#define GZ_CC_BOTTOM 0x20
#define GZ_CC_FAR 0x40
/*-----------------------------------------------------*/
#define ZSIZE_NSRC 3
typedef struct { s8 nx,ny,nz; } zNorm;
/*-----------------------------------------------------*/
#define ZSIZE_CSRC 4
#define ZSIZE_CDEST 4
typedef struct { u8 r, g, b, a; } zColor_t;
typedef union {
zColor_t n;
u32 w;
} zColor;
/*-----------------------------------------------------*/
#define ZSIZE_TDEST 4
typedef struct { s16 s, t; } zTxtr_t;
typedef union {
zTxtr_t n;
u32 w;
} zTxtr;
/*-----------------------------------------------------*/
#define ZSIZE_LIGHT 24
#define ZSIZE_DEFUSE 16
#define ZSIZE_AMBIENT 8
/*------------------------------------------------------------------------*/
/* ZObject: Common header */
typedef struct {
u32 header;
Gfx *rdpcmd1;
} zHeader_t;
typedef union {
zHeader_t t;
u64 force_structure_alignment;
} zHeader;
/*------------------------------------------------------------------------*/
/* ZObject: Null Node */
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
Gfx *rdpcmd2;
Gfx *rdpcmd3;
} zNull_t;
typedef union {
zNull_t t;
u64 force_structure_alignment;
} zNull;
/*------------------------------------------------------------------------*/
/* ZObject: Smooth Shaded Triangle */
typedef struct {
s16 x, y;
u8 r, g, b, a;
} zShVtx;
/*------------------------------------------------------------------------*/
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
zShVtx v[3];
} zShTri_t;
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
u32 xy0, clr0;
u32 xy1, clr1;
u32 xy2, clr2;
} zShTri_w;
typedef union {
zShTri_t t;
zShTri_w w;
u64 force_structure_alignment;
} zShTri;
/*------------------------------------------------------------------------*/
/* ZObject: Smooth Shaded Quadrangle */
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
zShVtx v[4];
} zShQuad_t;
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
u32 xy0, clr0;
u32 xy1, clr1;
u32 xy2, clr2;
u32 xy3, clr3;
} zShQuad_w;
typedef union {
zShQuad_t t;
zShQuad_w w;
u64 force_structure_alignment;
} zShQuad;
/*------------------------------------------------------------------------*/
/* ZObject: Smooth Shaded and Texture Mapped Triangle */
typedef struct {
s16 x, y;
u8 r, g, b, a;
s16 s, t;
s32 invw;
} zTxVtx;
/*------------------------------------------------------------------------*/
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
Gfx *rdpcmd2;
Gfx *rdpcmd3;
zTxVtx v[3];
} zTxTri_t;
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
Gfx *rdpcmd2;
Gfx *rdpcmd3;
u32 xy0, clr0, st0, invw0;
u32 xy1, clr1, st1, invw1;
u32 xy2, clr2, st2, invw2;
} zTxTri_w;
typedef union {
zTxTri_t t;
zTxTri_w w;
u64 force_structure_alignment;
} zTxTri;
/*------------------------------------------------------------------------*/
/* ZObject: Smooth Shaded and Texture Mapped Quadrangle */
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
Gfx *rdpcmd2;
Gfx *rdpcmd3;
zTxVtx v[4];
} zTxQuad_t;
typedef struct {
zHeader *header;
Gfx *rdpcmd1;
Gfx *rdpcmd2;
Gfx *rdpcmd3;
u32 xy0, clr0, st0, invw0;
u32 xy1, clr1, st1, invw1;
u32 xy2, clr2, st2, invw2;
u32 xy3, clr3, st3, invw3;
} zTxQuad_w;
typedef union {
zTxQuad_t t;
zTxQuad_w w;
u64 force_structure_alignment;
} zTxQuad;
/*------------------------------------------------------------------------*/
typedef struct {
u32 signal;
u32 padding;
} zSignal_t;
typedef union {
zSignal_t t;
u64 force_structure_alignment;
} zSignal;
/*===========================================================================*
* External functions
*===========================================================================*/
extern u64 gspZSort_fifoTextStart[], gspZSort_fifoTextEnd[];
extern u64 gspZSort_fifoDataStart[], gspZSort_fifoDataEnd[];
extern u64 gspZSort_pl_fifoTextStart[], gspZSort_pl_fifoTextEnd[];
extern u64 gspZSort_pl_fifoDataStart[], gspZSort_pl_fifoDataEnd[];
#endif
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* _GZSORT_H_ */
/*======== End of gzsort.h ========*/
+280
View File
@@ -0,0 +1,280 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: leo.h,v $
$Revision: 1.29 $
$Date: 1998/12/21 07:30:15 $
*---------------------------------------------------------------------*/
#ifndef _LEO_H_
#define _LEO_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#include <PR/leoappli.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
typedef u32 LEOError;
typedef u8 LEOSpdlMode;
typedef u8 LEOStatus;
typedef struct
{
u8 drive; /* version of hw */
u8 driver; /* version of sw */
u8 deviceType; /* dev type, always 00 */
u8 ndevices; /* # of devices, always 01 */
} LEOVersion;
typedef struct
{
u32 startLBA;
u32 endLBA;
u32 nbytes;
} LEOCapacity;
typedef struct
{
u8 pad;
u8 yearhi;
u8 yearlo;
u8 month;
u8 day;
u8 hour;
u8 minute;
u8 second;
} LEODiskTime;
typedef struct
{
u64 lineNumber;
LEODiskTime time;
} LEOSerialNum;
typedef struct
{
u8 gameName[4];
u8 gameVersion;
u8 diskNumber;
u8 ramUsage;
u8 diskUsage;
LEOSerialNum serialNumber;
u8 company[2];
u8 freeArea[6];
} LEODiskID;
typedef struct
{
LEOCmdHeader header;
union
{
struct
{
u32 lba;
u32 xfer_blks;
void *buff_ptr;
u32 rw_bytes;
#ifdef _LONGCMD
u32 size;
#endif
} readwrite;
struct
{
u32 lba;
} seek;
struct
{
void *buffer_pointer;
} readdiskid;
LEODiskTime time;
struct
{
u8 reserve1;
u8 reserve2;
u8 standby_time;
u8 sleep_time;
u32 reserve3;
} modeselect;
} data;
} LEOCmd;
#define _nbytes readwrite.rw_bytes
#define _result header.status
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#define LEO_SW_VERSION 6 /* This will be returned by */
/* LeoInquiry command */
#define OS_PRIORITY_LEOMGR OS_PRIORITY_PIMGR
/*
* Drive Rom offset address
*/
#define DDROM_FONT_START 0x000a0000
#define DDROM_WAVEDATA_START 0x00140000
/*
* Definition for osLeoSpdlMotor()
*/
#define ACTIVE 0
#define STANDBY 1
#define SLEEP 2
#define BRAKE 4
#define LEO_MOTOR_ACTIVE 0
#define LEO_MOTOR_STANDBY 1
#define LEO_MOTOR_SLEEP 2
#define LEO_MOTOR_BRAKE 4
#define NUM_LBAS 4292 /* total number of LBAs */
#define BLK_SIZE_ZONE0 19720
#define BLK_SIZE_ZONE1 18360
#define BLK_SIZE_ZONE2 17680
#define BLK_SIZE_ZONE3 16320
#define BLK_SIZE_ZONE4 14960
#define BLK_SIZE_ZONE5 13600
#define BLK_SIZE_ZONE6 12240
#define BLK_SIZE_ZONE7 10880
#define BLK_SIZE_ZONE8 9520
#define MAX_BLK_SIZE BLK_SIZE_ZONE0
#define MIN_BLK_SIZE BLK_SIZE_ZONE8
/*
* Error codes
*/
#define LEO_ERROR_GOOD 0
#define LEO_ERROR_DRIVE_NOT_READY 1
#define LEO_ERROR_DIAGNOSTIC_FAILURE 2
#define LEO_ERROR_COMMAND_PHASE_ERROR 3
#define LEO_ERROR_DATA_PHASE_ERROR 4
#define LEO_ERROR_REAL_TIME_CLOCK_FAILURE 5
#define LEO_ERROR_BUSY 8
#define LEO_ERROR_INCOMPATIBLE_MEDIUM_INSTALLED 11
#define LEO_ERROR_UNKNOWN_FORMAT 11
#define LEO_ERROR_NO_SEEK_COMPLETE 21
#define LEO_ERROR_WRITE_FAULT 22
#define LEO_ERROR_UNRECOVERED_READ_ERROR 23
#define LEO_ERROR_NO_REFERENCE_POSITION_FOUND 24
#define LEO_ERROR_TRACK_FOLLOWING_ERROR 25
#define LEO_ERROR_TRACKING_OR_SPDL_SERVO_FAILURE 25
#define LEO_ERROR_INVALID_COMMAND_OPERATION_CODE 31
#define LEO_ERROR_LBA_OUT_OF_RANGE 32
#define LEO_ERROR_WRITE_PROTECT_ERROR 33
#define LEO_ERROR_COMMAND_CLEARED_BY_HOST 34
#define LEO_ERROR_COMMAND_TERMINATED 34
#define LEO_ERROR_QUEUE_FULL 35
#define LEO_ERROR_ILLEGAL_TIMER_VALUE 36
#define LEO_ERROR_WAITING_NMI 37
#define LEO_ERROR_DEVICE_COMMUNICATION_FAILURE 41
#define LEO_ERROR_MEDIUM_NOT_PRESENT 42
#define LEO_ERROR_POWERONRESET_DEVICERESET_OCCURED 43
#define LEO_ERROR_RAMPACK_NOT_CONNECTED 44
#define LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED 47
#define LEO_ERROR_EJECTED_ILLEGALLY_RESUME 49
/*
* Reserved
*/
#define LEO_ERROR_NOT_BOOTED_DISK 45
#define LEO_ERROR_DIDNOT_CHANGED_DISK_AS_EXPECTED 46
/*
* Error codes only used in IPL
*/
#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48
#define LEO_ERROR_DIAGNOSTIC_FAILURE_RESET 50
#define LEO_ERROR_EJECTED_ILLEGALLY_RESET 51
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
#define GET_ERROR(x) ((x).header.sense)
/**************************************************************************
*
* Extern variables
*
*/
extern LEODiskID leoBootID;
extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Initialize routine */
extern s32 LeoCreateLeoManager(OSPri comPri, OSPri intPri,
OSMesg *cmdBuf, s32 cmdMsgCnt);
extern s32 LeoCJCreateLeoManager(OSPri comPri, OSPri intPri,
OSMesg *cmdBuf, s32 cmdMsgCnt);
extern s32 LeoCACreateLeoManager(OSPri comPri, OSPri intPri,
OSMesg *cmdBuf, s32 cmdMsgCnt);
extern u32 LeoDriveExist(void);
/* Synchronous functions */
extern s32 LeoClearQueue(void);
extern s32 LeoByteToLBA(s32 startLBA, u32 nbytes, s32 *lbas);
extern s32 LeoLBAToByte(s32 startLBA, u32 nLBAs, s32 *bytes);
extern s32 LeoReadCapacity(LEOCapacity *cap, s32 dir);
extern s32 LeoInquiry(LEOVersion *ver);
extern s32 LeoTestUnitReady(LEOStatus *status);
/* Asynchronous functions */
extern s32 LeoSpdlMotor(LEOCmd *cmdBlock, LEOSpdlMode mode, OSMesgQueue *mq);
extern s32 LeoSeek(LEOCmd *cmdBlock, u32 lba, OSMesgQueue *mq);
extern s32 LeoRezero(LEOCmd *cmdBlock, OSMesgQueue *mq);
extern s32 LeoReadWrite(LEOCmd *cmdBlock, s32 direction,
u32 LBA, void *vAddr, u32 nLBAs, OSMesgQueue *mq);
extern s32 LeoReadDiskID(LEOCmd *cmdBlock, LEODiskID *vaddr, OSMesgQueue *mq);
extern s32 LeoSetRTC(LEOCmd *cmdBlock, LEODiskTime *RTCdata, OSMesgQueue *mq);
extern s32 LeoReadRTC(LEOCmd *cmdBlock, OSMesgQueue *mq);
extern s32 LeoModeSelectAsync(LEOCmd *cmdBlock, u32 standby,
u32 sleep, OSMesgQueue *mq);
/* Font routines */
extern int LeoGetKAdr(int sjis);
extern int LeoGetAAdr(int code,int *dx,int *dy, int *cy);
extern int LeoGetAAdr2(u32 ccode,int *dx,int *dy, int *cy);
/* Boot function */
extern void LeoBootGame(void *entry);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_LEO_H */
+274
View File
@@ -0,0 +1,274 @@
/*
* F i l e N a m e : l e o a p p l i . h
*
****************************************************************************
* (C) Copyright ALPS Electric Co., Ltd. 1995-1997
****************************************************************************
* Version
*
* ver Date
* ---- --------
* 1.01 '97-11-18 Add MOTOR BRAKE definition for control bit.
****************************************************************************
*/
/*-----------------------------------*/
/* DRIVE PARAMETER */
/*-----------------------------------*/
#define LEO_DISK_TYPE_MIN 0
#define LEO_DISK_TYPE_MAX 6
#define LEO_LBA_MIN 0
#define LEO_LBA_MAX 4291
#define LEO_LBA_ROM_TOP LEO_LBA_MIN
#define LEO_LBA_ROM_END0 1417
#define LEO_LBA_ROM_END1 1965
#define LEO_LBA_ROM_END2 2513
#define LEO_LBA_ROM_END3 3061
#define LEO_LBA_ROM_END4 3609
#define LEO_LBA_ROM_END5 4087
#define LEO_LBA_ROM_END6 LEO_LBA_MAX
#define LEO_LBA_RAM_TOP0 (LEO_LBA_ROM_END0+1)
#define LEO_LBA_RAM_TOP1 (LEO_LBA_ROM_END1+1)
#define LEO_LBA_RAM_TOP2 (LEO_LBA_ROM_END2+1)
#define LEO_LBA_RAM_TOP3 (LEO_LBA_ROM_END3+1)
#define LEO_LBA_RAM_TOP4 (LEO_LBA_ROM_END4+1)
#define LEO_LBA_RAM_TOP5 (LEO_LBA_ROM_END5+1)
#define LEO_LBA_RAM_TOP6 (LEO_LBA_ROM_END6+1)
#define LEO_LBA_RAM_END6 LEO_LBA_MAX
/*-----------------------------------*/
/* LEO FUNCTION DEFINITIONS */
/*-----------------------------------*/
extern void leoInitialize(OSPri PRI_WRK, OSPri PRI_INT, OSMesg *command_que_buf, u32 cmd_buff_size);
extern void leoCommand(void *CDB);
extern void LeoReset(void);
extern s32 LeoResetClear(void);
/*-----------------------------------*/
/* THREAD PRIORITY */
/*-----------------------------------*/
#define LEO_PRIORITY_WRK (OS_PRIORITY_PIMGR-1)
#define LEO_PRIORITY_INT OS_PRIORITY_PIMGR
/*-----------------------------------*/
/* COMMAND CODE */
/*-----------------------------------*/
#define LEO_COMMAND_CLEAR_QUE 0x01
#define LEO_COMMAND_INQUIRY 0x02
#define LEO_COMMAND_TEST_UNIT_READY 0x03
#define LEO_COMMAND_REZERO 0x04
#define LEO_COMMAND_READ 0x05
#define LEO_COMMAND_WRITE 0x06
#define LEO_COMMAND_SEEK 0x07
#define LEO_COMMAND_START_STOP 0x08
#define LEO_COMMAND_READ_CAPACITY 0x09
#define LEO_COMMAND_TRANSLATE 0x0a
#define LEO_COMMAND_MODE_SELECT 0x0b
#define LEO_COMMAND_READ_DISK_ID 0x0c
#define LEO_COMMAND_READ_TIMER 0x0d
#define LEO_COMMAND_SET_TIMER 0x0e
/*-----------------------------------*/
/* CONTROL BIT */
/*-----------------------------------*/
#define LEO_CONTROL_POST 0x80 /* ENABLE POST QUEUE */
#define LEO_CONTROL_START 0x01 /* START COMMAND */
#define LEO_CONTROL_STBY 0x02 /* STAND-BY MODE(NOT SLEEP MODE) */
#define LEO_CONTROL_WRT 0x01 /* READ RE-WRITE-ABLE CAPACITY */
#define LEO_CONTROL_TBL 0x01 /* TRANSLATE BYTE TO LBA */
#define LEO_CONTROL_BRAKE 0x04 /* SLEEP MODE(BRAKE ON) */
/*-----------------------------------*/
/* BIT FIELD PARAMETER */
/*-----------------------------------*/
#define LEO_TEST_UNIT_MR 0x01 /* MEDIUM REMOVED */
#define LEO_TEST_UNIT_RE 0x02 /* HEAD RETRACTED */
#define LEO_TEST_UNIT_SS 0x04 /* SPINDLE STOPPED */
/*-----------------------------------*/
/* STATUS */
/*-----------------------------------*/
#define LEO_STATUS_GOOD 0x00
#define LEO_STATUS_CHECK_CONDITION 0x02
#define LEO_STATUS_BUSY 0x08
/*-----------------------------------*/
/* SENSE CODE */
/*-----------------------------------*/
#define LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION 00
#define LEO_SENSE_DRIVE_NOT_READY 01
#define LEO_SENSE_DIAGNOSTIC_FAILURE 02
#define LEO_SENSE_COMMAND_PHASE_ERROR 03
#define LEO_SENSE_DATA_PHASE_ERROR 04
#define LEO_SENSE_REAL_TIME_CLOCK_FAILURE 05
#define LEO_SENSE_INCOMPATIBLE_MEDIUM_INSTALLED 11
#define LEO_SENSE_UNKNOWN_FORMAT 11
#define LEO_SENSE_NO_SEEK_COMPLETE 21
#define LEO_SENSE_WRITE_FAULT 22
#define LEO_SENSE_UNRECOVERED_READ_ERROR 23
#define LEO_SENSE_NO_REFERENCE_POSITION_FOUND 24
#define LEO_SENSE_TRACK_FOLLOWING_ERROR 25
#define LEO_SENSE_TRACKING_OR_SPDL_SERVO_FAILURE 25
#define LEO_SENSE_INVALID_COMMAND_OPERATION_CODE 31
#define LEO_SENSE_LBA_OUT_OF_RANGE 32
#define LEO_SENSE_WRITE_PROTECT_ERROR 33
#define LEO_SENSE_COMMAND_TERMINATED 34
#define LEO_SENSE_QUEUE_FULL 35
#define LEO_SENSE_ILLEGAL_TIMER_VALUE 36
#define LEO_SENSE_WAITING_NMI 37
#define LEO_SENSE_DEVICE_COMMUNICATION_FAILURE 41
#define LEO_SENSE_MEDIUM_NOT_PRESENT 42
#define LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED 43
#define LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED 47
#define LEO_SENSE_EJECTED_ILLEGALLY_RESUME 49
/*-----------------------------------*/
/* Command Block Header */
/*-----------------------------------*/
typedef struct{
u8 command;
u8 reserve1;
u8 control;
u8 reserve3;
u8 status;
u8 sense;
u8 reserve6;
u8 reserve7;
OSMesgQueue *post;
} LEOCmdHeader;
/*-----------------------------------*/
/* CLEAR QUEUE(01H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
} LEOCmdClearQue;
/*-----------------------------------*/
/* INQUIRY(02H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u8 dev_type;
u8 version;
u8 dev_num;
u8 leo_bios_ver;
u32 reserve5;
} LEOCmdInquiry;
/*-----------------------------------*/
/* TEST UNIT READY(03H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u8 test;
u8 reserve2;
u8 reserve3;
u8 reserve4;
} LEOCmdTestUnitReady;
/*-----------------------------------*/
/* REZERO(04H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
} LEOCmdRezero;
/*-----------------------------------*/
/* READ(05H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u32 lba;
u32 xfer_blks;
void *buff_ptr;
u32 rw_bytes;
} LEOCmdRead;
/*-----------------------------------*/
/* WRITE(06H) command */
/*-----------------------------------*/
typedef LEOCmdRead LEOCmdWrite;
/*-----------------------------------*/
/* SEEK(07H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u32 lba;
} LEOCmdSeek;
/*-----------------------------------*/
/* START/STOP(08H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
} LEOCmdStartStop;
/*-----------------------------------*/
/* READ CAPACITY(09H) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u32 start_lba;
u32 end_lba;
u32 capa_bytes;
} LEOCmdReadCapacity;
/*-----------------------------------*/
/* TRANSLATE(0AH) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u32 start_lba;
u32 in_param;
u32 out_param;
} LEOCmdTranslate;
/*-----------------------------------*/
/* MODE SELECT(0BH) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u8 page_code;
u8 reserve1;
u8 standby_time;
u8 sleep_time;
u8 led_on_time;
u8 led_off_time;
u8 reserve18;
u8 reserve19;
} LEOCmdModeSelect;
/*-----------------------------------*/
/* READ DISK ID(0CH) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
void *buffer_pointer;
} LEOCmdReadDiskId;
/*-----------------------------------*/
/* READ TIMER(0DH) command */
/*-----------------------------------*/
typedef struct {
LEOCmdHeader header;
u8 reserve12;
u8 reserve13;
u8 year;
u8 month;
u8 day;
u8 hour;
u8 minute;
u8 second;
} LEOCmdReadTimer;
/*-----------------------------------*/
/* SET TIMER(0EH) command */
/*-----------------------------------*/
typedef LEOCmdReadTimer LEOCmdSetTimer;
/*-------end of leoappli.h--------------------------*/
+939 -15
View File
@@ -1,12 +1,281 @@
#ifndef _ULTRA64_LIBAUDIO_H_
#define _ULTRA64_LIBAUDIO_H_
/*====================================================================
* 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.
*====================================================================*/
#include "abi.h"
/**************************************************************************
*
* $Revision: 1.173 $
* $Date: 1997/12/01 12:42:21 $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/libaudio.h,v $
*
**************************************************************************/
typedef struct
{
u8 *offset;
s32 len;
#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;
#ifdef VERSION_SH
s8 magic[2]; // tbl: 0x0204, otherwise: 0x0203
@@ -29,20 +298,675 @@ typedef struct
#endif
} ALSeqData;
typedef struct
{
#ifndef VERSION_SH
s16 revision;
#endif
s16 seqCount;
typedef struct { /* Note: sizeof won't be correct */
s16 revision; /* format revision of this file */
s16 seqCount; /* number of sequences */
#ifdef VERSION_SH
s16 unk2;
u8 *data;
s32 pad[2];
#endif
ALSeqData seqArray[1];
ALSeqData seqArray[1]; /* ARRAY of sequence info */
} ALSeqFile;
void alSeqFileNew(ALSeqFile *f, u8 *base);
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__ */
-18
View File
@@ -1,18 +0,0 @@
#ifndef _LIBULTRA_H
#define _LIBULTRA_H
#define TV_TYPE_NTSC 1
#define TV_TYPE_PAL 0
#define TV_TYPE_MPAL 2
#define RESET_TYPE_COLD_RESET 0
#define RESET_TYPE_NMI 1
#define RESET_TYPE_BOOT_DISK 2
extern u32 osTvType;
extern u32 osRomBase;
extern u32 osResetType;
extern u32 osMemSize;
extern u8 osAppNmiBuffer[64];
#endif /* _LIBULTRA_H */
+1 -3
View File
@@ -1,8 +1,6 @@
#ifndef _MBI_H_
#define _MBI_H_
#include "platform_info.h"
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
@@ -19,7 +17,7 @@
*
* $Revision: 1.136 $
* $Date: 1999/01/05 13:04:00 $
* $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $
*
**************************************************************************/
+352
View File
@@ -0,0 +1,352 @@
/*====================================================================
*
* 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 {
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 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);
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_alCSPSetTempo(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__ */
+120
View File
@@ -0,0 +1,120 @@
#define ALVoice N_ALVoice
#define ALSynth N_ALSynth
#define ALGlobals N_ALGlobals
#define 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 alSynStartVoiceParams( a, b, c, d, e, f, g, h) \
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 alCSPSetTempo n_alCSPSetTempo
#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
+108
View File
@@ -0,0 +1,108 @@
/*====================================================================
* os.h
*
* Copyright 1995, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
* Inc.; the contents of this file may not be disclosed to third
* parties, copied or duplicated in any form, in whole or in part,
* without the prior written permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS
* 252.227-7013, and/or in similar or successor clauses in the FAR,
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
* Copyright Laws of the United States.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os.h,v $
$Revision: 1.168 $
$Date: 2000/06/15 06:24:52 $
*---------------------------------------------------------------------*/
#ifndef _OS_H_
#define _OS_H_
#include <PR/os_thread.h>
#include <PR/os_message.h>
#include <PR/os_exception.h>
#include <PR/os_tlb.h>
#include <PR/os_pi.h>
#include <PR/os_vi.h>
#include <PR/os_ai.h>
#include <PR/os_si.h>
#include <PR/os_time.h>
#include <PR/os_cont.h>
#include <PR/os_pfs.h>
#include <PR/os_gbpak.h>
#include <PR/os_voice.h>
#include <PR/os_cache.h>
#include <PR/os_debug.h>
#include <PR/os_error.h>
#include <PR/os_gio.h>
#include <PR/os_reg.h>
#include <PR/os_system.h>
#include <PR/os_eeprom.h>
#include <PR/os_flash.h>
#include <PR/os_host.h>
#include <PR/os_convert.h>
#include <PR/os_rdp.h>
#include <PR/os_rsp.h>
#include <PR/os_motor.h>
#include <PR/os_libc.h>
#include <PR/os_version.h>
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
/**************************************************************************
*
* Global definitions
*
*/
/*
* Stack size for I/O device managers: PIM (PI Manager), VIM (VI Manager),
* SIM (SI Manager)
*
*/
#define OS_PIM_STACKSIZE 4096
#define OS_VIM_STACKSIZE 4096
#define OS_SIM_STACKSIZE 4096
#define OS_MIN_STACKSIZE 72
/*
* Leo Disk
*/
/* transfer mode */
#define LEO_BLOCK_MODE 1
#define LEO_TRACK_MODE 2
#define LEO_SECTOR_MODE 3
/*
* Boot addresses
*/
#define BOOT_ADDRESS_ULTRA 0x80000400
#define BOOT_ADDRESS_COSIM 0x80002000
#define BOOT_ADDRESS_EMU 0x20010000
#define BOOT_ADDRESS_INDY 0x88100000
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_H */
+3 -3
View File
@@ -81,9 +81,9 @@ extern "C" {
/* Cache operations and macros */
extern void osInvalDCache(void *, size_t);
extern void osInvalICache(void *, size_t);
extern void osWritebackDCache(void *, size_t);
extern void osInvalDCache(void *, s32);
extern void osInvalICache(void *, s32);
extern void osWritebackDCache(void *, s32);
extern void osWritebackDCacheAll(void);
+4 -4
View File
@@ -53,22 +53,22 @@ extern "C" {
typedef struct {
u16 type; /* Controller Type */
u8 status; /* Controller status */
u8 errnum;
u8 error;
}OSContStatus;
typedef struct {
u16 button;
s8 stick_x; /* -80 <= stick_x <= 80 */
s8 stick_y; /* -80 <= stick_y <= 80 */
u8 errnum;
u8 error;
} OSContPad;
typedef struct {
void *address; /* Ram pad Address: 11 bits */
u8 databuffer[32]; /* address of the data buffer */
u8 addressCrc; /* CRC code for address */
u8 addressCrc; /* CRC code for address */
u8 dataCrc; /* CRC code for data */
u8 errnum;
u8 error;
} OSContRamIo;
+111
View File
@@ -0,0 +1,111 @@
/*====================================================================
* os_convert.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_convert.h,v $
$Revision: 1.2 $
$Date: 1999/04/21 02:53:11 $
*---------------------------------------------------------------------*/
#ifndef _OS_CONVERT_H_
#define _OS_CONVERT_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
/* OS_K?_TO_PHYSICAL macro bug fix for CodeWarrior */
#ifndef __MWERKS__
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
#else
#define OS_K0_TO_PHYSICAL(x) ((char *)(x)-0x80000000)
#define OS_K1_TO_PHYSICAL(x) ((char *)(x)-0xa0000000)
#endif
#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000))
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Address translation routines and macros */
extern u32 osVirtualToPhysical(void *);
extern void * osPhysicalToVirtual(u32);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_CONVERT_H_ */
+118
View File
@@ -0,0 +1,118 @@
/*====================================================================
* os_debug.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_debug.h,v $
$Revision: 1.4 $
$Date: 1999/06/30 03:04:08 $
*---------------------------------------------------------------------*/
#ifndef _OS_DEBUG_H_
#define _OS_DEBUG_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
/*
* Structure for Profiler
*/
typedef struct {
u16 *histo_base; /* histogram base */
u32 histo_size; /* histogram size */
u32 *text_start; /* start of text segment */
u32 *text_end; /* end of text segment */
} OSProf;
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/*
* Profiler constants
*/
#define PROF_MIN_INTERVAL 50 /* microseconds */
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Profiler Interface */
extern void osProfileInit(OSProf *, u32 profcnt);
extern void osProfileStart(u32);
extern void osProfileFlush(void);
extern void osProfileStop(void);
/* Thread Profiler Interface */
extern void osThreadProfileClear(OSId);
extern void osThreadProfileInit(void);
extern void osThreadProfileStart(void);
extern void osThreadProfileStop(void);
extern u32 osThreadProfileReadCount(OSId);
extern u32 osThreadProfileReadCountTh(OSThread*);
extern OSTime osThreadProfileReadTime(OSId);
extern OSTime osThreadProfileReadTimeTh(OSThread*);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_DEBUG_H_ */
+86
View File
@@ -0,0 +1,86 @@
/*====================================================================
* os_error.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_error.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:06 $
*---------------------------------------------------------------------*/
#ifndef _OS_ERROR_H_
#define _OS_ERROR_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_ERROR_H_ */
+71
View File
@@ -0,0 +1,71 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: os_flash.h,v $
$Revision: 1.1 $
$Date: 2000/06/15 06:24:55 $
*---------------------------------------------------------------------*/
#ifndef _OS_FLASH_H_
#define _OS_FLASH_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/*
* defines for FLASH
*/
#define FLASH_START_ADDR 0x08000000
#define FLASH_SIZE 0x20000
#define FLASH_LATENCY 0x5
#define FLASH_PULSE 0x0c
#define FLASH_PAGE_SIZE 0xf
#define FLASH_REL_DURATION 0x2
#define DEVICE_TYPE_FLASH 8
#define FLASH_VERSION_MX_PROTO_A 0x00c20000
#define FLASH_VERSION_MX_A 0x00c20001
#define FLASH_VERSION_MX_C 0x00c2001e
#define FLASH_VERSION_MX_B_AND_D 0x00c2001d
#define FLASH_VERSION_MEI 0x003200f1
#define OLD_FLASH 0
#define NEW_FLASH 1
/* OLD_FLASH is MX_PROTO_A, MX_A and MX_C */
/* NEW_FLASH is MX_B_AND_D and MATSUSHITA flash */
#define FLASH_STATUS_ERASE_BUSY 2
#define FLASH_STATUS_ERASE_ERROR -1
#define FLASH_STATUS_ERASE_OK 0
extern OSPiHandle *osFlashReInit(u8 latency, u8 pulse,
u8 page_size, u8 rel_duration, u32 start);
extern OSPiHandle *osFlashInit(void);
extern void osFlashReadStatus(u8 *flash_status);
extern void osFlashReadId(u32 *flash_type, u32 *flash_maker);
extern void osFlashClearStatus(void);
extern s32 osFlashAllErase(void);
extern s32 osFlashSectorErase(u32 page_num);
extern s32 osFlashWriteBuffer(OSIoMesg *mb, s32 priority,
void *dramAddr, OSMesgQueue *mq);
extern s32 osFlashWriteArray(u32 page_num);
extern s32 osFlashReadArray(OSIoMesg *mb, s32 priority, u32 page_num,
void *dramAddr, u32 n_pages, OSMesgQueue *mq);
extern void osFlashChange(u32 flash_num);
extern void osFlashAllEraseThrough(void);
extern void osFlashSectorEraseThrough(u32 page_num);
extern s32 osFlashCheckEraseEnd(void);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_FLASH_H_ */
+107
View File
@@ -0,0 +1,107 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: os_gbpak.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:07 $
*---------------------------------------------------------------------*/
#ifndef _OS_GBPAK_H_
#define _OS_GBPAK_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include "os_message.h"
#include "os_pfs.h"
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
typedef struct {
u16 fixed1;
u16 start_address;
u8 nintendo_chr[0x30];
u8 game_title[16];
u16 company_code;
u8 body_code;
u8 cart_type;
u8 rom_size;
u8 ram_size;
u8 country_code;
u8 fixed2;
u8 version;
u8 isum;
u16 sum;
} OSGbpakId;
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/* definition for 64GB-PAK */
#define OS_GBPAK_POWER 0x01
#define OS_GBPAK_RSTB_DETECTION 0x04
#define OS_GBPAK_RSTB_STATUS 0x08
#define OS_GBPAK_GBCART_PULL 0x40
#define OS_GBPAK_GBCART_ON 0x80
#define OS_GBPAK_POWER_OFF 0x00 /* power of 64GB-PAK */
#define OS_GBPAK_POWER_ON 0x01
#define OS_GBPAK_ROM_ID_SIZE 0x50 /* ID size of GB cartridge */
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* 64GB-PAK */
extern s32 osGbpakInit(OSMesgQueue *, OSPfs *, int);
extern s32 osGbpakPower(OSPfs *, s32);
extern s32 osGbpakGetStatus(OSPfs *, u8 *);
extern s32 osGbpakReadWrite(OSPfs *, u16, u16, u8 *, u16);
extern s32 osGbpakReadId(OSPfs *, OSGbpakId *, u8 *);
extern s32 osGbpakCheckConnector(OSPfs *, u8 *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_GBPAK_H_ */
+86
View File
@@ -0,0 +1,86 @@
/*====================================================================
* os_gio.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_gio.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:08 $
*---------------------------------------------------------------------*/
#ifndef _OS_GIO_H_
#define _OS_GIO_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_GIO_H_ */
+161
View File
@@ -0,0 +1,161 @@
/*====================================================================
* os_host.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_host.h,v $
$Revision: 1.3 $
$Date: 1999/06/24 09:23:06 $
*---------------------------------------------------------------------*/
#ifndef _OS_HOST_H_
#define _OS_HOST_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
extern void __osInitialize_common(void);
#if defined(_FINALROM)
#define osInitialize() __osInitialize_common()
#else
/* PARTNER-N64 */
#if defined(PTN64)
extern void __osInitialize_kmc(void);
#define osReadHost osReadHost_pt
#define osWriteHost osWriteHost_pt
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_kmc(); \
}
/* MONEGI SMART PACK A */
#elif defined(MWN64)
extern void __osInitialize_msp(void);
#define osReadHost osReadHost_pt
#define osWriteHost osWriteHost_pt
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_msp(); \
}
/* IS-Viewer(for Debugger) */
#elif defined(ISV64)
extern void __osInitialize_isv(void);
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_isv(); \
}
/* Emulation board for INDY */
#elif defined(EMU64)
extern void __osInitialize_emu(void);
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_emu(); \
}
#else
/* Default (auto detect) */
extern void __osInitialize_autodetect(void);
extern void __osInitialize_msp(void);
extern void __osInitialize_kmc(void);
extern void __osInitialize_isv(void);
extern void __osInitialize_emu(void);
#define osInitialize() \
{ \
__osInitialize_common(); \
__osInitialize_autodetect(); \
}
#endif
#endif /* _FINAL_ROM */
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Game <> Host data transfer functions */
extern s32 osTestHost(void);
extern void osReadHost(void *, u32);
extern void osWriteHost(void *, u32);
extern void osAckRamromRead(void);
extern void osAckRamromWrite(void);
/* RDB port operations */
extern void osInitRdb(u8 *sendBuf, u32 sendSize);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_HOST_H_ */
+45 -15
View File
@@ -1,19 +1,49 @@
#ifndef _ULTRA64_OS_INTERNAL_H_
#define _ULTRA64_OS_INTERNAL_H_
#include "PR/os_message.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. *
* *
**************************************************************************/
/* Internal functions used by the operating system */
/* Do not include this header in application code */
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal.h,v $
$Revision: 1.20 $
$Date: 1998/10/09 08:01:09 $
*---------------------------------------------------------------------*/
/* Variables */
//extern u64 osClockRate;
/* Functions */
/*u32 __osProbeTLB(void *);
u32 __osDisableInt(void);
void __osRestoreInt(u32);*/
OSThread *__osGetCurrFaultedThread(void);
#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)
#include "os_internal_reg.h"
#include "os_internal_exception.h"
#include "os_internal_tlb.h"
#include "os_internal_si.h"
#include "os_internal_rsp.h"
#include "os_internal_error.h"
#include "os_internal_gio.h"
#include "os_internal_thread.h"
#include "os_internal_debug.h"
#include "os_internal_host.h"
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_H */
+43
View File
@@ -0,0 +1,43 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_debug.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:09 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_DEBUG_H_
#define _OS_INTERNAL_DEBUG_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Debug port */
extern void __osSyncPutChars(int, int, const char *);
extern int __osAtomicDec(unsigned int *p);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_DEBUG_H */
+45
View File
@@ -0,0 +1,45 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_error.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:10 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_ERROR_H_
#define _OS_INTERNAL_ERROR_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Error handling */
extern void __osError(s16, s16, ...);
extern OSThread * __osGetCurrFaultedThread(void);
extern OSThread * __osGetNextFaultedThread(OSThread *);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_ERROR_H */
+49
View File
@@ -0,0 +1,49 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_exception.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:10 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_EXCEPTION_H_
#define _OS_INTERNAL_EXCEPTION_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Routine for HW interrupt "handler" */
extern void __osSetHWIntrRoutine(OSHWIntr interrupt,
s32 (*handler)(void), void *stackEnd);
extern void __osGetHWIntrRoutine(OSHWIntr interrupt,
s32 (**handler)(void), void **stackEnd);
/* Routine for global interrupt mask */
extern void __osSetGlobalIntMask(OSHWIntr);
extern void __osResetGlobalIntMask(OSHWIntr);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_EXCEPTION_H */
+45
View File
@@ -0,0 +1,45 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_gio.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:11 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_GIO_H_
#define _OS_INTERNAL_GIO_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Development board functions */
extern void __osGIOInit(s32);
extern void __osGIOInterrupt(s32);
extern void __osGIORawInterrupt(s32);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_GIO_H */
+42
View File
@@ -0,0 +1,42 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_host.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:11 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_HOST_H_
#define _OS_INTERNAL_HOST_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* 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_HOST_H */
+59
View File
@@ -0,0 +1,59 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_reg.h,v $
$Revision: 1.2 $
$Date: 1999/03/10 12:19:14 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_REG_H_
#define _OS_INTERNAL_REG_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);
extern u32 __osGetWatchLo(void);
extern void __osSetWatchLo(u32);
/* Routines to get/set floating-point control and status register */
extern u32 __osSetFpcCsr(u32);
extern u32 __osGetFpcCsr(void);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_REG_H */
+48
View File
@@ -0,0 +1,48 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_rsp.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:12 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_RSP_H_
#define _OS_INTERNAL_RSP_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Signal processor interface (Sp) */
extern u32 __osSpGetStatus(void);
extern void __osSpSetStatus(u32);
extern s32 __osSpSetPc(u32);
extern s32 __osSpRawWriteIo(u32, u32);
extern s32 __osSpRawReadIo(u32, u32 *);
extern s32 __osSpRawStartDma(s32, u32, void *, u32);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_RSP_H */
+46
View File
@@ -0,0 +1,46 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_si.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:13 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_SI_H_
#define _OS_INTERNAL_SI_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Serial interface (Si) */
extern u32 __osSiGetStatus(void);
extern s32 __osSiRawWriteIo(u32, u32);
extern s32 __osSiRawReadIo(u32, u32 *);
extern s32 __osSiRawStartDma(s32, void *);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_SI_H */
+43
View File
@@ -0,0 +1,43 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_thread.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:13 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_THREAD_H_
#define _OS_INTERNAL_THREAD_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* For debugger use */
extern OSThread * __osGetActiveQueue(void);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_THREAD_H */
+47
View File
@@ -0,0 +1,47 @@
/**************************************************************************
* *
* 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. *
* *
**************************************************************************/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_internal_tlb.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:14 $
*---------------------------------------------------------------------*/
#ifndef _OS_INTERNAL_TLB_H_
#define _OS_INTERNAL_TLB_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/os.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* 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);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_INTERNAL_TLB_H */
+95 -5
View File
@@ -1,10 +1,100 @@
/*====================================================================
* os_libc.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_libc.h,v $
$Revision: 1.3 $
$Date: 1999/07/13 01:43:47 $
*---------------------------------------------------------------------*/
#ifndef _OS_LIBC_H_
#define _OS_LIBC_H_
#define _OS_LIBC_H_
#include "ultratypes.h"
#include "os_pfs.h"
// Old deprecated functions from strings.h, replaced by memcpy/memset.
extern void bcopy(const void *, void *, size_t);
extern void bzero(void *, size_t);
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* byte string operations */
#ifdef TARGET_N64
extern void bcopy(const void *, void *, int);
extern int bcmp(const void *, const void *, int);
extern void bzero(void *, int);
#endif
/* Printf */
extern int sprintf(char *s, const char *fmt, ...);
extern void osSyncPrintf(const char *fmt, ...);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_LIBC_H_ */
-1
View File
@@ -35,7 +35,6 @@ extern "C" {
#endif
#include <PR/ultratypes.h>
#include <PR/os_thread.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
-11
View File
@@ -1,11 +0,0 @@
#ifndef _ULTRA64_OS_MISC_H_
#define _ULTRA64_OS_MISC_H_
#include <PR/ultratypes.h>
/* Miscellaneous OS functions */
void osInitialize(void);
u32 osGetCount(void);
uintptr_t osVirtualToPhysical(void *);
#endif
+83
View File
@@ -0,0 +1,83 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: os_motor.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:15 $
*---------------------------------------------------------------------*/
#ifndef _OS_MOTOR_H_
#define _OS_MOTOR_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include "os_message.h"
#include "os_pfs.h"
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Rumble PAK interface */
extern s32 osMotorInit(OSMesgQueue *, OSPfs *, int);
#if 1
#define MOTOR_START 1
#define MOTOR_STOP 0
#define osMotorStart(x) __osMotorAccess((x), MOTOR_START)
#define osMotorStop(x) __osMotorAccess((x), MOTOR_STOP)
extern s32 __osMotorAccess(OSPfs *, s32);
#else
extern s32 osMotorStop(OSPfs *);
extern s32 osMotorStart(OSPfs *);
#endif
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_MOTOR_H_ */
+174
View File
@@ -0,0 +1,174 @@
/*====================================================================
* os_pfs.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_pfs.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:16 $
*---------------------------------------------------------------------*/
#ifndef _OS_PFS_H_
#define _OS_PFS_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include "os_message.h"
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
/*
* Structure for file system
*/
typedef struct {
int status;
OSMesgQueue *queue;
int channel;
u8 id[32];
u8 label[32];
int version;
int dir_size;
int inode_table; /* block location */
int minode_table; /* mirrioring inode_table */
int dir_table; /* block location */
int inode_start_page; /* page # */
u8 banks;
u8 activebank;
} OSPfs;
typedef struct {
u32 file_size; /* bytes */
u32 game_code;
u16 company_code;
char ext_name[4];
char game_name[16];
} OSPfsState;
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/* File System size */
#define OS_PFS_VERSION 0x0200
#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8)
#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255)
#define PFS_FILE_NAME_LEN 16
#define PFS_FILE_EXT_LEN 4
#define BLOCKSIZE 32 /* bytes */
#define PFS_ONE_PAGE 8 /* blocks */
#define PFS_MAX_BANKS 62
/* File System flag */
#define PFS_READ 0
#define PFS_WRITE 1
#define PFS_CREATE 2
/* File System status */
#define PFS_INITIALIZED 0x1
#define PFS_CORRUPTED 0x2 /* File system was corrupted */
#define PFS_ID_BROKEN 0x4
#define PFS_MOTOR_INITIALIZED 0x8
#define PFS_GBPAK_INITIALIZED 0x10
/* File System error number */
#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */
#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a */
/* different one */
#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker */
#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR
#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/
#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/
#define PFS_DATA_FULL 7 /* no free pages on ram pack */
#define PFS_DIR_FULL 8 /* no free directories on ram pack*/
#define PFS_ERR_EXIST 9 /* file exists */
#define PFS_ERR_ID_FATAL 10 /* dead ram pack */
#define PFS_ERR_DEVICE 11 /* wrong device type*/
#define PFS_ERR_NO_GBCART 12 /* no gb cartridge (64GB-PAK) */
#define PFS_ERR_NEW_GBCART 13 /* gb cartridge may be changed */
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* file system interface */
extern s32 osPfsInitPak(OSMesgQueue *, OSPfs *, int);
extern s32 osPfsRepairId(OSPfs *);
extern s32 osPfsInit(OSMesgQueue *, OSPfs *, int);
extern s32 osPfsReFormat(OSPfs *, OSMesgQueue *, int);
extern s32 osPfsChecker(OSPfs *);
extern s32 osPfsAllocateFile(OSPfs *, u16, u32, u8 *, u8 *, int, s32 *);
extern s32 osPfsFindFile(OSPfs *, u16, u32, u8 *, u8 *, s32 *);
extern s32 osPfsDeleteFile(OSPfs *, u16, u32, u8 *, u8 *);
extern s32 osPfsReadWriteFile(OSPfs *, s32, u8, int, int, u8 *);
extern s32 osPfsFileState(OSPfs *, s32, OSPfsState *);
extern s32 osPfsGetLabel(OSPfs *, u8 *, int *);
extern s32 osPfsSetLabel(OSPfs *, u8 *);
extern s32 osPfsIsPlug(OSMesgQueue *, u8 *);
extern s32 osPfsFreeBlocks(OSPfs *, s32 *);
extern s32 osPfsNumFiles(OSPfs *, s32 *, s32 *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_PFS_H_ */
+197 -61
View File
@@ -1,88 +1,224 @@
#ifndef _ULTRA64_PI_H_
#define _ULTRA64_PI_H_
#include <ultra64.h>
/* Ultra64 Parallel Interface */
/*====================================================================
* os_pi.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.
*====================================================================*/
/* Types */
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_pi.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:16 $
*---------------------------------------------------------------------*/
#ifndef _OS_PI_H_
#define _OS_PI_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include "os_thread.h"
#include "os_message.h"
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
/*
* Structure for Enhanced PI interface
*/
/*
* OSTranxInfo is set up for Leo Disk DMA. This info will be maintained
* by exception handler. This is how the PIMGR and the ISR communicate.
*/
typedef struct {
#if !defined(VERSION_EU)
u32 errStatus;
#endif
void *dramAddr;
void *C2Addr;
u32 sectorSize;
u32 C1ErrNum;
u32 C1ErrSector[4];
u32 errStatus; /* error status */
void *dramAddr; /* RDRAM buffer address (DMA) */
void *C2Addr; /* C2 buffer address */
u32 sectorSize; /* size of transfering sector */
u32 C1ErrNum; /* total # of C1 errors */
u32 C1ErrSector[4]; /* error sectors */
} __OSBlockInfo;
typedef struct {
u32 cmdType; // 0
u16 transferMode; // 4
u16 blockNum; // 6
s32 sectorNum; // 8
uintptr_t devAddr; // c
#if defined(VERSION_EU)
u32 errStatus; //error status added moved to blockinfo
#endif
u32 bmCtlShadow; // 10
u32 seqCtlShadow; // 14
__OSBlockInfo block[2]; // 18
u32 cmdType; /* for disk only */
u16 transferMode; /* Block, Track, or sector? */
u16 blockNum; /* which block is transfering */
s32 sectorNum; /* which sector is transfering */
u32 devAddr; /* Device buffer address */
u32 bmCtlShadow; /* asic bm_ctl(510) register shadow ram */
u32 seqCtlShadow; /* asic seq_ctl(518) register shadow ram */
__OSBlockInfo block[2]; /* bolck transfer info */
} __OSTranxInfo;
typedef struct OSPiHandle_s {
struct OSPiHandle_s *next;
u8 type;
u8 latency;
u8 pageSize;
u8 relDuration;
u8 pulse;
u8 domain;
u32 baseAddress;
u32 speed;
__OSTranxInfo transferInfo;
struct OSPiHandle_s *next; /* point to next handle on the table */
u8 type; /* DEVICE_TYPE_BULK for disk */
u8 latency; /* domain latency */
u8 pageSize; /* domain page size */
u8 relDuration; /* domain release duration */
u8 pulse; /* domain pulse width */
u8 domain; /* which domain */
u32 baseAddress; /* Domain address */
u32 speed; /* for roms only */
/* The following are "private" elements" */
__OSTranxInfo transferInfo; /* for disk only */
} OSPiHandle;
typedef struct {
u8 type;
uintptr_t address;
u8 type;
u32 address;
} OSPiInfo;
/*
* Structure for I/O message block
*/
typedef struct {
u16 type;
u8 pri;
u8 status;
OSMesgQueue *retQueue;
u16 type; /* Message type */
u8 pri; /* Message priority (High or Normal) */
u8 status; /* Return status */
OSMesgQueue *retQueue; /* Return message queue to notify I/O
* completion */
} OSIoMesgHdr;
typedef struct {
/*0x00*/ OSIoMesgHdr hdr;
/*0x08*/ void *dramAddr;
/*0x0C*/ uintptr_t devAddr;
/*0x10*/ size_t size;
#if defined(VERSION_EU) || defined(VERSION_SH)
OSPiHandle *piHandle; // from the official definition
#endif
OSIoMesgHdr hdr; /* Message header */
void * dramAddr; /* RDRAM buffer address (DMA) */
u32 devAddr; /* Device buffer address (DMA) */
u32 size; /* DMA transfer size in bytes */
OSPiHandle *piHandle; /* PI device handle */
} OSIoMesg;
/* Definitions */
/*
* Structure for device manager block
*/
typedef struct {
s32 active; /* Status flag */
OSThread *thread; /* Calling thread */
OSMesgQueue *cmdQueue; /* Command queue */
OSMesgQueue *evtQueue; /* Event queue */
OSMesgQueue *acsQueue; /* Access queue */
/* Raw DMA routine */
s32 (*dma)(s32, u32, void *, u32);
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
} OSDevMgr;
#define OS_READ 0 // device -> RDRAM
#define OS_WRITE 1 // device <- RDRAM
#define OS_MESG_PRI_NORMAL 0
#define OS_MESG_PRI_HIGH 1
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/* Functions */
/**************************************************************************
*
* Global definitions
*
*/
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr,
size_t nbytes, OSMesgQueue *mq);
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
OSMesgQueue *osPiGetCmdQueue(void);
s32 osPiWriteIo(uintptr_t devAddr, u32 data);
s32 osPiReadIo(uintptr_t devAddr, u32 *data);
/* Flags to indicate direction of data transfer */
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size);
#define OS_READ 0 /* device -> RDRAM */
#define OS_WRITE 1 /* device <- RDRAM */
#define OS_OTHERS 2 /* for Leo disk only */
/*
* I/O message types
*/
#define OS_MESG_TYPE_BASE (10)
#define OS_MESG_TYPE_LOOPBACK (OS_MESG_TYPE_BASE+0)
#define OS_MESG_TYPE_DMAREAD (OS_MESG_TYPE_BASE+1)
#define OS_MESG_TYPE_DMAWRITE (OS_MESG_TYPE_BASE+2)
#define OS_MESG_TYPE_VRETRACE (OS_MESG_TYPE_BASE+3)
#define OS_MESG_TYPE_COUNTER (OS_MESG_TYPE_BASE+4)
#define OS_MESG_TYPE_EDMAREAD (OS_MESG_TYPE_BASE+5)
#define OS_MESG_TYPE_EDMAWRITE (OS_MESG_TYPE_BASE+6)
/*
* I/O message priority
*/
#define OS_MESG_PRI_NORMAL 0
#define OS_MESG_PRI_HIGH 1
/*
* PI/EPI
*/
#define PI_DOMAIN1 0
#define PI_DOMAIN2 1
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */
/**************************************************************************
*
* Function prototypes
*
*/
/* Peripheral interface (Pi) */
extern u32 osPiGetStatus(void);
extern s32 osPiGetDeviceType(void);
extern s32 osPiWriteIo(u32, u32);
extern s32 osPiReadIo(u32, u32 *);
extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32,
OSMesgQueue *);
extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32);
/* Enhanced PI interface */
extern OSPiHandle *osCartRomInit(void);
extern OSPiHandle *osLeoDiskInit(void);
extern OSPiHandle *osDriveRomInit(void);
extern s32 osEPiDeviceType(OSPiHandle *, OSPiInfo *);
extern s32 osEPiWriteIo(OSPiHandle *, u32 , u32 );
extern s32 osEPiReadIo(OSPiHandle *, u32 , u32 *);
extern s32 osEPiStartDma(OSPiHandle *, OSIoMesg *, s32);
extern s32 osEPiLinkHandle(OSPiHandle *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_PI_H_ */
+90
View File
@@ -0,0 +1,90 @@
/*====================================================================
* os_reg.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_reg.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:17 $
*---------------------------------------------------------------------*/
#ifndef _OS_REG_H_
#define _OS_REG_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Miscellaneous operations */
extern u32 osGetCount(void);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_REG_H_ */
+86
View File
@@ -0,0 +1,86 @@
/*====================================================================
* os_rsp.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_rsp.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:17 $
*---------------------------------------------------------------------*/
#ifndef _OS_RSP_H_
#define _OS_RSP_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_RSP_H_ */
+86
View File
@@ -0,0 +1,86 @@
/*====================================================================
* os_si.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_si.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:18 $
*---------------------------------------------------------------------*/
#ifndef _OS_SI_H_
#define _OS_SI_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_SI_H_ */
+118
View File
@@ -0,0 +1,118 @@
/*====================================================================
* os_system.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_system.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:18 $
*---------------------------------------------------------------------*/
#ifndef _OS_SYSTEM_H_
#define _OS_SYSTEM_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/*
* Values for osTvType
*/
#define OS_TV_PAL 0
#define OS_TV_NTSC 1
#define OS_TV_MPAL 2
/*
* Size of buffer the retains contents after NMI
*/
#define OS_APP_NMI_BUFSIZE 64
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */
extern void *osRomBase; /* Rom base address of the game image */
extern s32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */
extern s32 osResetType; /* 0 = cold reset, 1 = NMI */
extern s32 osCicId;
extern s32 osVersion;
extern u32 osMemSize; /* Memory Size */
extern s32 osAppNMIBuffer[];
extern u64 osClockRate;
extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */
/**************************************************************************
*
* Function prototypes
*
*/
extern void osInitialize(void);
extern void osExit(void);
extern u32 osGetMemSize(void);
/* pre-NMI */
extern s32 osAfterPreNMI(void);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_SYSTEM_H_ */
+136 -57
View File
@@ -1,75 +1,154 @@
#ifndef _ULTRA64_THREAD_H_
#define _ULTRA64_THREAD_H_
#include "ultratypes.h"
/* Recommended priorities for system threads */
#define OS_PRIORITY_MAX 255
#define OS_PRIORITY_VIMGR 254
#define OS_PRIORITY_RMON 250
#define OS_PRIORITY_RMONSPIN 200
#define OS_PRIORITY_PIMGR 150
#define OS_PRIORITY_SIMGR 140
#define OS_PRIORITY_APPMAX 127
#define OS_PRIORITY_IDLE 0
#define OS_STATE_STOPPED 1
#define OS_STATE_RUNNABLE 2
#define OS_STATE_RUNNING 4
#define OS_STATE_WAITING 8
/*====================================================================
* os_thread.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.
*====================================================================*/
/* Types */
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_thread.h,v $
$Revision: 1.3 $
$Date: 1999/06/15 12:39:40 $
*---------------------------------------------------------------------*/
typedef s32 OSPri;
typedef s32 OSId;
#ifndef _OS_THREAD_H_
#define _OS_THREAD_H_
typedef union
{
struct {f32 f_odd; f32 f_even;} f;
} __OSfp;
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
typedef struct
{
/* registers */
/*0x20*/ u64 at, v0, v1, a0, a1, a2, a3;
/*0x58*/ u64 t0, t1, t2, t3, t4, t5, t6, t7;
/*0x98*/ u64 s0, s1, s2, s3, s4, s5, s6, s7;
/*0xD8*/ u64 t8, t9, gp, sp, s8, ra;
/*0x108*/ u64 lo, hi;
/*0x118*/ u32 sr, pc, cause, badvaddr, rcp;
/*0x12C*/ u32 fpcsr;
__OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14;
__OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30;
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
typedef s32 OSPri;
typedef s32 OSId;
typedef union { struct { f32 f_odd; f32 f_even; } f; f64 d; } __OSfp;
typedef struct {
u64 at, v0, v1, a0, a1, a2, a3;
u64 t0, t1, t2, t3, t4, t5, t6, t7;
u64 s0, s1, s2, s3, s4, s5, s6, s7;
u64 t8, t9, gp, sp, s8, ra;
u64 lo, hi;
u32 sr, pc, cause, badvaddr, rcp;
u32 fpcsr;
__OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14;
__OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30;
} __OSThreadContext;
typedef struct
{
typedef struct {
u32 flag;
u32 count;
u64 time;
} __OSThreadprofile_s;
typedef struct OSThread_s
{
/*0x00*/ struct OSThread_s *next;
/*0x04*/ OSPri priority;
/*0x08*/ struct OSThread_s **queue;
/*0x0C*/ struct OSThread_s *tlnext;
/*0x10*/ u16 state;
/*0x12*/ u16 flags;
/*0x14*/ OSId id;
/*0x18*/ int fp;
/*0x1C*/ __OSThreadprofile_s *thprof;
/*0x20*/ __OSThreadContext context;
typedef struct OSThread_s {
struct OSThread_s *next; /* run/mesg queue link */
OSPri priority; /* run/mesg queue priority */
struct OSThread_s **queue; /* queue thread is on */
struct OSThread_s *tlnext; /* all threads queue link */
u16 state; /* OS_STATE_* */
u16 flags; /* flags for rmon */
OSId id; /* id for debugging */
int fp; /* thread has used fp unit */
__OSThreadprofile_s *thprof; /* workarea for thread profiler */
__OSThreadContext context; /* register/interrupt mask */
} OSThread;
/* Functions */
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *),
void *arg, void *sp, OSPri pri);
OSId osGetThreadId(OSThread *thread);
OSPri osGetThreadPri(OSThread *thread);
void osSetThreadPri(OSThread *thread, OSPri pri);
void osStartThread(OSThread *thread);
void osStopThread(OSThread *thread);
/**************************************************************************
*
* Global definitions
*
*/
/* Thread states */
#define OS_STATE_STOPPED 1
#define OS_STATE_RUNNABLE 2
#define OS_STATE_RUNNING 4
#define OS_STATE_WAITING 8
/* Recommended thread priorities for the system threads */
#define OS_PRIORITY_MAX 255
#define OS_PRIORITY_VIMGR 254
#define OS_PRIORITY_RMON 250
#define OS_PRIORITY_RMONSPIN 200
#define OS_PRIORITY_PIMGR 150
#define OS_PRIORITY_SIMGR 140
#define OS_PRIORITY_APPMAX 127
#define OS_PRIORITY_IDLE 0 /* Must be 0 */
/* for thread profiler */
#define THPROF_IDMAX 64
#define THPROF_STACKSIZE 256
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Thread operations */
extern void osCreateThread(OSThread *, OSId, void (*)(void *),
void *, void *, OSPri);
extern void osDestroyThread(OSThread *);
extern void osYieldThread(void);
extern void osStartThread(OSThread *);
extern void osStopThread(OSThread *);
extern OSId osGetThreadId(OSThread *);
extern void osSetThreadPri(OSThread *, OSPri);
extern OSPri osGetThreadPri(OSThread *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_THREAD_H_ */
+104 -17
View File
@@ -1,27 +1,114 @@
#ifndef _ULTRA64_TIME_H_
#define _ULTRA64_TIME_H_
/*====================================================================
* os_time.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_time.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:19 $
*---------------------------------------------------------------------*/
#ifndef _OS_TIME_H_
#define _OS_TIME_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include <PR/os_message.h>
#include "os_message.h"
/* Types */
typedef struct OSTimer_str
{
struct OSTimer_str *next;
struct OSTimer_str *prev;
u64 interval;
u64 remaining;
OSMesgQueue *mq;
OSMesg *msg;
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
/*
* Structure for time value
*/
typedef u64 OSTime;
/*
* Structure for interval timer
*/
typedef struct OSTimer_s {
struct OSTimer_s *next; /* point to next timer in list */
struct OSTimer_s *prev; /* point to previous timer in list */
OSTime interval; /* duration set by user */
OSTime value; /* time remaining before */
/* timer fires */
OSMesgQueue *mq; /* Message Queue */
OSMesg msg; /* Message to send */
} OSTimer;
typedef u64 OSTime;
/* Functions */
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
OSTime osGetTime(void);
void osSetTime(OSTime time);
u32 osSetTimer(OSTimer *, OSTime, OSTime, OSMesgQueue *, OSMesg);
/**************************************************************************
*
* Global definitions
*
*/
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Timer interface */
extern OSTime osGetTime(void);
extern void osSetTime(OSTime);
extern int osSetTimer(OSTimer *, OSTime, OSTime,
OSMesgQueue *, OSMesg);
extern int osStopTimer(OSTimer *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_TIME_H_ */
+16
View File
@@ -0,0 +1,16 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: os_version.h,v $
$Revision: 1.2 $
$Date: 1999/06/17 01:33:01 $
*---------------------------------------------------------------------*/
#ifndef _OS_VERSION_H_
#define _OS_VERSION_H_
#define OS_MAJOR_VERSION "2.0K" /* major version */
#define OS_MINOR_VERSION 0 /* patch level */
#endif /* !_OS_VERSION_H_ */
+249 -68
View File
@@ -1,86 +1,101 @@
#ifndef _ULTRA64_VI_H_
#define _ULTRA64_VI_H_
/*====================================================================
* os_vi.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.
*====================================================================*/
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo. (Originated by SGI)
$RCSfile: os_vi.h,v $
$Revision: 1.1 $
$Date: 1998/10/09 08:01:20 $
*---------------------------------------------------------------------*/
#ifndef _OS_VI_H_
#define _OS_VI_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#include <PR/os_message.h>
/* Ultra64 Video Interface */
#include "os_thread.h"
#include "os_message.h"
/* Special Features */
#define OS_VI_GAMMA_ON 0x0001
#define OS_VI_GAMMA_OFF 0x0002
#define OS_VI_GAMMA_DITHER_ON 0x0004
#define OS_VI_GAMMA_DITHER_OFF 0x0008
#define OS_VI_DIVOT_ON 0x0010
#define OS_VI_DIVOT_OFF 0x0020
#define OS_VI_DITHER_FILTER_ON 0x0040
#define OS_VI_DITHER_FILTER_OFF 0x0080
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
#define OS_VI_GAMMA 0x08
#define OS_VI_GAMMA_DITHER 0x04
#define OS_VI_DIVOT 0x10
#define OS_VI_DITHER_FILTER 0x10000
#define OS_VI_UNK200 0x200
#define OS_VI_UNK100 0x100
/**************************************************************************
*
* Type definitions
*
*/
/* Types */
typedef struct
{
u32 ctrl;
u32 width;
u32 burst;
u32 vSync;
u32 hSync;
u32 leap;
u32 hStart;
u32 xScale;
u32 vCurrent;
/*
* Structure to store VI register values that remain the same between 2 fields
*/
typedef struct {
u32 ctrl;
u32 width;
u32 burst;
u32 vSync;
u32 hSync;
u32 leap;
u32 hStart;
u32 xScale;
u32 vCurrent;
} OSViCommonRegs;
typedef struct
{
u32 origin;
u32 yScale;
u32 vStart;
u32 vBurst;
u32 vIntr;
/*
* Structure to store VI register values that change between fields
*/
typedef struct {
u32 origin;
u32 yScale;
u32 vStart;
u32 vBurst;
u32 vIntr;
} OSViFieldRegs;
typedef struct
{
u8 type;
OSViCommonRegs comRegs;
OSViFieldRegs fldRegs[2];
/*
* Structure for VI mode
*/
typedef struct {
u8 type; /* Mode type */
OSViCommonRegs comRegs; /* Common registers for both fields */
OSViFieldRegs fldRegs[2]; /* Registers for Field 1 & 2 */
} OSViMode;
typedef struct
{
/* 0x00 */ u16 unk00; //some kind of flags. swap buffer sets to 0x10
/* 0x02 */ u16 retraceCount;
/* 0x04 */ void* buffer;
/* 0x08 */ OSViMode *modep;
/* 0x0c */ u32 features;
/* 0x10 */ OSMesgQueue *mq;
/* 0x14 */ OSMesg *msg;
/* 0x18 */ u32 unk18;
/* 0x1c */ u32 unk1c;
/* 0x20 */ u32 unk20;
/* 0x24 */ f32 unk24;
/* 0x28 */ u16 unk28;
/* 0x2c */ u32 unk2c;
} OSViContext;
void osCreateViManager(OSPri pri);
void osViSetMode(OSViMode *mode);
void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount);
void osViBlack(u8 active);
void osViSetSpecialFeatures(u32 func);
void osViSwapBuffer(void *vaddr);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/*
* Video Interface (VI) mode type
*/
#define OS_VI_NTSC_LPN1 0 /* NTSC */
#define OS_VI_NTSC_LPF1 1
#define OS_VI_NTSC_LAN1 2
@@ -111,7 +126,173 @@ void osViSwapBuffer(void *vaddr);
#define OS_VI_PAL_HPN2 26
#define OS_VI_PAL_HPF2 27
#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */
#define OS_VI_MPAL_LPF1 29
#define OS_VI_MPAL_LAN1 30
#define OS_VI_MPAL_LAF1 31
#define OS_VI_MPAL_LPN2 32
#define OS_VI_MPAL_LPF2 33
#define OS_VI_MPAL_LAN2 34
#define OS_VI_MPAL_LAF2 35
#define OS_VI_MPAL_HPN1 36
#define OS_VI_MPAL_HPF1 37
#define OS_VI_MPAL_HAN1 38
#define OS_VI_MPAL_HAF1 39
#define OS_VI_MPAL_HPN2 40
#define OS_VI_MPAL_HPF2 41
#define OS_VI_FPAL_LPN1 42 /* FPAL - Full screen PAL */
#define OS_VI_FPAL_LPF1 43
#define OS_VI_FPAL_LAN1 44
#define OS_VI_FPAL_LAF1 45
#define OS_VI_FPAL_LPN2 46
#define OS_VI_FPAL_LPF2 47
#define OS_VI_FPAL_LAN2 48
#define OS_VI_FPAL_LAF2 49
#define OS_VI_FPAL_HPN1 50
#define OS_VI_FPAL_HPF1 51
#define OS_VI_FPAL_HAN1 52
#define OS_VI_FPAL_HAF1 53
#define OS_VI_FPAL_HPN2 54
#define OS_VI_FPAL_HPF2 55
/*
* Video Interface (VI) special features
*/
#define OS_VI_GAMMA_ON 0x0001
#define OS_VI_GAMMA_OFF 0x0002
#define OS_VI_GAMMA_DITHER_ON 0x0004
#define OS_VI_GAMMA_DITHER_OFF 0x0008
#define OS_VI_DIVOT_ON 0x0010
#define OS_VI_DIVOT_OFF 0x0020
#define OS_VI_DITHER_FILTER_ON 0x0040
#define OS_VI_DITHER_FILTER_OFF 0x0080
/*
* Video Interface (VI) mode attribute bit
*/
#define OS_VI_BIT_NONINTERLACE 0x0001 /* lo-res */
#define OS_VI_BIT_INTERLACE 0x0002 /* lo-res */
#define OS_VI_BIT_NORMALINTERLACE 0x0004 /* hi-res */
#define OS_VI_BIT_DEFLICKINTERLACE 0x0008 /* hi-res */
#define OS_VI_BIT_ANTIALIAS 0x0010
#define OS_VI_BIT_POINTSAMPLE 0x0020
#define OS_VI_BIT_16PIXEL 0x0040
#define OS_VI_BIT_32PIXEL 0x0080
#define OS_VI_BIT_LORES 0x0100
#define OS_VI_BIT_HIRES 0x0200
#define OS_VI_BIT_NTSC 0x0400
#define OS_VI_BIT_PAL 0x0800
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
extern OSViMode osViModeTable[]; /* Global VI mode table */
extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */
extern OSViMode osViModeNtscLpf1;
extern OSViMode osViModeNtscLan1;
extern OSViMode osViModeNtscLaf1;
extern OSViMode osViModeNtscLpn2;
extern OSViMode osViModeNtscLpf2;
extern OSViMode osViModeNtscLan2;
extern OSViMode osViModeNtscLaf2;
extern OSViMode osViModeNtscHpn1;
extern OSViMode osViModeNtscHpf1;
extern OSViMode osViModeNtscHan1;
extern OSViMode osViModeNtscHaf1;
extern OSViMode osViModeNtscHpn2;
extern OSViMode osViModeNtscHpf2;
extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */
extern OSViMode osViModePalLpf1;
extern OSViMode osViModePalLan1;
extern OSViMode osViModePalLaf1;
extern OSViMode osViModePalLpn2;
extern OSViMode osViModePalLpf2;
extern OSViMode osViModePalLan2;
extern OSViMode osViModePalLaf2;
extern OSViMode osViModePalHpn1;
extern OSViMode osViModePalHpf1;
extern OSViMode osViModePalHan1;
extern OSViMode osViModePalHaf1;
extern OSViMode osViModePalHpn2;
extern OSViMode osViModePalHpf2;
extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */
extern OSViMode osViModeMpalLpf1;
extern OSViMode osViModeMpalLan1;
extern OSViMode osViModeMpalLaf1;
extern OSViMode osViModeMpalLpn2;
extern OSViMode osViModeMpalLpf2;
extern OSViMode osViModeMpalLan2;
extern OSViMode osViModeMpalLaf2;
extern OSViMode osViModeMpalHpn1;
extern OSViMode osViModeMpalHpf1;
extern OSViMode osViModeMpalHan1;
extern OSViMode osViModeMpalHaf1;
extern OSViMode osViModeMpalHpn2;
extern OSViMode osViModeMpalHpf2;
extern OSViMode osViModeFpalLpn1; /* Individual VI FPAL modes */
extern OSViMode osViModeFpalLpf1;
extern OSViMode osViModeFpalLan1;
extern OSViMode osViModeFpalLaf1;
extern OSViMode osViModeFpalLpn2;
extern OSViMode osViModeFpalLpf2;
extern OSViMode osViModeFpalLan2;
extern OSViMode osViModeFpalLaf2;
extern OSViMode osViModeFpalHpn1;
extern OSViMode osViModeFpalHpf1;
extern OSViMode osViModeFpalHan1;
extern OSViMode osViModeFpalHaf1;
extern OSViMode osViModeFpalHpn2;
extern OSViMode osViModeFpalHpf2;
/**************************************************************************
*
* Function prototypes
*
*/
/* Video interface (Vi) */
extern u32 osViGetStatus(void);
extern u32 osViGetCurrentMode(void);
extern u32 osViGetCurrentLine(void);
extern u32 osViGetCurrentField(void);
extern void *osViGetCurrentFramebuffer(void);
extern void *osViGetNextFramebuffer(void);
extern void osViSetXScale(f32);
extern void osViSetYScale(f32);
extern void osViExtendVStart(u32);
extern void osViSetSpecialFeatures(u32);
extern void osViSetMode(OSViMode *);
extern void osViSetEvent(OSMesgQueue *, OSMesg, u32);
extern void osViSwapBuffer(void *);
extern void osViBlack(u8);
extern void osViFade(u8, u16);
extern void osViRepeatLine(u8);
extern void osCreateViManager(OSPri);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_VI_H_ */
+108
View File
@@ -0,0 +1,108 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: os_voice.h,v $
$Revision: 1.2 $
$Date: 1999/07/13 08:36:42 $
*---------------------------------------------------------------------*/
#ifndef _OS_VOICE_H_
#define _OS_VOICE_H_
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#include <PR/ultratypes.h>
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Type definitions
*
*/
typedef struct { /* Voice Recognition System */
OSMesgQueue *__mq; /* SI Message Queue */
int __channel; /* Controller Port # */
s32 __mode;
u8 cmd_status; /* Command Status */
} OSVoiceHandle;
typedef struct { /* Voice Recognition System */
u16 warning;
u16 answer_num; /* 0...5 */
u16 voice_level;
u16 voice_sn;
u16 voice_time;
u16 answer[5];
u16 distance[5];
} OSVoiceData;
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
/**************************************************************************
*
* Global definitions
*
*/
/* definition for Voice Recognition System */
#define VOICE_WARN_TOO_SMALL 0x0400
#define VOICE_WARN_TOO_LARGE 0x0800
#define VOICE_WARN_NOT_FIT 0x4000
#define VOICE_WARN_TOO_NOISY 0x8000
#define VOICE_STATUS_READY 0
#define VOICE_STATUS_START 1
#define VOICE_STATUS_CANCEL 3
#define VOICE_STATUS_BUSY 5
#define VOICE_STATUS_END 7
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/**************************************************************************
*
* Macro definitions
*
*/
/**************************************************************************
*
* Extern variables
*
*/
/**************************************************************************
*
* Function prototypes
*
*/
/* Voice Recognition System */
extern s32 osVoiceInit(OSMesgQueue *, OSVoiceHandle *, int);
extern s32 osVoiceCheckWord(u8 *data);
extern s32 osVoiceClearDictionary(OSVoiceHandle *, u8);
extern s32 osVoiceControlGain(OSVoiceHandle *, s32, s32);
extern s32 osVoiceSetWord(OSVoiceHandle *, u8 *);
extern s32 osVoiceStartReadData(OSVoiceHandle *);
extern s32 osVoiceStopReadData(OSVoiceHandle *);
extern s32 osVoiceGetReadData(OSVoiceHandle *, OSVoiceData *);
extern s32 osVoiceMaskDictionary(OSVoiceHandle *, u8 *, int);
extern void osVoiceCountSyllables(u8 *, u32 *);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_OS_VOICE_H_ */
+113
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: /exdisk2/cvs/N64OS/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 */
+7 -3
View File
@@ -18,9 +18,9 @@
* 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 $
* $Revision: 1.22 $
* $Date: 1999/05/20 03:01:49 $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/rcp.h,v $
*
**************************************************************************/
@@ -161,6 +161,9 @@ The Indy development board use cartridge domain 1:
#define DEVICE_TYPE_BULK 1 /* ROM bulk */
#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */
#define DEVICE_TYPE_SRAM 3 /* SRAM */
/* 4-6 are reserved */
#define DEVICE_TYPE_INIT 7 /* initial value */
/* 8-14 are reserved */
/*************************************************************************
* SP Memory
@@ -879,3 +882,4 @@ The Indy development board use cartridge domain 1:
#endif
#endif /* _RCP_H_ */
+93
View File
@@ -0,0 +1,93 @@
/**************************************************************************
*
* $Revision: 1.6 $
* $Date: 1997/02/11 08:29:31 $
* $Source: /exdisk2/cvs/N64OS/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
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: /exdisk2/cvs/N64OS/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
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: /exdisk2/cvs/N64OS/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 */
+85
View File
@@ -0,0 +1,85 @@
/*
* rsp.h
*
* Mon Mar 21 21:15:39 PST 1994
*
* This file is some common definitions for RSP code.
* It enforces the programming model for the task lists.
*
*/
/**************************************************************************
*
* $Revision: 1.1.1.2 $
* $Date: 2002/10/29 08:06:34 $
* $Source: /home/ryzen/cvsaaaa/depot/rf/sw/n64os20l/include/rsp.h,v $
*
**************************************************************************/
#ifndef _RSP_H_
#define _RSP_H_ 1
#define RSP_DMEM_BASE 0x04000000
#define RSP_IMEM_BASE 0x04001000
#define RSP_SCRATCH_BASE 0x20000000 /* for sim use only */
#define DCACHEBASEHI 0x0400
#define DCACHEBASELO 0x0000
#define RSPBOOTBASEHI 0x0400
#define RSPBOOTBASELO 0x1000
#define TASKBASEHI 0x0400
#define TASKBASELO 0x1080
#define HOSTSEMADDRHI 0x0000 # semaphore address
#define HOSTSEMADDRLO 0x1ffc # semaphore address
/* for now, we'll just copy all the output somewhere out-of-the-way... */
#define RDP_BUFF_HI 0x2000
#define RDP_BUFF_LO 0x0000
/* for now, we'll just fix some DRAM stack (for matrices, etc.) */
#define DRAM_STACK_HI 0x001f
#define DRAM_STACK_LO 0xfc00 /* a 1K stack... */
/*
* this is a hack; we need a place in DRAM for the RSP to
* use as a stack.
*/
#define rsp_DRAM_STACK_HI 0x0020
#define rsp_DRAM_STACK_LO 0x0000
/* where is the trig ROM? */
#define rsp_TRIG_BASE 0x10010000
#define rsp_TRIG_BASEHI 0x1001
#define rsp_TRIG_BASELO 0x0000
#ifdef _LANGUAGE_ASSEMBLY
.symbol RSPBOOTBASE, RSP_IMEM_BASE # start of rsp bootstrap
.symbol TASKBASE, (RSP_IMEM_BASE+0x80) # 32 inst. for bootstrap
.name DMA_CACHE, $c0 # these are CP0 registers
.name DMA_DRAM, $c1 #
.name DMA_READ_LENGTH, $c2
.name DMA_WRITE_LENGTH, $c3
.name SP_STATUS, $c4
.name DMA_FULL, $c5
.name DMA_BUSY, $c6
.name SP_RESERVED, $c7
.name CMD_START, $c8
.name CMD_END, $c9
.name CMD_CURRENT, $c10
.name CMD_STATUS, $c11
.name CMD_CLOCK, $c12
.name CMD_BUSY, $c13
.name CMD_PIPE_BUSY, $c14
.name CMD_TMEM_BUSY, $c15
#endif
#endif
+69
View File
@@ -0,0 +1,69 @@
/*
* rsp_ipc.h
*
* Mon Mar 13 10:24:35 PST 1995
*
*
*/
/**************************************************************************
*
* $Revision: 1.1.1.2 $
* $Date: 2002/10/29 08:06:34 $
* $Source: /home/ryzen/cvsaaaa/depot/rf/sw/n64os20l/include/rsp_ipc.h,v $
*
**************************************************************************/
#ifndef _RSP_IPC_H_
#define _RSP_IPC_H_ 1
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
typedef enum
{
CMD_NULL,
CMD_CMD,
CMD_QUIT,
CMD_DMA_READ,
CMD_DMA_WRITE,
CMD_READ_WORD,
CMD_WRITE_WORD,
CMD_LAST
} rsp_shm_cmd_t;
typedef struct
{
unsigned long int dram[(2048 * 1024)>>2]; /* share DRAM */
/*
* howardc - Keep buff right after the dram to keep it 64b aligned. This
* is the fake DMA IPC buffer to communicate to rspsim. If 64b aligned, the
* _emAlign64b (64bit alignment checking code) will properly check for
* alignment.
*/
unsigned long int buff[1024]; /* could be IMEM or DMEM */
char string[256]; /* pass command string */
rsp_shm_cmd_t cmd; /* what to do */
int reg; /* which register */
unsigned long int addr; /* RSP memory address for copy */
unsigned long int length; /* length of data to be copied */
} rsp_shm_buf_t;
/*
* simple semaphore interface, stolen from Stevens' Networking book.
*
* Tue Feb 7 13:38:49 PST 1995
*
*/
extern int sem_create(key_t key, int initval);
extern int sem_open(key_t key);
extern int sem_rm(int id);
extern int sem_close(int id);
extern int sem_wait(int id);
extern int sem_signal(int id);
extern int sem_op(int id, int value);
#endif
#endif
+115
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: /exdisk2/cvs/N64OS/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
+196
View File
@@ -0,0 +1,196 @@
/**************************************************************************
* *
* 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.16 $
* $Date: 1998/04/17 05:03:46 $
* $Source: /exdisk2/cvs/N64OS/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 wrapper
*/
#if defined(F3DEX_GBI_2)
#define spMove spX2Move
#define spSetZ spX2SetZ
#define spScissor spX2Scissor
#define spDraw spX2Draw
#define spInit spX2Init
#define spFinish spX2Finish
#elif defined(F3DEX_GBI)
#define spMove spXMove
#define spSetZ spXSetZ
#define spScissor spXScissor
#define spDraw spXDraw
#define spInit spXInit
#define spFinish spXFinish
#endif
/*
* 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_ */
+176 -91
View File
@@ -1,116 +1,201 @@
#ifndef _ULTRA64_SPTASK_H_
#define _ULTRA64_SPTASK_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. *
* *
**************************************************************************/
/* Task Types */
#define M_GFXTASK 1
#define M_AUDTASK 2
#define M_VIDTASK 3
#define M_HVQTASK 6
#define M_HVQMTASK 7
/**************************************************************************
*
* $Revision: 1.9 $
* $Date: 1998/03/05 06:40:29 $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/sptask.h,v $
*
**************************************************************************/
#if (defined(F3DEX_GBI) || defined(F3DLP_GBI) || defined(F3DEX_GBI_2))
#define OS_YIELD_DATA_SIZE 0xc00
#else
#define OS_YIELD_DATA_SIZE 0x900
#endif
#define OS_YIELD_AUDIO_SIZE 0x400
#ifndef _SPTASK_H_
#define _SPTASK_H_
/* Flags */
#define M_TASK_FLAG0 1
#define M_TASK_FLAG1 2
#ifdef VERSION_SH
#define M_TASK_FLAG2 4
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
/* SpStatus */
#define SPSTATUS_CLEAR_HALT 0x00000001
#define SPSTATUS_SET_HALT 0x00000002
#define SPSTATUS_CLEAR_BROKE 0x00000004
#define SPSTATUS_CLEAR_INTR 0x00000008
#define SPSTATUS_SET_INTR 0x00000010
#define SPSTATUS_CLEAR_SSTEP 0x00000020
#define SPSTATUS_SET_SSTEP 0x00000040
#define SPSTATUS_CLEAR_INTR_ON_BREAK 0x00000080
#define SPSTATUS_SET_INTR_ON_BREAK 0x00000100
#define SPSTATUS_CLEAR_SIGNAL0 0x00000200
#define SPSTATUS_SET_SIGNAL0 0x00000400
#define SPSTATUS_CLEAR_SIGNAL1 0x00000800
#define SPSTATUS_SET_SIGNAL1 0x00001000
#define SPSTATUS_CLEAR_SIGNAL2 0x00002000
#define SPSTATUS_SET_SIGNAL2 0x00004000
#define SPSTATUS_CLEAR_SIGNAL3 0x00008000
#define SPSTATUS_SET_SIGNAL3 0x00010000
#define SPSTATUS_CLEAR_SIGNAL4 0x00020000
#define SPSTATUS_SET_SIGNAL4 0x00040000
#define SPSTATUS_CLEAR_SIGNAL5 0x00080000
#define SPSTATUS_SET_SIGNAL5 0x00100000
#define SPSTATUS_CLEAR_SIGNAL6 0x00200000
#define SPSTATUS_SET_SIGNAL6 0x00800000
#define SPSTATUS_CLEAR_SIGNAL7 0x01000000
#define SPSTATUS_SET_SIGNAL7 0x02000000
#include <PR/ultratypes.h>
#define SPSTATUS_HALT 0x0001
#define SPSTATUS_BROKE 0x0002
#define SPSTATUS_DMA_BUSY 0x0004
#define SPSTATUS_DMA_FULL 0x0008
#define SPSTATUS_IO_FULL 0x0010
#define SPSTATUS_SINGLE_STEP 0x0020
#define SPSTATUS_INTERRUPT_ON_BREAK 0x0040
#define SPSTATUS_SIGNAL0_SET 0x0080
#define SPSTATUS_SIGNAL1_SET 0x0100
#define SPSTATUS_SIGNAL2_SET 0x0200
#define SPSTATUS_SIGNAL3_SET 0x0400
#define SPSTATUS_SIGNAL4_SET 0x0800
#define SPSTATUS_SIGNAL5_SET 0x1000
#define SPSTATUS_SIGNAL6_SET 0x2000
#define SPSTATUS_SIGNAL7_SET 0x4000
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/* Types */
/* Types */
/**************************************************************************
*
* Type definitions
*
*/
typedef struct
{
/*0x00*/ u32 type;
/*0x04*/ u32 flags;
/*
* 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;
/*0x08*/ u64 *ucode_boot;
/*0x0C*/ u32 ucode_boot_size;
u64 *ucode_boot;
u32 ucode_boot_size;
/*0x10*/ u64 *ucode;
/*0x14*/ u32 ucode_size;
u64 *ucode;
u32 ucode_size;
/*0x18*/ u64 *ucode_data;
/*0x1C*/ u32 ucode_data_size;
u64 *ucode_data;
u32 ucode_data_size;
/*0x20*/ u64 *dram_stack;
/*0x24*/ u32 dram_stack_size;
u64 *dram_stack;
u32 dram_stack_size;
/*0x28*/ u64 *output_buff;
/*0x2C*/ u64 *output_buff_size;
u64 *output_buff;
u64 *output_buff_size;
/*0x30*/ u64 *data_ptr;
/*0x34*/ u32 data_size;
u64 *data_ptr;
u32 data_size;
/*0x38*/ u64 *yield_data_ptr;
/*0x3C*/ u32 yield_data_size;
} OSTask_t; // size = 0x40
u64 *yield_data_ptr;
u32 yield_data_size;
} OSTask_t;
typedef union {
OSTask_t t;
long long int force_structure_alignment;
OSTask_t t;
long long int force_structure_alignment;
} OSTask;
typedef u32 OSYieldResult;
/* Functions */
#endif /* _LANGUAGE_C */
#define osSpTaskStart(p) \
osSpTaskLoad(p); \
osSpTaskStartGo(p);
#ifdef _LANGUAGE_ASSEMBLY
void osSpTaskLoad(OSTask *task);
void osSpTaskStartGo(OSTask *task);
void osSpTaskYield(void);
OSYieldResult osSpTaskYielded(OSTask *task);
/*
* 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(F3DEX_GBI_2))
#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 */
+17
View File
@@ -0,0 +1,17 @@
#define OS_TASK_SIZE 128
#define OS_TASK_OFF_TYPE 0
#define OS_TASK_OFF_FLAGS 8
#define OS_TASK_OFF_UBOOT 16
#define OS_TASK_OFF_UBOOT_SZ 24
#define OS_TASK_OFF_UCODE 32
#define OS_TASK_OFF_UCODE_SZ 40
#define OS_TASK_OFF_UDATA 48
#define OS_TASK_OFF_UDATA_SZ 56
#define OS_TASK_OFF_STACK 64
#define OS_TASK_OFF_STACK_SZ 72
#define OS_TASK_OFF_OUTBUFF 80
#define OS_TASK_OFF_OUTBUFF_SZ 88
#define OS_TASK_OFF_DATA 96
#define OS_TASK_OFF_DATA_SZ 104
#define OS_TASK_OFF_YIELD 112
#define OS_TASK_OFF_YIELD_SZ 120
+82
View File
@@ -0,0 +1,82 @@
#ifndef _TRACE_H_
#define _TRACE_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. *
* *
**************************************************************************/
/**************************************************************************
*
* Module: trace.h
*
* $Revision: 1.1.1.2 $
* $Date: 2002/10/29 08:06:34 $
* $Author: blythe $
* $Source: /home/ryzen/cvsaaaa/depot/rf/sw/n64os20l/include/trace.h,v $
*
* Description:
* This file contains debbuging and tracing macros
*
**************************************************************************/
/***************************************
*
* Macro definitions
*
*/
/* Debug macros */
#ifdef _TRACE
#undef _TRACE
#endif
#ifdef _DEBUG
#if defined( _EMULATOR ) || ( _INDY_TARGET )
extern unsigned long Dflags; /* Global debug flag */
/* Debug flag settings */
#define DALL 0xFFFFFFFF /* Turn on all debug types */
#define DERROR 0x00000001 /* Turn on error tracing */
#define DTHREAD 0x00000002 /* Turn on thread tracing */
#define DTIMER 0x00000004 /* Turn on timer tracing */
#define DMESSAGE 0x00000008 /* Turn on message tracing */
#define DMEMORY 0x00000010 /* Turn on memory tracing */
#define DREGION 0x00000020 /* Turn on region tracing */
#define _TRACE(type, code) { if (Dflags & (type)) \
{ printf("%s, %d: ", __FILE__, __LINE__); code; } }
#else
#define _TRACE(type, code)
#endif /* _EMULATOR | _INDY_TARGET */
#else
#define _TRACE(type, code)
#endif /* _DEBUG */
/***************************************
*
* Extern function prototypes
*
*/
#endif /* _TRACE_H_ */
+248 -11
View File
@@ -1,12 +1,242 @@
#ifndef _ULTRA64_UCODE_H_
#define _ULTRA64_UCODE_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. *
* *
**************************************************************************/
#define SP_DRAM_STACK_SIZE8 0x400
#define SP_UCODE_SIZE 0x1000
#define SP_UCODE_DATA_SIZE 0x800
/**************************************************************************
*
* $Revision: 1.15 $
* $Date: 1998/03/31 07:58:57 $
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ucode.h,v $
*
**************************************************************************/
// standard boot ucode
extern u64 rspF3DBootStart[], rspF3DBootEnd[];
#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 u64 rspbootTextStart[], rspbootTextEnd[];
/* standard 3D ucode: */
extern u64 gspFast3DTextStart[], gspFast3DTextEnd[];
extern u64 gspFast3DDataStart[], gspFast3DDataEnd[];
/* 3D ucode with output to DRAM: */
extern u64 gspFast3D_dramTextStart[], gspFast3D_dramTextEnd[];
extern u64 gspFast3D_dramDataStart[], gspFast3D_dramDataEnd[];
/* 3D ucode with output through DRAM FIFO to RDP: */
extern u64 gspFast3D_fifoTextStart[], gspFast3D_fifoTextEnd[];
extern u64 gspFast3D_fifoDataStart[], gspFast3D_fifoDataEnd[];
/* 3D ucode without nearclip: */
extern u64 gspF3DNoNTextStart[], gspF3DNoNTextEnd[];
extern u64 gspF3DNoNDataStart[], gspF3DNoNDataEnd[];
/* 3D ucode without nearclip with output to DRAM: */
extern u64 gspF3DNoN_dramTextStart[];
extern u64 gspF3DNoN_dramTextEnd[];
extern u64 gspF3DNoN_dramDataStart[];
extern u64 gspF3DNoN_dramDataEnd[];
/* 3D ucode without nearclip with output through DRAM FIFO to RDP: */
extern u64 gspF3DNoN_fifoTextStart[];
extern u64 gspF3DNoN_fifoTextEnd[];
extern u64 gspF3DNoN_fifoDataStart[];
extern u64 gspF3DNoN_fifoDataEnd[];
/* 3D line ucode: */
extern u64 gspLine3DTextStart[], gspLine3DTextEnd[];
extern u64 gspLine3DDataStart[], gspLine3DDataEnd[];
/* 3D line ucode with output to DRAM: */
extern u64 gspLine3D_dramTextStart[], gspLine3D_dramTextEnd[];
extern u64 gspLine3D_dramDataStart[], gspLine3D_dramDataEnd[];
/* 3D line ucode with output through DRAM FIFO to RDP: */
extern u64 gspLine3D_fifoTextStart[], gspLine3D_fifoTextEnd[];
extern u64 gspLine3D_fifoDataStart[], gspLine3D_fifoDataEnd[];
/* super 3D ucode: */
extern long long int gspSuper3DTextStart[], gspSuper3DTextEnd[];
extern long long int gspSuper3DDataStart[], gspSuper3DDataEnd[];
/* 3D ucode with output to DRAM: */
extern long long int gspSuper3D_dramTextStart[], gspSuper3D_dramTextEnd[];
extern long long int gspSuper3D_dramDataStart[], gspSuper3D_dramDataEnd[];
/* 3D ucode with output through DRAM FIFO to RDP: */
extern long long int gspSuper3D_fifoTextStart[], gspSuper3D_fifoTextEnd[];
extern long long int gspSuper3D_fifoDataStart[], gspSuper3D_fifoDataEnd[];
/* 2D sprite ucode: */
extern u64 gspSprite2DTextStart[], gspSprite2DTextEnd[];
extern u64 gspSprite2DDataStart[], gspSprite2DDataEnd[];
/* 2D sprite ucode with output to DRAM: */
extern u64 gspSprite2D_dramTextStart[], gspSprite2D_dramTextEnd[];
extern u64 gspSprite2D_dramDataStart[], gspSprite2D_dramDataEnd[];
/* 2D sprite ucode with output through DRAM FIFO to RDP: */
extern u64 gspSprite2D_fifoTextStart[], gspSprite2D_fifoTextEnd[];
extern u64 gspSprite2D_fifoDataStart[], gspSprite2D_fifoDataEnd[];
/* basic audio ucode: */
extern u64 aspMainTextStart[], aspMainTextEnd[];
extern u64 aspMainDataStart[], aspMainDataEnd[];
/*========== F3DEX/F3DLX/F3DLP/L3DEX ==========*/
/* FIFO version only */
extern u64 gspF3DEX_fifoTextStart[], gspF3DEX_fifoTextEnd[];
extern u64 gspF3DEX_fifoDataStart[], gspF3DEX_fifoDataEnd[];
extern u64 gspF3DEX_NoN_fifoTextStart[], gspF3DEX_NoN_fifoTextEnd[];
extern u64 gspF3DEX_NoN_fifoDataStart[], gspF3DEX_NoN_fifoDataEnd[];
extern u64 gspF3DLX_fifoTextStart[], gspF3DLX_fifoTextEnd[];
extern u64 gspF3DLX_fifoDataStart[], gspF3DLX_fifoDataEnd[];
extern u64 gspF3DLX_NoN_fifoTextStart[], gspF3DLX_NoN_fifoTextEnd[];
extern u64 gspF3DLX_NoN_fifoDataStart[], gspF3DLX_NoN_fifoDataEnd[];
extern u64 gspF3DLX_Rej_fifoTextStart[], gspF3DLX_Rej_fifoTextEnd[];
extern u64 gspF3DLX_Rej_fifoDataStart[], gspF3DLX_Rej_fifoDataEnd[];
extern u64 gspF3DLP_Rej_fifoTextStart[], gspF3DLP_Rej_fifoTextEnd[];
extern u64 gspF3DLP_Rej_fifoDataStart[], gspF3DLP_Rej_fifoDataEnd[];
extern u64 gspL3DEX_fifoTextStart[], gspL3DEX_fifoTextEnd[];
extern u64 gspL3DEX_fifoDataStart[], gspL3DEX_fifoDataEnd[];
/*========== F3DEX2/F3DLX2/F3DLP2/L3DEX2 ==========*/
/* FIFO version */
extern u64 gspF3DEX2_fifoTextStart[], gspF3DEX2_fifoTextEnd[];
extern u64 gspF3DEX2_fifoDataStart[], gspF3DEX2_fifoDataEnd[];
extern u64 gspF3DEX2_NoN_fifoTextStart[],gspF3DEX2_NoN_fifoTextEnd[];
extern u64 gspF3DEX2_NoN_fifoDataStart[],gspF3DEX2_NoN_fifoDataEnd[];
extern u64 gspF3DEX2_Rej_fifoTextStart[],gspF3DEX2_Rej_fifoTextEnd[];
extern u64 gspF3DEX2_Rej_fifoDataStart[],gspF3DEX2_Rej_fifoDataEnd[];
extern u64 gspF3DLX2_Rej_fifoTextStart[],gspF3DLX2_Rej_fifoTextEnd[];
extern u64 gspF3DLX2_Rej_fifoDataStart[],gspF3DLX2_Rej_fifoDataEnd[];
extern u64 gspL3DEX2_fifoTextStart[], gspL3DEX2_fifoTextEnd[];
extern u64 gspL3DEX2_fifoDataStart[], gspL3DEX2_fifoDataEnd[];
/* XBUS version */
extern u64 gspF3DEX2_xbusTextStart[], gspF3DEX2_xbusTextEnd[];
extern u64 gspF3DEX2_xbusDataStart[], gspF3DEX2_xbusDataEnd[];
extern u64 gspF3DEX2_NoN_xbusTextStart[],gspF3DEX2_NoN_xbusTextEnd[];
extern u64 gspF3DEX2_NoN_xbusDataStart[],gspF3DEX2_NoN_xbusDataEnd[];
extern u64 gspF3DEX2_Rej_xbusTextStart[],gspF3DEX2_Rej_xbusTextEnd[];
extern u64 gspF3DEX2_Rej_xbusDataStart[],gspF3DEX2_Rej_xbusDataEnd[];
extern u64 gspF3DLX2_Rej_xbusTextStart[],gspF3DLX2_Rej_xbusTextEnd[];
extern u64 gspF3DLX2_Rej_xbusDataStart[],gspF3DLX2_Rej_xbusDataEnd[];
extern u64 gspL3DEX2_xbusTextStart[], gspL3DEX2_xbusTextEnd[];
extern u64 gspL3DEX2_xbusDataStart[], gspL3DEX2_xbusDataEnd[];
/*========== F3DZEX2/L3DZEX2 ==========*/
/* FIFO version */
extern u64 gspF3DZEX2_fifoTextStart[],
gspF3DZEX2_fifoTextEnd[];
extern u64 gspF3DZEX2_fifoDataStart[],
gspF3DZEX2_fifoDataEnd[];
extern u64 gspF3DZEX2_NoN_fifoTextStart[],
gspF3DZEX2_NoN_fifoTextEnd[];
extern u64 gspF3DZEX2_NoN_fifoDataStart[],
gspF3DZEX2_NoN_fifoDataEnd[];
extern u64 gspL3DZEX2_fifoTextStart[],
gspL3DZEX2_fifoTextEnd[];
extern u64 gspL3DZEX2_fifoDataStart[],
gspL3DZEX2_fifoDataEnd[];
/* XBUS version */
extern u64 gspF3DZEX2_xbusTextStart[],
gspF3DZEX2_xbusTextEnd[];
extern u64 gspF3DZEX2_xbusDataStart[],
gspF3DZEX2_xbusDataEnd[];
extern u64 gspF3DZEX2_NoN_xbusTextStart[],
gspF3DZEX2_NoN_xbusTextEnd[];
extern u64 gspF3DZEX2_NoN_xbusDataStart[],
gspF3DZEX2_NoN_xbusDataEnd[];
extern u64 gspL3DZEX2_xbusTextStart[],
gspL3DZEX2_xbusTextEnd[];
extern u64 gspL3DZEX2_xbusDataStart[],
gspL3DZEX2_xbusDataEnd[];
/*========== F3DZEX2/L3DZEX2 ==========*/
extern u64 gspF3DZEX2_PosLight_fifoTextStart[],
gspF3DZEX2_PosLight_fifoTextEnd[];
extern u64 gspF3DZEX2_PosLight_fifoDataStart[],
gspF3DZEX2_PosLight_fifoDataEnd[];
extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[],
gspF3DZEX2_NoN_PosLight_fifoTextEnd[];
extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[],
gspF3DZEX2_NoN_PosLight_fifoDataEnd[];
extern u64 gspL3DZEX2_PosLight_fifoTextStart[],
gspL3DZEX2_PosLight_fifoTextEnd[];
extern u64 gspL3DZEX2_PosLight_fifoDataStart[],
gspL3DZEX2_PosLight_fifoDataEnd[];
/**************************************************************************
*
* decomp ucode names
*
*/
// F3D ucode
extern u64 rspF3DStart[], rspF3DEnd[];
@@ -14,10 +244,17 @@ extern u64 rspF3DStart[], rspF3DEnd[];
// F3D ucode data
extern u64 rspF3DDataStart[], rspF3DDataEnd[];
// aspMain (audio) ucode
extern u64 rspAspMainStart[], rspAspMainEnd[];
// aspMain ucode data
extern u64 rspAspMainDataStart[], rspAspMainDataEnd[];
/**************************************************************************
*
* Function prototypes
*
*/
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_UCODE_H */
+54
View File
@@ -0,0 +1,54 @@
/*---------------------------------------------------------------------*
Copyright (C) 1998, Nintendo.
File ucode_debug.h
Coded by Yoshitaka Yasumoto. Nov 15, 1998.
$Id: ucode_debug.h,v 1.1 1998/12/25 01:06:21 has Exp $
*---------------------------------------------------------------------*/
#ifndef _UCODE_DEBUG_H_
#define _UCODE_DEBUG_H_
#define DEBUG_DL_PTR() IO_READ(SP_DMEM_START+0xfc0)
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
/*========== F3DEX2/F3DLX2/L3DEX2/S2DEX2 ==========*/
/* FIFO version */
extern long long int gspF3DEX2d_fifoTextStart[], gspF3DEX2d_fifoTextEnd[];
extern long long int gspF3DEX2d_fifoDataStart[], gspF3DEX2d_fifoDataEnd[];
extern long long int gspF3DEX2d_NoN_fifoTextStart[],gspF3DEX2d_NoN_fifoTextEnd[];
extern long long int gspF3DEX2d_NoN_fifoDataStart[],gspF3DEX2d_NoN_fifoDataEnd[];
extern long long int gspF3DEX2d_Rej_fifoTextStart[],gspF3DEX2d_Rej_fifoTextEnd[];
extern long long int gspF3DEX2d_Rej_fifoDataStart[],gspF3DEX2d_Rej_fifoDataEnd[];
extern long long int gspF3DLX2d_Rej_fifoTextStart[],gspF3DLX2d_Rej_fifoTextEnd[];
extern long long int gspF3DLX2d_Rej_fifoDataStart[],gspF3DLX2d_Rej_fifoDataEnd[];
extern long long int gspL3DEX2d_fifoTextStart[], gspL3DEX2d_fifoTextEnd[];
extern long long int gspL3DEX2d_fifoDataStart[], gspL3DEX2d_fifoDataEnd[];
extern long long int gspS2DEX2d_fifoTextStart[], gspS2DEX2d_fifoTextEnd[];
extern long long int gspS2DEX2d_fifoDataStart[], gspS2DEX2d_fifoDataEnd[];
/* XBUS version */
extern long long int gspF3DEX2d_xbusTextStart[], gspF3DEX2d_xbusTextEnd[];
extern long long int gspF3DEX2d_xbusDataStart[], gspF3DEX2d_xbusDataEnd[];
extern long long int gspF3DEX2d_NoN_xbusTextStart[],gspF3DEX2d_NoN_xbusTextEnd[];
extern long long int gspF3DEX2d_NoN_xbusDataStart[],gspF3DEX2d_NoN_xbusDataEnd[];
extern long long int gspF3DEX2d_Rej_xbusTextStart[],gspF3DEX2d_Rej_xbusTextEnd[];
extern long long int gspF3DEX2d_Rej_xbusDataStart[],gspF3DEX2d_Rej_xbusDataEnd[];
extern long long int gspF3DLX2d_Rej_xbusTextStart[],gspF3DLX2d_Rej_xbusTextEnd[];
extern long long int gspF3DLX2d_Rej_xbusDataStart[],gspF3DLX2d_Rej_xbusDataEnd[];
extern long long int gspL3DEX2d_xbusTextStart[], gspL3DEX2d_xbusTextEnd[];
extern long long int gspL3DEX2d_xbusDataStart[], gspL3DEX2d_xbusDataEnd[];
extern long long int gspS2DEX2d_xbusTextStart[], gspS2DEX2d_xbusTextEnd[];
extern long long int gspS2DEX2d_xbusDataStart[], gspS2DEX2d_xbusDataEnd[];
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* !_UCODE_DEBUG_H */
/*======== End of ucode_debug.h ========*/
+179
View File
@@ -0,0 +1,179 @@
/*====================================================================
* 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.27 $
* $Date: 1999/07/14 02:44:00 $
* $Source: /exdisk2/cvs/N64OS/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
#define ERR_OSVIEXTENDVSTART_VIMGR 134
#define ERR_OSVIEXTENDVSTART_VALUE 135
#define ERR_OSTHPROFILESTART_FLAG 136
#define ERR_OSTHPROFILESTART_START 137
#define ERR_OSTHPROFILESTOP_FLAG 138
#define ERR_OSTHPROFILEREADCOUNT_FLAG 139
#define ERR_OSTHPROFILEREADTIME_FLAG 140
#define ERR_OSTHPROFILEREADCOUNTTH_FLAG 141
#define ERR_OSTHPROFILEREADTIMETH_FLAG 142
#define ERR_OSTHPROFILEREADCOUNT_LAR 143
#define ERR_OSTHPROFILEREADTIME_LAR 144
#define ERR_OSTHPROFILEREADCOUNTTH_LAR 145
#define ERR_OSTHPROFILEREADTIMETH_LAR 146
#define ERR_OSTHPROFILESTOP_LAR 147
#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
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: /exdisk2/cvs/N64OS/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
+72 -19
View File
@@ -1,12 +1,37 @@
#ifndef _ULTRA64_TYPES_H_
#define _ULTRA64_TYPES_H_
#ifndef _ULTRATYPES_H_
#define _ULTRATYPES_H_
#ifndef NULL
#define NULL (void *)0
#endif
#define TRUE 1
#define FALSE 0
/**************************************************************************
* *
* 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: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultratypes.h,v $
*
**************************************************************************/
/**********************************************************************
* General data types for R4300
*/
typedef signed char s8;
typedef unsigned char u8;
@@ -14,8 +39,34 @@ typedef signed short int s16;
typedef unsigned short int u16;
typedef signed int s32;
typedef unsigned int u32;
typedef float f32;
typedef double f64;
#ifdef TARGET_N64
typedef signed long long int s64;
typedef unsigned long long int u64;
typedef u32 size_t;
typedef s32 ssize_t;
typedef u32 uintptr_t;
typedef s32 intptr_t;
typedef s32 ptrdiff_t;
typedef s8 int8_t;
typedef u8 uint8_t;
typedef s16 int16_t;
typedef u16 uint16_t;
typedef s32 int32_t;
typedef u32 uint32_t;
typedef s64 int64_t;
typedef u64 uint64_t;
#else
#include <stddef.h>
#include <stdint.h>
typedef ptrdiff_t ssize_t;
typedef int64_t s64;
typedef uint64_t u64;
#endif
typedef volatile u8 vu8;
typedef volatile u16 vu16;
@@ -26,19 +77,21 @@ typedef volatile s16 vs16;
typedef volatile s32 vs32;
typedef volatile s64 vs64;
typedef float f32;
typedef double f64;
#ifdef TARGET_N64
typedef u32 size_t;
typedef s32 ssize_t;
typedef u32 uintptr_t;
typedef s32 intptr_t;
typedef s32 ptrdiff_t;
#else
#include <stddef.h>
#include <stdint.h>
typedef ptrdiff_t ssize_t;
/*************************************************************************
* Common definitions
*/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL (void *)0
#endif
#endif /* _ULTRATYPES_H_ */
+134
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: /exdisk2/cvs/N64OS/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
+4 -4
View File
@@ -144,7 +144,7 @@
CMD_PTR(NULL), \
CMD_PTR(NULL)
#define LOAD_MIO0(seg, romStart, romEnd) \
#define LOAD_YAY0(seg, romStart, romEnd) \
CMD_BBH(0x18, 0x0C, 0x0000), \
CMD_PTR(NULL), \
CMD_PTR(NULL)
@@ -160,7 +160,7 @@
CMD_PTR(romStart), \
CMD_PTR(romEnd)
#define LOAD_MIO0(seg, romStart, romEnd) \
#define LOAD_YAY0(seg, romStart, romEnd) \
CMD_BBH(0x18, 0x0C, seg), \
CMD_PTR(romStart), \
CMD_PTR(romEnd)
@@ -170,12 +170,12 @@
CMD_BBH(0x19, 0x04, sethead)
#ifdef NO_SEGMENTED_MEMORY
#define LOAD_MIO0_TEXTURE(seg, romStart, romEnd) \
#define LOAD_YAY0_TEXTURE(seg, romStart, romEnd) \
CMD_BBH(0x1A, 0x0C, 0x0000), \
CMD_PTR(NULL), \
CMD_PTR(NULL)
#else
#define LOAD_MIO0_TEXTURE(seg, romStart, romEnd) \
#define LOAD_YAY0_TEXTURE(seg, romStart, romEnd) \
CMD_BBH(0x1A, 0x0C, seg), \
CMD_PTR(romStart), \
CMD_PTR(romEnd)
+30 -30
View File
@@ -7,7 +7,7 @@
extern u8 _##name##SegmentRomEnd[];
#define DECLARE_ACTOR_SEGMENT(name) \
DECLARE_SEGMENT(name##_mio0) \
DECLARE_SEGMENT(name##_yay0) \
DECLARE_SEGMENT(name##_geo)
#define DECLARE_LEVEL_SEGMENT(name) \
@@ -59,40 +59,40 @@ DECLARE_LEVEL_SEGMENT(ending)
#undef STUB_LEVEL
#undef DEFINE_LEVEL
DECLARE_SEGMENT(segment2_mio0)
DECLARE_SEGMENT(segment2_yay0)
DECLARE_SEGMENT(water_skybox_mio0)
DECLARE_SEGMENT(ccm_skybox_mio0)
DECLARE_SEGMENT(clouds_skybox_mio0)
DECLARE_SEGMENT(bitfs_skybox_mio0)
DECLARE_SEGMENT(wdw_skybox_mio0)
DECLARE_SEGMENT(cloud_floor_skybox_mio0)
DECLARE_SEGMENT(ssl_skybox_mio0)
DECLARE_SEGMENT(bbh_skybox_mio0)
DECLARE_SEGMENT(bidw_skybox_mio0)
DECLARE_SEGMENT(bits_skybox_mio0)
DECLARE_SEGMENT(water_skybox_yay0)
DECLARE_SEGMENT(ccm_skybox_yay0)
DECLARE_SEGMENT(clouds_skybox_yay0)
DECLARE_SEGMENT(bitfs_skybox_yay0)
DECLARE_SEGMENT(wdw_skybox_yay0)
DECLARE_SEGMENT(cloud_floor_skybox_yay0)
DECLARE_SEGMENT(ssl_skybox_yay0)
DECLARE_SEGMENT(bbh_skybox_yay0)
DECLARE_SEGMENT(bidw_skybox_yay0)
DECLARE_SEGMENT(bits_skybox_yay0)
DECLARE_SEGMENT(fire_mio0)
DECLARE_SEGMENT(spooky_mio0)
DECLARE_SEGMENT(generic_mio0)
DECLARE_SEGMENT(water_mio0)
DECLARE_SEGMENT(sky_mio0)
DECLARE_SEGMENT(snow_mio0)
DECLARE_SEGMENT(cave_mio0)
DECLARE_SEGMENT(machine_mio0)
DECLARE_SEGMENT(mountain_mio0)
DECLARE_SEGMENT(grass_mio0)
DECLARE_SEGMENT(outside_mio0)
DECLARE_SEGMENT(inside_mio0)
DECLARE_SEGMENT(effect_mio0)
DECLARE_SEGMENT(title_screen_bg_mio0)
DECLARE_SEGMENT(fire_yay0)
DECLARE_SEGMENT(spooky_yay0)
DECLARE_SEGMENT(generic_yay0)
DECLARE_SEGMENT(water_yay0)
DECLARE_SEGMENT(sky_yay0)
DECLARE_SEGMENT(snow_yay0)
DECLARE_SEGMENT(cave_yay0)
DECLARE_SEGMENT(machine_yay0)
DECLARE_SEGMENT(mountain_yay0)
DECLARE_SEGMENT(grass_yay0)
DECLARE_SEGMENT(outside_yay0)
DECLARE_SEGMENT(inside_yay0)
DECLARE_SEGMENT(effect_yay0)
DECLARE_SEGMENT(title_screen_bg_yay0)
DECLARE_SEGMENT(debug_level_select_mio0)
DECLARE_SEGMENT(debug_level_select_yay0)
#ifdef VERSION_EU
DECLARE_SEGMENT(translation_de_mio0)
DECLARE_SEGMENT(translation_en_mio0)
DECLARE_SEGMENT(translation_fr_mio0)
DECLARE_SEGMENT(translation_de_yay0)
DECLARE_SEGMENT(translation_en_yay0)
DECLARE_SEGMENT(translation_fr_yay0)
#endif
#endif
+31 -24
View File
@@ -1,33 +1,40 @@
/**************************************************************************
* *
* 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: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultra64.h,v $
*
**************************************************************************/
#ifndef _ULTRA64_H_
#define _ULTRA64_H_
#include <math.h>
#ifndef _LANGUAGE_C
#define _LANGUAGE_C
#endif
#include <PR/ultratypes.h>
#include <PR/os_exception.h>
#include <PR/os_misc.h>
#include <PR/os_rdp.h>
#include <PR/os_thread.h>
#include <PR/os_time.h>
#include <PR/os_message.h>
#include <PR/os_cont.h>
#include <PR/os_tlb.h>
#include <PR/rcp.h>
#include <PR/os.h>
#include <PR/region.h>
#include <PR/rmon.h>
#include <PR/sptask.h>
#include <PR/ucode.h>
#include <PR/os_cache.h>
#include <PR/os_vi.h>
#include <PR/os_pi.h>
#include <PR/os_internal.h>
#include <PR/mbi.h>
#include <PR/os_eeprom.h>
#include <PR/os_libc.h>
#include <PR/gu.h>
#include <PR/os_ai.h>
#include <PR/libaudio.h>
#include <PR/libultra.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
+6 -6
View File
@@ -78,14 +78,14 @@ static const LevelScript script_func_local_4[] = {
const LevelScript level_bbh_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _bbh_segment_7SegmentRomStart, _bbh_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _bbh_skybox_mio0SegmentRomStart, _bbh_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _spooky_mio0SegmentRomStart, _spooky_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group9_mio0SegmentRomStart, _group9_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bbh_segment_7SegmentRomStart, _bbh_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bbh_skybox_yay0SegmentRomStart, _bbh_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _spooky_yay0SegmentRomStart, _spooky_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group9_yay0SegmentRomStart, _group9_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group9_geoSegmentRomStart, _group9_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+6 -6
View File
@@ -45,14 +45,14 @@ static const LevelScript script_func_local_3[] = {
const LevelScript level_bitdw_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _bitdw_segment_7SegmentRomStart, _bitdw_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _bidw_skybox_mio0SegmentRomStart, _bidw_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _sky_mio0SegmentRomStart, _sky_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group11_mio0SegmentRomStart, _group11_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bitdw_segment_7SegmentRomStart, _bitdw_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bidw_skybox_yay0SegmentRomStart, _bidw_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _sky_yay0SegmentRomStart, _sky_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group11_yay0SegmentRomStart, _group11_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group11_geoSegmentRomStart, _group11_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+7 -7
View File
@@ -52,15 +52,15 @@ static const LevelScript script_func_local_3[] = {
const LevelScript level_bitfs_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _bitfs_segment_7SegmentRomStart, _bitfs_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _sky_mio0SegmentRomStart, _sky_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _bitfs_skybox_mio0SegmentRomStart, _bitfs_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group2_mio0SegmentRomStart, _group2_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bitfs_segment_7SegmentRomStart, _bitfs_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _sky_yay0SegmentRomStart, _sky_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bitfs_skybox_yay0SegmentRomStart, _bitfs_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group2_yay0SegmentRomStart, _group2_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group2_geoSegmentRomStart, _group2_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+5 -5
View File
@@ -45,12 +45,12 @@ static const LevelScript script_func_local_2[] = {
const LevelScript level_bits_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _bits_segment_7SegmentRomStart, _bits_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _bits_skybox_mio0SegmentRomStart, _bits_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _sky_mio0SegmentRomStart, _sky_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group14_mio0SegmentRomStart, _group14_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bits_segment_7SegmentRomStart, _bits_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bits_skybox_yay0SegmentRomStart, _bits_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _sky_yay0SegmentRomStart, _sky_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group14_yay0SegmentRomStart, _group14_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group14_geoSegmentRomStart, _group14_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+6 -6
View File
@@ -55,14 +55,14 @@ static const LevelScript script_func_local_3[] = {
const LevelScript level_bob_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _bob_segment_7SegmentRomStart, _bob_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _generic_mio0SegmentRomStart, _generic_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group3_mio0SegmentRomStart, _group3_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bob_segment_7SegmentRomStart, _bob_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _generic_yay0SegmentRomStart, _generic_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _water_skybox_yay0SegmentRomStart, _water_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group3_yay0SegmentRomStart, _group3_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group3_geoSegmentRomStart, _group3_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group14_mio0SegmentRomStart, _group14_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group14_yay0SegmentRomStart, _group14_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group14_geoSegmentRomStart, _group14_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+3 -3
View File
@@ -18,9 +18,9 @@
const LevelScript level_bowser_1_entry[] = {
INIT_LEVEL(),
LOAD_MIO0(/*seg*/ 0x07, _bowser_1_segment_7SegmentRomStart, _bowser_1_segment_7SegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x0A, _bidw_skybox_mio0SegmentRomStart, _bidw_skybox_mio0SegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x06, _group12_mio0SegmentRomStart, _group12_mio0SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _bowser_1_segment_7SegmentRomStart, _bowser_1_segment_7SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x0A, _bidw_skybox_yay0SegmentRomStart, _bidw_skybox_yay0SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x06, _group12_yay0SegmentRomStart, _group12_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group12_geoSegmentRomStart, _group12_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+5 -5
View File
@@ -26,11 +26,11 @@ static const LevelScript script_func_local_1[] = {
const LevelScript level_bowser_2_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x0A, _bitfs_skybox_mio0SegmentRomStart, _bitfs_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _fire_mio0SegmentRomStart, _fire_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x07, _bowser_2_segment_7SegmentRomStart, _bowser_2_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group12_mio0SegmentRomStart, _group12_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bitfs_skybox_yay0SegmentRomStart, _bitfs_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _fire_yay0SegmentRomStart, _fire_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _bowser_2_segment_7SegmentRomStart, _bowser_2_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group12_yay0SegmentRomStart, _group12_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group12_geoSegmentRomStart, _group12_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+3 -3
View File
@@ -36,10 +36,10 @@ static const LevelScript script_func_local_1[] = {
const LevelScript level_bowser_3_entry[] = {
INIT_LEVEL(),
LOAD_MIO0(/*seg*/ 0x07, _bowser_3_segment_7SegmentRomStart, _bowser_3_segment_7SegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x06, _group12_mio0SegmentRomStart, _group12_mio0SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _bowser_3_segment_7SegmentRomStart, _bowser_3_segment_7SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x06, _group12_yay0SegmentRomStart, _group12_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group12_geoSegmentRomStart, _group12_geoSegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x0A, _bits_skybox_mio0SegmentRomStart, _bits_skybox_mio0SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x0A, _bits_skybox_yay0SegmentRomStart, _bits_skybox_yay0SegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
JUMP_LINK(script_func_global_13),
+5 -5
View File
@@ -31,12 +31,12 @@ static const LevelScript script_func_local_2[] = {
const LevelScript level_castle_courtyard_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _castle_courtyard_segment_7SegmentRomStart, _castle_courtyard_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, _outside_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group9_mio0SegmentRomStart, _group9_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _castle_courtyard_segment_7SegmentRomStart, _castle_courtyard_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _water_skybox_yay0SegmentRomStart, _water_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _outside_yay0SegmentRomStart, _outside_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group9_yay0SegmentRomStart, _group9_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group9_geoSegmentRomStart, _group9_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+6 -6
View File
@@ -94,14 +94,14 @@ static const LevelScript script_func_local_4[] = {
const LevelScript level_castle_grounds_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _castle_grounds_segment_7SegmentRomStart, _castle_grounds_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, _outside_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group10_mio0SegmentRomStart, _group10_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _castle_grounds_segment_7SegmentRomStart, _castle_grounds_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _water_skybox_yay0SegmentRomStart, _water_skybox_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _outside_yay0SegmentRomStart, _outside_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group10_yay0SegmentRomStart, _group10_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group10_geoSegmentRomStart, _group10_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group15_mio0SegmentRomStart, _group15_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group15_yay0SegmentRomStart, _group15_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group15_geoSegmentRomStart, _group15_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+3 -3
View File
@@ -221,9 +221,9 @@ static const LevelScript script_func_local_4[] = {
const LevelScript level_castle_inside_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _castle_inside_segment_7SegmentRomStart, _castle_inside_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _inside_mio0SegmentRomStart, _inside_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group15_mio0SegmentRomStart, _group15_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _castle_inside_segment_7SegmentRomStart, _castle_inside_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _inside_yay0SegmentRomStart, _inside_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group15_yay0SegmentRomStart, _group15_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group15_geoSegmentRomStart, _group15_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+7 -7
View File
@@ -51,15 +51,15 @@ static const LevelScript script_func_local_4[] = {
const LevelScript level_ccm_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _ccm_segment_7SegmentRomStart, _ccm_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _snow_mio0SegmentRomStart, _snow_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _ccm_skybox_mio0SegmentRomStart, _ccm_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group7_mio0SegmentRomStart, _group7_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _ccm_segment_7SegmentRomStart, _ccm_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _snow_yay0SegmentRomStart, _snow_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _ccm_skybox_yay0SegmentRomStart, _ccm_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group7_yay0SegmentRomStart, _group7_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group7_geoSegmentRomStart, _group7_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group16_mio0SegmentRomStart, _group16_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group16_yay0SegmentRomStart, _group16_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group16_geoSegmentRomStart, _group16_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+5 -5
View File
@@ -30,13 +30,13 @@ static const LevelScript script_func_local_2[] = {
const LevelScript level_cotmc_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _cotmc_segment_7SegmentRomStart, _cotmc_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _cave_mio0SegmentRomStart, _cave_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group8_mio0SegmentRomStart, _group8_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _cotmc_segment_7SegmentRomStart, _cotmc_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _cave_yay0SegmentRomStart, _cave_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group8_yay0SegmentRomStart, _group8_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group8_geoSegmentRomStart, _group8_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+7 -7
View File
@@ -62,15 +62,15 @@ static const LevelScript script_func_local_5[] = {
const LevelScript level_ddd_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _ddd_segment_7SegmentRomStart, _ddd_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _water_mio0SegmentRomStart, _water_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group4_mio0SegmentRomStart, _group4_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _ddd_segment_7SegmentRomStart, _ddd_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _water_yay0SegmentRomStart, _water_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _water_skybox_yay0SegmentRomStart, _water_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group4_yay0SegmentRomStart, _group4_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group4_geoSegmentRomStart, _group4_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group13_mio0SegmentRomStart, _group13_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group13_yay0SegmentRomStart, _group13_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group13_geoSegmentRomStart, _group13_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+1 -1
View File
@@ -18,7 +18,7 @@
const LevelScript level_ending_entry[] = {
/*0*/ INIT_LEVEL(),
/*1*/ LOAD_MIO0(/*seg*/ 0x07, _ending_segment_7SegmentRomStart, _ending_segment_7SegmentRomEnd),
/*1*/ LOAD_YAY0(/*seg*/ 0x07, _ending_segment_7SegmentRomStart, _ending_segment_7SegmentRomEnd),
/*4*/ ALLOC_LEVEL_POOL(),
/*5*/ AREA(/*index*/ 1, ending_geo_000050),
+5 -5
View File
@@ -70,13 +70,13 @@ static const LevelScript script_func_local_4[] = {
const LevelScript level_hmc_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _hmc_segment_7SegmentRomStart, _hmc_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _cave_mio0SegmentRomStart, _cave_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group6_mio0SegmentRomStart, _group6_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _hmc_segment_7SegmentRomStart, _hmc_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _cave_yay0SegmentRomStart, _cave_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group6_yay0SegmentRomStart, _group6_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group6_geoSegmentRomStart, _group6_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+5 -5
View File
@@ -22,7 +22,7 @@ const LevelScript level_intro_splash_screen[] = {
INIT_LEVEL(),
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
// Load "Super Mario 64" logo
ALLOC_LEVEL_POOL(),
@@ -49,7 +49,7 @@ const LevelScript level_intro_mario_head_regular[] = {
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
LOAD_MARIO_HEAD(/*loadHeadID*/ REGULAR_FACE),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_mio0SegmentRomStart, _title_screen_bg_mio0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd),
ALLOC_LEVEL_POOL(),
AREA(/*index*/ 1, intro_geo_mario_head_regular),
@@ -74,7 +74,7 @@ const LevelScript level_intro_mario_head_dizzy[] = {
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
LOAD_MARIO_HEAD(/*loadHeadID*/ DIZZY_FACE),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_mio0SegmentRomStart, _title_screen_bg_mio0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd),
ALLOC_LEVEL_POOL(),
AREA(/*index*/ 1, intro_geo_mario_head_dizzy),
@@ -96,8 +96,8 @@ const LevelScript level_intro_mario_head_dizzy[] = {
const LevelScript level_intro_entry_4[] = {
INIT_LEVEL(),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_mio0SegmentRomStart, _title_screen_bg_mio0SegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x07, _debug_level_select_mio0SegmentRomStart, _debug_level_select_mio0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _debug_level_select_yay0SegmentRomStart, _debug_level_select_yay0SegmentRomEnd),
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
ALLOC_LEVEL_POOL(),
+7 -7
View File
@@ -114,15 +114,15 @@ static const LevelScript script_func_local_5[] = {
const LevelScript level_jrb_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _jrb_segment_7SegmentRomStart, _jrb_segment_7SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _water_mio0SegmentRomStart, _water_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _clouds_skybox_mio0SegmentRomStart, _clouds_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group4_mio0SegmentRomStart, _group4_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _jrb_segment_7SegmentRomStart, _jrb_segment_7SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _water_yay0SegmentRomStart, _water_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _clouds_skybox_yay0SegmentRomStart, _clouds_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group4_yay0SegmentRomStart, _group4_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group4_geoSegmentRomStart, _group4_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group13_mio0SegmentRomStart, _group13_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group13_yay0SegmentRomStart, _group13_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group13_geoSegmentRomStart, _group13_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+7 -7
View File
@@ -118,15 +118,15 @@ static const LevelScript script_func_local_7[] = {
const LevelScript level_lll_entry[] = {
INIT_LEVEL(),
LOAD_MIO0( /*seg*/ 0x07, _lll_segment_7SegmentRomStart, _lll_segment_7SegmentRomEnd),
LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _fire_mio0SegmentRomStart, _fire_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0A, _bitfs_skybox_mio0SegmentRomStart, _bitfs_skybox_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x0B, _effect_mio0SegmentRomStart, _effect_mio0SegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x05, _group2_mio0SegmentRomStart, _group2_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x07, _lll_segment_7SegmentRomStart, _lll_segment_7SegmentRomEnd),
LOAD_YAY0_TEXTURE(/*seg*/ 0x09, _fire_yay0SegmentRomStart, _fire_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0A, _bitfs_skybox_yay0SegmentRomStart, _bitfs_skybox_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x0B, _effect_yay0SegmentRomStart, _effect_yay0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x05, _group2_yay0SegmentRomStart, _group2_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0C, _group2_geoSegmentRomStart, _group2_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x06, _group17_mio0SegmentRomStart, _group17_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x06, _group17_yay0SegmentRomStart, _group17_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0D, _group17_geoSegmentRomStart, _group17_geoSegmentRomEnd),
LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd),
LOAD_YAY0( /*seg*/ 0x08, _common0_yay0SegmentRomStart, _common0_yay0SegmentRomEnd),
LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd),
ALLOC_LEVEL_POOL(),
MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario),
+2 -2
View File
@@ -21,7 +21,7 @@
const LevelScript level_main_menu_entry_1[] = {
INIT_LEVEL(),
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
LOAD_MIO0(/*seg*/ 0x07, _menu_segment_7SegmentRomStart, _menu_segment_7SegmentRomEnd),
LOAD_YAY0(/*seg*/ 0x07, _menu_segment_7SegmentRomStart, _menu_segment_7SegmentRomEnd),
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
ALLOC_LEVEL_POOL(),
LOAD_MODEL_FROM_GEO(MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, geo_menu_mario_save_button),
@@ -62,7 +62,7 @@ const LevelScript level_main_menu_entry_2[] = {
/*2*/ JUMP_IF(/*op*/ OP_EQ, /*arg*/ 0, level_main_menu_entry_2 + 42),
/*5*/ INIT_LEVEL(),
/*6*/ FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
/*10*/ LOAD_MIO0(/*seg*/ 0x07, _menu_segment_7SegmentRomStart, _menu_segment_7SegmentRomEnd),
/*10*/ LOAD_YAY0(/*seg*/ 0x07, _menu_segment_7SegmentRomStart, _menu_segment_7SegmentRomEnd),
/*13*/ ALLOC_LEVEL_POOL(),
/*14*/ AREA(/*index*/ 2, geo_menu_act_selector_strings),
Loaded 100 of 296 files, more files were not shown because too many files have changed in this diff. Show more