mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
+4
-1
@@ -1,4 +1,6 @@
|
||||
asm
|
||||
expected
|
||||
__pycache__
|
||||
.splat/
|
||||
starfox64.ld
|
||||
starfox64.us.yaml
|
||||
@@ -7,4 +9,5 @@ starfox64.us.yaml
|
||||
*.n64
|
||||
*.z64
|
||||
*.bin
|
||||
/build
|
||||
/build
|
||||
gfxdis*
|
||||
@@ -4,3 +4,6 @@
|
||||
[submodule "tools/asm-processor"]
|
||||
path = tools/asm-processor
|
||||
url = https://github.com/simonlindholm/asm-processor
|
||||
[submodule "tools/asm-differ"]
|
||||
path = tools/asm-differ
|
||||
url = https://github.com/simonlindholm/asm-differ
|
||||
|
||||
Vendored
-31
@@ -14,36 +14,5 @@
|
||||
"tools/gfxsotn/**": false,
|
||||
},
|
||||
"files.associations": {
|
||||
"main.h": "c",
|
||||
"game.h": "c",
|
||||
"stage.h": "c",
|
||||
"common.h": "c",
|
||||
"types.h": "c",
|
||||
"macros.h": "c",
|
||||
"include_asm.h": "c",
|
||||
"sfx.h": "c",
|
||||
"libc.h": "c",
|
||||
"unkstruct.h": "c",
|
||||
"cen.h": "c",
|
||||
"np3.h": "c",
|
||||
"nz0.h": "c",
|
||||
"objects.h": "c",
|
||||
"ric.h": "c",
|
||||
"st0.h": "c",
|
||||
"animateentity.h": "c",
|
||||
"dre.h": "c",
|
||||
"mad.h": "c",
|
||||
"sattypes.h": "c",
|
||||
"stage_02.h": "c",
|
||||
"dra.h": "c",
|
||||
"items.h": "c",
|
||||
"libcd.h": "c",
|
||||
"no3.h": "c",
|
||||
"replace_breakable_with_item_drop.h": "c",
|
||||
"cr.h": "c",
|
||||
"ch.h": "c",
|
||||
"libgte.h": "c",
|
||||
"LIBGTE.H": "cpp",
|
||||
"entity.h": "c"
|
||||
},
|
||||
}
|
||||
@@ -78,10 +78,7 @@ endif
|
||||
|
||||
### Compiler ###
|
||||
|
||||
CC := tools/ido_recomp/$(DETECTED_OS)/7.1/cc
|
||||
CC_OLD := tools/ido_recomp/$(DETECTED_OS)/5.3/cc
|
||||
|
||||
|
||||
CC := tools/ido_recomp/$(DETECTED_OS)/5.3/cc
|
||||
AS := $(MIPS_BINUTILS_PREFIX)as
|
||||
LD := $(MIPS_BINUTILS_PREFIX)ld
|
||||
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
|
||||
@@ -180,9 +177,13 @@ $(shell mkdir -p $(BUILD_DIR)/linker_scripts/$(VERSION) $(BUILD_DIR)/linker_scri
|
||||
|
||||
|
||||
# directory flags
|
||||
build/src/main/O2/%.o: OPTFLAGS := -O2
|
||||
|
||||
# per-file flags
|
||||
build/src/libultra/io/pidma.o: OPTFLAGS := -O1 -g0
|
||||
build/src/main/1EB50.o: OPTFLAGS := -O1 -g0
|
||||
build/src/libultra/2BDF0.o: OPTFLAGS := -O1 -g0
|
||||
build/src/libultra/2C700.o: OPTFLAGS := -O1 -g0
|
||||
build/src/libultra/2D300.o: OPTFLAGS := -O1 -g0
|
||||
|
||||
# cc & asm-processor
|
||||
build/src/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) --
|
||||
@@ -191,8 +192,8 @@ all: uncompressed
|
||||
|
||||
init:
|
||||
$(MAKE) clean
|
||||
$(MAKE) extract -j
|
||||
$(MAKE) all
|
||||
$(MAKE) extract -j $(nproc)
|
||||
$(MAKE) all -j $(nproc)
|
||||
|
||||
uncompressed: $(ROM)
|
||||
ifneq ($(COMPARE),0)
|
||||
@@ -216,10 +217,16 @@ clean:
|
||||
@git clean -fdx build/
|
||||
|
||||
format:
|
||||
@./tools/format.py
|
||||
@./tools/format.py -j $(nproc)
|
||||
|
||||
checkformat:
|
||||
@./tools/check_format.sh
|
||||
@./tools/check_format.sh -j $(nproc)
|
||||
|
||||
# asm-differ expected object files
|
||||
expected:
|
||||
mkdir -p expected/build
|
||||
rm -rf expected/build/
|
||||
cp -r build/ expected/build/
|
||||
|
||||
|
||||
#### Various Recipes ####
|
||||
@@ -238,13 +245,16 @@ $(ELF): $(LIBULTRA_O) $(O_FILES) $(LD_SCRIPT) $(BUILD_DIR)/linker_scripts/$(VERS
|
||||
$(BUILD_DIR)/%.ld: %.ld
|
||||
$(CPP) $(CPPFLAGS) $(BUILD_DEFINES) $(IINC) $< > $@
|
||||
|
||||
# Binary
|
||||
$(BUILD_DIR)/%.o: %.bin
|
||||
$(OBJCOPY) -I binary -O elf32-big $< $@
|
||||
|
||||
# Assembly
|
||||
$(BUILD_DIR)/%.o: %.s
|
||||
$(CPP) $(CPPFLAGS) $(BUILD_DEFINES) $(IINC) -I $(dir $*) $(COMMON_DEFINES) $(RELEASE_DEFINES) $(GBI_DEFINES) $(AS_DEFINES) $< | $(ICONV) $(ICONV_FLAGS) | $(AS) $(ASFLAGS) $(ENDIAN) $(IINC) -I $(dir $*) -o $@
|
||||
$(OBJDUMP_CMD)
|
||||
|
||||
# C
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(CC_CHECK) $(CC_CHECK_FLAGS) $(IINC) -I $(dir $*) $(CHECK_WARNINGS) $(BUILD_DEFINES) $(COMMON_DEFINES) $(RELEASE_DEFINES) $(GBI_DEFINES) $(C_DEFINES) $(MIPS_BUILTIN_DEFS) -o $@ $<
|
||||
$(CC) -c $(CFLAGS) $(BUILD_DEFINES) $(IINC) $(WARNINGS) $(MIPS_VERSION) $(ENDIAN) $(COMMON_DEFINES) $(RELEASE_DEFINES) $(GBI_DEFINES) $(C_DEFINES) $(OPTFLAGS) -o $@ $<
|
||||
|
||||
@@ -53,19 +53,25 @@ cd sf64
|
||||
|
||||
#### 3. Install python dependencies
|
||||
|
||||
The build process has a few python packages required that are located in `requirements.txt`.
|
||||
The build process has a few python packages required that are located in `/tools/requirements-python.txt`.
|
||||
|
||||
To install them simply run in a terminal:
|
||||
|
||||
```bash
|
||||
python3 -m pip install -r requirements.txt
|
||||
python3 -m pip install -r ./tools/requirements-python.txt
|
||||
```
|
||||
|
||||
#### 4. Prepare a base ROM
|
||||
#### 4. Update submodules
|
||||
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
#### 5. Prepare a base ROM
|
||||
|
||||
Copy your ROM to inside the root of this new project directory, and rename the file of the baserom to reflect the version of ROM you are using. ex: `baserom.us.z64`
|
||||
|
||||
#### 5. Make and Build the ROM
|
||||
#### 6. Make and Build the ROM
|
||||
|
||||
To start the extraction/build process, run the following command:
|
||||
|
||||
|
||||
+5
-1
@@ -1,3 +1,6 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
@@ -15,4 +18,5 @@ typedef float f32;
|
||||
#define NULL 0
|
||||
|
||||
double fabsf(double f);
|
||||
#pragma intrinsic(fabsf)
|
||||
#pragma intrinsic(fabsf)
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef FUNCTIONS_H
|
||||
#define FUNCTIONS_H
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
#include "libultra/PR/ultratypes.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
#include "macros.h"
|
||||
|
||||
#endif // GLOBAL_H
|
||||
@@ -0,0 +1,84 @@
|
||||
#ifndef HUD_H
|
||||
#define HUD_H
|
||||
|
||||
#include "global.h"
|
||||
|
||||
typedef struct UnkStruct_func_80095350 {
|
||||
/* 0x00 */ s8 unk0;
|
||||
/* 0x01 */ char pad_1[0x1];
|
||||
/* 0x02 */ s16 unk2;
|
||||
/* 0x04 */ char pad_4[0xB2];
|
||||
/* 0xB6 */ s16 unkB6;
|
||||
} UnkStruct_func_80095350;
|
||||
|
||||
void func_800612B8(void*, u16, void*);
|
||||
void func_800613C4(void*);
|
||||
void func_80084E78(s32*, s32*, s32*, s32, s32, f32, f32, f32, f32, f32, f32);
|
||||
void func_80085944(void);
|
||||
void func_80086CC8(void);
|
||||
void func_80086DCC(void);
|
||||
void func_80087B5C(void);
|
||||
void func_8008A4DC(void);
|
||||
void func_8008B044(void);
|
||||
void func_8008B1B0(void);
|
||||
void func_8008B2F0(void);
|
||||
void func_8008B5B0(f32, f32);
|
||||
void func_8008B734(void);
|
||||
void func_8008B9E8(void);
|
||||
void func_8008BAE4(void);
|
||||
void func_8008CBE4(void);
|
||||
void func_8008D250(void);
|
||||
void func_8008D31C(void);
|
||||
void func_8008D4F0(f32, f32);
|
||||
void func_8008D7F4(void);
|
||||
void func_8008D984(void);
|
||||
void func_8008DC34(void);
|
||||
void func_8008E5E8(void);
|
||||
void func_8008E620(void);
|
||||
void func_80090E8C(void);
|
||||
void func_800910C0(void);
|
||||
void func_8009C320(s32*, s32*, s32*, s32, s32, f32, f32, f32, f32);
|
||||
void func_8009D0BC(s32*, void*, void*, u32, u32, f32, f32, f32, f32);
|
||||
void func_8009D994(s32*, s32*, s32, s32, f32, f32, f32, f32);
|
||||
void func_8009E1E8(s32*, s32*, s32, s32, f32, f32, f32, f32);
|
||||
|
||||
// Weird addresses, assets maybe?
|
||||
extern s32 D_1000E80;
|
||||
extern s32 D_1002280;
|
||||
extern s32 D_10030D0;
|
||||
extern s32 D_1011280;
|
||||
extern s32 D_10116A0;
|
||||
extern s32 D_10116B0;
|
||||
extern s32 D_1011730;
|
||||
extern s32 D_1011AC0;
|
||||
extern s32 D_1011B90;
|
||||
extern s32 D_1011BB0;
|
||||
extern s32 D_1011C80;
|
||||
extern s32 D_1011CA0;
|
||||
extern s32 D_1011D70;
|
||||
extern s32 D_1011D90;
|
||||
extern s32 D_1011E60;
|
||||
extern s32 D_1013170;
|
||||
extern s32 D_1013570;
|
||||
extern s32 D_1013580;
|
||||
extern s32 D_1013700;
|
||||
extern s32 D_3000B20;
|
||||
extern s32 D_30013E0;
|
||||
|
||||
extern s32 D_80137E64;
|
||||
extern s32 D_80161690;
|
||||
extern s32 D_801617E8[];
|
||||
extern s32 D_801617FC;
|
||||
extern s32 D_80161A98;
|
||||
extern s32 D_80177854;
|
||||
extern s32 D_80177880;
|
||||
extern s32 D_801778B0[];
|
||||
extern s32 D_801778BC;
|
||||
extern s32 D_801778E8;
|
||||
extern s32 D_80177B48;
|
||||
extern s32 D_80177B50[];
|
||||
extern s32 D_80177B70[];
|
||||
extern s32 D_80177E7C;
|
||||
extern s32 D_80178750;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,410 @@
|
||||
#ifndef _ABI_H_
|
||||
#define _ABI_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1994, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.32 $
|
||||
* $Date: 1997/02/11 08:16:37 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/abi.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Header file for the Audio Binary Interface.
|
||||
* This is included in the Media Binary Interface file
|
||||
* mbi.h.
|
||||
*
|
||||
* This file follows the framework used for graphics.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Audio commands: */
|
||||
#define A_SPNOOP 0
|
||||
#define A_ADPCM 1
|
||||
#define A_CLEARBUFF 2
|
||||
#define A_ENVMIXER 3
|
||||
#define A_LOADBUFF 4
|
||||
#define A_RESAMPLE 5
|
||||
#define A_SAVEBUFF 6
|
||||
#define A_SEGMENT 7
|
||||
#define A_SETBUFF 8
|
||||
#define A_SETVOL 9
|
||||
#define A_DMEMMOVE 10
|
||||
#define A_LOADADPCM 11
|
||||
#define A_MIXER 12
|
||||
#define A_INTERLEAVE 13
|
||||
#define A_POLEF 14
|
||||
#define A_SETLOOP 15
|
||||
|
||||
#define ACMD_SIZE 32
|
||||
/*
|
||||
* Audio flags
|
||||
*/
|
||||
|
||||
#define A_INIT 0x01
|
||||
#define A_CONTINUE 0x00
|
||||
#define A_LOOP 0x02
|
||||
#define A_OUT 0x02
|
||||
#define A_LEFT 0x02
|
||||
#define A_RIGHT 0x00
|
||||
#define A_VOL 0x04
|
||||
#define A_RATE 0x00
|
||||
#define A_AUX 0x08
|
||||
#define A_NOAUX 0x00
|
||||
#define A_MAIN 0x00
|
||||
#define A_MIX 0x10
|
||||
|
||||
/*
|
||||
* BEGIN C-specific section: (typedef's)
|
||||
*/
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/*
|
||||
* Data Structures.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int addr;
|
||||
} Aadpcm;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int addr;
|
||||
} Apolef;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
} Aenvelope;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int dmem:16;
|
||||
unsigned int pad2:16;
|
||||
unsigned int count:16;
|
||||
} Aclearbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int pad2:16;
|
||||
unsigned int inL:16;
|
||||
unsigned int inR:16;
|
||||
} Ainterleave;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int addr;
|
||||
} Aloadbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
} Aenvmixer;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int dmemi:16;
|
||||
unsigned int dmemo:16;
|
||||
} Amixer;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int dmem2:16;
|
||||
unsigned int addr;
|
||||
} Apan;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pitch:16;
|
||||
unsigned int addr;
|
||||
} Aresample;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
} Areverb;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int addr;
|
||||
} Asavebuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int pad2:2;
|
||||
unsigned int number:4;
|
||||
unsigned int base:24;
|
||||
} Asegment;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int dmemin:16;
|
||||
unsigned int dmemout:16;
|
||||
unsigned int count:16;
|
||||
} Asetbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int vol:16;
|
||||
unsigned int voltgt:16;
|
||||
unsigned int volrate:16;
|
||||
} Asetvol;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int dmemin:16;
|
||||
unsigned int dmemout:16;
|
||||
unsigned int count:16;
|
||||
} Admemmove;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int count:16;
|
||||
unsigned int addr;
|
||||
} Aloadadpcm;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int pad2:16;
|
||||
unsigned int addr;
|
||||
} Asetloop;
|
||||
|
||||
/*
|
||||
* Generic Acmd Packet
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned int w0;
|
||||
unsigned int w1;
|
||||
} Awords;
|
||||
|
||||
typedef union {
|
||||
Awords words;
|
||||
Aadpcm adpcm;
|
||||
Apolef polef;
|
||||
Aclearbuff clearbuff;
|
||||
Aenvelope envelope;
|
||||
Ainterleave interleave;
|
||||
Aloadbuff loadbuff;
|
||||
Aenvmixer envmixer;
|
||||
Aresample resample;
|
||||
Areverb reverb;
|
||||
Asavebuff savebuff;
|
||||
Asegment segment;
|
||||
Asetbuff setbuff;
|
||||
Asetvol setvol;
|
||||
Admemmove dmemmove;
|
||||
Aloadadpcm loadadpcm;
|
||||
Amixer mixer;
|
||||
Asetloop setloop;
|
||||
long long int force_union_align; /* dummy, force alignment */
|
||||
} Acmd;
|
||||
|
||||
/*
|
||||
* ADPCM State
|
||||
*/
|
||||
#define ADPCMVSIZE 8
|
||||
#define ADPCMFSIZE 16
|
||||
typedef short ADPCM_STATE[ADPCMFSIZE];
|
||||
|
||||
/*
|
||||
* Pole filter state
|
||||
*/
|
||||
typedef short POLEF_STATE[4];
|
||||
|
||||
/*
|
||||
* Resampler state
|
||||
*/
|
||||
typedef short RESAMPLE_STATE[16];
|
||||
|
||||
/*
|
||||
* Resampler constants
|
||||
*/
|
||||
#define UNITY_PITCH 0x8000
|
||||
#define MAX_RATIO 1.99996 /* within .03 cents of +1 octave */
|
||||
|
||||
/*
|
||||
* Enveloper/Mixer state
|
||||
*/
|
||||
typedef short ENVMIX_STATE[40];
|
||||
|
||||
/*
|
||||
* Macros to assemble the audio command list
|
||||
*/
|
||||
|
||||
#define aADPCMdec(pkt, f, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aPoleFilter(pkt, f, g, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \
|
||||
_SHIFTL(g, 0, 16)); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aClearBuffer(pkt, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \
|
||||
_a->words.w1 = (unsigned int)(c); \
|
||||
}
|
||||
|
||||
#define aEnvMixer(pkt, f, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aInterleave(pkt, l, r) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \
|
||||
_a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \
|
||||
}
|
||||
|
||||
#define aLoadBuffer(pkt, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aMix(pkt, f, g, i, o) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | _SHIFTL(f, 16, 8) | \
|
||||
_SHIFTL(g, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(i,16, 16) | _SHIFTL(o, 0, 16); \
|
||||
}
|
||||
|
||||
#define aPan(pkt, f, d, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \
|
||||
_SHIFTL(d, 0, 16)); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aResample(pkt, f, p, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\
|
||||
_SHIFTL(p, 0, 16)); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aSaveBuffer(pkt, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
#define aSegment(pkt, s, b) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_SEGMENT, 24, 8); \
|
||||
_a->words.w1 = _SHIFTL(s, 24, 8) | _SHIFTL(b, 0, 24); \
|
||||
}
|
||||
|
||||
#define aSetBuffer(pkt, f, i, o, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \
|
||||
_SHIFTL(i, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \
|
||||
}
|
||||
|
||||
#define aSetVolume(pkt, f, v, t, r) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \
|
||||
_SHIFTL(v, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \
|
||||
}
|
||||
|
||||
#define aSetLoop(pkt, a) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
_a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \
|
||||
_a->words.w1 = (unsigned int)(a); \
|
||||
}
|
||||
|
||||
#define aDMEMMove(pkt, i, o, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_DMEMMOVE, 24, 8) | _SHIFTL(i, 0, 24); \
|
||||
_a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \
|
||||
}
|
||||
|
||||
#define aLoadADPCM(pkt, c, d) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \
|
||||
_a->words.w1 = (unsigned int) d; \
|
||||
}
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#endif /* !_ABI_H_ */
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,363 @@
|
||||
|
||||
/*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* ALL RIGHTS RESERVED
|
||||
*
|
||||
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
|
||||
* States. Use of a copyright notice is precautionary only and does not
|
||||
* imply publication or disclosure.
|
||||
*
|
||||
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to restrictions
|
||||
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
|
||||
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
|
||||
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
|
||||
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
|
||||
*
|
||||
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
|
||||
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
|
||||
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
|
||||
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
|
||||
* GRAPHICS, INC.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: gt.h
|
||||
* Creator: hsa@sgi.com
|
||||
* Create Date: Thu Oct 12 15:48:14 PDT 1995
|
||||
*
|
||||
* This file defines the GBI for the TURBO 3D graphics microcode.
|
||||
* The turbo microcode is a special FEATURE-LIMITED microcode designed
|
||||
* for specific applications. It is not for general use.
|
||||
*
|
||||
* (see XXX for more information)
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.14 $
|
||||
* $Date: 1997/02/11 08:22:47 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/gt.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _GT_H_
|
||||
#define _GT_H_
|
||||
|
||||
/* this file should be #included AFTER gbi.h */
|
||||
|
||||
#include "sptask.h"
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif /* _LANGUAGE_C_PLUS_PLUS */
|
||||
|
||||
/* the following #defines seem out of order, but we need them
|
||||
* for the microcode.
|
||||
*/
|
||||
|
||||
/*
|
||||
* object state field: rendState
|
||||
*
|
||||
* This flag word is built up out of the bits from a
|
||||
* subset of the G_SETGEOMETRYMODE flags from gbi.h.
|
||||
*
|
||||
* When each of these bits is '1', the comments below explain
|
||||
* the effect on the triangles.
|
||||
*/
|
||||
#define GT_ZBUFFER G_ZBUFFER
|
||||
#define GT_TEXTURE G_TEXTURE_ENABLE /* texture ON */
|
||||
#define GT_CULL_BACK G_CULL_BACK /* reject backfaces */
|
||||
#define GT_SHADING_SMOOTH G_SHADING_SMOOTH /* smooth shade ON */
|
||||
|
||||
/*
|
||||
* object state field: textureState
|
||||
*
|
||||
* The lower 3 bits of this flag word contain the texture tile number
|
||||
* to be used. All triangles of an object are rendered with the same
|
||||
* texture tile.
|
||||
*/
|
||||
|
||||
/*
|
||||
* object state field: flag
|
||||
*
|
||||
* This is a group of what would be pad bits. We use them for some
|
||||
* flag bits.
|
||||
*/
|
||||
#define GT_FLAG_NOMTX 0x01 /* don't load the matrix */
|
||||
#define GT_FLAG_NO_XFM 0x02 /* load vtx, use verbatim */
|
||||
#define GT_FLAG_XFM_ONLY 0x04 /* xform vtx, write to *TriN */
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/* turbo 3D ucode: */
|
||||
extern long long int gspTurbo3DTextStart[], gspTurbo3DTextEnd[];
|
||||
extern long long int gspTurbo3DDataStart[], gspTurbo3DDataEnd[];
|
||||
extern long long int gspTurbo3D_dramTextStart[], gspTurbo3D_dramTextEnd[];
|
||||
extern long long int gspTurbo3D_dramDataStart[], gspTurbo3D_dramDataEnd[];
|
||||
extern long long int gspTurbo3D_fifoTextStart[], gspTurbo3D_fifoTextEnd[];
|
||||
extern long long int gspTurbo3D_fifoDataStart[], gspTurbo3D_fifoDataEnd[];
|
||||
|
||||
/*
|
||||
* This is the global state structure. It's definition carefully
|
||||
* matches the ucode, so if this structure changes, you must also change
|
||||
* the ucode.
|
||||
*/
|
||||
typedef struct {
|
||||
u16 perspNorm; /* persp normalization */
|
||||
u16 pad0;
|
||||
u32 flag;
|
||||
Gfx rdpOthermode;
|
||||
u32 segBases[16]; /* table of segment base addrs (SEE NOTE!) */
|
||||
Vp viewport; /* the viewport to use */
|
||||
Gfx *rdpCmds; /* block of RDP data, process if !NULL
|
||||
* block terminated by gDPEndDisplayList()
|
||||
* (This is a segment address)
|
||||
*/
|
||||
} gtGlobState_t;
|
||||
|
||||
/* NOTE:
|
||||
* Although there are 16 segment table entries, the first one (segment 0)
|
||||
* is reserved for physical memory mapping. You should not segment 0
|
||||
* to anything other than 0x0.
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
gtGlobState_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtGlobState;
|
||||
|
||||
|
||||
/*
|
||||
* This is the 'state' structure associated with each object
|
||||
* to be rendered. It's definition carefully matches the
|
||||
* ucode, so if this structure changes, you must also change
|
||||
* the gtoff.c tool and the ucode.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 renderState; /* render state */
|
||||
u32 textureState; /* texture state */
|
||||
u8 vtxCount; /* how many verts? */
|
||||
u8 vtxV0; /* where to load verts? */
|
||||
u8 triCount; /* how many tris? */
|
||||
u8 flag;
|
||||
Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
Gfx rdpOthermode;
|
||||
Mtx transform; /* the transform matrix to use */
|
||||
} gtState_t;
|
||||
|
||||
typedef union {
|
||||
gtState_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtState;
|
||||
|
||||
/* gtStateLite : same as gtState, but no matrix (see flags below) */
|
||||
/* this structure must be identical to gtState! (bad) */
|
||||
typedef struct {
|
||||
u32 renderState; /* render state */
|
||||
u32 textureState; /* texture state */
|
||||
u8 vtxCount; /* how many verts? */
|
||||
u8 vtxV0; /* where to load verts? */
|
||||
u8 triCount; /* how many tris? */
|
||||
u8 flag;
|
||||
Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
Gfx rdpOthermode;
|
||||
} gtStateL_t;
|
||||
|
||||
typedef union {
|
||||
gtStateL_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtStateL;
|
||||
|
||||
/*
|
||||
* The vertex list for the turbo display list uses the
|
||||
* Vtx struct in gbi.h
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This structure represents a single triangle, part of the
|
||||
* triangle list of the object to be rendered.
|
||||
*
|
||||
* NOTE: The triangle list MUST be aligned to an 8-byte boundary.
|
||||
* Since this structure is only 4 bytes, we are REQUIRING that
|
||||
* this structure only be used as an array of triangles, and we
|
||||
* depend on the MIPS C compiler (which always aligns arrays to
|
||||
* 8-byte boundaries). THIS IS DANGEROUS!!!!
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
u8 v0, v1, v2, flag; /* flag is which one for flat shade */
|
||||
} gtTriN;
|
||||
|
||||
|
||||
/*
|
||||
* This structure represents the transformed points. It is the format
|
||||
* of the points written out when GT_FLAG_XFM_ONLY is set, as well as
|
||||
* the format expected when GT_FLAG_NO_XFM is used.
|
||||
*
|
||||
* NOTE: The size and layout of these points is very similar to Vtx,
|
||||
* except the screen coordinates overwrite the x,y,z,pad fields.
|
||||
* (we could consider adding to the Vtx union, but we want to keep
|
||||
* turbo stuff out of gbi.h)
|
||||
*
|
||||
* NOTE: The z is a special format. It can be used to compare vertices
|
||||
* for sorting, but it should not be used for other purposes. If modified,
|
||||
* the z-buffer hardware might not understand the data.
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
short int xscrn; /* x,y screen coordinates are SSSS10.2 */
|
||||
short int yscrn;
|
||||
int zscrn; /* z screen is S15.16 */
|
||||
|
||||
short int s; /* transformed texture coord, S10.5 */
|
||||
short int t;
|
||||
|
||||
u8 r; /* color (or normal) */
|
||||
u8 g;
|
||||
u8 b;
|
||||
u8 a;
|
||||
} gtVtxOut_t;
|
||||
|
||||
/* see "Data Structure" comment in gbi.h for information about why
|
||||
* we use this union.
|
||||
*/
|
||||
typedef union {
|
||||
gtVtxOut_t v;
|
||||
long long int force_structure_alignment;
|
||||
} gtVtxOut;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* state field: rdpOthermode
|
||||
*
|
||||
* This is one of the trickier state fields. The turbo interface
|
||||
* requires the RDP othermode command to be cached by the host,
|
||||
* therefore we provide a different interface in libultra to help cache
|
||||
* this in the gt state (this word is just bits, you could pack them
|
||||
* on your own).
|
||||
*
|
||||
* gtStateSetOthermode() accomplishs this, taking as arguments
|
||||
* the state, one of the following mode enums, and a piece of data
|
||||
* (othermode parameters from gbi.h).
|
||||
*
|
||||
* By definition, the othermode word from the gt state structure is sent
|
||||
* to the RDP *before* any RDP commands from the rdpCmds[] field. The
|
||||
* othermode is *always* sent.
|
||||
*
|
||||
* Stated another way, NONE of the gbi RDP othermode commands equivalent
|
||||
* to those listed here are allowed in the rdpCmd[] field of the
|
||||
* gt state structure.
|
||||
*
|
||||
* Notice also that many of these commands do not make sense for
|
||||
* the turbo ucode (they control features not supported, like mip-mapping).
|
||||
* They are only included here for completeness.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
GT_CLEAR, /* special gt mode, clears othermode state */
|
||||
GT_ALPHACOMPARE,
|
||||
GT_ZSRCSEL,
|
||||
GT_RENDERMODE,
|
||||
GT_ALPHADITHER,
|
||||
GT_RGBDITHER,
|
||||
GT_COMBKEY,
|
||||
GT_TEXTCONV,
|
||||
GT_TEXTFILT,
|
||||
GT_TEXTLUT,
|
||||
GT_TEXTLOD,
|
||||
GT_TEXTDETAIL,
|
||||
GT_TEXTPERSP,
|
||||
GT_CYCLETYPE,
|
||||
GT_PIPELINE
|
||||
} gtStateOthermode_t;
|
||||
|
||||
/*
|
||||
* This call builds up an othermode command word. The 'mode' is one of
|
||||
* the above modes, the 'data' field comes from gbi.h, it is the data
|
||||
* field for the equivalent gbi setothermode macro.
|
||||
*/
|
||||
extern void gtStateSetOthermode(Gfx *om, gtStateOthermode_t mode, int data);
|
||||
|
||||
/*
|
||||
* This call dumps a turbo display list for use with gbi2mem and RSPSIM
|
||||
*/
|
||||
#define GT_DUMPTURBO_HANGAFTER 64
|
||||
#define GT_DUMPTURBO_NOTEXTURES 128
|
||||
extern void gtDumpTurbo(OSTask *tp,u8 flags);
|
||||
|
||||
/*
|
||||
* Special macros to init othermode words to all 0's, a good default
|
||||
* value.
|
||||
*/
|
||||
#define gDPClearOtherMode(pkt) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE, 24, 8); \
|
||||
_g->words.w1 = 0x0; \
|
||||
}
|
||||
|
||||
#define gsDPClearOtherMode() \
|
||||
{ \
|
||||
_SHIFTL(G_RDPSETOTHERMODE, 24, 8), 0x0 \
|
||||
}
|
||||
|
||||
/*
|
||||
* Special macros to end DP blocks (see above). These commands
|
||||
* generate all 0's, which the turbo ucode looks for. They *aren't*
|
||||
* real DP commands!
|
||||
*/
|
||||
#define gDPEndDisplayList(pkt) gSPNoOp(pkt)
|
||||
#define gsDPEndDisplayList() gsSPNoOp()
|
||||
|
||||
/*
|
||||
* This structure is a turbo 'object', the turbo display list is
|
||||
* simply a list of these.
|
||||
*
|
||||
* NOTE: All pointers are segment addresses
|
||||
*
|
||||
* NOTE: If (statep->flag & GT_FLAG_XFM_ONLY), the trip field is
|
||||
* interpreted as a pointer to gtVtxOut[] that can be used to store
|
||||
* the transformed points. (statep->triCount should be 0, else bad
|
||||
* things could happen...)
|
||||
*
|
||||
* NOTE: If (statep->flag & GT_FLAG_NO_XFM), the vtxp field is
|
||||
* interpreted as a pointer to gtVtxOut[] that can be used to load
|
||||
* pre-transformed points.
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
gtGlobState *gstatep; /* global state, usually NULL */
|
||||
gtState *statep; /* if this is NULL, end object processing */
|
||||
Vtx *vtxp; /* if this is NULL, use points in buffer */
|
||||
gtTriN *trip; /* if this is NULL, use tris in buffer */
|
||||
} gtGfx_t;
|
||||
|
||||
typedef union {
|
||||
gtGfx_t obj;
|
||||
long long int force_structure_alignment;
|
||||
} gtGfx;
|
||||
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
#include <PR/gtoff.h>
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif /* _LANGUAGE_C_PLUS_PLUS */
|
||||
|
||||
#ifdef _LANGUAGE_MAKEROM
|
||||
#endif /* _LANGUAGE_MAKEROM */
|
||||
|
||||
#endif /* _GT_H_ */
|
||||
@@ -0,0 +1,266 @@
|
||||
#ifndef _GU_H_
|
||||
#define _GU_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1994, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.45 $
|
||||
* $Date: 1997/02/11 08:23:46 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/gu.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/mbi.h>
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/sptask.h>
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_DTOR (3.14159265358979323846/180.0)
|
||||
|
||||
#define FTOFIX32(x) ((x) * 0x10000)
|
||||
#define FIX32TOF(x) ((float)(((float)x) / (float)(0x10000)))
|
||||
#define FTOFRAC8(x) ((int) MIN(((x) * (128.0)),127.0) & 0xff)
|
||||
|
||||
#define FILTER_WRAP 0
|
||||
#define FILTER_CLAMP 1
|
||||
|
||||
#define RAND(x) (guRandom()%x) /* random number between 0 to x */
|
||||
|
||||
/*
|
||||
* Data Structures
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *base;
|
||||
int fmt, siz;
|
||||
int xsize, ysize;
|
||||
int lsize;
|
||||
/* current tile info */
|
||||
int addr;
|
||||
int w, h;
|
||||
int s, t;
|
||||
} Image;
|
||||
|
||||
typedef struct {
|
||||
float col[3];
|
||||
float pos[3];
|
||||
float a1, a2; /* actual color = col/(a1*dist + a2) */
|
||||
} PositionalLight;
|
||||
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
*/
|
||||
|
||||
extern int guLoadTextureBlockMipMap(Gfx **glist, unsigned char *tbuf, Image *im,
|
||||
unsigned char startTile, unsigned char pal, unsigned char cms,
|
||||
unsigned char cmt, unsigned char masks, unsigned char maskt,
|
||||
unsigned char shifts, unsigned char shiftt, unsigned char cfs,
|
||||
unsigned char cft);
|
||||
|
||||
extern int guGetDPLoadTextureTileSz (int ult, int lrt);
|
||||
extern void guDPLoadTextureTile (Gfx *glistp, void *timg,
|
||||
int texl_fmt, int texl_size,
|
||||
int img_width, int img_height,
|
||||
int uls, int ult, int lrs, int lrt,
|
||||
int palette,
|
||||
int cms, int cmt,
|
||||
int masks, int maskt,
|
||||
int shifts, int shiftt);
|
||||
|
||||
|
||||
/*
|
||||
* matrix operations:
|
||||
*
|
||||
* The 'F' version is floating point, in case the application wants
|
||||
* to do matrix manipulations and convert to fixed-point at the last
|
||||
* minute.
|
||||
*/
|
||||
extern void guMtxIdent(Mtx *m);
|
||||
extern void guMtxIdentF(float mf[4][4]);
|
||||
extern void guOrtho(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guOrthoF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustum(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustumF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guPerspective(Mtx *m, u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guLookAt(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflect(Mtx *m, LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflectF(float mf[4][4], LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtStereo(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guLookAtStereoF(float mf[4][4],
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guRotate(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guRotateF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guRotateRPY(Mtx *m, float r, float p, float y);
|
||||
extern void guRotateRPYF(float mf[4][4], float r, float p, float h);
|
||||
extern void guAlign(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guAlignF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guScale(Mtx *m, float x, float y, float z);
|
||||
extern void guScaleF(float mf[4][4], float x, float y, float z);
|
||||
extern void guTranslate(Mtx *m, float x, float y, float z);
|
||||
extern void guTranslateF(float mf[4][4], float x, float y, float z);
|
||||
extern void guPosition(Mtx *m, float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guPositionF(float mf[4][4], float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
extern void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
extern void guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
|
||||
extern void guMtxCatL(Mtx *m, Mtx *n, Mtx *res);
|
||||
extern void guMtxXFMF(float mf[4][4], float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
extern void guMtxXFML(Mtx *m, float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
|
||||
/* vector utility: */
|
||||
extern void guNormalize(float *x, float *y, float *z);
|
||||
|
||||
/* light utilities: */
|
||||
void guPosLight(PositionalLight *pl, Light *l,
|
||||
float xOb, float yOb, float zOb);
|
||||
void guPosLightHilite(PositionalLight *pl1, PositionalLight *pl2,
|
||||
Light *l1, Light *l2,
|
||||
LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xOb, float yOb, float zOb,
|
||||
float xUp, float yUp, float zUp,
|
||||
int twidth, int theight);
|
||||
extern int guRandom(void);
|
||||
|
||||
/*
|
||||
* Math functions
|
||||
*/
|
||||
extern float sinf(float angle);
|
||||
extern float cosf(float angle);
|
||||
extern signed short sins (unsigned short angle);
|
||||
extern signed short coss (unsigned short angle);
|
||||
extern float sqrtf(float value);
|
||||
|
||||
/*
|
||||
* Dump routines for low-level display lists
|
||||
*/
|
||||
/* flag values for guParseRdpDL() */
|
||||
#define GU_PARSERDP_VERBOSE 1
|
||||
#define GU_PARSERDP_PRAREA 2
|
||||
#define GU_PARSERDP_PRHISTO 4
|
||||
#define GU_PARSERDP_DUMPONLY 32 /* doesn't need to be same as */
|
||||
/* GU_PARSEGBI_DUMPOLNY, but this */
|
||||
/* allows app to use interchangeably */
|
||||
|
||||
extern void guParseRdpDL(u64 *rdp_dl, u64 nbytes, u8 flags);
|
||||
extern void guParseString(char *StringPointer, u64 nbytes);
|
||||
|
||||
/*
|
||||
* NO LONGER SUPPORTED,
|
||||
* use guParseRdpDL with GU_PARSERDP_DUMPONLY flags
|
||||
*/
|
||||
/* extern void guDumpRawRdpDL(u64 *rdp_dl, u64 nbytes); */
|
||||
|
||||
/* flag values for guBlinkRdpDL() */
|
||||
#define GU_BLINKRDP_HILITE 1
|
||||
#define GU_BLINKRDP_EXTRACT 2
|
||||
|
||||
extern void
|
||||
guBlinkRdpDL(u64 *rdp_dl_in, u64 nbytes_in,
|
||||
u64 *rdp_dl_out, u64 *nbytes_out,
|
||||
u32 x, u32 y, u32 radius,
|
||||
u8 red, u8 green, u8 blue,
|
||||
u8 flags);
|
||||
|
||||
/* flag values for guParseGbiDL() */
|
||||
#define GU_PARSEGBI_ROWMAJOR 1
|
||||
#define GU_PARSEGBI_NONEST 2
|
||||
#define GU_PARSEGBI_FLTMTX 4
|
||||
#define GU_PARSEGBI_SHOWDMA 8
|
||||
#define GU_PARSEGBI_ALLMTX 16
|
||||
#define GU_PARSEGBI_DUMPONLY 32
|
||||
/*
|
||||
#define GU_PARSEGBI_HANGAFTER 64
|
||||
#define GU_PARSEGBI_NOTEXTURES 128
|
||||
*/
|
||||
extern void guParseGbiDL(u64 *gbi_dl, u32 nbytes, u8 flags);
|
||||
extern void guDumpGbiDL(OSTask *tp,u8 flags);
|
||||
|
||||
#define GU_PARSE_GBI_TYPE 1
|
||||
#define GU_PARSE_RDP_TYPE 2
|
||||
#define GU_PARSE_READY 3
|
||||
#define GU_PARSE_MEM_BLOCK 4
|
||||
#define GU_PARSE_ABI_TYPE 5
|
||||
#define GU_PARSE_STRING_TYPE 6
|
||||
|
||||
typedef struct {
|
||||
int dataSize;
|
||||
int dlType;
|
||||
int flags;
|
||||
u32 paddr;
|
||||
} guDLPrintCB;
|
||||
|
||||
void guSprite2DInit(uSprite *SpritePointer,
|
||||
void *SourceImagePointer,
|
||||
void *TlutPointer,
|
||||
int Stride,
|
||||
int SubImageWidth,
|
||||
int SubImageHeight,
|
||||
int SourceImageType,
|
||||
int SourceImageBitSize,
|
||||
int SourceImageOffsetS,
|
||||
int SourceImageOffsetT);
|
||||
|
||||
#endif /* !_GU_H_ */
|
||||
@@ -0,0 +1,238 @@
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 1997/02/13 14:54:47 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/leo.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _LEO_H_
|
||||
#define _LEO_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <ultra64.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;
|
||||
u16 diskUsage;
|
||||
LEOSerialNum serialNumber;
|
||||
u64 reserve;
|
||||
} LEODiskID;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LEOCmdHeader header;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u32 lba;
|
||||
u32 xfer_blks;
|
||||
void *buff_ptr;
|
||||
u32 rw_bytes;
|
||||
} readwrite;
|
||||
struct
|
||||
{
|
||||
u32 lba;
|
||||
} seek;
|
||||
struct
|
||||
{
|
||||
void *buffer_pointer;
|
||||
} readdiskid;
|
||||
LEODiskTime time;
|
||||
} 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 1 /* 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 LEO_MOTOR_ACTIVE 0
|
||||
#define LEO_MOTOR_STANDBY 1
|
||||
#define LEO_MOTOR_SLEEP 2
|
||||
|
||||
#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_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_NOT_BOOTED_DISK 45
|
||||
#define LEO_ERROR_DIDNOT_CHANGED_DISK_AS_EXPECTED 46
|
||||
#define LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED 47
|
||||
#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48
|
||||
#define LEO_ERROR_DISK_EJECTED_WHEN_ACCESSED 49
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
#define GET_ERROR(x) ((x).header.sense)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
extern LEODiskID leoBootID;
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
/* Initialize routine */
|
||||
extern s32 LeoCreateLeoManager(OSPri comPri, OSPri intPri,
|
||||
OSMesg *cmdBuf, s32 cmdMsgCnt);
|
||||
|
||||
/* 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);
|
||||
extern s32 LeoModeSelect(u32 standby, u32 sleep);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* Font routines */
|
||||
extern int LeoGetKAdr(int sjis);
|
||||
extern int LeoGetAAdr(int code,int *dx,int *dy, int *cy);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_LEO_H */
|
||||
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
* F i l e N a m e : l e o a p p l i . h
|
||||
*
|
||||
****************************************************************************
|
||||
* (C) Copyright ALPS Electric Co., Ltd. 1995-1996
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 1997/02/11 16:14:19 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/leoappli.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* DRIVE PARAMETER */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_DISK_TYPE_MIN 0
|
||||
#define LEO_DISK_TYPE_MAX 6
|
||||
|
||||
#define LEO_LBA_MIN 0
|
||||
#define LEO_LBA_MAX 4291
|
||||
|
||||
#define LEO_LBA_ROM_TOP LEO_LBA_MIN
|
||||
#define LEO_LBA_ROM_END0 1417
|
||||
#define LEO_LBA_ROM_END1 1965
|
||||
#define LEO_LBA_ROM_END2 2513
|
||||
#define LEO_LBA_ROM_END3 3061
|
||||
#define LEO_LBA_ROM_END4 3609
|
||||
#define LEO_LBA_ROM_END5 4087
|
||||
#define LEO_LBA_ROM_END6 LEO_LBA_MAX
|
||||
#define LEO_LBA_RAM_TOP0 (LEO_LBA_ROM_END0+1)
|
||||
#define LEO_LBA_RAM_TOP1 (LEO_LBA_ROM_END1+1)
|
||||
#define LEO_LBA_RAM_TOP2 (LEO_LBA_ROM_END2+1)
|
||||
#define LEO_LBA_RAM_TOP3 (LEO_LBA_ROM_END3+1)
|
||||
#define LEO_LBA_RAM_TOP4 (LEO_LBA_ROM_END4+1)
|
||||
#define LEO_LBA_RAM_TOP5 (LEO_LBA_ROM_END5+1)
|
||||
#define LEO_LBA_RAM_TOP6 (LEO_LBA_ROM_END6+1)
|
||||
#define LEO_LBA_RAM_END6 LEO_LBA_MAX
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* LEO FUNCTION DEFINITIONS */
|
||||
/*-----------------------------------*/
|
||||
extern void leoInitialize(OSPri PRI_WRK, OSPri PRI_INT, OSMesg *command_que_buf, u32 cmd_buff_size);
|
||||
extern void leoCommand(void *CDB);
|
||||
extern void leoReset(void);
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* THREAD PRIORITY */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_PRIORITY_WRK (OS_PRIORITY_PIMGR-1)
|
||||
#define LEO_PRIORITY_INT OS_PRIORITY_PIMGR
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* COMMAND CODE */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_COMMAND_CLEAR_QUE 0x01
|
||||
#define LEO_COMMAND_INQUIRY 0x02
|
||||
#define LEO_COMMAND_TEST_UNIT_READY 0x03
|
||||
#define LEO_COMMAND_REZERO 0x04
|
||||
#define LEO_COMMAND_READ 0x05
|
||||
#define LEO_COMMAND_WRITE 0x06
|
||||
#define LEO_COMMAND_SEEK 0x07
|
||||
#define LEO_COMMAND_START_STOP 0x08
|
||||
#define LEO_COMMAND_READ_CAPACITY 0x09
|
||||
#define LEO_COMMAND_TRANSLATE 0x0a
|
||||
#define LEO_COMMAND_MODE_SELECT 0x0b
|
||||
#define LEO_COMMAND_READ_DISK_ID 0x0c
|
||||
#define LEO_COMMAND_READ_TIMER 0x0d
|
||||
#define LEO_COMMAND_SET_TIMER 0x0e
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* CONTROL BIT */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_CONTROL_POST 0x80 /* ENABLE POST QUEUE */
|
||||
#define LEO_CONTROL_START 0x01 /* START COMMAND */
|
||||
#define LEO_CONTROL_STBY 0x02 /* STAND-BY MODE(NOT SLEEP MODE) */
|
||||
#define LEO_CONTROL_WRT 0x01 /* READ RE-WRITE-ABLE CAPACITY */
|
||||
#define LEO_CONTROL_TBL 0x01 /* TRANSLATE BYTE TO LBA */
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* BIT FIELD PARAMETER */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_TEST_UNIT_MR 0x01 /* MEDIUM REMOVED */
|
||||
#define LEO_TEST_UNIT_RE 0x02 /* HEAD RETRACTED */
|
||||
#define LEO_TEST_UNIT_SS 0x04 /* SPINDLE STOPPED */
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* STATUS */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_STATUS_GOOD 0x00
|
||||
#define LEO_STATUS_CHECK_CONDITION 0x02
|
||||
#define LEO_STATUS_BUSY 0x08
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* SENSE CODE */
|
||||
/*-----------------------------------*/
|
||||
#define LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION 00
|
||||
#define LEO_SENSE_DRIVE_NOT_READY 01
|
||||
#define LEO_SENSE_DIAGNOSTIC_FAILURE 02
|
||||
#define LEO_SENSE_COMMAND_PHASE_ERROR 03
|
||||
#define LEO_SENSE_DATA_PHASE_ERROR 04
|
||||
#define LEO_SENSE_REAL_TIME_CLOCK_FAILURE 05
|
||||
#define LEO_SENSE_INCOMPATIBLE_MEDIUM_INSTALLED 11
|
||||
#define LEO_SENSE_UNKNOWN_FORMAT 11
|
||||
#define LEO_SENSE_NO_SEEK_COMPLETE 21
|
||||
#define LEO_SENSE_WRITE_FAULT 22
|
||||
#define LEO_SENSE_UNRECOVERED_READ_ERROR 23
|
||||
#define LEO_SENSE_NO_REFERENCE_POSITION_FOUND 24
|
||||
#define LEO_SENSE_TRACK_FOLLOWING_ERROR 25
|
||||
#define LEO_SENSE_TRACKING_OR_SPDL_SERVO_FAILURE 25
|
||||
#define LEO_SENSE_INVALID_COMMAND_OPERATION_CODE 31
|
||||
#define LEO_SENSE_LBA_OUT_OF_RANGE 32
|
||||
#define LEO_SENSE_WRITE_PROTECT_ERROR 33
|
||||
#define LEO_SENSE_COMMAND_TERMINATED 34
|
||||
#define LEO_SENSE_QUEUE_FULL 35
|
||||
#define LEO_SENSE_ILLEGAL_TIMER_VALUE 36
|
||||
#define LEO_SENSE_DEVICE_COMMUNICATION_FAILURE 41
|
||||
#define LEO_SENSE_MEDIUM_NOT_PRESENT 42
|
||||
#define LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED 43
|
||||
#define LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED 47
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* Command Block Header */
|
||||
/*-----------------------------------*/
|
||||
typedef struct{
|
||||
u8 command;
|
||||
u8 reserve1;
|
||||
u8 control;
|
||||
u8 reserve3;
|
||||
u8 status;
|
||||
u8 sense;
|
||||
u8 reserve6;
|
||||
u8 reserve7;
|
||||
OSMesgQueue *post;
|
||||
} LEOCmdHeader;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* CLEAR QUEUE(01H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
} LEOCmdClearQue;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* INQUIRY(02H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u8 dev_type;
|
||||
u8 version;
|
||||
u8 dev_num;
|
||||
u8 leo_bios_ver;
|
||||
u32 reserve5;
|
||||
} LEOCmdInquiry;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* TEST UNIT READY(03H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u8 test;
|
||||
u8 reserve2;
|
||||
u8 reserve3;
|
||||
u8 reserve4;
|
||||
} LEOCmdTestUnitReady;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* REZERO(04H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
} LEOCmdRezero;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* READ(05H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u32 lba;
|
||||
u32 xfer_blks;
|
||||
void *buff_ptr;
|
||||
u32 rw_bytes;
|
||||
} LEOCmdRead;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* WRITE(06H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef LEOCmdRead LEOCmdWrite;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* SEEK(07H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u32 lba;
|
||||
} LEOCmdSeek;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* START/STOP(08H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
} LEOCmdStartStop;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* READ CAPACITY(09H) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u32 start_lba;
|
||||
u32 end_lba;
|
||||
u32 capa_bytes;
|
||||
} LEOCmdReadCapacity;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* TRANSLATE(0AH) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u32 start_lba;
|
||||
u32 in_param;
|
||||
u32 out_param;
|
||||
} LEOCmdTranslate;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* MODE SELECT(0BH) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u8 page_code;
|
||||
u8 reserve1;
|
||||
u8 standby_time;
|
||||
u8 sleep_time;
|
||||
u8 led_on_time;
|
||||
u8 led_off_time;
|
||||
u8 reserve18;
|
||||
u8 reserve19;
|
||||
} LEOCmdModeSelect;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* READ DISK ID(0CH) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
void *buffer_pointer;
|
||||
} LEOCmdReadDiskId;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* READ TIMER(0DH) command */
|
||||
/*-----------------------------------*/
|
||||
typedef struct {
|
||||
LEOCmdHeader header;
|
||||
u8 reserve12;
|
||||
u8 reserve13;
|
||||
u8 year;
|
||||
u8 month;
|
||||
u8 day;
|
||||
u8 hour;
|
||||
u8 minute;
|
||||
u8 second;
|
||||
} LEOCmdReadTimer;
|
||||
|
||||
/*-----------------------------------*/
|
||||
/* SET TIMER(0EH) command */
|
||||
/*-----------------------------------*/
|
||||
typedef LEOCmdReadTimer LEOCmdSetTimer;
|
||||
|
||||
/*-------end of leoappli.h--------------------------*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
/*---------------------------------------------------------------------
|
||||
File : libnos.h version 1.3
|
||||
|
||||
Coded by Yoshitaka Yasumoto. Apr 13, 1996.
|
||||
|
||||
Copyright by Nintendo, Co., Ltd. 1996.
|
||||
---------------------------------------------------------------------*/
|
||||
#ifndef __libnos_h__
|
||||
#define __libnos_h__
|
||||
|
||||
#define FONTSIZE_E 2112
|
||||
#define FONTSIZE_J 4768
|
||||
|
||||
extern void nosLoadFont(u16 *);
|
||||
extern int nosPakMenu(OSMesgQueue *, OSMesgQueue *);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
#ifndef _MBI_H_
|
||||
#define _MBI_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1994, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.134 $
|
||||
* $Date: 1997/02/11 08:25:28 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/mbi.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Header file for the Media Binary Interface
|
||||
*
|
||||
* NOTE: This file is included by the RSP microcode, so any C-specific
|
||||
* constructs must be bracketed by #ifdef _LANGUAGE_C
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* the SHIFT macros are used to build display list commands, inserting
|
||||
* bit-fields into a 32-bit word. They take a value, a shift amount,
|
||||
* and a width.
|
||||
*
|
||||
* For the left shift, the lower bits of the value are masked,
|
||||
* then shifted left.
|
||||
*
|
||||
* For the right shift, the value is shifted right, then the lower bits
|
||||
* are masked.
|
||||
*
|
||||
* (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment)
|
||||
*
|
||||
*/
|
||||
#define _SHIFTL(v, s, w) \
|
||||
((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s)))
|
||||
#define _SHIFTR(v, s, w) \
|
||||
((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))
|
||||
|
||||
#define _SHIFT _SHIFTL /* old, for compatibility only */
|
||||
|
||||
#define G_ON (1)
|
||||
#define G_OFF (0)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Graphics Binary Interface
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/gbi.h>
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Audio Binary Interface
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/abi.h>
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Task list
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define M_GFXTASK 1
|
||||
#define M_AUDTASK 2
|
||||
#define M_VIDTASK 3
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Segment macros and definitions
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define NUM_SEGMENTS (16)
|
||||
#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff)
|
||||
#define SEGMENT_NUMBER(a) ((unsigned int)(a) >> 24)
|
||||
#define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#endif /* !_MBI_H_ */
|
||||
@@ -0,0 +1,155 @@
|
||||
/*---------------------------------------------------------------------
|
||||
File : ncode.h
|
||||
|
||||
Coded by Yoshitaka Yasumoto. Feb 14, 1996.
|
||||
Copyright by Nintendo, Co., Ltd. 1996.
|
||||
---------------------------------------------------------------------*/
|
||||
#ifndef __ncode_h__
|
||||
#define __ncode_h__
|
||||
|
||||
//------------------------------------------------------
|
||||
// Nintendo code for letter(upper case) & digit
|
||||
//------------------------------------------------------
|
||||
#define __NUL 0x00
|
||||
#define __SPC 0x0f
|
||||
#define __0 0x10
|
||||
#define __1 0x11
|
||||
#define __2 0x12
|
||||
#define __3 0x13
|
||||
#define __4 0x14
|
||||
#define __5 0x15
|
||||
#define __6 0x16
|
||||
#define __7 0x17
|
||||
#define __8 0x18
|
||||
#define __9 0x19
|
||||
#define __A 0x1a
|
||||
#define __B 0x1b
|
||||
#define __C 0x1c
|
||||
#define __D 0x1d
|
||||
#define __E 0x1e
|
||||
#define __F 0x1f
|
||||
#define __G 0x20
|
||||
#define __H 0x21
|
||||
#define __I 0x22
|
||||
#define __J 0x23
|
||||
#define __K 0x24
|
||||
#define __L 0x25
|
||||
#define __M 0x26
|
||||
#define __N 0x27
|
||||
#define __O 0x28
|
||||
#define __P 0x29
|
||||
#define __Q 0x2a
|
||||
#define __R 0x2b
|
||||
#define __S 0x2c
|
||||
#define __T 0x2d
|
||||
#define __U 0x2e
|
||||
#define __V 0x2f
|
||||
#define __W 0x30
|
||||
#define __X 0x31
|
||||
#define __Y 0x32
|
||||
#define __Z 0x33
|
||||
#define __EXCLAM 0x34 // !
|
||||
#define __2QUOTE 0x35 // "
|
||||
#define __NUMBR 0x36 // #
|
||||
#define __1QUOTE 0x37 // '
|
||||
#define __ASTER 0x38 // *
|
||||
#define __PLUS 0x39 // +
|
||||
#define __COMMA 0x3a // ,
|
||||
#define __MINUS 0x3b // -
|
||||
#define __PERIOD 0x3c // .
|
||||
#define __SLASH 0x3d // /
|
||||
#define __COLON 0x3e // :
|
||||
#define __EQUAL 0x3f // =
|
||||
#define __QUEST 0x40 // ?
|
||||
#define __AT 0x41 // @
|
||||
|
||||
//-----------------------------------------------
|
||||
// Nintendo code for JAPANESE letter
|
||||
//-----------------------------------------------
|
||||
#ifdef LANG_JAPANESE
|
||||
# define j_MARU 0x42
|
||||
# define j_DAKU 0x43
|
||||
# define j_HANDAKU 0x44
|
||||
# define j_XA 0x45
|
||||
# define j_XI 0x46
|
||||
# define j_XU 0x47
|
||||
# define j_XE 0x48
|
||||
# define j_XO 0x49
|
||||
# define j_XTSU 0x4a
|
||||
# define j_XYA 0x4b
|
||||
# define j_XYU 0x4c
|
||||
# define j_XYO 0x4d
|
||||
# define j_WO 0x4e
|
||||
# define j_N 0x4f
|
||||
# define j_A 0x50
|
||||
# define j_I 0x51
|
||||
# define j_U 0x52
|
||||
# define j_E 0x53
|
||||
# define j_O 0x54
|
||||
# define j_KA 0x55
|
||||
# define j_KI 0x56
|
||||
# define j_KU 0x57
|
||||
# define j_KE 0x58
|
||||
# define j_KO 0x59
|
||||
# define j_SA 0x5a
|
||||
# define j_SHI 0x5b
|
||||
# define j_SU 0x5c
|
||||
# define j_SE 0x5d
|
||||
# define j_SO 0x5e
|
||||
# define j_TA 0x5f
|
||||
# define j_CHI 0x60
|
||||
# define j_TSU 0x61
|
||||
# define j_TE 0x62
|
||||
# define j_TO 0x63
|
||||
# define j_NA 0x64
|
||||
# define j_NI 0x65
|
||||
# define j_NU 0x66
|
||||
# define j_NE 0x67
|
||||
# define j_NO 0x68
|
||||
# define j_HA 0x69
|
||||
# define j_HI 0x6a
|
||||
# define j_FU 0x6b
|
||||
# define j_HE 0x6c
|
||||
# define j_HO 0x6d
|
||||
# define j_MA 0x6e
|
||||
# define j_MI 0x6f
|
||||
# define j_MU 0x70
|
||||
# define j_ME 0x71
|
||||
# define j_MO 0x72
|
||||
# define j_YA 0x73
|
||||
# define j_YU 0x74
|
||||
# define j_YO 0x75
|
||||
# define j_RA 0x76
|
||||
# define j_RI 0x77
|
||||
# define j_RU 0x78
|
||||
# define j_RE 0x79
|
||||
# define j_RO 0x7a
|
||||
# define j_WA 0x7b
|
||||
# define j_GA 0x7c
|
||||
# define j_GI 0x7d
|
||||
# define j_GU 0x7e
|
||||
# define j_GE 0x7f
|
||||
# define j_GO 0x80
|
||||
# define j_ZA 0x81
|
||||
# define j_JI 0x82
|
||||
# define j_ZU 0x83
|
||||
# define j_ZE 0x84
|
||||
# define j_ZO 0x85
|
||||
# define j_DA 0x86
|
||||
# define j_DI 0x87
|
||||
# define j_DU 0x88
|
||||
# define j_DE 0x89
|
||||
# define j_DO 0x8a
|
||||
# define j_BA 0x8b
|
||||
# define j_BI 0x8c
|
||||
# define j_BU 0x8d
|
||||
# define j_BE 0x8e
|
||||
# define j_BO 0x8f
|
||||
# define j_PA 0x90
|
||||
# define j_PI 0x91
|
||||
# define j_PU 0x92
|
||||
# define j_PE 0x93
|
||||
# define j_PO 0x94
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user