DWORD tid=0;\r
HANDLE thread=NULL;\r
\r
+ FrameInit();\r
+ ret=LoopInit(); if (ret) { LoopExit(); return 1; }\r
+\r
// notaz: load rom\r
static char rompath[MAX_PATH]; rompath[0] = 0;\r
strcpy(rompath, cmdline + (cmdline[0] == '\"' ? 1 : 0));\r
if(rompath[strlen(rompath)-1] == '\"') rompath[strlen(rompath)-1] = 0;\r
\r
- FILE *rom = 0;\r
- if(strlen(rompath) > 4) rom = fopen(rompath, "rb");\r
+ pm_file *rom = 0;\r
+ if(strlen(rompath) > 4) rom = pm_open(rompath);\r
if(!rom) {\r
OPENFILENAME of; ZeroMemory(&of, sizeof(OPENFILENAME));\r
of.lStructSize = sizeof(OPENFILENAME);\r
of.nMaxFile = MAX_PATH;\r
of.Flags = OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;\r
if(!GetOpenFileName(&of)) return 1;\r
- rom = fopen(rompath, "rb");\r
+ rom = pm_open(rompath);\r
if(!rom) return 1;\r
}\r
romname = rompath;\r
//RDebug::Print(_L("PicoCartLoad() failed."));\r
//goto cleanup;\r
}\r
-\r
- FrameInit();\r
- ret=LoopInit(); if (ret) { LoopExit(); return 1; }\r
+ pm_close(rom);\r
\r
PicoCartInsert(rom_data, rom_size);\r
\r
// only now we got the mode (pal/ntsc), so init sound now\r
DSoundInit();\r
\r
- preLoopInit();\r
-\r
// Make another thread to run LoopCode():\r
LoopQuit=0;\r
thread=CreateThread(NULL,0,ThreadCode,NULL,0,&tid);\r
_CrtDumpMemoryLeaks();\r
return 0;\r
}\r
+\r
+extern void error(char *text)\r
+{\r
+ MessageBox(FrameWnd, text, "Error", 0);\r
+}\r
#endif\r
\r