an attempt to clean up the logging a bit

1) The new ERROR, WARN, INFO, DEBUG _LOG macros were used 
	ERROR,   // Bad errors - that still don't deserve a PanicAlert.
	WARNING, // Something is suspicious.
	INFO,    // General information.
	DEBUG,   // Strictly for detailed debugging - might make things slow.
2) Made all LOG macro use into some of the logging level supporting macros
LOG is commented out on linux can someone try it on windows? (it's in Log.h)
3) Added ERROR_lOG next to each panic alert

I hope I helped making the logs a bit more useful/readble



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2510 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-03-02 01:49:16 +00:00
parent 3ba6731816
commit 4e9746877e
56 changed files with 787 additions and 726 deletions

View File

@ -87,7 +87,7 @@ extern void __Logv(int log, int v, const char *format, ...);
#else
#define LOG(t, ...) __Log(LogTypes::t, ##__VA_ARGS__);
//#define LOG(t, ...) __Log(LogTypes::t, ##__VA_ARGS__);
#define LOGV(t,v, ...) __Log(LogTypes::t + (v)*100, ##__VA_ARGS__);
#define LOGP(t, ...) __Log(t, ##__VA_ARGS__);
#define LOGVP(t,v, ...) __Log(t + (v)*100, ##__VA_ARGS__);
@ -100,13 +100,13 @@ extern void __Logv(int log, int v, const char *format, ...);
#define _dbg_assert_(_t_, _a_) \
if (!(_a_)) {\
LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
ERROR_LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
__LINE__, __FILE__, __TIME__); \
if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
}
#define _dbg_assert_msg_(_t_, _a_, ...)\
if (!(_a_)) {\
LOG(_t_, __VA_ARGS__); \
ERROR_LOG(_t_, __VA_ARGS__); \
if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
}
#define _dbg_update_() Host_UpdateLogDisplay();

View File

@ -53,7 +53,7 @@ bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, .
CharArrayFromFormatV(buffer, 2047, format, args);
va_end(args);
LOG(MASTER_LOG, "%s: %s", caption, buffer);
ERROR_LOG(MASTER_LOG, "%s: %s", caption, buffer);
// -----------
if (msg_handler) {

View File

@ -49,7 +49,7 @@ void CBoot::RunFunction(u32 _iAddr)
// execute the apploader, function by function, using the above utility.
void CBoot::EmulatedBIOS(bool _bDebug)
{
LOG(BOOT, "Faking GC BIOS...");
INFO_LOG(BOOT, "Faking GC BIOS...");
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);
m_MSR.FP = 1;
@ -94,7 +94,7 @@ void CBoot::EmulatedBIOS(bool _bDebug)
// =======================================================================================
// Call iAppLoaderEntry.
LOG(MASTER_LOG, "Call iAppLoaderEntry");
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderEntry");
u32 iAppLoaderFuncAddr = 0x80003100;
PowerPC::ppcState.gpr[3] = iAppLoaderFuncAddr + 0;
@ -106,7 +106,7 @@ void CBoot::EmulatedBIOS(bool _bDebug)
u32 iAppLoaderClose = Memory::ReadUnchecked_U32(iAppLoaderFuncAddr + 8);
// iAppLoaderInit
LOG(MASTER_LOG, "Call iAppLoaderInit");
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderInit");
PowerPC::ppcState.gpr[3] = 0x81300000;
RunFunction(iAppLoaderInit);
@ -115,7 +115,7 @@ void CBoot::EmulatedBIOS(bool _bDebug)
To give you an idea about where the stuff is located on the disc take a look at yagcd
ch 13. */
// ---------------------------------------------------------------------------------------
LOG(MASTER_LOG, "Call iAppLoaderMain");
DEBUG_LOG(MASTER_LOG, "Call iAppLoaderMain");
do
{
PowerPC::ppcState.gpr[3] = 0x81300004;
@ -135,7 +135,7 @@ void CBoot::EmulatedBIOS(bool _bDebug)
// =======================================================================================
// iAppLoaderClose
LOG(MASTER_LOG, "call iAppLoaderClose");
DEBUG_LOG(MASTER_LOG, "call iAppLoaderClose");
RunFunction(iAppLoaderClose);
// Load patches
@ -169,13 +169,13 @@ void CBoot::EmulatedBIOS(bool _bDebug)
//
bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
{
LOG(BOOT, "Faking Wii BIOS...");
INFO_LOG(BOOT, "Faking Wii BIOS...");
// See if we have a memory dump to boot
FILE* pDump = fopen(FULL_WII_SYS_DIR "dump_0x0000_0x4000.bin", "rb");
if (pDump != NULL)
{
LOG(MASTER_LOG, "Init from memory dump.");
INFO_LOG(MASTER_LOG, "Init from memory dump.");
fread(Memory::GetMainRAMPtr(), 1, 16384, pDump);
fclose(pDump);
@ -218,7 +218,7 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
FILE* pTmp = fopen(filename.c_str(), "rb");
if (!pTmp)
{
LOG(MASTER_LOG, "Cant find setting file");
ERROR_LOG(MASTER_LOG, "Cant find setting file");
return false;
}
@ -333,13 +333,13 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
u32 iAppLoaderSize = VolumeHandler::Read32(iAppLoaderOffset + 0x14);
if ((iAppLoaderEntry == (u32)-1) || (iAppLoaderSize == (u32)-1))
{
LOG(BOOT, "Invalid apploader. Probably your image is corrupted.");
ERROR_LOG(BOOT, "Invalid apploader. Probably your image is corrupted.");
return false;
}
VolumeHandler::ReadToPtr(Memory::GetPointer(0x81200000), iAppLoaderOffset + 0x20, iAppLoaderSize);
//call iAppLoaderEntry
LOG(BOOT, "Call iAppLoaderEntry");
DEBUG_LOG(BOOT, "Call iAppLoaderEntry");
u32 iAppLoaderFuncAddr = 0x80004000;
PowerPC::ppcState.gpr[3] = iAppLoaderFuncAddr + 0;
@ -351,7 +351,7 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
u32 iAppLoaderClose = Memory::ReadUnchecked_U32(iAppLoaderFuncAddr+8);
// iAppLoaderInit
LOG(BOOT, "Run iAppLoaderInit");
DEBUG_LOG(BOOT, "Run iAppLoaderInit");
PowerPC::ppcState.gpr[3] = 0x81300000;
RunFunction(iAppLoaderInit);
@ -360,7 +360,7 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
any side effects however. It's a little disconcerning however that Start after Stop
behaves differently than the first Start after starting Dolphin. It means something
was not reset correctly. */
LOG(BOOT, "Run iAppLoaderMain");
DEBUG_LOG(BOOT, "Run iAppLoaderMain");
do
{
PowerPC::ppcState.gpr[3] = 0x81300004;
@ -378,7 +378,7 @@ bool CBoot::EmulatedBIOS_Wii(bool _bDebug)
} while(PowerPC::ppcState.gpr[3] != 0x00);
// iAppLoaderClose
LOG(BOOT, "Run iAppLoaderClose");
DEBUG_LOG(BOOT, "Run iAppLoaderClose");
RunFunction(iAppLoaderClose);
// Load patches and run startup patches

View File

@ -121,7 +121,7 @@ void addrToHiLo(u32 addr, u16 &hi, s16 &lo)
bool ElfReader::LoadInto(u32 vaddr)
{
LOG(MASTER_LOG,"String section: %i", header->e_shstrndx);
DEBUG_LOG(MASTER_LOG,"String section: %i", header->e_shstrndx);
// sectionOffsets = new u32[GetNumSections()];
// sectionAddrs = new u32[GetNumSections()];
@ -131,15 +131,15 @@ bool ElfReader::LoadInto(u32 vaddr)
if (bRelocate)
{
LOG(MASTER_LOG,"Relocatable module");
DEBUG_LOG(MASTER_LOG,"Relocatable module");
entryPoint += vaddr;
}
else
{
LOG(MASTER_LOG,"Prerelocated executable");
DEBUG_LOG(MASTER_LOG,"Prerelocated executable");
}
LOG(MASTER_LOG,"%i segments:", header->e_phnum);
INFO_LOG(MASTER_LOG,"%i segments:", header->e_phnum);
// First pass : Get the bits into RAM
u32 segmentVAddr[32];
@ -149,7 +149,7 @@ bool ElfReader::LoadInto(u32 vaddr)
{
Elf32_Phdr *p = segments + i;
LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr, p->p_filesz, p->p_memsz);
INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr, p->p_filesz, p->p_memsz);
if (p->p_type == PT_LOAD)
{
@ -170,7 +170,7 @@ bool ElfReader::LoadInto(u32 vaddr)
{
//memset(dst + srcSize, 0, dstSize-srcSize); //zero out bss
}
LOG(MASTER_LOG,"Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz);
INFO_LOG(MASTER_LOG,"Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz);
}
}
@ -197,7 +197,7 @@ bool ElfReader::LoadInto(u32 vaddr)
}
}
*/
LOG(MASTER_LOG,"Done.");
INFO_LOG(MASTER_LOG,"Done loading.");
return true;
}

View File

@ -38,12 +38,12 @@ void Console_Submit(const char *cmd)
CASE1("r")
{
Core::StartTrace(false);
LOG(CONSOLE, "read tracing started.");
INFO_LOG(CONSOLE, "read tracing started.");
}
CASE1("w")
{
Core::StartTrace(true);
LOG(CONSOLE, "write tracing started.");
INFO_LOG(CONSOLE, "write tracing started.");
}
CASE("trans")
{
@ -57,11 +57,11 @@ void Console_Submit(const char *cmd)
u32 EA =
#endif
Memory::CheckDTLB(addr, Memory::FLAG_NO_EXCEPTION);
LOG(CONSOLE, "EA 0x%08x to 0x%08x", addr, EA);
INFO_LOG(CONSOLE, "EA 0x%08x to 0x%08x", addr, EA);
}
else
{
LOG(CONSOLE, "Syntax: trans ADDR");
DEBUG_LOG(CONSOLE, "Syntax: trans ADDR");
}
}
CASE("call")
@ -75,7 +75,7 @@ void Console_Submit(const char *cmd)
}
else
{
LOG(CONSOLE, "Syntax: call ADDR");
DEBUG_LOG(CONSOLE, "Syntax: call ADDR");
}
}
CASE("llac")
@ -89,7 +89,7 @@ void Console_Submit(const char *cmd)
}
else
{
LOG(CONSOLE, "Syntax: llac ADDR");
DEBUG_LOG(CONSOLE, "Syntax: llac ADDR");
}
}
CASE("pend")
@ -111,7 +111,7 @@ void Console_Submit(const char *cmd)
fputc(b,f);
}
fclose(f);
LOG(CONSOLE, "Dumped from %08x to %08x to %s",start,end,filename);
INFO_LOG(CONSOLE, "Dumped from %08x to %08x to %s",start,end,filename);
}
CASE("disa")
{
@ -128,14 +128,14 @@ void Console_Submit(const char *cmd)
}
CASE("help")
{
LOG(CONSOLE, "Dolphin Console Command List");
LOG(CONSOLE, "scan ADDR - will find functions that are called by this function");
LOG(CONSOLE, "call ADDR - will find functions that call this function");
LOG(CONSOLE, "dump START_A END_A FILENAME - will dump memory between START_A and END_A");
LOG(CONSOLE, "help - guess what this does :P");
LOG(CONSOLE, "lisd - list signature database");
LOG(CONSOLE, "lisf - list functions");
LOG(CONSOLE, "trans ADDR - translate address");
ERROR_LOG(CONSOLE, "Dolphin Console Command List");
ERROR_LOG(CONSOLE, "scan ADDR - will find functions that are called by this function");
ERROR_LOG(CONSOLE, "call ADDR - will find functions that call this function");
ERROR_LOG(CONSOLE, "dump START_A END_A FILENAME - will dump memory between START_A and END_A");
ERROR_LOG(CONSOLE, "help - guess what this does :P");
ERROR_LOG(CONSOLE, "lisd - list signature database");
ERROR_LOG(CONSOLE, "lisf - list functions");
ERROR_LOG(CONSOLE, "trans ADDR - translate address");
}
CASE("lisd")
{
@ -151,6 +151,6 @@ void Console_Submit(const char *cmd)
}
else {
printf("blach\n");
LOG(CONSOLE, "Invalid command");
ERROR_LOG(CONSOLE, "Invalid command");
}
}

View File

@ -365,8 +365,8 @@ THREAD_RETURN EmuThread(void *pArg)
if (_CoreParameter.bLockThreads)
Common::Thread::SetCurrentThreadAffinity(2); // Force to second core
LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "Gamecube");
LOG(OSREPORT, "Dualcore = %s", _CoreParameter.bUseDualCore ? "Yes" : "No");
INFO_LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "Gamecube");
INFO_LOG(OSREPORT, "Dualcore = %s", _CoreParameter.bUseDualCore ? "Yes" : "No");
HW::Init();
@ -575,7 +575,7 @@ void EmuThreadEnd()
HW::Shutdown();
Plugins.ShutdownPlugins();
LOG(MASTER_LOG, "EmuThread exited");
INFO_LOG(MASTER_LOG, "EmuThread exited");
// The CPU should return when a game is stopped and cleanup should be done here,
// so we can restart the plugins (or load new ones) for the next game.
if (_CoreParameter.hMainWindow == g_pWindowHandle)
@ -646,7 +646,7 @@ void LoadState() {
// WARNING - THIS IS EXECUTED FROM VIDEO THREAD
void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak)
{
LOG(VIDEO, _szMessage);
INFO_LOG(VIDEO, _szMessage);
}
// __________________________________________________________________________________________________
@ -733,7 +733,7 @@ void Callback_DSPInterrupt()
//
void Callback_PADLog(const TCHAR* _szMessage)
{
LOG(SERIALINTERFACE, _szMessage);
INFO_LOG(SERIALINTERFACE, _szMessage);
}
// __________________________________________________________________________________________________

View File

@ -174,7 +174,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBios _BootBios)
m_strSRAM = GC_SRAM_FILE;
m_strBios = FULL_GC_SYS_DIR + Region + DIR_SEP GC_IPL;
if (!File::Exists(m_strBios.c_str())) {
LOG(BOOT, "BIOS file %s not found - using HLE.", m_strBios.c_str());
WARN_LOG(BOOT, "BIOS file %s not found - using HLE.", m_strBios.c_str());
bHLEBios = true;
}

View File

@ -378,7 +378,7 @@ void Advance()
}
if (!first)
{
LOG(GEKKO, "WARNING - no events in queue. Setting downcount to 10000");
WARN_LOG(GEKKO, "WARNING - no events in queue. Setting downcount to 10000");
downcount += 10000;
}
else
@ -397,7 +397,7 @@ void LogPendingEvents()
Event *ptr = first;
while (ptr)
{
LOG(GEKKO, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
INFO_LOG(GEKKO, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
ptr = ptr->next;
}
}

View File

@ -32,7 +32,7 @@ void TMemCheck::Action(u32 iValue, u32 addr, bool write, int size, u32 pc)
{
if (Log)
{
LOG(MEMMAP,"CHK %08x %s%i at %08x (%s)",
DEBUG_LOG(MEMMAP,"CHK %08x %s%i at %08x (%s)",
iValue, write ? "Write" : "Read", // read or write
size*8, addr, // address
g_symbolDB.GetDescription(addr) // symbol map description

View File

@ -121,7 +121,7 @@ void PatchFunctions()
orig_instruction[addr] = Memory::ReadUnchecked_U32(addr);
Memory::Write_U32(HLEPatchValue | i, addr);
}
LOG(HLE,"Patching %s %08x", OSPatches[i].m_szPatchName, symbol->address);
INFO_LOG(HLE,"Patching %s %08x", OSPatches[i].m_szPatchName, symbol->address);
}
}
@ -131,7 +131,7 @@ void PatchFunctions()
if (symbol > 0)
{
BreakPoints::Add(symbol->address, false);
LOG(HLE,"Adding BP to %s %08x", OSBreakPoints[i].m_szPatchName, symbol->address);
INFO_LOG(HLE,"Adding BP to %s %08x", OSBreakPoints[i].m_szPatchName, symbol->address);
}
}

View File

@ -35,7 +35,7 @@ void HLE_OSPanic()
GetStringVA(Error);
PanicAlert("OSPanic: %s", Error.c_str());
LOG(OSREPORT,"(PC=%08x), OSPanic: %s", LR, Error.c_str());
ERROR_LOG(OSREPORT,"(PC=%08x), OSPanic: %s", LR, Error.c_str());
NPC = LR;
}
@ -50,7 +50,7 @@ void HLE_OSReport()
PC = LR;
// PanicAlert("(PC=%08x) OSReport: %s", LR, ReportMessage.c_str());
LOGV(OSREPORT,0,"(PC=%08x) OSReport: %s", LR, ReportMessage.c_str());
ERROR_LOG(OSREPORT,"(PC=%08x) OSReport: %s", LR, ReportMessage.c_str());
PC = hackPC;
}
@ -65,7 +65,7 @@ void HLE_vprintf()
PC = LR;
// PanicAlert("(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str());
LOG(OSREPORT,"(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str());
ERROR_LOG(OSREPORT,"(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str());
PC = hackPC;
}
@ -80,7 +80,7 @@ void HLE_printf()
PC = LR;
// PanicAlert("(PC=%08x) Printf: %s ", LR, ReportMessage.c_str());
LOG(OSREPORT,"(PC=%08x) Printf: %s ", LR, ReportMessage.c_str());
ERROR_LOG(OSREPORT,"(PC=%08x) Printf: %s ", LR, ReportMessage.c_str());
PC = hackPC;
}

View File

