2008-09-07 20:26:38 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#ifndef _WIN32
|
|
|
|
//#include <curses.h>
|
|
|
|
#else
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Globals.h"
|
2008-09-10 01:01:28 +00:00
|
|
|
#include "Host.h"
|
2008-09-07 20:26:38 +00:00
|
|
|
#include "Common.h"
|
|
|
|
#include "ISOFile.h"
|
|
|
|
#include "CPUDetect.h"
|
2008-09-07 21:06:55 +00:00
|
|
|
#include "cmdline.h"
|
|
|
|
#include "Thread.h"
|
|
|
|
#include "PowerPC/PowerPC.h"
|
2008-09-07 20:26:38 +00:00
|
|
|
|
|
|
|
#include "BootManager.h"
|
|
|
|
void* g_pCodeWindow = NULL;
|
|
|
|
void* main_frame = NULL;
|
|
|
|
bool wxPanicAlert(const char* text, bool /*yes_no*/)
|
|
|
|
{
|
|
|
|
return(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_BootingStarted(){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_BootingEnded(){}
|
|
|
|
|
|
|
|
|
|
|
|
// OK, this thread boundary is DANGEROUS on linux
|
|
|
|
// wxPostEvent / wxAddPendingEvent is the solution.
|
|
|
|
void Host_NotifyMapLoaded(){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_UpdateLogDisplay(){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_UpdateDisasmDialog(){}
|
|
|
|
|
|
|
|
|
2008-09-07 21:06:55 +00:00
|
|
|
Common::Event updateMainFrameEvent;
|
|
|
|
void Host_UpdateMainFrame()
|
|
|
|
{
|
|
|
|
updateMainFrameEvent.Set();
|
|
|
|
}
|
2008-09-07 20:26:38 +00:00
|
|
|
|
|
|
|
void Host_UpdateBreakPointView(){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_UpdateMemoryView(){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_SetDebugMode(bool){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_SetWaitCursor(bool enable){}
|
|
|
|
|
|
|
|
|
|
|
|
void Host_UpdateStatusBar(const char* _pText){}
|
|
|
|
|
2008-09-10 01:01:28 +00:00
|
|
|
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, msg);
|
|
|
|
}
|
|
|
|
|
2008-09-07 20:26:38 +00:00
|
|
|
// Include SDL header so it can hijack main().
|
2008-10-24 15:48:36 +00:00
|
|
|
#if !defined(OSX64)
|
2008-09-07 20:26:38 +00:00
|
|
|
#include <SDL.h>
|
2008-10-20 17:32:15 +00:00
|
|
|
#endif
|
2008-09-07 20:26:38 +00:00
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2008-09-07 21:02:57 +00:00
|
|
|
gengetopt_args_info args_info;
|
|
|
|
|
|
|
|
if (cmdline_parser (argc, argv, &args_info) != 0)
|
|
|
|
return(1);
|
|
|
|
|
|
|
|
if (args_info.inputs_num < 1)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Please supply at least one argument - the ISO to boot.\n");
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
std::string bootFile(args_info.inputs[0]);
|
|
|
|
|
2008-09-07 21:06:55 +00:00
|
|
|
updateMainFrameEvent.Init();
|
2008-09-07 21:02:57 +00:00
|
|
|
DetectCPU();
|
|
|
|
BootManager::BootCore(bootFile);
|
2008-09-07 21:06:55 +00:00
|
|
|
while (PowerPC::state != PowerPC::CPU_POWERDOWN)
|
|
|
|
{
|
|
|
|
updateMainFrameEvent.Wait();
|
|
|
|
}
|
2008-09-07 20:26:38 +00:00
|
|
|
|
2008-09-07 21:02:57 +00:00
|
|
|
cmdline_parser_free (&args_info);
|
|
|
|
return(0);
|
2008-09-07 20:26:38 +00:00
|
|
|
}
|