mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Log SWRS commands
This commit is contained in:
parent
e56e45e2da
commit
0f99077724
|
@ -14,7 +14,6 @@
|
|||
#include "gSP.h"
|
||||
#include "gDP.h"
|
||||
#include "GBI.h"
|
||||
#include "Log.h"
|
||||
#include "DisplayWindow.h"
|
||||
|
||||
#define F3DSWRS_VTXCOLOR 0x02
|
||||
|
@ -52,6 +51,8 @@ void F3DSWRS_MoveMem(u32 _w0, u32)
|
|||
case F3DSWRS_MV_TEXSCALE:
|
||||
gSP.textureCoordScale[0] = *(u32*)&RDRAM[RSP.PC[RSP.PCi] + 16];
|
||||
gSP.textureCoordScale[1] = *(u32*)&RDRAM[RSP.PC[RSP.PCi] + 12];
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_MoveMem Texscale(0x%08x, 0x%08x)\n",
|
||||
gSP.textureCoordScale[0], gSP.textureCoordScale[1]);
|
||||
break;
|
||||
}
|
||||
RSP.PC[RSP.PCi] += 16;
|
||||
|
@ -59,6 +60,8 @@ void F3DSWRS_MoveMem(u32 _w0, u32)
|
|||
|
||||
void F3DSWRS_Vtx(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_Vtx (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
|
||||
const u32 address = RSP_SegmentToPhysical(_w1);
|
||||
const u32 n = _SHIFTR(_w0, 10, 6);
|
||||
|
||||
|
@ -127,8 +130,8 @@ void F3DSWRS_PrepareVertices(const u32* _vert, const u8* _colorbase, const u32*
|
|||
|
||||
static
|
||||
void Jump3_2(const u32 * _params, u32 * _result) {
|
||||
if (_params[1] == 0xFDA00050 && _params[9] == 0xE2000200 && _params[8] == 0xF0000000)
|
||||
int k = 0;
|
||||
// if (_params[1] == 0xFDA00050 && _params[9] == 0xE2000200 && _params[8] == 0xF0000000)
|
||||
// int k = 0;
|
||||
typedef std::array<s16, 4> Vector;
|
||||
Vector v0 = { 0, 0, 0, 0 };
|
||||
Vector v1 = { 0, 0, 0, 0 };
|
||||
|
@ -164,6 +167,8 @@ void Jump3_2(const u32 * _params, u32 * _result) {
|
|||
bool _print = false;
|
||||
void F3DSWRS_Jump3(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_Jump3 (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
|
||||
const u32 mode = _SHIFTR(_w0, 8, 8);
|
||||
switch (mode) {
|
||||
case 0x02:
|
||||
|
@ -196,7 +201,7 @@ void F3DSWRS_Jump3(u32 _w0, u32 _w1)
|
|||
f32 sx = v.x / v.w * gSP.viewport.vscale[0] + gSP.viewport.vtrans[0];
|
||||
f32 sy = v.y / v.w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
|
||||
f32 sz = v.z / v.w * gSP.viewport.vscale[2] + gSP.viewport.vtrans[2];
|
||||
debugPrint("v[%d] x=%02f y=%02f z=%02f\n", i, sx, gDP.scissor.lry - sy, sz);
|
||||
DebugMsg(DEBUG_NORMAL, "v[%d] x=%02f y=%02f z=%02f\n", i, sx, gDP.scissor.lry - sy, sz);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +219,7 @@ void F3DSWRS_Jump3(u32 _w0, u32 _w1)
|
|||
|
||||
|
||||
const bool useTex = true;// (_w0 & 2) != 0;
|
||||
F3DSWRS_PrepareVertices(vert, (u8*)colorbase, color, (u8*)texbase, true, 4);
|
||||
F3DSWRS_PrepareVertices(vert, (u8*)colorbase, color, (u8*)texbase, useTex, 4);
|
||||
|
||||
SPVertex & vtx2 = drawer.getVertex(v2);
|
||||
SPVertex & vtx3 = drawer.getVertex(v3);
|
||||
|
@ -237,19 +242,22 @@ void F3DSWRS_Jump3(u32 _w0, u32 _w1)
|
|||
RSP.swDL[RSP.PCi].SWOtherDL = _SHIFTR(*(u32*)&RDRAM[RSP.PC[RSP.PCi] + 4], 0, 24);
|
||||
}
|
||||
|
||||
void F3DSWRS_DList(u32, u32 _w1)
|
||||
void F3DSWRS_DList(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_DList (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
gSPSWDisplayList(_w1);
|
||||
}
|
||||
|
||||
void F3DSWRS_BranchDList(u32, u32 _w1)
|
||||
void F3DSWRS_BranchDList(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_BranchDList (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
gSPSWBranchList(_w1);
|
||||
}
|
||||
|
||||
void F3DSWRS_Tri1(u32 _w0, u32 _w1)
|
||||
{
|
||||
const u32 v1 = (_SHIFTR( _w1, 13, 11 ) & 0x7F8) / 40;
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_Tri1 (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
const u32 v1 = (_SHIFTR(_w1, 13, 11) & 0x7F8) / 40;
|
||||
const u32 v2 = (_SHIFTR( _w1, 5, 11 ) & 0x7F8) / 40;
|
||||
const u32 v3 = ((_w1 << 3) & 0x7F8) / 40;
|
||||
const u32 vert[3] = { v1, v2, v3 };
|
||||
|
@ -270,7 +278,8 @@ void F3DSWRS_Tri1(u32 _w0, u32 _w1)
|
|||
|
||||
void F3DSWRS_Tri2(u32 _w0, u32 _w1)
|
||||
{
|
||||
const u32 v1 = (_SHIFTR( _w1, 13, 11 ) & 0x7F8) / 40;
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_Tri2 (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
const u32 v1 = (_SHIFTR(_w1, 13, 11) & 0x7F8) / 40;
|
||||
const u32 v2 = (_SHIFTR( _w1, 5, 11 ) & 0x7F8) / 40;
|
||||
const u32 v3 = ((_w1 << 3) & 0x7F8) / 40;
|
||||
const u32 v4 = (_SHIFTR( _w1, 21, 11 ) & 0x7F8) / 40;
|
||||
|
@ -293,7 +302,8 @@ void F3DSWRS_Tri2(u32 _w0, u32 _w1)
|
|||
|
||||
void F3DSWRS_MoveWord(u32 _w0, u32 _w1)
|
||||
{
|
||||
switch (_SHIFTR( _w0, 0, 8 )){
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_MoveWord (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
switch (_SHIFTR(_w0, 0, 8)){
|
||||
// case 0x58C: // This PC is used after a texrect in naboo
|
||||
// State.NabooPCAfterTexRect = Segment[Command.dl.segment] + Command.dl.addr;
|
||||
// break;
|
||||
|
@ -317,23 +327,26 @@ void F3DSWRS_MoveWord(u32 _w0, u32 _w1)
|
|||
}
|
||||
}
|
||||
|
||||
void F3DSWRS_HeightField(u32, u32)
|
||||
void F3DSWRS_HeightField(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_HeightField (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
// Lemmy's note:
|
||||
// seems to be similar to JUMP3, but calls actual function with A1=0x2C
|
||||
// it *might* need the same jump/branch code as JUMP3
|
||||
RSP.PC[RSP.PCi] += 16;
|
||||
}
|
||||
|
||||
void F3DSWRS_SetOtherMode_H_EX(u32, u32 _w1)
|
||||
void F3DSWRS_SetOtherMode_H_EX(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_SetOtherMode_H_EX (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
RSP.PC[RSP.PCi] += 8;
|
||||
gDP.otherMode.h &= *(u32*)&RDRAM[RSP.PC[RSP.PCi]];
|
||||
gDP.otherMode.h |= _w1;
|
||||
}
|
||||
|
||||
void F3DSWRS_SetOtherMode_L_EX(u32, u32 _w1)
|
||||
void F3DSWRS_SetOtherMode_L_EX(u32 _w0, u32 _w1)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "F3DSWRS_SetOtherMode_L_EX (0x%08x, 0x%08x)\n", _w0, _w1);
|
||||
RSP.PC[RSP.PCi] += 8;
|
||||
gDP.otherMode.l &= *(u32*)&RDRAM[RSP.PC[RSP.PCi]];
|
||||
gDP.otherMode.l |= _w1;
|
||||
|
|
|
@ -1442,6 +1442,8 @@ void gSPF3DAMVertex(u32 a, u32 n, u32 v0)
|
|||
|
||||
void gSPSWVertex(const SWVertex * vertex, u32 n, u32 v0)
|
||||
{
|
||||
DebugMsg(DEBUG_NORMAL, "gSPSWVertex n = %i, v0 = %i\n", n, v0);
|
||||
|
||||
GraphicsDrawer & drawer = dwnd().getDrawer();
|
||||
if ((n + v0) <= INDEXMAP_SIZE) {
|
||||
unsigned int i = v0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user