MCPcopy Create free account
hub / github.com/TASEmulators/fceux / pushToLogBuffer

Function pushToLogBuffer

src/drivers/Qt/TraceLogger.cpp:1224–1268  ·  view source on GitHub ↗

----------------------------------------------------

Source from the content-addressed store, hash-verified

1222}
1223//----------------------------------------------------
1224static void pushToLogBuffer(traceRecord_t &rec)
1225{
1226
1227 recBuf[recBufHead] = rec;
1228 recBufHead = (recBufHead + 1) % recBufMax;
1229
1230 if ( recBufNum < recBufMax )
1231 {
1232 recBufNum++;
1233 }
1234
1235 if ( logBuf )
1236 {
1237 int nextHead, delayCount = 0;
1238 logBuf[logBufHead] = rec;
1239 nextHead = (logBufHead + 1) % logBufMax;
1240
1241 while (nextHead == logBufTail)
1242 {
1243 SDL_Delay(1);
1244
1245 delayCount++;
1246
1247 if ( delayCount > 10000 )
1248 {
1249 break;
1250 }
1251 }
1252 logBufHead = nextHead;
1253
1254 if ( overrunWarningArmed )
1255 { // Don't spam with buffer overrun warning messages,
1256 // we will print once if this happens.
1257 if (logBufHead == logBufTail)
1258 {
1259 if ( traceLogWindow )
1260 {
1261 traceLogWindow->showBufferWarning();
1262 }
1263 printf("Trace Log Overrun!!!\n");
1264 overrunWarningArmed = false;
1265 }
1266 }
1267 }
1268}
1269//----------------------------------------------------
1270static void pushMsgToLogBuffer(const char *msg)
1271{

Callers 2

pushMsgToLogBufferFunction · 0.85
FCEUD_TraceInstructionFunction · 0.85

Calls 1

showBufferWarningMethod · 0.80

Tested by

no test coverage detected