Merge pull request #1497 from lioncash/host

Host: Kill off Host_SysMessage
This commit is contained in:
Lioncash 2014-11-06 20:41:53 -05:00
commit f6b4b4dbba
9 changed files with 34 additions and 97 deletions

View File

@ -10,7 +10,7 @@
#include <string>
#ifdef ANDROID
#include "Core/Host.h"
#include <android/log.h>
#endif
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
@ -141,7 +141,7 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
LogTypes::LOG_LEVEL_TO_CHAR[(int)level],
log->GetShortName().c_str(), temp);
#ifdef ANDROID
Host_SysMessage(msg.c_str());
__android_log_write(ANDROID_LOG_INFO, "Dolphinemu", msg.c_str());
#endif
log->Trigger(level, msg.c_str());
}

View File

@ -34,7 +34,6 @@ void Host_RequestRenderWindowSize(int width, int height);
void Host_RequestFullscreen(bool enable_fullscreen);
void Host_SetStartupDebuggingParameters();
void Host_SetWiiMoteConnectionState(int _State);
void Host_SysMessage(const char *fmt, ...);
void Host_UpdateDisasmDialog();
void Host_UpdateMainFrame();
void Host_UpdateTitle(const std::string& title);

View File

@ -13,20 +13,6 @@
#include "DolphinQt/MainWindow.h"
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n')
msg[strlen(msg)-1] = '\0';
PanicAlert("%s", msg);
}
void Host_Message(int id)
{
// TODO

View File

@ -435,20 +435,6 @@ void DolphinApp::OnFatalException()
// ------------
// Talk to GUI
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
//wxMessageBox(StrToWxStr(msg));
PanicAlert("%s", msg);
}
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
{
#ifdef __WXGTK__

View File

@ -106,15 +106,6 @@ bool Host_RendererHasFocus()
void Host_ConnectWiimote(int wm_idx, bool connect) {}
void Host_SysMessage(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
__android_log_vprint(ANDROID_LOG_INFO, DOLPHIN_TAG, fmt, args);
va_end(args);
}
void Host_SetWiiMoteConnectionState(int _State) {}
void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}

View File

@ -104,25 +104,6 @@ bool Host_RendererHasFocus()
void Host_ConnectWiimote(int wm_idx, bool connect) {}
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
size_t len = strlen(msg);
if (msg[len - 1] != '\n')
{
msg[len - 1] = '\n';
msg[len] = '\0';
}
fprintf(stderr, "%s", msg);
}
void Host_SetWiiMoteConnectionState(int _State) {}
void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}

View File

@ -89,43 +89,39 @@ static void InterpretDisplayListPreprocess(u32 address, u32 size)
static void UnknownOpcode(u8 cmd_byte, void *buffer, bool preprocess)
{
// TODO(Omega): Maybe dump FIFO to file on this error
std::string temp = StringFromFormat(
"GFX FIFO: Unknown Opcode (0x%x @ %p, preprocessing=%s).\n"
"This means one of the following:\n"
"* The emulated GPU got desynced, disabling dual core can help\n"
"* Command stream corrupted by some spurious memory bug\n"
"* This really is an unknown opcode (unlikely)\n"
"* Some other sort of bug\n\n"
"Dolphin will now likely crash or hang. Enjoy." ,
cmd_byte,
buffer,
preprocess ? "yes" : "no");
Host_SysMessage(temp.c_str());
INFO_LOG(VIDEO, "%s", temp.c_str());
PanicAlert(
"GFX FIFO: Unknown Opcode (0x%x @ %p, preprocessing=%s).\n"
"This means one of the following:\n"
"* The emulated GPU got desynced, disabling dual core can help\n"
"* Command stream corrupted by some spurious memory bug\n"
"* This really is an unknown opcode (unlikely)\n"
"* Some other sort of bug\n\n"
"Dolphin will now likely crash or hang. Enjoy." ,
cmd_byte,
buffer,
preprocess ? "yes" : "no");
{
SCPFifoStruct &fifo = CommandProcessor::fifo;
std::string tmp = StringFromFormat(
"Illegal command %02x\n"
"CPBase: 0x%08x\n"
"CPEnd: 0x%08x\n"
"CPHiWatermark: 0x%08x\n"
"CPLoWatermark: 0x%08x\n"
"CPReadWriteDistance: 0x%08x\n"
"CPWritePointer: 0x%08x\n"
"CPReadPointer: 0x%08x\n"
"CPBreakpoint: 0x%08x\n"
"bFF_GPReadEnable: %s\n"
"bFF_BPEnable: %s\n"
"bFF_BPInt: %s\n"
"bFF_Breakpoint: %s\n"
,cmd_byte, fifo.CPBase, fifo.CPEnd, fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance
,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint, fifo.bFF_GPReadEnable ? "true" : "false"
,fifo.bFF_BPEnable ? "true" : "false" ,fifo.bFF_BPInt ? "true" : "false"
,fifo.bFF_Breakpoint ? "true" : "false");
Host_SysMessage(tmp.c_str());
INFO_LOG(VIDEO, "%s", tmp.c_str());
PanicAlert(
"Illegal command %02x\n"
"CPBase: 0x%08x\n"
"CPEnd: 0x%08x\n"
"CPHiWatermark: 0x%08x\n"
"CPLoWatermark: 0x%08x\n"
"CPReadWriteDistance: 0x%08x\n"
"CPWritePointer: 0x%08x\n"
"CPReadPointer: 0x%08x\n"
"CPBreakpoint: 0x%08x\n"
"bFF_GPReadEnable: %s\n"
"bFF_BPEnable: %s\n"
"bFF_BPInt: %s\n"
"bFF_Breakpoint: %s\n"
,cmd_byte, fifo.CPBase, fifo.CPEnd, fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance
,fifo.CPWritePointer, fifo.CPReadPointer, fifo.CPBreakpoint, fifo.bFF_GPReadEnable ? "true" : "false"
,fifo.bFF_BPEnable ? "true" : "false" ,fifo.bFF_BPInt ? "true" : "false"
,fifo.bFF_Breakpoint ? "true" : "false");
}
}

View File

@ -226,10 +226,9 @@ void VertexLoader::CompileVertexTranslator()
if (pFunc == nullptr)
{
Host_SysMessage(
StringFromFormat("VertexLoader_Normal::GetFunction(%i %i %i %i) returned zero!",
PanicAlert("VertexLoader_Normal::GetFunction(%i %i %i %i) returned zero!",
(u32)m_VtxDesc.Normal, m_VtxAttr.NormalFormat,
m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3).c_str());
m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
}
WriteCall(pFunc);

View File

@ -24,7 +24,6 @@ void Host_SetStartupDebuggingParameters() {}
bool Host_UIHasFocus() { return false; }
bool Host_RendererHasFocus() { return false; }
void Host_ConnectWiimote(int, bool) {}
void Host_SysMessage(const char*, ...) {}
void Host_SetWiiMoteConnectionState(int) {}
void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
cInterfaceBase* HostGL_CreateGLInterface() { return nullptr; }