mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Merge pull request #54 from MittenzHugg/master
libultra functions update
This commit is contained in:
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"macros.h": "c",
|
||||
"libultra_internal.h": "c"
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,22 @@ ALL_ASSETS_BUILT := $(ANIMATIONS_BUILT) $(AUDIO_BUILT) $(BILLBOARDS_BUILT) $(BIN
|
||||
|
||||
$(BUILD_DIR)/lib/%.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/lib/src/unknown_0C91A0.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/unknown_0D29F0.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osCreateThread.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osGetThreadPri.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osPiStartDma.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osRecvMesg.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osSendMesg.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osSetTimer.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osStopThread.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osTimer.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osViBlack.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osViSwapBuffer.o : OPT_FLAGS := -O1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################## Targets #############################
|
||||
|
||||
@@ -189,6 +205,13 @@ else
|
||||
@echo "/build/ directory has already been deleted."
|
||||
endif
|
||||
|
||||
clean_lib:
|
||||
ifneq ($(wildcard ./build/lib/.*),)
|
||||
rm -r $(BUILD_DIR)/lib/src/*.o
|
||||
else
|
||||
@echo "/build/lib directory has already been deleted."
|
||||
endif
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(LIB_DIRS) $(ASM_DIRS) $(SRC_DIRS) $(ASSETS_DIRS))
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ glabel func_8007A98C
|
||||
.L8007AAE8:
|
||||
/* 07B6E8 8007AAE8 3C048012 */ lui $a0, %hi(D_801262D8) # $a0, 0x8012
|
||||
/* 07B6EC 8007AAEC 8C8462D8 */ lw $a0, %lo(D_801262D8)($a0)
|
||||
/* 07B6F0 8007AAF0 0C034908 */ jal func_800D2420
|
||||
/* 07B6F0 8007AAF0 0C034908 */ jal osViSwapBuffer
|
||||
/* 07B6F4 8007AAF4 AFA30028 */ sw $v1, 0x28($sp)
|
||||
/* 07B6F8 8007AAF8 02402025 */ move $a0, $s2
|
||||
/* 07B6FC 8007AAFC 00002825 */ move $a1, $zero
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
glabel osCreatePiManager
|
||||
/* 0C6C00 800C6000 27BDFFD0 */ addiu $sp, $sp, -0x30
|
||||
/* 0C6C04 800C6004 AFB00020 */ sw $s0, 0x20($sp)
|
||||
/* 0C6C08 800C6008 3C10800E */ lui $s0, %hi(D_800E3740) # $s0, 0x800e
|
||||
/* 0C6C0C 800C600C 26103740 */ addiu $s0, %lo(D_800E3740) # addiu $s0, $s0, 0x3740
|
||||
/* 0C6C08 800C6008 3C10800E */ lui $s0, %hi(__osPiDevMgr) # $s0, 0x800e
|
||||
/* 0C6C0C 800C600C 26103740 */ addiu $s0, %lo(__osPiDevMgr) # addiu $s0, $s0, 0x3740
|
||||
/* 0C6C10 800C6010 8E0E0000 */ lw $t6, ($s0)
|
||||
/* 0C6C14 800C6014 AFBF0024 */ sw $ra, 0x24($sp)
|
||||
/* 0C6C18 800C6018 AFA40030 */ sw $a0, 0x30($sp)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
glabel osCreatePiManager
|
||||
/* 0C6C00 800C6000 27BDFFD0 */ addiu $sp, $sp, -0x30
|
||||
/* 0C6C04 800C6004 AFB00020 */ sw $s0, 0x20($sp)
|
||||
/* 0C6C08 800C6008 3C10800E */ lui $s0, %hi(D_800E3740) # $s0, 0x800e
|
||||
/* 0C6C0C 800C600C 26103740 */ addiu $s0, %lo(D_800E3740) # addiu $s0, $s0, 0x3740
|
||||
/* 0C6C08 800C6008 3C10800E */ lui $s0, %hi(__osPiDevMgr) # $s0, 0x800e
|
||||
/* 0C6C0C 800C600C 26103740 */ addiu $s0, %lo(__osPiDevMgr) # addiu $s0, $s0, 0x3740
|
||||
/* 0C6C10 800C6010 8E0E0000 */ lw $t6, ($s0)
|
||||
/* 0C6C14 800C6014 AFBF0024 */ sw $ra, 0x24($sp)
|
||||
/* 0C6C18 800C6018 AFA40030 */ sw $a0, 0x30($sp)
|
||||
|
||||
+3
-3
@@ -8084,7 +8084,7 @@ glabel D_800E3710
|
||||
.word 0x00000000
|
||||
.word 0x00000000
|
||||
|
||||
glabel D_800E3740
|
||||
glabel __osPiDevMgr
|
||||
.word 0x00000000
|
||||
.word 0x00000000
|
||||
|
||||
@@ -9252,7 +9252,7 @@ glabel D_800E4878
|
||||
.word 0x02E6D354
|
||||
.word 0x00000000
|
||||
|
||||
glabel D_800E4880
|
||||
glabel __osThreadTail
|
||||
.word 0x00000000
|
||||
.word 0xFFFFFFFF
|
||||
|
||||
@@ -9262,7 +9262,7 @@ glabel D_800E4888
|
||||
glabel D_800E488C
|
||||
.word 0x800E4880
|
||||
|
||||
glabel D_800E4890
|
||||
glabel __osRunningThread
|
||||
.word 0x00000000
|
||||
|
||||
glabel D_800E4894
|
||||
|
||||
@@ -0,0 +1,453 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 1997/02/11 08:15:34 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __R4300_H__
|
||||
#define __R4300_H__
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/*
|
||||
* Segment base addresses and sizes
|
||||
*/
|
||||
#define KUBASE 0
|
||||
#define KUSIZE 0x80000000
|
||||
#define K0BASE 0x80000000
|
||||
#define K0SIZE 0x20000000
|
||||
#define K1BASE 0xA0000000
|
||||
#define K1SIZE 0x20000000
|
||||
#define K2BASE 0xC0000000
|
||||
#define K2SIZE 0x20000000
|
||||
|
||||
/*
|
||||
* Exception vectors
|
||||
*/
|
||||
#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */
|
||||
#define UT_VEC K0BASE /* utlbmiss vector */
|
||||
#define R_VEC (K1BASE+0x1fc00000) /* reset vector */
|
||||
#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */
|
||||
#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */
|
||||
#define E_VEC (K0BASE+0x180) /* Gen. exception vector */
|
||||
|
||||
/*
|
||||
* Address conversion macros
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
|
||||
#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#else /* _LANGUAGE_C */
|
||||
|
||||
#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* Address predicates
|
||||
*/
|
||||
#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE)
|
||||
#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE)
|
||||
#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE)
|
||||
#define IS_KUSEG(x) ((u32)(x) < K0BASE)
|
||||
|
||||
/*
|
||||
* TLB size constants
|
||||
*/
|
||||
|
||||
#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */
|
||||
|
||||
#define TLBHI_VPN2MASK 0xffffe000
|
||||
#define TLBHI_VPN2SHIFT 13
|
||||
#define TLBHI_PIDMASK 0xff
|
||||
#define TLBHI_PIDSHIFT 0
|
||||
#define TLBHI_NPID 255 /* 255 to fit in 8 bits */
|
||||
|
||||
#define TLBLO_PFNMASK 0x3fffffc0
|
||||
#define TLBLO_PFNSHIFT 6
|
||||
#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */
|
||||
#define TLBLO_CACHSHIFT 3
|
||||
#define TLBLO_UNCACHED 0x10 /* not cached */
|
||||
#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */
|
||||
#define TLBLO_EXLWR 0x28 /* Exclusive write */
|
||||
#define TLBLO_D 0x4 /* writeable */
|
||||
#define TLBLO_V 0x2 /* valid bit */
|
||||
#define TLBLO_G 0x1 /* global access bit */
|
||||
|
||||
#define TLBINX_PROBE 0x80000000
|
||||
#define TLBINX_INXMASK 0x3f
|
||||
#define TLBINX_INXSHIFT 0
|
||||
|
||||
#define TLBRAND_RANDMASK 0x3f
|
||||
#define TLBRAND_RANDSHIFT 0
|
||||
|
||||
#define TLBWIRED_WIREDMASK 0x3f
|
||||
|
||||
#define TLBCTXT_BASEMASK 0xff800000
|
||||
#define TLBCTXT_BASESHIFT 23
|
||||
#define TLBCTXT_BASEBITS 9
|
||||
|
||||
#define TLBCTXT_VPNMASK 0x7ffff0
|
||||
#define TLBCTXT_VPNSHIFT 4
|
||||
|
||||
#define TLBPGMASK_4K 0x0
|
||||
#define TLBPGMASK_16K 0x6000
|
||||
#define TLBPGMASK_64K 0x1e000
|
||||
|
||||
/*
|
||||
* Status register
|
||||
*/
|
||||
#define SR_CUMASK 0xf0000000 /* coproc usable bits */
|
||||
|
||||
#define SR_CU3 0x80000000 /* Coprocessor 3 usable */
|
||||
#define SR_CU2 0x40000000 /* Coprocessor 2 usable */
|
||||
#define SR_CU1 0x20000000 /* Coprocessor 1 usable */
|
||||
#define SR_CU0 0x10000000 /* Coprocessor 0 usable */
|
||||
#define SR_RP 0x08000000 /* Reduced power (quarter speed) */
|
||||
#define SR_FR 0x04000000 /* MIPS III FP register mode */
|
||||
#define SR_RE 0x02000000 /* Reverse endian */
|
||||
#define SR_ITS 0x01000000 /* Instruction trace support */
|
||||
#define SR_BEV 0x00400000 /* Use boot exception vectors */
|
||||
#define SR_TS 0x00200000 /* TLB shutdown */
|
||||
#define SR_SR 0x00100000 /* Soft reset occured */
|
||||
#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */
|
||||
#define SR_CE 0x00020000 /* Create ECC */
|
||||
#define SR_DE 0x00010000 /* ECC of parity does not cause error */
|
||||
|
||||
/*
|
||||
* Interrupt enable bits
|
||||
* (NOTE: bits set to 1 enable the corresponding level interrupt)
|
||||
*/
|
||||
#define SR_IMASK 0x0000ff00 /* Interrupt mask */
|
||||
#define SR_IMASK8 0x00000000 /* mask level 8 */
|
||||
#define SR_IMASK7 0x00008000 /* mask level 7 */
|
||||
#define SR_IMASK6 0x0000c000 /* mask level 6 */
|
||||
#define SR_IMASK5 0x0000e000 /* mask level 5 */
|
||||
#define SR_IMASK4 0x0000f000 /* mask level 4 */
|
||||
#define SR_IMASK3 0x0000f800 /* mask level 3 */
|
||||
#define SR_IMASK2 0x0000fc00 /* mask level 2 */
|
||||
#define SR_IMASK1 0x0000fe00 /* mask level 1 */
|
||||
#define SR_IMASK0 0x0000ff00 /* mask level 0 */
|
||||
|
||||
#define SR_IBIT8 0x00008000 /* bit level 8 */
|
||||
#define SR_IBIT7 0x00004000 /* bit level 7 */
|
||||
#define SR_IBIT6 0x00002000 /* bit level 6 */
|
||||
#define SR_IBIT5 0x00001000 /* bit level 5 */
|
||||
#define SR_IBIT4 0x00000800 /* bit level 4 */
|
||||
#define SR_IBIT3 0x00000400 /* bit level 3 */
|
||||
#define SR_IBIT2 0x00000200 /* bit level 2 */
|
||||
#define SR_IBIT1 0x00000100 /* bit level 1 */
|
||||
|
||||
#define SR_IMASKSHIFT 8
|
||||
|
||||
#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */
|
||||
#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */
|
||||
#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */
|
||||
#define SR_KSU_MASK 0x00000018 /* mode mask */
|
||||
#define SR_KSU_USR 0x00000010 /* user mode */
|
||||
#define SR_KSU_SUP 0x00000008 /* supervisor mode */
|
||||
#define SR_KSU_KER 0x00000000 /* kernel mode */
|
||||
#define SR_ERL 0x00000004 /* Error level, 1=>cache error */
|
||||
#define SR_EXL 0x00000002 /* Exception level, 1=>exception */
|
||||
#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */
|
||||
|
||||
/*
|
||||
* Cause Register
|
||||
*/
|
||||
#define CAUSE_BD 0x80000000 /* Branch delay slot */
|
||||
#define CAUSE_CEMASK 0x30000000 /* coprocessor error */
|
||||
#define CAUSE_CESHIFT 28
|
||||
|
||||
/* Interrupt pending bits */
|
||||
#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */
|
||||
#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */
|
||||
#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */
|
||||
#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */
|
||||
#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */
|
||||
#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */
|
||||
#define CAUSE_SW2 0x00000200 /* Software level 2 pending */
|
||||
#define CAUSE_SW1 0x00000100 /* Software level 1 pending */
|
||||
|
||||
#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */
|
||||
#define CAUSE_IPSHIFT 8
|
||||
|
||||
#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */
|
||||
|
||||
#define CAUSE_EXCSHIFT 2
|
||||
|
||||
/* Cause register exception codes */
|
||||
|
||||
#define EXC_CODE(x) ((x)<<2)
|
||||
|
||||
/* Hardware exception codes */
|
||||
#define EXC_INT EXC_CODE(0) /* interrupt */
|
||||
#define EXC_MOD EXC_CODE(1) /* TLB mod */
|
||||
#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */
|
||||
#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */
|
||||
#define EXC_RADE EXC_CODE(4) /* Read Address Error */
|
||||
#define EXC_WADE EXC_CODE(5) /* Write Address Error */
|
||||
#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */
|
||||
#define EXC_DBE EXC_CODE(7) /* Data Bus Error */
|
||||
#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */
|
||||
#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */
|
||||
#define EXC_II EXC_CODE(10) /* Illegal Instruction */
|
||||
#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */
|
||||
#define EXC_OV EXC_CODE(12) /* OVerflow */
|
||||
#define EXC_TRAP EXC_CODE(13) /* Trap exception */
|
||||
#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */
|
||||
#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */
|
||||
#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */
|
||||
#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */
|
||||
|
||||
/* C0_PRID Defines */
|
||||
#define C0_IMPMASK 0xff00
|
||||
#define C0_IMPSHIFT 8
|
||||
#define C0_REVMASK 0xff
|
||||
#define C0_MAJREVMASK 0xf0
|
||||
#define C0_MAJREVSHIFT 4
|
||||
#define C0_MINREVMASK 0xf
|
||||
|
||||
/*
|
||||
* Coprocessor 0 operations
|
||||
*/
|
||||
#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */
|
||||
#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */
|
||||
#define C0_RFE 0x10 /* restore for exception */
|
||||
|
||||
/*
|
||||
* 'cache' instruction definitions
|
||||
*/
|
||||
|
||||
/* Target cache */
|
||||
#define CACH_PI 0x0 /* specifies primary inst. cache */
|
||||
#define CACH_PD 0x1 /* primary data cache */
|
||||
#define CACH_SI 0x2 /* secondary instruction cache */
|
||||
#define CACH_SD 0x3 /* secondary data cache */
|
||||
|
||||
/* Cache operations */
|
||||
#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */
|
||||
#define C_IWBINV 0x0 /* index writeback inval (d, sd) */
|
||||
#define C_ILT 0x4 /* index load tag (all) */
|
||||
#define C_IST 0x8 /* index store tag (all) */
|
||||
#define C_CDX 0xc /* create dirty exclusive (d, sd) */
|
||||
#define C_HINV 0x10 /* hit invalidate (all) */
|
||||
#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */
|
||||
#define C_FILL 0x14 /* fill (i) */
|
||||
#define C_HWB 0x18 /* hit writeback (i, d, sd) */
|
||||
#define C_HSV 0x1c /* hit set virt. (si, sd) */
|
||||
|
||||
/*
|
||||
* Cache size definitions
|
||||
*/
|
||||
#define ICACHE_SIZE 0x4000 /* 16K */
|
||||
#define ICACHE_LINESIZE 32 /* 8 words */
|
||||
#define ICACHE_LINEMASK (ICACHE_LINESIZE-1)
|
||||
|
||||
#define DCACHE_SIZE 0x2000 /* 8K */
|
||||
#define DCACHE_LINESIZE 16 /* 4 words */
|
||||
#define DCACHE_LINEMASK (DCACHE_LINESIZE-1)
|
||||
|
||||
/*
|
||||
* C0_CONFIG register definitions
|
||||
*/
|
||||
#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */
|
||||
#define CONFIG_EC 0x70000000 /* System Clock ratio */
|
||||
#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */
|
||||
#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */
|
||||
#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */
|
||||
#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */
|
||||
#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */
|
||||
#define CONFIG_SB 0x00c00000 /* Secondary cache block size */
|
||||
|
||||
#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */
|
||||
#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */
|
||||
#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */
|
||||
#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */
|
||||
#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/
|
||||
#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */
|
||||
#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */
|
||||
#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */
|
||||
|
||||
#define CONFIG_IC 0x00000e00 /* Primary Icache size */
|
||||
#define CONFIG_DC 0x000001c0 /* Primary Dcache size */
|
||||
#define CONFIG_IB 0x00000020 /* Icache block size */
|
||||
#define CONFIG_DB 0x00000010 /* Dcache block size */
|
||||
#define CONFIG_CU 0x00000008 /* Update on Store-conditional */
|
||||
#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */
|
||||
|
||||
#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */
|
||||
#define CONFIG_NONCOHRNT 0x00000003
|
||||
#define CONFIG_COHRNT_EXLWR 0x00000005
|
||||
#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */
|
||||
#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */
|
||||
#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */
|
||||
#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */
|
||||
|
||||
/*
|
||||
* C0_TAGLO definitions for setting/getting cache states and physaddr bits
|
||||
*/
|
||||
#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */
|
||||
#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */
|
||||
#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */
|
||||
#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */
|
||||
#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */
|
||||
#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */
|
||||
#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */
|
||||
#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */
|
||||
|
||||
#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */
|
||||
#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */
|
||||
#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */
|
||||
#define PINVALID 0x0000 /* invalid --> 000 == state 0 */
|
||||
#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */
|
||||
#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */
|
||||
#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */
|
||||
|
||||
/*
|
||||
* C0_CACHE_ERR definitions.
|
||||
*/
|
||||
#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */
|
||||
#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */
|
||||
#define CACHERR_ED 0x20000000 /* 1: data error */
|
||||
#define CACHERR_ET 0x10000000 /* 1: tag error */
|
||||
#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/
|
||||
#define CACHERR_EE 0x04000000 /* error on SysAD bus */
|
||||
#define CACHERR_EB 0x02000000 /* complicated, see spec. */
|
||||
#define CACHERR_EI 0x01000000 /* complicated, see spec. */
|
||||
#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */
|
||||
#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */
|
||||
#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */
|
||||
|
||||
/* R4000 family supports hardware watchpoints:
|
||||
* C0_WATCHLO:
|
||||
* bits 31..3 are bits 31..3 of physaddr to watch
|
||||
* bit 2: reserved; must be written as 0.
|
||||
* bit 1: when set causes a watchpoint trap on load accesses to paddr.
|
||||
* bit 0: when set traps on stores to paddr;
|
||||
* C0_WATCHHI
|
||||
* bits 31..4 are reserved and must be written as zeros.
|
||||
* bits 3..0 are bits 35..32 of the physaddr to watch
|
||||
*/
|
||||
#define WATCHLO_WTRAP 0x00000001
|
||||
#define WATCHLO_RTRAP 0x00000002
|
||||
#define WATCHLO_ADDRMASK 0xfffffff8
|
||||
#define WATCHLO_VALIDMASK 0xfffffffb
|
||||
#define WATCHHI_VALIDMASK 0x0000000f
|
||||
|
||||
/*
|
||||
* Coprocessor 0 registers
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
#define C0_INX $0
|
||||
#define C0_RAND $1
|
||||
#define C0_ENTRYLO0 $2
|
||||
#define C0_ENTRYLO1 $3
|
||||
#define C0_CONTEXT $4
|
||||
#define C0_PAGEMASK $5 /* page mask */
|
||||
#define C0_WIRED $6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR $8
|
||||
#define C0_COUNT $9 /* free-running counter */
|
||||
#define C0_ENTRYHI $10
|
||||
#define C0_SR $12
|
||||
#define C0_CAUSE $13
|
||||
#define C0_EPC $14
|
||||
#define C0_PRID $15 /* revision identifier */
|
||||
#define C0_COMPARE $11 /* counter comparison reg. */
|
||||
#define C0_CONFIG $16 /* hardware configuration */
|
||||
#define C0_LLADDR $17 /* load linked address */
|
||||
#define C0_WATCHLO $18 /* watchpoint */
|
||||
#define C0_WATCHHI $19 /* watchpoint */
|
||||
#define C0_ECC $26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR $27 /* cache error status */
|
||||
#define C0_TAGLO $28 /* cache operations */
|
||||
#define C0_TAGHI $29 /* cache operations */
|
||||
#define C0_ERROR_EPC $30 /* ECC error prg. counter */
|
||||
|
||||
# else /* ! _LANGUAGE_ASSEMBLY */
|
||||
|
||||
#define C0_INX 0
|
||||
#define C0_RAND 1
|
||||
#define C0_ENTRYLO0 2
|
||||
#define C0_ENTRYLO1 3
|
||||
#define C0_CONTEXT 4
|
||||
#define C0_PAGEMASK 5 /* page mask */
|
||||
#define C0_WIRED 6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR 8
|
||||
#define C0_COUNT 9 /* free-running counter */
|
||||
#define C0_ENTRYHI 10
|
||||
#define C0_SR 12
|
||||
#define C0_CAUSE 13
|
||||
#define C0_EPC 14
|
||||
#define C0_PRID 15 /* revision identifier */
|
||||
#define C0_COMPARE 11 /* counter comparison reg. */
|
||||
#define C0_CONFIG 16 /* hardware configuration */
|
||||
#define C0_LLADDR 17 /* load linked address */
|
||||
#define C0_WATCHLO 18 /* watchpoint */
|
||||
#define C0_WATCHHI 19 /* watchpoint */
|
||||
#define C0_ECC 26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR 27 /* cache error status */
|
||||
#define C0_TAGLO 28 /* cache operations */
|
||||
#define C0_TAGHI 29 /* cache operations */
|
||||
#define C0_ERROR_EPC 30 /* ECC error prg. counter */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* floating-point status register
|
||||
*/
|
||||
#define FPCSR_FS 0x01000000 /* flush denorm to zero */
|
||||
#define FPCSR_C 0x00800000 /* condition bit */
|
||||
#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */
|
||||
#define FPCSR_CV 0x00010000 /* cause: invalid operation */
|
||||
#define FPCSR_CZ 0x00008000 /* cause: division by zero */
|
||||
#define FPCSR_CO 0x00004000 /* cause: overflow */
|
||||
#define FPCSR_CU 0x00002000 /* cause: underflow */
|
||||
#define FPCSR_CI 0x00001000 /* cause: inexact operation */
|
||||
#define FPCSR_EV 0x00000800 /* enable: invalid operation */
|
||||
#define FPCSR_EZ 0x00000400 /* enable: division by zero */
|
||||
#define FPCSR_EO 0x00000200 /* enable: overflow */
|
||||
#define FPCSR_EU 0x00000100 /* enable: underflow */
|
||||
#define FPCSR_EI 0x00000080 /* enable: inexact operation */
|
||||
#define FPCSR_FV 0x00000040 /* flag: invalid operation */
|
||||
#define FPCSR_FZ 0x00000020 /* flag: division by zero */
|
||||
#define FPCSR_FO 0x00000010 /* flag: overflow */
|
||||
#define FPCSR_FU 0x00000008 /* flag: underflow */
|
||||
#define FPCSR_FI 0x00000004 /* flag: inexact operation */
|
||||
#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */
|
||||
#define FPCSR_RM_RN 0x00000000 /* round to nearest */
|
||||
#define FPCSR_RM_RZ 0x00000001 /* round to zero */
|
||||
#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */
|
||||
#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */
|
||||
|
||||
#endif /* __R4300_H */
|
||||
File diff suppressed because it is too large
Load Diff
+4718
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,392 @@
|
||||
/*---------------------------------------------------------------------
|
||||
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.21 1998/05/28 00:14:49 has 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-coordinate of upper-left position of texture (u10.5) */
|
||||
u16 imageW; /* width of the texture (u10.2) */
|
||||
s16 frameX; /* upper-left position of transferred frame (s10.2) */
|
||||
u16 frameW; /* width of transferred frame (u10.2) */
|
||||
|
||||
u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */
|
||||
u16 imageH; /* height of the texture (u10.2) */
|
||||
s16 frameY; /* upper-left position of transferred frame (s10.2) */
|
||||
u16 frameH; /* height of transferred frame (u10.2) */
|
||||
|
||||
u64 *imagePtr; /* texture source address on DRAM */
|
||||
u16 imageLoad; /* which to use, LoadBlock or LoadTile */
|
||||
u8 imageFmt; /* format of texel - G_IM_FMT_* */
|
||||
u8 imageSiz; /* size of texel - G_IM_SIZ_* */
|
||||
u16 imagePal; /* pallet number */
|
||||
u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */
|
||||
|
||||
/* The following is set in the initialization routine guS2DInitBg(). There is no need for the user to set it. */
|
||||
u16 tmemW; /* TMEM width and Word size of frame 1 line.
|
||||
At LoadBlock, GS_PIX2TMEM(imageW/4,imageSiz)
|
||||
At LoadTile GS_PIX2TMEM(frameW/4,imageSiz)+1 */
|
||||
u16 tmemH; /* height of TMEM loadable at a time (s13.2) 4 times value
|
||||
When the normal texture, 512/tmemW*4
|
||||
When the CI texture, 256/tmemW*4 */
|
||||
u16 tmemLoadSH; /* SH value
|
||||
At LoadBlock, tmemSize/2-1
|
||||
At LoadTile, tmemW*16-1 */
|
||||
u16 tmemLoadTH; /* TH value or Stride value
|
||||
At LoadBlock, GS_CALC_DXT(tmemW)
|
||||
At LoadTile, tmemH-1 */
|
||||
u16 tmemSizeW; /* skip value of imagePtr for image 1-line
|
||||
At LoadBlock, tmemW*2
|
||||
At LoadTile, GS_PIX2TMEM(imageW/4,imageSiz)*2 */
|
||||
u16 tmemSize; /* skip value of imagePtr for 1-loading
|
||||
= tmemSizeW*tmemH */
|
||||
} uObjBg_t; /* 40 bytes */
|
||||
|
||||
/* Scalable background plane */
|
||||
typedef struct {
|
||||
u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */
|
||||
u16 imageW; /* width of texture (u10.2) */
|
||||
s16 frameX; /* upper-left position of transferred frame (s10.2) */
|
||||
u16 frameW; /* width of transferred frame (u10.2) */
|
||||
|
||||
u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */
|
||||
u16 imageH; /* height of texture (u10.2) */
|
||||
s16 frameY; /* upper-left position of transferred frame (s10.2) */
|
||||
u16 frameH; /* height of transferred frame (u10.2) */
|
||||
|
||||
u64 *imagePtr; /* texture source address on DRAM */
|
||||
u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */
|
||||
u8 imageFmt; /* format of texel - G_IM_FMT_* */
|
||||
u8 imageSiz; /* size of texel - G_IM_SIZ_* */
|
||||
u16 imagePal; /* pallet number */
|
||||
u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */
|
||||
|
||||
u16 scaleW; /* scale value of X-direction (u5.10) */
|
||||
u16 scaleH; /* scale value of Y-direction (u5.10) */
|
||||
s32 imageYorig; /* start point of drawing on 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 /* inversion to S-direction */
|
||||
#define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */
|
||||
|
||||
typedef struct {
|
||||
s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */
|
||||
u16 scaleW; /* u5.10 Scaling of u5.10 width direction */
|
||||
u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */
|
||||
u16 paddingX; /* Unused - Always 0 */
|
||||
s16 objY; /* s10.2 OBJ y-coordinate of s10.2 OBJ upper-left end */
|
||||
u16 scaleH; /* u5.10 Scaling of u5.10 height direction */
|
||||
u16 imageH; /* u10.5 height of u10.5 texture (length of T-direction) */
|
||||
u16 paddingY; /* Unused - Always 0 */
|
||||
u16 imageStride; /* folding width of texel (In units of 64bit word) */
|
||||
u16 imageAdrs; /* texture header position in TMEM (In units of 64bit word) */
|
||||
u8 imageFmt; /* format of texel - G_IM_FMT_* */
|
||||
u8 imageSiz; /* size of texel - G_IM_SIZ_* */
|
||||
u8 imagePal; /* pallet number (0-7) */
|
||||
u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */
|
||||
} uObjSprite_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjSprite_t s;
|
||||
long long int force_structure_alignment;
|
||||
} uObjSprite;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* 2D Matrix
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
s32 A, B, C, D; /* s15.16 */
|
||||
s16 X, Y; /* s10.2 */
|
||||
u16 BaseScaleX; /* u5.10 */
|
||||
u16 BaseScaleY; /* u5.10 */
|
||||
} uObjMtx_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjMtx_t m;
|
||||
long long int force_structure_alignment;
|
||||
} uObjMtx;
|
||||
|
||||
typedef struct {
|
||||
s16 X, Y; /* s10.2 */
|
||||
u16 BaseScaleX; /* u5.10 */
|
||||
u16 BaseScaleY; /* u5.10 */
|
||||
} uObjSubMtx_t; /* 8 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjSubMtx_t m;
|
||||
long long int force_structure_alignment;
|
||||
} uObjSubMtx;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Loading into TMEM
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_OBJLT_TXTRBLOCK 0x00001033
|
||||
#define G_OBJLT_TXTRTILE 0x00fc1034
|
||||
#define G_OBJLT_TLUT 0x00000030
|
||||
|
||||
#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1)
|
||||
#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz))))
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* G_OBJLT_TXTRBLOCK divided into types */
|
||||
u64 *image; /* texture source address on DRAM */
|
||||
u16 tmem; /* loaded TMEM word address (8byteWORD) */
|
||||
u16 tsize; /* Texture size, Specified by macro GS_TB_TSIZE() */
|
||||
u16 tline; /* width of Texture 1-line, Specified by macro GS_TB_TLINE() */
|
||||
u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrBlock_t; /* 24 bytes */
|
||||
|
||||
#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1)
|
||||
#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1)
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* G_OBJLT_TXTRTILE divided into types */
|
||||
u64 *image; /* texture source address on DRAM */
|
||||
u16 tmem; /* loaded TMEM word address (8byteWORD)*/
|
||||
u16 twidth; /* width of Texture (Specified by macro GS_TT_TWIDTH()) */
|
||||
u16 theight; /* height of Texture (Specified by macro GS_TT_THEIGHT()) */
|
||||
u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrTile_t; /* 24 bytes */
|
||||
|
||||
#define GS_PAL_HEAD(head) ((head)+256)
|
||||
#define GS_PAL_NUM(num) ((num)-1)
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* G_OBJLT_TLUT divided into types */
|
||||
u64 *image; /* texture source address on DRAM */
|
||||
u16 phead; /* pallet number of load header (Between 256 and 511) */
|
||||
u16 pnum; /* loading pallet number -1 */
|
||||
u16 zero; /* Assign 0 all the time */
|
||||
u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12)*/
|
||||
u32 flag; /* STATE flag */
|
||||
u32 mask; /* STATE mask */
|
||||
} uObjTxtrTLUT_t; /* 24 bytes */
|
||||
|
||||
typedef union {
|
||||
uObjTxtrBlock_t block;
|
||||
uObjTxtrTile_t tile;
|
||||
uObjTxtrTLUT_t tlut;
|
||||
long long int force_structure_alignment;
|
||||
} uObjTxtr;
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Loading into TMEM & 2D Objects
|
||||
*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
uObjTxtr txtr;
|
||||
uObjSprite sprite;
|
||||
} uObjTxSprite; /* 48 bytes */
|
||||
|
||||
/*===========================================================================*
|
||||
* GBI Commands for S2DEX microcode
|
||||
*===========================================================================*/
|
||||
/* GBI Header */
|
||||
#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 /* Note that it is the same value of G_MW_FOG */
|
||||
|
||||
#define gSPSetStatus(pkt, sid, val) \
|
||||
gMoveWd((pkt), G_MW_GENSTAT, (sid), (val))
|
||||
#define gsSPSetStatus(sid, val) \
|
||||
gsMoveWd( G_MW_GENSTAT, (sid), (val))
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* Set Object Render Mode
|
||||
*---------------------------------------------------------------------------*/
|
||||
#define G_OBJRM_NOTXCLAMP 0x01
|
||||
#define G_OBJRM_XLU 0x02 /* Ignored */
|
||||
#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */
|
||||
#define G_OBJRM_BILERP 0x08
|
||||
#define G_OBJRM_SHRINKSIZE_1 0x10
|
||||
#define G_OBJRM_SHRINKSIZE_2 0x20
|
||||
#define G_OBJRM_WIDEN 0x40
|
||||
|
||||
#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode))
|
||||
#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode))
|
||||
|
||||
/*===========================================================================*
|
||||
* Render Mode Macro
|
||||
*===========================================================================*/
|
||||
#define RM_RA_SPRITE(clk) \
|
||||
AA_EN | CVG_DST_CLAMP | \
|
||||
CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \
|
||||
GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)
|
||||
|
||||
#define G_RM_SPRITE G_RM_OPA_SURF
|
||||
#define G_RM_SPRITE2 G_RM_OPA_SURF2
|
||||
#define G_RM_RA_SPRITE RM_RA_SPRITE(1)
|
||||
#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2)
|
||||
#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR
|
||||
#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2
|
||||
#define G_RM_XLU_SPRITE G_RM_XLU_SURF
|
||||
#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2
|
||||
#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF
|
||||
#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2
|
||||
|
||||
/*===========================================================================*
|
||||
* External functions
|
||||
*===========================================================================*/
|
||||
extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[];
|
||||
extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[];
|
||||
extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[];
|
||||
extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[];
|
||||
extern 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 ========*/
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef _ULTRA64_GU_H_
|
||||
#define _ULTRA64_GU_H_
|
||||
|
||||
#include <PR/mbi.h>
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#define GU_PI 3.1415926
|
||||
/* Functions */
|
||||
|
||||
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect,
|
||||
float near, float far, float scale);
|
||||
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near,
|
||||
float far, float scale);
|
||||
void guOrtho(Mtx *m, float left, float right, float bottom, float top,
|
||||
float near, float far, float scale);
|
||||
void guTranslate(Mtx *m, float x, float y, float z);
|
||||
void guRotate(Mtx *m, float a, float x, float y, float z);
|
||||
void guScale(Mtx *m, float x, float y, float z);
|
||||
void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
void guMtxIdent(Mtx *m);
|
||||
void guMtxIdentF(float mf[4][4]);
|
||||
void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
void guNormalize(float *, float *, float *);
|
||||
|
||||
/* Used only in Fast3DEX2 */
|
||||
void guLookAtReflect (Mtx *m, LookAt *l, float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
#endif
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _ULTRA64_LIBAUDIO_H_
|
||||
#define _ULTRA64_LIBAUDIO_H_
|
||||
|
||||
#include "abi.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 *offset;
|
||||
s32 len;
|
||||
} ALSeqData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
s16 revision;
|
||||
s16 seqCount;
|
||||
ALSeqData seqArray[1];
|
||||
} ALSeqFile;
|
||||
|
||||
void alSeqFileNew(ALSeqFile *f, u8 *base);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _LIBULTRA_H
|
||||
#define _LIBULTRA_H
|
||||
|
||||
#define TV_TYPE_NTSC 1
|
||||
#define TV_TYPE_PAL 0
|
||||
#define TV_TYPE_MPAL 2
|
||||
|
||||
#define RESET_TYPE_COLD_RESET 0
|
||||
#define RESET_TYPE_NMI 1
|
||||
#define RESET_TYPE_BOOT_DISK 2
|
||||
|
||||
extern u32 osTvType;
|
||||
extern u32 osRomBase;
|
||||
extern u32 osResetType;
|
||||
extern u32 osMemSize;
|
||||
extern u8 osAppNmiBuffer[64];
|
||||
|
||||
#endif /* _LIBULTRA_H */
|
||||
@@ -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.136 $
|
||||
* $Date: 1999/01/05 13:04:00 $
|
||||
* $Source: /hosts/gate3/exdisk2/cvs/N64OS/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
|
||||
#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_ */
|
||||
@@ -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 $
|
||||
$Date: 1998/10/09 08:01:04 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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,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 $
|
||||
$Date: 1998/10/09 08:01:04 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 *, size_t);
|
||||
extern void osInvalICache(void *, size_t);
|
||||
extern void osWritebackDCache(void *, size_t);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CACHE_H_ */
|
||||
@@ -0,0 +1,207 @@
|
||||
|
||||
/*====================================================================
|
||||
* 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.1 $
|
||||
$Date: 1998/10/09 08:01:05 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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 */
|
||||
u8 errno;
|
||||
}OSContStatus;
|
||||
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x; /* -80 <= stick_x <= 80 */
|
||||
s8 stick_y; /* -80 <= stick_y <= 80 */
|
||||
u8 errno;
|
||||
} 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 */
|
||||
u8 errno;
|
||||
} 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_ */
|
||||
@@ -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 $
|
||||
$Date: 1998/10/09 08:01:06 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
@@ -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 $
|
||||
$Date: 1998/10/09 08:01:07 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#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_ */
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _ULTRA64_OS_INTERNAL_H_
|
||||
#define _ULTRA64_OS_INTERNAL_H_
|
||||
|
||||
/* Internal functions used by the operating system */
|
||||
/* Do not include this header in application code */
|
||||
|
||||
/* Variables */
|
||||
|
||||
//extern u64 osClockRate;
|
||||
|
||||
/* Functions */
|
||||
|
||||
/*u32 __osProbeTLB(void *);
|
||||
u32 __osDisableInt(void);
|
||||
void __osRestoreInt(u32);*/
|
||||
OSThread *__osGetCurrFaultedThread(void);
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user