defines of 3D commands
This commit is contained in:
parent
18b2b6ebc4
commit
4ee18c0a3c
|
@ -306,7 +306,7 @@ void MMU_clearMem()
|
||||||
/* the VRAM blocks keep their content even when not blended in */
|
/* the VRAM blocks keep their content even when not blended in */
|
||||||
/* to ensure that we write the content back to the LCD ram */
|
/* to ensure that we write the content back to the LCD ram */
|
||||||
/* FIXME: VRAM Bank E,F,G,H,I missing */
|
/* FIXME: VRAM Bank E,F,G,H,I missing */
|
||||||
void MMU_VRAMWriteBackToLCD(u8 block)
|
void MMU_VRAMWriteBackToLCD(u32 block)
|
||||||
{
|
{
|
||||||
u8 *destination;
|
u8 *destination;
|
||||||
u8 *source;
|
u8 *source;
|
||||||
|
@ -315,6 +315,7 @@ void MMU_VRAMWriteBackToLCD(u8 block)
|
||||||
#if 1
|
#if 1
|
||||||
return ;
|
return ;
|
||||||
#endif
|
#endif
|
||||||
|
block = (u8)block;
|
||||||
destination = 0 ;
|
destination = 0 ;
|
||||||
source = 0;
|
source = 0;
|
||||||
VRAMBankCnt = MMU_read8(ARMCPU_ARM9,REG_VRAMCNTA+block) ;
|
VRAMBankCnt = MMU_read8(ARMCPU_ARM9,REG_VRAMCNTA+block) ;
|
||||||
|
@ -3626,103 +3627,108 @@ INLINE void MMU_write32_REG_3D(u32 adr, u32 val) {
|
||||||
case 0x04000400 :
|
case 0x04000400 :
|
||||||
OGLRender::glCallList(val);
|
OGLRender::glCallList(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000440 :
|
case cmd_3D_MTX_MODE :
|
||||||
OGLRender::glMatrixMode(val);
|
OGLRender::glMatrixMode(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000444 :
|
case cmd_3D_MTX_PUSH :
|
||||||
OGLRender::glPushMatrix();
|
OGLRender::glPushMatrix();
|
||||||
return;
|
return;
|
||||||
case 0x04000448 :
|
case cmd_3D_MTX_POP :
|
||||||
OGLRender::glPopMatrix(val);
|
OGLRender::glPopMatrix(val);
|
||||||
return;
|
return;
|
||||||
case 0x0400044C :
|
case cmd_3D_MTX_STORE :
|
||||||
OGLRender::glStoreMatrix(val);
|
OGLRender::glStoreMatrix(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000450 :
|
case cmd_3D_MTX_RESTORE :
|
||||||
OGLRender::glRestore();
|
OGLRender::glRestore();
|
||||||
return;
|
return;
|
||||||
case 0x04000454 :
|
case cmd_3D_MTX_IDENTITY :
|
||||||
OGLRender::glLoadIdentity();
|
OGLRender::glLoadIdentity();
|
||||||
return;
|
return;
|
||||||
case 0x04000458 :
|
case cmd_3D_MTX_LOAD_4x4 :
|
||||||
OGLRender::ML4x4ajouter(val);
|
OGLRender::ML4x4ajouter(val);
|
||||||
return;
|
return;
|
||||||
case 0x0400045C :
|
case cmd_3D_MTX_LOAD_4x3 :
|
||||||
OGLRender::ML4x3ajouter(val);
|
OGLRender::ML4x3ajouter(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000460 :
|
case cmd_3D_MTX_MULT_4x4 :
|
||||||
OGLRender::glMultMatrix4x4(val);
|
OGLRender::glMultMatrix4x4(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000464 :
|
case cmd_3D_MTX_MULT_4x3 :
|
||||||
OGLRender::glMultMatrix4x3(val);
|
OGLRender::glMultMatrix4x3(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000468 :
|
case cmd_3D_MTX_MULT_3x3 :
|
||||||
OGLRender::glMultMatrix3x3(val);
|
OGLRender::glMultMatrix3x3(val);
|
||||||
return;
|
return;
|
||||||
case 0x0400046C :
|
case cmd_3D_MTX_SCALE :
|
||||||
OGLRender::glScale(val);
|
OGLRender::glScale(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000470 :
|
case cmd_3D_MTX_TRANS :
|
||||||
OGLRender::addTrans(val);
|
OGLRender::addTrans(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000480 :
|
case cmd_3D_COLOR :
|
||||||
OGLRender::glColor3b(val);
|
OGLRender::glColor3b(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000488 :
|
case cmd_3D_NORMA :
|
||||||
OGLRender::glTexCoord(val);
|
OGLRender::glTexCoord(val);
|
||||||
//execute = FALSE;
|
//execute = FALSE;
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
case 0x0400048C :
|
case cmd_3D_VTX_16 :
|
||||||
//OGLRender::glVertex3(val);
|
//OGLRender::glVertex3(val);
|
||||||
|
gl_VTX_16(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000490 :
|
case cmd_3D_VTX_10 :
|
||||||
//GPULOG("VERTEX 10 %d\r\n",val);
|
//GPULOG("VERTEX 10 %d\r\n",val);
|
||||||
gl_VTX_10(val);
|
gl_VTX_10(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000494 :
|
case cmd_3D_VTX_XY :
|
||||||
//GPULOG(printf(txt, "VERTEXY %d\r\n",val);
|
//GPULOG(printf(txt, "VERTEXY %d\r\n",val);
|
||||||
gl_VTX_XY(val);
|
gl_VTX_XY(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000498 :
|
case cmd_3D_VTX_XZ :
|
||||||
//GPULOG("VERTEXZ %d\r\n",val);
|
//GPULOG("VERTEXZ %d\r\n",val);
|
||||||
gl_VTX_XZ(val);
|
gl_VTX_XZ(val);
|
||||||
return;
|
return;
|
||||||
case 0x0400049C :
|
case cmd_3D_VTX_YZ :
|
||||||
//GPULOG("VERTEYZ %d\r\n",val);
|
//GPULOG("VERTEYZ %d\r\n",val);
|
||||||
gl_VTX_YZ(val);
|
gl_VTX_YZ(val);
|
||||||
return;
|
return;
|
||||||
case 0x040004A0 :
|
case cmd_3D_VTX_DIFF :
|
||||||
gl_VTX_DIFF(val);
|
gl_VTX_DIFF(val);
|
||||||
return;
|
return;
|
||||||
#ifdef RENDER3D
|
#ifdef RENDER3D
|
||||||
case 0x040004A8 :
|
case cmd_3D_TEXIMAGE_PARAM :
|
||||||
OGLRender::glTexImage2D(val, FALSE);
|
OGLRender::glTexImage2D(val, FALSE);
|
||||||
//execute = FALSE;
|
//execute = FALSE;
|
||||||
testval = val;
|
testval = val;
|
||||||
return;
|
return;
|
||||||
case 0x040004AC :
|
case cmd_3D_PLTT_BASE :
|
||||||
OGLRender::glTexImage2D(testval, TRUE);
|
OGLRender::glTexImage2D(testval, TRUE);
|
||||||
//execute = FALSE;
|
//execute = FALSE;
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
case 0x04000500 :
|
case cmd_3D_BEGIN_VTXS :
|
||||||
// OGLRender::glBegin(val);
|
// OGLRender::glBegin(val);
|
||||||
gl_VTX_begin(val);
|
gl_VTX_begin(val);
|
||||||
return;
|
return;
|
||||||
case 0x04000504 :
|
case cmd_3D_END_VTXS :
|
||||||
// OGLRender::glEnd();
|
// OGLRender::glEnd();
|
||||||
gl_VTX_end();
|
gl_VTX_end();
|
||||||
return;
|
return;
|
||||||
#ifdef RENDER3D
|
#ifdef RENDER3D
|
||||||
case 0x04000540 :
|
case cmd_3D_SWAP_BUFFERS :
|
||||||
OGLRender::glFlush();
|
OGLRender::glFlush();
|
||||||
return;
|
return;
|
||||||
case 0x04000580 :
|
case cmd_3D_VIEWPORT :
|
||||||
OGLRender::glViewPort(val);
|
OGLRender::glViewPort(val);
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if (adr > 0x4000300 && adr < 0x4000700)
|
||||||
|
printf("command %08x\n", adr);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
static u16 vx=0,vy=0,vz=0;
|
static u16 vx=0,vy=0,vz=0;
|
||||||
|
|
||||||
//#define print(a) printf a
|
#define print(a) printf a
|
||||||
#define print(a)
|
//#define print(a)
|
||||||
|
|
||||||
INLINE void gl_VTX_one() {
|
INLINE void gl_VTX_one() {
|
||||||
float vfx,vfy,vfz;
|
float vfx,vfy,vfz;
|
||||||
|
@ -62,17 +62,28 @@ void gl_VTX_end() {
|
||||||
print(("VTX_end.\n"));
|
print(("VTX_end.\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gl_VTX_16 (u32 val) {
|
||||||
void gl_VTX_16 (u32 xxyy, u32 zz__) {
|
|
||||||
//see 400048Ch - Cmd 23h - VTX_16 - Set Vertex XYZ Coordinates (W)
|
//see 400048Ch - Cmd 23h - VTX_16 - Set Vertex XYZ Coordinates (W)
|
||||||
_VTX_16 xy, z_;
|
_VTX_16 vval;
|
||||||
xy.val = xxyy;
|
static int vtx_16_nbparams = 0;
|
||||||
z_.val = zz__;
|
|
||||||
vx = xy.bits.low ;
|
vval.val = val;
|
||||||
vy = xy.bits.high;
|
switch(vtx_16_nbparams) {
|
||||||
vz = z_.bits.low ;
|
case 0:
|
||||||
gl_VTX_one();
|
vx = vval.bits.low ;
|
||||||
|
vy = vval.bits.high;
|
||||||
|
vtx_16_nbparams++;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
vz = vval.bits.low ;
|
||||||
|
gl_VTX_one();
|
||||||
|
vtx_16_nbparams=0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl_VTX_10 (u32 xyz) {
|
void gl_VTX_10 (u32 xyz) {
|
||||||
//see 4000490h - Cmd 24h - VTX_10 - Set Vertex XYZ Coordinates (W)
|
//see 4000490h - Cmd 24h - VTX_10 - Set Vertex XYZ Coordinates (W)
|
||||||
_VTX_10 vt;
|
_VTX_10 vt;
|
||||||
|
|
|
@ -53,7 +53,7 @@ void gl_VTX_begin(u32 val);
|
||||||
void gl_VTX_end();
|
void gl_VTX_end();
|
||||||
//see 4000504h - Cmd 41h - END_VTXS - End of Vertex List (W)
|
//see 4000504h - Cmd 41h - END_VTXS - End of Vertex List (W)
|
||||||
|
|
||||||
void gl_VTX_16 (u32 xxyy, u32 zz__);
|
void gl_VTX_16 (u32 val);
|
||||||
//see 400048Ch - Cmd 23h - VTX_16 - Set Vertex XYZ Coordinates (W)
|
//see 400048Ch - Cmd 23h - VTX_16 - Set Vertex XYZ Coordinates (W)
|
||||||
void gl_VTX_10 (u32 xyz);
|
void gl_VTX_10 (u32 xyz);
|
||||||
//see 4000490h - Cmd 24h - VTX_10 - Set Vertex XYZ Coordinates (W)
|
//see 4000490h - Cmd 24h - VTX_10 - Set Vertex XYZ Coordinates (W)
|
||||||
|
|
|
@ -249,5 +249,44 @@
|
||||||
#define REG_DISPA_DISPMMEMFIFO 0x04000068
|
#define REG_DISPA_DISPMMEMFIFO 0x04000068
|
||||||
|
|
||||||
|
|
||||||
|
// 3d commands
|
||||||
|
#define cmd_3D_MTX_MODE 0x04000440
|
||||||
|
#define cmd_3D_MTX_PUSH 0x04000444
|
||||||
|
#define cmd_3D_MTX_POP 0x04000448
|
||||||
|
#define cmd_3D_MTX_STORE 0x0400044C
|
||||||
|
#define cmd_3D_MTX_RESTORE 0x04000450
|
||||||
|
#define cmd_3D_MTX_IDENTITY 0x04000454
|
||||||
|
#define cmd_3D_MTX_LOAD_4x4 0x04000458
|
||||||
|
#define cmd_3D_MTX_LOAD_4x3 0x0400045C
|
||||||
|
#define cmd_3D_MTX_MULT_4x4 0x04000460
|
||||||
|
#define cmd_3D_MTX_MULT_4x3 0x04000464
|
||||||
|
#define cmd_3D_MTX_MULT_3x3 0x04000468
|
||||||
|
#define cmd_3D_MTX_SCALE 0x0400046C
|
||||||
|
#define cmd_3D_MTX_TRANS 0x04000470
|
||||||
|
#define cmd_3D_COLOR 0x04000480
|
||||||
|
#define cmd_3D_NORMA 0x04000484
|
||||||
|
#define cmd_3D_TEXCOORD 0x04000488
|
||||||
|
#define cmd_3D_VTX_16 0x0400048C
|
||||||
|
#define cmd_3D_VTX_10 0x04000490
|
||||||
|
#define cmd_3D_VTX_XY 0x04000494
|
||||||
|
#define cmd_3D_VTX_XZ 0x04000498
|
||||||
|
#define cmd_3D_VTX_YZ 0x0400049C
|
||||||
|
#define cmd_3D_VTX_DIFF 0x040004A0
|
||||||
|
#define cmd_3D_POLYGON_ATTR 0x040004A4
|
||||||
|
#define cmd_3D_TEXIMAGE_PARAM 0x040004A8
|
||||||
|
#define cmd_3D_PLTT_BASE 0x040004AC
|
||||||
|
#define cmd_3D_DIF_AMB 0x040004C0
|
||||||
|
#define cmd_3D_SPE_EMI 0x040004C4
|
||||||
|
#define cmd_3D_LIGHT_VECTOR 0x040004C8
|
||||||
|
#define cmd_3D_LIGHT_COLOR 0x040004CC
|
||||||
|
#define cmd_3D_SHININESS 0x040004D0
|
||||||
|
#define cmd_3D_BEGIN_VTXS 0x04000500
|
||||||
|
#define cmd_3D_END_VTXS 0x04000504
|
||||||
|
#define cmd_3D_SWAP_BUFFERS 0x04000540
|
||||||
|
#define cmd_3D_VIEWPORT 0x04000580
|
||||||
|
#define cmd_3D_BOX_TEST 0x040005C0
|
||||||
|
#define cmd_3D_POS_TEST 0x040005C4
|
||||||
|
#define cmd_3D_VEC_TEST 0x040005C8
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue