notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updating win32 port
[picodrive.git]
/
platform
/
win32
/
GenaDrive
/
Main.cpp
diff --git
a/platform/win32/GenaDrive/Main.cpp
b/platform/win32/GenaDrive/Main.cpp
index
edab430
..
a8e3362
100644
(file)
--- a/
platform/win32/GenaDrive/Main.cpp
+++ b/
platform/win32/GenaDrive/Main.cpp
@@
-113,13
+113,16
@@
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR cmdline,int)
DWORD tid=0;
\r
HANDLE thread=NULL;
\r
\r
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
// 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
if(!rom) {
\r
OPENFILENAME of; ZeroMemory(&of, sizeof(OPENFILENAME));
\r
of.lStructSize = sizeof(OPENFILENAME);
\r
@@
-128,7
+131,7
@@
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR cmdline,int)
of.nMaxFile = MAX_PATH;
\r
of.Flags = OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
\r
if(!GetOpenFileName(&of)) return 1;
\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
if(!rom) return 1;
\r
}
\r
romname = rompath;
\r
@@
-137,17
+140,13
@@
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR cmdline,int)
//RDebug::Print(_L("PicoCartLoad() failed."));
\r
//goto cleanup;
\r
}
\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
\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
// Make another thread to run LoopCode():
\r
LoopQuit=0;
\r
thread=CreateThread(NULL,0,ThreadCode,NULL,0,&tid);
\r
@@
-174,5
+173,10
@@
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR cmdline,int)
_CrtDumpMemoryLeaks();
\r
return 0;
\r
}
\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
#endif
\r
\r