@ -124,7 +124,7 @@ void Read32(u32& _rReturnValue, const u32 _Address)
switch (_Address & 0xFFFF)
{
case AI_CONTROL_REGISTER: //0x6C00
LOGV(AUDIO_INTERFACE, 1, "AudioInterface(R) 0x%08x", _Address);
WARN_LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
_rReturnValue = g_AudioRegister.m_Control.hex;
return;
@ -132,7 +132,7 @@ void Read32(u32& _rReturnValue, const u32 _Address)
// Sample Rate (AIGetDSPSampleRate)
// 32bit state (highest bit PlayState) // AIGetStreamPlayState
case AI_VOLUME_REGISTER: //0x6C04
LOGV(AUDIO_INTERFACE, 1, "AudioInterface(R) 0x%08x", _Address);
WARN_LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
_rReturnValue = g_AudioRegister.m_Volume.hex;
return;
@ -145,12 +145,12 @@ void Read32(u32& _rReturnValue, const u32 _Address)
case AI_INTERRUPT_TIMING:
// When sample counter reaches the value of this register, the interrupt AIINT should
// fire.
LOGV(AUDIO_INTERFACE, 1, "AudioInterface(R) 0x%08x", _Address);
WARN_LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
_rReturnValue = g_AudioRegister.m_InterruptTiming;
return;
default:
LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
INFO_LOG(AUDIO_INTERFACE, "AudioInterface(R) 0x%08x", _Address);
_dbg_assert_msg_(AUDIO_INTERFACE, 0, "AudioInterface - Read from ???");
_rReturnValue = 0;
return;
@ -171,7 +171,7 @@ void Write32(const u32 _Value, const u32 _Address)
// Set frequency
if (tmpAICtrl.AFR != g_AudioRegister.m_Control.AFR)
{
LOG(AUDIO_INTERFACE, "Change Freq to %s", tmpAICtrl.AFR ? "48khz":"32khz");
INFO_LOG(AUDIO_INTERFACE, "Change Freq to %s", tmpAICtrl.AFR ? "48khz":"32khz");
g_AudioRegister.m_Control.AFR = tmpAICtrl.AFR;
}
@ -184,7 +184,7 @@ void Write32(const u32 _Value, const u32 _Address)
// Streaming counter
if (tmpAICtrl.PSTAT != g_AudioRegister.m_Control.PSTAT)
{
LOG(AUDIO_INTERFACE, "Change StreamingCounter to %s", tmpAICtrl.PSTAT ? "startet":"stopped");
INFO_LOG(AUDIO_INTERFACE, "Change StreamingCounter to %s", tmpAICtrl.PSTAT ? "startet":"stopped");
g_AudioRegister.m_Control.PSTAT = tmpAICtrl.PSTAT;
g_LastCPUTime = CoreTiming::GetTicks();
@ -193,14 +193,14 @@ void Write32(const u32 _Value, const u32 _Address)
// AI Interrupt
if (tmpAICtrl.AIINT)
{
LOG(AUDIO_INTERFACE, "Clear AI Interrupt");
INFO_LOG(AUDIO_INTERFACE, "Clear AI Interrupt");
g_AudioRegister.m_Control.AIINT = 0;
}
// Sample Count Reset
if (tmpAICtrl.SCRESET)
{
LOGV(AUDIO_INTERFACE, 1, "Reset SampleCounter");
WARN_LOG(AUDIO_INTERFACE, "Reset SampleCounter");
g_AudioRegister.m_SampleCounter = 0;
g_AudioRegister.m_Control.SCRESET = 0;
@ -217,7 +217,7 @@ void Write32(const u32 _Value, const u32 _Address)
case AI_VOLUME_REGISTER:
g_AudioRegister.m_Volume.hex = _Value;
LOGV(AUDIO_INTERFACE, 1, "Set m_Volume: left(%i) right(%i)", g_AudioRegister.m_Volume.leftVolume, g_AudioRegister.m_Volume.rightVolume);
WARN_LOG(AUDIO_INTERFACE, "Set m_Volume: left(%i) right(%i)", g_AudioRegister.m_Volume.leftVolume, g_AudioRegister.m_Volume.rightVolume);
break;
case AI_SAMPLE_COUNTER:
@ -227,7 +227,7 @@ void Write32(const u32 _Value, const u32 _Address)
case AI_INTERRUPT_TIMING:
g_AudioRegister.m_InterruptTiming = _Value;
LOG(AUDIO_INTERFACE, "Set AudioInterrupt: 0x%08x Samples", g_AudioRegister.m_InterruptTiming);
INFO_LOG(AUDIO_INTERFACE, "Set AudioInterrupt: 0x%08x Samples", g_AudioRegister.m_InterruptTiming);
break;
default:

View File

@ -240,7 +240,7 @@ void Shutdown()
void Read16(u16& _rReturnValue, const u32 _Address)
{
LOGV(COMMANDPROCESSOR, 1, "(r): 0x%08x", _Address);
WARN_LOG(COMMANDPROCESSOR, "(r): 0x%08x", _Address);
switch (_Address & 0xFFF)
{
case STATUS_REGISTER:
@ -255,7 +255,7 @@ void Read16(u16& _rReturnValue, const u32 _Address)
//m_CPStatusReg.CommandIdle = 1;
_rReturnValue = m_CPStatusReg.Hex;
LOG(COMMANDPROCESSOR, "\t iBP %s | fREADIDLE %s | fCMDIDLE %s | iOvF %s | iUndF %s"
INFO_LOG(COMMANDPROCESSOR, "\t iBP %s | fREADIDLE %s | fCMDIDLE %s | iOvF %s | iUndF %s"
, m_CPStatusReg.Breakpoint ? "ON" : "OFF"
, m_CPStatusReg.ReadIdle ? "ON" : "OFF"
, m_CPStatusReg.CommandIdle ? "ON" : "OFF"
@ -286,33 +286,33 @@ void Read16(u16& _rReturnValue, const u32 _Address)
//_rReturnValue = ReadLow (fifo.CPReadWriteDistance);
// hack: CPU will always believe fifo is empty and on idle
_rReturnValue = 0;
LOG(COMMANDPROCESSOR,"read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_RW_DISTANCE_LO : %04x", _rReturnValue);
return;
case FIFO_RW_DISTANCE_HI:
//_rReturnValue = ReadHigh(fifo.CPReadWriteDistance);
// hack: CPU will always believe fifo is empty and on idle
_rReturnValue = 0;
LOG(COMMANDPROCESSOR,"read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_RW_DISTANCE_HI : %04x", _rReturnValue);
return;
case FIFO_WRITE_POINTER_LO:
_rReturnValue = ReadLow (fifo.CPWritePointer);
LOG(COMMANDPROCESSOR,"read FIFO_WRITE_POINTER_LO : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_WRITE_POINTER_LO : %04x", _rReturnValue);
return;
case FIFO_WRITE_POINTER_HI:
_rReturnValue = ReadHigh(fifo.CPWritePointer);
LOG(COMMANDPROCESSOR,"read FIFO_WRITE_POINTER_HI : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_WRITE_POINTER_HI : %04x", _rReturnValue);
return;
case FIFO_READ_POINTER_LO:
//_rReturnValue = ReadLow (fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle
_rReturnValue = ReadLow (fifo.CPWritePointer);
LOG(COMMANDPROCESSOR,"read FIFO_READ_POINTER_LO : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_READ_POINTER_LO : %04x", _rReturnValue);
return;
case FIFO_READ_POINTER_HI:
//_rReturnValue = ReadHigh(fifo.CPReadPointer);
// hack: CPU will always believe fifo is empty and on idle
_rReturnValue = ReadHigh(fifo.CPWritePointer);
LOG(COMMANDPROCESSOR,"read FIFO_READ_POINTER_HI : %04x", _rReturnValue);
DEBUG_LOG(COMMANDPROCESSOR,"read FIFO_READ_POINTER_HI : %04x", _rReturnValue);
return;
case FIFO_BP_LO: _rReturnValue = ReadLow (fifo.CPBreakpoint); return;
case FIFO_BP_HI: _rReturnValue = ReadHigh(fifo.CPBreakpoint); return;
@ -344,7 +344,7 @@ bool AllowIdleSkipping()
void Write16(const u16 _Value, const u32 _Address)
{
LOGV(COMMANDPROCESSOR, 1, "(w): 0x%04x @ 0x%08x",_Value,_Address);
WARN_LOG(COMMANDPROCESSOR, "(w): 0x%04x @ 0x%08x",_Value,_Address);
//Spin until queue is empty - it WILL become empty because this is the only thread
//that submits data
@ -377,13 +377,13 @@ void Write16(const u16 _Value, const u32 _Address)
" - Anyway, fifo flush will be forced if you press OK and dolphin might continue to work...\n"
" - We aren't betting on that :)", fifo.CPReadWriteDistance);
*/
LOG(COMMANDPROCESSOR, "*********************** GXSetGPFifo very soon? ***********************");
WARN_LOG(COMMANDPROCESSOR, "*********************** GXSetGPFifo very soon? ***********************");
u32 ct=0;
// (mb2) We don't sleep here since it could be a perf issue for super monkey ball (yup only this game IIRC)
// Touching that game is a no-go so I don't want to take the risk :p
while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > 0 )
ct++;
if (ct) {LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);}
if (ct) {WARN_LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);}
}
}
@ -412,7 +412,7 @@ void Write16(const u16 _Value, const u32 _Address)
// update interrupts
UpdateInterrupts();
LOG(COMMANDPROCESSOR,"\t write to STATUS_REGISTER : %04x", _Value);
INFO_LOG(COMMANDPROCESSOR,"\t write to STATUS_REGISTER : %04x", _Value);
}
break;
@ -449,8 +449,8 @@ void Write16(const u16 _Value, const u32 _Address)
}*/
m_CPCtrlReg.Hex = tmpCtrl.Hex;
UpdateInterrupts();
LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value);
LOG(COMMANDPROCESSOR, "\t GPREAD %s | CPULINK %s | BP %s || CPIntEnable %s | OvF %s | UndF %s"
DEBUG_LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | CPULINK %s | BP %s || CPIntEnable %s | OvF %s | UndF %s"
, fifo.bFF_GPReadEnable ? "ON" : "OFF"
, fifo.bFF_GPLinkEnable ? "ON" : "OFF"
, fifo.bFF_BPEnable ? "ON" : "OFF"
@ -467,35 +467,35 @@ void Write16(const u16 _Value, const u32 _Address)
UCPClearReg tmpClearReg(_Value);
m_CPClearReg.Hex = 0;
LOG(COMMANDPROCESSOR,"\t write to CLEAR_REGISTER : %04x",_Value);
INFO_LOG(COMMANDPROCESSOR,"\t write to CLEAR_REGISTER : %04x",_Value);
}
break;
// Fifo Registers
case FIFO_TOKEN_REGISTER:
m_tokenReg = _Value;
LOG(COMMANDPROCESSOR,"\t write to FIFO_TOKEN_REGISTER : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_TOKEN_REGISTER : %04x", _Value);
break;
case FIFO_BASE_LO:
WriteLow ((u32 &)fifo.CPBase, _Value);
fifo.CPBase &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_LO : %04x", _Value);
break;
case FIFO_BASE_HI:
WriteHigh((u32 &)fifo.CPBase, _Value);
fifo.CPBase &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_BASE_HI : %04x", _Value);
break;
case FIFO_END_LO:
WriteLow ((u32 &)fifo.CPEnd, _Value);
fifo.CPEnd &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_END_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_END_LO : %04x", _Value);
break;
case FIFO_END_HI:
WriteHigh((u32 &)fifo.CPEnd, _Value);
fifo.CPEnd &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_END_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_END_HI : %04x", _Value);
break;
// Hm. Should we really & these with FFFFFFE0?
@ -503,45 +503,45 @@ void Write16(const u16 _Value, const u32 _Address)
// fifo.CPEnd is the only value that could be not 32B aligned so far.
case FIFO_WRITE_POINTER_LO:
WriteLow ((u32 &)fifo.CPWritePointer, _Value); fifo.CPWritePointer &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_LO : %04x", _Value);
break;
case FIFO_WRITE_POINTER_HI:
WriteHigh((u32 &)fifo.CPWritePointer, _Value); fifo.CPWritePointer &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_WRITE_POINTER_HI : %04x", _Value);
break;
case FIFO_READ_POINTER_LO:
WriteLow ((u32 &)fifo.CPReadPointer, _Value); fifo.CPReadPointer &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_LO : %04x", _Value);
break;
case FIFO_READ_POINTER_HI:
WriteHigh((u32 &)fifo.CPReadPointer, _Value); fifo.CPReadPointer &= 0xFFFFFFE0;
LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_READ_POINTER_HI : %04x", _Value);
break;
case FIFO_HI_WATERMARK_LO:
WriteLow ((u32 &)fifo.CPHiWatermark, _Value);
LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_LO : %04x", _Value);
break;
case FIFO_HI_WATERMARK_HI:
WriteHigh((u32 &)fifo.CPHiWatermark, _Value);
LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_HI_WATERMARK_HI : %04x", _Value);
break;
case FIFO_LO_WATERMARK_LO:
WriteLow ((u32 &)fifo.CPLoWatermark, _Value);
LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_LO : %04x", _Value);
break;
case FIFO_LO_WATERMARK_HI:
WriteHigh((u32 &)fifo.CPLoWatermark, _Value);
LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"\t write to FIFO_LO_WATERMARK_HI : %04x", _Value);
break;
case FIFO_BP_LO:
WriteLow ((u32 &)fifo.CPBreakpoint, _Value);
LOG(COMMANDPROCESSOR,"write to FIFO_BP_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"write to FIFO_BP_LO : %04x", _Value);
break;
case FIFO_BP_HI:
WriteHigh((u32 &)fifo.CPBreakpoint, _Value);
LOG(COMMANDPROCESSOR,"write to FIFO_BP_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"write to FIFO_BP_HI : %04x", _Value);
break;
// Super monkey try to overwrite CPReadWriteDistance by an old saved RWD value. Which is lame for us.
@ -550,11 +550,11 @@ void Write16(const u16 _Value, const u32 _Address)
// So, we can skip it.
case FIFO_RW_DISTANCE_HI:
//WriteHigh((u32 &)fifo.CPReadWriteDistance, _Value);
LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_HI : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_HI : %04x", _Value);
break;
case FIFO_RW_DISTANCE_LO:
//WriteLow((u32 &)fifo.CPReadWriteDistance, _Value);
LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value);
DEBUG_LOG(COMMANDPROCESSOR,"try to write to FIFO_RW_DISTANCE_LO : %04x", _Value);
break;
}
@ -608,14 +608,14 @@ void STACKALIGN GatherPipeBursted()
// - CPU can write to fifo
// - disable Underflow interrupt
LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached");
WARN_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached");
// Wait for GPU to catch up
while (!(fifo.bFF_BPEnable && fifo.bFF_Breakpoint) && fifo.CPReadWriteDistance > fifo.CPLoWatermark)
{
ct++;
Common::SleepCurrentThread(1);
}
if (ct) {LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu ms for nothing :[", ct);}
if (ct) {WARN_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu ms for nothing :[", ct);}
/**/
}
// check if we are in sync
@ -684,7 +684,7 @@ void CatchUpGPU()
fifo.CPReadPointer = fifo.CPBase;
// adjust, take care
ptr = Memory::GetPointer(fifo.CPReadPointer);
LOG(COMMANDPROCESSOR, "BUFFER LOOP");
INFO_LOG(COMMANDPROCESSOR, "BUFFER LOOP");
// PanicAlert("loop now");
}
}

View File

@ -232,7 +232,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
if ((_iAddress & 0x6C00) != 0x6c00)
{
if (_iAddress != 0xCC005004) {
LOGV(DSPINTERFACE, 3, "DSPInterface(r16) 0x%08x", _iAddress);
DEBUG_LOG(DSPINTERFACE, "DSPInterface(r16) 0x%08x", _iAddress);
}
Common::PluginDSP *dsp = CPluginManager::GetInstance().GetDSP();
switch (_iAddress & 0xFFFF)
@ -317,7 +317,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
void Write16(const u16 _Value, const u32 _Address)
{
LOGV(DSPINTERFACE, 3, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address);
DEBUG_LOG(DSPINTERFACE, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address);
Common::PluginDSP *dsp = CPluginManager::GetInstance().GetDSP();
switch(_Address & 0xFFFF)
{
@ -442,7 +442,7 @@ void Write16(const u16 _Value, const u32 _Address)
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
GenerateDSPInterrupt(DSP::INT_AID);
LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
INFO_LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
}
break;
}
@ -485,7 +485,7 @@ void UpdateAudioDMA()
void Read32(u32& _uReturnValue, const u32 _iAddress)
{
LOG(DSPINTERFACE, "DSPInterface(r) 0x%08x", _iAddress);
INFO_LOG(DSPINTERFACE, "DSPInterface(r) 0x%08x", _iAddress);
switch (_iAddress & 0xFFFF)
{
case DSP_INTERRUPT_CONTROL:
@ -501,7 +501,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOG(DSPINTERFACE, "DSPInterface(w) 0x%08x 0x%08x", _iValue, _iAddress);
INFO_LOG(DSPINTERFACE, "DSPInterface(w) 0x%08x 0x%08x", _iValue, _iAddress);
switch (_iAddress & 0xFFFF)
{
@ -572,13 +572,13 @@ void Update_ARAM_DMA()
return;
g_arDMA.CntValid[0] = g_arDMA.CntValid[1] = false;
LOGV(DSPINTERFACE, 1, "ARAM DMA triggered");
WARN_LOG(DSPINTERFACE, "ARAM DMA triggered");
//TODO: speedup
if (g_arDMA.Cnt.dir)
{
//read from ARAM
LOGV(DSPINTERFACE, 1, "ARAM DMA read %08x bytes from %08x to Mem: %08x",g_arDMA.Cnt.count, g_arDMA.ARAddr, g_arDMA.MMAddr);
WARN_LOG(DSPINTERFACE, "ARAM DMA read %08x bytes from %08x to Mem: %08x",g_arDMA.Cnt.count, g_arDMA.ARAddr, g_arDMA.MMAddr);
u32 iMemAddress = g_arDMA.MMAddr;
u32 iARAMAddress = g_arDMA.ARAddr;

View File

@ -287,7 +287,7 @@ bool DVDReadADPCM(u8* _pDestBuffer, u32 _iNumSamples)
void Read32(u32& _uReturnValue, const u32 _iAddress)
{
LOGV(DVDINTERFACE, 3, "DVD(r): 0x%08x", _iAddress);
DEBUG_LOG(DVDINTERFACE, "DVD(r): 0x%08x", _iAddress);
switch (_iAddress & 0xFFF)
{
@ -316,7 +316,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOGV(DVDINTERFACE, 3, "DVD(w): 0x%08x @ 0x%08x", _iValue, _iAddress);
DEBUG_LOG(DVDINTERFACE, "DVD(w): 0x%08x @ 0x%08x", _iValue, _iAddress);
switch (_iAddress & 0x3FF)
{
@ -455,7 +455,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
u32 destlength = dvdMem.DMALength.Length;
dvdMem.DMALength.Length = 0;
LOG(DVDINTERFACE, "[WARNING] DVD: Get drive info offset=%08x, destbuffer=%08x, destlength=%08x", offset * 4, destbuffer, destlength);
INFO_LOG(DVDINTERFACE, "[WARNING] DVD: Get drive info offset=%08x, destbuffer=%08x, destlength=%08x", offset * 4, destbuffer, destlength);
// metroid uses this...
for (unsigned int i = 0; i < destlength / 4; i++)
@ -479,7 +479,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
u32 iDVDOffset = dvdMem.Command[1] << 2;
u32 iSrcLength = dvdMem.Command[2];
if (false) { iSrcLength++; } // avoid warning << wtf is this?
LOGV(DVDINTERFACE, 2, "DVD: Read ISO: DVDOffset=%08x, DMABuffer=%08x, SrcLength=%08x, DMALength=%08x",iDVDOffset,dvdMem.DMAAddress.Address,iSrcLength,dvdMem.DMALength.Length);
INFO_LOG(DVDINTERFACE, "DVD: Read ISO: DVDOffset=%08x, DMABuffer=%08x, SrcLength=%08x, DMALength=%08x",iDVDOffset,dvdMem.DMAAddress.Address,iSrcLength,dvdMem.DMALength.Length);
_dbg_assert_(DVDINTERFACE, iSrcLength == dvdMem.DMALength.Length);
if (DVDRead(iDVDOffset, dvdMem.DMAAddress.Address, dvdMem.DMALength.Length) != true)
@ -507,7 +507,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
#ifdef LOGGING
u32 offset = dvdMem.Command[1] << 2;
#endif
LOG(DVDINTERFACE, "DVD: Trying to seek: offset=%08x", offset);
DEBUG_LOG(DVDINTERFACE, "DVD: Trying to seek: offset=%08x", offset);
}
break;
@ -516,7 +516,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
// Command/Subcommand/Padding <- E0000000
//=========================================================================================================
case 0xE0:
LOG(DVDINTERFACE, "DVD: Requesting error");
ERROR_LOG(DVDINTERFACE, "DVD: Requesting error");
dvdMem.Immediate = g_ErrorCode;
break;
@ -548,7 +548,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
m_bStream = true;
LOG(DVDINTERFACE, "DVD(Audio) Stream subcmd = %02x offset = %08x length=%08x", subCommand, dvdMem.AudioPos, dvdMem.AudioLength);
DEBUG_LOG(DVDINTERFACE, "DVD(Audio) Stream subcmd = %02x offset = %08x length=%08x", subCommand, dvdMem.AudioPos, dvdMem.AudioLength);
}
}
break;
@ -564,7 +564,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
else
dvdMem.Immediate = 0;*/
}
LOG(DVDINTERFACE, "DVD(Audio): Request Audio status");
DEBUG_LOG(DVDINTERFACE, "DVD(Audio): Request Audio status");
break;
//=========================================================================================================
@ -572,7 +572,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg)
// Command/Subcommand/Padding <- E3000000
//=========================================================================================================
case 0xE3:
LOG(DVDINTERFACE, "DVD: Stop motor");
DEBUG_LOG(DVDINTERFACE, "DVD: Stop motor");
break;
//=========================================================================================================

View File

@ -111,10 +111,10 @@ public:
virtual ~CEXIDummy(){}
void ImmWrite(u32 data, u32 size) {LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmWrite: %08x", m_strName.c_str(), data);}
u32 ImmRead (u32 size) {LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmRead", m_strName.c_str()); return 0;}
void DMAWrite(u32 addr, u32 size) {LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMAWrite: %08x bytes, from %08x to device", m_strName.c_str(), size, addr);}
void DMARead (u32 addr, u32 size) {LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMARead: %08x bytes, from device to %08x", m_strName.c_str(), size, addr);}
void ImmWrite(u32 data, u32 size) {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmWrite: %08x", m_strName.c_str(), data);}
u32 ImmRead (u32 size) {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmRead", m_strName.c_str()); return 0;}
void DMAWrite(u32 addr, u32 size) {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMAWrite: %08x bytes, from %08x to device", m_strName.c_str(), size, addr);}
void DMARead (u32 addr, u32 size) {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMARead: %08x bytes, from device to %08x", m_strName.c_str(), size, addr);}
};
//////////////////////////////////////////////////////////////////////////

View File

@ -190,35 +190,35 @@ void CEXIIPL::TransferByte(u8& _uByte)
if ((m_uAddress & 0xF0000000) == 0xb0000000)
{
LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: WII something");
INFO_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: WII something");
}
else if ((m_uAddress & 0xF0000000) == 0x30000000)
{
// wii stuff perhaps wii SRAM?
LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: WII something (perhaps SRAM?)");
INFO_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: WII something (perhaps SRAM?)");
}
// debug only
else if ((m_uAddress & 0x60000000) == 0)
{
LOGV(EXPANSIONINTERFACE, 2, "EXI IPL-DEV: IPL access");
INFO_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: IPL access");
}
else if ((m_uAddress & 0x7FFFFF00) == 0x20000000)
{
LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: RTC access");
INFO_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: RTC access");
}
else if ((m_uAddress & 0x7FFFFF00) == 0x20000100)
{
LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: SRAM access");
INFO_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: SRAM access");
}
else if ((m_uAddress & 0x7FFFFF00) == 0x20010000)
{
LOGV(EXPANSIONINTERFACE, 3, "EXI IPL-DEV: UART");
DEBUG_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: UART");
}
else
{
//_dbg_assert_(EXPANSIONINTERFACE, 0);
_dbg_assert_msg_(EXPANSIONINTERFACE, 0, "EXI IPL-DEV: illegal access address %08x", m_uAddress);
LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: illegal address %08x", m_uAddress);
ERROR_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: illegal address %08x", m_uAddress);
}
#endif
}
@ -264,7 +264,7 @@ void CEXIIPL::TransferByte(u8& _uByte)
if ((m_count >= 256) || (_uByte == 0xD))
{
m_szBuffer[m_count] = 0x00;
LOG(OSREPORT, "%s", m_szBuffer);
INFO_LOG(OSREPORT, "%s", m_szBuffer);
memset(m_szBuffer, 0, sizeof(m_szBuffer));
m_count = 0;
}

View File

@ -82,7 +82,7 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
memory_card_content = new u8[memory_card_size];
memset(memory_card_content, 0xFF, memory_card_size);
LOG(EXPANSIONINTERFACE, "Reading memory card %s", m_strFilename.c_str());
INFO_LOG(EXPANSIONINTERFACE, "Reading memory card %s", m_strFilename.c_str());
fread(memory_card_content, 1, memory_card_size, pFile);
fclose(pFile);
}
@ -95,7 +95,7 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
memory_card_content = new u8[memory_card_size];
memset(memory_card_content, 0xFF, memory_card_size);
LOG(EXPANSIONINTERFACE, "No memory card found. Will create new.");
WARN_LOG(EXPANSIONINTERFACE, "No memory card found. Will create new.");
Flush();
}
@ -236,12 +236,12 @@ bool CEXIMemoryCard::IsInterruptSet()
void CEXIMemoryCard::TransferByte(u8 &byte)
{
LOGV(EXPANSIONINTERFACE, 3, "EXI MEMCARD: > %02x", byte);
DEBUG_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: > %02x", byte);
if (m_uPosition == 0)
{
command = byte; // first byte is command
byte = 0xFF; // would be tristate, but we don't care.
LOGV(EXPANSIONINTERFACE, 1, "EXI MEMCARD: command %02x", byte)
WARN_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: command %02x", byte)
if(command == cmdClearStatus)
{
@ -361,10 +361,10 @@ void CEXIMemoryCard::TransferByte(u8 &byte)
break;
default:
LOG(EXPANSIONINTERFACE, "EXI MEMCARD: unknown command byte %02x\n", byte);
WARN_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: unknown command byte %02x\n", byte);
byte = 0xFF;
}
}
m_uPosition++;
LOGV(EXPANSIONINTERFACE, 3, "EXI MEMCARD: < %02x", byte);
DEBUG_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: < %02x", byte);
}

View File

@ -140,10 +140,10 @@ readFn64 hwReadWii64[NUMHWMEMFUN];
u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag);
template <class T>
void HW_Default_Write(const T _Data, const u32 _Address){ LOG(MASTER_LOG, "Illegal HW Write%i %08x", sizeof(T)*8, _Address);_dbg_assert_(MEMMAP, 0);}
void HW_Default_Write(const T _Data, const u32 _Address){ ERROR_LOG(MASTER_LOG, "Illegal HW Write%i %08x", sizeof(T)*8, _Address);_dbg_assert_(MEMMAP, 0);}
template <class T>
void HW_Default_Read(T _Data, const u32 _Address){ LOG(MASTER_LOG, "Illegal HW Read%i %08x", sizeof(T)*8, _Address); _dbg_assert_(MEMMAP, 0);}
void HW_Default_Read(T _Data, const u32 _Address){ ERROR_LOG(MASTER_LOG, "Illegal HW Read%i %08x", sizeof(T)*8, _Address); _dbg_assert_(MEMMAP, 0);}
#define PAGE_SHIFT 10
@ -441,7 +441,7 @@ bool Init()
else
InitHWMemFuncs();
LOG(MEMMAP, "Memory system initialized. RAM at %p (mirrors at 0 @ %p, 0x80000000 @ %p , 0xC0000000 @ %p)",
INFO_LOG(MEMMAP, "Memory system initialized. RAM at %p (mirrors at 0 @ %p, 0x80000000 @ %p , 0xC0000000 @ %p)",
m_pRAM, m_pPhysicalRAM, m_pVirtualCachedRAM, m_pVirtualUncachedRAM);
m_IsInitialized = true;
return true;
@ -497,7 +497,7 @@ bool Shutdown()
g_arena.ReleaseView(m_pPhysicalFakeVMEM, FAKEVMEM_SIZE);
#endif
g_arena.ReleaseSpace();
LOG(MEMMAP, "Memory system shut down.");
INFO_LOG(MEMMAP, "Memory system shut down.");
return true;
}
@ -607,12 +607,12 @@ void CheckForBadAddresses(u32 Address, u32 Data, bool Read, int Bits)
{
if(Read)
{
LOG(CONSOLE, "Read%i: Program tried to read [%08x] from [%08x]", Bits, Address);
WARN_LOG(CONSOLE, "Read%i: Program tried to read [%08x] from [%08x]", Bits, Address);
//PanicAlert("Write_U32: Program tried to write [%08x] to [%08x]", _Address);
}
else
{
LOGV(CONSOLE, 0, "Write%i: Program tried to write [%08x] to [%08x]", Bits, Data, Address);
ERROR_LOG(CONSOLE, "Write%i: Program tried to write [%08x] to [%08x]", Bits, Data, Address);
//PanicAlert("Read: Program tried to write [%08x] to [%08x]", Data, Address);
}
}
@ -621,12 +621,12 @@ void CheckForBadAddresses(u32 Address, u32 Data, bool Read, int Bits)
{
if(Read)
{
LOGV(CONSOLE, 1, "Read%i: Program read [0x%08x] from [0x%08x] * * * 0 * * *", Bits, Data, Address);
WARN_LOG(CONSOLE, "Read%i: Program read [0x%08x] from [0x%08x] * * * 0 * * *", Bits, Data, Address);
//PanicAlert("Read: Program read [%08x] from [%08x]", Data, Address);
}
else
{
LOGV(CONSOLE, 1, "Write%i: Program wrote [0x%08x] to [0x%08x] * * * 0 * * *", Bits, Data, Address);
WARN_LOG(CONSOLE, "Write%i: Program wrote [0x%08x] to [0x%08x] * * * 0 * * *", Bits, Data, Address);
//PanicAlert("Read: Program wrote [%08x] to [%08x]", Data, Address);
}
}
@ -647,12 +647,12 @@ void CheckForBadAddresses(u32 Address, u32 Data, bool Read, int Bits)
{
if(Read)
{
LOGV(CONSOLE, 0, "Read%i: Program read [0x%08x] from [0x%08x] * * * * * * * * * * * *", Bits, Data, Address);
ERROR_LOG(CONSOLE, "Read%i: Program read [0x%08x] from [0x%08x] * * * * * * * * * * * *", Bits, Data, Address);
//PanicAlert("Read%i: Program read [%08x] from [%08x]", Bits, Data, Address);
}
else
{
LOGV(CONSOLE, 0, "Write%i: Program wrote [0x%08x] to [0x%08x] * * * * * * * * * * * *", Bits,Data, Address);
ERROR_LOG(CONSOLE, "Write%i: Program wrote [0x%08x] to [0x%08x] * * * * * * * * * * * *", Bits,Data, Address);
//PanicAlert("Write%i: Program wrote [0x%08x] to [0x%08x]", Bits, Data, Address);
}
}

View File

@ -185,7 +185,7 @@ void WriteToHardware(u32 em_address, const T data, u32 effective_address, Memory
return;
}
else {
LOG(MEMMAP, "hwwrite [%08x] := %08x (PC: %08x)", em_address, data, PC);
ERROR_LOG(MEMMAP, "hwwrite [%08x] := %08x (PC: %08x)", em_address, data, PC);
_dbg_assert_msg_(MEMMAP,0,"Memory - Unknown HW address %08x", em_address);
}
}
@ -210,7 +210,7 @@ void WriteToHardware(u32 em_address, const T data, u32 effective_address, Memory
}
else if (em_address >= 0xE0000000)
{
LOG(MEMMAP,"WRITE: Cache address out of bounds (addr: %08x data: %08x)", em_address, data);
ERROR_LOG(MEMMAP,"WRITE: Cache address out of bounds (addr: %08x data: %08x)", em_address, data);
/* PanicAlert("WRITE: Cache address %08x out of bounds", em_address); */
}
else
@ -512,7 +512,7 @@ void GenerateDSIException(u32 _EffectiveAdress, bool _bWrite)
PowerPC::ppcState.spr[SPR_DAR] = _EffectiveAdress;
LOG(MEMMAP, "Generate DSI Exception 0x%08x", _EffectiveAdress);
INFO_LOG(MEMMAP, "Generate DSI Exception 0x%08x", _EffectiveAdress);
PowerPC::ppcState.Exceptions |= EXCEPTION_DSI;
}
@ -523,7 +523,7 @@ void GenerateISIException()
// (HTEG), or in the rehashed secondary HTEG, or in the range of a DBAT register (page fault
// condition); otherwise cleared.
PowerPC::ppcState.spr[SPR_DSISR] = 0x4000000;
LOG(MEMMAP, "Generate ISI Exception");
INFO_LOG(MEMMAP, "Generate ISI Exception");
PowerPC::ppcState.Exceptions |= EXCEPTION_ISI;
}
@ -669,4 +669,4 @@ u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag)
// ***********************
} // namespace
} // namespace

View File

@ -58,25 +58,25 @@ void DoState(PointerWrap &p)
void Read16(u16& _uReturnValue, const u32 _iAddress)
{
//0x30 -> 0x5a : gp memory metrics
LOG(MEMMAP, "(r16) 0x%04x @ 0x%08x", 0, _iAddress);
INFO_LOG(MEMMAP, "(r16) 0x%04x @ 0x%08x", 0, _iAddress);
_uReturnValue = 0;
}
void Read32(u32& _uReturnValue, const u32 _iAddress)
{
LOG(MEMMAP, "(r32) 0x%08x @ 0x%08x", 0, _iAddress);
INFO_LOG(MEMMAP, "(r32) 0x%08x @ 0x%08x", 0, _iAddress);
_uReturnValue = 0;
}
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOG(MEMMAP, "(w32) 0x%08x @ 0x%08x", _iValue, _iAddress);
INFO_LOG(MEMMAP, "(w32) 0x%08x @ 0x%08x", _iValue, _iAddress);
}
//TODO : check
void Write16(const u16 _iValue, const u32 _iAddress)
{
LOG(MEMMAP, "(w16) 0x%04x @ 0x%08x", _iValue, _iAddress);
INFO_LOG(MEMMAP, "(w16) 0x%04x @ 0x%08x", _iValue, _iAddress);
switch(_iAddress & 0xFFF)
{
case MEM_CHANNEL0_HI: miMem.Channel0_Addr = (miMem.Channel0_Addr & 0xFFFF) | (_iValue<<16); return;

View File

@ -69,17 +69,17 @@ void CPeripheralInterface::Read32(u32& _uReturnValue, const u32 _iAddress)
return;
case PI_FIFO_BASE:
LOG(PERIPHERALINTERFACE,"read cpu fifo base, value = %08x",Fifo_CPUBase);
INFO_LOG(PERIPHERALINTERFACE,"read cpu fifo base, value = %08x",Fifo_CPUBase);
_uReturnValue = Fifo_CPUBase;
return;
case PI_FIFO_END:
LOG(PERIPHERALINTERFACE,"read cpu fifo end, value = %08x",Fifo_CPUEnd);
INFO_LOG(PERIPHERALINTERFACE,"read cpu fifo end, value = %08x",Fifo_CPUEnd);
_uReturnValue = Fifo_CPUEnd;
return;
case PI_FIFO_WPTR:
LOGV(PERIPHERALINTERFACE, 3, "read writepointer, value = %08x",Fifo_CPUWritePointer);
DEBUG_LOG(PERIPHERALINTERFACE, "read writepointer, value = %08x",Fifo_CPUWritePointer);
_uReturnValue = Fifo_CPUWritePointer; //really writes in 32-byte chunks
// Monk's gcube does some crazy align trickery here.
@ -94,7 +94,7 @@ void CPeripheralInterface::Read32(u32& _uReturnValue, const u32 _iAddress)
return;
default:
LOG(PERIPHERALINTERFACE,"!!!!Unknown write!!!! 0x%08x", _iAddress);
ERROR_LOG(PERIPHERALINTERFACE,"!!!!Unknown write!!!! 0x%08x", _iAddress);
break;
}
@ -103,7 +103,7 @@ void CPeripheralInterface::Read32(u32& _uReturnValue, const u32 _iAddress)
void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
{
LOG(PERIPHERALINTERFACE, "(w32) 0x%08x @ 0x%08x", _uValue, _iAddress);
INFO_LOG(PERIPHERALINTERFACE, "(w32) 0x%08x @ 0x%08x", _uValue, _iAddress);
switch(_iAddress & 0xFFF)
{
case PI_INTERRUPT_CAUSE:
@ -113,23 +113,23 @@ void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
case PI_INTERRUPT_MASK:
m_InterruptMask = _uValue;
LOG(PERIPHERALINTERFACE,"New Interrupt mask: %08x",m_InterruptMask);
DEBUG_LOG(PERIPHERALINTERFACE,"New Interrupt mask: %08x",m_InterruptMask);
UpdateException();
return;
case PI_FIFO_BASE:
Fifo_CPUBase = _uValue & 0xFFFFFFE0;
LOG(PERIPHERALINTERFACE,"Fifo base = %08x", _uValue);
DEBUG_LOG(PERIPHERALINTERFACE,"Fifo base = %08x", _uValue);
break;
case PI_FIFO_END:
Fifo_CPUEnd = _uValue & 0xFFFFFFE0;
LOG(PERIPHERALINTERFACE,"Fifo end = %08x", _uValue);
DEBUG_LOG(PERIPHERALINTERFACE,"Fifo end = %08x", _uValue);
break;
case PI_FIFO_WPTR:
Fifo_CPUWritePointer = _uValue & 0xFFFFFFE0;
LOG(PERIPHERALINTERFACE,"Fifo writeptr = %08x", _uValue);
DEBUG_LOG(PERIPHERALINTERFACE,"Fifo writeptr = %08x", _uValue);
break;
case PI_FIFO_RESET:
@ -139,7 +139,7 @@ void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
case PI_RESET_CODE:
{
LOG(PERIPHERALINTERFACE,"PI Reset = %08x ???", _uValue);
INFO_LOG(PERIPHERALINTERFACE,"PI Reset = %08x ???", _uValue);
if ((_uValue != 0x80000001) && (_uValue != 0x80000005)) // DVDLowReset
{
@ -156,7 +156,7 @@ void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
break;
default:
LOG(PERIPHERALINTERFACE,"!!!!Unknown PI write!!!! 0x%08x", _iAddress);
ERROR_LOG(PERIPHERALINTERFACE,"!!!!Unknown PI write!!!! 0x%08x", _iAddress);
PanicAlert("Unknown write to PI: %08x", _iAddress);
break;
}
@ -201,12 +201,12 @@ void CPeripheralInterface::SetInterrupt(InterruptCause _causemask, bool _bSet)
if (_bSet && !(m_InterruptCause & (u32)_causemask))
{
LOGV(PERIPHERALINTERFACE, 2, "Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "set");
INFO_LOG(PERIPHERALINTERFACE, "Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "set");
}
if (!_bSet && (m_InterruptCause & (u32)_causemask))
{
LOGV(PERIPHERALINTERFACE, 2, "Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "clear");
INFO_LOG(PERIPHERALINTERFACE, "Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "clear");
}
if (_bSet)

View File

@ -86,22 +86,22 @@ void Init()
void Read16(u16& _uReturnValue, const u32 _iAddress)
{
LOGV(PIXELENGINE, 3, "(r16): 0x%08x", _iAddress);
DEBUG_LOG(PIXELENGINE, "(r16): 0x%08x", _iAddress);
switch (_iAddress & 0xFFF)
{
case CTRL_REGISTER:
_uReturnValue = g_ctrlReg.Hex;
LOG(PIXELENGINE,"\t CTRL_REGISTER : %04x", _uReturnValue);
INFO_LOG(PIXELENGINE,"\t CTRL_REGISTER : %04x", _uReturnValue);
return;
case TOKEN_REG:
_uReturnValue = CommandProcessor::fifo.PEToken;
LOG(PIXELENGINE,"\t TOKEN_REG : %04x", _uReturnValue);
INFO_LOG(PIXELENGINE,"\t TOKEN_REG : %04x", _uReturnValue);
return;
default:
LOG(PIXELENGINE,"(unknown)");
WARN_LOG(PIXELENGINE,"(unknown)");
break;
}
@ -110,12 +110,12 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOGV(PIXELENGINE, 2, "(w32): 0x%08x @ 0x%08x",_iValue,_iAddress);
INFO_LOG(PIXELENGINE, "(w32): 0x%08x @ 0x%08x",_iValue,_iAddress);
}
void Write16(const u16 _iValue, const u32 _iAddress)
{
LOGV(PIXELENGINE, 3, "(w16): 0x%04x @ 0x%08x",_iValue,_iAddress);
DEBUG_LOG(PIXELENGINE, "(w16): 0x%04x @ 0x%08x",_iValue,_iAddress);
switch(_iAddress & 0xFFF)
{
@ -175,7 +175,7 @@ void SetToken_OnMainThread(u64 userdata, int cyclesLate)
//{
g_bSignalTokenInterrupt = true;
//_dbg_assert_msg_(PIXELENGINE, (CommandProcessor::fifo.PEToken == (userdata&0xFFFF)), "WTF? BPMEM_PE_TOKEN_INT_ID's token != BPMEM_PE_TOKEN_ID's token" );
LOGV(PIXELENGINE, 1, "VIDEO Plugin raises INT_CAUSE_PE_TOKEN (btw, token: %04x)", CommandProcessor::fifo.PEToken);
WARN_LOG(PIXELENGINE, "VIDEO Plugin raises INT_CAUSE_PE_TOKEN (btw, token: %04x)", CommandProcessor::fifo.PEToken);
UpdateInterrupts();
//}
//else
@ -214,7 +214,7 @@ void SetFinish()
CommandProcessor::IncrementGPWDToken(); // for DC watchdog hack
CoreTiming::ScheduleEvent_Threadsafe(
0, et_SetFinishOnMainThread);
LOGV(PIXELENGINE, 2, "VIDEO Set Finish");
INFO_LOG(PIXELENGINE, "VIDEO Set Finish");
}
} // end of namespace PixelEngine

View File

@ -257,7 +257,7 @@ void Shutdown()
void Read32(u32& _uReturnValue, const u32 _iAddress)
{
LOGV(SERIALINTERFACE, 3, "(r32): 0x%08x", _iAddress);
DEBUG_LOG(SERIALINTERFACE, "(r32): 0x%08x", _iAddress);
// SIBuffer
if ((_iAddress >= 0xCC006480 && _iAddress < 0xCC006500) ||
@ -353,7 +353,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
case SI_EXI_CLOCK_COUNT: _uReturnValue = g_EXIClockCount.Hex; return;
default:
LOG(SERIALINTERFACE, "(r32-unk): 0x%08x", _iAddress);
INFO_LOG(SERIALINTERFACE, "(r32-unk): 0x%08x", _iAddress);
_dbg_assert_(SERIALINTERFACE,0);
break;
}
@ -364,7 +364,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOGV(SERIALINTERFACE, 3, "(w32): 0x%08x 0x%08x", _iValue,_iAddress);
DEBUG_LOG(SERIALINTERFACE, "(w32): 0x%08x 0x%08x", _iValue,_iAddress);
// SIBuffer
if ((_iAddress >= 0xCC006480 && _iAddress < 0xCC006500) ||
@ -462,7 +462,7 @@ void Write32(const u32 _iValue, const u32 _iAddress)
break;
case 0x80:
LOG(SERIALINTERFACE, "WII something at 0xCD006480");
INFO_LOG(SERIALINTERFACE, "WII something at 0xCD006480");
break;
default:
@ -557,7 +557,7 @@ void RunSIBuffer()
#endif
g_Channel[g_ComCSR.CHANNEL].m_pDevice->RunBuffer(g_SIBuffer, inLength);
LOGV(SERIALINTERFACE, 2, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput);
INFO_LOG(SERIALINTERFACE, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput);
// Transfer completed
GenerateSIInterrupt(INT_TCINT);

View File

@ -25,7 +25,7 @@
int ISIDevice::RunBuffer(u8* _pBuffer, int _iLength)
{
#ifdef _DEBUG
LOG(SERIALINTERFACE, "Send Data Device(%i) - Length(%i) ", ISIDevice::m_iDeviceNumber,_iLength);
DEBUG_LOG(SERIALINTERFACE, "Send Data Device(%i) - Length(%i) ", ISIDevice::m_iDeviceNumber,_iLength);
char szTemp[256] = "";
int num = 0;
@ -38,11 +38,11 @@ int ISIDevice::RunBuffer(u8* _pBuffer, int _iLength)
if ((num % 8) == 0)
{
LOG(SERIALINTERFACE, szTemp);
DEBUG_LOG(SERIALINTERFACE, szTemp);
szTemp[0] = '\0';
}
}
LOG(SERIALINTERFACE, szTemp);
DEBUG_LOG(SERIALINTERFACE, szTemp);
#endif
return 0;
};
@ -69,8 +69,8 @@ public:
return 4;
}
bool GetData(u32& _Hi, u32& _Low) {LOG(SERIALINTERFACE, "SI DUMMY %i GetData", this->m_iDeviceNumber); return false;}
void SendCommand(u32 _Cmd) {LOG(SERIALINTERFACE, "SI DUMMY %i SendCommand: %08x", this->m_iDeviceNumber, _Cmd);}
bool GetData(u32& _Hi, u32& _Low) {INFO_LOG(SERIALINTERFACE, "SI DUMMY %i GetData", this->m_iDeviceNumber); return false;}
void SendCommand(u32 _Cmd) {INFO_LOG(SERIALINTERFACE, "SI DUMMY %i SendCommand: %08x", this->m_iDeviceNumber, _Cmd);}
};
//////////////////////////////////////////////////////////////////////////
@ -92,6 +92,11 @@ ISIDevice* SIDevice_Create(TSIDevices _SIDevice, int _iDeviceNumber)
case SI_GBA:
return new CSIDevice_GBA(_iDeviceNumber);
break;
default:
return NULL;
break;
}
return NULL;
}

View File

@ -57,7 +57,7 @@ int CSIDevice_GBA::RunBuffer(u8* _pBuffer, int _iLength)
*(u32*)&_pBuffer[0] = SI_GBA;//|2;
iPosition = _iLength; // break the while loop
LOG(SERIALINTERFACE, "GBA %i CMD_RESET", this->m_iDeviceNumber);
INFO_LOG(SERIALINTERFACE, "GBA %i CMD_RESET", this->m_iDeviceNumber);
}
break;
case CMD_STATUS:
@ -70,7 +70,7 @@ int CSIDevice_GBA::RunBuffer(u8* _pBuffer, int _iLength)
*(u32*)&_pBuffer[0] = SI_GBA;//|8;
iPosition = _iLength; // break the while loop
LOG(SERIALINTERFACE, "GBA %i CMD_STATUS", this->m_iDeviceNumber);
INFO_LOG(SERIALINTERFACE, "GBA %i CMD_STATUS", this->m_iDeviceNumber);
}
break;
case CMD_WRITE:
@ -83,7 +83,7 @@ int CSIDevice_GBA::RunBuffer(u8* _pBuffer, int _iLength)
//Send to Upper 8bits of JOY_RECV_H
//Receive from lower 8bits of SIOSTAT register
LOG(SERIALINTERFACE, "GBA %i CMD_WRITE", this->m_iDeviceNumber);
INFO_LOG(SERIALINTERFACE, "GBA %i CMD_WRITE", this->m_iDeviceNumber);
}
break;
case CMD_READ:
@ -96,12 +96,12 @@ int CSIDevice_GBA::RunBuffer(u8* _pBuffer, int _iLength)
//Receive from Upper 8bits of JOY_TRANS_H
//Receive from lower 8bits of SIOSTAT register
LOG(SERIALINTERFACE, "GBA CMD_READ");
INFO_LOG(SERIALINTERFACE, "GBA CMD_READ");
}
break;
default:
{
LOG(SERIALINTERFACE, "GBA %i unknown command (0x%x)", this->m_iDeviceNumber, command);
WARN_LOG(SERIALINTERFACE, "GBA %i unknown command (0x%x)", this->m_iDeviceNumber, command);
iPosition = _iLength;
}
break;
@ -117,7 +117,7 @@ int CSIDevice_GBA::RunBuffer(u8* _pBuffer, int _iLength)
bool
CSIDevice_GBA::GetData(u32& _Hi, u32& _Low)
{
LOG(SERIALINTERFACE, "GBA %i GetData Hi: 0x%x Low: 0x%x", this->m_iDeviceNumber, _Hi, _Low);
INFO_LOG(SERIALINTERFACE, "GBA %i GetData Hi: 0x%x Low: 0x%x", this->m_iDeviceNumber, _Hi, _Low);
return true;
}
@ -128,5 +128,5 @@ CSIDevice_GBA::GetData(u32& _Hi, u32& _Low)
void
CSIDevice_GBA::SendCommand(u32 _Cmd)
{
LOG(SERIALINTERFACE, "GBA %i SendCommand: (0x%x)", this->m_iDeviceNumber, _Cmd);
INFO_LOG(SERIALINTERFACE, "GBA %i SendCommand: (0x%x)", this->m_iDeviceNumber, _Cmd);
}

View File

@ -67,7 +67,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
case CMD_ORIGIN:
{
LOG(SERIALINTERFACE, "PAD - Get Origin");
INFO_LOG(SERIALINTERFACE, "PAD - Get Origin");
u8* pCalibration = reinterpret_cast<u8*>(&m_origin);
for (int i = 0; i < (int)sizeof(SOrigin); i++)
{
@ -80,7 +80,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
// Recalibrate (FiRES: i am not 100 percent sure about this)
case CMD_RECALIBRATE:
{
LOG(SERIALINTERFACE, "PAD - Recalibrate");
INFO_LOG(SERIALINTERFACE, "PAD - Recalibrate");
u8* pCalibration = reinterpret_cast<u8*>(&m_origin);
for (int i = 0; i < (int)sizeof(SOrigin); i++)
{
@ -92,13 +92,13 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
// WII Something
case 0xCE:
LOG(SERIALINTERFACE, "Unknown Wii SI Command");
WARN_LOG(SERIALINTERFACE, "Unknown Wii SI Command");
break;
// DEFAULT
default:
{
LOG(SERIALINTERFACE, "unknown SI command (0x%x)", command);
ERROR_LOG(SERIALINTERFACE, "unknown SI command (0x%x)", command);
PanicAlert("SI: Unknown command");
iPosition = _iLength;
}
@ -165,7 +165,7 @@ CSIDevice_GCController::SendCommand(u32 _Cmd)
default:
{
LOG(SERIALINTERFACE, "unknown direct command (0x%x)", _Cmd);
ERROR_LOG(SERIALINTERFACE, "unknown direct command (0x%x)", _Cmd);
PanicAlert("SI: Unknown direct command");
}
break;

View File

@ -207,7 +207,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
return;
case VI_CONTROL_REGISTER:
LOGV(VIDEOINTERFACE, 3, "VideoInterface(r16): VI_CONTROL_REGISTER 0x%08x", m_VIDisplayControlRegister.Hex);
DEBUG_LOG(VIDEOINTERFACE, "VideoInterface(r16): VI_CONTROL_REGISTER 0x%08x", m_VIDisplayControlRegister.Hex);
_uReturnValue = m_VIDisplayControlRegister.Hex;
return;
@ -274,7 +274,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
void Write16(const u16 _iValue, const u32 _iAddress)
{
LOGV(VIDEOINTERFACE, 3, "(w16): 0x%04x, 0x%08x",_iValue,_iAddress);
DEBUG_LOG(VIDEOINTERFACE, "(w16): 0x%04x, 0x%08x",_iValue,_iAddress);
//Somewhere it sets screen width.. we need to communicate this to the gfx plugin...
@ -368,7 +368,7 @@ void Write16(const u16 _iValue, const u32 _iAddress)
void Read32(u32& _uReturnValue, const u32 _iAddress)
{
LOG(VIDEOINTERFACE, "(r32): 0x%08x", _iAddress);
INFO_LOG(VIDEOINTERFACE, "(r32): 0x%08x", _iAddress);
if ((_iAddress & 0xFFF) < 0x20)
{
@ -393,7 +393,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
LOG(VIDEOINTERFACE, "(w32): 0x%08x, 0x%08x",_iValue,_iAddress);
INFO_LOG(VIDEOINTERFACE, "(w32): 0x%08x, 0x%08x",_iValue,_iAddress);
// Allow 32-bit writes to the VI: although this is officially not
// allowed, the hardware seems to accept it (for example, DesktopMan GC

View File

@ -38,42 +38,42 @@ void Read32(u32& _rReturnValue, const u32 _Address)
{
// NAND Loader ... no idea
case 0x018:
LOGV(WII_IOB, 0, "IOP: Read32 from 0x18 = 0x%08x (NANDLoader)", _Address);
ERROR_LOG(WII_IOB, "IOP: Read32 from 0x18 = 0x%08x (NANDLoader)", _Address);
break;
// WiiMenu... no idea
case 0x24:
LOGV(WII_IOB, 0, "IOP: Read32 from 0x18 = 0x%08x (WiiMenu)", _Address);
ERROR_LOG(WII_IOB, "IOP: Read32 from 0x18 = 0x%08x (WiiMenu)", _Address);
break;
case 0xc0: // __VISendI2CData
_rReturnValue = 0;
LOGV(WII_IOB, 2, "IOP: Read32 from 0xc0 = 0x%08x (__VISendI2CData)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0xc0 = 0x%08x (__VISendI2CData)", _rReturnValue);
break;
case 0xc4: // __VISendI2CData
_rReturnValue = 0;
LOGV(WII_IOB, 2, "IOP: Read32 from 0xc4 = 0x%08x (__VISendI2CData)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0xc4 = 0x%08x (__VISendI2CData)", _rReturnValue);
break;
case 0xc8: // __VISendI2CData
_rReturnValue = 0;
LOGV(WII_IOB, 2, "IOP: Read32 from 0xc8 = 0x%08x (__VISendI2CData)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0xc8 = 0x%08x (__VISendI2CData)", _rReturnValue);
break;
case 0x180: // __AIClockInit
_rReturnValue = 0;
LOG(WII_IOB, "IOP: Read32 from 0x180 = 0x%08x (__AIClockInit)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0x180 = 0x%08x (__AIClockInit)", _rReturnValue);
return;
case 0x1CC: // __AIClockInit
_rReturnValue = 0;
LOG(WII_IOB, "IOP: Read32 from 0x1CC = 0x%08x (__AIClockInit)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0x1CC = 0x%08x (__AIClockInit)", _rReturnValue);
return;
case 0x1D0: // __AIClockInit
_rReturnValue = 0;
LOG(WII_IOB, "IOP: Read32 from 0x1D0 = 0x%08x (__AIClockInit)", _rReturnValue);
INFO_LOG(WII_IOB, "IOP: Read32 from 0x1D0 = 0x%08x (__AIClockInit)", _rReturnValue);
return;
default:
@ -103,35 +103,35 @@ void Write32(const u32 _Value, const u32 _Address)
{
// NANDLoader ... no idea
case 0x18:
LOGV(WII_IOB, 0, "IOP: Write32 0x%08x to 0x%08x (NANDLoader)", _Value, _Address);
ERROR_LOG(WII_IOB, 0, "IOP: Write32 0x%08x to 0x%08x (NANDLoader)", _Value, _Address);
break;
// WiiMenu... no idea
case 0x24:
LOGV(WII_IOB, 0, "IOP: Write32 0x%08x to 0x%08x (WiiMenu)", _Value, _Address);
ERROR_LOG(WII_IOB, "IOP: Write32 0x%08x to 0x%08x (WiiMenu)", _Value, _Address);
break;
case 0xc0: // __VISendI2CData
LOGV(WII_IOB, 2, "IOP: Write32 to 0xc0 = 0x%08x (__VISendI2CData)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0xc0 = 0x%08x (__VISendI2CData)", _Value);
break;
case 0xc4: // __VISendI2CData
LOGV(WII_IOB, 2, "IOP: Write32 to 0xc4 = 0x%08x (__VISendI2CData)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0xc4 = 0x%08x (__VISendI2CData)", _Value);
break;
case 0xc8: // __VISendI2CData
LOGV(WII_IOB, 2, "IOP: Write32 to 0xc8 = 0x%08x (__VISendI2CData)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0xc8 = 0x%08x (__VISendI2CData)", _Value);
break;
case 0x180: // __AIClockInit
LOG(WII_IOB, "IOP: Write32 to 0x180 = 0x%08x (__AIClockInit)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0x180 = 0x%08x (__AIClockInit)", _Value);
return;
case 0x1CC: // __AIClockInit
LOG(WII_IOB, "IOP: Write32 to 0x1D0 = 0x%08x (__AIClockInit)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0x1D0 = 0x%08x (__AIClockInit)", _Value);
return;
case 0x1D0: // __AIClockInit
LOG(WII_IOB, "IOP: Write32 to 0x1D0 = 0x%08x (__AIClockInit)", _Value);
INFO_LOG(WII_IOB, "IOP: Write32 to 0x1D0 = 0x%08x (__AIClockInit)", _Value);
return;
default:

View File

@ -129,7 +129,7 @@ void Read32(u32& _rReturnValue, const u32 _Address)
_rReturnValue = g_IPC_Control.Hex;
LOGV(WII_IPC, 2, "IOP: Read32 from IPC_CONTROL_REGISTER(0x04) = 0x%08x", _rReturnValue);
INFO_LOG(WII_IPC, "IOP: Read32 from IPC_CONTROL_REGISTER(0x04) = 0x%08x", _rReturnValue);
// if ((REASON_REG & 0x14) == 0x14) CALL IPCReplayHanlder
// if ((REASON_REG & 0x22) != 0x22) Jumps to the end
@ -138,7 +138,7 @@ void Read32(u32& _rReturnValue, const u32 _Address)
case IPC_REPLY_REGISTER: // looks a little bit like a callback function
_rReturnValue = g_Reply;
LOGV(WII_IPC, 2, "IOP: Write32 to IPC_REPLAY_REGISTER(0x08) = 0x%08x ", _rReturnValue);
INFO_LOG(WII_IPC, "IOP: Write32 to IPC_REPLAY_REGISTER(0x08) = 0x%08x ", _rReturnValue);
break;
case IPC_SENSOR_BAR_POWER_REGISTER:
@ -159,13 +159,13 @@ void Write32(const u32 _Value, const u32 _Address)
case IPC_COMMAND_REGISTER: // __ios_Ipc2 ... a value from __responses is loaded
{
g_Address = _Value;
LOGV(WII_IPC, 1, "IOP: Write32 to IPC_ADDRESS_REGISTER(0x00) = 0x%08x", g_Address);
WARN_LOG(WII_IPC, "IOP: Write32 to IPC_ADDRESS_REGISTER(0x00) = 0x%08x", g_Address);
}
break;
case IPC_CONTROL_REGISTER:
{
LOGV(WII_IPC, 1, "IOP: Write32 to IPC_CONTROL_REGISTER(0x04) = 0x%08x (old: 0x%08x)", _Value, g_IPC_Control.Hex);
WARN_LOG(WII_IPC, "IOP: Write32 to IPC_CONTROL_REGISTER(0x04) = 0x%08x (old: 0x%08x)", _Value, g_IPC_Control.Hex);
UIPC_Control TempControl(_Value);
_dbg_assert_msg_(WII_IPC, TempControl.pad == 0, "IOP: Write to UIPC_Control.pad", _Address);
@ -190,13 +190,13 @@ void Write32(const u32 _Value, const u32 _Address)
UIPC_Status NewStatus(_Value);
if (NewStatus.INTERRUPT) g_IPC_Status.INTERRUPT = 0; // clear interrupt
LOGV(WII_IPC, 1, "IOP: Write32 to IPC_STATUS_REGISTER(0x30) = 0x%08x", _Value);
WARN_LOG(WII_IPC, "IOP: Write32 to IPC_STATUS_REGISTER(0x30) = 0x%08x", _Value);
}
break;
case IPC_CONFIG_REGISTER: // __OSInterruptInit (0x40000000)
{
LOG(WII_IPC, "IOP: Write32 to IPC_CONFIG_REGISTER(0x33) = 0x%08x", _Value);
INFO_LOG(WII_IPC, "IOP: Write32 to IPC_CONFIG_REGISTER(0x33) = 0x%08x", _Value);
g_IPC_Config.Hex = _Value;

View File

@ -210,13 +210,14 @@ IWII_IPC_HLE_Device* CreateDevice(u32 _DeviceID, const std::string& _rDeviceName
}
else
{
ERROR_LOG(WII_IPC_FILEIO, "Unknown device: %s", _rDeviceName.c_str());
PanicAlert("Unknown device: %s", _rDeviceName.c_str());
pDevice = new CWII_IPC_HLE_Device_Error(u32(-1), _rDeviceName);
}
}
else
{
LOGV(WII_IPC_FILEIO, 0, "IOP: Create Device %s", _rDeviceName.c_str());
INFO_LOG(WII_IPC_FILEIO, "IOP: Create Device %s", _rDeviceName.c_str());
pDevice = new CWII_IPC_HLE_Device_FileIO(_DeviceID, _rDeviceName);
}
@ -233,13 +234,14 @@ IWII_IPC_HLE_Device* CreateDevice(u32 _DeviceID, const std::string& _rDeviceName
bool AckCommand(u32 _Address)
{
Debugger::PrintCallstack(LogTypes::WII_IPC_HLE);
LOGV(WII_IPC_HLE, 1, "AckCommand: 0%08x (num: %i) PC=0x%08x", _Address, g_AckNumber, PC);
WARN_LOG(WII_IPC_HLE, "AckCommand: 0%08x (num: %i) PC=0x%08x", _Address, g_AckNumber, PC);
std::list<u32>::iterator itr = g_Ack.begin();
while (itr != g_Ack.end())
{
if (*itr == _Address)
{
ERROR_LOG(WII_IPC_HLE, "execute a command two times");
PanicAlert("execute a command two times");
return false;
}
@ -270,11 +272,11 @@ void CopySettingsFile(std::string DeviceName)
if (File::Copy(Source.c_str(), Target.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: Copied %s to %s", Source.c_str(), Target.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: Copied %s to %s", Source.c_str(), Target.c_str());
}
else
{
LOG(WII_IPC_FILEIO, "Could not copy %s to %s", Source.c_str(), Target.c_str());
ERROR_LOG(WII_IPC_FILEIO, "Could not copy %s to %s", Source.c_str(), Target.c_str());
PanicAlert("Could not copy %s to %s", Source.c_str(), Target.c_str());
}
}
@ -315,12 +317,12 @@ void ExecuteCommand(u32 _Address)
if(pDevice->GetDeviceName().find("/dev/") == std::string::npos
|| pDevice->GetDeviceName().c_str() == std::string("/dev/fs"))
{
LOG(WII_IPC_FILEIO, "IOP: Open (Device=%s, DeviceID=%08x, Mode=%i, GenerateReply=%i)",
INFO_LOG(WII_IPC_FILEIO, "IOP: Open (Device=%s, DeviceID=%08x, Mode=%i, GenerateReply=%i)",
pDevice->GetDeviceName().c_str(), CurrentDeviceID, Mode, (int)GenerateReply);
}
else
{
LOG(WII_IPC_HLE, "IOP: Open (Device=%s, DeviceID=%08x, Mode=%i)",
INFO_LOG(WII_IPC_HLE, "IOP: Open (Device=%s, DeviceID=%08x, Mode=%i)",
pDevice->GetDeviceName().c_str(), CurrentDeviceID, Mode);
}
}
@ -337,7 +339,7 @@ void ExecuteCommand(u32 _Address)
// F|RES: prolly the re-open is just a mode change
LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)",
INFO_LOG(WII_IPC_FILEIO, "IOP: ReOpen (Device=%s, DeviceID=%08x, Mode=%i)",
pDevice->GetDeviceName().c_str(), DeviceID, Mode);
if(DeviceName.find("/dev/") == std::string::npos)
@ -453,7 +455,7 @@ void ExecuteCommand(u32 _Address)
// Write reply, this will later be executed in Update()
g_ReplyQueue.push(std::pair<u32, std::string>(_Address, pDevice->GetDeviceName()));
} else {
LOG(WII_IPC_HLE, "IOP: Reply to unknown device ID (DeviceID=%i)", DeviceID);
WARN_LOG(WII_IPC_HLE, "IOP: Reply to unknown device ID (DeviceID=%i)", DeviceID);
g_ReplyQueue.push(std::pair<u32, std::string>(_Address, "unknown"));
}
@ -507,9 +509,9 @@ void Update()
{
u32 _Address = g_Ack.front();
g_Ack.pop_front();
LOGV(WII_IPC_HLE, 1, "-- Exeute Ack (0x%08x)", _Address);
WARN_LOG(WII_IPC_HLE, "-- Exeute Ack (0x%08x)", _Address);
ExecuteCommand(_Address);
LOGV(WII_IPC_HLE, 1, "-- End of ExecuteAck (0x%08x)", _Address);
WARN_LOG(WII_IPC_HLE, "-- End of ExecuteAck (0x%08x)", _Address);
// Go back to WII_IPC.cpp and generate an acknowledgement
WII_IPCInterface::GenerateAck(_Address);

View File

@ -77,9 +77,9 @@ bool CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress)
{
LOGV(WII_IPC_DVD, 1, "*******************************");
LOGV(WII_IPC_DVD, 1, "CWII_IPC_DVD_Device_di::IOCtl");
LOGV(WII_IPC_DVD, 1, "*******************************");
INFO_LOG(WII_IPC_DVD, "*******************************");
INFO_LOG(WII_IPC_DVD, "CWII_IPC_DVD_Device_di::IOCtl");
INFO_LOG(WII_IPC_DVD, "*******************************");
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
@ -88,7 +88,7 @@ bool CWII_IPC_HLE_Device_di::IOCtl(u32 _CommandAddress)
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
u32 Command = Memory::Read_U32(BufferIn) >> 24;
LOG(WII_IPC_DVD, "%s - Command(0x%08x) BufferIn(0x%08x, 0x%x) BufferOut(0x%08x, 0x%x)", GetDeviceName().c_str(), Command, BufferIn, BufferInSize, BufferOut, BufferOutSize);
DEBUG_LOG(WII_IPC_DVD, "%s - Command(0x%08x) BufferIn(0x%08x, 0x%x) BufferOut(0x%08x, 0x%x)", GetDeviceName().c_str(), Command, BufferIn, BufferInSize, BufferOut, BufferOutSize);
u32 ReturnValue = ExecuteCommand(BufferIn, BufferInSize, BufferOut, BufferOutSize);
Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);
@ -109,12 +109,12 @@ bool CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
// DVDLowOpenPartition???
case 0x8b:
{
LOG(WII_IPC_DVD, "DVD IOCtlV: DVDLowOpenPartition");
INFO_LOG(WII_IPC_DVD, "DVD IOCtlV: DVDLowOpenPartition");
_dbg_assert_msg_(WII_IPC_DVD, 0, "DVD IOCtlV: DVDLowOpenPartition");
}
break;
default:
LOG(WII_IPC_DVD, "DVD IOCtlV: %i", CommandBuffer.Parameter);
INFO_LOG(WII_IPC_DVD, "DVD IOCtlV: %i", CommandBuffer.Parameter);
_dbg_assert_msg_(WII_IPC_DVD, 0, "DVD: %i", CommandBuffer.Parameter);
break;
}
@ -159,7 +159,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
buffer[6] = 0x08;
buffer[7] = 0x29;
LOG(WII_IPC_DVD, "%s executes DVDLowInquiry (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
DEBUG_LOG(WII_IPC_DVD, "%s executes DVDLowInquiry (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
return 0x1;
}
@ -171,7 +171,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
// TODO - verify that this is correct
VolumeHandler::ReadToPtr(Memory::GetPointer(_BufferOut), 0, _BufferOutSize);
LOG(WII_IPC_DVD, "%s executes DVDLowReadDiskID (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
DEBUG_LOG(WII_IPC_DVD, "%s executes DVDLowReadDiskID (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
return 0x1;
}
@ -191,11 +191,11 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
const char *pFilename = m_pFileSystem->GetFileName(DVDAddress);
if (pFilename != NULL)
{
LOG(WII_IPC_DVD, " DVDLowRead: %s (0x%x) - (DVDAddr: 0x%x, Size: 0x%x)", pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress, Size);
INFO_LOG(WII_IPC_DVD, " DVDLowRead: %s (0x%x) - (DVDAddr: 0x%x, Size: 0x%x)", pFilename, m_pFileSystem->GetFileSize(pFilename), DVDAddress, Size);
}
else
{
LOG(WII_IPC_DVD, " DVDLowRead: file unkw - (DVDAddr: 0x%x, Size: 0x%x)", GetDeviceName().c_str(), DVDAddress, Size);
INFO_LOG(WII_IPC_DVD, " DVDLowRead: file unkw - (DVDAddr: 0x%x, Size: 0x%x)", GetDeviceName().c_str(), DVDAddress, Size);
}
if (Size > _BufferOutSize)
@ -226,7 +226,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
case 0x79:
{
Memory::Memset(_BufferOut, 0, _BufferOutSize);
LOG(WII_IPC_DVD, "%s executes DVDLowWaitForCoverClose (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "%s executes DVDLowWaitForCoverClose (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
return 4;
}
break;
@ -234,7 +234,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
// DVDLowGetCoverReg - Called by "Legend of Spyro" and MP3
case 0x7a:
{
LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverReg (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverReg (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
// Write zeroes to the out buffer just in case there is some nonsense data there
Memory::Memset(_BufferOut, 0, _BufferOutSize);
@ -266,7 +266,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
case 0x86:
{
Memory::Memset(_BufferOut, 0, _BufferOutSize);
LOGV(WII_IPC_DVD, 1, "%s executes DVDLowClearCoverInterrupt (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
WARN_LOG(WII_IPC_DVD, "%s executes DVDLowClearCoverInterrupt (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
}
break;
@ -274,7 +274,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
case 0x88:
{
Memory::Memset(_BufferOut, 0, _BufferOutSize);
LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverStatus (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverStatus (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
return 1;
}
break;
@ -283,7 +283,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
case 0x8a:
{
Memory::Memset(_BufferOut, 0, _BufferOutSize);
LOG(WII_IPC_DVD, "%s executes DVDLowReset (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "%s executes DVDLowReset (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
return 1;
}
break;
@ -337,18 +337,18 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
Memory::Memset(_BufferOut, 0, _BufferOutSize);
u32 eject = Memory::Read_U32(_BufferIn + 0x04);
LOG(WII_IPC_DVD, "%s executes DVDLowStopMotor (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "%s executes DVDLowStopMotor (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
if(eject)
{
LOG(WII_IPC_DVD, "Eject disc", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
INFO_LOG(WII_IPC_DVD, "Eject disc", GetDeviceName().c_str(), _BufferOut, _BufferOutSize);
// TODO: eject the disc
}
}
break;
default:
LOG(WII_IPC_DVD, "%s executes unknown cmd 0x%08x (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), Command, _BufferOut, _BufferOutSize);
ERROR_LOG(WII_IPC_DVD, "%s executes unknown cmd 0x%08x (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), Command, _BufferOut, _BufferOutSize);
PanicAlert("%s executes unknown cmd 0x%08x", GetDeviceName().c_str(), Command);
break;

View File

@ -59,7 +59,7 @@ bool
CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress)
{
u32 DeviceID = Memory::Read_U32(_CommandAddress + 8);
LOG(WII_IPC_FILEIO, "FileIO: Close %s (DeviceID=%08x)", GetDeviceName().c_str(), DeviceID);
INFO_LOG(WII_IPC_FILEIO, "FileIO: Close %s (DeviceID=%08x)", GetDeviceName().c_str(), DeviceID);
// Close always return 0 for success
Memory::Write_U32(0, _CommandAddress + 4);
@ -85,7 +85,7 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
{ "Read and Write" }
};
LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s)", GetDeviceName().c_str(), Modes[_Mode]);
INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s)", GetDeviceName().c_str(), Modes[_Mode]);
m_Filename = std::string(HLE_IPC_BuildFilename(GetDeviceName().c_str(), 64));
@ -109,7 +109,7 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
}
else
{
LOG(WII_IPC_FILEIO, " failed - File doesn't exist");
ERROR_LOG(WII_IPC_FILEIO, " failed - File doesn't exist");
ReturnValue = -106;
}
@ -124,7 +124,7 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
u32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
u32 Mode = Memory::Read_U32(_CommandAddress +0x10);
LOG(WII_IPC_FILEIO, "FileIO: Old Seek Pos: %s, Mode: %i (Device=%s, FileSize=%s)", ThS(SeekPosition).c_str(), Mode, GetDeviceName().c_str(), ThS(m_FileLength).c_str());
INFO_LOG(WII_IPC_FILEIO, "FileIO: Old Seek Pos: %s, Mode: %i (Device=%s, FileSize=%s)", ThS(SeekPosition).c_str(), Mode, GetDeviceName().c_str(), ThS(m_FileLength).c_str());
/* Zelda - TP Fix: It doesn't make much sense but it works in Zelda - TP and
it's probably better than trying to read outside the file (it seeks to 0x6000 instead
@ -138,10 +138,10 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
if (m_FileLength > 0 && SeekPosition > m_FileLength && Mode == 0)
{
NewSeekPosition = SeekPosition % m_FileLength;
LOG(WII_IPC_FILEIO, "***********************************:");
INFO_LOG(WII_IPC_FILEIO, "***********************************:");
}
LOG(WII_IPC_FILEIO, "FileIO: New Seek Pos: %s, Mode: %i (Device=%s)", ThS(NewSeekPosition).c_str(), Mode, GetDeviceName().c_str());
INFO_LOG(WII_IPC_FILEIO, "FileIO: New Seek Pos: %s, Mode: %i (Device=%s)", ThS(NewSeekPosition).c_str(), Mode, GetDeviceName().c_str());
// Set seek mode
int seek_mode[3] = {SEEK_SET, SEEK_CUR, SEEK_END};
@ -155,9 +155,10 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
// What should we return for Zelda, the new correct or old incorrect seek position?
ReturnValue = SeekPosition;
} else {
LOG(WII_IPC_FILEIO, "FILEIO: Seek failed");
ERROR_LOG(WII_IPC_FILEIO, "FILEIO: Seek failed");
}
} else {
ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_FileIO unsupported seek mode %i", Mode);
PanicAlert("CWII_IPC_HLE_Device_FileIO unsupported seek mode %i", Mode);
}
@ -175,13 +176,13 @@ CWII_IPC_HLE_Device_FileIO::Read(u32 _CommandAddress)
if (m_pFileHandle != NULL)
{
LOG(WII_IPC_FILEIO, "FileIO: Read 0x%x bytes to 0x%08x from %s", Size, Address, GetDeviceName().c_str());
INFO_LOG(WII_IPC_FILEIO, "FileIO: Read 0x%x bytes to 0x%08x from %s", Size, Address, GetDeviceName().c_str());
size_t readItems = fread(Memory::GetPointer(Address), 1, Size, m_pFileHandle);
ReturnValue = (u32)readItems;
}
else
{
LOG(WII_IPC_FILEIO, "FileIO failed to read from %s (Addr=0x%08x Size=0x%x) - file not open", GetDeviceName().c_str(), Address, Size);
ERROR_LOG(WII_IPC_FILEIO, "FileIO failed to read from %s (Addr=0x%08x Size=0x%x) - file not open", GetDeviceName().c_str(), Address, Size);
}
Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);
@ -196,7 +197,7 @@ CWII_IPC_HLE_Device_FileIO::Write(u32 _CommandAddress)
u32 Address = Memory::Read_U32(_CommandAddress +0xC); // Write data from this memory address
u32 Size = Memory::Read_U32(_CommandAddress +0x10);
LOG(WII_IPC_FILEIO, "FileIO: Write 0x%04x bytes to 0x%08x from %s", Size, Address, GetDeviceName().c_str());
INFO_LOG(WII_IPC_FILEIO, "FileIO: Write 0x%04x bytes to 0x%08x from %s", Size, Address, GetDeviceName().c_str());
if (m_pFileHandle)
{
@ -213,7 +214,7 @@ CWII_IPC_HLE_Device_FileIO::Write(u32 _CommandAddress)
bool
CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
{
LOG(WII_IPC_FILEIO, "FileIO: IOCtl (Device=%s)", GetDeviceName().c_str());
INFO_LOG(WII_IPC_FILEIO, "FileIO: IOCtl (Device=%s)", GetDeviceName().c_str());
DumpCommands(_CommandAddress);
u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC);
@ -230,8 +231,8 @@ CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
u32 Position = (u32)ftell(m_pFileHandle);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
LOG(WII_IPC_FILEIO, "FileIO: ISFS_IOCTL_GETFILESTATS");
LOG(WII_IPC_FILEIO, " Length: %i Seek: %i", m_FileLength, Position);
INFO_LOG(WII_IPC_FILEIO, "FileIO: ISFS_IOCTL_GETFILESTATS");
INFO_LOG(WII_IPC_FILEIO, " Length: %i Seek: %i", m_FileLength, Position);
Memory::Write_U32((u32)m_FileLength, BufferOut);
Memory::Write_U32(Position, BufferOut+4);
@ -240,6 +241,7 @@ CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
default:
{
ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_FileIO: Parameter %i", Parameter);
PanicAlert("CWII_IPC_HLE_Device_FileIO: Parameter %i", Parameter);
}
break;

View File

@ -74,7 +74,7 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string&
m_TitleID = ((u64)0x00010000 << 32) | 0xF00DBEEF;
}
LOG(WII_IPC_ES, "Set default title to %08x/%08x", m_TitleID>>32, m_TitleID);
INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", m_TitleID>>32, m_TitleID);
}
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
@ -90,7 +90,7 @@ bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress)
{
LOG(WII_IPC_ES, "ES: Close");
INFO_LOG(WII_IPC_ES, "ES: Close");
Memory::Write_U32(0, _CommandAddress + 4);
return true;
}
@ -99,7 +99,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
{
SIOCtlVBuffer Buffer(_CommandAddress);
LOG(WII_IPC_ES, "%s (0x%x)", GetDeviceName().c_str(), Buffer.Parameter);
INFO_LOG(WII_IPC_ES, "%s (0x%x)", GetDeviceName().c_str(), Buffer.Parameter);
// Prepare the out buffer(s) with zeroes as a safety precaution
// to avoid returning bad values
@ -123,7 +123,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(CFD, _CommandAddress + 0x4);
LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", TitleID>>32, TitleID, Index, CFD);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", TitleID>>32, TitleID, Index, CFD);
return true;
}
break;
@ -139,7 +139,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(CFD, _CommandAddress + 0x4);
LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD);
return true;
}
break;
@ -169,7 +169,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
rContent.m_Position += Size;
}
LOG(WII_IPC_ES, "ES: IOCTL_ES_READCONTENT: CFD %x, Addr 0x%x, Size %i -> stream pos %i", CFD, Addr, Size, rContent.m_Position);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_READCONTENT: CFD %x, Addr 0x%x, Size %i -> stream pos %i", CFD, Addr, Size, rContent.m_Position);
Memory::Write_U32(Size, _CommandAddress + 0x4);
return true;
@ -184,7 +184,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
CContentAccessMap::iterator itr = m_ContentAccessMap.find(CFD);
m_ContentAccessMap.erase(itr);
LOG(WII_IPC_ES, "ES: IOCTL_ES_CLOSECONTENT: CFD %x", CFD);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_CLOSECONTENT: CFD %x", CFD);
Memory::Write_U32(0, _CommandAddress + 0x4);
return true;
@ -215,7 +215,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
break;
}
LOG(WII_IPC_ES, "ES: IOCTL_ES_SEEKCONTENT: CFD %x, Addr 0x%x, Mode %i -> Pos %i", CFD, Addr, Mode, rContent.m_Position);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SEEKCONTENT: CFD %x, Addr 0x%x, Mode %i -> Pos %i", CFD, Addr, Mode, rContent.m_Position);
Memory::Write_U32(rContent.m_Position, _CommandAddress + 0x4);
return true;
@ -230,7 +230,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
char* Path = (char*)Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
sprintf(Path, "/%08x/%08x/data", (TitleID >> 32) & 0xFFFFFFFF, TitleID & 0xFFFFFFFF);
LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s)", Path);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s)", Path);
}
break;
@ -239,7 +239,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no out buffer");
Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address);
LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: %08x/%08x", m_TitleID>>32, m_TitleID);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: %08x/%08x", m_TitleID>>32, m_TitleID);
}
break;
@ -248,7 +248,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no in buffer");
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
LOG(WII_IPC_ES, "ES: IOCTL_ES_SETUID titleID: %08x/%08x", TitleID>>32, TitleID );
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SETUID titleID: %08x/%08x", TitleID>>32, TitleID );
}
break;
@ -269,7 +269,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(0, Buffer.PayloadBuffer[0].m_Address);
}
LOG(WII_IPC_ES, "ES: IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x", TitleID>>32, TitleID );
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x", TitleID>>32, TitleID );
Memory::Write_U32(0, _CommandAddress + 0x4);
return true;
@ -286,7 +286,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
// TODO
Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address);
LOGV(WII_IPC_ES, 0, "IOCTL_ES_GETTITLECNT: TODO... 1");
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECNT: TODO... 1");
}
break;
@ -306,7 +306,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
for (int i = 0; i < (int)TitleIDs.size(); i++)
{
Memory::Write_U64(TitleIDs[i], Buffer.PayloadBuffer[0].m_Address + i*8);
LOGV(WII_IPC_ES, 0, "IOCTL_ES_GETTITLES: %08x/%08x", TitleIDs[i] >> 32, TitleIDs[i]);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLES: %08x/%08x", TitleIDs[i] >> 32, TitleIDs[i]);
}
}
break;
@ -336,7 +336,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
Memory::Write_U32(0, _CommandAddress + 0x4);
LOGV(WII_IPC_ES, 0, "IOCTL_ES_LAUNCH");
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH");
return true;
}
@ -376,7 +376,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETVIEWS: this looks really wrong...");
LOGV(WII_IPC_ES, 0, "IOCTL_ES_LAUNCH");
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH");
return true;
}
break;
@ -413,7 +413,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
_dbg_assert_msg_(WII_IPC_ES, 0, "CWII_IPC_HLE_Device_es: 0x%x", Buffer.Parameter);
DumpCommands(_CommandAddress, 8);
LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:"
INFO_LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:"
"Parameter: 0x%08x", Buffer.Parameter);
break;

View File

@ -97,7 +97,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
std::string Filename(HLE_IPC_BuildFilename((const char*)Memory::GetPointer(
CommandBuffer.InBuffer[0].m_Address), CommandBuffer.InBuffer[0].m_Size));
LOG(WII_IPC_FILEIO, "FS: IOCTL_READ_DIR %s", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: IOCTL_READ_DIR %s", Filename.c_str());
/* Check if this is really a directory. Or a file, because it seems like Mario Kart
did a IOCTL_READ_DIR on the save file to check if it existed before deleting it,
@ -114,7 +114,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
if (!File::Exists(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, " directory does not exist - return FS_DIRFILE_NOT_FOUND", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, " directory does not exist - return FS_DIRFILE_NOT_FOUND", Filename.c_str());
ReturnValue = FS_DIRFILE_NOT_FOUND;
break;
}
@ -122,7 +122,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
I have not seen any example of this. */
else if (!File::IsDirectory(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, " Not a directory - return FS_INVALID_ARGUMENT", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, " Not a directory - return FS_INVALID_ARGUMENT", Filename.c_str());
ReturnValue = FS_INVALID_ARGUMENT;
break;
}
@ -140,7 +140,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
if ((CommandBuffer.InBuffer.size() == 1) && (CommandBuffer.PayloadBuffer.size() == 1))
{
size_t numFile = FileSearch.GetFileNames().size();
LOG(WII_IPC_FILEIO, " Files in directory: %i", numFile);
INFO_LOG(WII_IPC_FILEIO, " Files in directory: %i", numFile);
Memory::Write_U32((u32)numFile, CommandBuffer.PayloadBuffer[0].m_Address);
}
@ -167,7 +167,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
*pFilename++ = 0x00; // termination
numFiles++;
LOG(WII_IPC_FILEIO, " %s", CompleteFilename.c_str());
INFO_LOG(WII_IPC_FILEIO, " %s", CompleteFilename.c_str());
}
Memory::Write_U32((u32)numFiles, CommandBuffer.PayloadBuffer[1].m_Address);
@ -192,7 +192,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
u32 fsBlock = 0;
u32 iNodes = 0;
LOGV(WII_IPC_FILEIO, 1, "FS: IOCTL_GETUSAGE %s", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, "FS: IOCTL_GETUSAGE %s", Filename.c_str());
if (File::IsDirectory(Filename.c_str()))
{
// make a file search
@ -215,7 +215,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
ReturnValue = FS_RESULT_OK;
LOGV(WII_IPC_FILEIO, 1, " fsBlock: %i, iNodes: %i", fsBlock, iNodes);
WARN_LOG(WII_IPC_FILEIO, " fsBlock: %i, iNodes: %i", fsBlock, iNodes);
}
else
{
@ -224,7 +224,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
ReturnValue = FS_RESULT_OK;
// PanicAlert("IOCTL_GETUSAGE - unk dir %s", Filename.c_str());
LOGV(WII_IPC_FILEIO, 1, " error: not executed on a valid directoy: %s", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, " error: not executed on a valid directoy: %s", Filename.c_str());
}
Memory::Write_U32(fsBlock, CommandBuffer.PayloadBuffer[0].m_Address);
@ -281,8 +281,8 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
{
_dbg_assert_(WII_IPC_FILEIO, _BufferOutSize == 28);
LOG(WII_IPC_FILEIO, "FS: GET STATS - no idea what we have to return here, prolly the free memory etc:)");
LOG(WII_IPC_FILEIO, " InBufferSize: %i OutBufferSize: %i", _BufferInSize, _BufferOutSize);
WARN_LOG(WII_IPC_FILEIO, "FS: GET STATS - no idea what we have to return here, prolly the free memory etc:)");
WARN_LOG(WII_IPC_FILEIO, " InBufferSize: %i OutBufferSize: %i", _BufferInSize, _BufferOutSize);
// This happens in Tatsonuko vs Capcom.
//PanicAlert("GET_STATS");
@ -310,7 +310,7 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
Addr += 9; // owner attribs, permission
u8 Attribs = Memory::Read_U8(Addr);
LOG(WII_IPC_FILEIO, "FS: CREATE_DIR %s", DirName.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: CREATE_DIR %s", DirName.c_str());
DirName += DIR_SEP;
File::CreateFullPath(DirName.c_str());
@ -332,13 +332,13 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
u8 OtherPerm = Memory::Read_U8(Addr); Addr += 1;
u8 Attributes = Memory::Read_U8(Addr); Addr += 1;
LOGV(WII_IPC_FILEIO, 0, "FS: SetAttrib %s", Filename.c_str());
LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID);
LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID);
LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm);
LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm);
LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm);
LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes);
INFO_LOG(WII_IPC_FILEIO, "FS: SetAttrib %s", Filename.c_str());
DEBUG_LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID);
DEBUG_LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID);
DEBUG_LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm);
DEBUG_LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm);
DEBUG_LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm);
DEBUG_LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes);
return FS_RESULT_OK;
}
@ -359,17 +359,17 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
u8 Attributes = 0x00; // no attributes
if (File::IsDirectory(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: GET_ATTR Directory %s - all permission flags are set", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR Directory %s - all permission flags are set", Filename.c_str());
}
else
{
if (File::Exists(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: GET_ATTR %s - all permission flags are set", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR %s - all permission flags are set", Filename.c_str());
}
else
{
LOG(WII_IPC_FILEIO, "FS: GET_ATTR unknown %s", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR unknown %s", Filename.c_str());
return FS_FILE_NOT_EXIST;
}
}
@ -401,15 +401,15 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
Offset += 64;
if (File::Delete(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: DeleteFile %s", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: DeleteFile %s", Filename.c_str());
}
else if (File::DeleteDir(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: DeleteDir %s", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: DeleteDir %s", Filename.c_str());
}
else
{
LOG(WII_IPC_FILEIO, "FS: DeleteFile %s - failed!!!", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, "FS: DeleteFile %s - failed!!!", Filename.c_str());
}
return FS_RESULT_OK;
@ -439,11 +439,11 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
// finally try to rename the file
if (File::Rename(Filename.c_str(), FilenameRename.c_str()))
{
LOG(WII_IPC_FILEIO, "FS: Rename %s to %s", Filename.c_str(), FilenameRename.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: Rename %s to %s", Filename.c_str(), FilenameRename.c_str());
}
else
{
LOG(WII_IPC_FILEIO, "FS: Rename %s to %s - failed", Filename.c_str(), FilenameRename.c_str());
ERROR_LOG(WII_IPC_FILEIO, "FS: Rename %s to %s - failed", Filename.c_str(), FilenameRename.c_str());
PanicAlert("CWII_IPC_HLE_Device_fs: rename %s to %s failed", Filename.c_str(), FilenameRename.c_str());
}
@ -464,18 +464,18 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
u8 OtherPerm = Memory::Read_U8(Addr); Addr++;
u8 Attributes = Memory::Read_U8(Addr); Addr++;
LOGV(WII_IPC_FILEIO, 0, "FS: CreateFile %s", Filename.c_str());
LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID);
LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID);
LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm);
LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm);
LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm);
LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes);
INFO_LOG(WII_IPC_FILEIO, "FS: CreateFile %s", Filename.c_str());
DEBUG_LOG(WII_IPC_FILEIO, " OwnerID: 0x%08x", OwnerID);
DEBUG_LOG(WII_IPC_FILEIO, " GroupID: 0x%04x", GroupID);
DEBUG_LOG(WII_IPC_FILEIO, " OwnerPerm: 0x%02x", OwnerPerm);
DEBUG_LOG(WII_IPC_FILEIO, " GroupPerm: 0x%02x", GroupPerm);
DEBUG_LOG(WII_IPC_FILEIO, " OtherPerm: 0x%02x", OtherPerm);
DEBUG_LOG(WII_IPC_FILEIO, " Attributes: 0x%02x", Attributes);
// check if the file already exist
if (File::Exists(Filename.c_str()))
{
LOG(WII_IPC_FILEIO, " result = FS_RESULT_EXISTS", Filename.c_str());
WARN_LOG(WII_IPC_FILEIO, " result = FS_RESULT_EXISTS", Filename.c_str());
return FS_FILE_EXIST;
}
@ -484,16 +484,18 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
bool Result = File::CreateEmptyFile(Filename.c_str());
if (!Result)
{
ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_fs: couldn't create new file");
PanicAlert("CWII_IPC_HLE_Device_fs: couldn't create new file");
return FS_RESULT_FATAL;
}
LOG(WII_IPC_FILEIO, " result = FS_RESULT_OK", Filename.c_str());
INFO_LOG(WII_IPC_FILEIO, " result = FS_RESULT_OK", Filename.c_str());
return FS_RESULT_OK;
}
break;
default:
ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_fs::IOCtl: ni 0x%x", _Parameter);
PanicAlert("CWII_IPC_HLE_Device_fs::IOCtl: ni 0x%x", _Parameter);
break;
}

View File

@ -112,14 +112,14 @@ CWII_IPC_HLE_Device_net_kd_request::~CWII_IPC_HLE_Device_net_kd_request()
bool CWII_IPC_HLE_Device_net_kd_request::Open(u32 _CommandAddress, u32 _Mode)
{
LOG(WII_IPC_NET, "NET_KD_REQ: Open");
INFO_LOG(WII_IPC_NET, "NET_KD_REQ: Open");
Memory::Write_U32(GetDeviceID(), _CommandAddress + 4);
return true;
}
bool CWII_IPC_HLE_Device_net_kd_request::Close(u32 _CommandAddress)
{
LOG(WII_IPC_NET, "NET_KD_REQ: Close");
INFO_LOG(WII_IPC_NET, "NET_KD_REQ: Close");
Memory::Write_U32(0, _CommandAddress + 4);
return true;
}
@ -134,7 +134,7 @@ bool CWII_IPC_HLE_Device_net_kd_request::IOCtl(u32 _CommandAddress)
u32 ReturnValue = ExecuteCommand(Parameter, BufferIn, BufferInSize, BufferOut, BufferOutSize);
LOG(WII_IPC_NET, "NET_KD_REQ: IOCtl (Device=%s) (Parameter: 0x%02x)", GetDeviceName().c_str(), Parameter);
INFO_LOG(WII_IPC_NET, "NET_KD_REQ: IOCtl (Device=%s) (Parameter: 0x%02x)", GetDeviceName().c_str(), Parameter);
Memory::Write_U32(ReturnValue, _CommandAddress + 4);
@ -223,7 +223,7 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
break;
default:
LOG(WII_IPC_NET, "NET_NCD_MANAGE IOCtlV: %i", CommandBuffer.Parameter);
INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE IOCtlV: %i", CommandBuffer.Parameter);
_dbg_assert_msg_(WII_IPC_NET, 0, "NET_NCD_MANAGE IOCtlV: %i", CommandBuffer.Parameter);
break;
}
@ -299,11 +299,11 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtlV(u32 _CommandAddress)
switch(CommandBuffer.Parameter)
{
default:
LOG(WII_IPC_NET, "NET_IP_TOP IOCtlV: %i", CommandBuffer.Parameter);
INFO_LOG(WII_IPC_NET, "NET_IP_TOP IOCtlV: %i", CommandBuffer.Parameter);
break;
}
Memory::Write_U32(ReturnValue, _CommandAddress+4);
return true;
}
}

View File

@ -52,14 +52,14 @@ public:
virtual bool Open(u32 _CommandAddress, u32 _Mode)
{
LOG(WII_IPC_NET, "%s - IOCtl: Open", GetDeviceName().c_str());
INFO_LOG(WII_IPC_NET, "%s - IOCtl: Open", GetDeviceName().c_str());
Memory::Write_U32(GetDeviceID(), _CommandAddress+4);
return true;
}
virtual bool Close(u32 _CommandAddress, u32 _Mode)
{
LOG(WII_IPC_NET, "%s - IOCtl: Close", GetDeviceName().c_str());
INFO_LOG(WII_IPC_NET, "%s - IOCtl: Close", GetDeviceName().c_str());
Memory::Write_U32(0, _CommandAddress + 4);
return true;
}
@ -77,7 +77,7 @@ public:
// write return value
Memory::Write_U32(0, _CommandAddress + 0x4);
LOG(WII_IPC_NET, "%s - IOCtl:\n"
INFO_LOG(WII_IPC_NET, "%s - IOCtl:\n"
" Parameter: 0x%x (0x17 could be some kind of Sync RTC) \n"
" Buffer1: 0x%08x\n"
" BufferSize1: 0x%08x\n"

View File

@ -39,14 +39,14 @@ CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0()
bool CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
{
LOG(WII_IPC_SD, "SD: Open");
INFO_LOG(WII_IPC_SD, "SD: Open");
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
return true;
}
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
{
LOG(WII_IPC_SD, "SD: Close");
INFO_LOG(WII_IPC_SD, "SD: Close");
Memory::Write_U32(0, _CommandAddress + 0x4);
return true;
}
@ -78,22 +78,22 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
u32 ReturnValue = 0;
switch (Cmd) {
case 1: // set_hc_reg
LOGV(WII_IPC_SD, 0, "SD: set_hc_reg");
ERROR_LOG(WII_IPC_SD, "SD: set_hc_reg");
break;
case 2: // get_hc_reg
LOGV(WII_IPC_SD, 0, "SD: get_hc_reg");
ERROR_LOG(WII_IPC_SD, "SD: get_hc_reg");
break;
case 4: // reset, do nothing ?
LOGV(WII_IPC_SD, 0, "SD: reset");
ERROR_LOG(WII_IPC_SD, "SD: reset");
break;
case 6: // sd_clock
LOGV(WII_IPC_SD, 0, "SD: sd_clock");
ERROR_LOG(WII_IPC_SD, "SD: sd_clock");
break;
case 7: // Send cmd (Input: 24 bytes, Output: 10 bytes)
LOGV(WII_IPC_SD, 0, "SD: sendcmd");
ERROR_LOG(WII_IPC_SD, "SD: sendcmd");
ReturnValue = ExecuteCommand(BufferIn, BufferInSize, BufferOut, BufferOutSize);
break;
@ -104,7 +104,7 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
}
else
{
LOGV(WII_IPC_SD, 0, "SD: sd_get_status. Answer: SD card is not inserted", BufferOut);
ERROR_LOG(WII_IPC_SD, "SD: sd_get_status. Answer: SD card is not inserted", BufferOut);
Memory::Write_U32(2, BufferOut); // SD card is not inserted
}
break;

View File

@ -54,7 +54,7 @@ public:
virtual bool Open(u32 _CommandAddress, u32 _Mode)
{
LOGV(WII_IPC_SD, 0, "STM: Open");
ERROR_LOG(WII_IPC_SD, "STM: Open");
Memory::Write_U32(GetDeviceID(), _CommandAddress+4);
return true;
}
@ -75,33 +75,33 @@ public:
switch(Parameter)
{
case IOCTL_STM_HOTRESET:
LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " IOCTL_STM_HOTRESET");
INFO_LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
INFO_LOG(WII_IPC_SD, " IOCTL_STM_HOTRESET");
break;
case IOCTL_STM_VIDIMMING: // (Input: 20 bytes, Output: 20 bytes)
LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " IOCTL_STM_VIDIMMING");
INFO_LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
INFO_LOG(WII_IPC_SD, " IOCTL_STM_VIDIMMING");
//DumpCommands(BufferIn, BufferInSize / 4, LogTypes::WII_IPC_SD);
//Memory::Write_U32(1, BufferOut);
//ReturnValue = 1;
break;
case IOCTL_STM_LEDMODE: // (Input: 20 bytes, Output: 20 bytes)
LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " IOCTL_STM_LEDMODE");
INFO_LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
INFO_LOG(WII_IPC_SD, " IOCTL_STM_LEDMODE");
break;
default:
{
_dbg_assert_msg_(WII_IPC_SD, 0, "CWII_IPC_HLE_Device_stm_immediate: 0x%x", Parameter);
LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " Parameter: 0x%x\n", Parameter);
LOG(WII_IPC_SD, " InBuffer: 0x%08x\n", BufferIn);
LOG(WII_IPC_SD, " InBufferSize: 0x%08x\n", BufferInSize);
LOG(WII_IPC_SD, " OutBuffer: 0x%08x\n", BufferOut);
LOG(WII_IPC_SD, " OutBufferSize: 0x%08x\n", BufferOutSize);
INFO_LOG(WII_IPC_SD, "%s - IOCtl: \n", GetDeviceName().c_str());
DEBUG_LOG(WII_IPC_SD, " Parameter: 0x%x\n", Parameter);
DEBUG_LOG(WII_IPC_SD, " InBuffer: 0x%08x\n", BufferIn);
DEBUG_LOG(WII_IPC_SD, " InBufferSize: 0x%08x\n", BufferInSize);
DEBUG_LOG(WII_IPC_SD, " OutBuffer: 0x%08x\n", BufferOut);
DEBUG_LOG(WII_IPC_SD, " OutBufferSize: 0x%08x\n", BufferOutSize);
}
break;
}
@ -156,12 +156,12 @@ public:
{
m_EventHookAddress = _CommandAddress;
LOG(WII_IPC_SD, "%s registers event hook:\n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " 0x1000 - IOCTL_STM_EVENTHOOK\n", Parameter);
LOG(WII_IPC_SD, " BufferIn: 0x%08x\n", BufferIn);
LOG(WII_IPC_SD, " BufferInSize: 0x%08x\n", BufferInSize);
LOG(WII_IPC_SD, " BufferOut: 0x%08x\n", BufferOut);
LOG(WII_IPC_SD, " BufferOutSize: 0x%08x\n", BufferOutSize);
INFO_LOG(WII_IPC_SD, "%s registers event hook:\n", GetDeviceName().c_str());
DEBUG_LOG(WII_IPC_SD, " 0x1000 - IOCTL_STM_EVENTHOOK\n", Parameter);
DEBUG_LOG(WII_IPC_SD, " BufferIn: 0x%08x\n", BufferIn);
DEBUG_LOG(WII_IPC_SD, " BufferInSize: 0x%08x\n", BufferInSize);
DEBUG_LOG(WII_IPC_SD, " BufferOut: 0x%08x\n", BufferOut);
DEBUG_LOG(WII_IPC_SD, " BufferOutSize: 0x%08x\n", BufferOutSize);
DumpCommands(BufferIn, BufferInSize/4, LogTypes::WII_IPC_SD);
@ -172,12 +172,12 @@ public:
default:
{
_dbg_assert_msg_(WII_IPC_SD, 0, "CWII_IPC_HLE_Device_stm_eventhook: 0x%x", Parameter);
LOG(WII_IPC_SD, "%s registers event hook:\n", GetDeviceName().c_str());
LOG(WII_IPC_SD, " Parameter: 0x%x\n", Parameter);
LOG(WII_IPC_SD, " BufferIn: 0x%08x\n", BufferIn);
LOG(WII_IPC_SD, " BufferInSize: 0x%08x\n", BufferInSize);
LOG(WII_IPC_SD, " BufferOut: 0x%08x\n", BufferOut);
LOG(WII_IPC_SD, " BufferOutSize: 0x%08x\n", BufferOutSize);
INFO_LOG(WII_IPC_SD, "%s registers event hook:\n", GetDeviceName().c_str());
DEBUG_LOG(WII_IPC_SD, " Parameter: 0x%x\n", Parameter);
DEBUG_LOG(WII_IPC_SD, " BufferIn: 0x%08x\n", BufferIn);
DEBUG_LOG(WII_IPC_SD, " BufferInSize: 0x%08x\n", BufferInSize);
DEBUG_LOG(WII_IPC_SD, " BufferOut: 0x%08x\n", BufferOut);
DEBUG_LOG(WII_IPC_SD, " BufferOutSize: 0x%08x\n", BufferOutSize);
}
break;
}

View File

@ -142,13 +142,13 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
"WIIMOTE: Termination != 0");
#if 0
LOG(WII_IPC_WIIMOTE, "USB_IOCTL_CTRLMSG (0x%08x) - execute command", _CommandAddress);
INFO_LOG(WII_IPC_WIIMOTE, "USB_IOCTL_CTRLMSG (0x%08x) - execute command", _CommandAddress);
LOG(WII_IPC_WIIMOTE, " bRequestType: 0x%x", CtrlSetup.bRequestType);
LOG(WII_IPC_WIIMOTE, " bRequest: 0x%x", CtrlSetup.bRequest);
LOG(WII_IPC_WIIMOTE, " wValue: 0x%x", CtrlSetup.wValue);
LOG(WII_IPC_WIIMOTE, " wIndex: 0x%x", CtrlSetup.wIndex);
LOG(WII_IPC_WIIMOTE, " wLength: 0x%x", CtrlSetup.wLength);
DEBUG_LOG(WII_IPC_WIIMOTE, " bRequestType: 0x%x", CtrlSetup.bRequestType);
DEBUG_LOG(WII_IPC_WIIMOTE, " bRequest: 0x%x", CtrlSetup.bRequest);
DEBUG_LOG(WII_IPC_WIIMOTE, " wValue: 0x%x", CtrlSetup.wValue);
DEBUG_LOG(WII_IPC_WIIMOTE, " wIndex: 0x%x", CtrlSetup.wIndex);
DEBUG_LOG(WII_IPC_WIIMOTE, " wLength: 0x%x", CtrlSetup.wLength);
#endif
ExecuteHCICommandMessage(CtrlSetup);
@ -186,7 +186,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
delete m_pACLBuffer;
m_pACLBuffer = new SIOCtlVBuffer(_CommandAddress);
LOGV(WII_IPC_WIIMOTE, 2, "ACL_DATA_ENDPOINT: 0x%08x ", _CommandAddress);
INFO_LOG(WII_IPC_WIIMOTE, "ACL_DATA_ENDPOINT: 0x%08x ", _CommandAddress);
return false;
}
break;
@ -210,6 +210,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
{
if (m_pHCIBuffer)
{
ERROR_LOG(WII_IPC_WIIMOTE, "Kill current hci buffer... there could be a comand inside");
PanicAlert("Kill current hci buffer... there could be a comand inside");
delete m_pHCIBuffer;
}
@ -231,12 +232,12 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
{
_dbg_assert_msg_(WII_IPC_WIIMOTE, 0, "Unknown CWII_IPC_HLE_Device_usb_oh1_57e_305: %x", CommandBuffer.Parameter);
LOG(WII_IPC_WIIMOTE, "%s - IOCtlV:", GetDeviceName().c_str());
LOG(WII_IPC_WIIMOTE, " Parameter: 0x%x", CommandBuffer.Parameter);
LOG(WII_IPC_WIIMOTE, " NumberIn: 0x%08x", CommandBuffer.NumberInBuffer);
LOG(WII_IPC_WIIMOTE, " NumberOut: 0x%08x", CommandBuffer.NumberPayloadBuffer);
LOG(WII_IPC_WIIMOTE, " BufferVector: 0x%08x", CommandBuffer.BufferVector);
LOG(WII_IPC_WIIMOTE, " BufferSize: 0x%08x", CommandBuffer.BufferSize);
INFO_LOG(WII_IPC_WIIMOTE, "%s - IOCtlV:", GetDeviceName().c_str());
DEBUG_LOG(WII_IPC_WIIMOTE, " Parameter: 0x%x", CommandBuffer.Parameter);
DEBUG_LOG(WII_IPC_WIIMOTE, " NumberIn: 0x%08x", CommandBuffer.NumberInBuffer);
DEBUG_LOG(WII_IPC_WIIMOTE, " NumberOut: 0x%08x", CommandBuffer.NumberPayloadBuffer);
DEBUG_LOG(WII_IPC_WIIMOTE, " BufferVector: 0x%08x", CommandBuffer.BufferVector);
DEBUG_LOG(WII_IPC_WIIMOTE, " BufferSize: 0x%08x", CommandBuffer.BufferSize);
DumpAsync(CommandBuffer.BufferVector, _CommandAddress, CommandBuffer.NumberInBuffer, CommandBuffer.NumberPayloadBuffer);
}
break;
@ -260,6 +261,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendToDevice(u16 _ConnectionHandle, u8
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_ConnectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendToDevice: Cant find WiiMote by connection handle: %02x", _ConnectionHandle);
PanicAlert("SendToDevice: Cant find WiiMote by connection handle: %02x", _ConnectionHandle);
return;
}
@ -277,7 +279,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendToDevice(u16 _ConnectionHandle, u8
// ----------------
void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendACLFrame(u16 _ConnectionHandle, u8* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 1, "Queing ACL frame.");
INFO_LOG(WII_IPC_WIIMOTE, "Queuing ACL frame.");
// Queue the packet
ACLFrame frame;
@ -338,7 +340,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
{
ACLFrame& frame = m_AclFrameQue.front();
LOGV(WII_IPC_WIIMOTE, 1, "Sending ACL frame.");
INFO_LOG(WII_IPC_WIIMOTE, "Sending ACL frame.");
UACLHeader* pHeader = (UACLHeader*)Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address);
pHeader->ConnectionHandle = frame.ConnectionHandle;
pHeader->BCFlag = 0;
@ -462,8 +464,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventCommandStatus(u16 _Opcode)
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: Command Status");
LOG(WII_IPC_WIIMOTE, " Opcode: 0x%04x", pHCIEvent->Opcode);
INFO_LOG(WII_IPC_WIIMOTE, "Event: Command Status");
INFO_LOG(WII_IPC_WIIMOTE, " Opcode: 0x%04x", pHCIEvent->Opcode);
return true;
}
@ -490,8 +492,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventCommandComplete(u16 _OpCode,
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: Command Complete");
LOG(WII_IPC_WIIMOTE, " Opcode: 0x%04x", pHCIEvent->Opcode);
INFO_LOG(WII_IPC_WIIMOTE, "Event: Command Complete");
INFO_LOG(WII_IPC_WIIMOTE, " Opcode: 0x%04x", pHCIEvent->Opcode);
}
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventInquiryResponse()
@ -527,8 +529,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventInquiryResponse()
pResponse->page_scan_mode = 0;
pResponse->clock_offset = 0x3818;
LOG(WII_IPC_WIIMOTE, "Event: Send Fake Inquriy of one controller");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: Send Fake Inquriy of one controller");
INFO_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pResponse->bdaddr.b[0], pResponse->bdaddr.b[1], pResponse->bdaddr.b[2],
pResponse->bdaddr.b[3], pResponse->bdaddr.b[4], pResponse->bdaddr.b[5]);
}
@ -549,7 +551,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventInquiryComplete()
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: Inquiry complete");
INFO_LOG(WII_IPC_WIIMOTE, "Event: Inquiry complete");
return true;
}
@ -559,6 +561,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRemoteNameReq(bdaddr_t _bd)
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_bd);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE,"SendEventRemoteNameReq: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2], _bd.b[3], _bd.b[4], _bd.b[5]);
PanicAlert("SendEventRemoteNameReq: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2], _bd.b[3], _bd.b[4], _bd.b[5]);
return false;
@ -576,11 +580,11 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRemoteNameReq(bdaddr_t _bd)
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: SendEventRemoteNameReq");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventRemoteNameReq");
INFO_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pRemoteNameReq->bdaddr.b[0], pRemoteNameReq->bdaddr.b[1], pRemoteNameReq->bdaddr.b[2],
pRemoteNameReq->bdaddr.b[3], pRemoteNameReq->bdaddr.b[4], pRemoteNameReq->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " remotename: %s", pRemoteNameReq->RemoteName);
INFO_LOG(WII_IPC_WIIMOTE, " remotename: %s", pRemoteNameReq->RemoteName);
return true;
}
@ -618,14 +622,14 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRequestConnection(CWII_IPC_HL
};
#endif
LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestConnection");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestConnection");
INFO_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pEventRequestConnection->bdaddr.b[0], pEventRequestConnection->bdaddr.b[1], pEventRequestConnection->bdaddr.b[2],
pEventRequestConnection->bdaddr.b[3], pEventRequestConnection->bdaddr.b[4], pEventRequestConnection->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pEventRequestConnection->uclass[0]);
LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pEventRequestConnection->uclass[1]);
LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pEventRequestConnection->uclass[2]);
LOG(WII_IPC_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]);
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pEventRequestConnection->uclass[0]);
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pEventRequestConnection->uclass[1]);
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pEventRequestConnection->uclass[2]);
DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]);
return true;
};
@ -644,8 +648,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRequestLinkKey(bdaddr_t _bd)
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestLinkKey");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventRequestLinkKey");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pEventRequestLinkKey->bdaddr.b[0], pEventRequestLinkKey->bdaddr.b[1], pEventRequestLinkKey->bdaddr.b[2],
pEventRequestLinkKey->bdaddr.b[3], pEventRequestLinkKey->bdaddr.b[4], pEventRequestLinkKey->bdaddr.b[5]);
@ -666,8 +670,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventLinkKeyNotification(const CWI
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: SendEventLinkKeyNotification");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventLinkKeyNotification");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pEventLinkKey->bdaddr.b[0], pEventLinkKey->bdaddr.b[1], pEventLinkKey->bdaddr.b[2],
pEventLinkKey->bdaddr.b[3], pEventLinkKey->bdaddr.b[4], pEventLinkKey->bdaddr.b[5]);
LOG_LinkKey(pEventLinkKey->LinkKey);
@ -682,6 +686,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventConnectionComplete(bdaddr_t _
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_bd);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE,"SendEventConnectionComplete: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2],
_bd.b[3], _bd.b[4], _bd.b[5]);
PanicAlert("SendEventConnectionComplete: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2],
_bd.b[3], _bd.b[4], _bd.b[5]);
@ -720,13 +727,13 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventConnectionComplete(bdaddr_t _
};
#endif
LOG(WII_IPC_WIIMOTE, "Event: SendEventConnectionComplete");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pConnectionComplete->Connection_Handle);
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventConnectionComplete");
INFO_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pConnectionComplete->Connection_Handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pConnectionComplete->bdaddr.b[0], pConnectionComplete->bdaddr.b[1], pConnectionComplete->bdaddr.b[2],
pConnectionComplete->bdaddr.b[3], pConnectionComplete->bdaddr.b[4], pConnectionComplete->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " LinkType: %s", s_szLinkType[pConnectionComplete->LinkType]);
LOG(WII_IPC_WIIMOTE, " EncryptionEnabled: %i", pConnectionComplete->EncryptionEnabled);
DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", s_szLinkType[pConnectionComplete->LinkType]);
DEBUG_LOG(WII_IPC_WIIMOTE, " EncryptionEnabled: %i", pConnectionComplete->EncryptionEnabled);
return true;
}
@ -736,6 +743,10 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRoleChange(bdaddr_t _bd, bool
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_bd);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventRoleChange: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2],
_bd.b[3], _bd.b[4], _bd.b[5]);
PanicAlert("SendEventRoleChange: Cant find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
_bd.b[0], _bd.b[1], _bd.b[2],
_bd.b[3], _bd.b[4], _bd.b[5]);
@ -754,11 +765,11 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRoleChange(bdaddr_t _bd, bool
AddEventToQueue(Event);
LOG(WII_IPC_WIIMOTE, "Event: SendEventRoleChange");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventRoleChange");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pRoleChange->bdaddr.b[0], pRoleChange->bdaddr.b[1], pRoleChange->bdaddr.b[2],
pRoleChange->bdaddr.b[3], pRoleChange->bdaddr.b[4], pRoleChange->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " NewRole: %i", pRoleChange->NewRole);
DEBUG_LOG(WII_IPC_WIIMOTE, " NewRole: %i", pRoleChange->NewRole);
return true;
}
@ -770,6 +781,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadClockOffsetComplete(u16 _
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventReadClockOffsetComplete: Cant find WiiMote by connection handle: %02x", _connectionHandle);
PanicAlert("SendEventReadClockOffsetComplete: Cant find WiiMote by connection handle: %02x", _connectionHandle);
return false;
}
@ -786,9 +798,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadClockOffsetComplete(u16 _
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventReadClockOffsetComplete");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadClockOffsetComplete->ConnectionHandle);
LOG(WII_IPC_WIIMOTE, " ClockOffset: 0x%04x", pReadClockOffsetComplete->ClockOffset);
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadClockOffsetComplete");
DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadClockOffsetComplete->ConnectionHandle);
DEBUG_LOG(WII_IPC_WIIMOTE, " ClockOffset: 0x%04x", pReadClockOffsetComplete->ClockOffset);
return true;
}
@ -798,6 +810,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadRemoteVerInfo(u16 _connec
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventReadRemoteVerInfo: Cant find WiiMote by connection handle: %02x", _connectionHandle);
PanicAlert("SendEventReadRemoteVerInfo: Cant find WiiMote by connection handle: %02x", _connectionHandle);
return false;
}
@ -816,11 +829,11 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadRemoteVerInfo(u16 _connec
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteVerInfo");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteVerInfo->ConnectionHandle);
LOG(WII_IPC_WIIMOTE, " lmp_version: 0x%02x", pReadRemoteVerInfo->lmp_version);
LOG(WII_IPC_WIIMOTE, " manufacturer: 0x%04x", pReadRemoteVerInfo->manufacturer);
LOG(WII_IPC_WIIMOTE, " lmp_subversion: 0x%04x", pReadRemoteVerInfo->lmp_subversion);
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteVerInfo");
DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteVerInfo->ConnectionHandle);
DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_version: 0x%02x", pReadRemoteVerInfo->lmp_version);
DEBUG_LOG(WII_IPC_WIIMOTE, " manufacturer: 0x%04x", pReadRemoteVerInfo->manufacturer);
DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_subversion: 0x%04x", pReadRemoteVerInfo->lmp_subversion);
return true;
}
@ -830,6 +843,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadRemoteFeatures(u16 _conne
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventReadRemoteFeatures: Cant find WiiMote by connection handle: %02x", _connectionHandle);
PanicAlert("SendEventReadRemoteFeatures: Cant find WiiMote by connection handle: %02x", _connectionHandle);
return false;
}
@ -853,9 +867,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventReadRemoteFeatures(u16 _conne
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteFeatures");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteFeatures->ConnectionHandle);
LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventReadRemoteFeatures");
DEBUG_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pReadRemoteFeatures->ConnectionHandle);
DEBUG_LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
pReadRemoteFeatures->features[0], pReadRemoteFeatures->features[1], pReadRemoteFeatures->features[2],
pReadRemoteFeatures->features[3], pReadRemoteFeatures->features[4], pReadRemoteFeatures->features[5],
pReadRemoteFeatures->features[6], pReadRemoteFeatures->features[7]);
@ -868,6 +882,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets(u16
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventNumberOfCompletedPackets: Cant find WiiMote by connection handle %02x", _connectionHandle);
PanicAlert("SendEventNumberOfCompletedPackets: Cant find WiiMote by connection handle %02x", _connectionHandle);
return false;
}
@ -884,9 +899,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets(u16
AddEventToQueue(Event);
// Log
LOGV(WII_IPC_WIIMOTE, 1, "Event: SendEventNumberOfCompletedPackets");
LOGV(WII_IPC_WIIMOTE, 1, " Connection_Handle: 0x%04x", pNumberOfCompletedPackets->Connection_Handle);
LOGV(WII_IPC_WIIMOTE, 1, " Number_Of_Completed_Packets: %i", pNumberOfCompletedPackets->Number_Of_Completed_Packets);
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventNumberOfCompletedPackets");
INFO_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pNumberOfCompletedPackets->Connection_Handle);
INFO_LOG(WII_IPC_WIIMOTE, " Number_Of_Completed_Packets: %i", pNumberOfCompletedPackets->Number_Of_Completed_Packets);
return true;
}
@ -896,6 +911,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventAuthenticationCompleted(u16 _
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventAuthenticationCompleted: Cant find WiiMote by connection handle %02x", _connectionHandle);
PanicAlert("SendEventAuthenticationCompleted: Cant find WiiMote by connection handle %02x", _connectionHandle);
return false;
}
@ -911,8 +927,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventAuthenticationCompleted(u16 _
AddEventToQueue(Event);
// Log
LOGV(WII_IPC_WIIMOTE, 1, "Event: SendEventAuthenticationCompleted");
LOGV(WII_IPC_WIIMOTE, 1, " Connection_Handle: 0x%04x", pEventAuthenticationCompleted->Connection_Handle);
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventAuthenticationCompleted");
INFO_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pEventAuthenticationCompleted->Connection_Handle);
return true;
}
@ -922,6 +938,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventModeChange(u16 _connectionHan
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventModeChange: Cant find WiiMote by connection handle %02x", _connectionHandle);
PanicAlert("SendEventModeChange: Cant find WiiMote by connection handle %02x", _connectionHandle);
return false;
}
@ -939,9 +956,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventModeChange(u16 _connectionHan
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventModeChange");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pModeChange->Connection_Handle);
LOG(WII_IPC_WIIMOTE, " missing other paramter :)");
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventModeChange");
INFO_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pModeChange->Connection_Handle);
INFO_LOG(WII_IPC_WIIMOTE, " missing other paramter :)");
return true;
}
@ -951,6 +968,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventDisconnect(u16 _connectionHan
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(_connectionHandle);
if (pWiiMote == NULL)
{
ERROR_LOG(WII_IPC_WIIMOTE, "SendEventDisconnect: Cant find WiiMote by connection handle %02x", _connectionHandle);
PanicAlert("SendEventDisconnect: Cant find WiiMote by connection handle %02x", _connectionHandle);
return false;
}
@ -967,9 +985,9 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventDisconnect(u16 _connectionHan
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventDisconnect");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pDisconnect->Connection_Handle);
LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDisconnect->Reason);
INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventDisconnect");
INFO_LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pDisconnect->Connection_Handle);
INFO_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDisconnect->Reason);
return true;
}
@ -990,8 +1008,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
u16 ocf = HCI_OCF(pMsg->Opcode);
u16 ogf = HCI_OGF(pMsg->Opcode);
LOG(WII_IPC_WIIMOTE, "******************************");
LOG(WII_IPC_WIIMOTE, "ExecuteHCICommandMessage(0x%04x)(ocf: 0x%02x, ogf: 0x%02x)",
INFO_LOG(WII_IPC_WIIMOTE, "******************************");
INFO_LOG(WII_IPC_WIIMOTE, "ExecuteHCICommandMessage(0x%04x)(ocf: 0x%02x, ogf: 0x%02x)",
pMsg->Opcode, ocf, ogf);
switch(pMsg->Opcode)
@ -1147,11 +1165,11 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
if (_ogf == 0x3f)
{
PanicAlert("Vendor specific HCI command");
LOG(WII_IPC_WIIMOTE, "Command: vendor specific: 0x%04X (ocf: 0x%x)", pMsg->Opcode, _ocf);
ERROR_LOG(WII_IPC_WIIMOTE, "Command: vendor specific: 0x%04X (ocf: 0x%x)", pMsg->Opcode, _ocf);
for (int i=0; i<pMsg->len; i++)
{
LOG(WII_IPC_WIIMOTE, " 0x02%x", pInput[i]);
ERROR_LOG(WII_IPC_WIIMOTE, " 0x02%x", pInput[i]);
}
}
else
@ -1180,7 +1198,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReset(u8* _Input)
hci_status_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_RESET");
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_RESET");
SendEventCommandComplete(HCI_CMD_RESET, &Reply, sizeof(hci_status_rp));
}
@ -1195,12 +1213,12 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadBufferSize(u8* _Input)
Reply.max_sco_size = 64;
Reply.num_sco_pkts = 0;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BUFFER_SIZE:");
LOG(WII_IPC_WIIMOTE, "return:");
LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", Reply.max_acl_size);
LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", Reply.num_acl_pkts);
LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", Reply.max_sco_size);
LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", Reply.num_sco_pkts);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BUFFER_SIZE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "return:");
DEBUG_LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", Reply.max_acl_size);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", Reply.num_acl_pkts);
DEBUG_LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", Reply.max_sco_size);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", Reply.num_sco_pkts);
SendEventCommandComplete(HCI_CMD_READ_BUFFER_SIZE, &Reply, sizeof(hci_read_buffer_size_rp));
}
@ -1216,13 +1234,13 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadLocalVer(u8* _Input)
Reply.manufacturer = 0x000F; // manufacturer: reserved for tests
Reply.lmp_subversion = 0x430e; // LMP subversion
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_VER:");
LOG(WII_IPC_WIIMOTE, "return:");
LOG(WII_IPC_WIIMOTE, " status: %i", Reply.status);
LOG(WII_IPC_WIIMOTE, " hci_revision: %i", Reply.hci_revision);
LOG(WII_IPC_WIIMOTE, " lmp_version: %i", Reply.lmp_version);
LOG(WII_IPC_WIIMOTE, " manufacturer: %i", Reply.manufacturer);
LOG(WII_IPC_WIIMOTE, " lmp_subversion: %i", Reply.lmp_subversion);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_VER:");
DEBUG_LOG(WII_IPC_WIIMOTE, "return:");
DEBUG_LOG(WII_IPC_WIIMOTE, " status: %i", Reply.status);
DEBUG_LOG(WII_IPC_WIIMOTE, " hci_revision: %i", Reply.hci_revision);
DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_version: %i", Reply.lmp_version);
DEBUG_LOG(WII_IPC_WIIMOTE, " manufacturer: %i", Reply.manufacturer);
DEBUG_LOG(WII_IPC_WIIMOTE, " lmp_subversion: %i", Reply.lmp_subversion);
SendEventCommandComplete(HCI_CMD_READ_LOCAL_VER, &Reply, sizeof(hci_read_local_ver_rp));
}
@ -1234,9 +1252,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadBDAdrr(u8* _Input)
Reply.status = 0x00;
Reply.bdaddr = m_ControllerBD;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BDADDR:");
LOG(WII_IPC_WIIMOTE, "return:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_BDADDR:");
DEBUG_LOG(WII_IPC_WIIMOTE, "return:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
Reply.bdaddr.b[0], Reply.bdaddr.b[1], Reply.bdaddr.b[2],
Reply.bdaddr.b[3], Reply.bdaddr.b[4], Reply.bdaddr.b[5]);
@ -1257,9 +1275,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadLocalFeatures(u8* _Input)
Reply.features[6] = 0x00;
Reply.features[7] = 0x80;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_FEATURES:");
LOG(WII_IPC_WIIMOTE, "return:");
LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_LOCAL_FEATURES:");
DEBUG_LOG(WII_IPC_WIIMOTE, "return:");
DEBUG_LOG(WII_IPC_WIIMOTE, " features: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
Reply.features[0], Reply.features[1], Reply.features[2],
Reply.features[3], Reply.features[4], Reply.features[5],
Reply.features[6], Reply.features[7]);
@ -1282,19 +1300,20 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input)
}
else
{
ERROR_LOG(WII_IPC_WIIMOTE, "CommandReadStoredLinkKey");
PanicAlert("CommandReadStoredLinkKey");
}
// logging
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_STORED_LINK_KEY:");
LOG(WII_IPC_WIIMOTE, "input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_STORED_LINK_KEY:");
DEBUG_LOG(WII_IPC_WIIMOTE, "input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
ReadStoredLinkKey->bdaddr.b[0], ReadStoredLinkKey->bdaddr.b[1], ReadStoredLinkKey->bdaddr.b[2],
ReadStoredLinkKey->bdaddr.b[3], ReadStoredLinkKey->bdaddr.b[4], ReadStoredLinkKey->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " read_all: %i", ReadStoredLinkKey->read_all);
LOG(WII_IPC_WIIMOTE, "return:");
LOG(WII_IPC_WIIMOTE, " max_num_keys: %i", Reply.max_num_keys);
LOG(WII_IPC_WIIMOTE, " num_keys_read: %i", Reply.num_keys_read);
DEBUG_LOG(WII_IPC_WIIMOTE, " read_all: %i", ReadStoredLinkKey->read_all);
DEBUG_LOG(WII_IPC_WIIMOTE, "return:");
DEBUG_LOG(WII_IPC_WIIMOTE, " max_num_keys: %i", Reply.max_num_keys);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_keys_read: %i", Reply.num_keys_read);
// generate link key
for (size_t i=0; i<m_WiiMotes.size(); i++)
@ -1320,11 +1339,11 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteUnitClass(u8* _Input)
hci_write_unit_class_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_UNIT_CLASS:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pWriteUnitClass->uclass[0]);
LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pWriteUnitClass->uclass[1]);
LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pWriteUnitClass->uclass[2]);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_UNIT_CLASS:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pWriteUnitClass->uclass[0]);
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pWriteUnitClass->uclass[1]);
DEBUG_LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pWriteUnitClass->uclass[2]);
SendEventCommandComplete(HCI_CMD_WRITE_UNIT_CLASS, &Reply, sizeof(hci_write_unit_class_rp));
}
@ -1339,9 +1358,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLocalName(u8* _Input)
hci_write_local_name_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LOCAL_NAME:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " local_name: %s", pWriteLocalName->name);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LOCAL_NAME:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " local_name: %s", pWriteLocalName->name);
SendEventCommandComplete(HCI_CMD_WRITE_LOCAL_NAME, &Reply, sizeof(hci_write_local_name_rp));
}
@ -1356,9 +1375,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePinType(u8* _Input)
hci_write_pin_type_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PIN_TYPE:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " pin_type: %x", pWritePinType->pin_type);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PIN_TYPE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " pin_type: %x", pWritePinType->pin_type);
SendEventCommandComplete(HCI_CMD_WRITE_PIN_TYPE, &Reply, sizeof(hci_write_pin_type_rp));
}
@ -1376,12 +1395,12 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandHostBufferSize(u8* _Input)
hci_host_buffer_size_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_HOST_BUFFER_SIZE:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", pHostBufferSize->max_acl_size);
LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", pHostBufferSize->max_sco_size);
LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", pHostBufferSize->num_acl_pkts);
LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", pHostBufferSize->num_sco_pkts);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_HOST_BUFFER_SIZE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " max_acl_size: %i", pHostBufferSize->max_acl_size);
DEBUG_LOG(WII_IPC_WIIMOTE, " max_sco_size: %i", pHostBufferSize->max_sco_size);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_acl_pkts: %i", pHostBufferSize->num_acl_pkts);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_sco_pkts: %i", pHostBufferSize->num_sco_pkts);
SendEventCommandComplete(HCI_CMD_HOST_BUFFER_SIZE, &Reply, sizeof(hci_host_buffer_size_rp));
}
@ -1402,9 +1421,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input)
hci_host_buffer_size_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_TIMEOUT:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " timeout: %i", pWritePageTimeOut->timeout);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_TIMEOUT:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: %i", pWritePageTimeOut->timeout);
SendEventCommandComplete(HCI_CMD_WRITE_PAGE_TIMEOUT, &Reply, sizeof(hci_host_buffer_size_rp));
}
@ -1433,9 +1452,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
};
#endif
LOGV(WII_IPC_WIIMOTE, 0, "Command: HCI_CMD_WRITE_SCAN_ENABLE:");
LOGV(WII_IPC_WIIMOTE, 0, "write:");
LOGV(WII_IPC_WIIMOTE, 0, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_SCAN_ENABLE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]);
SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &Reply, sizeof(hci_write_scan_enable_rp));
}
@ -1461,9 +1480,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input)
{ "Inquiry Result with RSSI format or Extended Inquiry Result format" }
};
#endif
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_MODE:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " mode: %s", InquiryMode[pInquiryMode->mode]);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_MODE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " mode: %s", InquiryMode[pInquiryMode->mode]);
SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &Reply, sizeof(hci_write_inquiry_mode_rp));
}
@ -1487,9 +1506,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input)
};
#endif
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " type: %s", PageScanType[pWritePageScanType->type]);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " type: %s", PageScanType[pWritePageScanType->type]);
SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &Reply, sizeof(hci_write_page_scan_type_rp));
}
@ -1505,10 +1524,10 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandSetEventFilter(u8* _Input)
hci_set_event_filter_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SET_EVENT_FILTER:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " filter_type: %i", pSetEventFilter->filter_type);
LOG(WII_IPC_WIIMOTE, " filter_condition_type: %i", pSetEventFilter->filter_condition_type);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SET_EVENT_FILTER:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " filter_type: %i", pSetEventFilter->filter_type);
DEBUG_LOG(WII_IPC_WIIMOTE, " filter_condition_type: %i", pSetEventFilter->filter_condition_type);
SendEventCommandComplete(HCI_CMD_SET_EVENT_FILTER, &Reply, sizeof(hci_set_event_filter_rp));
}
@ -1521,13 +1540,13 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
memcpy(lap, pInquiry->lap, HCI_LAP_SIZE);
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " LAP[0]: 0x%02x", pInquiry->lap[0]);
LOG(WII_IPC_WIIMOTE, " LAP[1]: 0x%02x", pInquiry->lap[1]);
LOG(WII_IPC_WIIMOTE, " LAP[2]: 0x%02x", pInquiry->lap[2]);
LOG(WII_IPC_WIIMOTE, " inquiry_length: %i (N x 1.28) sec", pInquiry->inquiry_length);
LOG(WII_IPC_WIIMOTE, " num_responses: %i (N x 1.28) sec", pInquiry->num_responses);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[0]: 0x%02x", pInquiry->lap[0]);
DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[1]: 0x%02x", pInquiry->lap[1]);
DEBUG_LOG(WII_IPC_WIIMOTE, " LAP[2]: 0x%02x", pInquiry->lap[2]);
DEBUG_LOG(WII_IPC_WIIMOTE, " inquiry_length: %i (N x 1.28) sec", pInquiry->inquiry_length);
DEBUG_LOG(WII_IPC_WIIMOTE, " num_responses: %i (N x 1.28) sec", pInquiry->num_responses);
SendEventCommandStatus(HCI_CMD_INQUIRY);
SendEventInquiryResponse();
@ -1544,9 +1563,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input
hci_write_inquiry_scan_type_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_SCAN_TYPE:");
LOG(WII_IPC_WIIMOTE, "write:");
LOG(WII_IPC_WIIMOTE, " type: %i", pSetEventFilter->type);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_INQUIRY_SCAN_TYPE:");
DEBUG_LOG(WII_IPC_WIIMOTE, "write:");
DEBUG_LOG(WII_IPC_WIIMOTE, " type: %i", pSetEventFilter->type);
SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_SCAN_TYPE, &Reply, sizeof(hci_write_inquiry_scan_type_rp));
}
@ -1564,8 +1583,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandVendorSpecific_FC4F(u8* _Input,
hci_status_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4F: (callstack WUDiRemovePatch)");
LOG(WII_IPC_WIIMOTE, "input (size 0x%x):", _Size);
INFO_LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4F: (callstack WUDiRemovePatch)");
INFO_LOG(WII_IPC_WIIMOTE, "input (size 0x%x):", _Size);
Debugger::PrintDataBuffer(LogTypes::WII_IPC_WIIMOTE, _Input, _Size, "Data: ");
@ -1578,8 +1597,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandVendorSpecific_FC4C(u8* _Input,
hci_status_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4C:");
LOG(WII_IPC_WIIMOTE, "input (size 0x%x):", _Size);
INFO_LOG(WII_IPC_WIIMOTE, "Command: CommandVendorSpecific_FC4C:");
INFO_LOG(WII_IPC_WIIMOTE, "input (size 0x%x):", _Size);
Debugger::PrintDataBuffer(LogTypes::WII_IPC_WIIMOTE, _Input, _Size, "Data: ");
SendEventCommandComplete(0xFC4C, &Reply, sizeof(hci_status_rp));
@ -1591,7 +1610,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiryCancel(u8* _Input)
hci_inquiry_cancel_rp Reply;
Reply.status = 0x00;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY_CANCEL");
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_INQUIRY_CANCEL");
SendEventCommandComplete(HCI_CMD_INQUIRY_CANCEL, &Reply, sizeof(hci_inquiry_cancel_rp));
}
@ -1601,14 +1620,14 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandRemoteNameReq(u8* _Input)
// command parameters
hci_remote_name_req_cp* pRemoteNameReq = (hci_remote_name_req_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_REMOTE_NAME_REQ");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_REMOTE_NAME_REQ");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pRemoteNameReq->bdaddr.b[0], pRemoteNameReq->bdaddr.b[1], pRemoteNameReq->bdaddr.b[2],
pRemoteNameReq->bdaddr.b[3], pRemoteNameReq->bdaddr.b[4], pRemoteNameReq->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", pRemoteNameReq->page_scan_rep_mode);
LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", pRemoteNameReq->page_scan_mode);
LOG(WII_IPC_WIIMOTE, " clock_offset: %i", pRemoteNameReq->clock_offset);
DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", pRemoteNameReq->page_scan_rep_mode);
DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", pRemoteNameReq->page_scan_mode);
DEBUG_LOG(WII_IPC_WIIMOTE, " clock_offset: %i", pRemoteNameReq->clock_offset);
SendEventCommandStatus(HCI_CMD_REMOTE_NAME_REQ);
SendEventRemoteNameReq(pRemoteNameReq->bdaddr);
@ -1619,17 +1638,17 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandCreateCon(u8* _Input)
// command parameters
hci_create_con_cp* pCreateCon = (hci_create_con_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_CREATE_CON");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_CREATE_CON");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pCreateCon->bdaddr.b[0], pCreateCon->bdaddr.b[1], pCreateCon->bdaddr.b[2],
pCreateCon->bdaddr.b[3], pCreateCon->bdaddr.b[4], pCreateCon->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " pkt_type: %i", pCreateCon->pkt_type);
LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", pCreateCon->page_scan_rep_mode);
LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", pCreateCon->page_scan_mode);
LOG(WII_IPC_WIIMOTE, " clock_offset: %i", pCreateCon->clock_offset);
LOG(WII_IPC_WIIMOTE, " accept_role_switch: %i", pCreateCon->accept_role_switch);
DEBUG_LOG(WII_IPC_WIIMOTE, " pkt_type: %i", pCreateCon->pkt_type);
DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_rep_mode: %i", pCreateCon->page_scan_rep_mode);
DEBUG_LOG(WII_IPC_WIIMOTE, " page_scan_mode: %i", pCreateCon->page_scan_mode);
DEBUG_LOG(WII_IPC_WIIMOTE, " clock_offset: %i", pCreateCon->clock_offset);
DEBUG_LOG(WII_IPC_WIIMOTE, " accept_role_switch: %i", pCreateCon->accept_role_switch);
SendEventCommandStatus(HCI_CMD_CREATE_CON);
SendEventConnectionComplete(pCreateCon->bdaddr);
@ -1648,12 +1667,12 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input)
};
#endif
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_ACCEPT_CON");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_ACCEPT_CON");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pAcceptCon->bdaddr.b[0], pAcceptCon->bdaddr.b[1], pAcceptCon->bdaddr.b[2],
pAcceptCon->bdaddr.b[3], pAcceptCon->bdaddr.b[4], pAcceptCon->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " role: %s", s_szRole[pAcceptCon->role]);
DEBUG_LOG(WII_IPC_WIIMOTE, " role: %s", s_szRole[pAcceptCon->role]);
SendEventCommandStatus(HCI_CMD_ACCEPT_CON);
@ -1671,9 +1690,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadClockOffset(u8* _Input)
// command parameters
hci_read_clock_offset_cp* pReadClockOffset = (hci_read_clock_offset_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_CLOCK_OFFSET");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", pReadClockOffset->con_handle);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_CLOCK_OFFSET");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", pReadClockOffset->con_handle);
SendEventCommandStatus(HCI_CMD_READ_CLOCK_OFFSET);
SendEventReadClockOffsetComplete(pReadClockOffset->con_handle);
@ -1688,9 +1707,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadRemoteVerInfo(u8* _Input)
// command parameters
hci_read_remote_ver_info_cp* pReadRemoteVerInfo = (hci_read_remote_ver_info_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_VER_INFO");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", pReadRemoteVerInfo->con_handle);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_VER_INFO");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%02x", pReadRemoteVerInfo->con_handle);
SendEventCommandStatus(HCI_CMD_READ_REMOTE_VER_INFO);
SendEventReadRemoteVerInfo(pReadRemoteVerInfo->con_handle);
@ -1701,9 +1720,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadRemoteFeatures(u8* _Input)
// command parameters
hci_read_remote_features_cp* pReadRemoteFeatures = (hci_read_remote_features_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_FEATURES");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pReadRemoteFeatures->con_handle);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_READ_REMOTE_FEATURES");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pReadRemoteFeatures->con_handle);
SendEventCommandStatus(HCI_CMD_READ_REMOTE_FEATURES);
SendEventReadRemoteFeatures(pReadRemoteFeatures->con_handle);
@ -1714,10 +1733,10 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkPolicy(u8* _Input)
// command parameters
hci_write_link_policy_settings_cp* pLinkPolicy = (hci_write_link_policy_settings_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_POLICY_SETTINGS");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pLinkPolicy->con_handle);
LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", pLinkPolicy->settings);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_WRITE_LINK_POLICY_SETTINGS");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pLinkPolicy->con_handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", pLinkPolicy->settings);
SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS);
@ -1733,9 +1752,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAuthenticationRequested(u8* _In
// command parameters
hci_auth_req_cp* pAuthReq = (hci_auth_req_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_AUTH_REQ");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pAuthReq->con_handle);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_AUTH_REQ");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pAuthReq->con_handle);
SendEventCommandStatus(HCI_CMD_AUTH_REQ);
SendEventAuthenticationCompleted(pAuthReq->con_handle);
@ -1746,13 +1765,13 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandSniffMode(u8* _Input)
// command parameters
hci_sniff_mode_cp* pSniffMode = (hci_sniff_mode_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SNIFF_MODE");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pSniffMode->con_handle);
LOG(WII_IPC_WIIMOTE, " max_interval: 0x%04x", pSniffMode->max_interval);
LOG(WII_IPC_WIIMOTE, " min_interval: 0x%04x", pSniffMode->min_interval);
LOG(WII_IPC_WIIMOTE, " attempt: 0x%04x", pSniffMode->attempt);
LOG(WII_IPC_WIIMOTE, " timeout: 0x%04x", pSniffMode->timeout);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_SNIFF_MODE");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pSniffMode->con_handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " max_interval: 0x%04x", pSniffMode->max_interval);
DEBUG_LOG(WII_IPC_WIIMOTE, " min_interval: 0x%04x", pSniffMode->min_interval);
DEBUG_LOG(WII_IPC_WIIMOTE, " attempt: 0x%04x", pSniffMode->attempt);
DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: 0x%04x", pSniffMode->timeout);
SendEventCommandStatus(HCI_CMD_SNIFF_MODE);
SendEventModeChange(pSniffMode->con_handle, 0x02, pSniffMode->max_interval); // 0x02 - sniff mode
@ -1763,10 +1782,10 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDisconnect(u8* _Input)
// command parameters
hci_discon_cp* pDiscon = (hci_discon_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_DISCONNECT");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pDiscon->con_handle);
LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDiscon->reason);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_DISCONNECT");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pDiscon->con_handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDiscon->reason);
SendEventCommandStatus(HCI_CMD_DISCONNECT);
SendEventDisconnect(pDiscon->con_handle, pDiscon->reason);
@ -1781,6 +1800,11 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDisconnect(u8* _Input)
if (OneShotMessage)
{
OneShotMessage = false;
ERROR_LOG(WII_IPC_WIIMOTE, "IPC CommandDisconnect: WiiMote emulation is out of sync.\n"
"This message will be shot one time only, because dolphin does\n"
"not executes the disconnect at all and some times you can play\n"
"anyway. It is strongly recommed to save and/or restart the\n"
"emulation.");
PanicAlert("IPC CommandDisconnect: WiiMote emulation is out of sync.\n"
"This message will be shot one time only, because dolphin does\n"
"not executes the disconnect at all and some times you can play\n"
@ -1802,10 +1826,10 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkSupervisionTimeout(u8*
// command parameters
hci_write_link_supervision_timeout_cp* pSuperVision = (hci_write_link_supervision_timeout_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_OCF_WRITE_LINK_SUPERVISION_TIMEOUT");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " con_handle: 0x%04x", pSuperVision->con_handle);
LOG(WII_IPC_WIIMOTE, " timeout: 0x%02x", pSuperVision->timeout);
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_OCF_WRITE_LINK_SUPERVISION_TIMEOUT");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " con_handle: 0x%04x", pSuperVision->con_handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " timeout: 0x%02x", pSuperVision->timeout);
hci_write_link_supervision_timeout_rp Reply;
Reply.status = 0x00;
@ -1819,18 +1843,19 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDeleteStoredLinkKey(u8* _Input)
// command parameters
hci_delete_stored_link_key_cp* pDeleteStoredLinkKey = (hci_delete_stored_link_key_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_OCF_DELETE_STORED_LINK_KEY");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_OCF_DELETE_STORED_LINK_KEY");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pDeleteStoredLinkKey->bdaddr.b[0], pDeleteStoredLinkKey->bdaddr.b[1], pDeleteStoredLinkKey->bdaddr.b[2],
pDeleteStoredLinkKey->bdaddr.b[3], pDeleteStoredLinkKey->bdaddr.b[4], pDeleteStoredLinkKey->bdaddr.b[5]);
LOG(WII_IPC_WIIMOTE, " delete_all: 0x%01x", pDeleteStoredLinkKey->delete_all);
DEBUG_LOG(WII_IPC_WIIMOTE, " delete_all: 0x%01x", pDeleteStoredLinkKey->delete_all);
CWII_IPC_HLE_WiiMote* pWiiMote = AccessWiiMote(pDeleteStoredLinkKey->bdaddr);
if (pWiiMote == NULL)
{
PanicAlert("CommandDeleteStoredLinkKey: Cant find WiiMote by bd");
ERROR_LOG(WII_IPC_WIIMOTE, "CommandDeleteStoredLinkKey: Can't find WiiMote by bd");
PanicAlert("CommandDeleteStoredLinkKey: Can't find WiiMote by bd");
return;
}
@ -1840,7 +1865,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDeleteStoredLinkKey(u8* _Input)
SendEventCommandComplete(HCI_CMD_DELETE_STORED_LINK_KEY, &Reply, sizeof(hci_delete_stored_link_key_rp));
PanicAlert("HCI: CommandDeleteStoredLinkKey... Prolly the security for linking has failed. COuld be a problem with the loading of the SCONF");
ERROR_LOG(WII_IPC_WIIMOTE, "HCI: CommandDeleteStoredLinkKey... Probablu the security for linking has failed. Could be a problem with loading the SCONF");
PanicAlert("HCI: CommandDeleteStoredLinkKey... Probably the security for linking has failed. Could be a problem with loading the SCONF");
}
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandLinkKeyNegRep(u8* _Input)
@ -1848,9 +1874,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandLinkKeyNegRep(u8* _Input)
// command parameters
hci_link_key_neg_rep_cp* pKeyNeg = (hci_link_key_neg_rep_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_NEG_REP");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_NEG_REP");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pKeyNeg->bdaddr.b[0], pKeyNeg->bdaddr.b[1], pKeyNeg->bdaddr.b[2],
pKeyNeg->bdaddr.b[3], pKeyNeg->bdaddr.b[4], pKeyNeg->bdaddr.b[5]);
@ -1866,9 +1892,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandLinkKeyRep(u8* _Input)
// command parameters
hci_link_key_rep_cp* pKeyRep = (hci_link_key_rep_cp*)_Input;
LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_REP");
LOG(WII_IPC_WIIMOTE, "Input:");
LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
INFO_LOG(WII_IPC_WIIMOTE, "Command: HCI_CMD_LINK_KEY_REP");
DEBUG_LOG(WII_IPC_WIIMOTE, "Input:");
DEBUG_LOG(WII_IPC_WIIMOTE, " bd: %02x:%02x:%02x:%02x:%02x:%02x",
pKeyRep->bdaddr.b[0], pKeyRep->bdaddr.b[1], pKeyRep->bdaddr.b[2],
pKeyRep->bdaddr.b[3], pKeyRep->bdaddr.b[4], pKeyRep->bdaddr.b[5]);
LOG_LinkKey(pKeyRep->key);
@ -1919,7 +1945,7 @@ CWII_IPC_HLE_WiiMote* CWII_IPC_HLE_Device_usb_oh1_57e_305::AccessWiiMote(u16 _Co
void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey)
{
LOG(WII_IPC_WIIMOTE, " link key: "
DEBUG_LOG(WII_IPC_WIIMOTE, " link key: "
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x "
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x "
, _pLinkKey[0], _pLinkKey[1], _pLinkKey[2], _pLinkKey[3], _pLinkKey[4], _pLinkKey[5], _pLinkKey[6], _pLinkKey[7]

View File

@ -150,7 +150,7 @@ CWII_IPC_HLE_WiiMote::CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305*
{
s_Usb = _pHost;
LOG(WII_IPC_WIIMOTE, "Wiimote %i constructed", _Number);
INFO_LOG(WII_IPC_WIIMOTE, "Wiimote %i constructed", _Number);
m_BD.b[0] = 0x11;
m_BD.b[1] = 0x02;
@ -327,12 +327,12 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
u8* pData = _pData + sizeof(SL2CAP_Header);
u32 DataSize = _Size - sizeof(SL2CAP_Header);
LOGV(WII_IPC_WIIMOTE, 2, "L2Cap-SendFrame: Channel 0x%04x, Len 0x%x, DataSize 0x%x",
INFO_LOG(WII_IPC_WIIMOTE, "L2Cap-SendFrame: Channel 0x%04x, Len 0x%x, DataSize 0x%x",
pHeader->CID, pHeader->Length, DataSize);
if(pHeader->Length != DataSize)
{
LOGV(WII_IPC_WIIMOTE, 2, "Faulty packet. It is dropped.");
INFO_LOG(WII_IPC_WIIMOTE, "Faulty packet. It is dropped.");
return;
}
@ -366,7 +366,8 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
break;
default:
PanicAlert("channel 0x04%x has unknown PSM %x", pHeader->CID, rChannel.PSM);
ERROR_LOG(WII_IPC_WIIMOTE, "channel 0x04%x has unknown PSM %x", pHeader->CID, rChannel.PSM);
PanicAlert("WIIMOTE: channel 0x04%x has unknown PSM %x", pHeader->CID, rChannel.PSM);
break;
}
}
@ -473,6 +474,9 @@ void CWII_IPC_HLE_WiiMote::SignalChannel(u8* _pData, u32 _Size)
break;
case L2CAP_COMMAND_REJ:
ERROR_LOG(WII_IPC_WIIMOTE, "SignalChannel - L2CAP_COMMAND_REJ (something went wrong). Try to replace your"
"SYSCONF file with a new copy."
,pCommand->code);
PanicAlert(
"SignalChannel - L2CAP_COMMAND_REJ (something went wrong). Try to replace your"
"SYSCONF file with a new copy."
@ -480,7 +484,7 @@ void CWII_IPC_HLE_WiiMote::SignalChannel(u8* _pData, u32 _Size)
break;
default:
LOG(WII_IPC_WIIMOTE, " Unknown Command-Code (0x%02x)", pCommand->code);
ERROR_LOG(WII_IPC_WIIMOTE, " Unknown Command-Code (0x%02x)", pCommand->code);
PanicAlert("SignalChannel %x",pCommand->code);
return;
}
@ -513,11 +517,11 @@ void CWII_IPC_HLE_WiiMote::CommandConnectionReq(u8 _Ident, u8* _pData, u32 _Size
rChannel.SCID = pCommandConnectionReq->scid;
rChannel.DCID = pCommandConnectionReq->scid;
LOG(WII_IPC_WIIMOTE, " CommandConnectionReq");
LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
LOG(WII_IPC_WIIMOTE, " PSM: 0x%04x", rChannel.PSM);
LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rChannel.SCID);
LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rChannel.DCID);
INFO_LOG(WII_IPC_WIIMOTE, " CommandConnectionReq");
DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
DEBUG_LOG(WII_IPC_WIIMOTE, " PSM: 0x%04x", rChannel.PSM);
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rChannel.SCID);
DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rChannel.DCID);
// response
SL2CAP_ConnectionResponse Rsp;
@ -538,7 +542,7 @@ void CWII_IPC_HLE_WiiMote::CommandConnectionReq(u8 _Ident, u8* _pData, u32 _Size
void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 1, "*******************************************************");
INFO_LOG(WII_IPC_WIIMOTE, "*******************************************************");
u32 Offset = 0;
SL2CAP_CommandConfigurationReq* pCommandConfigReq = (SL2CAP_CommandConfigurationReq*)_pData;
@ -547,10 +551,10 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(pCommandConfigReq->dcid));
SChannel& rChannel = m_Channel[pCommandConfigReq->dcid];
LOGV(WII_IPC_WIIMOTE, 1, " CommandCofigurationReq");
LOGV(WII_IPC_WIIMOTE, 1, " Ident: 0x%02x", _Ident);
LOGV(WII_IPC_WIIMOTE, 1, " DCID: 0x%04x", pCommandConfigReq->dcid);
LOGV(WII_IPC_WIIMOTE, 1, " Flags: 0x%04x", pCommandConfigReq->flags);
INFO_LOG(WII_IPC_WIIMOTE, " CommandCofigurationReq");
INFO_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
INFO_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandConfigReq->dcid);
INFO_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", pCommandConfigReq->flags);
Offset += sizeof(SL2CAP_CommandConfigurationReq);
@ -577,7 +581,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == 2);
SL2CAP_OptionsMTU* pMTU = (SL2CAP_OptionsMTU*)&_pData[Offset];
rChannel.MTU = pMTU->MTU;
LOGV(WII_IPC_WIIMOTE, 1, " Config MTU: 0x%04x", pMTU->MTU);
INFO_LOG(WII_IPC_WIIMOTE, " Config MTU: 0x%04x", pMTU->MTU);
}
break;
@ -586,7 +590,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == 2);
SL2CAP_OptionsFlushTimeOut* pFlushTimeOut = (SL2CAP_OptionsFlushTimeOut*)&_pData[Offset];
rChannel.FlushTimeOut = pFlushTimeOut->TimeOut;
LOGV(WII_IPC_WIIMOTE, 1, " Config FlushTimeOut: 0x%04x", pFlushTimeOut->TimeOut);
INFO_LOG(WII_IPC_WIIMOTE, " Config FlushTimeOut: 0x%04x", pFlushTimeOut->TimeOut);
}
break;
@ -603,7 +607,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
}
SendCommandToACL(_Ident, L2CAP_CONF_RSP, RespLen, TempBuffer);
LOGV(WII_IPC_WIIMOTE, 1, "*******************************************************");
INFO_LOG(WII_IPC_WIIMOTE, "*******************************************************");
}
void CWII_IPC_HLE_WiiMote::CommandConnectionResponse(u8 _Ident, u8* _pData, u32 _Size)
@ -612,11 +616,11 @@ void CWII_IPC_HLE_WiiMote::CommandConnectionResponse(u8 _Ident, u8* _pData, u32
_dbg_assert_(WII_IPC_WIIMOTE, _Size == sizeof(l2cap_conn_rsp));
LOG(WII_IPC_WIIMOTE, " CommandConnectionResponse");
LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rsp->dcid);
LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
LOG(WII_IPC_WIIMOTE, " Status: 0x%04x", rsp->status);
INFO_LOG(WII_IPC_WIIMOTE, " CommandConnectionResponse");
DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", rsp->dcid);
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
DEBUG_LOG(WII_IPC_WIIMOTE, " Status: 0x%04x", rsp->status);
_dbg_assert_(WII_IPC_WIIMOTE, rsp->result == 0);
_dbg_assert_(WII_IPC_WIIMOTE, rsp->status == 0);
@ -639,10 +643,10 @@ void CWII_IPC_HLE_WiiMote::CommandConfigurationResponse(u8 _Ident, u8* _pData, u
_dbg_assert_(WII_IPC_WIIMOTE, _Size == sizeof(l2cap_conf_rsp));
LOG(WII_IPC_WIIMOTE, " CommandConfigurationResponse");
LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", rsp->flags);
LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
INFO_LOG(WII_IPC_WIIMOTE, " CommandConfigurationResponse");
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", rsp->scid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", rsp->flags);
DEBUG_LOG(WII_IPC_WIIMOTE, " Result: 0x%04x", rsp->result);
_dbg_assert_(WII_IPC_WIIMOTE, rsp->result == 0);
@ -662,10 +666,10 @@ void CWII_IPC_HLE_WiiMote::CommandDisconnectionReq(u8 _Ident, u8* _pData, u32 _S
// create the channel
_dbg_assert_(WII_IPC_WIIMOTE, m_Channel.find(pCommandDisconnectionReq->scid) != m_Channel.end());
LOG(WII_IPC_WIIMOTE, " CommandDisconnectionReq");
LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", pCommandDisconnectionReq->dcid);
LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandDisconnectionReq->scid);
INFO_LOG(WII_IPC_WIIMOTE, " CommandDisconnectionReq");
DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
DEBUG_LOG(WII_IPC_WIIMOTE, " SCID: 0x%04x", pCommandDisconnectionReq->dcid);
DEBUG_LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandDisconnectionReq->scid);
// response
SL2CAP_CommandDisconnectionResponse Rsp;
@ -700,9 +704,9 @@ void CWII_IPC_HLE_WiiMote::SendConnectionRequest(u16 scid, u16 psm)
cr.psm = psm;
cr.scid = scid;
LOG(WII_IPC_WIIMOTE, " SendConnectionRequest()");
LOG(WII_IPC_WIIMOTE, " Psm: 0x%04x", cr.psm);
LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid);
INFO_LOG(WII_IPC_WIIMOTE, " SendConnectionRequest()");
DEBUG_LOG(WII_IPC_WIIMOTE, " Psm: 0x%04x", cr.psm);
DEBUG_LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid);
SendCommandToACL(L2CAP_CONN_REQ, L2CAP_CONN_REQ, sizeof(l2cap_conn_req), (u8*)&cr);
}
@ -716,9 +720,9 @@ void CWII_IPC_HLE_WiiMote::SendDisconnectRequest(u16 scid)
cr.dcid = rChannel.DCID;
cr.scid = rChannel.SCID;
LOG(WII_IPC_WIIMOTE, " SendDisconnectionRequest()");
LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr.dcid);
LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid);
INFO_LOG(WII_IPC_WIIMOTE, " SendDisconnectionRequest()");
DEBUG_LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr.dcid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Scid: 0x%04x", cr.scid);
SendCommandToACL(L2CAP_DISCONN_REQ, L2CAP_DISCONN_REQ, sizeof(l2cap_disconn_req), (u8*)&cr);
}
@ -758,9 +762,9 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16* MTU, u16* Flu
*(u16*)&Buffer[Offset] = *FlushTimeOut; Offset += 2;
}
LOG(WII_IPC_WIIMOTE, " SendConfigurationRequest()");
LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr->dcid);
LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", cr->flags);
INFO_LOG(WII_IPC_WIIMOTE, " SendConfigurationRequest()");
DEBUG_LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr->dcid);
DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", cr->flags);
// hack:
static u8 ident = 99;
@ -834,8 +838,8 @@ u32 ParseCont(u8* pCont)
{
return 0x00;
}
PanicAlert("wrong cont: %i", typeID);
ERROR_LOG(WII_IPC_WIIMOTE,"ParseCont: wrong cont: %i", typeID);
PanicAlert("ParseCont: wrong cont: %i", typeID);
return 0;
}
@ -858,6 +862,7 @@ int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID)
{
_startID = attribList.Read16(attribOffset); attribOffset += 2;
_endID = _startID;
WARN_LOG(WII_IPC_WIIMOTE, "Read just a single attrib - not tested");
PanicAlert("Read just a single attrib - not tested");
}
@ -871,6 +876,7 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceAttributeResponse(u16 cid, u16 Transact
{
if (ServiceHandle != 0x10000)
{
ERROR_LOG(WII_IPC_WIIMOTE, "unknown service handle %x" , ServiceHandle);
PanicAlert("unknown service handle %x" , ServiceHandle);
}
@ -912,7 +918,7 @@ void CWII_IPC_HLE_WiiMote::HandleSDP(u16 cid, u8* _pData, u32 _Size)
// SDP_ServiceSearchRequest
case 0x02:
{
LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceSearchRequest !!!");
WARN_LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceSearchRequest !!!");
_dbg_assert_(WII_IPC_WIIMOTE, _Size == 13);
@ -929,7 +935,7 @@ void CWII_IPC_HLE_WiiMote::HandleSDP(u16 cid, u8* _pData, u32 _Size)
// SDP_ServiceAttributeRequest
case 0x04:
{
LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceAttributeRequest !!!");
WARN_LOG(WII_IPC_WIIMOTE, "!!! SDP_ServiceAttributeRequest !!!");
u16 startAttrID, endAttrID;
u32 offset = 1;
@ -946,7 +952,8 @@ void CWII_IPC_HLE_WiiMote::HandleSDP(u16 cid, u8* _pData, u32 _Size)
break;
default:
PanicAlert("Unknown SDP command %x", _pData[0]);
ERROR_LOG(WII_IPC_WIIMOTE, "WIIMOTE: Unknown SDP command %x", _pData[0]);
PanicAlert("WIIMOTE: Unknown SDP command %x", _pData[0]);
break;
}
}
@ -981,9 +988,9 @@ void CWII_IPC_HLE_WiiMote::SendCommandToACL(u8 _Ident, u8 _Code, u8 _CommandLeng
memcpy(&DataFrame[Offset], _pCommandData, _CommandLength);
LOG(WII_IPC_WIIMOTE, " SendCommandToACL (answer)");
LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
LOG(WII_IPC_WIIMOTE, " Code: 0x%02x", _Code);
WARN_LOG(WII_IPC_WIIMOTE, " SendCommandToACL (answer)");
DEBUG_LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
DEBUG_LOG(WII_IPC_WIIMOTE, " Code: 0x%02x", _Code);
// send ....
m_pHost->SendACLFrame(GetConnectionHandle(), DataFrame, pHeader->Length + sizeof(SL2CAP_Header));
@ -1032,14 +1039,14 @@ namespace Core
a reporting mode. _Size is the byte size of the report. */
void Callback_WiimoteInput(u16 _channelID, const void* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 3, "=========================================================");
DEBUG_LOG(WII_IPC_WIIMOTE, "=========================================================");
const u8* pData = (const u8*)_pData;
LOGV(WII_IPC_WIIMOTE, 3, "Callback_WiimoteInput:");
DEBUG_LOG(WII_IPC_WIIMOTE, "Callback_WiimoteInput:");
//std::string Temp = ArrayToString(pData, _Size, 0, 50);
//LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
//LOGV(WII_IPC_WIIMOTE, 3, " Channel: %u", _channelID);
s_Usb->m_WiiMotes[0].SendL2capData(_channelID, _pData, _Size);
LOGV(WII_IPC_WIIMOTE, 3, "=========================================================");
DEBUG_LOG(WII_IPC_WIIMOTE, "=========================================================");
}
}

View File

@ -148,7 +148,7 @@ void Run()
//2: check for breakpoint
if (BreakPoints::IsAddressBreakPoint(PC))
{
LOG(GEKKO, "Hit Breakpoint - %08x", PC);
INFO_LOG(GEKKO, "Hit Breakpoint - %08x", PC);
CCPU::Break();
if (BreakPoints::IsTempBreakPoint(PC))
BreakPoints::Remove(PC);

View File

@ -300,8 +300,8 @@ namespace CPUCompare
if ((been_here.find(PC)->second) & 1023)
return;
}
LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
printf("I'm here - PC = %08x , LR = %08x", PC, LR);
DEBUG_LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
//printf("I'm here - PC = %08x , LR = %08x", PC, LR);
been_here[PC] = 1;
}
@ -383,9 +383,10 @@ namespace CPUCompare
{
if (GetSpaceLeft() < 0x10000 || blocks.IsFull())
{
LOG(DYNA_REC, "JIT cache full - clearing.")
WARN_LOG(DYNA_REC, "JIT cache full - clearing.")
if (Core::g_CoreStartupParameter.bJITUnlimitedCache)
{
ERROR_LOG(DYNA_REC, "What? JIT cache still full - clearing.");
PanicAlert("What? JIT cache still full - clearing.");
}
ClearCache();

View File

@ -302,8 +302,8 @@ namespace CPUCompare
if ((been_here.find(PC)->second) & 1023)
return;
}
LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
printf("I'm here - PC = %08x , LR = %08x", PC, LR);
DEBUG_LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
// printf("I'm here - PC = %08x , LR = %08x", PC, LR);
been_here[PC] = 1;
}
@ -385,9 +385,10 @@ namespace CPUCompare
{
if (GetSpaceLeft() < 0x10000 || blocks.IsFull())
{
LOG(DYNA_REC, "JIT cache full - clearing.")
INFO_LOG(DYNA_REC, "JIT cache full - clearing.")
if (Core::g_CoreStartupParameter.bJITUnlimitedCache)
{
ERROR_LOG(DYNA_REC, "What? JIT cache still full - clearing.");
PanicAlert("What? JIT cache still full - clearing.");
}
ClearCache();

View File

@ -315,7 +315,7 @@ void JitBlockCache::GetBlockNumbersFromAddress(u32 em_address, std::vector<int>
//overwritten. We should have thrown it out before, on instruction cache invalidate or something.
//Not ne cessarily bad though , if a game has simply thrown away a lot of code and is now using the space
//for something else, then it's fine.
LOG(MASTER_LOG, "WARNING - ClearCache detected code overwrite @ %08x", blocks[blocknum].originalAddress);
WARN_LOG(MASTER_LOG, "WARNING - ClearCache detected code overwrite @ %08x", blocks[blocknum].originalAddress);
}
// We don't unlink blocks, we just send anyone who tries to run them back to the dispatcher.

View File

@ -625,7 +625,7 @@ void FindFunctions(u32 startAddr, u32 endAddr, SymbolDB *func_db)
{
if (iter->second.address == 4)
{
LOG(HLE, "weird function");
WARN_LOG(HLE, "weird function");
continue;
}
AnalyzeFunction2(&(iter->second));
@ -675,8 +675,8 @@ void FindFunctions(u32 startAddr, u32 endAddr, SymbolDB *func_db)
else
unniceSize /= numUnNice;
LOG(HLE, "Functions analyzed. %i leafs, %i nice, %i unnice. %i timer, %i rfi. %i are branchless leafs.",numLeafs,numNice,numUnNice,numTimer,numRFI,numStraightLeaf);
LOG(HLE, "Average size: %i (leaf), %i (nice), %i(unnice)", leafSize, niceSize, unniceSize);
INFO_LOG(HLE, "Functions analyzed. %i leafs, %i nice, %i unnice. %i timer, %i rfi. %i are branchless leafs.",numLeafs,numNice,numUnNice,numTimer,numRFI,numStraightLeaf);
INFO_LOG(HLE, "Average size: %i (leaf), %i (nice), %i(unnice)", leafSize, niceSize, unniceSize);
}
} // namespace

View File

@ -739,7 +739,7 @@ void PrintInstructionRunCounts()
{
if (temp[i].count == 0)
break;
LOG(GEKKO, "%s : %i", temp[i].name,temp[i].count);
DEBUG_LOG(GEKKO, "%s : %i", temp[i].name,temp[i].count);
//PanicAlert("%s : %i", temp[i].name,temp[i].count);
}
}

View File

@ -220,7 +220,7 @@ void CheckExceptions()
SRR1 = MSR & 0x0780FF77;
NPC = 0x80000800;
LOGV(GEKKO, 1, "EXCEPTION_FPU_UNAVAILABLE");
WARN_LOG(GEKKO, "EXCEPTION_FPU_UNAVAILABLE");
ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE;
SRR1 |= 0x02; //recoverable
}
@ -230,7 +230,7 @@ void CheckExceptions()
SRR1 = MSR & 0x0780FF77;
NPC = 0x80000C00;
LOGV(GEKKO, 1, "EXCEPTION_SYSCALL (PC=%08x)", PC);
WARN_LOG(GEKKO, "EXCEPTION_SYSCALL (PC=%08x)", PC);
ppcState.Exceptions &= ~EXCEPTION_SYSCALL;
SRR1 |= 0x02; //recoverable
}
@ -240,7 +240,7 @@ void CheckExceptions()
SRR1 = MSR & 0x0780FF77;
NPC = 0x80000300;
LOGV(GEKKO, 1, "EXCEPTION_DSI");
WARN_LOG(GEKKO, "EXCEPTION_DSI");
ppcState.Exceptions &= ~EXCEPTION_DSI;
//SRR1 |= 0x02; //make recoverable ?
}
@ -250,7 +250,7 @@ void CheckExceptions()
SRR1 = (MSR & 0x0780FF77) | 0x40000000;
NPC = 0x80000400;
LOG(GEKKO, "EXCEPTION_ISI");
INFO_LOG(GEKKO, "EXCEPTION_ISI");
ppcState.Exceptions &= ~EXCEPTION_ISI;
//SRR1 |= 0x02; //make recoverable ?
}
@ -261,7 +261,7 @@ void CheckExceptions()
SRR1 = MSR & 0x0780FF77;
NPC = 0x80000600;
LOG(GEKKO, "EXCEPTION_ALIGNMENT");
INFO_LOG(GEKKO, "EXCEPTION_ALIGNMENT");
ppcState.Exceptions &= ~EXCEPTION_ALIGNMENT;
//SRR1 |= 0x02; //make recoverable ?
}
@ -278,7 +278,7 @@ void CheckExceptions()
NPC = 0x80000500;
SRR1 = (MSR & 0x0780FF77);
LOGV(GEKKO, 1, "EXCEPTION_EXTERNAL_INT");
WARN_LOG(GEKKO, "EXCEPTION_EXTERNAL_INT");
SRR1 |= 0x02; //set it to recoverable
_dbg_assert_msg_(GEKKO, (SRR1 & 0x02) != 0, "GEKKO", "EXTERNAL_INT unrecoverable???"); // unrecoverable exception !?!
@ -291,13 +291,13 @@ void CheckExceptions()
ppcState.Exceptions &= ~EXCEPTION_DECREMENTER;
LOGV(GEKKO, 1, "EXCEPTION_DECREMENTER");
WARN_LOG(GEKKO, "EXCEPTION_DECREMENTER");
SRR1 |= 0x02; //make recoverable
}
else
{
_dbg_assert_msg_(GEKKO, 0, "Unknown EXT interrupt: Exceptions == %08x", ppcState.Exceptions);
LOG(GEKKO, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", ppcState.Exceptions);
ERROR_LOG(GEKKO, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", ppcState.Exceptions);
}
}
MSR &= ~0x0008000; // clear EE-bit so interrupts aren't possible anymore

View File

@ -63,7 +63,7 @@ bool SignatureDB::Save(const char *filename)
FILE *f = fopen(filename,"wb");
if (!f)
{
LOG(HLE, "Database save failed");
ERROR_LOG(HLE, "Database save failed");
return false;
}
int fcount = (int)database.size();
@ -78,7 +78,7 @@ bool SignatureDB::Save(const char *filename)
fwrite(&temp, sizeof(temp), 1, f);
}
fclose(f);
LOG(HLE,"Database save successful");
INFO_LOG(HLE,"Database save successful");
return true;
}
@ -101,9 +101,9 @@ void SignatureDB::List()
{
for (FuncDB::iterator iter = database.begin(); iter != database.end(); iter++)
{
LOG(HLE,"%s : %i bytes, hash = %08x",iter->second.name.c_str(), iter->second.size, iter->first);
INFO_LOG(HLE,"%s : %i bytes, hash = %08x",iter->second.name.c_str(), iter->second.size, iter->first);
}
LOG(HLE, "%i functions known in current database.", database.size());
INFO_LOG(HLE, "%i functions known in current database.", database.size());
}
void SignatureDB::Clear()
@ -123,12 +123,12 @@ void SignatureDB::Apply(SymbolDB *symbol_db)
if (iter->second.size == (unsigned int)function->size)
{
function->name = iter->second.name;
LOGV(HLE, 1, "Found %s at %08x (size: %08x)!", iter->second.name.c_str(), function->address, function->size);
INFO_LOG(HLE, "Found %s at %08x (size: %08x)!", iter->second.name.c_str(), function->address, function->size);
}
else
{
function->name = iter->second.name;
LOG(HLE, "Wrong sizzze! Found %s at %08x (size: %08x instead of %08x)!", iter->second.name.c_str(), function->address, function->size, iter->second.size);
ERROR_LOG(HLE, "Wrong sizzze! Found %s at %08x (size: %08x instead of %08x)!", iter->second.name.c_str(), function->address, function->size, iter->second.size);
}
}
}

View File

@ -42,9 +42,9 @@ void SymbolDB::List()
{
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); iter++)
{
LOG(HLE,"%s @ %08x: %i bytes (hash %08x) : %i calls", iter->second.name.c_str(), iter->second.address, iter->second.size, iter->second.hash,iter->second.numCalls);
DEBUG_LOG(HLE,"%s @ %08x: %i bytes (hash %08x) : %i calls", iter->second.name.c_str(), iter->second.address, iter->second.size, iter->second.hash,iter->second.numCalls);
}
LOG(HLE,"%i functions known in this program above.", functions.size());
INFO_LOG(HLE,"%i functions known in this program above.", functions.size());
}
void SymbolDB::Clear(const char *prefix)
@ -189,19 +189,19 @@ void SymbolDB::PrintCalls(u32 funcAddr) const
if (iter != functions.end())
{
const Symbol &f = iter->second;
LOG(HLE, "The function %s at %08x calls:", f.name.c_str(), f.address);
INFO_LOG(HLE, "The function %s at %08x calls:", f.name.c_str(), f.address);
for (std::vector<SCall>::const_iterator fiter = f.calls.begin(); fiter!=f.calls.end(); fiter++)
{
XFuncMap::const_iterator n = functions.find(fiter->function);
if (n != functions.end())
{
LOG(CONSOLE,"* %08x : %s", fiter->callAddress, n->second.name.c_str());
INFO_LOG(CONSOLE,"* %08x : %s", fiter->callAddress, n->second.name.c_str());
}
}
}
else
{
LOG(CONSOLE, "Symbol does not exist");
WARN_LOG(CONSOLE, "Symbol does not exist");
}
}
@ -211,13 +211,13 @@ void SymbolDB::PrintCallers(u32 funcAddr) const
if (iter != functions.end())
{
const Symbol &f = iter->second;
LOG(CONSOLE,"The function %s at %08x is called by:",f.name.c_str(),f.address);
INFO_LOG(CONSOLE,"The function %s at %08x is called by:",f.name.c_str(),f.address);
for (std::vector<SCall>::const_iterator fiter = f.callers.begin(); fiter != f.callers.end(); fiter++)
{
XFuncMap::const_iterator n = functions.find(fiter->function);
if (n != functions.end())
{
LOG(CONSOLE,"* %08x : %s", fiter->callAddress, n->second.name.c_str());
INFO_LOG(CONSOLE,"* %08x : %s", fiter->callAddress, n->second.name.c_str());
}
}
}

View File

@ -81,7 +81,7 @@ int SyncTrace()
{
if (PowerPC::ppcState.gpr[i] != state.gpr[i])
{
LOG(GEKKO, "DIFFERENCE - r%i (local %08x, remote %08x)", i, PowerPC::ppcState.gpr[i], state.gpr[i]);
DEBUG_LOG(GEKKO, "DIFFERENCE - r%i (local %08x, remote %08x)", i, PowerPC::ppcState.gpr[i], state.gpr[i]);
difference = true;
}
}

View File

@ -184,7 +184,7 @@ void CLogWindow::OnClear(wxCommandEvent& event)
if (Core::GetState() != Core::CORE_UNINITIALIZED) // avoid crash
{
LogManager::Clear();
LOG(MASTER_LOG, "(log cleared).");
INFO_LOG(MASTER_LOG, "(log cleared).");
NotifyUpdate();
}
}

View File

@ -108,9 +108,9 @@ void HandleGLError();
#ifdef _WIN32
#define PRIM_LOG(...) {LOG(VIDEO, __VA_ARGS__)}
#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, __VA_ARGS__)}
#else
#define PRIM_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)}
#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, ##__VA_ARGS__)}
#endif
#ifdef LOGGING

View File

@ -89,12 +89,12 @@ namespace WiiMoteEmu
// ----------------
void WmDataReporting(u16 _channelID, wm_data_reporting* dr)
{
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
LOG(WII_IPC_WIIMOTE, " Set Data reporting mode");
LOG(WII_IPC_WIIMOTE, " Rumble: %x", dr->rumble);
LOG(WII_IPC_WIIMOTE, " Continuous: %x", dr->continuous);
LOG(WII_IPC_WIIMOTE, " All The Time: %x (not only on data change)", dr->all_the_time);
LOG(WII_IPC_WIIMOTE, " Mode: 0x%02x", dr->mode);
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
DEBUG_LOG(WII_IPC_WIIMOTE, " Set Data reporting mode");
DEBUG_LOG(WII_IPC_WIIMOTE, " Rumble: %x", dr->rumble);
DEBUG_LOG(WII_IPC_WIIMOTE, " Continuous: %x", dr->continuous);
DEBUG_LOG(WII_IPC_WIIMOTE, " All The Time: %x (not only on data change)", dr->all_the_time);
DEBUG_LOG(WII_IPC_WIIMOTE, " Mode: 0x%02x", dr->mode);
Console::Print("Data reporting:\n");
Console::Print(" Continuous: %x\n", dr->continuous);
Console::Print(" All The Time: %x (not only on data change)\n", dr->all_the_time);
@ -117,7 +117,7 @@ void WmDataReporting(u16 _channelID, wm_data_reporting* dr)
// WmSendAck(_channelID, WM_DATA_REPORTING);
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
}
@ -137,7 +137,7 @@ void SendReportCore(u16 _channelID)
FillReportInfo(pReport->c);
#endif
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCore()");
INFO_LOG(WII_IPC_WIIMOTE, " SendReportCore()");
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
@ -163,9 +163,9 @@ void SendReportCoreAccel(u16 _channelID)
FillReportAcc(pReport->a);
#endif
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccel (0x31)");
LOGV(WII_IPC_WIIMOTE, 2, " Channel: %04x", _channelID);
LOGV(WII_IPC_WIIMOTE, 2, " Offset: %08x", Offset);
INFO_LOG(WII_IPC_WIIMOTE, " SendReportCoreAccel (0x31)");
INFO_LOG(WII_IPC_WIIMOTE, " Channel: %04x", _channelID);
INFO_LOG(WII_IPC_WIIMOTE, " Offset: %08x", Offset);
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
@ -195,8 +195,8 @@ void SendReportCoreAccelIr12(u16 _channelID) {
memset(&pReport->ir[2], 0xff, sizeof(wm_ir_extended));
memset(&pReport->ir[3], 0xff, sizeof(wm_ir_extended));
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccelIr12()");
LOGV(WII_IPC_WIIMOTE, 2, " Offset: %08x", Offset);
INFO_LOG(WII_IPC_WIIMOTE, " SendReportCoreAccelIr12()");
INFO_LOG(WII_IPC_WIIMOTE, " Offset: %08x", Offset);
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
@ -241,9 +241,9 @@ void SendReportCoreAccelExt16(u16 _channelID)
memcpy(&pReport->ext, &_ext, sizeof(_ext));
}
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccelExt16 (0x35)");
LOGV(WII_IPC_WIIMOTE, 2, " Channel: %04x", _channelID);
LOGV(WII_IPC_WIIMOTE, 2, " Offset: %08x", Offset);
INFO_LOG(WII_IPC_WIIMOTE, " SendReportCoreAccelExt16 (0x35)");
INFO_LOG(WII_IPC_WIIMOTE, " Channel: %04x", _channelID);
INFO_LOG(WII_IPC_WIIMOTE, " Offset: %08x", Offset);
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
@ -289,7 +289,7 @@ void SendReportCoreAccelIr10Ext(u16 _channelID)
memcpy(&pReport->ext, &_ext, sizeof(_ext));
}
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccelIr10Ext()");
INFO_LOG(WII_IPC_WIIMOTE, " SendReportCoreAccelIr10Ext()");
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);

