Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 9, 2024
2 parents 0aca793 + 3e78322 commit 398dddd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
28 changes: 14 additions & 14 deletions pcsx2/DEV9/smap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,18 @@ u32 wswap(u32 d)

void tx_process()
{
//we loop based on count ? or just *use* it ?
const u32 cnt = dev9Ru8(SMAP_R_TXFIFO_FRAME_CNT);
//spams// printf("tx_process : %u cnt frames !\n",cnt);

NetPacket pk;
u32 fc = 0;
for (fc = 0; fc < cnt; fc++)
// We will loop though TX_BD, sending any that are ready
// stopping once we reach one that isn't ready
// SMAP_R_TXFIFO_FRAME_CNT is decremented, but otherwise isn't used
// This seems to match HW behaviour
u32 cnt = 0;
while (true)
{
smap_bd_t* pbd = ((smap_bd_t*)&dev9.dev9R[SMAP_BD_TX_BASE & 0xffff]) + dev9.txbdi;

if (!(pbd->ctrl_stat & SMAP_BD_TX_READY))
{
Console.Error("DEV9: SMAP: ERROR : !pbd->ctrl_stat&SMAP_BD_TX_READY");
break;
}
if (pbd->length & 3)
Expand Down Expand Up @@ -212,18 +211,19 @@ void tx_process()

//decrease frame count -- this is not thread safe
dev9Ru8(SMAP_R_TXFIFO_FRAME_CNT)--;
cnt++;
}

//spams// emu_printf("processed %u frames, %u count, cnt = %u\n",fc,dev9Ru8(SMAP_R_TXFIFO_FRAME_CNT),cnt);
//if some error/early exit signal TXDNV
if (fc != cnt || cnt == 0)
// if we actualy send something set TXEND
if (cnt != 0)
{
Console.Error("DEV9: SMAP: WARN : (fc!=cnt || cnt==0) but packet send request was made oO..");
_DEV9irq(SMAP_INTR_TXEND, 100); //now ? or when the fifo is empty ? i guess now atm
}
else
{
Console.Error("DEV9: SMAP: WARN : Current BD_TX was not ready, but packet send request was made");
_DEV9irq(SMAP_INTR_TXDNV, 0);
}
//if we actualy send something send TXEND
if (fc != 0)
_DEV9irq(SMAP_INTR_TXEND, 100); //now ? or when the fifo is empty ? i guess now atm
}


Expand Down
27 changes: 25 additions & 2 deletions pcsx2/GS/GS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,37 @@ void GSgetStats(SmallStringBase& info)
{
const double fps = GetVerticalFrequency();
const double fillrate = pm.Get(GSPerfMon::Fillrate);
info.format("{} SW | {} S | {} P | {} D | {:.2f} U | {:.2f} D | {:.2f} mpps",
double pps = fps * fillrate;
char prefix = '\0';

if (pps >= 170000000)
{
pps /= 1073741824; // Gpps
prefix = 'G';
}
else if (pps >= 35000000)
{
pps /= 1048576; // Mpps
prefix = 'M';
}
else if (pps >= 1024)
{
pps /= 1024;
prefix = 'K';
}
else
{
prefix = '\0';
}

info.format("{} SW | {} SP | {} P | {} D | {:.2f} S | {:.2f} U | {:.2f} {}pps",
api_name,
(int)pm.Get(GSPerfMon::SyncPoint),
(int)pm.Get(GSPerfMon::Prim),
(int)pm.Get(GSPerfMon::Draw),
pm.Get(GSPerfMon::Swizzle) / 1024,
pm.Get(GSPerfMon::Unswizzle) / 1024,
fps * fillrate / (1024 * 1024));
pps,prefix);
}
else if (GSCurrentRenderer == GSRendererType::Null)
{
Expand Down

0 comments on commit 398dddd

Please sign in to comment.