MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / parse_custom

Function parse_custom

src/debug.cpp:9480–9512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9478}
9479
9480static void parse_custom(char *out, int buffersize, char *format, char *p, char c)
9481{
9482 bool gotv = false;
9483 bool gots = false;
9484 out[0] = 0;
9485 uae_u32 v = 0;
9486 char s[256];
9487 if (!strcmp(p, "CYCLES")) {
9488 if (debugsprintf_cycles_set) {
9489 v = (uae_u32)((get_cycles() - debugsprintf_cycles) / CYCLE_UNIT);
9490 } else {
9491 v = 0xffffffff;
9492 }
9493 gotv = true;
9494 }
9495 if (gotv) {
9496 if (c == 'x' || c == 'X' || c == 'd' || c == 'i' || c == 'u' || c == 'o') {
9497 char *fs = format + strlen(format);
9498 *fs++ = c;
9499 *fs = 0;
9500 snprintf(out, buffersize, format, v);
9501 } else {
9502 strcpy(s, "****");
9503 gots = true;
9504 }
9505 }
9506 if (gots) {
9507 char *fs = format + strlen(format);
9508 *fs++ = 's';
9509 *fs = 0;
9510 snprintf(out, buffersize, format, s);
9511 }
9512}
9513
9514static uae_u32 get_value(struct dsprintfstack **stackp, uae_u32 *sizep, uaecptr *ptrp, uae_u32 size)
9515{

Callers 1

debug_sprintf_doFunction · 0.85

Calls 2

get_cyclesFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected