Naomi: fix raw BIN/DAT files loading on win32
This commit is contained in:
parent
976d647e1c
commit
ebca83e56e
|
@ -835,6 +835,9 @@ u32 libExtDevice_ReadMem_A0_006(u32 addr,u32 size) {
|
||||||
return *(u16 *)&mem600[addr & ~1];
|
return *(u16 *)&mem600[addr & ~1];
|
||||||
case 4:
|
case 4:
|
||||||
return *(u32 *)&mem600[addr & ~3];
|
return *(u32 *)&mem600[addr & ~3];
|
||||||
|
default:
|
||||||
|
die("Invalid size");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@ bool naomi_cart_LoadRom(char* file)
|
||||||
vector<u32> fstart;
|
vector<u32> fstart;
|
||||||
vector<u32> fsize;
|
vector<u32> fsize;
|
||||||
u32 setsize = 0;
|
u32 setsize = 0;
|
||||||
|
bool raw_bin_file = false;
|
||||||
|
|
||||||
char *pdot = strrchr(file, '.');
|
char *pdot = strrchr(file, '.');
|
||||||
if (pdot != NULL && (!strcmp(pdot, ".lst") || !strcmp(pdot, ".LST")))
|
if (pdot != NULL && (!strcmp(pdot, ".lst") || !strcmp(pdot, ".LST")))
|
||||||
|
@ -254,6 +255,7 @@ bool naomi_cart_LoadRom(char* file)
|
||||||
fsize.push_back(file_size);
|
fsize.push_back(file_size);
|
||||||
setsize = file_size;
|
setsize = file_size;
|
||||||
RomSize = file_size;
|
RomSize = file_size;
|
||||||
|
raw_bin_file = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("+%ld romfiles, %.2f MB set size, %.2f MB set address space\n", files.size(), setsize / 1024.f / 1024.f, RomSize / 1024.f / 1024.f);
|
printf("+%ld romfiles, %.2f MB set size, %.2f MB set address space\n", files.size(), setsize / 1024.f / 1024.f, RomSize / 1024.f / 1024.f);
|
||||||
|
@ -282,7 +284,7 @@ bool naomi_cart_LoadRom(char* file)
|
||||||
//Create File Mapping Objects
|
//Create File Mapping Objects
|
||||||
for (size_t i = 0; i<files.size(); i++)
|
for (size_t i = 0; i<files.size(); i++)
|
||||||
{
|
{
|
||||||
if (files[i][0] != '/' && files[i][0] != '\\')
|
if (!raw_bin_file)
|
||||||
{
|
{
|
||||||
strncpy(t, file, sizeof(t));
|
strncpy(t, file, sizeof(t));
|
||||||
t[sizeof(t) - 1] = '\0';
|
t[sizeof(t) - 1] = '\0';
|
||||||
|
@ -414,7 +416,7 @@ bool naomi_cart_SelectFile(void* handle)
|
||||||
ofn.hInstance = (HINSTANCE)GetModuleHandle(0);
|
ofn.hInstance = (HINSTANCE)GetModuleHandle(0);
|
||||||
ofn.lpstrFile = SelectedFile;
|
ofn.lpstrFile = SelectedFile;
|
||||||
ofn.nMaxFile = MAX_PATH;
|
ofn.nMaxFile = MAX_PATH;
|
||||||
ofn.lpstrFilter = "*.lst\0*.lst\0\0";
|
ofn.lpstrFilter = "*.lst\0*.lst\0*.bin\0*.bin\0*.dat\0*.dat\0\0";
|
||||||
ofn.nFilterIndex = 0;
|
ofn.nFilterIndex = 0;
|
||||||
ofn.hwndOwner = (HWND)handle;
|
ofn.hwndOwner = (HWND)handle;
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
|
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
|
||||||
|
|
Loading…
Reference in New Issue