Add iQue support
This commit is contained in:
1 parent
4eb3896bd8
commit
d242a07102
179 files changed
+18231
-107
No files matched your search
@@ -74,6 +74,8 @@ build/*
|
||||
# libultra
|
||||
|
||||
!/lib/*.a
|
||||
!/lib/n64/*.a
|
||||
!/lib/ique/*.a
|
||||
|
||||
!/lib/PR/hvqm/*.o
|
||||
|
||||
@@ -18,6 +18,21 @@ DEFINES :=
|
||||
# Build for the N64 (turn this off for ports)
|
||||
TARGET_N64 ?= 1
|
||||
|
||||
# Location of official N64 libraries
|
||||
# CONSOLE - selects the console to target
|
||||
# jp - builds the 1996 Japanese version
|
||||
# us - builds the 1996 North American version
|
||||
CONSOLE ?= n64
|
||||
$(eval $(call validate-option,CONSOLE,n64 ique))
|
||||
|
||||
ifeq ($(CONSOLE),n64)
|
||||
INCLUDE_DIRS += include/n64
|
||||
LIBS_DIR := lib/n64
|
||||
else ifeq ($(CONSOLE),ique)
|
||||
INCLUDE_DIRS += include/ique
|
||||
LIBS_DIR := lib/ique
|
||||
DEFINES += BBPLAYER=1
|
||||
endif
|
||||
|
||||
# COMPILER - selects the C compiler to use
|
||||
# ido - uses the SGI IRIS Development Option compiler, which is used to build
|
||||
@@ -130,7 +145,7 @@ endif
|
||||
COMPARE ?= 0
|
||||
$(eval $(call validate-option,COMPARE,0 1))
|
||||
|
||||
TARGET_STRING := sm64.$(VERSION).$(GRUCODE)
|
||||
TARGET_STRING := sm64.$(VERSION).$(CONSOLE).$(GRUCODE)
|
||||
# If non-default settings were chosen, disable COMPARE
|
||||
ifeq ($(filter $(TARGET_STRING), sm64.jp.f3d_old sm64.us.f3d_old sm64.eu.f3d_new sm64.sh.f3d_new),)
|
||||
COMPARE := 0
|
||||
@@ -172,6 +187,7 @@ ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||
$(info ==== Build Options ====)
|
||||
$(info Version: $(VERSION))
|
||||
$(info Microcode: $(GRUCODE))
|
||||
$(info Console: $(CONSOLE))
|
||||
$(info Target: $(TARGET))
|
||||
ifeq ($(COMPARE),1)
|
||||
$(info Compare ROM: yes)
|
||||
@@ -193,8 +209,6 @@ 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
|
||||
@@ -337,7 +351,7 @@ ifeq ($(TARGET_N64),1)
|
||||
CC_CFLAGS := -fno-builtin
|
||||
endif
|
||||
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src . include/hvqm
|
||||
INCLUDE_DIRS += include $(BUILD_DIR) $(BUILD_DIR)/include src . include/hvqm
|
||||
ifeq ($(TARGET_N64),1)
|
||||
INCLUDE_DIRS += include/libc
|
||||
endif
|
||||
@@ -752,7 +766,7 @@ $(BUILD_DIR)/libultra.a: $(ULTRA_O_FILES)
|
||||
# Link SM64 ELF file
|
||||
$(ELF): $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.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) -L $(N64_LIBS_DIR) -lultra_rom -lhvqm2
|
||||
$(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$(LIBS_DIR) -lultra_rom -Llib -lhvqm2 -lgcc
|
||||
|
||||
# Build ROM
|
||||
$(ROM): $(ELF)
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
- Naming and documentation of the source code and data structures are in progress.
|
||||
- It has been edited to allow for the usage of the final "N64 OS" library, version ``2.0L``
|
||||
- Shindou Rumble Pak code is on for all regions.
|
||||
- Targeting the iQue Player is supported.
|
||||
- It has been patched with someone2639's shiftable segments patch
|
||||
- It will have HVQM full motion video support
|
||||
- Getting HVQM FMV support to work with the game is in progress.
|
||||
- Getting UNFLoader (flashcart USB library) to work with the game is in progress.
|
||||
|
||||
## FAQ
|
||||
|
||||
@@ -1,100 +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"
|
||||
|
||||
/* -------------------------------------------------------------------------------------- */
|
||||
/* need to asm these functions because lib32gcc-7-dev-mips-cross does not exist so we */
|
||||
/* cannot naturally link a libgcc variant for this target given this architecture and */
|
||||
/* compiler. Until we have a good workaround with a gcc target that doesn't involve */
|
||||
/* assuming a 32-bit to 64-bit change, we have to encode these functions as raw assembly */
|
||||
/* for it to compile. */
|
||||
/* -------------------------------------------------------------------------------------- */
|
||||
|
||||
/* TODO: Is there a non-insane way to fix this hack that doesn't involve the user compiling */
|
||||
/* a library themselves? */
|
||||
glabel __umoddi3
|
||||
sw $a0, ($sp)
|
||||
sw $a1, 4($sp)
|
||||
sw $a2, 8($sp)
|
||||
sw $a3, 0xc($sp)
|
||||
ld $t7, 8($sp)
|
||||
ld $t6, ($sp)
|
||||
ddivu $zero, $t6, $t7
|
||||
bnez $t7, .L80324144
|
||||
nop
|
||||
break 7
|
||||
.L80324144:
|
||||
mfhi $v0
|
||||
dsll32 $v1, $v0, 0
|
||||
dsra32 $v1, $v1, 0
|
||||
jr $ra
|
||||
dsra32 $v0, $v0, 0
|
||||
|
||||
glabel __udivdi3
|
||||
sw $a0, ($sp)
|
||||
sw $a1, 4($sp)
|
||||
sw $a2, 8($sp)
|
||||
sw $a3, 0xc($sp)
|
||||
ld $t7, 8($sp)
|
||||
ld $t6, ($sp)
|
||||
ddivu $zero, $t6, $t7
|
||||
bnez $t7, .L80324180
|
||||
nop
|
||||
break 7
|
||||
.L80324180:
|
||||
mflo $v0
|
||||
dsll32 $v1, $v0, 0
|
||||
dsra32 $v1, $v1, 0
|
||||
jr $ra
|
||||
dsra32 $v0, $v0, 0
|
||||
|
||||
glabel __moddi3
|
||||
sw $a0, ($sp)
|
||||
sw $a1, 4($sp)
|
||||
sw $a2, 8($sp)
|
||||
sw $a3, 0xc($sp)
|
||||
ld $t7, 8($sp)
|
||||
ld $t6, ($sp)
|
||||
ddivu $zero, $t6, $t7
|
||||
bnez $t7, .L803241E8
|
||||
nop
|
||||
break 7
|
||||
.L803241E8:
|
||||
mfhi $v0
|
||||
dsll32 $v1, $v0, 0
|
||||
dsra32 $v1, $v1, 0
|
||||
jr $ra
|
||||
dsra32 $v0, $v0, 0
|
||||
|
||||
glabel __divdi3
|
||||
sw $a0, ($sp)
|
||||
sw $a1, 4($sp)
|
||||
sw $a2, 8($sp)
|
||||
sw $a3, 0xc($sp)
|
||||
ld $t7, 8($sp)
|
||||
ld $t6, ($sp)
|
||||
ddiv $zero, $t6, $t7
|
||||
nop
|
||||
bnez $t7, .L80324228
|
||||
nop
|
||||
break 7
|
||||
.L80324228:
|
||||
daddiu $at, $zero, -1
|
||||
bne $t7, $at, .L80324244
|
||||
daddiu $at, $zero, 1
|
||||
dsll32 $at, $at, 0x1f
|
||||
bne $t6, $at, .L80324244
|
||||
nop
|
||||
break 6
|
||||
.L80324244:
|
||||
mflo $v0
|
||||
dsll32 $v1, $v0, 0
|
||||
dsra32 $v1, $v1, 0
|
||||
jr $ra
|
||||
dsra32 $v0, $v0, 0
|
||||
Executable
+126
@@ -0,0 +1,126 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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__ */
|
||||
Executable
+453
@@ -0,0 +1,453 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/R4300.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __R4300_H__
|
||||
#define __R4300_H__
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/*
|
||||
* Segment base addresses and sizes
|
||||
*/
|
||||
#define KUBASE 0
|
||||
#define KUSIZE 0x80000000
|
||||
#define K0BASE 0x80000000
|
||||
#define K0SIZE 0x20000000
|
||||
#define K1BASE 0xA0000000
|
||||
#define K1SIZE 0x20000000
|
||||
#define K2BASE 0xC0000000
|
||||
#define K2SIZE 0x20000000
|
||||
|
||||
/*
|
||||
* Exception vectors
|
||||
*/
|
||||
#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */
|
||||
#define UT_VEC K0BASE /* utlbmiss vector */
|
||||
#define R_VEC (K1BASE+0x1fc00000) /* reset vector */
|
||||
#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */
|
||||
#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */
|
||||
#define E_VEC (K0BASE+0x180) /* Gen. exception vector */
|
||||
|
||||
/*
|
||||
* Address conversion macros
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
|
||||
#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#else /* _LANGUAGE_C */
|
||||
|
||||
#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* Address predicates
|
||||
*/
|
||||
#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE)
|
||||
#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE)
|
||||
#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE)
|
||||
#define IS_KUSEG(x) ((u32)(x) < K0BASE)
|
||||
|
||||
/*
|
||||
* TLB size constants
|
||||
*/
|
||||
|
||||
#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */
|
||||
|
||||
#define TLBHI_VPN2MASK 0xffffe000
|
||||
#define TLBHI_VPN2SHIFT 13
|
||||
#define TLBHI_PIDMASK 0xff
|
||||
#define TLBHI_PIDSHIFT 0
|
||||
#define TLBHI_NPID 255 /* 255 to fit in 8 bits */
|
||||
|
||||
#define TLBLO_PFNMASK 0x3fffffc0
|
||||
#define TLBLO_PFNSHIFT 6
|
||||
#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */
|
||||
#define TLBLO_CACHSHIFT 3
|
||||
#define TLBLO_UNCACHED 0x10 /* not cached */
|
||||
#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */
|
||||
#define TLBLO_EXLWR 0x28 /* Exclusive write */
|
||||
#define TLBLO_D 0x4 /* writeable */
|
||||
#define TLBLO_V 0x2 /* valid bit */
|
||||
#define TLBLO_G 0x1 /* global access bit */
|
||||
|
||||
#define TLBINX_PROBE 0x80000000
|
||||
#define TLBINX_INXMASK 0x3f
|
||||
#define TLBINX_INXSHIFT 0
|
||||
|
||||
#define TLBRAND_RANDMASK 0x3f
|
||||
#define TLBRAND_RANDSHIFT 0
|
||||
|
||||
#define TLBWIRED_WIREDMASK 0x3f
|
||||
|
||||
#define TLBCTXT_BASEMASK 0xff800000
|
||||
#define TLBCTXT_BASESHIFT 23
|
||||
#define TLBCTXT_BASEBITS 9
|
||||
|
||||
#define TLBCTXT_VPNMASK 0x7ffff0
|
||||
#define TLBCTXT_VPNSHIFT 4
|
||||
|
||||
#define TLBPGMASK_4K 0x0
|
||||
#define TLBPGMASK_16K 0x6000
|
||||
#define TLBPGMASK_64K 0x1e000
|
||||
|
||||
/*
|
||||
* Status register
|
||||
*/
|
||||
#define SR_CUMASK 0xf0000000 /* coproc usable bits */
|
||||
|
||||
#define SR_CU3 0x80000000 /* Coprocessor 3 usable */
|
||||
#define SR_CU2 0x40000000 /* Coprocessor 2 usable */
|
||||
#define SR_CU1 0x20000000 /* Coprocessor 1 usable */
|
||||
#define SR_CU0 0x10000000 /* Coprocessor 0 usable */
|
||||
#define SR_RP 0x08000000 /* Reduced power (quarter speed) */
|
||||
#define SR_FR 0x04000000 /* MIPS III FP register mode */
|
||||
#define SR_RE 0x02000000 /* Reverse endian */
|
||||
#define SR_ITS 0x01000000 /* Instruction trace support */
|
||||
#define SR_BEV 0x00400000 /* Use boot exception vectors */
|
||||
#define SR_TS 0x00200000 /* TLB shutdown */
|
||||
#define SR_SR 0x00100000 /* Soft reset occured */
|
||||
#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */
|
||||
#define SR_CE 0x00020000 /* Create ECC */
|
||||
#define SR_DE 0x00010000 /* ECC of parity does not cause error */
|
||||
|
||||
/*
|
||||
* Interrupt enable bits
|
||||
* (NOTE: bits set to 1 enable the corresponding level interrupt)
|
||||
*/
|
||||
#define SR_IMASK 0x0000ff00 /* Interrupt mask */
|
||||
#define SR_IMASK8 0x00000000 /* mask level 8 */
|
||||
#define SR_IMASK7 0x00008000 /* mask level 7 */
|
||||
#define SR_IMASK6 0x0000c000 /* mask level 6 */
|
||||
#define SR_IMASK5 0x0000e000 /* mask level 5 */
|
||||
#define SR_IMASK4 0x0000f000 /* mask level 4 */
|
||||
#define SR_IMASK3 0x0000f800 /* mask level 3 */
|
||||
#define SR_IMASK2 0x0000fc00 /* mask level 2 */
|
||||
#define SR_IMASK1 0x0000fe00 /* mask level 1 */
|
||||
#define SR_IMASK0 0x0000ff00 /* mask level 0 */
|
||||
|
||||
#define SR_IBIT8 0x00008000 /* bit level 8 */
|
||||
#define SR_IBIT7 0x00004000 /* bit level 7 */
|
||||
#define SR_IBIT6 0x00002000 /* bit level 6 */
|
||||
#define SR_IBIT5 0x00001000 /* bit level 5 */
|
||||
#define SR_IBIT4 0x00000800 /* bit level 4 */
|
||||
#define SR_IBIT3 0x00000400 /* bit level 3 */
|
||||
#define SR_IBIT2 0x00000200 /* bit level 2 */
|
||||
#define SR_IBIT1 0x00000100 /* bit level 1 */
|
||||
|
||||
#define SR_IMASKSHIFT 8
|
||||
|
||||
#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */
|
||||
#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */
|
||||
#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */
|
||||
#define SR_KSU_MASK 0x00000018 /* mode mask */
|
||||
#define SR_KSU_USR 0x00000010 /* user mode */
|
||||
#define SR_KSU_SUP 0x00000008 /* supervisor mode */
|
||||
#define SR_KSU_KER 0x00000000 /* kernel mode */
|
||||
#define SR_ERL 0x00000004 /* Error level, 1=>cache error */
|
||||
#define SR_EXL 0x00000002 /* Exception level, 1=>exception */
|
||||
#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */
|
||||
|
||||
/*
|
||||
* Cause Register
|
||||
*/
|
||||
#define CAUSE_BD 0x80000000 /* Branch delay slot */
|
||||
#define CAUSE_CEMASK 0x30000000 /* coprocessor error */
|
||||
#define CAUSE_CESHIFT 28
|
||||
|
||||
/* Interrupt pending bits */
|
||||
#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */
|
||||
#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */
|
||||
#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */
|
||||
#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */
|
||||
#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */
|
||||
#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */
|
||||
#define CAUSE_SW2 0x00000200 /* Software level 2 pending */
|
||||
#define CAUSE_SW1 0x00000100 /* Software level 1 pending */
|
||||
|
||||
#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */
|
||||
#define CAUSE_IPSHIFT 8
|
||||
|
||||
#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */
|
||||
|
||||
#define CAUSE_EXCSHIFT 2
|
||||
|
||||
/* Cause register exception codes */
|
||||
|
||||
#define EXC_CODE(x) ((x)<<2)
|
||||
|
||||
/* Hardware exception codes */
|
||||
#define EXC_INT EXC_CODE(0) /* interrupt */
|
||||
#define EXC_MOD EXC_CODE(1) /* TLB mod */
|
||||
#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */
|
||||
#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */
|
||||
#define EXC_RADE EXC_CODE(4) /* Read Address Error */
|
||||
#define EXC_WADE EXC_CODE(5) /* Write Address Error */
|
||||
#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */
|
||||
#define EXC_DBE EXC_CODE(7) /* Data Bus Error */
|
||||
#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */
|
||||
#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */
|
||||
#define EXC_II EXC_CODE(10) /* Illegal Instruction */
|
||||
#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */
|
||||
#define EXC_OV EXC_CODE(12) /* OVerflow */
|
||||
#define EXC_TRAP EXC_CODE(13) /* Trap exception */
|
||||
#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */
|
||||
#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */
|
||||
#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */
|
||||
#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */
|
||||
|
||||
/* C0_PRID Defines */
|
||||
#define C0_IMPMASK 0xff00
|
||||
#define C0_IMPSHIFT 8
|
||||
#define C0_REVMASK 0xff
|
||||
#define C0_MAJREVMASK 0xf0
|
||||
#define C0_MAJREVSHIFT 4
|
||||
#define C0_MINREVMASK 0xf
|
||||
|
||||
/*
|
||||
* Coprocessor 0 operations
|
||||
*/
|
||||
#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */
|
||||
#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */
|
||||
#define C0_RFE 0x10 /* restore for exception */
|
||||
|
||||
/*
|
||||
* 'cache' instruction definitions
|
||||
*/
|
||||
|
||||
/* Target cache */
|
||||
#define CACH_PI 0x0 /* specifies primary inst. cache */
|
||||
#define CACH_PD 0x1 /* primary data cache */
|
||||
#define CACH_SI 0x2 /* secondary instruction cache */
|
||||
#define CACH_SD 0x3 /* secondary data cache */
|
||||
|
||||
/* Cache operations */
|
||||
#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */
|
||||
#define C_IWBINV 0x0 /* index writeback inval (d, sd) */
|
||||
#define C_ILT 0x4 /* index load tag (all) */
|
||||
#define C_IST 0x8 /* index store tag (all) */
|
||||
#define C_CDX 0xc /* create dirty exclusive (d, sd) */
|
||||
#define C_HINV 0x10 /* hit invalidate (all) */
|
||||
#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */
|
||||
#define C_FILL 0x14 /* fill (i) */
|
||||
#define C_HWB 0x18 /* hit writeback (i, d, sd) */
|
||||
#define C_HSV 0x1c /* hit set virt. (si, sd) */
|
||||
|
||||
/*
|
||||
* Cache size definitions
|
||||
*/
|
||||
#define ICACHE_SIZE 0x4000 /* 16K */
|
||||
#define ICACHE_LINESIZE 32 /* 8 words */
|
||||
#define ICACHE_LINEMASK (ICACHE_LINESIZE-1)
|
||||
|
||||
#define DCACHE_SIZE 0x2000 /* 8K */
|
||||
#define DCACHE_LINESIZE 16 /* 4 words */
|
||||
#define DCACHE_LINEMASK (DCACHE_LINESIZE-1)
|
||||
|
||||
/*
|
||||
* C0_CONFIG register definitions
|
||||
*/
|
||||
#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */
|
||||
#define CONFIG_EC 0x70000000 /* System Clock ratio */
|
||||
#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */
|
||||
#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */
|
||||
#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */
|
||||
#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */
|
||||
#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */
|
||||
#define CONFIG_SB 0x00c00000 /* Secondary cache block size */
|
||||
|
||||
#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */
|
||||
#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */
|
||||
#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */
|
||||
#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */
|
||||
#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/
|
||||
#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */
|
||||
#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */
|
||||
#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */
|
||||
|
||||
#define CONFIG_IC 0x00000e00 /* Primary Icache size */
|
||||
#define CONFIG_DC 0x000001c0 /* Primary Dcache size */
|
||||
#define CONFIG_IB 0x00000020 /* Icache block size */
|
||||
#define CONFIG_DB 0x00000010 /* Dcache block size */
|
||||
#define CONFIG_CU 0x00000008 /* Update on Store-conditional */
|
||||
#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */
|
||||
|
||||
#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */
|
||||
#define CONFIG_NONCOHRNT 0x00000003
|
||||
#define CONFIG_COHRNT_EXLWR 0x00000005
|
||||
#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */
|
||||
#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */
|
||||
#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */
|
||||
#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */
|
||||
|
||||
/*
|
||||
* C0_TAGLO definitions for setting/getting cache states and physaddr bits
|
||||
*/
|
||||
#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */
|
||||
#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */
|
||||
#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */
|
||||
#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */
|
||||
#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */
|
||||
#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */
|
||||
#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */
|
||||
#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */
|
||||
|
||||
#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */
|
||||
#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */
|
||||
#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */
|
||||
#define PINVALID 0x0000 /* invalid --> 000 == state 0 */
|
||||
#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */
|
||||
#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */
|
||||
#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */
|
||||
|
||||
/*
|
||||
* C0_CACHE_ERR definitions.
|
||||
*/
|
||||
#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */
|
||||
#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */
|
||||
#define CACHERR_ED 0x20000000 /* 1: data error */
|
||||
#define CACHERR_ET 0x10000000 /* 1: tag error */
|
||||
#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/
|
||||
#define CACHERR_EE 0x04000000 /* error on SysAD bus */
|
||||
#define CACHERR_EB 0x02000000 /* complicated, see spec. */
|
||||
#define CACHERR_EI 0x01000000 /* complicated, see spec. */
|
||||
#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */
|
||||
#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */
|
||||
#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */
|
||||
|
||||
/* R4000 family supports hardware watchpoints:
|
||||
* C0_WATCHLO:
|
||||
* bits 31..3 are bits 31..3 of physaddr to watch
|
||||
* bit 2: reserved; must be written as 0.
|
||||
* bit 1: when set causes a watchpoint trap on load accesses to paddr.
|
||||
* bit 0: when set traps on stores to paddr;
|
||||
* C0_WATCHHI
|
||||
* bits 31..4 are reserved and must be written as zeros.
|
||||
* bits 3..0 are bits 35..32 of the physaddr to watch
|
||||
*/
|
||||
#define WATCHLO_WTRAP 0x00000001
|
||||
#define WATCHLO_RTRAP 0x00000002
|
||||
#define WATCHLO_ADDRMASK 0xfffffff8
|
||||
#define WATCHLO_VALIDMASK 0xfffffffb
|
||||
#define WATCHHI_VALIDMASK 0x0000000f
|
||||
|
||||
/*
|
||||
* Coprocessor 0 registers
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
#define C0_INX $0
|
||||
#define C0_RAND $1
|
||||
#define C0_ENTRYLO0 $2
|
||||
#define C0_ENTRYLO1 $3
|
||||
#define C0_CONTEXT $4
|
||||
#define C0_PAGEMASK $5 /* page mask */
|
||||
#define C0_WIRED $6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR $8
|
||||
#define C0_COUNT $9 /* free-running counter */
|
||||
#define C0_ENTRYHI $10
|
||||
#define C0_SR $12
|
||||
#define C0_CAUSE $13
|
||||
#define C0_EPC $14
|
||||
#define C0_PRID $15 /* revision identifier */
|
||||
#define C0_COMPARE $11 /* counter comparison reg. */
|
||||
#define C0_CONFIG $16 /* hardware configuration */
|
||||
#define C0_LLADDR $17 /* load linked address */
|
||||
#define C0_WATCHLO $18 /* watchpoint */
|
||||
#define C0_WATCHHI $19 /* watchpoint */
|
||||
#define C0_ECC $26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR $27 /* cache error status */
|
||||
#define C0_TAGLO $28 /* cache operations */
|
||||
#define C0_TAGHI $29 /* cache operations */
|
||||
#define C0_ERROR_EPC $30 /* ECC error prg. counter */
|
||||
|
||||
# else /* ! _LANGUAGE_ASSEMBLY */
|
||||
|
||||
#define C0_INX 0
|
||||
#define C0_RAND 1
|
||||
#define C0_ENTRYLO0 2
|
||||
#define C0_ENTRYLO1 3
|
||||
#define C0_CONTEXT 4
|
||||
#define C0_PAGEMASK 5 /* page mask */
|
||||
#define C0_WIRED 6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR 8
|
||||
#define C0_COUNT 9 /* free-running counter */
|
||||
#define C0_ENTRYHI 10
|
||||
#define C0_SR 12
|
||||
#define C0_CAUSE 13
|
||||
#define C0_EPC 14
|
||||
#define C0_PRID 15 /* revision identifier */
|
||||
#define C0_COMPARE 11 /* counter comparison reg. */
|
||||
#define C0_CONFIG 16 /* hardware configuration */
|
||||
#define C0_LLADDR 17 /* load linked address */
|
||||
#define C0_WATCHLO 18 /* watchpoint */
|
||||
#define C0_WATCHHI 19 /* watchpoint */
|
||||
#define C0_ECC 26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR 27 /* cache error status */
|
||||
#define C0_TAGLO 28 /* cache operations */
|
||||
#define C0_TAGHI 29 /* cache operations */
|
||||
#define C0_ERROR_EPC 30 /* ECC error prg. counter */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* floating-point status register
|
||||
*/
|
||||
#define FPCSR_FS 0x01000000 /* flush denorm to zero */
|
||||
#define FPCSR_C 0x00800000 /* condition bit */
|
||||
#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */
|
||||
#define FPCSR_CV 0x00010000 /* cause: invalid operation */
|
||||
#define FPCSR_CZ 0x00008000 /* cause: division by zero */
|
||||
#define FPCSR_CO 0x00004000 /* cause: overflow */
|
||||
#define FPCSR_CU 0x00002000 /* cause: underflow */
|
||||
#define FPCSR_CI 0x00001000 /* cause: inexact operation */
|
||||
#define FPCSR_EV 0x00000800 /* enable: invalid operation */
|
||||
#define FPCSR_EZ 0x00000400 /* enable: division by zero */
|
||||
#define FPCSR_EO 0x00000200 /* enable: overflow */
|
||||
#define FPCSR_EU 0x00000100 /* enable: underflow */
|
||||
#define FPCSR_EI 0x00000080 /* enable: inexact operation */
|
||||
#define FPCSR_FV 0x00000040 /* flag: invalid operation */
|
||||
#define FPCSR_FZ 0x00000020 /* flag: division by zero */
|
||||
#define FPCSR_FO 0x00000010 /* flag: overflow */
|
||||
#define FPCSR_FU 0x00000008 /* flag: underflow */
|
||||
#define FPCSR_FI 0x00000004 /* flag: inexact operation */
|
||||
#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */
|
||||
#define FPCSR_RM_RN 0x00000000 /* round to nearest */
|
||||
#define FPCSR_RM_RZ 0x00000001 /* round to zero */
|
||||
#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */
|
||||
#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */
|
||||
|
||||
#endif /* __R4300_H */
|
||||
File renamed without changes.
Executable
+69
@@ -0,0 +1,69 @@
|
||||
/*====================================================================
|
||||
* audiotools.h
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/audiotools.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* This file contains defines used by the audiotools programs.
|
||||
*
|
||||
*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __AUDIOTOOLS__
|
||||
#define __AUDIOTOOLS__
|
||||
|
||||
#define AL_SYM_FILE_VERSION 'SF01'
|
||||
|
||||
typedef struct {
|
||||
s32 objectId;
|
||||
s32 objectClass;
|
||||
s32 bankFileOffset;
|
||||
s32 stringOffset;
|
||||
s32 refCount;
|
||||
} ALSymFileObj;
|
||||
|
||||
typedef struct {
|
||||
s32 revision;
|
||||
s32 fileSize;
|
||||
s32 objectCount;
|
||||
} ALSymFile;
|
||||
|
||||
|
||||
#define AL_NO_CLASS 0
|
||||
#define AL_BANK_CLASS 1
|
||||
#define AL_INST_CLASS 2
|
||||
#define AL_SOUND_CLASS 3
|
||||
#define AL_KEYMAP_CLASS 4
|
||||
#define AL_WAVETBL_CLASS 5
|
||||
#define AL_LOOP_CLASS 6
|
||||
#define AL_BNKFILE_CLASS 7
|
||||
#define AL_ENVLP_CLASS 8
|
||||
#define AL_BOOK_CLASS 9
|
||||
#define AL_SNDFILE_CLASS 10
|
||||
|
||||
#define AL_NUM_CLASSES 11
|
||||
|
||||
#endif /* !__AUDIOTOOLS__ */
|
||||
@@ -0,0 +1,86 @@
|
||||
#ifndef __bb_fs_h__
|
||||
#define __bb_fs_h__
|
||||
|
||||
#include <PR/bbtypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/*
|
||||
* BBplayer file system data structures
|
||||
*/
|
||||
|
||||
#define BB_FL_PAGE_SIZE 512
|
||||
#define BB_FL_SPARE_SIZE 16
|
||||
#define BB_FL_BLOCK_SIZE 16384
|
||||
#define BB_FL_BYTE_TO_BLOCK(x) ((u32)(x)>>14)
|
||||
#define BB_FL_BLOCK_TO_BYTE(x) ((u32)(x)<<14)
|
||||
#define BB_FL_KB_TO_BLOCK(x) ((u32)(x)>>4)
|
||||
#define BB_FL_BLOCK_TO_KB(x) ((u32)(x)<<4)
|
||||
#define BB_FL_BYTE_TO_PAGE(x) ((u32)(x)>>9)
|
||||
#define BB_FL_PAGE_TO_BYTE(x) ((u32)(x)<<9)
|
||||
#define BB_FL_BLOCK_PAGES (BB_FL_BLOCK_SIZE/BB_FL_PAGE_SIZE)
|
||||
#define BB_FL_ECC0_OFF (525-512)
|
||||
#define BB_FL_ECC1_OFF (520-512)
|
||||
#define BB_FL_BLOCK_STATUS_OFF (517-512)
|
||||
#define BB_FL_BLOCK_LINK_OFF (512-512)
|
||||
#define BB_FL_BLOCK_LINK_SIZE 2
|
||||
#define BB_FL_SEQ_OFF (514-512)
|
||||
|
||||
/*
|
||||
* FAT entries are 16-bit block numbers, each pointing to the
|
||||
* next block in a file or a system-specific code
|
||||
* Block numbers are relative to the start of the device.
|
||||
*/
|
||||
typedef u16 BbFatEntry;
|
||||
|
||||
#define BB_FAT_AVAIL 0x0000 /* available block */
|
||||
#define BB_FAT_LAST 0xFFFF /* last block of a file */
|
||||
#define BB_FAT_BAD 0xFFFE /* unreadable/writable block */
|
||||
#define BB_FAT_RESERVED 0xFFFD /* reserved block */
|
||||
|
||||
#define BB_FAT16_ENTRIES 4096 /* enough to span 64MB */
|
||||
#define BB_FAT16_ENTRIES_SHIFT 12 /* enough to span 64MB */
|
||||
|
||||
#define BB_INODE16_ENTRIES 409 /* remainder of space in FAT block */
|
||||
#define BB_INODE16_NAMELEN 11 /* maximum name length */
|
||||
|
||||
#define BB_FAT16_MAGIC "BBFS"
|
||||
#define BB_FAT16_LINK_MAGIC "BBFL"
|
||||
|
||||
#define BB_FAT16_CKSUM 0xcad7
|
||||
|
||||
#define BB_FAT16_BLOCKS 16 /* number of copies of the fat */
|
||||
#define BB_SYSTEM_AREA_SIZE 0x100000 /* 384KB reserved for system area */
|
||||
#define BB_BIG_FILE_THRESHOLD 0x100000 /* allocation hint */
|
||||
|
||||
/*
|
||||
* Inode entries contain the file name, type, first block address
|
||||
* and file size. There are a fixed number of inodes immediately
|
||||
* following the FAT entries.
|
||||
*/
|
||||
|
||||
/*
|
||||
* All fields are big-endian
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u8 name[BB_INODE16_NAMELEN]; /* 8.3 name */
|
||||
u8 type; /* unused type field */
|
||||
u16 block; /* address of first block in file */
|
||||
u16 pad; /* to align on 4-byte boundary */
|
||||
u32 size; /* size of file in bytes */
|
||||
} BbInode;
|
||||
|
||||
typedef struct { /* FAT for a 16K block size */
|
||||
BbFatEntry entry[BB_FAT16_ENTRIES];
|
||||
BbInode inode[BB_INODE16_ENTRIES];
|
||||
u8 magic[4]; /* 'BBFS' */
|
||||
u32 seq; /* highest number is current */
|
||||
u16 link; /* link to another FAT */
|
||||
u16 cksum; /* mod 2^16 checksum */
|
||||
} BbFat16;
|
||||
|
||||
#define BB_FAT16_NEXT(fat,n) (fat)[(n)>>BB_FAT16_ENTRIES_SHIFT].entry[(n)&(BB_FAT16_ENTRIES-1)]
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 2002 - 2004 BroadOn Communications.
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __bb_fs_h__
|
||||
#define __bb_fs_h__
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
#define BB_FL_BLOCK_SIZE 16384
|
||||
#define BB_INODE16_NAMELEN 11 /* maximum name length */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,179 @@
|
||||
#ifndef __BB_SK_API_HDR__
|
||||
#define __BB_SK_API_HDR__
|
||||
|
||||
|
||||
/*
|
||||
* To add an sk api function:
|
||||
* 1) add SK_API_CALL_ define
|
||||
* 2) add function prototype in this header
|
||||
* 3) implement function in lib/SK/skapi.c
|
||||
* 4) add the function to the array skapi_call_table (lib/SK/skapi.c)
|
||||
* 5) add entry stub to libultra/bb/sk/skapi.s.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Function call mapping numbers, must be in order 0..end
|
||||
*/
|
||||
|
||||
#define SK_API_CALL_GET_ID 0
|
||||
#define SK_API_CALL_LAUNCH_SETUP 1
|
||||
#define SK_API_CALL_LAUNCH 2
|
||||
#define SK_API_CALL_LIST_VALID 3
|
||||
#define SK_API_CALL_RECRYPT_BEGIN 4
|
||||
#define SK_API_CALL_RECRYPT_DATA 5
|
||||
#define SK_API_CALL_RECRYPT_STATE 6
|
||||
#define SK_API_CALL_RECRYPT_END 7
|
||||
#define SK_API_CALL_SIGN_HASH 8
|
||||
#define SK_API_CALL_VERIFY_HASH 9
|
||||
#define SK_API_CALL_GET_CONSUMPTION 10
|
||||
#define SK_API_CALL_ADVANCE_TICKET_WINDOW 11
|
||||
#define SK_API_CALL_SET_LIMIT 12
|
||||
#define SK_API_CALL_EXIT 13
|
||||
#define SK_API_CALL_KEEP_ALIVE 14
|
||||
|
||||
/*
|
||||
* the calls below are for test purpose, not for default or
|
||||
* production build
|
||||
*/
|
||||
|
||||
#define SK_API_CALL_GET_RAND 15
|
||||
#define SK_API_CALL_DUMP_VIRAGE 16
|
||||
#define SK_API_CALL_TEST2 17
|
||||
#define SK_API_CALL_TEST3 18
|
||||
#define SK_API_CALL_RESET_WINDOW 19
|
||||
#define SK_API_CALL_VALIDATE_RLS 20
|
||||
|
||||
|
||||
|
||||
/* sk api error and return codes. Negative implies failure. */
|
||||
#define SK_API_SUCCESS 0
|
||||
#define SK_API_RECRYPT_NOT_REQUIRED 1
|
||||
#define SK_API_RECRYPT_COMPLETE 2
|
||||
#define SK_API_RECRYPT_INCOMPLETE 3
|
||||
#define SK_API_RECRYPT_NEW 4
|
||||
|
||||
#define SK_API_FAIL -1
|
||||
#define SK_API_INVALID_TSRL -2
|
||||
#define SK_API_INVALID_CARL -3
|
||||
#define SK_API_INVALID_CPRL -4
|
||||
#define SK_API_INVALID_CRL -5
|
||||
#define SK_API_INVALID_CERT -6
|
||||
#define SK_API_INVALID_CONT_HASH -7
|
||||
#define SK_API_SIGNER_MISMATCH -8
|
||||
#define SK_API_REVOKED_SERVER -9
|
||||
#define SK_API_REVOKED_CONTENT -10
|
||||
#define SK_API_NO_ENTRY_FOUND -11
|
||||
|
||||
#define SK_IDENTITY (0x06091968)
|
||||
#define API_IDENTITY (0x00000001)
|
||||
|
||||
#define SK_RECRYPT_KEYLIST_SIZE (16*1024)
|
||||
|
||||
/*
|
||||
* Function call declarations.
|
||||
* NOTE: max number of args is 4, and they must fit into a0-a3.
|
||||
*/
|
||||
|
||||
#if defined(_LANGUAGE_C)
|
||||
|
||||
#include <PR/bbticket.h>
|
||||
#include <PR/bbcert.h>
|
||||
#include <PR/bbcrl.h>
|
||||
#include <PR/bbvirage.h>
|
||||
|
||||
typedef struct {
|
||||
BbCrlHead *head;
|
||||
BbServerSuffix *list; /* the actual names of revoked SNs */
|
||||
|
||||
/* each pointer points to a cert object */
|
||||
BbCertBase *certChain[BB_CERT_CHAIN_MAXLEN];
|
||||
} BbCrlBundle;
|
||||
|
||||
typedef struct {
|
||||
BbTicket *ticket;
|
||||
BbCertBase *ticketChain[BB_CERT_CHAIN_MAXLEN];
|
||||
BbCertBase *cmdChain[BB_CERT_CHAIN_MAXLEN];
|
||||
} BbTicketBundle;
|
||||
|
||||
typedef struct {
|
||||
BbCrlBundle tsrl; /* ticket server revocation list */
|
||||
BbCrlBundle carl; /* certificate authority revocation list */
|
||||
BbCrlBundle cprl; /* content publishing server revocation list */
|
||||
} BbAppLaunchCrls;
|
||||
|
||||
|
||||
/*
|
||||
* The actual sk api function declarations. All functions
|
||||
* return SK_API_ return codes defined above. Any return
|
||||
* value < 0 is failure.
|
||||
*/
|
||||
|
||||
|
||||
/* get the bbid */
|
||||
int skGetId(BbId *id);
|
||||
|
||||
/* setup app launch. does not transfer data.
|
||||
*/
|
||||
int skLaunchSetup(BbTicketBundle *ticket,
|
||||
BbAppLaunchCrls *crls,
|
||||
void *pKeyList);
|
||||
|
||||
/* setyp app rights and xfer control to app at addr. */
|
||||
int skLaunch(u32 addr);
|
||||
|
||||
/* primes sk for ensuing skRecrypt*() calls.
|
||||
* ticket and crls are as in skLaunchSetup().
|
||||
* pKeyList will obtain list to be stored.
|
||||
* Maximum key list length is 16KB.
|
||||
*/
|
||||
int skRecryptListValid(void *pKeyList);
|
||||
|
||||
int skRecryptBegin(BbTicketBundle *ticket,
|
||||
BbAppLaunchCrls *crls,
|
||||
void *pKeyList);
|
||||
|
||||
int skRecryptData(u8 *data, u32 size);
|
||||
|
||||
/* when recovering from aborted recryption attempt, this call must
|
||||
* be used to feed the already recrypted data before calling
|
||||
* skRecryptData to finish.
|
||||
*/
|
||||
int skRecryptComputeState(u8 *data, u32 size);
|
||||
|
||||
/* end recyrption and determine success.
|
||||
* pKeyList will obtain list to be stored.
|
||||
* Maximum key list length is 16KB.
|
||||
*/
|
||||
int skRecryptEnd(void *pKeyList);
|
||||
|
||||
/*sign hash: operates on SHA-1 hash only, add on an optional identity */
|
||||
int skSignHash(BbShaHash hash, BbEccSig sign);
|
||||
|
||||
/*verify hash: operates on SHA-1 hash only, use an optional identity */
|
||||
int skVerifyHash(BbShaHash hash, BbGenericSig *sign, BbCertBase *certChain[],
|
||||
BbAppLaunchCrls *crls);
|
||||
|
||||
|
||||
extern int skGetConsumption(u16* tidWindow, u16 cc[BB_MAX_CC]);
|
||||
extern int skAdvanceTicketWindow(void);
|
||||
extern int skSetLimit(u16 limit, u16 code);
|
||||
extern int skExit(void);
|
||||
extern int skKeepAlive(void);
|
||||
|
||||
#ifdef SK_DEVELOP
|
||||
/* test calls for developement, not for production */
|
||||
int skGetRandomKeyData(u8 *data, int size); /* max size = 16 bytes */
|
||||
int skDumpVirage(u8 *virage2data);
|
||||
int skTest2(int a,int b);
|
||||
int skTest3(int a,int b);
|
||||
int skResetWindow(void);
|
||||
int skValidateRls(BbCrlBundle *carl, BbCrlBundle *cprl,
|
||||
BbCrlBundle *tsrl, u32 *versions);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 2002 - 2004 BroadOn Communications.
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __BB_SK_API_HDR__
|
||||
#define __BB_SK_API_HDR__
|
||||
|
||||
#if defined(_LANGUAGE_C)
|
||||
|
||||
typedef u32 BbId; /* 32-bit Player identity */
|
||||
typedef u32 BbContentId; /* 32-bit content identity */
|
||||
|
||||
/* get the bbid */
|
||||
int skGetId(BbId *id);
|
||||
extern int skExit(void);
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#endif
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* 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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/dbgdefs.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _DBGDEFS_H_
|
||||
#define _DBGDEFS_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef int TVid;
|
||||
typedef unsigned short TVushort;
|
||||
typedef unsigned char TVuchar;
|
||||
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Executable
+609
@@ -0,0 +1,609 @@
|
||||
/*
|
||||
* ==========================================================================
|
||||
* Copyright (c) 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. handleSelectExceptions
|
||||
*
|
||||
* 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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/dbgproto.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef dbgproto_h
|
||||
#define dbgproto_h
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <dbgdefs.h>
|
||||
|
||||
#ident "$Revision: 1.1.1.2 $"
|
||||
|
||||
/*
|
||||
* NOTE: If you change this file, remember increment the revision below.
|
||||
*/
|
||||
#define TV_DBGPROTO_REV 2
|
||||
|
||||
|
||||
#define TV_DBG_MAXREQ_SIZE 1024
|
||||
|
||||
/*
|
||||
* Higher resolution time information
|
||||
*/
|
||||
typedef struct __KKTimeStruct {
|
||||
long seconds;
|
||||
long nanoseconds;
|
||||
} KKTimeStruct;
|
||||
|
||||
#define MAGIC_PORT 2727 /* clients connect here */
|
||||
|
||||
typedef struct __KKObjsStruct {
|
||||
TVushort number; /* number of objects */
|
||||
TVid objects[1]; /* variabel length array of object ids */
|
||||
} KKObjs;
|
||||
|
||||
typedef struct __KKFaultInfoStruct {
|
||||
unsigned int addr; /* Faulting address on a watchpoint */
|
||||
short major; /* major classification of fault */
|
||||
short minor; /* minor classification of fault */
|
||||
} KKFaultInfo;
|
||||
|
||||
typedef struct __KKThreadStatusStruct {
|
||||
int flags; /* flags */
|
||||
short why; /* reason for stop */
|
||||
short what; /* system call number when why == KK_SYSENTRY */
|
||||
/* or why == KK_SYSEXIT */
|
||||
TVid tid; /* thread id */
|
||||
TVid pid; /* process id */
|
||||
unsigned int instr; /* current instruction */
|
||||
KKFaultInfo info; /* info associated with fault */
|
||||
int priority; /* scheduling priority */
|
||||
int start; /* used to name the thread */
|
||||
int rv; /* return value from last system call */
|
||||
unsigned args[6]; /* args to system call */
|
||||
} KKThreadStatus;
|
||||
|
||||
/* values for flags - Thread States */
|
||||
#define KK_STOPPED 0x1 /* thread is stopped */
|
||||
#define KK_RUNNABLE 0x2 /* thread is waiting for the cpu */
|
||||
#define KK_RUNNING 0x4 /* thread is executing in the cpu */
|
||||
#define KK_WAITING 0x8 /* thread is waiting for non-cpu resource */
|
||||
|
||||
/* values for why - reason for being stopped, mutually exclusive */
|
||||
#define KK_REQUESTED 0x1 /* stopped as a result of stop directive */
|
||||
#define KK_FAULTED 0x2 /* stopped on incurring a hardware fault */
|
||||
#define KK_SYSENTRY 0x3 /* stopped on entry to a system call */
|
||||
#define KK_SYSEXIT 0x4 /* stopped on exit from a system call */
|
||||
#define KK_NWHY 0x4 /* number of values for why */
|
||||
|
||||
typedef struct __KKRunStruct {
|
||||
int flags; /* flags */
|
||||
unsigned int vaddr; /* Virtual address at which to resume */
|
||||
} KKRun;
|
||||
|
||||
/* values for flags */
|
||||
#define KK_STEP 0x1 /* single step thread */
|
||||
#define KK_VADDR 0x2 /* set PC on resumption from vaddr */
|
||||
#define KK_ABORT 0x4 /* thread should kill itself when resumed */
|
||||
|
||||
typedef struct __KKFaultStruct {
|
||||
short majorMask; /* bit mask giving major fault */
|
||||
short minorMask; /* bit mask giving minor fault */
|
||||
} KKFault;
|
||||
|
||||
/* values for major_ mask */
|
||||
#define KK_FLTMEM 0x1 /* Memory fault */
|
||||
#define KK_FLTINSTR 0x2 /* Instruction fault */
|
||||
#define KK_FLTINTX 0x4 /* Integer exception fault */
|
||||
#define KK_FLTFPE 0x8 /* Floating point exception fault */
|
||||
|
||||
/* types of memory faults */
|
||||
#define KK_FLTALIGN 0x1 /* Alignment error */
|
||||
#define KK_FLTACCESS 0x2 /* Memory access violation */
|
||||
#define KK_FLTBOUNDS 0x4 /* Memory bounds violation */
|
||||
#define KK_FLTWATCH 0x8 /* User watchpoint */
|
||||
|
||||
/* types of instruction faults */
|
||||
#define KK_FLTILL 0x1 /* Illegal instruction */
|
||||
#define KK_FLTPRIV 0x2 /* Privileged instruction */
|
||||
#define KK_FLTTRACE 0x4 /* Trace or breakpoint instruction */
|
||||
|
||||
/* types of exception faults - integer and floating point */
|
||||
#define KK_FLTOVF 0x1 /* overflow */
|
||||
#define KK_FLTZDIV 0x2 /* zero-divide */
|
||||
|
||||
/* types of exceptions - only floating point */
|
||||
#define KK_FLTUDF 0x4 /* underflow */
|
||||
#define KK_FLTINXCT 0x8 /* inexact result */
|
||||
#define KK_FLTINVAL 0xf /* invalid operand */
|
||||
|
||||
typedef struct __KKRegionStruct {
|
||||
unsigned int vaddr; /* Starting virtual address of region */
|
||||
unsigned int size; /* size of region */
|
||||
short flags; /* access flags */
|
||||
unsigned int paddr; /* physical address of first page in region */
|
||||
} KKRegion;
|
||||
|
||||
/* values for flags - access permissions */
|
||||
#define KK_READ 0x1 /* read permission */
|
||||
#define KK_WRITE 0x2 /* write permission */
|
||||
#define KK_EXEC 0x4 /* execute permission */
|
||||
|
||||
#define KK_NGREGS 37
|
||||
#define KK_NSREGS 40
|
||||
|
||||
typedef struct __KKGregSetStruct {
|
||||
unsigned int gregs[KK_NGREGS];
|
||||
} KKGregSet;
|
||||
|
||||
typedef struct __KKFPregSetStruct {
|
||||
union {
|
||||
double dregs[16]; /* 16 64-bit registers */
|
||||
float fregs[32]; /* 32 32-bit registers */
|
||||
unsigned int regs[32]; /* 32 64-bit registers */
|
||||
} fpregs;
|
||||
unsigned int fpcsr;
|
||||
unsigned int fppad;
|
||||
} KKFPregSet;
|
||||
|
||||
typedef struct __KKRegisterContextStruct {
|
||||
KKGregSet gregs; /* general register set */
|
||||
KKFPregSet fpregs; /* floating point register set */
|
||||
} KKRegisterContext;
|
||||
|
||||
#define KK_VREGS 32
|
||||
#define KK_SREGS 40 /* 32 + 8 special registers */
|
||||
|
||||
/*
|
||||
sregs[0..31] = scalar registers
|
||||
|
||||
Special Registers (all 32 bits in size):
|
||||
|
||||
sregs[32] = dramDMA
|
||||
sregs[33] = memDMA
|
||||
sregs[34] = readDMA
|
||||
sregs[35] = pc
|
||||
sregs[36] = writeDMA
|
||||
sregs[37] = status
|
||||
sregs[38] = DMAfull
|
||||
sregs[39] = DMAbusy
|
||||
*/
|
||||
|
||||
|
||||
|
||||
typedef struct __KKCpScalarSetStruct {
|
||||
unsigned int sregs[KK_SREGS];
|
||||
} KKCpScalarRegSet;
|
||||
|
||||
typedef struct __KKCpVectorSetStruct {
|
||||
unsigned int vregs[4 * KK_VREGS];
|
||||
} KKCpVectorRegSet;
|
||||
|
||||
typedef struct __KKCpRegisterContextStruct {
|
||||
KKCpScalarRegSet sregs;
|
||||
KKCpVectorRegSet vregs;
|
||||
} KKCpRegisterContext;
|
||||
|
||||
typedef struct __KKUsageStruct {
|
||||
KKTimeStruct tstamp; /* Wall clock time */
|
||||
KKTimeStruct created; /* Create time */
|
||||
KKTimeStruct states[10];
|
||||
} KKUsage;
|
||||
|
||||
/* values for how in __KKSetCommRequestStruct */
|
||||
#define KK_TTY 0
|
||||
#define KK_TCP 1
|
||||
#define KK_NOP 2
|
||||
|
||||
/* specify a range of log events to enable or disable */
|
||||
typedef struct __KKLogEventSetStruct {
|
||||
int from;
|
||||
int to;
|
||||
} KKLogEventSet;
|
||||
|
||||
/* define where log data is flushed */
|
||||
#define KK_LOG_FLUSH_TO_FILE 0
|
||||
#define KK_LOG_FLUSH_TO_FIFO 1
|
||||
|
||||
/* logger status */
|
||||
typedef struct __KKLogStatusStruct {
|
||||
int bufferType;
|
||||
int bufferSize;
|
||||
int dataSize;
|
||||
int logState;
|
||||
int flushLimit;
|
||||
} KKLogStatus;
|
||||
|
||||
/* process usage data */
|
||||
typedef struct __KKProcUsageStruct {
|
||||
TVid pid;
|
||||
KKTimeStruct states[10];
|
||||
} KKProcUsage;
|
||||
|
||||
/*
|
||||
* Request codes
|
||||
*/
|
||||
|
||||
#define _KK_REQ_LDXEQ 0
|
||||
#define _KK_REQ_LISTPROCS 1
|
||||
#define _KK_REQ_GETXEQNAME 2
|
||||
#define _KK_REQ_LSTTHREADS 3
|
||||
#define _KK_REQ_STATUS 4
|
||||
#define _KK_REQ_STOPPROC 5
|
||||
#define _KK_REQ_STOPTHREAD 6
|
||||
#define _KK_REQ_RUNTHREAD 7
|
||||
#define _KK_REQ_RUNPROC 8
|
||||
#define _KK_REQ_KILLPROC 9
|
||||
#define _KK_REQ_SETFAULT 10
|
||||
#define _KK_REQ_GETFAULT 11
|
||||
#define _KK_REQ_NUMREGIONS 12
|
||||
#define _KK_REQ_GETREGIONS 13
|
||||
#define _KK_REQ_GETGREGSET 14
|
||||
#define _KK_REQ_SETGREGSET 15
|
||||
#define _KK_REQ_GETFPREGSET 16
|
||||
#define _KK_REQ_SETFPREGSET 17
|
||||
#define _KK_REQ_READMEM 18
|
||||
#define _KK_REQ_WRITEMEM 19
|
||||
#define _KK_REQ_SETBKPT 20
|
||||
#define _KK_REQ_CLRBKPT 21
|
||||
#define _KK_REQ_LISTBKPTS 22
|
||||
#define _KK_REQ_NUMWATCH 23
|
||||
#define _KK_REQ_SETWATCH 24
|
||||
#define _KK_REQ_GETWATCH 25
|
||||
#define _KK_REQ_USAGE 26
|
||||
#define _KK_REQ_GETPATHLIST 27
|
||||
#define _KK_REQ_GETFRAME 28
|
||||
#define _KK_REQ_REBOOT 29
|
||||
#define _KK_REQ_SETCOMM 30
|
||||
#define _KK_REQ_SETSYSENTRY 31
|
||||
#define _KK_REQ_GETSYSENTRY 32
|
||||
#define _KK_REQ_SETSYSEXIT 33
|
||||
#define _KK_REQ_GETSYSEXIT 34
|
||||
#define _KK_REQ_ENABLELOG 35
|
||||
#define _KK_REQ_DISABLELOG 36
|
||||
#define _KK_REQ_FLUSHLOG 37
|
||||
#define _KK_REQ_NEWLOG 38
|
||||
#define _KK_REQ_GETMASK 39
|
||||
#define _KK_REQ_AMCMD 40
|
||||
#define _KK_REQ_REMOTE 41
|
||||
#define _KK_REQ_LOGCONTROL 42
|
||||
#define _KK_REQ_LOGSTATUS 43
|
||||
#define _KK_REQ_GETLOGFILE 44
|
||||
#define _KK_REQ_GETSYSUSAGE 45
|
||||
#define _KK_REQ_SETTRPT 46
|
||||
#define _KK_REQ_CLRTRPT 47
|
||||
#define _KK_REQ_LISTTRPTS 48
|
||||
#define _KK_REQ_GETSREGSET 49
|
||||
#define _KK_REQ_SETSREGSET 50
|
||||
#define _KK_REQ_GETVREGSET 51
|
||||
#define _KK_REQ_SETVREGSET 52
|
||||
#define _KK_REQ_COUNT 53 /* must be last */
|
||||
|
||||
/* for the type field in KKHeader */
|
||||
#define _KK_REQUEST 0
|
||||
#define _KK_REPLY 1
|
||||
#define _KK_EXCEPTION 2
|
||||
#define _KK_THREAD_EXIT 3
|
||||
#define _KK_PROCESS_EXIT 4
|
||||
#define _KK_CONSOLE 5
|
||||
|
||||
typedef struct __KKHeaderStruct {
|
||||
int length;
|
||||
char code;
|
||||
char type;
|
||||
short error;
|
||||
char rev;
|
||||
char method; /* 0 - cpu, 1 - RCP */
|
||||
short notused2;
|
||||
} KKHeader;
|
||||
|
||||
/*
|
||||
* Request Structures
|
||||
*/
|
||||
typedef struct __KKGetFrameRequestStruct {
|
||||
KKHeader header;
|
||||
int height, width;
|
||||
int which;
|
||||
} KKGetFrameRequest;
|
||||
|
||||
typedef struct __KKLoadExecutableRequestStruct {
|
||||
KKHeader header;
|
||||
char str[1];
|
||||
} KKLoadExecutableRequest;
|
||||
|
||||
typedef struct __KKObjectRequestStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
} KKObjectRequest;
|
||||
|
||||
typedef struct __KKRunThreadRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKRun actions;
|
||||
} KKRunThreadRequest;
|
||||
|
||||
typedef struct __KKFaultRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKFault fault;
|
||||
TVuchar stopAllThreads;
|
||||
} KKFaultRequest;
|
||||
|
||||
typedef struct __KKGRegsetRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKGregSet registers;
|
||||
} KKGRegsetRequest;
|
||||
|
||||
typedef struct __KKFPRegsetRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKFPregSet registers;
|
||||
} KKFPRegsetRequest;
|
||||
|
||||
typedef struct __KKCpScalarRegsetRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKCpScalarRegSet registers;
|
||||
} KKCpScalarRegsetRequest;
|
||||
|
||||
typedef struct __KKCpVectorRegsetRequestStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKCpVectorRegSet registers;
|
||||
} KKCpVectorRegsetRequest;
|
||||
|
||||
typedef struct __KKReadRequestStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int addr;
|
||||
unsigned int nbytes;
|
||||
} KKReadRequest;
|
||||
|
||||
typedef struct __KKWriteHeaderStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int addr;
|
||||
unsigned int nbytes;
|
||||
} KKWriteHeader;
|
||||
|
||||
typedef struct __KKWriteRequestStruct {
|
||||
KKWriteHeader writeHeader;
|
||||
char buffer[1];
|
||||
} KKWriteRequest;
|
||||
|
||||
typedef struct __KKSetBkptRequestStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int addr;
|
||||
} KKSetBkptRequest;
|
||||
|
||||
typedef struct __KKClrBkptRequestStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
TVid bp;
|
||||
} KKClrBkptRequest;
|
||||
|
||||
typedef struct __KKWatchRequestStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int number;
|
||||
KKRegion wp[1];
|
||||
} KKWatchRequest;
|
||||
|
||||
typedef struct __KKSetCommRequestStruct {
|
||||
KKHeader header;
|
||||
unsigned int how;
|
||||
unsigned int addr;
|
||||
} KKSetCommRequest;
|
||||
|
||||
typedef struct __KKSysCallSetStruct {
|
||||
unsigned int word[8];
|
||||
} KKSysCallSet;
|
||||
|
||||
typedef struct __KKSysCallRequestStruct {
|
||||
KKHeader header;
|
||||
TVid pid;
|
||||
KKSysCallSet syscallset;
|
||||
} KKSysCallRequest;
|
||||
|
||||
typedef struct __KKLogEventRequestStruct {
|
||||
KKHeader header;
|
||||
unsigned int numSet;
|
||||
KKLogEventSet set[1];
|
||||
} KKLogEventRequest;
|
||||
|
||||
typedef struct __KKNewLogRequestStruct {
|
||||
KKHeader header;
|
||||
char str[1];
|
||||
} KKNewLogRequest;
|
||||
|
||||
typedef struct __KKRemoteRequestStruct {
|
||||
KKHeader header;
|
||||
int len;
|
||||
char buf[16];
|
||||
} KKRemoteRequest;
|
||||
|
||||
typedef struct __KKFlushLogRequestStruct {
|
||||
KKHeader header;
|
||||
int no_block;
|
||||
} KKFlushLogRequest;
|
||||
|
||||
typedef struct __KKLogControlRequestStruct {
|
||||
KKHeader header;
|
||||
int command;
|
||||
int arg;
|
||||
} KKLogControlRequest;
|
||||
|
||||
typedef struct __KKSetTrptRequestStruct {
|
||||
KKSetBkptRequest bpRequest;
|
||||
unsigned short code;
|
||||
} KKSetTrptRequest;
|
||||
|
||||
typedef KKClrBkptRequest KKClrTrptRequest;
|
||||
|
||||
/*
|
||||
* Macros for manipulating sets of flags.
|
||||
* sp must be a pointer to KKSysCallSet.
|
||||
* flag must be a member of the enumeration corresponding to *sp.
|
||||
*/
|
||||
|
||||
/* turn on all flags in set */
|
||||
#define TVFILLSET(sp) \
|
||||
{ int _i_ = sizeof(*(sp))/sizeof(unsigned int); \
|
||||
while(_i_) ((unsigned int*)(sp))[--_i_] = 0xFFFFFFFF; }
|
||||
|
||||
/* turn off all flags in set */
|
||||
#define TVEMPTYSET(sp) \
|
||||
{ int _i_ = sizeof(*(sp))/sizeof(unsigned int); \
|
||||
while(_i_) ((unsigned int*)(sp))[--_i_] = 0; }
|
||||
|
||||
/* is this set empty? */
|
||||
#define TVISEMPTYSET(set) \
|
||||
(setisempty(set, sizeof(*(set))/sizeof(unsigned int)))
|
||||
|
||||
/* turn on specified flag in set */
|
||||
#define TVADDSET(sp, flag) \
|
||||
(((unsigned)((flag)) < 32*sizeof(*(sp))/sizeof(unsigned int)) \
|
||||
&& (((unsigned int*)(sp))[((flag))/32] |= (1<<(((flag))%32))))
|
||||
|
||||
/* turn off specified flag in set */
|
||||
#define TVDELSET(sp, flag) \
|
||||
(((unsigned)((flag)) < 32*sizeof(*(sp))/sizeof(unsigned int)) \
|
||||
&& (((unsigned int*)(sp))[((flag))/32] &= ~(1<<(((flag))%32))))
|
||||
|
||||
/* query: != 0 iff flag is turned on in set */
|
||||
#define TVISMEMBER(sp, flag) \
|
||||
(((unsigned)((flag)) < 32*sizeof(*(sp))/sizeof(unsigned int)) \
|
||||
&& (((unsigned int*)(sp))[((flag))/32] & (1<<(((flag))%32))))
|
||||
|
||||
|
||||
/*
|
||||
* Event Structures
|
||||
*/
|
||||
|
||||
typedef struct __KKObjectEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
} KKObjectEvent;
|
||||
|
||||
typedef struct __KKObjsEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
KKObjs objs;
|
||||
} KKObjsEvent;
|
||||
|
||||
typedef struct __KKBufferEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
char buffer[1];
|
||||
} KKBufferEvent;
|
||||
|
||||
typedef struct __KKStatusEventStruct {
|
||||
KKHeader header;
|
||||
KKThreadStatus status;
|
||||
} KKStatusEvent;
|
||||
|
||||
typedef struct __KKFaultEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKFault fault;
|
||||
TVuchar stopAllThreads;
|
||||
} KKFaultEvent;
|
||||
|
||||
typedef struct __KKNumberEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int number;
|
||||
} KKNumberEvent;
|
||||
|
||||
typedef struct __KKRegionEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
unsigned int number;
|
||||
KKRegion regions[1];
|
||||
} KKRegionEvent;
|
||||
|
||||
typedef struct __KKGregEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKGregSet registers;
|
||||
} KKGregEvent;
|
||||
|
||||
typedef struct __KKFPregEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKFPregSet registers;
|
||||
} KKFPregEvent;
|
||||
|
||||
typedef struct __KKCpSregEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKCpScalarRegSet registers;
|
||||
} KKCpSregEvent;
|
||||
|
||||
typedef struct __KKCpVregEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKCpVectorRegSet registers;
|
||||
} KKCpVregEvent;
|
||||
|
||||
typedef struct __KKBkptEventStruct {
|
||||
KKHeader header;
|
||||
TVid object;
|
||||
TVid bp;
|
||||
unsigned int instruction;
|
||||
} KKBkptEvent;
|
||||
|
||||
typedef struct __KKUsageEventStruct {
|
||||
KKHeader header;
|
||||
TVid tid;
|
||||
KKUsage usage;
|
||||
} KKUsageEvent;
|
||||
|
||||
typedef struct __KKFlushEventStruct {
|
||||
KKHeader header;
|
||||
int bufferType;
|
||||
char buffer[1];
|
||||
} KKFlushEvent;
|
||||
|
||||
typedef struct __KKLogStatusEventStruct {
|
||||
KKHeader header;
|
||||
KKLogStatus status;
|
||||
} KKLogStatusEvent;
|
||||
|
||||
typedef struct __KKSysUsageEventStruct {
|
||||
KKHeader header;
|
||||
KKTimeStruct tstamp;
|
||||
int numProc;
|
||||
KKProcUsage usage[1];
|
||||
} KKSysUsageEvent;
|
||||
|
||||
typedef struct __KKStringEventStruct {
|
||||
KKHeader header;
|
||||
char str[1];
|
||||
} KKStringEvent;
|
||||
|
||||
typedef KKSysCallRequest KKSysCallEvent;
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* dbgproto_h */
|
||||
Executable
+134
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* driverd.h: driver daemon declarations & struct definitions.
|
||||
*
|
||||
* 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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/driverd.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#define MAXCLIENTS 5
|
||||
|
||||
/*
|
||||
* Same numbers as videod, bumped up by one each.
|
||||
*/
|
||||
#define DRIVERD_TCP_PORT 8001
|
||||
#define DRIVERD_RPC_PORT 391012
|
||||
|
||||
/*
|
||||
* Daemon must keep track of each client which has attached; it does so by
|
||||
* maintaining an array of 'em.
|
||||
*/
|
||||
|
||||
typedef struct _Client *ClientPtr;
|
||||
|
||||
typedef struct _Client {
|
||||
|
||||
int fd; /* File descriptor of private socket between daemon/client */
|
||||
id_t id; /* Process ID of the client (so that we can signal them) */
|
||||
/*
|
||||
* Event range (6 bit numbers) that this client is interested in; when
|
||||
* the game sends the daemon an event via a socket (that the emulator
|
||||
* opens with the daemon), the daemon checks to see which clients are
|
||||
* interested in this event, then writes to their sockets to indicate
|
||||
* that the event came in. The clients then wake up, realize an event
|
||||
* has occurred, & query the daemon to find out what happened (just as
|
||||
* they'll have to query the device driver via ioctl to find out what
|
||||
* happened).
|
||||
*/
|
||||
int min_event;
|
||||
int max_event;
|
||||
int index;
|
||||
} ClientRec;
|
||||
|
||||
/*
|
||||
* We need a special one byte header on all writes to the private socket
|
||||
* between daemon & client to differentiate between the three actions we
|
||||
* expect the daemon to perform:
|
||||
*
|
||||
* Session registration (new clients identify themselves & pass pid to daemon)
|
||||
*
|
||||
* Events from Game (emulator writes events on private socket)
|
||||
*
|
||||
* Commands to Game (daemon receives commands from host side clients,
|
||||
* arbitrates for control of ramrom, writes the command into ramrom,
|
||||
* sends a signal to the game to tell it to read the ramrom arena, then
|
||||
* waits for an acknowledge to come back from the game indicating that the
|
||||
* command has been accepted (so that the daemon could begin a new command
|
||||
* arbitration if needed).
|
||||
*/
|
||||
|
||||
#define DRIVERD_REGISTER_SESSION 101
|
||||
#define DRIVERD_REGISTER_EMULATOR 102
|
||||
#define DRIVERD_EVENT_FROM_GAME 103
|
||||
#define DRIVERD_IOCTL_REQUEST 104
|
||||
|
||||
typedef struct _registerSession *registerSessionPtr;
|
||||
|
||||
typedef struct _registerSession {
|
||||
|
||||
unsigned int dd_header; /* One of the three possible actions for daemon*/
|
||||
|
||||
id_t id; /* Process ID of the client (so that we can signal them) */
|
||||
/*
|
||||
* Event range (6 bit numbers) that this client is interested in; when
|
||||
* the game sends the daemon an event via a socket (that the emulator
|
||||
* opens with the daemon), the daemon checks to see which clients are
|
||||
* interested in this event, then writes to their sockets to indicate
|
||||
* that the event came in. The clients then wake up, realize an event
|
||||
* has occurred, & query the daemon to find out what happened (just as
|
||||
* they'll have to query the device driver via ioctl to find out what
|
||||
* happened).
|
||||
*/
|
||||
} RegisterSession;
|
||||
|
||||
typedef struct _registerEmulator {
|
||||
|
||||
unsigned int dd_header; /* One of the possible actions for daemon*/
|
||||
|
||||
id_t id; /* Process ID of emulate (so that we can signal them) */
|
||||
int shmkey; /* Shared memory key */
|
||||
} RegisterEmulator;
|
||||
|
||||
typedef struct _eventFromGame *eventFromGamePtr;
|
||||
|
||||
typedef struct _eventFromGame {
|
||||
unsigned int dd_header; /* One of the possible actions for daemon*/
|
||||
int event; /* Signed value */
|
||||
} EventFromGame;
|
||||
|
||||
typedef struct _commandToGame *commandToGamePtr;
|
||||
|
||||
typedef struct _commandToGame {
|
||||
unsigned int dd_header; /* One of the possible actions for daemon*/
|
||||
/*
|
||||
* XXX
|
||||
*/
|
||||
} CommandToGame;
|
||||
|
||||
typedef struct _ioctlRequest {
|
||||
unsigned int dd_header; /* One of the possible actions for daemon*/
|
||||
int request;
|
||||
} IoctlRequest;
|
||||
|
||||
extern int MakeDriverDConnection(char *phostname, int iserver, int retries, int *familyp); /* RETURN */
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#ifndef _EM_H_
|
||||
#define _EM_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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/em.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/mbi.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
unsigned int buttons;
|
||||
} MouseState;
|
||||
|
||||
#define BUTTON_LEFT 0x4
|
||||
#define BUTTON_MIDDLE 0x2
|
||||
#define BUTTON_RIGHT 0x1
|
||||
|
||||
typedef struct {
|
||||
unsigned short button; /* all of the 14 buttons */
|
||||
unsigned char stick_x;
|
||||
unsigned char stick_y;
|
||||
} GamePad;
|
||||
|
||||
/* Simulate interrupts with signals */
|
||||
#define SIGSW1 (SIGRTMIN + OS_EVENT_SW1)
|
||||
#define SIGSW2 (SIGRTMIN + OS_EVENT_SW2)
|
||||
#define SIGCART (SIGRTMIN + OS_EVENT_CART)
|
||||
#define SIGCOUNTER (SIGRTMIN + OS_EVENT_COUNTER)
|
||||
#define SIGSP (SIGRTMIN + OS_EVENT_SP)
|
||||
#define SIGSI (SIGRTMIN + OS_EVENT_SI)
|
||||
#define SIGAI (SIGRTMIN + OS_EVENT_AI)
|
||||
#define SIGVI (SIGRTMIN + OS_EVENT_VI)
|
||||
#define SIGPI (SIGRTMIN + OS_EVENT_PI)
|
||||
#define SIGDI (SIGRTMIN + OS_EVENT_DP)
|
||||
#define SIGBREAK (SIGRTMIN + OS_EVENT_CPU_BREAK)
|
||||
#define SIGSPBREAK (SIGRTMIN + OS_EVENT_SP_BREAK)
|
||||
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
*/
|
||||
|
||||
extern void emDisplayBuffer(unsigned int);
|
||||
extern void emGetMouseState(MouseState *);
|
||||
extern int emInitController(int);
|
||||
extern int emGetController(int, GamePad *);
|
||||
extern int emMemoryDump(const char *);
|
||||
extern int emMemoryLoad(const char *);
|
||||
extern int emPrintf(const char *, ...);
|
||||
extern void emGIOInit( void );
|
||||
extern void emInitSocket( void );
|
||||
extern void emWriteSocket( char );
|
||||
extern void emRomToHost( int, int );
|
||||
|
||||
/* connect to RSP: */
|
||||
extern int emRSPFrame(char *prefix, int fid, int keepMem, int DRAMoutput, int RDPin);
|
||||
extern int emRSPAudioFrame(char *prefix, int fid, int keepMem);
|
||||
extern int emRSPQuit(void);
|
||||
|
||||
/* audio support */
|
||||
|
||||
extern void emAudioInit(char *filename);
|
||||
extern void emAudioWrite(short *out, int count);
|
||||
extern void emAudioFlush(void);
|
||||
extern void emPause(void);
|
||||
|
||||
/* DRAM definites */
|
||||
|
||||
#define KSEG0_BASE 0x20000000
|
||||
#define DRAM_SIZE 0x200000
|
||||
|
||||
/* locations for shared ROM in emulator */
|
||||
|
||||
#define ROM_BASE (KSEG0_BASE + DRAM_SIZE + 0x2000)
|
||||
#define GIO_CART_INT_REGISTER (ROM_BASE + RAMROM_SIZE - 4)
|
||||
#define SHM_CART_INT_REGISTER (RAMROM_MSG_SIZE - 4)
|
||||
#define SHM_MSG_BUFFER_ADDRESS (RAMROM_MSG_SIZE - 8)
|
||||
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#endif /* !_EM_H_ */
|
||||
File renamed without changes.
Regular → Executable
File renamed without changes.
Executable
+393
@@ -0,0 +1,393 @@
|
||||
/*---------------------------------------------------------------------
|
||||
Copyright (C) 1997, Nintendo.
|
||||
|
||||
File gs2dex.h
|
||||
Coded by Yoshitaka Yasumoto. Jul 31, 1997.
|
||||
Modified by
|
||||
Comments Header file for S2DEX ucode.
|
||||
|
||||
$Id: gs2dex.h,v 1.1.1.1 2002/05/02 03:28:24 blythe Exp $
|
||||
---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _GS2DEX_H_
|
||||
#define _GS2DEX_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* Macro
|
||||
*===========================================================================*/
|
||||
#define GS_CALC_DXT(line) (((1<< G_TX_DXT_FRAC)-1)/(line)+1)
|
||||
#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz)))
|
||||
#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz)))
|
||||
|
||||
/*===========================================================================*
|
||||
* Data structures for S2DEX microcode
|
||||
*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Background
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_BGLT_LOADBLOCK 0x0033
|
||||
#define G_BGLT_LOADTILE 0xfff4
|
||||
|
||||
#define G_BG_FLAG_FLIPS 0x01
|
||||
#define G_BG_FLAG_FLIPT 0x10
|
||||
|
||||
/* Non scalable background plane */
|
||||
typedef struct {
|
||||
u16 imageX; /* テクスチャの左上位置 X 座標 (u10.5) */
|
||||
u16 imageW; /* テクスチャの幅 (u10.2) */
|
||||
s16 frameX; /* 転送されるフレームの左上位置(s10.2) */
|
||||
u16 frameW; /* 転送されるフレームの幅 (u10.2) */
|
||||
|
||||
u16 imageY; /* テクスチャの左上位置 Y 座標 (u10.5) */
|
||||
u16 imageH; /* テクスチャの高さ (u10.2) */
|
||||
s16 frameY; /* 転送されるフレームの左上位置(s10.2) */
|
||||
u16 frameH; /* 転送されるフレームの高さ (u10.2) */
|
||||
|
||||
u64 *imagePtr; /* DRAM 上のテクスチャソースアドレス */
|
||||
u16 imageLoad; /* LoadBlock, LoadTile のどちらを使用するか */
|
||||
u8 imageFmt; /* テクセルのフォーマット G_IM_FMT_* */
|
||||
u8 imageSiz; /* テクセルのサイズ G_IM_SIZ_* */
|
||||
u16 imagePal; /* パレット番号 */
|
||||
u16 imageFlip; /* イメージの左右反転 G_BG_FLAG_FLIPS で反転 */
|
||||
|
||||
/* 以下は初期化ルーチン guS2DInitBg() 内で設定されるのでユーザが設
|
||||
定する必要はない */
|
||||
u16 tmemW; /* frame 1 ラインの TMEM 幅 Word サイズ
|
||||
LoadBlock の時 GS_PIX2TMEM(imageW/4,imageSiz)
|
||||
LoadTile の時 GS_PIX2TMEM(frameW/4,imageSiz)+1 */
|
||||
u16 tmemH; /* 一度にロードできる TMEM 高さ (s13.2) 4倍値
|
||||
通常テクスチャの時 512/tmemW*4
|
||||
CI テクスチャの時 256/tmemW*4 */
|
||||
u16 tmemLoadSH; /* SH 値
|
||||
LoadBlock の時 tmemSize/2-1
|
||||
LoadTile の時 tmemW*16-1 */
|
||||
u16 tmemLoadTH; /* TH 値 or Stride 値
|
||||
LoadBlock の時 GS_CALC_DXT(tmemW)
|
||||
LoadTile の時 tmemH-1 */
|
||||
u16 tmemSizeW; /* image 1 ライン分の imagePtr のスキップ値
|
||||
LoadBlock の時 tmemW*2
|
||||
LoadTile の時 GS_PIX2TMEM(imageW/4,imageSiz)*2 */
|
||||
u16 tmemSize; /* ロード一回分の imagePtr のスキップ値
|
||||
= tmemSizeW*tmemH */
|
||||
} uObjBg_t; /* 40 bytes */
|
||||
|
||||
/* Scalable background plane */
|
||||
typedef struct {
|
||||
u16 imageX; /* テクスチャの左上位置 X 座標 (u10.5) */
|
||||
u16 imageW; /* テクスチャの幅 (u10.2) */
|
||||
s16 frameX; /* 転送されるフレームの左上位置(s10.2) */
|
||||
u16 frameW; /* 転送されるフレームの幅 (u10.2) */
|
||||
|
||||
u16 imageY; /* テクスチャの左上位置 Y 座標 (u10.5) */
|
||||
u16 imageH; /* テクスチャの高さ (u10.2) */
|
||||
s16 frameY; /* 転送されるフレームの左上位置(s10.2) */
|
||||
u16 frameH; /* 転送されるフレームの高さ (u10.2) */
|
||||
|
||||
u64 *imagePtr; /* DRAM 上のテクスチャソースアドレス */
|
||||
u16 imageLoad; /* LoadBlock, LoadTile のどちらを使用するか */
|
||||
u8 imageFmt; /* テクセルのフォーマット G_IM_FMT_* */
|
||||
u8 imageSiz; /* テクセルのサイズ G_IM_SIZ_* */
|
||||
u16 imagePal; /* パレット番号 */
|
||||
u16 imageFlip; /* イメージの左右反転 G_BG_FLAG_FLIPS で反転 */
|
||||
|
||||
u16 scaleW; /* X 方向スケール値 (u5.10) */
|
||||
u16 scaleH; /* Y 方向スケール値 (u5.10) */
|
||||
s32 imageYorig; /* image における描画始点 (s20.5) */
|
||||
|
||||
u8 padding[4];
|
||||
|
||||
} uObjScaleBg_t; /* 40 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjBg_t b;
|
||||
uObjScaleBg_t s;
|
||||
long long int force_structure_alignment;
|
||||
} uObjBg;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* 2D Objects
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_OBJ_FLAG_FLIPS 1<<0 /* S 方向反転 */
|
||||
#define G_OBJ_FLAG_FLIPT 1<<4 /* T 方向反転 */
|
||||
|
||||
typedef struct {
|
||||
s16 objX; /* s10.2 OBJ 左上端 X 座標 */
|
||||
u16 scaleW; /* u5.10 幅方向スケーリング */
|
||||
u16 imageW; /* u10.5 テクスチャの幅 (S 方向の長さ) */
|
||||
u16 paddingX; /* 未使用 常に 0 */
|
||||
s16 objY; /* s10.2 OBJ 左上端 Y 座標 */
|
||||
u16 scaleH; /* u5.10 高さ方向スケーリング */
|
||||
u16 imageH; /* u10.5 テクスチャの高さ (T 方向の長さ) */
|
||||
u16 paddingY; /* 未使用 常に 0 */
|
||||
u16 imageStride; /* テクセルの折り返し幅 (64bit word 単位) */
|
||||
u16 imageAdrs; /* TMEM 内のテクスチャ先頭位置 (64bit word 単位) */
|
||||
u8 imageFmt; /* テクセルのフォーマット G_IM_FMT_* */
|
||||
u8 imageSiz; /* テクセルのサイズ G_IM_SIZ_* */
|
||||
u8 imagePal; /* パレット番号 0-7 */
|
||||
u8 imageFlags; /* 表示フラグ G_OBJ_FLAG_FLIP* */
|
||||
} uObjSprite_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjSprite_t s;
|
||||
long long int force_structure_alignment;
|
||||
} uObjSprite;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* 2D Matrix
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
s32 A, B, C, D; /* s15.16 */
|
||||
s16 X, Y; /* s10.2 */
|
||||
u16 BaseScaleX; /* u5.10 */
|
||||
u16 BaseScaleY; /* u5.10 */
|
||||
} uObjMtx_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjMtx_t m;
|
||||
long long int force_structure_alignment;
|
||||
} uObjMtx;
|
||||
|
||||
typedef struct {
|
||||
s16 X, Y; /* s10.2 */
|
||||
u16 BaseScaleX; /* u5.10 */
|
||||
u16 BaseScaleY; /* u5.10 */
|
||||
} uObjSubMtx_t; /* 8 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjSubMtx_t m;
|
||||
long long int force_structure_alignment;
|
||||
} uObjSubMtx;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Loading into TMEM
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_OBJLT_TXTRBLOCK 0x00001033
|
||||
#define G_OBJLT_TXTRTILE 0x00fc1034
|
||||
#define G_OBJLT_TLUT 0x00000030
|
||||
|
||||
#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1)
|
||||
#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz))))
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* Type 種別 G_OBJLT_TXTRBLOCK */
|
||||
u64 *image; /* DRAM 上のテクスチャソースアドレス */
|
||||
u16 tmem; /* ロード先の TMEM ワードアドレス (8byteWORD) */
|
||||
u16 tsize; /* Texture サイズ マクロ GS_TB_TSIZE() で指定 */
|
||||
u16 tline; /* Texture 1 ライン幅 マクロ GS_TB_TLINE() で指定 */
|
||||
u16 sid; /* STATE ID 4 の倍数で 0,4,8,12 のどれか */
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrBlock_t; /* 24 bytes */
|
||||
|
||||
#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1)
|
||||
#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1)
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* Type 種別 G_OBJLT_TXTRTILE */
|
||||
u64 *image; /* DRAM 上のテクスチャソースアドレス */
|
||||
u16 tmem; /* ロード先の TMEM ワードアドレス (8byteWORD) */
|
||||
u16 twidth; /* Texture 幅 マクロ GS_TT_TWIDTH() で指定 */
|
||||
u16 theight; /* Texture 高さ マクロ GS_TT_THEIGHT() で指定 */
|
||||
u16 sid; /* STATE ID 4 の倍数で 0,4,8,12 のどれか */
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrTile_t; /* 24 bytes */
|
||||
|
||||
#define GS_PAL_HEAD(head) ((head)+256)
|
||||
#define GS_PAL_NUM(num) ((num)-1)
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* Type 種別 G_OBJLT_TLUT */
|
||||
u64 *image; /* DRAM 上のテクスチャソースアドレス */
|
||||
u16 phead; /* ロード先頭のパレット番号 256 以上 511 以下 */
|
||||
u16 pnum; /* ロードするパレット数 - 1 */
|
||||
u16 zero; /* 常に 0 を代入する */
|
||||
u16 sid; /* STATE ID 4 の倍数で 0,4,8,12 のどれか */
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrTLUT_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjTxtrBlock_t block;
|
||||
uObjTxtrTile_t tile;
|
||||
uObjTxtrTLUT_t tlut;
|
||||
long long int force_structure_alignment;
|
||||
} uObjTxtr;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Loading into TMEM & 2D Objects
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
uObjTxtr txtr;
|
||||
uObjSprite sprite;
|
||||
} uObjTxSprite; /* 48 bytes */
|
||||
|
||||
/*===========================================================================*
|
||||
* GBI Commands for S2DEX microcode
|
||||
*===========================================================================*/
|
||||
/* GBI Header */
|
||||
#ifdef F3DEX_GBI_2
|
||||
#define G_OBJ_RECTANGLE_R 0xda
|
||||
#define G_OBJ_MOVEMEM 0xdc
|
||||
#define G_RDPHALF_0 0xe4
|
||||
#define G_OBJ_RECTANGLE 0x01
|
||||
#define G_OBJ_SPRITE 0x02
|
||||
#define G_SELECT_DL 0x04
|
||||
#define G_OBJ_LOADTXTR 0x05
|
||||
#define G_OBJ_LDTX_SPRITE 0x06
|
||||
#define G_OBJ_LDTX_RECT 0x07
|
||||
#define G_OBJ_LDTX_RECT_R 0x08
|
||||
#define G_BG_1CYC 0x09
|
||||
#define G_BG_COPY 0x0a
|
||||
#define G_OBJ_RENDERMODE 0x0b
|
||||
#else
|
||||
#define G_BG_1CYC 0x01
|
||||
#define G_BG_COPY 0x02
|
||||
#define G_OBJ_RECTANGLE 0x03
|
||||
#define G_OBJ_SPRITE 0x04
|
||||
#define G_OBJ_MOVEMEM 0x05
|
||||
#define G_SELECT_DL 0xb0
|
||||
#define G_OBJ_RENDERMODE 0xb1
|
||||
#define G_OBJ_RECTANGLE_R 0xb2
|
||||
#define G_OBJ_LOADTXTR 0xc1
|
||||
#define G_OBJ_LDTX_SPRITE 0xc2
|
||||
#define G_OBJ_LDTX_RECT 0xc3
|
||||
#define G_OBJ_LDTX_RECT_R 0xc4
|
||||
#define G_RDPHALF_0 0xe4
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Background wrapped screen
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt),(m),(mptr),0)
|
||||
#define gsSPBgRectangle(m, mptr) gsDma0p( (m),(mptr),0)
|
||||
#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr))
|
||||
#define gsSPBgRectCopy(mptr) gsSPBgRectangle( G_BG_COPY, (mptr))
|
||||
#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr))
|
||||
#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle( G_BG_1CYC, (mptr))
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* 2D Objects
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define gSPObjSprite(pkt, mptr) gDma0p((pkt),G_OBJ_SPRITE, (mptr),0)
|
||||
#define gsSPObjSprite(mptr) gsDma0p( G_OBJ_SPRITE, (mptr),0)
|
||||
#define gSPObjRectangle(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE, (mptr),0)
|
||||
#define gsSPObjRectangle(mptr) gsDma0p( G_OBJ_RECTANGLE, (mptr),0)
|
||||
#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE_R,(mptr),0)
|
||||
#define gsSPObjRectangleR(mptr) gsDma0p( G_OBJ_RECTANGLE_R,(mptr),0)
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* 2D Matrix
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define gSPObjMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),0,23)
|
||||
#define gsSPObjMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),0,23)
|
||||
#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),2, 7)
|
||||
#define gsSPObjSubMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),2, 7)
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Loading into TMEM
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt),G_OBJ_LOADTXTR, (tptr),23)
|
||||
#define gsSPObjLoadTxtr(tptr) gsDma0p( G_OBJ_LOADTXTR, (tptr),23)
|
||||
#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_SPRITE,(tptr),47)
|
||||
#define gsSPObjLoadTxSprite(tptr) gsDma0p( G_OBJ_LDTX_SPRITE,(tptr),47)
|
||||
#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT, (tptr),47)
|
||||
#define gsSPObjLoadTxRect(tptr) gsDma0p( G_OBJ_LDTX_RECT, (tptr),47)
|
||||
#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT_R,(tptr),47)
|
||||
#define gsSPObjLoadTxRectR(tptr) gsDma0p( G_OBJ_LDTX_RECT_R,(tptr),47)
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Select Display List
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define gSPSelectDL(pkt, mptr, sid, flag, mask) \
|
||||
{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
|
||||
gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); }
|
||||
#define gsSPSelectDL(mptr, sid, flag, mask) \
|
||||
{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
|
||||
gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); }
|
||||
#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \
|
||||
{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
|
||||
gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); }
|
||||
#define gsSPSelectBranchDL(mptr, sid, flag, mask) \
|
||||
{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \
|
||||
gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); }
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Set general status
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_MW_GENSTAT 0x08 /* G_MW_FOG と同じ値なので注意 */
|
||||
|
||||
#define gSPSetStatus(pkt, sid, val) \
|
||||
gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))
|
||||
#define gsSPSetStatus(sid, val) \
|
||||
gsMoveWd( G_MW_GENSTAT, (sid), (val))
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Set Object Render Mode
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_OBJRM_NOTXCLAMP 0x01
|
||||
#define G_OBJRM_XLU 0x02 /* Ignored */
|
||||
#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */
|
||||
#define G_OBJRM_BILERP 0x08
|
||||
#define G_OBJRM_SHRINKSIZE_1 0x10
|
||||
#define G_OBJRM_SHRINKSIZE_2 0x20
|
||||
#define G_OBJRM_WIDEN 0x40
|
||||
|
||||
#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode))
|
||||
#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode))
|
||||
|
||||
/*===========================================================================*
|
||||
* Render Mode Macro
|
||||
*===========================================================================*/
|
||||
#define RM_RA_SPRITE(clk) \
|
||||
AA_EN | CVG_DST_CLAMP | \
|
||||
CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
|
||||
GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
|
||||
#define G_RM_SPRITE G_RM_OPA_SURF
|
||||
#define G_RM_SPRITE2 G_RM_OPA_SURF2
|
||||
#define G_RM_RA_SPRITE RM_RA_SPRITE(1)
|
||||
#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2)
|
||||
#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR
|
||||
#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2
|
||||
#define G_RM_XLU_SPRITE G_RM_XLU_SURF
|
||||
#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2
|
||||
#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF
|
||||
#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2
|
||||
|
||||
/*===========================================================================*
|
||||
* External functions
|
||||
*===========================================================================*/
|
||||
extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[];
|
||||
extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[];
|
||||
extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[];
|
||||
extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[];
|
||||
extern u64 gspS2DEX2_fifoTextStart[], gspS2DEX2_fifoTextEnd[];
|
||||
extern u64 gspS2DEX2_fifoDataStart[], gspS2DEX2_fifoDataEnd[];
|
||||
extern u64 gspS2DEX2_xbusTextStart[], gspS2DEX2_xbusTextEnd[];
|
||||
extern u64 gspS2DEX2_xbusDataStart[], gspS2DEX2_xbusDataEnd[];
|
||||
extern void guS2DInitBg(uObjBg *);
|
||||
|
||||
#ifdef F3DEX_GBI_2
|
||||
# define guS2DEmuBgRect1Cyc guS2D2EmuBgRect1Cyc /*Wrapper*/
|
||||
# define guS2DEmuSetScissor guS2D2EmuSetScissor /*Wrapper*/
|
||||
extern void guS2D2EmuSetScissor(u32, u32, u32, u32, u8);
|
||||
extern void guS2D2EmuBgRect1Cyc(Gfx **, uObjBg *);
|
||||
#else
|
||||
extern void guS2DEmuSetScissor(u32, u32, u32, u32, u8);
|
||||
extern void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *);
|
||||
#endif
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
#endif /* _GS2DEX_H_ */
|
||||
|
||||
/*======== End of gs2dex.h ========*/
|
||||
Executable
+365
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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_ */
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
/* GENERATED FILE, DO NOT EDIT! */
|
||||
|
||||
/* gtState_t structure offsets for assembly language: */
|
||||
#define GT_STATE_SIZE 88
|
||||
#define GT_STATE_OFF_RENDSTATE 0x00
|
||||
#define GT_STATE_OFF_TEXSTATE 0x04
|
||||
#define GT_STATE_OFF_VTXCOUNT 0x08
|
||||
#define GT_STATE_OFF_VTXV0 0x09
|
||||
#define GT_STATE_OFF_TRICOUNT 0x0a
|
||||
#define GT_STATE_OFF_RDPCMDS 0x0c
|
||||
#define GT_STATE_OFF_OTHERMODE 0x10
|
||||
#define GT_STATE_OFF_TRANSFORM 0x18
|
||||
Executable
+269
@@ -0,0 +1,269 @@
|
||||
#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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/gu.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/mbi.h>
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/sptask.h>
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_DTOR (3.14159265358979323846/180.0)
|
||||
|
||||
#define FTOFIX32(x) (long)((x) * (float)0x00010000)
|
||||
#define FIX32TOF(x) ((float)(x) * (1.0f / (float)0x00010000))
|
||||
#define FTOFRAC8(x) ((int) MIN(((x) * (128.0f)), 127.0f) & 0xff)
|
||||
|
||||
#define FILTER_WRAP 0
|
||||
#define FILTER_CLAMP 1
|
||||
|
||||
#define RAND(x) (guRandom()%x) /* random number between 0 to x */
|
||||
|
||||
/*
|
||||
* Data Structures
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *base;
|
||||
int fmt, siz;
|
||||
int xsize, ysize;
|
||||
int lsize;
|
||||
/* current tile info */
|
||||
int addr;
|
||||
int w, h;
|
||||
int s, t;
|
||||
} Image;
|
||||
|
||||
typedef struct {
|
||||
float col[3];
|
||||
float pos[3];
|
||||
float a1, a2; /* actual color = col/(a1*dist + a2) */
|
||||
} PositionalLight;
|
||||
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
*/
|
||||
|
||||
extern int guLoadTextureBlockMipMap(Gfx **glist, unsigned char *tbuf, Image *im,
|
||||
unsigned char startTile, unsigned char pal, unsigned char cms,
|
||||
unsigned char cmt, unsigned char masks, unsigned char maskt,
|
||||
unsigned char shifts, unsigned char shiftt, unsigned char cfs,
|
||||
unsigned char cft);
|
||||
|
||||
extern int guGetDPLoadTextureTileSz (int ult, int lrt);
|
||||
extern void guDPLoadTextureTile (Gfx *glistp, void *timg,
|
||||
int texl_fmt, int texl_size,
|
||||
int img_width, int img_height,
|
||||
int uls, int ult, int lrs, int lrt,
|
||||
int palette,
|
||||
int cms, int cmt,
|
||||
int masks, int maskt,
|
||||
int shifts, int shiftt);
|
||||
|
||||
|
||||
/*
|
||||
* matrix operations:
|
||||
*
|
||||
* The 'F' version is floating point, in case the application wants
|
||||
* to do matrix manipulations and convert to fixed-point at the last
|
||||
* minute.
|
||||
*/
|
||||
extern void guMtxIdent(Mtx *m);
|
||||
extern void guMtxIdentF(float mf[4][4]);
|
||||
extern void guOrtho(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guOrthoF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustum(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustumF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guPerspective(Mtx *m, u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guLookAt(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflect(Mtx *m, LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflectF(float mf[4][4], LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtStereo(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guLookAtStereoF(float mf[4][4],
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guRotate(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guRotateF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guRotateRPY(Mtx *m, float r, float p, float y);
|
||||
extern void guRotateRPYF(float mf[4][4], float r, float p, float h);
|
||||
extern void guAlign(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guAlignF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guScale(Mtx *m, float x, float y, float z);
|
||||
extern void guScaleF(float mf[4][4], float x, float y, float z);
|
||||
extern void guTranslate(Mtx *m, float x, float y, float z);
|
||||
extern void guTranslateF(float mf[4][4], float x, float y, float z);
|
||||
extern void guPosition(Mtx *m, float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guPositionF(float mf[4][4], float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
extern void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
extern void guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
|
||||
extern void guMtxCatL(Mtx *m, Mtx *n, Mtx *res);
|
||||
extern void guMtxXFMF(float mf[4][4], float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
extern void guMtxXFML(Mtx *m, float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
|
||||
/* vector utility: */
|
||||
extern void guNormalize(float *x, float *y, float *z);
|
||||
|
||||
/* light utilities: */
|
||||
void guPosLight(PositionalLight *pl, Light *l,
|
||||
float xOb, float yOb, float zOb);
|
||||
void guPosLightHilite(PositionalLight *pl1, PositionalLight *pl2,
|
||||
Light *l1, Light *l2,
|
||||
LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xOb, float yOb, float zOb,
|
||||
float xUp, float yUp, float zUp,
|
||||
int twidth, int theight);
|
||||
extern int guRandom(void);
|
||||
|
||||
/*
|
||||
* Math functions
|
||||
*/
|
||||
extern float sinf(float angle);
|
||||
extern float cosf(float angle);
|
||||
extern signed short sins (unsigned short angle);
|
||||
extern signed short coss (unsigned short angle);
|
||||
extern float sqrtf(float value);
|
||||
#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_ */
|
||||
Executable
+633
@@ -0,0 +1,633 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1997-1998, Nintendo.
|
||||
|
||||
File gzsort.h
|
||||
Coded by Yoshitaka Yasumoto. Jun 16, 1997.
|
||||
|
||||
$Id: gzsort.h,v 1.1.1.1 2002/05/02 03:28:24 blythe Exp $
|
||||
*---------------------------------------------------------------------*/
|
||||
#ifndef _GZSORT_H_
|
||||
#define _GZSORT_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* 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 ========*/
|
||||
Executable
+280
@@ -0,0 +1,280 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: leo.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Regular → Executable
File renamed without changes.
Executable
+50
@@ -0,0 +1,50 @@
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/leosp.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _LEOSP_H_
|
||||
#define _LEOSP_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _LONGCMD
|
||||
#define _LONGCMD
|
||||
#endif
|
||||
|
||||
#include <PR/leo.h>
|
||||
|
||||
#define LEO_COMMAND_READ_LONG 0x10
|
||||
#define LEO_COMMAND_WRITE_LONG 0x11
|
||||
#define LEO_COMMAND_READ_SECTOR 0x12
|
||||
|
||||
#define LEO_CONTROL_ND 0x40 /* no defect mode */
|
||||
#define LEO_CONTROL_LONG 0x01 /* do long read/write */
|
||||
|
||||
|
||||
#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48
|
||||
#define LEO_ERROR_ILLEGAL_SECTOR_SIZE 91
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
extern s32 LeoReadWriteLong(LEOCmd *cmdBlock, s32 direction,
|
||||
s32 LBA, void *vAddr, u32 nLBAs,
|
||||
u32 secSize, OSMesgQueue *mq);
|
||||
extern s32 LeoSectorRead(LEOCmd *cmdBlock, s32 LBA, void *vAddr,
|
||||
u32 nLBAs, OSMesgQueue *mq);
|
||||
extern s32 LeoSysReadWrite(LEOCmd *cmdBlock, s32 direction,
|
||||
s32 LBA, void *vAddr, u32 nLBAs, OSMesgQueue *mq);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_LEOSP_H */
|
||||
File renamed without changes.
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#ifndef _MBI_H_
|
||||
#define _MBI_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1994, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/mbi.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Header file for the Media Binary Interface
|
||||
*
|
||||
* NOTE: This file is included by the RSP microcode, so any C-specific
|
||||
* constructs must be bracketed by #ifdef _LANGUAGE_C
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* the SHIFT macros are used to build display list commands, inserting
|
||||
* bit-fields into a 32-bit word. They take a value, a shift amount,
|
||||
* and a width.
|
||||
*
|
||||
* For the left shift, the lower bits of the value are masked,
|
||||
* then shifted left.
|
||||
*
|
||||
* For the right shift, the value is shifted right, then the lower bits
|
||||
* are masked.
|
||||
*
|
||||
* (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment)
|
||||
*
|
||||
*/
|
||||
#define _SHIFTL(v, s, w) \
|
||||
((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s)))
|
||||
#define _SHIFTR(v, s, w) \
|
||||
((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))
|
||||
|
||||
#define _SHIFT _SHIFTL /* old, for compatibility only */
|
||||
|
||||
#define G_ON (1)
|
||||
#define G_OFF (0)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Graphics Binary Interface
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/gbi.h>
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Audio Binary Interface
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/abi.h>
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Task list
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define M_GFXTASK 1
|
||||
#define M_AUDTASK 2
|
||||
#define M_VIDTASK 3
|
||||
#define M_HVQTASK 6
|
||||
#define M_HVQMTASK 7
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Segment macros and definitions
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define NUM_SEGMENTS (16)
|
||||
#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff)
|
||||
#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28)
|
||||
#define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#endif /* !_MBI_H_ */
|
||||
Regular → Executable
File renamed without changes.
Regular → Executable
File renamed without changes.
Executable
+108
@@ -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.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_ai.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_ai.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_AI_H_
|
||||
#define _OS_AI_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
|
||||
*
|
||||
*/
|
||||
|
||||
/* Audio interface (Ai) */
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_AI_H_ */
|
||||
@@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 2002 BroadOn Communications.
|
||||
|
||||
$RCSfile: os_bb.h,v $
|
||||
$Revision: 1.13 $
|
||||
$Date: 2004/06/28 22:34:42 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_BB_H_
|
||||
#define _OS_BB_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
|
||||
*
|
||||
*/
|
||||
|
||||
/* BB Player Events */
|
||||
#define OS_EVENT_FLASH 23 /* flash ctrl interrupt */
|
||||
#define OS_EVENT_AES 24 /* aes ctrl interrupt */
|
||||
#define OS_EVENT_IDE 25 /* io interface interrupt */
|
||||
#define OS_EVENT_PI_ERR 26 /* pi error interrupt */
|
||||
#define OS_EVENT_USB0 27 /* usb0 interrupt */
|
||||
#define OS_EVENT_USB1 28 /* usb1 interrupt */
|
||||
#define OS_EVENT_BUT 29 /* button interrupt */
|
||||
#define OS_EVENT_MD 30 /* module detect interrupt */
|
||||
#define OS_EVENT_DBG_WAIT_BRK 31 /* waiting for breakpoint */
|
||||
#define OS_EVENT_RDB_READ_RESET 32 /* RDB was reset */
|
||||
#define OS_EVENT_RDB_DATA_RESET 33 /* RDB was reset */
|
||||
#define OS_NUM_EVENTS 34 /* contradicts os_message.h */
|
||||
|
||||
/* BB Player I/O Messages */
|
||||
#define OS_MESG_TYPE_FLASH (OS_MESG_TYPE_BASE+7)
|
||||
#define OS_MESG_TYPE_MD (OS_MESG_TYPE_BASE+8)
|
||||
#define OS_MESG_TYPE_RDB_READ_DONE (OS_MESG_TYPE_BASE+9)
|
||||
#define OS_MESG_TYPE_RDB_READ_RESET (OS_MESG_TYPE_BASE+10)
|
||||
#define OS_MESG_TYPE_RDB_DATA_DONE (OS_MESG_TYPE_BASE+11)
|
||||
#define OS_MESG_TYPE_RDB_DATA_RESET (OS_MESG_TYPE_BASE+12)
|
||||
|
||||
/* Stack sizes for managers */
|
||||
#define OS_CARDM_STACKSIZE 4096
|
||||
|
||||
#include "os.h"
|
||||
#include "os_bbcard.h"
|
||||
#include "os_bbfs.h"
|
||||
#include "os_usb.h"
|
||||
#include "os_bbatb.h"
|
||||
#include "os_bbexec.h"
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
extern void osBbPowerOff(void);
|
||||
extern void osBbPowerOn(void);
|
||||
extern void osBbSetErrorLed(u32 value);
|
||||
extern u32 osBbGetErrorLed(void);
|
||||
extern u32 osBbGetBoxId(void);
|
||||
extern s32 osBbExecFile(s32 fd, const char *name, OSBbLaunchMetaData *md,
|
||||
u8 buffer[16*1024]);
|
||||
extern void osBbRtcInit(void);
|
||||
extern void osBbRtcSet(u8 year, u8 month, u8 day, u8 dow, u8 hour, u8 min,
|
||||
u8 sec);
|
||||
extern void osBbRtcGet(u8* year, u8* month, u8* day, u8* dow, u8* hour, u8* min,
|
||||
u8* sec);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_BB_H_ */
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 2002 - 2004 BroadOn Communications.
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_BB_H_
|
||||
#define _OS_BB_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
extern void osBbRtcGet(u8* year, u8* month, u8* day, u8* dow, u8* hour, u8* min,
|
||||
u8* sec);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_BB_H_ */
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
#ifndef _os_bb_card_h_
|
||||
#define _os_bb_card_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
|
||||
*
|
||||
*/
|
||||
|
||||
#define BBCARD_ERR_NO_CARD (-1) /* no card present */
|
||||
#define BBCARD_ERR_FAIL (-2) /* operation failed */
|
||||
#define BBCARD_ERR_INVALID (-3) /* invalid parameters */
|
||||
#define BBCARD_ERR_CHANGED (-4) /* card changed */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
extern void osBbCardInit(void);
|
||||
extern s32 osBbCardProbe(u32 dev);
|
||||
extern s32 osBbCardUnhappy(void);
|
||||
extern u32 osBbCardBlocks(u32 dev);
|
||||
extern s32 osBbCardStatus(u32 dev, u8 *status);
|
||||
extern s32 osBbCardReadId(u32 dev, u32 *mfg, u32* type);
|
||||
extern s32 osBbCardEraseBlock(u32 dev, u16 block);
|
||||
extern s32 osBbCardEraseBlocks(u32 dev, const u16 block[], u32 n);
|
||||
extern s32 osBbCardReadBlock(u32 dev, u16 block, void* addr, void* spare);
|
||||
extern s32 osBbCardWriteBlock(u32 dev, u16 block, const void* addr,
|
||||
const void* spare);
|
||||
extern s32 osBbCardWriteBlocks(u32 dev, const u16 block[], u32 n,
|
||||
const void* addr, const void* spare);
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
#ifndef __os_bb_metadata_h__
|
||||
#define __os_bb_metadata_h__
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/bbtypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
typedef struct {
|
||||
u32 eepromAddress;
|
||||
u32 eepromSize;
|
||||
u32 flashAddress;
|
||||
u32 flashSize;
|
||||
u32 sramAddress;
|
||||
u32 sramSize;
|
||||
u32 pakAddress[MAXCONTROLLERS];
|
||||
u32 pakSize;
|
||||
} OSBbStateVector;
|
||||
|
||||
typedef struct {
|
||||
OSBbStateVector state;
|
||||
|
||||
u32 romBase;
|
||||
s32 tvType;
|
||||
u32 memSize;
|
||||
u32 errataSize;
|
||||
u32 errataAddress;
|
||||
|
||||
u32 magic;
|
||||
} OSBbLaunchMetaData;
|
||||
|
||||
#define BB_METADATA_MAGIC 0x43414d00
|
||||
#define BB_MAX_AUXDATA_SIZE 32768
|
||||
#define BB_MAX_AUXDATA 16
|
||||
#define BB_STATENAME_LEN 16
|
||||
|
||||
/* Extract permitted auxdata from the metadata */
|
||||
#define BB_AUXDATA_COUNT(md) ((md)->magic & 0xFF)
|
||||
|
||||
extern s32 osBbSaveState(char stateName[] /* OUTPUT, 8.3 filename */, BbTicketId* tid);
|
||||
extern s32 osBbLoadState(const char *name, BbTicketId tid, OSBbStateVector *sv, s32 bindings[MAXCONTROLLERS]);
|
||||
extern s32 osBbGetLaunchMetaData(OSBbLaunchMetaData *md, u16 *blockList, s32 listSize);
|
||||
extern u32 osBbLoadApp(OSBbLaunchMetaData *md, u16* blockList, s32 listSize, s32 loadAll);
|
||||
extern s32 osBbExecApp(u32 addr);
|
||||
extern s32 osBbVerifyFile(const char *name, u8 block[BB_FL_BLOCK_SIZE]);
|
||||
extern s32 osBbVerifySig(const char *name, BbEccSig sig, u8 block[BB_FL_BLOCK_SIZE]);
|
||||
extern s32 osBbSignFile(const char *name, u8 block[BB_FL_BLOCK_SIZE]);
|
||||
extern s32 osBbDeleteSignedFile(const char *name, u8 block[BB_FL_BLOCK_SIZE]);
|
||||
|
||||
extern void osBbInitState(const char *name);
|
||||
extern s32 osBbAuxDataGetLimit();
|
||||
extern s32 osBbAuxDataSetLimit(u8 limit);
|
||||
|
||||
/* State functions to be used by games */
|
||||
extern s32 osBbGameCommitState();
|
||||
extern s32 osBbAuxDataInit(void* buf, u32 len);
|
||||
extern s32 osBbAuxDataSave(u8 id, const void* buf, u32 len);
|
||||
extern s32 osBbAuxDataLoad(u8 id, void* buf, u32 len);
|
||||
extern s32 osBbAuxDataDelete(u8 id);
|
||||
extern s32 osBbAuxDataSize(u8 id);
|
||||
extern s32 osBbAuxDataIds(u8 ids[BB_MAX_AUXDATA]);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#ifndef __os_bb_exec_h__
|
||||
#define __os_bb_exec_h__
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
#define BB_MAX_AUXDATA 16
|
||||
|
||||
extern s32 osBbGameCommitState();
|
||||
extern s32 osBbAuxDataInit(void* buf, u32 len);
|
||||
extern s32 osBbAuxDataSave(u8 id, const void* buf, u32 len);
|
||||
extern s32 osBbAuxDataLoad(u8 id, void* buf, u32 len);
|
||||
extern s32 osBbAuxDataDelete(u8 id);
|
||||
extern s32 osBbAuxDataSize(u8 id);
|
||||
extern s32 osBbAuxDataIds(u8 ids[BB_MAX_AUXDATA]);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __os_bb_exec_h__ */
|
||||
@@ -0,0 +1,108 @@
|
||||
#ifndef __os_bb_fs_h__
|
||||
#define __os_bb_fs_h__
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/bbfs.h>
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
#ifndef WIN32
|
||||
u8 root[2*16*1024] __attribute__((aligned(16))); /* room for two FATs */
|
||||
#else
|
||||
u8 root[2*16*1024]; /* room for two FATs */
|
||||
#endif
|
||||
} OSBbFs;
|
||||
|
||||
typedef struct {
|
||||
u16 files;
|
||||
u16 blocks;
|
||||
u16 freeFiles;
|
||||
u16 freeBlocks;
|
||||
} OSBbStatFs;
|
||||
|
||||
typedef struct {
|
||||
char name[BB_INODE16_NAMELEN+2]; /* extra space for '.' and 0 termination */
|
||||
u8 type;
|
||||
u32 size;
|
||||
} OSBbDirEnt;
|
||||
|
||||
typedef struct {
|
||||
u8 type;
|
||||
u32 size;
|
||||
} OSBbStatBuf;
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#define BBFS_ERR_NO_CARD (-1) /* card not present */
|
||||
#define BBFS_ERR_FAIL (-2) /* operation failed */
|
||||
#define BBFS_ERR_INVALID (-3) /* invalid parameters */
|
||||
#define BBFS_ERR_CHANGED (-4) /* card changed */
|
||||
#define BBFS_ERR_UNINIT (-5) /* fs uninitialized */
|
||||
#define BBFS_ERR_EXISTS (-6) /* file exists */
|
||||
#define BBFS_ERR_SPACE (-7) /* no space */
|
||||
#define BBFS_ERR_ENTRY (-8) /* no entry */
|
||||
|
||||
/* Used for saving auxilliary game state data */
|
||||
#define BBFS_ERR_STATE (-9) /* invalid state */
|
||||
#define BBFS_ERR_STATE_LIMIT (-10) /* state limit reached */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
s32 osBbFInit(OSBbFs* fs);
|
||||
s32 osBbFStatFs(OSBbStatFs* fs);
|
||||
s32 osBbFReadDir(OSBbDirEnt* dir, u32 count);
|
||||
s32 osBbFOpen(const char* name, const char* mode);
|
||||
s32 osBbFCreate(const char*name, u8 type, u32 len);
|
||||
s32 osBbFDelete(const char* name);
|
||||
s32 osBbFRename(const char* old, const char* new);
|
||||
s32 osBbFClose(s32 fd);
|
||||
s32 osBbFRead(s32 fd, u32 off, void* buf, u32 len);
|
||||
s32 osBbFWrite(s32 fd, u32 off, const void* buf, u32 len);
|
||||
s32 osBbFStat(s32 fd, OSBbStatBuf* sb, u16* blockList, u32 listLen);
|
||||
s32 osBbFShuffle(s32 sfd, s32 dfd, s32 release, void* buf, u32 len);
|
||||
s32 osBbFRepairBlock(s32 fd, u32 off, void* buf, u32 len);
|
||||
s32 osBbFAutoSync(u32 on);
|
||||
s32 osBbFSync(void);
|
||||
#endif
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
#endif /*__os_bb_fs_h__*/
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#ifndef __os_bb_fs_h__
|
||||
#define __os_bb_fs_h__
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#define BBFS_ERR_NO_CARD (-1) /* card not present */
|
||||
#define BBFS_ERR_FAIL (-2) /* operation failed */
|
||||
#define BBFS_ERR_INVALID (-3) /* invalid parameters */
|
||||
#define BBFS_ERR_CHANGED (-4) /* card changed */
|
||||
#define BBFS_ERR_UNINIT (-5) /* fs uninitialized */
|
||||
#define BBFS_ERR_EXISTS (-6) /* file exists */
|
||||
#define BBFS_ERR_SPACE (-7) /* no space */
|
||||
#define BBFS_ERR_ENTRY (-8) /* no entry */
|
||||
|
||||
/* Used for saving auxilliary game state data */
|
||||
#define BBFS_ERR_STATE (-9) /* invalid state */
|
||||
#define BBFS_ERR_STATE_LIMIT (-10) /* state limit reached */
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
#endif /*__os_bb_fs_h__*/
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_cache.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_cache.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_CACHE_H_
|
||||
#define _OS_CACHE_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
|
||||
*
|
||||
*/
|
||||
|
||||
#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Cache operations and macros */
|
||||
|
||||
extern void osInvalDCache(void *, s32);
|
||||
extern void osInvalICache(void *, s32);
|
||||
extern void osWritebackDCache(void *, s32);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CACHE_H_ */
|
||||
Executable
+219
@@ -0,0 +1,219 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_cont.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_cont.h,v $
|
||||
$Revision: 1.2 $
|
||||
$Date: 2004/10/29 00:51:42 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_CONT_H_
|
||||
#define _OS_CONT_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 controllers
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u16 type; /* Controller Type */
|
||||
u8 status; /* Controller status */
|
||||
#ifndef BBC
|
||||
u8 errno;
|
||||
#else
|
||||
u8 err_no;
|
||||
#endif
|
||||
}OSContStatus;
|
||||
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x; /* -80 <= stick_x <= 80 */
|
||||
s8 stick_y; /* -80 <= stick_y <= 80 */
|
||||
#ifndef BBC
|
||||
u8 errno;
|
||||
#else
|
||||
u8 err_no;
|
||||
#endif
|
||||
} OSContPad;
|
||||
|
||||
typedef struct {
|
||||
void *address; /* Ram pad Address: 11 bits */
|
||||
u8 databuffer[32]; /* address of the data buffer */
|
||||
u8 addressCrc; /* CRC code for address */
|
||||
u8 dataCrc; /* CRC code for data */
|
||||
#ifndef BBC
|
||||
u8 errno;
|
||||
#else
|
||||
u8 err_no;
|
||||
#endif
|
||||
} OSContRamIo;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Controllers number
|
||||
*/
|
||||
|
||||
#ifndef _HW_VERSION_1
|
||||
#define MAXCONTROLLERS 4
|
||||
#else
|
||||
#define MAXCONTROLLERS 6
|
||||
#endif
|
||||
|
||||
/* controller errors */
|
||||
#define CONT_NO_RESPONSE_ERROR 0x8
|
||||
#define CONT_OVERRUN_ERROR 0x4
|
||||
#ifdef _HW_VERSION_1
|
||||
#define CONT_FRAME_ERROR 0x2
|
||||
#define CONT_COLLISION_ERROR 0x1
|
||||
#endif
|
||||
|
||||
/* Controller type */
|
||||
|
||||
#define CONT_ABSOLUTE 0x0001
|
||||
#define CONT_RELATIVE 0x0002
|
||||
#define CONT_JOYPORT 0x0004
|
||||
#define CONT_EEPROM 0x8000
|
||||
#define CONT_EEP16K 0x4000
|
||||
#define CONT_TYPE_MASK 0x1f07
|
||||
#define CONT_TYPE_NORMAL 0x0005
|
||||
#define CONT_TYPE_MOUSE 0x0002
|
||||
#define CONT_TYPE_VOICE 0x0100
|
||||
|
||||
/* Controller status */
|
||||
|
||||
#define CONT_CARD_ON 0x01
|
||||
#define CONT_CARD_PULL 0x02
|
||||
#define CONT_ADDR_CRC_ER 0x04
|
||||
#define CONT_EEPROM_BUSY 0x80
|
||||
|
||||
/* Buttons */
|
||||
|
||||
#define CONT_A 0x8000
|
||||
#define CONT_B 0x4000
|
||||
#define CONT_G 0x2000
|
||||
#define CONT_START 0x1000
|
||||
#define CONT_UP 0x0800
|
||||
#define CONT_DOWN 0x0400
|
||||
#define CONT_LEFT 0x0200
|
||||
#define CONT_RIGHT 0x0100
|
||||
#define CONT_L 0x0020
|
||||
#define CONT_R 0x0010
|
||||
#define CONT_E 0x0008
|
||||
#define CONT_D 0x0004
|
||||
#define CONT_C 0x0002
|
||||
#define CONT_F 0x0001
|
||||
|
||||
/* Nintendo's official button names */
|
||||
|
||||
#define A_BUTTON CONT_A
|
||||
#define B_BUTTON CONT_B
|
||||
#define L_TRIG CONT_L
|
||||
#define R_TRIG CONT_R
|
||||
#define Z_TRIG CONT_G
|
||||
#define START_BUTTON CONT_START
|
||||
#define U_JPAD CONT_UP
|
||||
#define L_JPAD CONT_LEFT
|
||||
#define R_JPAD CONT_RIGHT
|
||||
#define D_JPAD CONT_DOWN
|
||||
#define U_CBUTTONS CONT_E
|
||||
#define L_CBUTTONS CONT_C
|
||||
#define R_CBUTTONS CONT_F
|
||||
#define D_CBUTTONS CONT_D
|
||||
|
||||
/* Controller error number */
|
||||
|
||||
#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */
|
||||
#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */
|
||||
#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */
|
||||
#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */
|
||||
#define CONT_ERR_NOT_READY 12
|
||||
#define CONT_ERR_VOICE_MEMORY 13
|
||||
#define CONT_ERR_VOICE_WORD 14
|
||||
#define CONT_ERR_VOICE_NO_RESPONSE 15
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Controller interface */
|
||||
|
||||
extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *);
|
||||
extern s32 osContReset(OSMesgQueue *, OSContStatus *);
|
||||
extern s32 osContStartQuery(OSMesgQueue *);
|
||||
extern s32 osContStartReadData(OSMesgQueue *);
|
||||
#ifndef _HW_VERSION_1
|
||||
extern s32 osContSetCh(u8);
|
||||
#endif
|
||||
extern void osContGetQuery(OSContStatus *);
|
||||
extern void osContGetReadData(OSContPad *);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CONT_H_ */
|
||||
Executable
+111
@@ -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.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+117
@@ -0,0 +1,117 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_eeprom.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_eeprom.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_EEPROM_H_
|
||||
#define _OS_EEPROM_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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* EEPROM TYPE */
|
||||
|
||||
#define EEPROM_TYPE_4K 0x01
|
||||
#define EEPROM_TYPE_16K 0x02
|
||||
|
||||
/* definition for EEPROM */
|
||||
|
||||
#define EEPROM_MAXBLOCKS 64
|
||||
#define EEP16K_MAXBLOCKS 256
|
||||
#define EEPROM_BLOCK_SIZE 8
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* EEPROM interface */
|
||||
|
||||
extern s32 osEepromProbe(OSMesgQueue *);
|
||||
extern s32 osEepromRead(OSMesgQueue *, u8, u8 *);
|
||||
extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *);
|
||||
extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int);
|
||||
extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_EEPROM_H_ */
|
||||
Executable
+86
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+119
@@ -0,0 +1,119 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_exception.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_exception.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_EXCEPTION_H_
|
||||
#define _OS_EXCEPTION_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 u32 OSIntMask;
|
||||
typedef u32 OSHWIntr;
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* Flags for debugging purpose */
|
||||
|
||||
#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */
|
||||
#define OS_FLAG_FAULT 2 /* CPU fault has occurred */
|
||||
|
||||
/* Interrupt masks */
|
||||
|
||||
#define OS_IM_NONE 0x00000001
|
||||
#define OS_IM_SW1 0x00000501
|
||||
#define OS_IM_SW2 0x00000601
|
||||
#define OS_IM_CART 0x00000c01
|
||||
#define OS_IM_PRENMI 0x00001401
|
||||
#define OS_IM_RDBWRITE 0x00002401
|
||||
#define OS_IM_RDBREAD 0x00004401
|
||||
#define OS_IM_COUNTER 0x00008401
|
||||
#define OS_IM_CPU 0x0000ff01
|
||||
#define OS_IM_SP 0x00010401
|
||||
#define OS_IM_SI 0x00020401
|
||||
#define OS_IM_AI 0x00040401
|
||||
#define OS_IM_VI 0x00080401
|
||||
#define OS_IM_PI 0x00100401
|
||||
#define OS_IM_DP 0x00200401
|
||||
#define OS_IM_ALL 0x003fff01
|
||||
#define RCP_IMASK 0x003f0000
|
||||
#define RCP_IMASKSHIFT 16
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Interrupt operations */
|
||||
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_EXCEPTION_H_ */
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_flash.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_gbpak.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+86
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+170
@@ -0,0 +1,170 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.2 $
|
||||
$Date: 2004/06/28 22:34:42 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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);
|
||||
|
||||
#ifdef BBPLAYER
|
||||
/* BB versions of osReadHost and osWriteHost that returns upon error */
|
||||
extern s32 osBbReadHost(void *, u32);
|
||||
extern s32 osBbWriteHost(void *, u32);
|
||||
#endif
|
||||
|
||||
/* RDB port operations */
|
||||
|
||||
extern void osInitRdb(u8 *sendBuf, u32 sendSize);
|
||||
|
||||
#ifdef BBPLAYER
|
||||
extern void osResetRdb();
|
||||
#endif
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_HOST_H_ */
|
||||
Executable
+49
@@ -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.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+43
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+45
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+49
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+45
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+42
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:24 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+59
@@ -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.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+48
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+46
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+43
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+47
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
Executable
+103
@@ -0,0 +1,103 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.5 $
|
||||
$Date: 2004/11/16 01:47:19 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_LIBC_H_
|
||||
#define _OS_LIBC_H_
|
||||
|
||||
#include "os_pfs.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
|
||||
*
|
||||
*/
|
||||
|
||||
/* 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 */
|
||||
|
||||
#ifndef WIN32
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
#endif
|
||||
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_ */
|
||||
Executable
+167
@@ -0,0 +1,167 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_message.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_message.h,v $
|
||||
$Revision: 1.3 $
|
||||
$Date: 2004/06/28 22:34:42 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_MESSAGE_H_
|
||||
#define _OS_MESSAGE_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 u32 OSEvent;
|
||||
|
||||
/*
|
||||
* Structure for message
|
||||
*/
|
||||
typedef void * OSMesg;
|
||||
|
||||
/*
|
||||
* Structure for message queue
|
||||
*/
|
||||
typedef struct OSMesgQueue_s {
|
||||
OSThread *mtqueue; /* Queue to store threads blocked
|
||||
on empty mailboxes (receive) */
|
||||
OSThread *fullqueue; /* Queue to store threads blocked
|
||||
on full mailboxes (send) */
|
||||
s32 validCount; /* Contains number of valid message */
|
||||
s32 first; /* Points to first valid message */
|
||||
s32 msgCount; /* Contains total # of messages */
|
||||
OSMesg *msg; /* Points to message buffer array */
|
||||
} OSMesgQueue;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* Events */
|
||||
#ifndef BBPLAYER
|
||||
/*XXXblythe events also defined is os_bb.h*/
|
||||
#ifdef _FINALROM
|
||||
#define OS_NUM_EVENTS 15
|
||||
#else
|
||||
#define OS_NUM_EVENTS 23
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */
|
||||
#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */
|
||||
#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */
|
||||
#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */
|
||||
#define OS_EVENT_SP 4 /* SP task done interrupt */
|
||||
#define OS_EVENT_SI 5 /* SI (controller) interrupt */
|
||||
#define OS_EVENT_AI 6 /* AI interrupt */
|
||||
#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */
|
||||
#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */
|
||||
#define OS_EVENT_DP 9 /* DP full sync interrupt */
|
||||
#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */
|
||||
#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */
|
||||
#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */
|
||||
#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */
|
||||
#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */
|
||||
#ifndef _FINALROM
|
||||
#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */
|
||||
#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */
|
||||
#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */
|
||||
#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */
|
||||
#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */
|
||||
#define OS_EVENT_RDB_DBG_DONE 20
|
||||
#define OS_EVENT_RDB_FLUSH_PROF 21
|
||||
#define OS_EVENT_RDB_ACK_PROF 22
|
||||
/* BBPlayer event messages continues in os_bb.h */
|
||||
#endif
|
||||
|
||||
/* Flags to turn blocking on/off when sending/receiving message */
|
||||
|
||||
#define OS_MESG_NOBLOCK 0
|
||||
#define OS_MESG_BLOCK 1
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* Get count of valid messages in queue */
|
||||
#define MQ_GET_COUNT(mq) ((mq)->validCount)
|
||||
|
||||
/* Figure out if message queue is empty or full */
|
||||
#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0)
|
||||
#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount)
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Message operations */
|
||||
|
||||
extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
|
||||
extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
|
||||
|
||||
/* Event operations */
|
||||
|
||||
extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_MESSAGE_H_ */
|
||||
Executable
+83
@@ -0,0 +1,83 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_motor.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+174
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+224
@@ -0,0 +1,224 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_pi.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 {
|
||||
u32 errStatus; /* error status */
|
||||
void *dramAddr; /* RDRAM buffer address (DMA) */
|
||||
void *C2Addr; /* C2 buffer address */
|
||||
u32 sectorSize; /* size of transfering sector */
|
||||
u32 C1ErrNum; /* total # of C1 errors */
|
||||
u32 C1ErrSector[4]; /* error sectors */
|
||||
} __OSBlockInfo;
|
||||
|
||||
typedef struct {
|
||||
u32 cmdType; /* for disk only */
|
||||
u16 transferMode; /* Block, Track, or sector? */
|
||||
u16 blockNum; /* which block is transfering */
|
||||
s32 sectorNum; /* which sector is transfering */
|
||||
u32 devAddr; /* Device buffer address */
|
||||
u32 bmCtlShadow; /* asic bm_ctl(510) register shadow ram */
|
||||
u32 seqCtlShadow; /* asic seq_ctl(518) register shadow ram */
|
||||
__OSBlockInfo block[2]; /* bolck transfer info */
|
||||
} __OSTranxInfo;
|
||||
|
||||
|
||||
typedef struct OSPiHandle_s {
|
||||
struct OSPiHandle_s *next; /* point to next handle on the table */
|
||||
u8 type; /* DEVICE_TYPE_BULK for disk */
|
||||
u8 latency; /* domain latency */
|
||||
u8 pageSize; /* domain page size */
|
||||
u8 relDuration; /* domain release duration */
|
||||
u8 pulse; /* domain pulse width */
|
||||
u8 domain; /* which domain */
|
||||
u32 baseAddress; /* Domain address */
|
||||
u32 speed; /* for roms only */
|
||||
/* The following are "private" elements" */
|
||||
__OSTranxInfo transferInfo; /* for disk only */
|
||||
} OSPiHandle;
|
||||
|
||||
typedef struct {
|
||||
u8 type;
|
||||
u32 address;
|
||||
} OSPiInfo;
|
||||
|
||||
/*
|
||||
* Structure for I/O message block
|
||||
*/
|
||||
typedef struct {
|
||||
u16 type; /* Message type */
|
||||
u8 pri; /* Message priority (High or Normal) */
|
||||
u8 status; /* Return status */
|
||||
OSMesgQueue *retQueue; /* Return message queue to notify I/O
|
||||
* completion */
|
||||
} OSIoMesgHdr;
|
||||
|
||||
typedef struct {
|
||||
OSIoMesgHdr hdr; /* Message header */
|
||||
void * dramAddr; /* RDRAM buffer address (DMA) */
|
||||
u32 devAddr; /* Device buffer address (DMA) */
|
||||
u32 size; /* DMA transfer size in bytes */
|
||||
OSPiHandle *piHandle; /* PI device handle */
|
||||
} OSIoMesg;
|
||||
|
||||
/*
|
||||
* Structure for device manager block
|
||||
*/
|
||||
typedef struct {
|
||||
s32 active; /* Status flag */
|
||||
OSThread *thread; /* Calling thread */
|
||||
OSMesgQueue *cmdQueue; /* Command queue */
|
||||
OSMesgQueue *evtQueue; /* Event queue */
|
||||
OSMesgQueue *acsQueue; /* Access queue */
|
||||
/* Raw DMA routine */
|
||||
s32 (*dma)(s32, u32, void *, u32);
|
||||
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
|
||||
} OSDevMgr;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* Flags to indicate direction of data transfer */
|
||||
|
||||
#define OS_READ 0 /* device -> RDRAM */
|
||||
#define OS_WRITE 1 /* device <- RDRAM */
|
||||
#define OS_OTHERS 2 /* for Leo disk only */
|
||||
|
||||
/*
|
||||
* I/O message types
|
||||
*/
|
||||
#define OS_MESG_TYPE_BASE (10)
|
||||
#define OS_MESG_TYPE_LOOPBACK (OS_MESG_TYPE_BASE+0)
|
||||
#define OS_MESG_TYPE_DMAREAD (OS_MESG_TYPE_BASE+1)
|
||||
#define OS_MESG_TYPE_DMAWRITE (OS_MESG_TYPE_BASE+2)
|
||||
#define OS_MESG_TYPE_VRETRACE (OS_MESG_TYPE_BASE+3)
|
||||
#define OS_MESG_TYPE_COUNTER (OS_MESG_TYPE_BASE+4)
|
||||
#define OS_MESG_TYPE_EDMAREAD (OS_MESG_TYPE_BASE+5)
|
||||
#define OS_MESG_TYPE_EDMAWRITE (OS_MESG_TYPE_BASE+6)
|
||||
|
||||
/*
|
||||
* I/O message priority
|
||||
*/
|
||||
#define OS_MESG_PRI_NORMAL 0
|
||||
#define OS_MESG_PRI_HIGH 1
|
||||
|
||||
/*
|
||||
* 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_ */
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_rdp.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_rdp.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_RDP_H_
|
||||
#define _OS_RDP_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
|
||||
*
|
||||
*/
|
||||
|
||||
/* Display processor interface (Dp) */
|
||||
extern u32 osDpGetStatus(void);
|
||||
extern void osDpSetStatus(u32);
|
||||
extern void osDpGetCounters(u32 *);
|
||||
extern s32 osDpSetNextBuffer(void *, u64);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_RDP_H_ */
|
||||
Executable
+90
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+86
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+86
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+118
@@ -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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+174
@@ -0,0 +1,174 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_thread.h,v $
|
||||
$Revision: 1.4 $
|
||||
$Date: 2004/02/06 02:16:48 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_THREAD_H_
|
||||
#define _OS_THREAD_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 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 {
|
||||
u32 flag;
|
||||
u32 count;
|
||||
u64 time;
|
||||
} __OSThreadprofile_s;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* Thread states */
|
||||
|
||||
#define OS_STATE_STOPPED 1
|
||||
#define OS_STATE_RUNNABLE 2
|
||||
#define OS_STATE_RUNNING 4
|
||||
#define OS_STATE_WAITING 8
|
||||
|
||||
/* 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 */
|
||||
|
||||
#ifdef BBPLAYER
|
||||
/* BB Player thread IDs */
|
||||
#define OS_TID_RMONMAIN 3201
|
||||
#define OS_TID_RMONIO 3202
|
||||
#define OS_TID_PROFILEIO 3251
|
||||
#define OS_TID_PIMGR 3301
|
||||
#define OS_TID_RAMROM 3302
|
||||
#define OS_TID_VIMGR 3401
|
||||
|
||||
/* We also have two USB threads (see osint_usb.h) */
|
||||
#define OS_TID_USB0 (OS_USB_TID_BASE) /* 3141 */
|
||||
#define OS_TID_USB1 (OS_USB_TID_BASE+1) /* 3142 */
|
||||
|
||||
/* Also define constants for GDB */
|
||||
#define OS_PRIORITY_GDB OS_PRIORITY_RMON
|
||||
#define OS_TID_GDBMAIN OS_TID_RMONMAIN
|
||||
#define OS_TID_GDBIO OS_TID_RMONIO
|
||||
|
||||
#endif
|
||||
|
||||
/* 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_ */
|
||||
Executable
+114
@@ -0,0 +1,114 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_TIME_H_
|
||||
#define _OS_TIME_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 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;
|
||||
|
||||
|
||||
#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
|
||||
*
|
||||
*/
|
||||
|
||||
/* 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_ */
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_tlb.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_tlb.h,v $
|
||||
$Revision: 1.1.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_TLB_H_
|
||||
#define _OS_TLB_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 u32 OSPageMask;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Page size argument for TLB routines
|
||||
*/
|
||||
#define OS_PM_4K 0x0000000
|
||||
#define OS_PM_16K 0x0006000
|
||||
#define OS_PM_64K 0x001e000
|
||||
#define OS_PM_256K 0x007e000
|
||||
#define OS_PM_1M 0x01fe000
|
||||
#define OS_PM_4M 0x07fe000
|
||||
#define OS_PM_16M 0x1ffe000
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* TLB management routines */
|
||||
|
||||
extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
|
||||
extern void osMapTLBRdb(void);
|
||||
extern void osUnmapTLB(s32);
|
||||
extern void osUnmapTLBAll(void);
|
||||
extern void osSetTLBASID(s32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_TLB_H_ */
|
||||
Executable
+172
@@ -0,0 +1,172 @@
|
||||
/*====================================================================
|
||||
* os_usb.h
|
||||
*
|
||||
* Copyright 2003, BroadOn Communications Corp.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of BroadOn Communications
|
||||
* Corp.; 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 BroadOn Communications.
|
||||
*
|
||||
* 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) 2003 BroadOn Communications Corp
|
||||
|
||||
$RCSfile: os_usb.h,v $
|
||||
$Revision: 1.12 $
|
||||
$Date: 2004/09/03 03:52:47 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_USB_H_
|
||||
#define _OS_USB_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 to describe USB device
|
||||
*/
|
||||
typedef struct OSBbUsbInfo_s {
|
||||
u8 ua_type; /* controller mode (host or device) */
|
||||
u8 ua_class; /* device class */
|
||||
u8 ua_subclass; /* subclass */
|
||||
u8 ua_protocol; /* protocol */
|
||||
u16 ua_vendor; /* vendor */
|
||||
u16 ua_product; /* product */
|
||||
u8 ua_cfg; /* configuration */
|
||||
u8 ua_ifc; /* interface */
|
||||
u8 ua_ep; /* endpoint */
|
||||
u8 ua_speed; /* LS/FS/HS */
|
||||
u8 ua_mode; /* R, W or R/W */
|
||||
u8 ua_blksize; /* block size */
|
||||
u8 ua_support; /* have driver */
|
||||
u8 ua_state; /* device state (attached?) */
|
||||
u8 *ua_mfr_str; /* manufacturer string */
|
||||
u8 *ua_prod_str; /* product description string */
|
||||
u8 *ua_driver_name; /* driver name */
|
||||
} OSBbUsbInfo;
|
||||
|
||||
/*
|
||||
* Handle for USB device
|
||||
*/
|
||||
typedef void *OSBbUsbHandle;
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* USB Controller Modes
|
||||
*/
|
||||
#define OS_USB_TYPE_DISABLED 0
|
||||
#define OS_USB_TYPE_HOST 1
|
||||
#define OS_USB_TYPE_DEVICE 2
|
||||
#define OS_USB_TYPE_EITHER (OS_USB_TYPE_HOST|OS_USB_HOST_DEVICE)
|
||||
|
||||
/*
|
||||
* USB Device States
|
||||
*/
|
||||
#define OS_USB_STATE_NULL 0
|
||||
#define OS_USB_STATE_ATTACHED 1
|
||||
|
||||
/*
|
||||
* USB Device Classes
|
||||
*/
|
||||
#define OS_USB_DEV_GENERIC 0
|
||||
#define OS_USB_DEV_SERIAL 1
|
||||
#define OS_USB_DEV_MODEM 2
|
||||
#define OS_USB_DEV_MSD 3
|
||||
|
||||
/*
|
||||
* USB Device Speeds
|
||||
*/
|
||||
#define OS_USB_LOW_SPEED 0 /* LS (1Mb/s) */
|
||||
#define OS_USB_FULL_SPEED 1 /* FS (12Mb/s) */
|
||||
#define OS_USB_HIGH_SPEED 2 /* HS (480Mb/s) */
|
||||
|
||||
/*
|
||||
* USB Device Access Modes
|
||||
*/
|
||||
#define OS_USB_MODE_READ 1 /* Read only */
|
||||
#define OS_USB_MODE_WRITE 2 /* Write only */
|
||||
#define OS_USB_MODE_RW 3 /* R/W = READ | WRITE */
|
||||
|
||||
|
||||
/*
|
||||
* USB subsystem parameters
|
||||
*/
|
||||
#define OS_USB_MAX_CONTROLLERS 2
|
||||
#define OS_USB_QUEUE_SIZE 128
|
||||
|
||||
/*
|
||||
* Error codes
|
||||
*/
|
||||
#define OS_USB_ERROR_BASE 201
|
||||
#define EUSBRINVAL OS_USB_ERROR_BASE+0
|
||||
#define EUSBAGAIN OS_USB_ERROR_BASE+1
|
||||
#define EUSBBUSY OS_USB_ERROR_BASE+2
|
||||
#define EUSBNXIO OS_USB_ERROR_BASE+3
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* USB interface */
|
||||
extern s32 osBbUsbInit(void);
|
||||
extern s32 osBbUsbSetCtlrModes(s32, u32);
|
||||
extern u32 osBbUsbGetResetCount(s32);
|
||||
extern s32 osBbUsbDevQuery(s32, OSBbUsbInfo *, s32);
|
||||
extern s32 osBbUsbDevGetHandle(s32, OSBbUsbInfo *, OSBbUsbHandle *);
|
||||
extern s32 osBbUsbDevFreeHandle(OSBbUsbHandle);
|
||||
extern s32 osBbUsbDevRead(OSBbUsbHandle, u8 *, s32, u64);
|
||||
extern s32 osBbUsbDevWrite(OSBbUsbHandle, u8 *, s32, u64);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_USB_H_ */
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_version.h,v $
|
||||
$Revision: 1.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+298
@@ -0,0 +1,298 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.1.1 $
|
||||
$Date: 2002/05/02 03:28:25 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_VI_H_
|
||||
#define _OS_VI_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 to store VI register values that remain the same between 2 fields
|
||||
*/
|
||||
typedef struct {
|
||||
u32 ctrl;
|
||||
u32 width;
|
||||
u32 burst;
|
||||
u32 vSync;
|
||||
u32 hSync;
|
||||
u32 leap;
|
||||
u32 hStart;
|
||||
u32 xScale;
|
||||
u32 vCurrent;
|
||||
} OSViCommonRegs;
|
||||
|
||||
|
||||
/*
|
||||
* Structure to store VI register values that change between fields
|
||||
*/
|
||||
typedef struct {
|
||||
u32 origin;
|
||||
u32 yScale;
|
||||
u32 vStart;
|
||||
u32 vBurst;
|
||||
u32 vIntr;
|
||||
} OSViFieldRegs;
|
||||
|
||||
|
||||
/*
|
||||
* Structure for VI mode
|
||||
*/
|
||||
typedef struct {
|
||||
u8 type; /* Mode type */
|
||||
OSViCommonRegs comRegs; /* Common registers for both fields */
|
||||
OSViFieldRegs fldRegs[2]; /* Registers for Field 1 & 2 */
|
||||
} OSViMode;
|
||||
|
||||
|
||||
#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
|
||||
#define OS_VI_NTSC_LAF1 3
|
||||
#define OS_VI_NTSC_LPN2 4
|
||||
#define OS_VI_NTSC_LPF2 5
|
||||
#define OS_VI_NTSC_LAN2 6
|
||||
#define OS_VI_NTSC_LAF2 7
|
||||
#define OS_VI_NTSC_HPN1 8
|
||||
#define OS_VI_NTSC_HPF1 9
|
||||
#define OS_VI_NTSC_HAN1 10
|
||||
#define OS_VI_NTSC_HAF1 11
|
||||
#define OS_VI_NTSC_HPN2 12
|
||||
#define OS_VI_NTSC_HPF2 13
|
||||
|
||||
#define OS_VI_PAL_LPN1 14 /* PAL */
|
||||
#define OS_VI_PAL_LPF1 15
|
||||
#define OS_VI_PAL_LAN1 16
|
||||
#define OS_VI_PAL_LAF1 17
|
||||
#define OS_VI_PAL_LPN2 18
|
||||
#define OS_VI_PAL_LPF2 19
|
||||
#define OS_VI_PAL_LAN2 20
|
||||
#define OS_VI_PAL_LAF2 21
|
||||
#define OS_VI_PAL_HPN1 22
|
||||
#define OS_VI_PAL_HPF1 23
|
||||
#define OS_VI_PAL_HAN1 24
|
||||
#define OS_VI_PAL_HAF1 25
|
||||
#define OS_VI_PAL_HPN2 26
|
||||
#define OS_VI_PAL_HPF2 27
|
||||
|
||||
#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */
|
||||
#define OS_VI_MPAL_LPF1 29
|
||||
#define OS_VI_MPAL_LAN1 30
|
||||
#define OS_VI_MPAL_LAF1 31
|
||||
#define OS_VI_MPAL_LPN2 32
|
||||
#define OS_VI_MPAL_LPF2 33
|
||||
#define OS_VI_MPAL_LAN2 34
|
||||
#define OS_VI_MPAL_LAF2 35
|
||||
#define OS_VI_MPAL_HPN1 36
|
||||
#define OS_VI_MPAL_HPF1 37
|
||||
#define OS_VI_MPAL_HAN1 38
|
||||
#define OS_VI_MPAL_HAF1 39
|
||||
#define OS_VI_MPAL_HPN2 40
|
||||
#define OS_VI_MPAL_HPF2 41
|
||||
|
||||
#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_ */
|
||||
Executable
+108
@@ -0,0 +1,108 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_voice.h,v $
|
||||
$Revision: 1.1.1.2 $
|
||||
$Date: 2002/10/29 08:06:34 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#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.3 $
|
||||
* $Date: 2003/04/26 23:43:20 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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))
|
||||
#ifdef BBPLAYER
|
||||
extern unsigned long __osBbIsBb;
|
||||
#define RAMROM_APP_WRITE_ADDR (__osBbIsBb ? 0x04980000 : (RAMROM_MSG_ADDR + (1*RAMROM_BUF_SIZE)))
|
||||
#else
|
||||
#define RAMROM_APP_WRITE_ADDR (RAMROM_MSG_ADDR + (1*RAMROM_BUF_SIZE))
|
||||
#endif
|
||||
#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 */
|
||||
Executable
+885
@@ -0,0 +1,885 @@
|
||||
#ifndef _RCP_H_
|
||||
#define _RCP_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* File: rcp.h
|
||||
*
|
||||
* This file contains register and bit definitions for RCP memory map.
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/rcp.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/R4300.h>
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* Here is a quick overview of the RCP memory map:
|
||||
*
|
||||
|
||||
0x0000_0000 .. 0x03ef_ffff RDRAM memory
|
||||
0x03f0_0000 .. 0x03ff_ffff RDRAM registers
|
||||
|
||||
RCP registers (see below)
|
||||
0x0400_0000 .. 0x040f_ffff SP registers
|
||||
0x0410_0000 .. 0x041f_ffff DP command registers
|
||||
0x0420_0000 .. 0x042f_ffff DP span registers
|
||||
0x0430_0000 .. 0x043f_ffff MI registers
|
||||
0x0440_0000 .. 0x044f_ffff VI registers
|
||||
0x0450_0000 .. 0x045f_ffff AI registers
|
||||
0x0460_0000 .. 0x046f_ffff PI registers
|
||||
0x0470_0000 .. 0x047f_ffff RI registers
|
||||
0x0480_0000 .. 0x048f_ffff SI registers
|
||||
0x0490_0000 .. 0x04ff_ffff unused
|
||||
|
||||
0x0500_0000 .. 0x05ff_ffff cartridge domain 2
|
||||
0x0600_0000 .. 0x07ff_ffff cartridge domain 1
|
||||
0x0800_0000 .. 0x0fff_ffff cartridge domain 2
|
||||
0x1000_0000 .. 0x1fbf_ffff cartridge domain 1
|
||||
|
||||
0x1fc0_0000 .. 0x1fc0_07bf PIF Boot Rom (1984 bytes)
|
||||
0x1fc0_07c0 .. 0x1fc0_07ff PIF (JoyChannel) RAM (64 bytes)
|
||||
0x1fc0_0800 .. 0x1fcf_ffff Reserved
|
||||
0x1fd0_0000 .. 0x7fff_ffff cartridge domain 1
|
||||
0x8000_0000 .. 0xffff_ffff external SysAD device
|
||||
|
||||
The Indy development board use cartridge domain 1:
|
||||
0x1000_0000 .. 0x10ff_ffff RAMROM
|
||||
0x1800_0000 .. 0x1800_0003 GIO interrupt (6 bits valid in 4 bytes)
|
||||
0x1800_0400 .. 0x1800_0403 GIO sync (6 bits valid in 4 bytes)
|
||||
0x1800_0800 .. 0x1800_0803 CART interrupt (6 bits valid in 4 bytes)
|
||||
|
||||
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* RDRAM Memory (Assumes that maximum size is 4 MB)
|
||||
*/
|
||||
#define RDRAM_0_START 0x00000000
|
||||
#define RDRAM_0_END 0x001FFFFF
|
||||
#define RDRAM_1_START 0x00200000
|
||||
#define RDRAM_1_END 0x003FFFFF
|
||||
|
||||
#define RDRAM_START RDRAM_0_START
|
||||
#define RDRAM_END RDRAM_1_END
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Address predicates
|
||||
*/
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
#define IS_RDRAM(x) ((unsigned)(x) >= RDRAM_START && \
|
||||
(unsigned)(x) < RDRAM_END)
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* RDRAM Registers (0x03f0_0000 .. 0x03ff_ffff)
|
||||
*/
|
||||
#define RDRAM_BASE_REG 0x03F00000
|
||||
|
||||
#define RDRAM_CONFIG_REG (RDRAM_BASE_REG+0x00)
|
||||
#define RDRAM_DEVICE_TYPE_REG (RDRAM_BASE_REG+0x00)
|
||||
#define RDRAM_DEVICE_ID_REG (RDRAM_BASE_REG+0x04)
|
||||
#define RDRAM_DELAY_REG (RDRAM_BASE_REG+0x08)
|
||||
#define RDRAM_MODE_REG (RDRAM_BASE_REG+0x0c)
|
||||
#define RDRAM_REF_INTERVAL_REG (RDRAM_BASE_REG+0x10)
|
||||
#define RDRAM_REF_ROW_REG (RDRAM_BASE_REG+0x14)
|
||||
#define RDRAM_RAS_INTERVAL_REG (RDRAM_BASE_REG+0x18)
|
||||
#define RDRAM_MIN_INTERVAL_REG (RDRAM_BASE_REG+0x1c)
|
||||
#define RDRAM_ADDR_SELECT_REG (RDRAM_BASE_REG+0x20)
|
||||
#define RDRAM_DEVICE_MANUF_REG (RDRAM_BASE_REG+0x24)
|
||||
|
||||
#define RDRAM_0_DEVICE_ID 0
|
||||
#define RDRAM_1_DEVICE_ID 1
|
||||
|
||||
#define RDRAM_RESET_MODE 0
|
||||
#define RDRAM_ACTIVE_MODE 1
|
||||
#define RDRAM_STANDBY_MODE 2
|
||||
|
||||
#define RDRAM_LENGTH (2*512*2048)
|
||||
#define RDRAM_0_BASE_ADDRESS (RDRAM_0_DEVICE_ID*RDRAM_LENGTH)
|
||||
#define RDRAM_1_BASE_ADDRESS (RDRAM_1_DEVICE_ID*RDRAM_LENGTH)
|
||||
|
||||
#define RDRAM_0_CONFIG 0x00000
|
||||
#define RDRAM_1_CONFIG 0x00400
|
||||
#define RDRAM_GLOBAL_CONFIG 0x80000
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* PIF Physical memory map (total size = 2 KB)
|
||||
*
|
||||
* Size Description Mode
|
||||
* 1FC007FF +-------+-----------------+-----+
|
||||
* | 64 B | JoyChannel RAM | R/W |
|
||||
* 1FC007C0 +-------+-----------------+-----+
|
||||
* |1984 B | Boot ROM | * | * = Reserved
|
||||
* 1FC00000 +-------+-----------------+-----+
|
||||
*
|
||||
*/
|
||||
#define PIF_ROM_START 0x1FC00000
|
||||
#define PIF_ROM_END 0x1FC007BF
|
||||
#define PIF_RAM_START 0x1FC007C0
|
||||
#define PIF_RAM_END 0x1FC007FF
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Controller channel
|
||||
* Each game controller channel has 4 error bits that are defined in bit 6-7 of
|
||||
* the Rx and Tx data size area bytes. Programmers need to clear these bits
|
||||
* when setting the Tx/Rx size area values for a channel
|
||||
*/
|
||||
#define CHNL_ERR_NORESP 0x80 /* Bit 7 (Rx): No response error */
|
||||
#define CHNL_ERR_OVERRUN 0x40 /* Bit 6 (Rx): Overrun error */
|
||||
#define CHNL_ERR_FRAME 0x80 /* Bit 7 (Tx): Frame error */
|
||||
#define CHNL_ERR_COLLISION 0x40 /* Bit 6 (Tx): Collision error */
|
||||
|
||||
#define CHNL_ERR_MASK 0xC0 /* Bit 6-7: channel errors */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* External device info
|
||||
*/
|
||||
#define DEVICE_TYPE_CART 0 /* ROM cartridge */
|
||||
#define DEVICE_TYPE_BULK 1 /* ROM bulk */
|
||||
#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */
|
||||
#define DEVICE_TYPE_SRAM 3 /* SRAM */
|
||||
/* 4-6 are reserved */
|
||||
#define DEVICE_TYPE_INIT 7 /* initial value */
|
||||
/* 8-14 are reserved */
|
||||
|
||||
/*************************************************************************
|
||||
* SP Memory
|
||||
*/
|
||||
#define SP_DMEM_START 0x04000000 /* read/write */
|
||||
#define SP_DMEM_END 0x04000FFF
|
||||
#define SP_IMEM_START 0x04001000 /* read/write */
|
||||
#define SP_IMEM_END 0x04001FFF
|
||||
|
||||
/*************************************************************************
|
||||
* SP CP0 Registers
|
||||
*/
|
||||
|
||||
#define SP_BASE_REG 0x04040000
|
||||
|
||||
/* SP memory address (R/W): [11:0] DMEM/IMEM address; [12] 0=DMEM,1=IMEM */
|
||||
#define SP_MEM_ADDR_REG (SP_BASE_REG+0x00) /* Master */
|
||||
|
||||
/* SP DRAM DMA address (R/W): [23:0] RDRAM address */
|
||||
#define SP_DRAM_ADDR_REG (SP_BASE_REG+0x04) /* Slave */
|
||||
|
||||
/* SP read DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */
|
||||
/* direction: I/DMEM <- RDRAM */
|
||||
#define SP_RD_LEN_REG (SP_BASE_REG+0x08) /* R/W: read len */
|
||||
|
||||
/* SP write DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */
|
||||
/* direction: I/DMEM -> RDRAM */
|
||||
#define SP_WR_LEN_REG (SP_BASE_REG+0x0C) /* R/W: write len */
|
||||
|
||||
/* SP status (R/W): [14:0] valid bits; see below for write/read mode */
|
||||
#define SP_STATUS_REG (SP_BASE_REG+0x10)
|
||||
|
||||
/* SP DMA full (R): [0] valid bit; dma full */
|
||||
#define SP_DMA_FULL_REG (SP_BASE_REG+0x14)
|
||||
|
||||
/* SP DMA busy (R): [0] valid bit; dma busy */
|
||||
#define SP_DMA_BUSY_REG (SP_BASE_REG+0x18)
|
||||
|
||||
/* SP semaphore (R/W): Read: [0] semaphore flag (set on read) */
|
||||
/* Write: [] clear semaphore flag */
|
||||
#define SP_SEMAPHORE_REG (SP_BASE_REG+0x1C)
|
||||
|
||||
/* SP PC (R/W): [11:0] program counter */
|
||||
#define SP_PC_REG 0x04080000
|
||||
|
||||
/* SP MEM address: bit 12 specifies if address is IMEM or DMEM */
|
||||
#define SP_DMA_DMEM 0x0000 /* Bit 12: 0=DMEM, 1=IMEM */
|
||||
#define SP_DMA_IMEM 0x1000 /* Bit 12: 0=DMEM, 1=IMEM */
|
||||
|
||||
/*
|
||||
* Values to clear/set bit in status reg (SP_STATUS_REG - write)
|
||||
*/
|
||||
#define SP_CLR_HALT 0x00001 /* Bit 0: clear halt */
|
||||
#define SP_SET_HALT 0x00002 /* Bit 1: set halt */
|
||||
#define SP_CLR_BROKE 0x00004 /* Bit 2: clear broke */
|
||||
#define SP_CLR_INTR 0x00008 /* Bit 3: clear intr */
|
||||
#define SP_SET_INTR 0x00010 /* Bit 4: set intr */
|
||||
#define SP_CLR_SSTEP 0x00020 /* Bit 5: clear sstep */
|
||||
#define SP_SET_SSTEP 0x00040 /* Bit 6: set sstep */
|
||||
#define SP_CLR_INTR_BREAK 0x00080 /* Bit 7: clear intr on break */
|
||||
#define SP_SET_INTR_BREAK 0x00100 /* Bit 8: set intr on break */
|
||||
#define SP_CLR_SIG0 0x00200 /* Bit 9: clear signal 0 */
|
||||
#define SP_SET_SIG0 0x00400 /* Bit 10: set signal 0 */
|
||||
#define SP_CLR_SIG1 0x00800 /* Bit 11: clear signal 1 */
|
||||
#define SP_SET_SIG1 0x01000 /* Bit 12: set signal 1 */
|
||||
#define SP_CLR_SIG2 0x02000 /* Bit 13: clear signal 2 */
|
||||
#define SP_SET_SIG2 0x04000 /* Bit 14: set signal 2 */
|
||||
#define SP_CLR_SIG3 0x08000 /* Bit 15: clear signal 3 */
|
||||
#define SP_SET_SIG3 0x10000 /* Bit 16: set signal 3 */
|
||||
#define SP_CLR_SIG4 0x20000 /* Bit 17: clear signal 4 */
|
||||
#define SP_SET_SIG4 0x40000 /* Bit 18: set signal 4 */
|
||||
#define SP_CLR_SIG5 0x80000 /* Bit 19: clear signal 5 */
|
||||
#define SP_SET_SIG5 0x100000 /* Bit 20: set signal 5 */
|
||||
#define SP_CLR_SIG6 0x200000 /* Bit 21: clear signal 6 */
|
||||
#define SP_SET_SIG6 0x400000 /* Bit 22: set signal 6 */
|
||||
#define SP_CLR_SIG7 0x800000 /* Bit 23: clear signal 7 */
|
||||
#define SP_SET_SIG7 0x1000000 /* Bit 24: set signal 7 */
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (SP_STATUS_REG - read)
|
||||
*/
|
||||
#define SP_STATUS_HALT 0x001 /* Bit 0: halt */
|
||||
#define SP_STATUS_BROKE 0x002 /* Bit 1: broke */
|
||||
#define SP_STATUS_DMA_BUSY 0x004 /* Bit 2: dma busy */
|
||||
#define SP_STATUS_DMA_FULL 0x008 /* Bit 3: dma full */
|
||||
#define SP_STATUS_IO_FULL 0x010 /* Bit 4: io full */
|
||||
#define SP_STATUS_SSTEP 0x020 /* Bit 5: single step */
|
||||
#define SP_STATUS_INTR_BREAK 0x040 /* Bit 6: interrupt on break */
|
||||
#define SP_STATUS_SIG0 0x080 /* Bit 7: signal 0 set */
|
||||
#define SP_STATUS_SIG1 0x100 /* Bit 8: signal 1 set */
|
||||
#define SP_STATUS_SIG2 0x200 /* Bit 9: signal 2 set */
|
||||
#define SP_STATUS_SIG3 0x400 /* Bit 10: signal 3 set */
|
||||
#define SP_STATUS_SIG4 0x800 /* Bit 11: signal 4 set */
|
||||
#define SP_STATUS_SIG5 0x1000 /* Bit 12: signal 5 set */
|
||||
#define SP_STATUS_SIG6 0x2000 /* Bit 13: signal 6 set */
|
||||
#define SP_STATUS_SIG7 0x4000 /* Bit 14: signal 7 set */
|
||||
|
||||
/*
|
||||
* Use of SIG bits
|
||||
*/
|
||||
#define SP_CLR_YIELD SP_CLR_SIG0
|
||||
#define SP_SET_YIELD SP_SET_SIG0
|
||||
#define SP_STATUS_YIELD SP_STATUS_SIG0
|
||||
#define SP_CLR_YIELDED SP_CLR_SIG1
|
||||
#define SP_SET_YIELDED SP_SET_SIG1
|
||||
#define SP_STATUS_YIELDED SP_STATUS_SIG1
|
||||
#define SP_CLR_TASKDONE SP_CLR_SIG2
|
||||
#define SP_SET_TASKDONE SP_SET_SIG2
|
||||
#define SP_STATUS_TASKDONE SP_STATUS_SIG2
|
||||
#define SP_CLR_RSPSIGNAL SP_CLR_SIG3
|
||||
#define SP_SET_RSPSIGNAL SP_SET_SIG3
|
||||
#define SP_STATUS_RSPSIGNAL SP_STATUS_SIG3
|
||||
#define SP_CLR_CPUSIGNAL SP_CLR_SIG4
|
||||
#define SP_SET_CPUSIGNAL SP_SET_SIG4
|
||||
#define SP_STATUS_CPUSIGNAL SP_STATUS_SIG4
|
||||
|
||||
/* SP IMEM BIST REG (R/W): [6:0] BIST status bits; see below for detail */
|
||||
#define SP_IBIST_REG 0x04080004
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (SP_BIST_REG - write)
|
||||
*/
|
||||
#define SP_IBIST_CHECK 0x01 /* Bit 0: BIST check */
|
||||
#define SP_IBIST_GO 0x02 /* Bit 1: BIST go */
|
||||
#define SP_IBIST_CLEAR 0x04 /* Bit 2: BIST clear */
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (SP_BIST_REG - read)
|
||||
*/
|
||||
/* First 2 bits are same as in write mode:
|
||||
* Bit 0: BIST check; Bit 1: BIST go
|
||||
*/
|
||||
#define SP_IBIST_DONE 0x04 /* Bit 2: BIST done */
|
||||
#define SP_IBIST_FAILED 0x78 /* Bit [6:3]: BIST fail */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* DP Command Registers
|
||||
*/
|
||||
#define DPC_BASE_REG 0x04100000
|
||||
|
||||
/* DP CMD DMA start (R/W): [23:0] DMEM/RDRAM start address */
|
||||
#define DPC_START_REG (DPC_BASE_REG+0x00)
|
||||
|
||||
/* DP CMD DMA end (R/W): [23:0] DMEM/RDRAM end address */
|
||||
#define DPC_END_REG (DPC_BASE_REG+0x04)
|
||||
|
||||
/* DP CMD DMA end (R): [23:0] DMEM/RDRAM current address */
|
||||
#define DPC_CURRENT_REG (DPC_BASE_REG+0x08)
|
||||
|
||||
/* DP CMD status (R/W): [9:0] valid bits - see below for definitions */
|
||||
#define DPC_STATUS_REG (DPC_BASE_REG+0x0C)
|
||||
|
||||
/* DP clock counter (R): [23:0] clock counter */
|
||||
#define DPC_CLOCK_REG (DPC_BASE_REG+0x10)
|
||||
|
||||
/* DP buffer busy counter (R): [23:0] clock counter */
|
||||
#define DPC_BUFBUSY_REG (DPC_BASE_REG+0x14)
|
||||
|
||||
/* DP pipe busy counter (R): [23:0] clock counter */
|
||||
#define DPC_PIPEBUSY_REG (DPC_BASE_REG+0x18)
|
||||
|
||||
/* DP TMEM load counter (R): [23:0] clock counter */
|
||||
#define DPC_TMEM_REG (DPC_BASE_REG+0x1C)
|
||||
|
||||
/*
|
||||
* Values to clear/set bit in status reg (DPC_STATUS_REG - write)
|
||||
*/
|
||||
#define DPC_CLR_XBUS_DMEM_DMA 0x0001 /* Bit 0: clear xbus_dmem_dma */
|
||||
#define DPC_SET_XBUS_DMEM_DMA 0x0002 /* Bit 1: set xbus_dmem_dma */
|
||||
#define DPC_CLR_FREEZE 0x0004 /* Bit 2: clear freeze */
|
||||
#define DPC_SET_FREEZE 0x0008 /* Bit 3: set freeze */
|
||||
#define DPC_CLR_FLUSH 0x0010 /* Bit 4: clear flush */
|
||||
#define DPC_SET_FLUSH 0x0020 /* Bit 5: set flush */
|
||||
#define DPC_CLR_TMEM_CTR 0x0040 /* Bit 6: clear tmem ctr */
|
||||
#define DPC_CLR_PIPE_CTR 0x0080 /* Bit 7: clear pipe ctr */
|
||||
#define DPC_CLR_CMD_CTR 0x0100 /* Bit 8: clear cmd ctr */
|
||||
#define DPC_CLR_CLOCK_CTR 0x0200 /* Bit 9: clear clock ctr */
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (DPC_STATUS_REG - read)
|
||||
*/
|
||||
#define DPC_STATUS_XBUS_DMEM_DMA 0x001 /* Bit 0: xbus_dmem_dma */
|
||||
#define DPC_STATUS_FREEZE 0x002 /* Bit 1: freeze */
|
||||
#define DPC_STATUS_FLUSH 0x004 /* Bit 2: flush */
|
||||
/*#define DPC_STATUS_FROZEN 0x008*/ /* Bit 3: frozen */
|
||||
#define DPC_STATUS_START_GCLK 0x008 /* Bit 3: start gclk */
|
||||
#define DPC_STATUS_TMEM_BUSY 0x010 /* Bit 4: tmem busy */
|
||||
#define DPC_STATUS_PIPE_BUSY 0x020 /* Bit 5: pipe busy */
|
||||
#define DPC_STATUS_CMD_BUSY 0x040 /* Bit 6: cmd busy */
|
||||
#define DPC_STATUS_CBUF_READY 0x080 /* Bit 7: cbuf ready */
|
||||
#define DPC_STATUS_DMA_BUSY 0x100 /* Bit 8: dma busy */
|
||||
#define DPC_STATUS_END_VALID 0x200 /* Bit 9: end valid */
|
||||
#define DPC_STATUS_START_VALID 0x400 /* Bit 10: start valid */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* DP Span Registers
|
||||
*/
|
||||
#define DPS_BASE_REG 0x04200000
|
||||
|
||||
/* DP tmem bist (R/W): [10:0] BIST status bits; see below for detail */
|
||||
#define DPS_TBIST_REG (DPS_BASE_REG+0x00)
|
||||
|
||||
/* DP span test mode (R/W): [0] Span buffer test access enable */
|
||||
#define DPS_TEST_MODE_REG (DPS_BASE_REG+0x04)
|
||||
|
||||
/* DP span buffer test address (R/W): [6:0] bits; see below for detail */
|
||||
#define DPS_BUFTEST_ADDR_REG (DPS_BASE_REG+0x08)
|
||||
|
||||
/* DP span buffer test data (R/W): [31:0] span buffer data */
|
||||
#define DPS_BUFTEST_DATA_REG (DPS_BASE_REG+0x0C)
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (DPS_TMEM_BIST_REG - write)
|
||||
*/
|
||||
#define DPS_TBIST_CHECK 0x01 /* Bit 0: BIST check */
|
||||
#define DPS_TBIST_GO 0x02 /* Bit 1: BIST go */
|
||||
#define DPS_TBIST_CLEAR 0x04 /* Bit 2: BIST clear */
|
||||
|
||||
/*
|
||||
* Patterns to interpret status reg (DPS_TMEM_BIST_REG - read)
|
||||
*/
|
||||
/* First 2 bits are same as in write mode:
|
||||
* Bit 0: BIST check; Bit 1: BIST go
|
||||
*/
|
||||
#define DPS_TBIST_DONE 0x004 /* Bit 2: BIST done */
|
||||
#define DPS_TBIST_FAILED 0x7F8 /* Bit [10:3]: BIST fail */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* MIPS Interface (MI) Registers
|
||||
*/
|
||||
#define MI_BASE_REG 0x04300000
|
||||
|
||||
/*
|
||||
* MI init mode (W): [6:0] init length, [7] clear init mode, [8] set init mode
|
||||
* [9/10] clear/set ebus test mode, [11] clear DP interrupt
|
||||
* (R): [6:0] init length, [7] init mode, [8] ebus test mode
|
||||
*/
|
||||
#define MI_INIT_MODE_REG (MI_BASE_REG+0x00)
|
||||
#define MI_MODE_REG MI_INIT_MODE_REG
|
||||
|
||||
/*
|
||||
* Values to clear/set bit in mode reg (MI_MODE_REG - write)
|
||||
*/
|
||||
#define MI_CLR_INIT 0x0080 /* Bit 7: clear init mode */
|
||||
#define MI_SET_INIT 0x0100 /* Bit 8: set init mode */
|
||||
#define MI_CLR_EBUS 0x0200 /* Bit 9: clear ebus test */
|
||||
#define MI_SET_EBUS 0x0400 /* Bit 10: set ebus test mode */
|
||||
#define MI_CLR_DP_INTR 0x0800 /* Bit 11: clear dp interrupt */
|
||||
#define MI_CLR_RDRAM 0x1000 /* Bit 12: clear RDRAM reg */
|
||||
#define MI_SET_RDRAM 0x2000 /* Bit 13: set RDRAM reg mode */
|
||||
|
||||
/*
|
||||
* Patterns to interpret mode reg (MI_MODE_REG - read)
|
||||
*/
|
||||
#define MI_MODE_INIT 0x0080 /* Bit 7: init mode */
|
||||
#define MI_MODE_EBUS 0x0100 /* Bit 8: ebus test mode */
|
||||
#define MI_MODE_RDRAM 0x0200 /* Bit 9: RDRAM reg mode */
|
||||
|
||||
/* MI version (R): [7:0] io, [15:8] rac, [23:16] rdp, [31:24] rsp */
|
||||
#define MI_VERSION_REG (MI_BASE_REG+0x04)
|
||||
#define MI_NOOP_REG MI_VERSION_REG
|
||||
|
||||
/* MI interrupt (R): [5:0] valid bits - see below for bit patterns */
|
||||
#define MI_INTR_REG (MI_BASE_REG+0x08)
|
||||
|
||||
/*
|
||||
* MI interrupt mask (W): [11:0] valid bits - see below for bit patterns
|
||||
* (R): [5:0] valid bits - see below for bit patterns
|
||||
*/
|
||||
#define MI_INTR_MASK_REG (MI_BASE_REG+0x0C)
|
||||
|
||||
/*
|
||||
* The following are values to check for interrupt setting (MI_INTR_REG)
|
||||
*/
|
||||
#define MI_INTR_SP 0x01 /* Bit 0: SP intr */
|
||||
#define MI_INTR_SI 0x02 /* Bit 1: SI intr */
|
||||
#define MI_INTR_AI 0x04 /* Bit 2: AI intr */
|
||||
#define MI_INTR_VI 0x08 /* Bit 3: VI intr */
|
||||
#define MI_INTR_PI 0x10 /* Bit 4: PI intr */
|
||||
#define MI_INTR_DP 0x20 /* Bit 5: DP intr */
|
||||
|
||||
/*
|
||||
* The following are values to clear/set various interrupt bit mask
|
||||
* They can be ORed together to manipulate multiple bits
|
||||
* (MI_INTR_MASK_REG - write)
|
||||
*/
|
||||
#define MI_INTR_MASK_CLR_SP 0x0001 /* Bit 0: clear SP mask */
|
||||
#define MI_INTR_MASK_SET_SP 0x0002 /* Bit 1: set SP mask */
|
||||
#define MI_INTR_MASK_CLR_SI 0x0004 /* Bit 2: clear SI mask */
|
||||
#define MI_INTR_MASK_SET_SI 0x0008 /* Bit 3: set SI mask */
|
||||
#define MI_INTR_MASK_CLR_AI 0x0010 /* Bit 4: clear AI mask */
|
||||
#define MI_INTR_MASK_SET_AI 0x0020 /* Bit 5: set AI mask */
|
||||
#define MI_INTR_MASK_CLR_VI 0x0040 /* Bit 6: clear VI mask */
|
||||
#define MI_INTR_MASK_SET_VI 0x0080 /* Bit 7: set VI mask */
|
||||
#define MI_INTR_MASK_CLR_PI 0x0100 /* Bit 8: clear PI mask */
|
||||
#define MI_INTR_MASK_SET_PI 0x0200 /* Bit 9: set PI mask */
|
||||
#define MI_INTR_MASK_CLR_DP 0x0400 /* Bit 10: clear DP mask */
|
||||
#define MI_INTR_MASK_SET_DP 0x0800 /* Bit 11: set DP mask */
|
||||
|
||||
/*
|
||||
* The following are values to check for interrupt mask setting
|
||||
* (MI_INTR_MASK_REG - read)
|
||||
*/
|
||||
#define MI_INTR_MASK_SP 0x01 /* Bit 0: SP intr mask */
|
||||
#define MI_INTR_MASK_SI 0x02 /* Bit 1: SI intr mask */
|
||||
#define MI_INTR_MASK_AI 0x04 /* Bit 2: AI intr mask */
|
||||
#define MI_INTR_MASK_VI 0x08 /* Bit 3: VI intr mask */
|
||||
#define MI_INTR_MASK_PI 0x10 /* Bit 4: PI intr mask */
|
||||
#define MI_INTR_MASK_DP 0x20 /* Bit 5: DP intr mask */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Video Interface (VI) Registers
|
||||
*/
|
||||
#define VI_BASE_REG 0x04400000
|
||||
|
||||
/* VI status/control (R/W): [15-0] valid bits:
|
||||
* [1:0] = type[1:0] (pixel size)
|
||||
* 0: blank (no data, no sync)
|
||||
* 1: reserved
|
||||
* 2: 5/5/5/3 ("16" bit)
|
||||
* 3: 8/8/8/8 (32 bit)
|
||||
* [2] = gamma_dither_enable (normally on, unless "special effect")
|
||||
* [3] = gamma_enable (normally on, unless MPEG/JPEG)
|
||||
* [4] = divot_enable (normally on if antialiased, unless decal lines)
|
||||
* [5] = reserved - always off
|
||||
* [6] = serrate (always on if interlaced, off if not)
|
||||
* [7] = reserved - diagnostics only
|
||||
* [9:8] = anti-alias (aa) mode[1:0]
|
||||
* 0: aa & resamp (always fetch extra lines)
|
||||
* 1: aa & resamp (fetch extra lines if needed)
|
||||
* 2: resamp only (treat as all fully covered)
|
||||
* 3: neither (replicate pixels, no interpolate)
|
||||
* [11] = reserved - diagnostics only
|
||||
* [15:12] = reserved
|
||||
*
|
||||
*/
|
||||
#define VI_STATUS_REG (VI_BASE_REG+0x00)
|
||||
#define VI_CONTROL_REG VI_STATUS_REG
|
||||
|
||||
/* VI origin (R/W): [23:0] frame buffer origin in bytes */
|
||||
#define VI_ORIGIN_REG (VI_BASE_REG+0x04)
|
||||
#define VI_DRAM_ADDR_REG VI_ORIGIN_REG
|
||||
|
||||
/* VI width (R/W): [11:0] frame buffer line width in pixels */
|
||||
#define VI_WIDTH_REG (VI_BASE_REG+0x08)
|
||||
#define VI_H_WIDTH_REG VI_WIDTH_REG
|
||||
|
||||
/* VI vertical intr (R/W): [9:0] interrupt when current half-line = V_INTR */
|
||||
#define VI_INTR_REG (VI_BASE_REG+0x0C)
|
||||
#define VI_V_INTR_REG VI_INTR_REG
|
||||
|
||||
/*
|
||||
* VI current vertical line (R/W): [9:0] current half line, sampled once per
|
||||
* line (the lsb of V_CURRENT is constant within a field, and in
|
||||
* interlaced modes gives the field number - which is constant for non-
|
||||
* interlaced modes)
|
||||
* - Any write to this register will clear interrupt line
|
||||
*/
|
||||
#define VI_CURRENT_REG (VI_BASE_REG+0x10)
|
||||
#define VI_V_CURRENT_LINE_REG VI_CURRENT_REG
|
||||
|
||||
/*
|
||||
* VI video timing (R/W): [ 7: 0] horizontal sync width in pixels,
|
||||
* [15: 8] color burst width in pixels,
|
||||
* [19:16] vertical sync width in half lines,
|
||||
* [29:20] start of color burst in pixels from h-sync
|
||||
*/
|
||||
#define VI_BURST_REG (VI_BASE_REG+0x14)
|
||||
#define VI_TIMING_REG VI_BURST_REG
|
||||
|
||||
/* VI vertical sync (R/W): [9:0] number of half-lines per field */
|
||||
#define VI_V_SYNC_REG (VI_BASE_REG+0x18)
|
||||
|
||||
/* VI horizontal sync (R/W): [11: 0] total duration of a line in 1/4 pixel
|
||||
* [20:16] a 5-bit leap pattern used for PAL only
|
||||
* (h_sync_period)
|
||||
*/
|
||||
#define VI_H_SYNC_REG (VI_BASE_REG+0x1C)
|
||||
|
||||
/*
|
||||
* VI horizontal sync leap (R/W): [11: 0] identical to h_sync_period
|
||||
* [27:16] identical to h_sync_period
|
||||
*/
|
||||
#define VI_LEAP_REG (VI_BASE_REG+0x20)
|
||||
#define VI_H_SYNC_LEAP_REG VI_LEAP_REG
|
||||
|
||||
/*
|
||||
* VI horizontal video (R/W): [ 9: 0] end of active video in screen pixels
|
||||
* : [25:16] start of active video in screen pixels
|
||||
*/
|
||||
#define VI_H_START_REG (VI_BASE_REG+0x24)
|
||||
#define VI_H_VIDEO_REG VI_H_START_REG
|
||||
|
||||
/*
|
||||
* VI vertical video (R/W): [ 9: 0] end of active video in screen half-lines
|
||||
* : [25:16] start of active video in screen half-lines
|
||||
*/
|
||||
#define VI_V_START_REG (VI_BASE_REG+0x28)
|
||||
#define VI_V_VIDEO_REG VI_V_START_REG
|
||||
|
||||
/*
|
||||
* VI vertical burst (R/W): [ 9: 0] end of color burst enable in half-lines
|
||||
* : [25:16] start of color burst enable in half-lines
|
||||
*/
|
||||
#define VI_V_BURST_REG (VI_BASE_REG+0x2C)
|
||||
|
||||
/* VI x-scale (R/W): [11: 0] 1/horizontal scale up factor (2.10 format)
|
||||
* [27:16] horizontal subpixel offset (2.10 format)
|
||||
*/
|
||||
#define VI_X_SCALE_REG (VI_BASE_REG+0x30)
|
||||
|
||||
/* VI y-scale (R/W): [11: 0] 1/vertical scale up factor (2.10 format)
|
||||
* [27:16] vertical subpixel offset (2.10 format)
|
||||
*/
|
||||
#define VI_Y_SCALE_REG (VI_BASE_REG+0x34)
|
||||
|
||||
/*
|
||||
* Patterns to interpret VI_CONTROL_REG
|
||||
*/
|
||||
#define VI_CTRL_TYPE_16 0x00002 /* Bit [1:0] pixel size: 16 bit */
|
||||
#define VI_CTRL_TYPE_32 0x00003 /* Bit [1:0] pixel size: 32 bit */
|
||||
#define VI_CTRL_GAMMA_DITHER_ON 0x00004 /* Bit 2: default = on */
|
||||
#define VI_CTRL_GAMMA_ON 0x00008 /* Bit 3: default = on */
|
||||
#define VI_CTRL_DIVOT_ON 0x00010 /* Bit 4: default = on */
|
||||
#define VI_CTRL_SERRATE_ON 0x00040 /* Bit 6: on if interlaced */
|
||||
#define VI_CTRL_ANTIALIAS_MASK 0x00300 /* Bit [9:8] anti-alias mode */
|
||||
#define VI_CTRL_DITHER_FILTER_ON 0x10000 /* Bit 16: dither-filter mode */
|
||||
|
||||
/*
|
||||
* Possible video clocks (NTSC or PAL)
|
||||
*/
|
||||
#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */
|
||||
#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */
|
||||
#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Audio Interface (AI) Registers
|
||||
*
|
||||
* The address and length registers are double buffered; that is, they
|
||||
* can be written twice before becoming full.
|
||||
* The address must be written before the length.
|
||||
*/
|
||||
#define AI_BASE_REG 0x04500000
|
||||
|
||||
/* AI DRAM address (W): [23:0] starting RDRAM address (8B-aligned) */
|
||||
#define AI_DRAM_ADDR_REG (AI_BASE_REG+0x00) /* R0: DRAM address */
|
||||
|
||||
/* AI length (R/W): [14:0] transfer length (v1.0) - Bottom 3 bits are ignored */
|
||||
/* [17:0] transfer length (v2.0) - Bottom 3 bits are ignored */
|
||||
#define AI_LEN_REG (AI_BASE_REG+0x04) /* R1: Length */
|
||||
|
||||
/* AI control (W): [0] DMA enable - if LSB == 1, DMA is enabled */
|
||||
#define AI_CONTROL_REG (AI_BASE_REG+0x08) /* R2: DMA Control */
|
||||
|
||||
/*
|
||||
* AI status (R): [31]/[0] ai_full (addr & len buffer full), [30] ai_busy
|
||||
* Note that a 1->0 transition in ai_full will set interrupt
|
||||
* (W): clear audio interrupt
|
||||
*/
|
||||
#define AI_STATUS_REG (AI_BASE_REG+0x0C) /* R3: Status */
|
||||
|
||||
/*
|
||||
* AI DAC sample period register (W): [13:0] dac rate
|
||||
* - vid_clock/(dperiod + 1) is the DAC sample rate
|
||||
* - (dperiod + 1) >= 66 * (aclockhp + 1) must be true
|
||||
*/
|
||||
#define AI_DACRATE_REG (AI_BASE_REG+0x10) /* R4: DAC rate 14-lsb*/
|
||||
|
||||
/*
|
||||
* AI bit rate (W): [3:0] bit rate (abus clock half period register - aclockhp)
|
||||
* - vid_clock/(2 * (aclockhp + 1)) is the DAC clock rate
|
||||
* - The abus clock stops if aclockhp is zero
|
||||
*/
|
||||
#define AI_BITRATE_REG (AI_BASE_REG+0x14) /* R5: Bit rate 4-lsb */
|
||||
|
||||
/* Value for control register */
|
||||
#define AI_CONTROL_DMA_ON 0x01 /* LSB = 1: DMA enable*/
|
||||
#define AI_CONTROL_DMA_OFF 0x00 /* LSB = 1: DMA enable*/
|
||||
|
||||
/* Value for status register */
|
||||
#define AI_STATUS_FIFO_FULL 0x80000000 /* Bit 31: full */
|
||||
#define AI_STATUS_DMA_BUSY 0x40000000 /* Bit 30: busy */
|
||||
|
||||
/* DAC rate = video clock / audio frequency
|
||||
* - DAC rate >= (66 * Bit rate) must be true
|
||||
*/
|
||||
#define AI_MAX_DAC_RATE 16384 /* 14-bit+1 */
|
||||
#define AI_MIN_DAC_RATE 132
|
||||
|
||||
/* Bit rate <= (DAC rate / 66) */
|
||||
#define AI_MAX_BIT_RATE 16 /* 4-bit+1 */
|
||||
#define AI_MIN_BIT_RATE 2
|
||||
|
||||
/*
|
||||
* Maximum and minimum values for audio frequency based on video clocks
|
||||
* max frequency = (video clock / min dac rate)
|
||||
* min frequency = (video clock / max dac rate)
|
||||
*/
|
||||
#define AI_NTSC_MAX_FREQ 368000 /* 368 KHz */
|
||||
#define AI_NTSC_MIN_FREQ 3000 /* 3 KHz ~ 2971 Hz */
|
||||
|
||||
#define AI_PAL_MAX_FREQ 376000 /* 376 KHz */
|
||||
#define AI_PAL_MIN_FREQ 3050 /* 3 KHz ~ 3031 Hz */
|
||||
|
||||
#define AI_MPAL_MAX_FREQ 368000 /* 368 KHz */
|
||||
#define AI_MPAL_MIN_FREQ 3000 /* 3 KHz ~ 2968 Hz */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Peripheral Interface (PI) Registers
|
||||
*/
|
||||
#define PI_BASE_REG 0x04600000
|
||||
|
||||
/* PI DRAM address (R/W): [23:0] starting RDRAM address */
|
||||
#define PI_DRAM_ADDR_REG (PI_BASE_REG+0x00) /* DRAM address */
|
||||
|
||||
/* PI pbus (cartridge) address (R/W): [31:0] starting AD16 address */
|
||||
#define PI_CART_ADDR_REG (PI_BASE_REG+0x04)
|
||||
|
||||
/* PI read length (R/W): [23:0] read data length */
|
||||
#define PI_RD_LEN_REG (PI_BASE_REG+0x08)
|
||||
|
||||
/* PI write length (R/W): [23:0] write data length */
|
||||
#define PI_WR_LEN_REG (PI_BASE_REG+0x0C)
|
||||
|
||||
/*
|
||||
* PI status (R): [0] DMA busy, [1] IO busy, [2], error
|
||||
* (W): [0] reset controller (and abort current op), [1] clear intr
|
||||
*/
|
||||
#define PI_STATUS_REG (PI_BASE_REG+0x10)
|
||||
|
||||
/* PI dom1 latency (R/W): [7:0] domain 1 device latency */
|
||||
#define PI_BSD_DOM1_LAT_REG (PI_BASE_REG+0x14)
|
||||
|
||||
/* PI dom1 pulse width (R/W): [7:0] domain 1 device R/W strobe pulse width */
|
||||
#define PI_BSD_DOM1_PWD_REG (PI_BASE_REG+0x18)
|
||||
|
||||
/* PI dom1 page size (R/W): [3:0] domain 1 device page size */
|
||||
#define PI_BSD_DOM1_PGS_REG (PI_BASE_REG+0x1C) /* page size */
|
||||
|
||||
/* PI dom1 release (R/W): [1:0] domain 1 device R/W release duration */
|
||||
#define PI_BSD_DOM1_RLS_REG (PI_BASE_REG+0x20)
|
||||
|
||||
/* PI dom2 latency (R/W): [7:0] domain 2 device latency */
|
||||
#define PI_BSD_DOM2_LAT_REG (PI_BASE_REG+0x24) /* Domain 2 latency */
|
||||
|
||||
/* PI dom2 pulse width (R/W): [7:0] domain 2 device R/W strobe pulse width */
|
||||
#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28) /* pulse width */
|
||||
|
||||
/* PI dom2 page size (R/W): [3:0] domain 2 device page size */
|
||||
#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C) /* page size */
|
||||
|
||||
/* PI dom2 release (R/W): [1:0] domain 2 device R/W release duration */
|
||||
#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30) /* release duration */
|
||||
|
||||
#define PI_DOMAIN1_REG PI_BSD_DOM1_LAT_REG
|
||||
#define PI_DOMAIN2_REG PI_BSD_DOM2_LAT_REG
|
||||
|
||||
#define PI_DOM_LAT_OFS 0x00
|
||||
#define PI_DOM_PWD_OFS 0x04
|
||||
#define PI_DOM_PGS_OFS 0x08
|
||||
#define PI_DOM_RLS_OFS 0x0C
|
||||
|
||||
/*
|
||||
* PI status register has 3 bits active when read from (PI_STATUS_REG - read)
|
||||
* Bit 0: DMA busy - set when DMA is in progress
|
||||
* Bit 1: IO busy - set when IO is in progress
|
||||
* Bit 2: Error - set when CPU issues IO request while DMA is busy
|
||||
*/
|
||||
#define PI_STATUS_ERROR 0x04
|
||||
#define PI_STATUS_IO_BUSY 0x02
|
||||
#define PI_STATUS_DMA_BUSY 0x01
|
||||
|
||||
/* PI status register has 2 bits active when written to:
|
||||
* Bit 0: When set, reset PIC
|
||||
* Bit 1: When set, clear interrupt flag
|
||||
* The values of the two bits can be ORed together to both reset PIC and
|
||||
* clear interrupt at the same time.
|
||||
*
|
||||
* Note:
|
||||
* - The PIC does generate an interrupt at the end of each DMA. CPU
|
||||
* needs to clear the interrupt flag explicitly (from an interrupt
|
||||
* handler) by writing into the STATUS register with bit 1 set.
|
||||
*
|
||||
* - When a DMA completes, the interrupt flag is set. CPU can issue
|
||||
* another request even while the interrupt flag is set (as long as
|
||||
* PIC is idle). However, it is the CPU's responsibility for
|
||||
* maintaining accurate correspondence between DMA completions and
|
||||
* interrupts.
|
||||
*
|
||||
* - When PIC is reset, if PIC happens to be busy, an interrupt will
|
||||
* be generated as PIC returns to idle. Otherwise, no interrupt will
|
||||
* be generated and PIC remains idle.
|
||||
*/
|
||||
/*
|
||||
* Values to clear interrupt/reset PIC (PI_STATUS_REG - write)
|
||||
*/
|
||||
#define PI_STATUS_RESET 0x01
|
||||
#define PI_SET_RESET PI_STATUS_RESET
|
||||
|
||||
#define PI_STATUS_CLR_INTR 0x02
|
||||
#define PI_CLR_INTR PI_STATUS_CLR_INTR
|
||||
|
||||
#define PI_DMA_BUFFER_SIZE 128
|
||||
|
||||
#define PI_DOM1_ADDR1 0x06000000 /* to 0x07FFFFFF */
|
||||
#define PI_DOM1_ADDR2 0x10000000 /* to 0x1FBFFFFF */
|
||||
#define PI_DOM1_ADDR3 0x1FD00000 /* to 0x7FFFFFFF */
|
||||
#define PI_DOM2_ADDR1 0x05000000 /* to 0x05FFFFFF */
|
||||
#define PI_DOM2_ADDR2 0x08000000 /* to 0x0FFFFFFF */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* RDRAM Interface (RI) Registers
|
||||
*/
|
||||
#define RI_BASE_REG 0x04700000
|
||||
|
||||
/* RI mode (R/W): [1:0] operating mode, [2] stop T active, [3] stop R active */
|
||||
#define RI_MODE_REG (RI_BASE_REG+0x00)
|
||||
|
||||
/* RI config (R/W): [5:0] current control input, [6] current control enable */
|
||||
#define RI_CONFIG_REG (RI_BASE_REG+0x04)
|
||||
|
||||
/* RI current load (W): [] any write updates current control register */
|
||||
#define RI_CURRENT_LOAD_REG (RI_BASE_REG+0x08)
|
||||
|
||||
/* RI select (R/W): [2:0] receive select, [2:0] transmit select */
|
||||
#define RI_SELECT_REG (RI_BASE_REG+0x0C)
|
||||
|
||||
/* RI refresh (R/W): [7:0] clean refresh delay, [15:8] dirty refresh delay,
|
||||
* [16] refresh bank, [17] refresh enable
|
||||
* [18] refresh optimize
|
||||
*/
|
||||
#define RI_REFRESH_REG (RI_BASE_REG+0x10)
|
||||
#define RI_COUNT_REG RI_REFRESH_REG
|
||||
|
||||
/* RI latency (R/W): [3:0] DMA latency/overlap */
|
||||
#define RI_LATENCY_REG (RI_BASE_REG+0x14)
|
||||
|
||||
/* RI error (R): [0] nack error, [1] ack error */
|
||||
#define RI_RERROR_REG (RI_BASE_REG+0x18)
|
||||
|
||||
/* RI error (W): [] any write clears all error bits */
|
||||
#define RI_WERROR_REG (RI_BASE_REG+0x1C)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Serial Interface (SI) Registers
|
||||
*/
|
||||
#define SI_BASE_REG 0x04800000
|
||||
|
||||
/* SI DRAM address (R/W): [23:0] starting RDRAM address */
|
||||
#define SI_DRAM_ADDR_REG (SI_BASE_REG+0x00) /* R0: DRAM address */
|
||||
|
||||
/* SI address read 64B (W): [] any write causes a 64B DMA write */
|
||||
#define SI_PIF_ADDR_RD64B_REG (SI_BASE_REG+0x04) /* R1: 64B PIF->DRAM */
|
||||
|
||||
/* Address SI_BASE_REG + (0x08, 0x0c, 0x14) are reserved */
|
||||
|
||||
/* SI address write 64B (W): [] any write causes a 64B DMA read */
|
||||
#define SI_PIF_ADDR_WR64B_REG (SI_BASE_REG+0x10) /* R4: 64B DRAM->PIF */
|
||||
|
||||
/*
|
||||
* SI status (W): [] any write clears interrupt
|
||||
* (R): [0] DMA busy, [1] IO read busy, [2] reserved
|
||||
* [3] DMA error, [12] interrupt
|
||||
*/
|
||||
#define SI_STATUS_REG (SI_BASE_REG+0x18) /* R6: Status */
|
||||
|
||||
/* SI status register has the following bits active:
|
||||
* 0: DMA busy - set when DMA is in progress
|
||||
* 1: IO busy - set when IO access is in progress
|
||||
* 3: DMA error - set when there are overlapping DMA requests
|
||||
* 12: Interrupt - Interrupt set
|
||||
*/
|
||||
#define SI_STATUS_DMA_BUSY 0x0001
|
||||
#define SI_STATUS_RD_BUSY 0x0002
|
||||
#define SI_STATUS_DMA_ERROR 0x0008
|
||||
#define SI_STATUS_INTERRUPT 0x1000
|
||||
|
||||
/*************************************************************************
|
||||
* Development Board GIO Control Registers
|
||||
*/
|
||||
|
||||
#define GIO_BASE_REG 0x18000000
|
||||
|
||||
/* Game to Host Interrupt */
|
||||
#define GIO_GIO_INTR_REG (GIO_BASE_REG+0x000)
|
||||
|
||||
/* Game to Host SYNC */
|
||||
#define GIO_GIO_SYNC_REG (GIO_BASE_REG+0x400)
|
||||
|
||||
/* Host to Game Interrupt */
|
||||
#define GIO_CART_INTR_REG (GIO_BASE_REG+0x800)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Common macros
|
||||
*/
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr))
|
||||
#define IO_WRITE(addr,data) (*(vu32 *)PHYS_TO_K1(addr)=(u32)(data))
|
||||
#define RCP_STAT_PRINT \
|
||||
rmonPrintf("current=%x start=%x end=%x dpstat=%x spstat=%x\n", \
|
||||
IO_READ(DPC_CURRENT_REG), \
|
||||
IO_READ(DPC_START_REG), \
|
||||
IO_READ(DPC_END_REG), \
|
||||
IO_READ(DPC_STATUS_REG), \
|
||||
IO_READ(SP_STATUS_REG))
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _RCP_H_ */
|
||||
|
||||
Executable
+107
@@ -0,0 +1,107 @@
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2004/02/06 02:26:05 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
#ifdef BBPLAYER
|
||||
#define RDB_TYPE_GtoH_DATAB 23
|
||||
#define RDB_TYPE_GtoH_SYNC 25
|
||||
#endif
|
||||
|
||||
|
||||
#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
|
||||
#ifdef BBPLAYER
|
||||
#define RDB_TYPE_HtoG_DATAB 24
|
||||
#define RDB_TYPE_HtoG_SYNC_DONE 26
|
||||
#define RDB_TYPE_HtoG_DEBUG_DONE 27
|
||||
#endif
|
||||
|
||||
|
||||
#define RDB_PROF_ACK_SIG 1
|
||||
#define RDB_PROF_FLUSH_SIG 2
|
||||
#define PROF_BLOCK_SIZE 2048
|
||||
|
||||
#ifdef BBPLAYER
|
||||
#define RDB_LOG_MAX_BLOCK_SIZE 0x1000
|
||||
#define RDB_DATA_MAX_BLOCK_SIZE 0x1000
|
||||
#else
|
||||
#define RDB_LOG_MAX_BLOCK_SIZE 0x8000
|
||||
#define RDB_DATA_MAX_BLOCK_SIZE 0x8000
|
||||
#endif
|
||||
|
||||
|
||||
/* 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 */
|
||||
Executable
+123
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Author: blythe $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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_ */
|
||||
|
||||
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* 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.2 $
|
||||
* $Date: 2004/02/06 02:27:21 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
|
||||
#ifdef BBPLAYER
|
||||
|
||||
/* Let's use GDB debugger instead of RMON */
|
||||
#define rmonMain gdbMain
|
||||
#define rmonPrintf osSyncPrintf
|
||||
|
||||
#define GDB_DBG_BUF_SIZE 2048
|
||||
#define GDB_STACKSIZE 0x1000
|
||||
|
||||
extern void gdbMain( void * );
|
||||
extern void gdbInit();
|
||||
|
||||
#else
|
||||
extern void rmonMain( void * );
|
||||
extern void rmonPrintf( const char *, ... );
|
||||
#endif
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_H */
|
||||
Executable
+85
@@ -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/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
Executable
+69
@@ -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/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
Executable
+115
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
|
||||
Executable
+196
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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_ */
|
||||
Executable
+201
@@ -0,0 +1,201 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/sptask.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SPTASK_H_
|
||||
#define _SPTASK_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Task List Structure.
|
||||
*
|
||||
* Things an app might pass to the SP via the task list.
|
||||
* Not every task ucode would need/use every field, but
|
||||
*
|
||||
* - type (audio, gfx, video, ...)
|
||||
* - flags
|
||||
* - wait for DP to drain before running new task
|
||||
* - SEE BIT DEFINITIONS UNDER "Task Flags field"
|
||||
* - pointer to boot ucode
|
||||
* - size of boot ucode
|
||||
* - pointer to ucode
|
||||
* - size of ucode
|
||||
* - pointer to initial DMEM data
|
||||
* - size of initial DMEM data
|
||||
* - pointer to DRAM stack
|
||||
* - size of DRAM stack (max)
|
||||
* - pointer to output buffer
|
||||
* - pointer to store output buffer length
|
||||
* - generic data pointer (for display list, etc.)
|
||||
* - generic data length (for display list, etc.)
|
||||
* - pointer to buffer where to store saved DMEM (in yield case)
|
||||
* - size of buffer to store saved DMEM.
|
||||
*
|
||||
* IMPORTANT!!! Watch alignment issues.
|
||||
*
|
||||
* IMPORTANT!!! Watch data cache issues. The RCP may write data into the
|
||||
* dram_stack, output_buff, output_buff_size, and the yield_data_ptr areas.
|
||||
* These buffers should be cache aligned and use the entire line (16 bytes) to
|
||||
* avoid corruption by writebacks by the CPU (cache tearing).
|
||||
*
|
||||
* IMPORTANT!!! all addresses are virtual addresses. Library does
|
||||
* any necessary translation.
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
u32 type;
|
||||
u32 flags;
|
||||
|
||||
u64 *ucode_boot;
|
||||
u32 ucode_boot_size;
|
||||
|
||||
u64 *ucode;
|
||||
u32 ucode_size;
|
||||
|
||||
u64 *ucode_data;
|
||||
u32 ucode_data_size;
|
||||
|
||||
u64 *dram_stack;
|
||||
u32 dram_stack_size;
|
||||
|
||||
u64 *output_buff;
|
||||
u64 *output_buff_size;
|
||||
|
||||
u64 *data_ptr;
|
||||
u32 data_size;
|
||||
|
||||
u64 *yield_data_ptr;
|
||||
u32 yield_data_size;
|
||||
|
||||
} OSTask_t;
|
||||
|
||||
typedef union {
|
||||
OSTask_t t;
|
||||
long long int force_structure_alignment;
|
||||
} OSTask;
|
||||
|
||||
typedef u32 OSYieldResult;
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
|
||||
/*
|
||||
* For the RSP ucode:
|
||||
* offsets into the task structure
|
||||
*/
|
||||
|
||||
#include <PR/sptaskoff.h>
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Task Flags field
|
||||
*/
|
||||
#define OS_TASK_YIELDED 0x0001
|
||||
#define OS_TASK_DP_WAIT 0x0002
|
||||
#define OS_TASK_LOADABLE 0x0004
|
||||
#define OS_TASK_SP_ONLY 0x0008
|
||||
#define OS_TASK_USR0 0x0010
|
||||
#define OS_TASK_USR1 0x0020
|
||||
#define OS_TASK_USR2 0x0040
|
||||
#define OS_TASK_USR3 0x0080
|
||||
|
||||
/*
|
||||
* Size of Yield buffer. The taskHdrPtr->t.yield_data_ptr must point to a
|
||||
* buffer of this size. (The size is in bytes). ONLY If the task will NEVER
|
||||
* yield it may be a null pointer. The buffer must be aligned to a 64 bit
|
||||
* boundary. The taskHdrPtr->t.yield_data_ptr must be set to point to the
|
||||
* buffer BEFORE the task is started.
|
||||
*/
|
||||
#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)||defined(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 */
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#define OS_TASK_SIZE 64
|
||||
#define OS_TASK_OFF_TYPE 0
|
||||
#define OS_TASK_OFF_FLAGS 4
|
||||
#define OS_TASK_OFF_UBOOT 8
|
||||
#define OS_TASK_OFF_UBOOT_SZ 12
|
||||
#define OS_TASK_OFF_UCODE 16
|
||||
#define OS_TASK_OFF_UCODE_SZ 20
|
||||
#define OS_TASK_OFF_UDATA 24
|
||||
#define OS_TASK_OFF_UDATA_SZ 28
|
||||
#define OS_TASK_OFF_STACK 32
|
||||
#define OS_TASK_OFF_STACK_SZ 36
|
||||
#define OS_TASK_OFF_OUTBUFF 40
|
||||
#define OS_TASK_OFF_OUTBUFF_SZ 44
|
||||
#define OS_TASK_OFF_DATA 48
|
||||
#define OS_TASK_OFF_DATA_SZ 52
|
||||
#define OS_TASK_OFF_YIELD 56
|
||||
#define OS_TASK_OFF_YIELD_SZ 60
|
||||
Executable
+82
@@ -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/routefree/bb/depot/rf/sw/bbplayer/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_ */
|
||||
|
||||
File renamed without changes.
Executable
+54
@@ -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.1.1 2002/05/02 03:28:25 blythe 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 ========*/
|
||||
Executable
+179
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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__ */
|
||||
Executable
+74
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
File renamed without changes.
Executable
+134
@@ -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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/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
|
||||
Executable
+120
@@ -0,0 +1,120 @@
|
||||
#ifndef _VERIFY_H_
|
||||
#define _VERIFY_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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/verify.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/*
|
||||
* This structure must be aligned to 64-bit boundary for the
|
||||
* RSP to get at it. Likewise, the important fields that the
|
||||
* RSP writes back must also be aligned...
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int rspListAddr; /* 0x00 */ /* ALIGNED */
|
||||
unsigned int rspListSize; /* 0x04 */
|
||||
|
||||
unsigned int rspListType; /* 0x08 */
|
||||
unsigned int ucodeTextAddr; /* 0x0c */
|
||||
|
||||
unsigned int ucodeDataAddr; /* 0x10 */
|
||||
unsigned int ucodeDataSize; /* 0x14 */
|
||||
|
||||
unsigned int dramStackAddr; /* 0x18 */
|
||||
unsigned int dramStackSize; /* 0x1c */
|
||||
|
||||
/* this length must be a 64-bit thing so the RSP can DMA it */
|
||||
unsigned long long int rdpListSize; /* 0x20 */ /* ALIGNED */
|
||||
|
||||
unsigned int rdpListAddr; /* 0x28 */ /* ALIGNED */
|
||||
unsigned int pad1;
|
||||
|
||||
unsigned int bootUcodeAddr; /* 0x30 */
|
||||
|
||||
unsigned short width; /* 0x34 */
|
||||
unsigned short height; /* 0x36 */
|
||||
|
||||
unsigned int frameBuffer0Addr; /* 0x38 */
|
||||
unsigned int frameBuffer1Addr; /* 0x3c */
|
||||
|
||||
unsigned int zBufferAddr; /* 0x40 */
|
||||
|
||||
unsigned long magicNumber; /* 0x44 */
|
||||
unsigned long version; /* 0x48 */
|
||||
|
||||
unsigned int frameBufferFormat; /* 0x4c */
|
||||
unsigned int frameBufferSize; /* 0x50 */
|
||||
|
||||
unsigned int staticSegAddr; /* 0x54 */
|
||||
unsigned int staticSegSize; /* 0x58 */
|
||||
|
||||
} VerifyInfo;
|
||||
|
||||
|
||||
#define MAGICNUMBER 0x102594 /* (Kaelyn's Birthday) */
|
||||
#define VERSION 1
|
||||
|
||||
#define CVGMAGIC 0x00120594
|
||||
|
||||
struct CVGHeader {
|
||||
unsigned long magic;
|
||||
unsigned char format;
|
||||
unsigned char size;
|
||||
unsigned short width;
|
||||
unsigned short height;
|
||||
};
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#define VERIFY_INFO_PHYSADDR 0x00000800
|
||||
|
||||
#define RSPLIST_ADDR_OFFSET 0x00
|
||||
#define RSPLIST_SIZE_OFFSET 0x04
|
||||
#define RSPLIST_TYPE_OFFSET 0x08
|
||||
#define UCODETEXT_ADDR_OFFSET 0x0c
|
||||
#define UCODEDATA_ADDR_OFFSET 0x10
|
||||
#define UCODEDATA_SIZE_OFFSET 0x14
|
||||
#define DRAMSTACK_ADDR_OFFSET 0x18
|
||||
#define DRAMSTACK_SIZE_OFFSET 0x1c
|
||||
#define RDPLISTSIZE_OFFSET 0x20
|
||||
#define RDPLIST_ADDR_OFFSET 0x28
|
||||
#define BOOTUCODE_ADDR_OFFST 0x30
|
||||
#define WIDTH_OFFSET 0x34
|
||||
#define HEIGHT_OFFSET 0x36
|
||||
#define FRAMEBUFFER0_ADDR_OFFSET 0x38
|
||||
#define FRAMEBUFFER1_ADDR_OFFSET 0x3c
|
||||
#define ZBUFFER_ADDR_OFFSET 0x40
|
||||
|
||||
|
||||
/*
|
||||
* Address map for family of verification programs
|
||||
*/
|
||||
#define JEAN_START_ADDR 0x000000
|
||||
#define JEAN_END_ADDR 0x010000
|
||||
#define APP_START_ADDR JEAN_END_ADDR
|
||||
#define APP_END_ADDR 0x0b0000
|
||||
#define FB_START_ADDR APP_END_ADDR
|
||||
#define ZB_START_ADDR 0x100000
|
||||
#define ZB_END_ADDR 0x125800
|
||||
#define EVAN_START_ADDR 0x130000
|
||||
#define EVAN_END_ADDR 0x140000
|
||||
|
||||
#endif /* !_VERIFY_H_ */
|
||||
Executable
+40
@@ -0,0 +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.1.1.2 $
|
||||
* $Date: 2002/10/29 08:06:34 $
|
||||
* $Source: /home/routefree/bb/depot/rf/sw/bbplayer/include/ultra64.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _ULTRA64_H_
|
||||
#define _ULTRA64_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/rcp.h>
|
||||
#include <PR/os.h>
|
||||
#include <PR/region.h>
|
||||
#include <PR/rmon.h>
|
||||
#include <PR/sptask.h>
|
||||
#include <PR/mbi.h>
|
||||
#include <PR/libaudio.h>
|
||||
#include <PR/gu.h>
|
||||
#include <PR/ramrom.h>
|
||||
#include <PR/sp.h>
|
||||
#include <PR/ucode.h>
|
||||
#include <PR/ultraerror.h>
|
||||
#include <PR/ultralog.h>
|
||||
|
||||
#endif
|
||||
File renamed without changes.
File renamed without changes.
Loaded 100 of 179 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user