Remove DBG_PRINTF and remaining usages

This commit is contained in:
Anthony Miles 2019-06-08 23:56:48 +12:00
parent 9a7ded6a53
commit 1611559087
5 changed files with 54 additions and 53 deletions

View File

@ -400,9 +400,6 @@ extern thread_local std::string _logThreadPrefix;
} \
}
#define DBG_PRINTF(fmt, ...) \
DBG_PRINTF_EX(LOG_PREFIX, fmt, ##__VA_ARGS__)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@ -429,10 +426,10 @@ extern thread_local std::string _logThreadPrefix;
// RETURN_TYPE logs the given typed result and then returns it (so this should appear last in functions)
#define RETURN_TYPE(type, r) do { if (g_bPrintfOn) LOG_CHECK_ENABLED(LOG_LEVEL::DEBUG) { LOG_FUNC_RESULT_TYPE(type, r) } return r; } while (0)
#define LOG_ONCE(msg, ...) { static bool bFirstTime = true; if(bFirstTime) { bFirstTime = false; DBG_PRINTF("TRAC: " ## msg, __VA_ARGS__); } }
#define LOG_ONCE(msg, ...) { static bool bFirstTime = true; if(bFirstTime) { bFirstTime = false; EmuLog(LOG_LEVEL::DEBUG, "TRAC: " ## msg, __VA_ARGS__); } }
#define LOG_XBOX_CALL(func) EmuLog(LOG_LEVEL::DEBUG, "TRAC: Xbox " ## func ## "() call");
#define LOG_FIRST_XBOX_CALL(func) LOG_ONCE("First Xbox " ## func ## "() call\n");
#define LOG_FIRST_XBOX_CALL(func) LOG_ONCE("First Xbox " ## func ## "() call");
//
// Headers for rendering enums, flags and (pointer-to-)types :

View File

@ -90,23 +90,24 @@ inline void XADPCM2PCMFormat(LPWAVEFORMATEX lpwfxFormat)
{
#if 0 //For testing purpose if XADPCM to PCM is not accurate.
DBG_PRINTF("EmuDSound: XADPCM WAVEFORMATEX\n"
"{\n"
" wFormatTag : 0x%.04hX\n"
" nChannels : 0x%.02hd\n"
" nSamplesPerSec : 0x%.08X\n"
" nAvgBytesPerSec : 0x%.08X\n"
" nBlockAlign : 0x%.02hd\n"
" wBitsPerSample : 0x%.04hX\n"
" cbSize : 0x%.04hX\n"
"}\n",
lpwfxFormat->wFormatTag,
lpwfxFormat->nChannels,
lpwfxFormat->nSamplesPerSec,
lpwfxFormat->nAvgBytesPerSec,
lpwfxFormat->nBlockAlign,
lpwfxFormat->wBitsPerSample,
lpwfxFormat->cbSize);
EmuLog(LOG_LEVEL::DEBUG,
"EmuDSound: XADPCM WAVEFORMATEX\n"
"{\n"
" wFormatTag : 0x%.04hX\n"
" nChannels : 0x%.02hd\n"
" nSamplesPerSec : 0x%.08X\n"
" nAvgBytesPerSec : 0x%.08X\n"
" nBlockAlign : 0x%.02hd\n"
" wBitsPerSample : 0x%.04hX\n"
" cbSize : 0x%.04hX\n"
"}\n",
lpwfxFormat->wFormatTag,
lpwfxFormat->nChannels,
lpwfxFormat->nSamplesPerSec,
lpwfxFormat->nAvgBytesPerSec,
lpwfxFormat->nBlockAlign,
lpwfxFormat->wBitsPerSample,
lpwfxFormat->cbSize);
#endif
lpwfxFormat->wFormatTag = WAVE_FORMAT_PCM;
@ -132,23 +133,24 @@ inline void XADPCM2PCMFormat(LPWAVEFORMATEX lpwfxFormat)
#endif
#if 0 //For testing purpose if XADPCM to PCM is not accurate.
DBG_PRINTF("EmuDSound: Converted to PCM WAVEFORMATEX\n"
"{\n"
" wFormatTag : 0x%.04hX\n"
" nChannels : 0x%.02hd\n"
" nSamplesPerSec : 0x%.08X\n"
" nAvgBytesPerSec : 0x%.08X\n"
" nBlockAlign : 0x%.02hd\n"
" wBitsPerSample : 0x%.04hX\n"
" cbSize : 0x%.04hX\n"
"}\n",
lpwfxFormat->wFormatTag,
lpwfxFormat->nChannels,
lpwfxFormat->nSamplesPerSec,
lpwfxFormat->nAvgBytesPerSec,
lpwfxFormat->nBlockAlign,
lpwfxFormat->wBitsPerSample,
lpwfxFormat->cbSize);
EmuLog(LOG_LEVEL::DEBUG,
"EmuDSound: Converted to PCM WAVEFORMATEX\n"
"{\n"
" wFormatTag : 0x%.04hX\n"
" nChannels : 0x%.02hd\n"
" nSamplesPerSec : 0x%.08X\n"
" nAvgBytesPerSec : 0x%.08X\n"
" nBlockAlign : 0x%.02hd\n"
" wBitsPerSample : 0x%.04hX\n"
" cbSize : 0x%.04hX\n"
"}\n",
lpwfxFormat->wFormatTag,
lpwfxFormat->nChannels,
lpwfxFormat->nSamplesPerSec,
lpwfxFormat->nAvgBytesPerSec,
lpwfxFormat->nBlockAlign,
lpwfxFormat->wBitsPerSample,
lpwfxFormat->cbSize);
#endif
}

View File

@ -581,7 +581,7 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
uint8_t *bByte = (uint8_t*)pNewTLS + v;
if (v % 0x10 == 0) {
DBG_PRINTF("0x%.8X:", (xbaddr)bByte);
EmuLog(LOG_LEVEL::DEBUG, "0x%.8X:", (xbaddr)bByte);
}
// Note : Use printf instead of DBG_PRINTF here, which prefixes with GetCurrentThreadId() :

View File

@ -336,10 +336,11 @@ void EmuNVNet_DMAPacketFromGuest()
memcpy(&desc, (void*)(tx_ring_addr | CONTIGUOUS_MEMORY_BASE), sizeof(desc));
DBG_PRINTF("Looking at ring desc %d (%llx): ", s->tx_ring_index, tx_ring_addr);
DBG_PRINTF("Buffer: 0x%x, ", desc.packet_buffer);
DBG_PRINTF("Length: 0x%x, ", desc.length);
EmuLog(LOG_LEVEL::DEBUG, "Flags: 0x%x", desc.flags);
EmuLog(LOG_LEVEL::DEBUG, "Looking at ring desc %d (%llx): "
"\n Buffer: 0x%x "
"\n Length: 0x%x "
"\n Flags: 0x%x ",
s->tx_ring_index, tx_ring_addr, desc.packet_buffer, desc.length, desc.flags);
s->tx_ring_index += 1;
@ -390,10 +391,11 @@ bool EmuNVNet_DMAPacketToGuest(void* packet, size_t size)
memcpy(&desc, (void*)(rx_ring_addr | CONTIGUOUS_MEMORY_BASE), sizeof(desc));
DBG_PRINTF("Looking at ring descriptor %d (0x%llx): ", s->rx_ring_index, rx_ring_addr);
DBG_PRINTF("Buffer: 0x%x, ", desc.packet_buffer);
DBG_PRINTF("Length: 0x%x, ", desc.length);
EmuLog(LOG_LEVEL::DEBUG, "Flags: 0x%x", desc.flags);
EmuLog(LOG_LEVEL::DEBUG, "Looking at ring descriptor %d (0x%llx): "
"\n Buffer: 0x%x "
"\n Length: 0x%x "
"\n Flags: 0x%x ",
s->rx_ring_index, rx_ring_addr, desc.packet_buffer, desc.length, desc.flags);
s->rx_ring_index += 1;
@ -409,9 +411,10 @@ bool EmuNVNet_DMAPacketToGuest(void* packet, size_t size)
desc.length = (uint16_t)size;
desc.flags = NV_RX_BIT4 | NV_RX_DESCRIPTORVALID;
memcpy((void*)(rx_ring_addr | CONTIGUOUS_MEMORY_BASE), &desc, sizeof(desc));
DBG_PRINTF("Updated ring descriptor: ");
DBG_PRINTF("Length: 0x%x, ", desc.length);
EmuLog(LOG_LEVEL::DEBUG, "Flags: 0x%x", desc.flags);
EmuLog(LOG_LEVEL::DEBUG, "Updated ring descriptor: "
"\n Length: 0x%x "
"\n Flags: 0x%x ",
desc.flags, desc.length);
/* Trigger interrupt */
EmuLog(LOG_LEVEL::DEBUG, "Triggering interrupt");

View File

@ -955,8 +955,7 @@ int USBDevice::USBDesc_HandleControl(XboxDeviceState* dev, USBPacket *p,
// From the USB 1.1 standard: "This request allows the host to select an alternate setting for the specified interface"
// wValue = Alternative Setting; wIndex = Interface
ret = USBDesc_SetInterface(dev, index, value);
DBG_PRINTF("Received standard SetInterface() request for device at address 0x%X. Interface selected is %d, Alternative Setting \
is %d and returned %d\n", dev->Addr, index, value, ret);
EmuLog(LOG_LEVEL::DEBUG, "Received standard SetInterface() request for device at address 0x%X. Interface selected is %d, Alternative Setting is %d and returned %d", dev->Addr, index, value, ret);
break;
}