mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
Dreamcast: Fix not compiling
This commit is contained in:
parent
1c61512e64
commit
1bfc86b9c3
@ -523,7 +523,7 @@ _ProcessVertexList:
|
|||||||
bra SUBMIT_LOOP
|
bra SUBMIT_LOOP
|
||||||
add #-64,r15
|
add #-64,r15
|
||||||
|
|
||||||
! Submits a PowerVR GPU command
|
! Submits a PVR2 TA GPU command
|
||||||
DO_CMD:
|
DO_CMD:
|
||||||
PushVertex REG_V0
|
PushVertex REG_V0
|
||||||
bra NEXT_ITER
|
bra NEXT_ITER
|
||||||
@ -543,7 +543,6 @@ SUBMIT_LOOP:
|
|||||||
bf.s DO_CMD ! if (!T) goto DO_CMD
|
bf.s DO_CMD ! if (!T) goto DO_CMD
|
||||||
! PVR_CMD_VERTEX_EOL case
|
! PVR_CMD_VERTEX_EOL case
|
||||||
extu.b r0,r1 ! EX, MASK = FLAGS & 0xFF (branch delay slot)
|
extu.b r0,r1 ! EX, MASK = FLAGS & 0xFF (branch delay slot)
|
||||||
mov.l r11,@r13 ! LS, CUR->flags = PVR_CMD_VERTEX_EOL
|
|
||||||
|
|
||||||
! Prepare and then jump to quad drawing function, based on quad clipflags
|
! Prepare and then jump to quad drawing function, based on quad clipflags
|
||||||
mova .CASES,r0 ! LS, r0 = CASES
|
mova .CASES,r0 ! LS, r0 = CASES
|
||||||
|
@ -61,6 +61,7 @@ static void InitGPU(void) {
|
|||||||
static void InitGLState(void) {
|
static void InitGLState(void) {
|
||||||
pvr_set_zclip(0.0f);
|
pvr_set_zclip(0.0f);
|
||||||
PVR_SET(PT_ALPHA_REF, 127); // define missing from KOS
|
PVR_SET(PT_ALPHA_REF, 127); // define missing from KOS
|
||||||
|
//PVR_SET(PVR_SPANSORT_CFG, 0x0);
|
||||||
|
|
||||||
ALPHA_TEST_ENABLED = false;
|
ALPHA_TEST_ENABLED = false;
|
||||||
CULLING_ENABLED = false;
|
CULLING_ENABLED = false;
|
||||||
@ -70,7 +71,7 @@ static void InitGLState(void) {
|
|||||||
TEXTURES_ENABLED = false;
|
TEXTURES_ENABLED = false;
|
||||||
FOG_ENABLED = false;
|
FOG_ENABLED = false;
|
||||||
|
|
||||||
stateDirty = true;
|
stateDirty = true;
|
||||||
listOP.list_type = PVR_LIST_OP_POLY;
|
listOP.list_type = PVR_LIST_OP_POLY;
|
||||||
listPT.list_type = PVR_LIST_PT_POLY;
|
listPT.list_type = PVR_LIST_PT_POLY;
|
||||||
listTR.list_type = PVR_LIST_TR_POLY;
|
listTR.list_type = PVR_LIST_TR_POLY;
|
||||||
@ -683,7 +684,7 @@ static void SubmitList(AlignedVector* cmds) {
|
|||||||
pvr_list_begin(cmds->list_type);
|
pvr_list_begin(cmds->list_type);
|
||||||
{
|
{
|
||||||
pvr_dr_init(&dr_state);
|
pvr_dr_init(&dr_state);
|
||||||
SceneListSubmit(cmds->data, cmds->size);
|
SceneListSubmit((Vertex*)cmds->data, cmds->size);
|
||||||
sq_wait();
|
sq_wait();
|
||||||
}
|
}
|
||||||
pvr_list_finish();
|
pvr_list_finish();
|
||||||
|
3
third_party/gldc/src/gldc.h
vendored
3
third_party/gldc/src/gldc.h
vendored
@ -66,9 +66,6 @@ typedef struct {
|
|||||||
float w;
|
float w;
|
||||||
} __attribute__ ((aligned (32))) Vertex;
|
} __attribute__ ((aligned (32))) Vertex;
|
||||||
|
|
||||||
|
|
||||||
#define GL_FORCE_INLINE static __attribute__((always_inline)) inline
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t color; /* This is the PVR texture format */
|
uint32_t color; /* This is the PVR texture format */
|
||||||
void *data;
|
void *data;
|
||||||
|
15
third_party/gldc/src/sh4.c
vendored
15
third_party/gldc/src/sh4.c
vendored
@ -5,9 +5,10 @@
|
|||||||
|
|
||||||
#define PREFETCH(addr) __builtin_prefetch((addr))
|
#define PREFETCH(addr) __builtin_prefetch((addr))
|
||||||
static volatile uint32_t* sq;
|
static volatile uint32_t* sq;
|
||||||
|
#define GL_FORCE_INLINE __attribute__((always_inline)) inline
|
||||||
|
|
||||||
// calculates 1/sqrt(x)
|
// calculates 1/sqrt(x)
|
||||||
GL_FORCE_INLINE float sh4_fsrra(float x) {
|
static GL_FORCE_INLINE float sh4_fsrra(float x) {
|
||||||
asm volatile ("fsrra %[value]\n"
|
asm volatile ("fsrra %[value]\n"
|
||||||
: [value] "+f" (x) // outputs (r/w to FPU register)
|
: [value] "+f" (x) // outputs (r/w to FPU register)
|
||||||
: // no inputs
|
: // no inputs
|
||||||
@ -16,11 +17,11 @@ GL_FORCE_INLINE float sh4_fsrra(float x) {
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_FORCE_INLINE float _glFastInvert(float x) {
|
static GL_FORCE_INLINE float _glFastInvert(float x) {
|
||||||
return sh4_fsrra(x * x);
|
return sh4_fsrra(x * x);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_FORCE_INLINE void _glPerspectiveDivideVertex(Vertex* vertex) {
|
static GL_FORCE_INLINE void _glPerspectiveDivideVertex(Vertex* vertex) {
|
||||||
const float f = _glFastInvert(vertex->w);
|
const float f = _glFastInvert(vertex->w);
|
||||||
|
|
||||||
/* Convert to NDC (viewport already applied) */
|
/* Convert to NDC (viewport already applied) */
|
||||||
@ -45,7 +46,6 @@ static inline void _glPushHeaderOrVertex(Vertex* v) {
|
|||||||
|
|
||||||
extern void ClipEdge(const Vertex* const v1, const Vertex* const v2, Vertex* vout);
|
extern void ClipEdge(const Vertex* const v1, const Vertex* const v2, Vertex* vout);
|
||||||
|
|
||||||
#define SPAN_SORT_CFG 0x005F8030
|
|
||||||
#define V0_VIS (1 << 0)
|
#define V0_VIS (1 << 0)
|
||||||
#define V1_VIS (1 << 1)
|
#define V1_VIS (1 << 1)
|
||||||
#define V2_VIS (1 << 2)
|
#define V2_VIS (1 << 2)
|
||||||
@ -371,11 +371,9 @@ static void SubmitClipped(Vertex* v0, Vertex* v1, Vertex* v2, Vertex* v3, uint8_
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void ProcessVertexList(Vertex* v3, int n, void* sq_addr);
|
extern void ProcessVertexList(Vertex* v3, int n, void* sq_addr);
|
||||||
void SceneListSubmit(Vertex* v3, int n) {
|
|
||||||
PVR_SET(SPAN_SORT_CFG, 0x0);
|
|
||||||
|
|
||||||
|
void SceneListSubmit(Vertex* v3, int n) {
|
||||||
sq = (uint32_t*)MEM_AREA_SQ_BASE;
|
sq = (uint32_t*)MEM_AREA_SQ_BASE;
|
||||||
uint8_t visible_mask = 0;
|
|
||||||
|
|
||||||
for(int i = 0; i < n; ++i, ++v3)
|
for(int i = 0; i < n; ++i, ++v3)
|
||||||
{
|
{
|
||||||
@ -395,8 +393,7 @@ void SceneListSubmit(Vertex* v3, int n) {
|
|||||||
Vertex* const v1 = v3 - 2;
|
Vertex* const v1 = v3 - 2;
|
||||||
Vertex* const v2 = v3 - 1;
|
Vertex* const v2 = v3 - 1;
|
||||||
|
|
||||||
visible_mask = v3->flags & 0xFF;
|
uint8_t visible_mask = v3->flags & 0xFF;
|
||||||
v3->flags &= ~0xFF;
|
|
||||||
|
|
||||||
// Stats gathering found that when testing a 64x64x64 sized world, at most
|
// Stats gathering found that when testing a 64x64x64 sized world, at most
|
||||||
// ~400-500 triangles needed clipping
|
// ~400-500 triangles needed clipping
|
||||||
|
8
third_party/gldc/src/state.c
vendored
8
third_party/gldc/src/state.c
vendored
@ -88,10 +88,10 @@ void apply_poly_header(pvr_poly_hdr_t* dst, int list_type) {
|
|||||||
dst->mode1 |= (depth_write << PVR_TA_PM1_DEPTHWRITE_SHIFT) & PVR_TA_PM1_DEPTHWRITE_MASK;
|
dst->mode1 |= (depth_write << PVR_TA_PM1_DEPTHWRITE_SHIFT) & PVR_TA_PM1_DEPTHWRITE_MASK;
|
||||||
dst->mode1 |= (txr_enable << PVR_TA_PM1_TXRENABLE_SHIFT) & PVR_TA_PM1_TXRENABLE_MASK;
|
dst->mode1 |= (txr_enable << PVR_TA_PM1_TXRENABLE_SHIFT) & PVR_TA_PM1_TXRENABLE_MASK;
|
||||||
|
|
||||||
dst->mode2 = (blend_src << PVR_TA_PM2_SRCBLEND_SHIFT) & PVR_TA_PM2_SRCBLEND_MASK;
|
dst->mode2 = (blend_src << PVR_TA_PM2_SRCBLEND_SHIFT) & PVR_TA_PM2_SRCBLEND_MASK;
|
||||||
dst->mode2 |= (blend_dst << PVR_TA_PM2_DSTBLEND_SHIFT) & PVR_TA_PM2_DSTBLEND_MASK;
|
dst->mode2 |= (blend_dst << PVR_TA_PM2_DSTBLEND_SHIFT) & PVR_TA_PM2_DSTBLEND_MASK;
|
||||||
dst->mode2 |= (gen_fog_type << PVR_TA_PM2_FOG_SHIFT) & PVR_TA_PM2_FOG_MASK;
|
dst->mode2 |= (gen_fog_type << PVR_TA_PM2_FOG_SHIFT) & PVR_TA_PM2_FOG_MASK;
|
||||||
dst->mode2 |= (gen_alpha << PVR_TA_PM2_ALPHA_SHIFT) & PVR_TA_PM2_ALPHA_MASK;
|
dst->mode2 |= (gen_alpha << PVR_TA_PM2_ALPHA_SHIFT) & PVR_TA_PM2_ALPHA_MASK;
|
||||||
|
|
||||||
if (txr_enable == PVR_TEXTURE_DISABLE) {
|
if (txr_enable == PVR_TEXTURE_DISABLE) {
|
||||||
dst->mode3 = 0;
|
dst->mode3 = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user