mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-28 03:10:49 +00:00
parent
5a092227b0
commit
013bbf126b
@ -675,6 +675,8 @@ CTEntry PS_GPU::Commands[4][256] =
|
||||
#undef BLENDMODE_MAC
|
||||
};
|
||||
|
||||
static uint64 PrimitiveCounter[256] = { 0 }; // Debug
|
||||
|
||||
void PS_GPU::ProcessFIFO(void)
|
||||
{
|
||||
if(!BlitterFIFO.CanRead())
|
||||
@ -789,8 +791,20 @@ void PS_GPU::ProcessFIFO(void)
|
||||
if(!command->ss_cmd)
|
||||
DrawTimeAvail -= 2;
|
||||
|
||||
PrimitiveCounter[cc]++;
|
||||
|
||||
if(command->func[TexMode])
|
||||
{
|
||||
#if 0
|
||||
PSX_WARNING("[GPU] Command: %08x %s %d %d %d", CB[0], command->name, command->len, scanline, DrawTimeAvail);
|
||||
if(1)
|
||||
{
|
||||
printf("[GPU] ");
|
||||
for(unsigned i = 0; i < command->len; i++)
|
||||
printf("0x%08x ", CB[i]);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
// A very very ugly kludge to support texture mode specialization. fixme/cleanup/SOMETHING in the future.
|
||||
if(cc >= 0x20 && cc <= 0x3F && (cc & 0x4))
|
||||
{
|
||||
@ -847,8 +861,7 @@ void PS_GPU::Write(const pscpu_timestamp_t timestamp, uint32 A, uint32 V)
|
||||
|
||||
switch(command)
|
||||
{
|
||||
default:
|
||||
//PSX_WARNING("[GPU] Unknown control command %02x - %06x", command, V);
|
||||
default: PSX_WARNING("[GPU] Unknown control command %02x - %06x", command, V);
|
||||
break;
|
||||
|
||||
case 0x00: // Reset GPU
|
||||
@ -937,33 +950,33 @@ void PS_GPU::WriteDMA(uint32 V)
|
||||
|
||||
INLINE uint32 PS_GPU::ReadData(void)
|
||||
{
|
||||
DataReadBuffer = 0;
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(InCmd == INCMD_FBREAD)
|
||||
{
|
||||
DataReadBuffer = 0;
|
||||
for(int i = 0; i < 2; i++)
|
||||
{
|
||||
DataReadBuffer |= GPURAM[FBRW_CurY & 511][FBRW_CurX & 1023] << (i * 16);
|
||||
|
||||
FBRW_CurX++;
|
||||
if(FBRW_CurX == (FBRW_X + FBRW_W))
|
||||
{
|
||||
DataReadBuffer |= GPURAM[FBRW_CurY & 511][FBRW_CurX & 1023] << (i * 16);
|
||||
|
||||
FBRW_CurX++;
|
||||
if(FBRW_CurX == (FBRW_X + FBRW_W))
|
||||
{
|
||||
FBRW_CurX = FBRW_X;
|
||||
FBRW_CurY++;
|
||||
if(FBRW_CurY == (FBRW_Y + FBRW_H))
|
||||
{
|
||||
InCmd = INCMD_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
FBRW_CurX = FBRW_X;
|
||||
FBRW_CurY++;
|
||||
if(FBRW_CurY == (FBRW_Y + FBRW_H))
|
||||
{
|
||||
InCmd = INCMD_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return DataReadBuffer;
|
||||
return DataReadBuffer;
|
||||
}
|
||||
|
||||
uint32 PS_GPU::ReadDMA(void)
|
||||
{
|
||||
if (InCmd == INCMD_FBREAD)
|
||||
return ReadData();
|
||||
else
|
||||
return DataReadBuffer;
|
||||
return ReadData();
|
||||
}
|
||||
|
||||
uint32 PS_GPU::Read(const pscpu_timestamp_t timestamp, uint32 A)
|
||||
@ -1009,10 +1022,8 @@ uint32 PS_GPU::Read(const pscpu_timestamp_t timestamp, uint32 A)
|
||||
if(MaskEvalAND)
|
||||
ret |= 1 << 12;
|
||||
}
|
||||
else if (InCmd == INCMD_FBREAD) // "Data"
|
||||
ret = ReadData();
|
||||
else
|
||||
ret = DataReadBuffer;
|
||||
else // "Data"
|
||||
ret = ReadData();
|
||||
|
||||
return(ret >> ((A & 3) * 8));
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
&PS_GPU::Command_DrawPolygon<3 + ((cv & 0x8) >> 3), ((cv & 0x10) >> 4), ((cv & 0x4) >> 2), ((cv & 0x2) >> 1) ? BLENDMODE_MAC : -1, ((cv & 1) ^ 1) & ((cv & 0x4) >> 2), tm, mam >
|
||||
|
||||
#define POLY_HELPER(cv) { 1 + (3 /*+ ((cv & 0x8) >> 3)*/) * ( 1 + ((cv & 0x4) >> 2) + ((cv & 0x10) >> 4) ) - ((cv & 0x10) >> 4), \
|
||||
1, false, "Polygon", { POLY_HELPER_SUB(cv, 0, 0), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 0), \
|
||||
1, false, "Polygon", { POLY_HELPER_SUB(cv, ((cv & 0x4) ? 0 : 0), 0), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 0), \
|
||||
POLY_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 0), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 0), \
|
||||
POLY_HELPER_SUB(cv, 0, 1), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 1), \
|
||||
POLY_HELPER_SUB(cv, ((cv & 0x4) ? 0 : 0), 1), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 1), \
|
||||
POLY_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 1), POLY_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 1), \
|
||||
} }
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
#define SPR_HELPER_SUB(cv, tm, mam) &PS_GPU::Command_DrawSprite<(cv >> 3) & 0x3, ((cv & 0x4) >> 2), ((cv & 0x2) >> 1) ? BLENDMODE_MAC : -1, ((cv & 1) ^ 1) & ((cv & 0x4) >> 2), tm, mam>
|
||||
|
||||
#define SPR_HELPER(cv) { 2 + ((cv & 0x4) >> 2) + ((cv & 0x18) ? 0 : 1), 2 | ((cv & 0x4) >> 2) | ((cv & 0x18) ? 0 : 1), false, "Sprite", { \
|
||||
SPR_HELPER_SUB(cv, 0, 0), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 0), \
|
||||
SPR_HELPER_SUB(cv, ((cv & 0x4) ? 0 : 0), 0), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 0), \
|
||||
SPR_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 0), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 0), \
|
||||
SPR_HELPER_SUB(cv, 0, 1), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 1), \
|
||||
SPR_HELPER_SUB(cv, ((cv & 0x4) ? 0 : 0), 1), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 1 : 0), 1), \
|
||||
SPR_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 1), SPR_HELPER_SUB(cv, ((cv & 0x4) ? 2 : 0), 1), \
|
||||
} }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user