What happens to printfs when code run on real non interactive system?

Hi All,

I’m attempting to make a modification so that output from my printfs can be viewed via a web page. To do this I’ve hacked DC’s printf function to make a copy of it’s output into my own buffer. This works fine when I’m running my program in “development mode”, downloading from the USB cable. When I run my program in normal “deployment mode” however, by debug buffer is always empty as if the printfs are never being called. Can anyone explain what could be going on here?

TY
FW


// References to externally defined debug buffer, used to store a
// copy of printfs
extern char g_DebugBuffer[];
extern int g_DebugBufferIndex;

nodebug
int _printf(char far*fmt,char *args)
{
	auto int __printfcnt, __cnt;
    int i;

   // __printfbuf can't be far -- it's passed to __qe2 (by way of doprnt)
   // which passes it to dkDoMsg() and _stdioSerialOut(), two assembly
   // functions that expect a near pointer.
	auto char __printfbuf[STDIO_MAX_PRINTF_BUF_SIZE];

	__printfcnt = 0;
	doprnt(__qe2, fmt, args, NULL, __printfbuf, &__printfcnt);
	__cnt = __printfcnt;
	__qe2(0, __printfbuf, &__printfcnt, NULL);

   if(__printfbuf[0] != 0)
   {
#ifdef STDIO_DEBUG_SERIAL
#ifndef STDIO_DEBUG_FORCEDSERIAL
		if (OPMODE & 0x08)
			dkDoMsg(__printfbuf);  // xmit buffer to stdout window for debug mode
		else
#endif	//STDIO_DEBUG_FORCEDSERIAL
			_stdioSerialOut(__printfbuf);
#else
		dkDoMsg(__printfbuf);  // xmit buffer to stdout window
#endif
	}

#ifdef DEBUG_BUFFER_SIZE
    // append printf output to circular g_DebugBuffer
    for (i = 0;__printfbuf[i] != 0;i++) {
    	g_DebugBuffer[g_DebugBufferIndex] = __printfbuf[i];
        g_DebugBufferIndex = (g_DebugBufferIndex + 1) % DEBUG_BUFFER_SIZE;
    }
	g_DebugBuffer[g_DebugBufferIndex] = 0;
    // leave index at pointer to null terminator, so this gets overwritten
    // on the next call
#endif

	return __cnt;
}