View File

@ -597,8 +597,8 @@ void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
{
//Console::Print("Emu InterruptChannel\n");
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
LOGV(WII_IPC_WIIMOTE, 3, "Wiimote_Input");
DEBUG_LOG(WII_IPC_WIIMOTE, "=============================================================");
DEBUG_LOG(WII_IPC_WIIMOTE, "Wiimote_Input");
const u8* data = (const u8*)_pData;
/* Debugging. We have not yet decided how much of 'data' we will use, it's not determined
@ -639,6 +639,7 @@ void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE, "HidInput: HID_TYPE_DATA - param 0x%02x", hidp->type, hidp->param);
PanicAlert("HidInput: HID_TYPE_DATA - param 0x%02x", hidp->type, hidp->param);
break;
}
@ -646,10 +647,11 @@ void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE,"HidInput: Unknown type 0x%02x and param 0x%02x", hidp->type, hidp->param);
PanicAlert("HidInput: Unknown type 0x%02x and param 0x%02x", hidp->type, hidp->param);
break;
}
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
DEBUG_LOG(WII_IPC_WIIMOTE, "=============================================================");
}
@ -660,12 +662,12 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
const u8* data = (const u8*)_pData;
// Dump raw data
{
LOG(WII_IPC_WIIMOTE, "Wiimote_ControlChannel");
INFO_LOG(WII_IPC_WIIMOTE, "Wiimote_ControlChannel");
std::string Temp = ArrayToString(data, 0, _Size);
#if defined(HAVE_WX) && HAVE_WX
Console::Print("\n%s: ControlChannel: %s\n", Tm().c_str(), Temp.c_str());
#endif
LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str());
DEBUG_LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str());
}
hid_packet* hidp = (hid_packet*) data;
@ -674,18 +676,21 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
case HID_TYPE_HANDSHAKE:
if (hidp->param == HID_PARAM_INPUT)
{
ERROR_LOG(WII_IPC_WIIMOTE, "HID_TYPE_HANDSHAKE - HID_PARAM_INPUT");
PanicAlert("HID_TYPE_HANDSHAKE - HID_PARAM_INPUT");
}
else
{
PanicAlert("HID_TYPE_HANDSHAKE - HID_PARAM_OUTPUT");
ERROR_LOG(WII_IPC_WIIMOTE, "HID_TYPE_HANDSHAKE - HID_PARAM_OUTPUT");
PanicAlert("HID_TYPE_HANDSHAKE - HID_PARAM_OUTPUT");
}
break;
case HID_TYPE_SET_REPORT:
if (hidp->param == HID_PARAM_INPUT)
{
PanicAlert("HID_TYPE_SET_REPORT input");
ERROR_LOG(WII_IPC_WIIMOTE, "HID_TYPE_SET_REPORT input");
PanicAlert("HID_TYPE_SET_REPORT input");
}
else
{
@ -698,10 +703,12 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
break;
case HID_TYPE_DATA:
ERROR_LOG(WII_IPC_WIIMOTE, "HID_TYPE_DATA %s", hidp->type, hidp->param == HID_PARAM_INPUT ? "input" : "output");
PanicAlert("HID_TYPE_DATA %s", hidp->type, hidp->param == HID_PARAM_INPUT ? "input" : "output");
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE, "HidControlChannel: Unknown type %x and param %x", hidp->type, hidp->param);
PanicAlert("HidControlChannel: Unknown type %x and param %x", hidp->type, hidp->param);
break;
}

View File

@ -78,14 +78,14 @@ namespace WiiMoteEmu
0x6 = Enable */
// ----------------
void HidOutputReport(u16 _channelID, wm_report* sr) {
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
LOGV(WII_IPC_WIIMOTE, 0, "HidOutputReport (0x%02x)", sr->channel);
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "HidOutputReport (0x%02x)", sr->channel);
std::string Temp;
switch(sr->channel)
{
case 0x10:
LOGV(WII_IPC_WIIMOTE, 0, "HidOutputReport: unknown sr->channel 0x10");
ERROR_LOG(WII_IPC_WIIMOTE, "HidOutputReport: unknown sr->channel 0x10");
break;
case WM_LEDS: // 0x11
WmLeds(_channelID, (wm_leds*)sr->data);
@ -106,7 +106,7 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
so that WmRequestStatus() knows about it */
case WM_IR_PIXEL_CLOCK: // 0x13
case WM_IR_LOGIC: // 0x1a
LOGV(WII_IPC_WIIMOTE, 0, " IR Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
WARN_LOG(WII_IPC_WIIMOTE, " IR Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
Console::Print("IR Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
if(sr->data[0] == 0x02) g_IR = 0;
else if(sr->data[0] == 0x06) g_IR = 1;
@ -117,13 +117,13 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
break;
case WM_SPEAKER_ENABLE: // 0x14
LOGV(WII_IPC_WIIMOTE, 1, " WM Speaker Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
INFO_LOG(WII_IPC_WIIMOTE, " WM Speaker Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
//Console::Print("Speaker Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
if(sr->data[0] == 0x02) g_Speaker = 0;
else if(sr->data[0] == 0x06) g_Speaker = 1;
break;
case WM_SPEAKER_MUTE: // 0x19
LOGV(WII_IPC_WIIMOTE, 1, " WM Mute Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
INFO_LOG(WII_IPC_WIIMOTE, " WM Mute Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
//Console::Print("Speaker Mute/Unmute 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
if(sr->data[0] == 0x02) g_SpeakerVoice = 0; // g_SpeakerVoice
else if(sr->data[0] == 0x06) g_SpeakerVoice = 1;
@ -132,10 +132,11 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE, "HidOutputReport: Unknown channel 0x%02x", sr->channel);
PanicAlert("HidOutputReport: Unknown channel 0x%02x", sr->channel);
return;
}
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
}
@ -164,14 +165,14 @@ int WriteWmReport(u8* dst, u8 channel)
/* LED (blue lights) report. */
// ----------------
void WmLeds(u16 _channelID, wm_leds* leds) {
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
LOG(WII_IPC_WIIMOTE, " Set LEDs");
LOG(WII_IPC_WIIMOTE, " Leds: %x", leds->leds);
LOG(WII_IPC_WIIMOTE, " Rumble: %x", leds->rumble);
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, " Set LEDs");
INFO_LOG(WII_IPC_WIIMOTE, " Leds: %x", leds->leds);
INFO_LOG(WII_IPC_WIIMOTE, " Rumble: %x", leds->rumble);
g_Leds = leds->leds;
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
}
@ -199,8 +200,8 @@ void WmSendAck(u16 _channelID, u8 _reportID, u32 address)
pData->errorID = 0;
Offset += sizeof(wm_acknowledge);
LOGV(WII_IPC_WIIMOTE, 2, " WMSendAck()");
LOGV(WII_IPC_WIIMOTE, 2, " Report ID: %02x", _reportID);
INFO_LOG(WII_IPC_WIIMOTE, " WMSendAck()");
INFO_LOG(WII_IPC_WIIMOTE, " Report ID: %02x", _reportID);
//std::string Temp = ArrayToString(DataFrame, Offset, 0);
//LOGV(WII_IPC_WIIMOTE, 2, " Data: %s", Temp.c_str());
//Console::Print("%s: WMSendAck: %s\n", Tm(true).c_str(), Temp.c_str());
@ -224,15 +225,15 @@ void WmSendAck(u16 _channelID, u8 _reportID, u32 address)
// ----------------
void WmReadData(u16 _channelID, wm_read_data* rd)
{
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, 0, "===========================================================");
u32 address = convert24bit(rd->address);
u16 size = convert16bit(rd->size);
std::string Temp;
LOG(WII_IPC_WIIMOTE, "Read data");
LOG(WII_IPC_WIIMOTE, " Address space: %x", rd->space);
LOG(WII_IPC_WIIMOTE, " Address: 0x%06x", address);
LOG(WII_IPC_WIIMOTE, " Size: 0x%04x", size);
LOG(WII_IPC_WIIMOTE, " Rumble: %x", rd->rumble);
INFO_LOG(WII_IPC_WIIMOTE, "Read data");
INFO_LOG(WII_IPC_WIIMOTE, " Address space: %x", rd->space);
INFO_LOG(WII_IPC_WIIMOTE, " Address: 0x%06x", address);
INFO_LOG(WII_IPC_WIIMOTE, " Size: 0x%04x", size);
INFO_LOG(WII_IPC_WIIMOTE, " Rumble: %x", rd->rumble);
//u32 _address = address;
std::string Tmp; // Debugging
@ -259,7 +260,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
case 0xA2:
block = g_RegSpeaker;
blockSize = WIIMOTE_REG_SPEAKER_SIZE;
LOGV(WII_IPC_WIIMOTE, 0, " Case 0xa2: g_RegSpeaker");
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa2: g_RegSpeaker");
/*Tmp = ArrayToString(g_RegSpeaker, size, (address & 0xffff));
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
Console::Print("Read RegSpkr: Size %i Address %08x Offset %08x\nData %s\n",
@ -268,7 +269,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
case 0xA4:
block = g_RegExt;
blockSize = WIIMOTE_REG_EXT_SIZE;
LOGV(WII_IPC_WIIMOTE, 0, " Case 0xa4: Read ExtReg");
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa4: Read ExtReg");
/*Tmp = ArrayToString(g_RegExt, size, (address & 0xffff), 40);
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
Console::Print("Read RegExt: Size %i Address %08x Offset %08x\nData %s\n",
@ -277,13 +278,14 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
case 0xB0:
block = g_RegIr;
blockSize = WIIMOTE_REG_IR_SIZE;
LOGV(WII_IPC_WIIMOTE, 0, " Case: 0xb0 g_RegIr");
INFO_LOG(WII_IPC_WIIMOTE, " Case: 0xb0 g_RegIr");
/*Tmp = ArrayToString(g_RegIr, size, (address & 0xffff));
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
Console::Print("Read RegIR: Size %i Address %08x Offset %08x\nData %s\n",
size, address, (address & 0xffff), Tmp.c_str());*/
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: bad register block!");
PanicAlert("WmWriteData: bad register block!");
return;
}
@ -336,7 +338,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
PanicAlert("WmReadData: unimplemented parameters (size: %i, addr: 0x%x!", size, rd->space);
}
LOGV(WII_IPC_WIIMOTE, 0, "===========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "===========================================================");
}
// ===================================================
/* Here we produce the actual 0x21 Input report that we send to the Wii. The message
@ -353,7 +355,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
// ----------------
void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _Size)
{
LOGV(WII_IPC_WIIMOTE, 0, "=========================================");
INFO_LOG(WII_IPC_WIIMOTE, "=========================================");
int dataOffset = 0;
const u8* data = (const u8*)_Base;
@ -398,11 +400,11 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _Size)
}
// Logging
LOG(WII_IPC_WIIMOTE, " SendReadDataReply()");
LOG(WII_IPC_WIIMOTE, " Buttons: 0x%04x", pReply->buttons);
LOG(WII_IPC_WIIMOTE, " Error: 0x%x", pReply->error);
LOG(WII_IPC_WIIMOTE, " Size: 0x%x", pReply->size);
LOG(WII_IPC_WIIMOTE, " Address: 0x%04x", pReply->address);
INFO_LOG(WII_IPC_WIIMOTE, " SendReadDataReply()");
DEBUG_LOG(WII_IPC_WIIMOTE, " Buttons: 0x%04x", pReply->buttons);
DEBUG_LOG(WII_IPC_WIIMOTE, " Error: 0x%x", pReply->error);
DEBUG_LOG(WII_IPC_WIIMOTE, " Size: 0x%x", pReply->size);
DEBUG_LOG(WII_IPC_WIIMOTE, " Address: 0x%04x", pReply->address);
/*Console::Print(" SendReadDataReply()\n");
Console::Print(" Offset: 0x%x\n", Offset);
Console::Print(" dataOffset: 0x%x\n", dataOffset);
@ -421,9 +423,11 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _Size)
ReadDebugging(true, DataFrame, Offset);
}
if (_Size != 0)
if (_Size != 0) {
ERROR_LOG(WII_IPC_WIIMOTE, "WiiMote-Plugin: SendReadDataReply() failed");
PanicAlert("WiiMote-Plugin: SendReadDataReply() failed");
LOGV(WII_IPC_WIIMOTE, 0, "==========================================");
}
INFO_LOG(WII_IPC_WIIMOTE, "==========================================");
}
// ================
@ -433,13 +437,13 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _Size)
// ----------------
void WmWriteData(u16 _channelID, wm_write_data* wd)
{
LOGV(WII_IPC_WIIMOTE, 0, "========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "========================================================");
u32 address = convert24bit(wd->address);
LOG(WII_IPC_WIIMOTE, "Write data");
LOG(WII_IPC_WIIMOTE, " Address space: %x", wd->space);
LOG(WII_IPC_WIIMOTE, " Address: 0x%06x", address);
LOG(WII_IPC_WIIMOTE, " Size: 0x%02x", wd->size);
LOG(WII_IPC_WIIMOTE, " Rumble: %x", wd->rumble);
INFO_LOG(WII_IPC_WIIMOTE, "Write data");
DEBUG_LOG(WII_IPC_WIIMOTE, " Address space: %x", wd->space);
DEBUG_LOG(WII_IPC_WIIMOTE, " Address: 0x%06x", address);
DEBUG_LOG(WII_IPC_WIIMOTE, " Size: 0x%02x", wd->size);
DEBUG_LOG(WII_IPC_WIIMOTE, " Rumble: %x", wd->rumble);
//std::string Temp = ArrayToString(wd->data, wd->size);
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
@ -447,6 +451,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
if(wd->size <= 16 && wd->space == WM_SPACE_EEPROM)
{
if(address + wd->size > WIIMOTE_EEPROM_SIZE) {
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: address + size out of bounds!");
PanicAlert("WmWriteData: address + size out of bounds!");
return;
}
@ -464,7 +469,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
case 0xA2:
block = g_RegSpeaker;
blockSize = WIIMOTE_REG_SPEAKER_SIZE;
LOGV(WII_IPC_WIIMOTE, 0, " Case 0xa2: RegSpeaker");
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa2: RegSpeaker");
/*Console::Print("Write RegSpeaker: Size: %i, Address: %08x, Offset: %08x\n",
wd->size, address, (address & 0xffff));
Console::Print("Data: %s\n", Temp.c_str());*/
@ -473,7 +478,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
block = g_RegExt; // Extension Controller register
blockSize = WIIMOTE_REG_EXT_SIZE;
//LOGV(WII_IPC_WIIMOTE, 0, " *******************************************************");
LOGV(WII_IPC_WIIMOTE, 0, " Case 0xa4: ExtReg");
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa4: ExtReg");
//LOGV(WII_IPC_WIIMOTE, 0, " *******************************************************");
/*Console::Print("Write RegExt Size: %i Address: %08x Offset: %08x \n",
wd->size, address, (address & 0xffff));
@ -482,12 +487,13 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
case 0xB0:
block = g_RegIr;
blockSize = WIIMOTE_REG_IR_SIZE;
LOGV(WII_IPC_WIIMOTE, 0, " Case 0xb0: RegIr");
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xb0: RegIr");
/*Console::Print("Write RegIR Size: %i Address: %08x Offset: %08x \n",
wd->size, address, (address & 0xffff));
Console::Print("Data: %s\n", Temp.c_str());*/
break;
default:
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: bad register block!");
PanicAlert("WmWriteData: bad register block!");
return;
}
@ -497,6 +503,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
// Check if the address is within bounds
if(address + wd->size > blockSize) {
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: address + size out of bounds!");
PanicAlert("WmWriteData: address + size out of bounds!");
return;
}
@ -524,6 +531,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
} else {
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: unimplemented parameters!");
PanicAlert("WmWriteData: unimplemented parameters!");
}
@ -531,7 +539,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
InterruptChannel()? Or is there a separate route here that don't pass though
InterruptChannel()? */
//WmSendAck(_channelID, WM_WRITE_DATA, _address);
LOGV(WII_IPC_WIIMOTE, 0, "==========================================================");
INFO_LOG(WII_IPC_WIIMOTE, "==========================================================");
}
// ===================================================
@ -542,10 +550,10 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
void WmRequestStatus(u16 _channelID, wm_request_status* rs, int Extension)
{
//PanicAlert("WmRequestStatus");
LOGV(WII_IPC_WIIMOTE, 0, "================================================");
LOGV(WII_IPC_WIIMOTE, 0, " Request Status");
LOGV(WII_IPC_WIIMOTE, 0, " Rumble: %x", rs->rumble);
LOGV(WII_IPC_WIIMOTE, 0, " Channel: %04x", _channelID);
INFO_LOG(WII_IPC_WIIMOTE, "================================================");
INFO_LOG(WII_IPC_WIIMOTE, " Request Status");
INFO_LOG(WII_IPC_WIIMOTE, " Rumble: %x", rs->rumble);
INFO_LOG(WII_IPC_WIIMOTE, " Channel: %04x", _channelID);
//SendStatusReport();
u8 DataFrame[1024];
@ -584,13 +592,13 @@ void WmRequestStatus(u16 _channelID, wm_request_status* rs, int Extension)
pStatus->extension = 0;
}
LOGV(WII_IPC_WIIMOTE, 0, " Extension: %x", pStatus->extension);
LOGV(WII_IPC_WIIMOTE, 0, " SendStatusReport()");
LOGV(WII_IPC_WIIMOTE, 0, " Flags: 0x%02x", pStatus->padding1[2]);
LOGV(WII_IPC_WIIMOTE, 0, " Battery: %d", pStatus->battery);
INFO_LOG(WII_IPC_WIIMOTE, " Extension: %x", pStatus->extension);
INFO_LOG(WII_IPC_WIIMOTE, " SendStatusReport()");
DEBUG_LOG(WII_IPC_WIIMOTE, " Flags: 0x%02x", pStatus->padding1[2]);
DEBUG_LOG(WII_IPC_WIIMOTE, " Battery: %d", pStatus->battery);
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
LOGV(WII_IPC_WIIMOTE, 0, "=================================================");
INFO_LOG(WII_IPC_WIIMOTE, "=================================================");
// Debugging
ReadDebugging(true, DataFrame, Offset);