mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
The emulator is now almost completely Unicode - this means all paths and file names used can now use non-Latin characters;
Fixed several NVR- and ROM-related bugs in the process of doing the above.
This commit is contained in:
38
src/config.c
38
src/config.c
@@ -8,9 +8,9 @@
|
||||
#include "config.h"
|
||||
#include "ibm.h"
|
||||
|
||||
char config_file_default[256];
|
||||
wchar_t config_file_default[256];
|
||||
|
||||
static char config_file[256];
|
||||
static wchar_t config_file[256];
|
||||
|
||||
typedef struct list_t
|
||||
{
|
||||
@@ -100,9 +100,9 @@ void config_free()
|
||||
}
|
||||
}
|
||||
|
||||
void config_load(char *fn)
|
||||
void config_load(wchar_t *fn)
|
||||
{
|
||||
FILE *f = fopen(fn, "rt, ccs=UNICODE");
|
||||
FILE *f = _wfopen(fn, L"rt, ccs=UNICODE");
|
||||
section_t *current_section;
|
||||
|
||||
memset(&config_head, 0, sizeof(list_t));
|
||||
@@ -200,7 +200,7 @@ void config_load(char *fn)
|
||||
|
||||
void config_new()
|
||||
{
|
||||
FILE *f = fopen(config_file, "wt, ccs=UNICODE");
|
||||
FILE *f = _wfopen(config_file, L"wt, ccs=UNICODE");
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
@@ -386,11 +386,28 @@ char *get_filename(char *s)
|
||||
return s;
|
||||
}
|
||||
|
||||
wchar_t *get_filename_w(wchar_t *s)
|
||||
{
|
||||
int c = wcslen(s) - 1;
|
||||
while (c > 0)
|
||||
{
|
||||
if (s[c] == L'/' || s[c] == L'\\')
|
||||
return &s[c+1];
|
||||
c--;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void append_filename(char *dest, char *s1, char *s2, int size)
|
||||
{
|
||||
sprintf(dest, "%s%s", s1, s2);
|
||||
}
|
||||
|
||||
void append_filename_w(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size)
|
||||
{
|
||||
_swprintf(dest, L"%s%s", s1, s2);
|
||||
}
|
||||
|
||||
void put_backslash(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
@@ -398,6 +415,13 @@ void put_backslash(char *s)
|
||||
s[c] = '/';
|
||||
}
|
||||
|
||||
void put_backslash_w(wchar_t *s)
|
||||
{
|
||||
int c = wcslen(s) - 1;
|
||||
if (s[c] != L'/' && s[c] != L'\\')
|
||||
s[c] = L'/';
|
||||
}
|
||||
|
||||
char *get_extension(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
@@ -432,9 +456,9 @@ wchar_t *get_extension_w(wchar_t *s)
|
||||
|
||||
static wchar_t wname[512];
|
||||
|
||||
void config_save(char *fn)
|
||||
void config_save(wchar_t *fn)
|
||||
{
|
||||
FILE *f = fopen(fn, "wt, ccs=UNICODE");
|
||||
FILE *f = _wfopen(fn, L"wt, ccs=UNICODE");
|
||||
section_t *current_section;
|
||||
|
||||
current_section = (section_t *)config_head.next;
|
||||
|
||||
@@ -9,14 +9,17 @@ void config_set_string(char *head, char *name, char *val);
|
||||
void config_set_wstring(char *head, char *name, wchar_t *val);
|
||||
|
||||
char *get_filename(char *s);
|
||||
wchar_t *get_filename_w(wchar_t *s);
|
||||
void append_filename(char *dest, char *s1, char *s2, int size);
|
||||
void append_filename_w(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size);
|
||||
void put_backslash(char *s);
|
||||
void put_backslash_w(wchar_t *s);
|
||||
char *get_extension(char *s);
|
||||
wchar_t *get_extension_w(wchar_t *s);
|
||||
|
||||
void config_load(char *fn);
|
||||
void config_save(char *fn);
|
||||
void config_load(wchar_t *fn);
|
||||
void config_save(wchar_t *fn);
|
||||
void config_dump();
|
||||
void config_free();
|
||||
|
||||
extern char config_file_default[256];
|
||||
extern wchar_t config_file_default[256];
|
||||
|
||||
@@ -3134,7 +3134,7 @@ void d86f_load(int drive, wchar_t *fn)
|
||||
|
||||
if (d86f[drive].is_compressed)
|
||||
{
|
||||
memcpy(temp_file_name, drive ? L"TEMP$$$1.$$$" : L"TEMP$$$0.$$$", 256);
|
||||
memcpy(temp_file_name, drive ? nvr_concat(L"TEMP$$$1.$$$") : nvr_concat(L"TEMP$$$0.$$$"), 256);
|
||||
memcpy(d86f[drive].original_file_name, fn, (wcslen(fn) << 1) + 2);
|
||||
|
||||
fclose(d86f[drive].f);
|
||||
@@ -3322,7 +3322,7 @@ void d86f_close(int drive)
|
||||
{
|
||||
wchar_t temp_file_name[2048];
|
||||
|
||||
memcpy(temp_file_name, drive ? "TEMP$$$1.$$$" : "TEMP$$$0.$$$", 26);
|
||||
memcpy(temp_file_name, drive ? nvr_concat(L"TEMP$$$1.$$$") : nvr_concat(L"TEMP$$$0.$$$"), 26);
|
||||
|
||||
if (d86f[drive].f)
|
||||
fclose(d86f[drive].f);
|
||||
|
||||
@@ -842,7 +842,7 @@ static void *esdi_init()
|
||||
esdi_t *esdi = malloc(sizeof(esdi_t));
|
||||
memset(esdi, 0, sizeof(esdi_t));
|
||||
|
||||
rom_init_interleaved(&esdi->bios_rom, "roms/90x8970.bin", "roms/90x8969.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init_interleaved(&esdi->bios_rom, L"roms/90x8970.bin", L"roms/90x8969.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
mem_mapping_disable(&esdi->bios_rom.mapping);
|
||||
|
||||
for (i = 0; i < HDC_NUM; i++)
|
||||
@@ -882,7 +882,7 @@ static void esdi_close(void *p)
|
||||
|
||||
static int esdi_available()
|
||||
{
|
||||
return rom_present("roms/90x8969.bin") && rom_present("roms/90x8970.bin");
|
||||
return rom_present(L"roms/90x8969.bin") && rom_present(L"roms/90x8970.bin");
|
||||
}
|
||||
|
||||
device_t hdd_esdi_device =
|
||||
|
||||
11
src/ibm.h
11
src/ibm.h
@@ -52,7 +52,6 @@ void outw(uint16_t port, uint16_t val);
|
||||
uint32_t inl(uint16_t port);
|
||||
void outl(uint16_t port, uint32_t val);
|
||||
|
||||
FILE *romfopen(char *fn, char *mode);
|
||||
extern int shadowbios,shadowbios_write;
|
||||
extern int mem_size;
|
||||
extern int readlnum,writelnum;
|
||||
@@ -552,7 +551,7 @@ int gated,speakval,speakon;
|
||||
#define SND_WSS 9 /*Windows Sound System*/
|
||||
#define SND_PAS16 10 /*Pro Audio Spectrum 16*/
|
||||
|
||||
char pcempath[512];
|
||||
wchar_t pcempath[512];
|
||||
|
||||
|
||||
/*Hard disc*/
|
||||
@@ -676,7 +675,7 @@ uint64_t timer_read();
|
||||
extern uint64_t timer_freq;
|
||||
|
||||
|
||||
void loadconfig(char *fn);
|
||||
void loadconfig(wchar_t *fn);
|
||||
|
||||
extern int infocus;
|
||||
|
||||
@@ -701,10 +700,10 @@ extern uint64_t star;
|
||||
|
||||
#define FPU_CW_Reserved_Bits (0xe0c0)
|
||||
|
||||
extern char nvr_path[1024];
|
||||
extern wchar_t nvr_path[1024];
|
||||
extern int path_len;
|
||||
|
||||
char *nvr_concat(char *to_concat);
|
||||
wchar_t *nvr_concat(wchar_t *to_concat);
|
||||
|
||||
int mem_a20_state;
|
||||
|
||||
@@ -758,7 +757,7 @@ void execx86(int cycs);
|
||||
void flushmmucache();
|
||||
void flushmmucache_cr3();
|
||||
int idivl(int32_t val);
|
||||
void initpc(int argc, char *argv[]);
|
||||
void initpc(int argc, wchar_t *argv[]);
|
||||
void loadcscall(uint16_t seg);
|
||||
void loadcsjmp(uint16_t seg, uint32_t oxpc);
|
||||
void mmu_invalidate(uint32_t addr);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
|
||||
#define FLASH_IS_BXB 2
|
||||
#define FLASH_INVERT 1
|
||||
@@ -34,7 +35,7 @@ typedef struct flash_t
|
||||
uint8_t array[131072];
|
||||
} flash_t;
|
||||
|
||||
static char flash_path[1024];
|
||||
static wchar_t flash_path[1024];
|
||||
|
||||
static uint8_t flash_read(uint32_t addr, void *p)
|
||||
{
|
||||
@@ -150,7 +151,6 @@ static void intel_flash_add_mappings_inverted(flash_t *flash)
|
||||
void *intel_flash_init(uint8_t type)
|
||||
{
|
||||
FILE *f;
|
||||
char fpath[1024];
|
||||
int i;
|
||||
flash_t *flash;
|
||||
flash = malloc(sizeof(flash_t));
|
||||
@@ -159,74 +159,64 @@ void *intel_flash_init(uint8_t type)
|
||||
switch(romset)
|
||||
{
|
||||
case ROM_REVENGE:
|
||||
strcpy(flash_path, "roms/revenge/");
|
||||
wcscpy(flash_path, nvr_concat(L"revenge.bin"));
|
||||
break;
|
||||
case ROM_586MC1:
|
||||
strcpy(flash_path, "roms/586mc1/");
|
||||
wcscpy(flash_path, nvr_concat(L"586mc1.bin"));
|
||||
break;
|
||||
case ROM_PLATO:
|
||||
strcpy(flash_path, "roms/plato/");
|
||||
wcscpy(flash_path, nvr_concat(L"plato.bin"));
|
||||
break;
|
||||
case ROM_ENDEAVOR:
|
||||
strcpy(flash_path, "roms/endeavor/");
|
||||
wcscpy(flash_path, nvr_concat(L"endeavor.bin"));
|
||||
break;
|
||||
case ROM_MB500N:
|
||||
strcpy(flash_path, "roms/mb500n/");
|
||||
wcscpy(flash_path, nvr_concat(L"mb500n.bin"));
|
||||
break;
|
||||
#if 0
|
||||
case ROM_POWERMATE_V:
|
||||
strcpy(flash_path, "roms/powermate_v/");
|
||||
break;
|
||||
#endif
|
||||
case ROM_P54TP4XE:
|
||||
strcpy(flash_path, "roms/p54tp4xe/");
|
||||
wcscpy(flash_path, nvr_concat(L"p54tp4xe.bin"));
|
||||
break;
|
||||
case ROM_AP53:
|
||||
strcpy(flash_path, "roms/ap53/");
|
||||
wcscpy(flash_path, nvr_concat(L"ap53.bin"));
|
||||
break;
|
||||
case ROM_P55T2S:
|
||||
strcpy(flash_path, "roms/p55t2s/");
|
||||
wcscpy(flash_path, nvr_concat(L"p55t2s.bin"));
|
||||
break;
|
||||
case ROM_ACERM3A:
|
||||
strcpy(flash_path, "roms/acerm3a/");
|
||||
wcscpy(flash_path, nvr_concat(L"acerm3a.bin"));
|
||||
break;
|
||||
case ROM_ACERV35N:
|
||||
strcpy(flash_path, "roms/acerv35n/");
|
||||
wcscpy(flash_path, nvr_concat(L"acerv35n.bin"));
|
||||
break;
|
||||
case ROM_430VX:
|
||||
strcpy(flash_path, "roms/430vx/");
|
||||
wcscpy(flash_path, nvr_concat(L"430vx.bin"));
|
||||
break;
|
||||
case ROM_P55VA:
|
||||
strcpy(flash_path, "roms/p55va/");
|
||||
wcscpy(flash_path, nvr_concat(L"p55va.bin"));
|
||||
break;
|
||||
case ROM_P55T2P4:
|
||||
strcpy(flash_path, "roms/p55t2p4/");
|
||||
wcscpy(flash_path, nvr_concat(L"p55t2p4.bin"));
|
||||
break;
|
||||
case ROM_P55TVP4:
|
||||
strcpy(flash_path, "roms/p55tvp4/");
|
||||
wcscpy(flash_path, nvr_concat(L"p55tvp4.bin"));
|
||||
break;
|
||||
case ROM_440FX:
|
||||
strcpy(flash_path, "roms/440fx/");
|
||||
wcscpy(flash_path, nvr_concat(L"440fx.bin"));
|
||||
break;
|
||||
#if 0
|
||||
case ROM_MARL:
|
||||
strcpy(flash_path, "roms/marl/");
|
||||
break;
|
||||
#endif
|
||||
case ROM_THOR:
|
||||
strcpy(flash_path, "roms/thor/");
|
||||
wcscpy(flash_path, nvr_concat(L"thor.bin"));
|
||||
break;
|
||||
case ROM_MRTHOR:
|
||||
strcpy(flash_path, "roms/mrthor/");
|
||||
wcscpy(flash_path, nvr_concat(L"mrthor.bin"));
|
||||
break;
|
||||
case ROM_ZAPPA:
|
||||
strcpy(flash_path, "roms/zappa/");
|
||||
wcscpy(flash_path, nvr_concat(L"zappa.bin"));
|
||||
break;
|
||||
case ROM_S1668:
|
||||
strcpy(flash_path, "roms/tpatx/");
|
||||
wcscpy(flash_path, nvr_concat(L"tpatx.bin"));
|
||||
break;
|
||||
default:
|
||||
fatal("intel_flash_init on unsupported ROM set %i\n", romset);
|
||||
fatal("intel_flash_init on unsupported ROM set %i\n", romset);
|
||||
}
|
||||
|
||||
flash->flash_id = (type & FLASH_IS_BXB) ? 0x95 : 0x94;
|
||||
@@ -289,9 +279,7 @@ void *intel_flash_init(uint8_t type)
|
||||
flash->command = CMD_READ_ARRAY;
|
||||
flash->status = 0;
|
||||
|
||||
strcpy(fpath, flash_path);
|
||||
strcat(fpath, "flash.bin");
|
||||
f = romfopen(fpath, "rb");
|
||||
f = nvrfopen(flash_path, L"rb");
|
||||
if (f)
|
||||
{
|
||||
fread(&(flash->array[flash->block_start[BLOCK_MAIN]]), flash->block_len[BLOCK_MAIN], 1, f);
|
||||
@@ -331,11 +319,7 @@ void intel_flash_close(void *p)
|
||||
FILE *f;
|
||||
flash_t *flash = (flash_t *)p;
|
||||
|
||||
char fpath[1024];
|
||||
|
||||
strcpy(fpath, flash_path);
|
||||
strcat(fpath, "flash.bin");
|
||||
f = romfopen(fpath, "wb");
|
||||
f = nvrfopen(flash_path, L"wb");
|
||||
fwrite(&(flash->array[flash->block_start[BLOCK_MAIN]]), flash->block_len[BLOCK_MAIN], 1, f);
|
||||
fwrite(&(flash->array[flash->block_start[BLOCK_DATA1]]), flash->block_len[BLOCK_DATA1], 1, f);
|
||||
fwrite(&(flash->array[flash->block_start[BLOCK_DATA2]]), flash->block_len[BLOCK_DATA2], 1, f);
|
||||
|
||||
275
src/mem.c
275
src/mem.c
@@ -68,7 +68,7 @@ uint32_t ram_mapped_addr[64];
|
||||
static void mem_load_atide115_bios()
|
||||
{
|
||||
FILE *f;
|
||||
f=romfopen("roms/ide_at_1_1_5.bin","rb");
|
||||
f=romfopen(L"roms/ide_at_1_1_5.bin",L"rb");
|
||||
|
||||
if (f)
|
||||
{
|
||||
@@ -83,8 +83,8 @@ int loadbios()
|
||||
FILE *f=NULL,*ff=NULL;
|
||||
int c;
|
||||
|
||||
loadfont("roms/mda.rom", 0);
|
||||
loadfont("roms/wy700.rom", 3);
|
||||
loadfont(L"roms/mda.rom", 0);
|
||||
loadfont(L"roms/wy700.rom", 3);
|
||||
|
||||
biosmask = 0xffff;
|
||||
|
||||
@@ -98,8 +98,8 @@ int loadbios()
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_PC1512:
|
||||
f=romfopen("roms/pc1512/40043.v1","rb");
|
||||
ff=romfopen("roms/pc1512/40044.v1","rb");
|
||||
f=romfopen(L"roms/pc1512/40043.v1",L"rb");
|
||||
ff=romfopen(L"roms/pc1512/40044.v1",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -108,11 +108,11 @@ int loadbios()
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
loadfont("roms/pc1512/40078.ic127", 2);
|
||||
loadfont(L"roms/pc1512/40078.ic127", 2);
|
||||
return 1;
|
||||
case ROM_PC1640:
|
||||
f=romfopen("roms/pc1640/40044.v3","rb");
|
||||
ff=romfopen("roms/pc1640/40043.v3","rb");
|
||||
f=romfopen(L"roms/pc1640/40044.v3",L"rb");
|
||||
ff=romfopen(L"roms/pc1640/40043.v3",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -121,13 +121,13 @@ int loadbios()
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f=romfopen("roms/pc1640/40100","rb");
|
||||
f=romfopen(L"roms/pc1640/40100",L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_PC200:
|
||||
f=romfopen("roms/pc200/pc20v2.1","rb");
|
||||
ff=romfopen("roms/pc200/pc20v2.0","rb");
|
||||
f=romfopen(L"roms/pc200/pc20v2.1",L"rb");
|
||||
ff=romfopen(L"roms/pc200/pc20v2.0",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -136,24 +136,24 @@ int loadbios()
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
loadfont("roms/pc200/40109.bin", 1);
|
||||
loadfont(L"roms/pc200/40109.bin", 1);
|
||||
return 1;
|
||||
case ROM_TANDY:
|
||||
f=romfopen("roms/tandy/tandy1t1.020","rb");
|
||||
f=romfopen(L"roms/tandy/tandy1t1.020",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_TANDY1000HX:
|
||||
f = romfopen("roms/tandy1000hx/v020000.u12", "rb");
|
||||
f = romfopen(L"roms/tandy1000hx/v020000.u12", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
case ROM_TANDY1000SL2:
|
||||
f = romfopen("roms/tandy1000sl2/8079047.hu1" ,"rb");
|
||||
ff = romfopen("roms/tandy1000sl2/8079048.hu2","rb");
|
||||
f = romfopen(L"roms/tandy1000sl2/8079047.hu1" ,L"rb");
|
||||
ff = romfopen(L"roms/tandy1000sl2/8079048.hu2",L"rb");
|
||||
if (!f || !ff) break;
|
||||
fseek(f, 0x30000/2, SEEK_SET);
|
||||
fseek(ff, 0x30000/2, SEEK_SET);
|
||||
@@ -165,20 +165,12 @@ int loadbios()
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
/* case ROM_IBMPCJR:
|
||||
f=fopen("pcjr/bios.rom","rb");
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
f=fopen("pcjr/basic.rom","rb");
|
||||
fread(rom+0x6000,32768,1,f);
|
||||
fclose(f);
|
||||
break;*/
|
||||
case ROM_IBMXT:
|
||||
f=romfopen("roms/ibmxt/xt.rom","rb");
|
||||
f=romfopen(L"roms/ibmxt/xt.rom",L"rb");
|
||||
if (!f)
|
||||
{
|
||||
f = romfopen("roms/ibmxt/5000027.u19", "rb");
|
||||
ff = romfopen("roms/ibmxt/1501512.u18","rb");
|
||||
f = romfopen(L"roms/ibmxt/5000027.u19", L"rb");
|
||||
ff = romfopen(L"roms/ibmxt/1501512.u18", L"rb");
|
||||
if (!f || !ff) break;
|
||||
fread(rom, 0x8000, 1, f);
|
||||
fread(rom + 0x8000, 0x8000, 1, ff);
|
||||
@@ -195,22 +187,22 @@ int loadbios()
|
||||
break;
|
||||
|
||||
case ROM_IBMPCJR:
|
||||
f = romfopen("roms/ibmpcjr/bios.rom","rb");
|
||||
f = romfopen(L"roms/ibmpcjr/bios.rom", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PORTABLE:
|
||||
f=romfopen("roms/portable/Compaq Portable Plus 100666-001 Rev C u47.bin","rb");
|
||||
f=romfopen(L"roms/portable/Compaq Portable Plus 100666-001 Rev C u47.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PORTABLEII:
|
||||
f = romfopen("roms/portableii/62x0820.u27", "rb");
|
||||
ff =romfopen("roms/portableii/62x0821.u47", "rb");
|
||||
f = romfopen(L"roms/portableii/62x0820.u27", L"rb");
|
||||
ff =romfopen(L"roms/portableii/62x0821.u47", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -222,9 +214,9 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_PORTABLEIII:
|
||||
case ROM_PORTABLEIII386:
|
||||
f = romfopen("roms/portableiii/62x0820.u27", "rb");
|
||||
ff =romfopen("roms/portableiii/62x0821.u47", "rb");
|
||||
case ROM_PORTABLEIII386:
|
||||
f = romfopen(L"roms/portableiii/62x0820.u27", L"rb");
|
||||
ff =romfopen(L"roms/portableiii/62x0821.u47", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -236,20 +228,20 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_GENXT:
|
||||
f=romfopen("roms/genxt/pcxt.rom","rb");
|
||||
f=romfopen(L"roms/genxt/pcxt.rom",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_DTKXT:
|
||||
f=romfopen("roms/dtk/DTK_ERSO_2.42_2764.bin","rb");
|
||||
f=romfopen(L"roms/dtk/DTK_ERSO_2.42_2764.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_OLIM24:
|
||||
f = romfopen("roms/olivetti_m24/olivetti_m24_version_1.43_low.bin" ,"rb");
|
||||
ff = romfopen("roms/olivetti_m24/olivetti_m24_version_1.43_high.bin","rb");
|
||||
f = romfopen(L"roms/olivetti_m24/olivetti_m24_version_1.43_low.bin" ,L"rb");
|
||||
ff = romfopen(L"roms/olivetti_m24/olivetti_m24_version_1.43_high.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x4000; c += 2)
|
||||
{
|
||||
@@ -261,8 +253,8 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_PC2086:
|
||||
f = romfopen("roms/pc2086/40179.ic129" ,"rb");
|
||||
ff = romfopen("roms/pc2086/40180.ic132","rb");
|
||||
f = romfopen(L"roms/pc2086/40179.ic129" ,L"rb");
|
||||
ff = romfopen(L"roms/pc2086/40180.ic132",L"rb");
|
||||
if (!f || !ff) break;
|
||||
pclog("Loading BIOS\n");
|
||||
for (c = 0x0000; c < 0x4000; c += 2)
|
||||
@@ -273,32 +265,26 @@ int loadbios()
|
||||
pclog("%02X %02X %02X\n", rom[0xfff0], rom[0xfff1], rom[0xfff2]);
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f = romfopen("roms/pc2086/40186.ic171", "rb");
|
||||
f = romfopen(L"roms/pc2086/40186.ic171", L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
biosmask = 0x3fff;
|
||||
return 1;
|
||||
|
||||
case ROM_PC3086:
|
||||
f = romfopen("roms/pc3086/fc00.bin" ,"rb");
|
||||
f = romfopen(L"roms/pc3086/fc00.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x4000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/pc3086/c000.bin", "rb");
|
||||
f = romfopen(L"roms/pc3086/c000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
biosmask = 0x3fff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMAT:
|
||||
/* f=romfopen("roms/AMIC206.BIN","rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;*/
|
||||
case ROM_IBMAT386:
|
||||
f = romfopen("roms/ibmat/62x0820.u27", "rb");
|
||||
ff =romfopen("roms/ibmat/62x0821.u47", "rb");
|
||||
f = romfopen(L"roms/ibmat/62x0820.u27", L"rb");
|
||||
ff =romfopen(L"roms/ibmat/62x0821.u47", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -309,8 +295,8 @@ int loadbios()
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_CMDPC30:
|
||||
f = romfopen("roms/cmdpc30/commodore pc 30 iii even.bin", "rb");
|
||||
ff = romfopen("roms/cmdpc30/commodore pc 30 iii odd.bin", "rb");
|
||||
f = romfopen(L"roms/cmdpc30/commodore pc 30 iii even.bin", L"rb");
|
||||
ff = romfopen(L"roms/cmdpc30/commodore pc 30 iii odd.bin", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x8000; c += 2)
|
||||
{
|
||||
@@ -321,24 +307,9 @@ int loadbios()
|
||||
fclose(f);
|
||||
biosmask = 0x7fff;
|
||||
return 1;
|
||||
#if 0
|
||||
case ROM_CMDPC60:
|
||||
f = romfopen("roms/cmdpc60/cbm-pc60c-bios-lo-v1.36-390473-07.bin", "rb");
|
||||
ff = romfopen("roms/cmdpc60/cbm-pc60c-bios-hi-v1.36-390474-07.bin", "rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x20000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c + 1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
#endif
|
||||
case ROM_DELL200:
|
||||
f=romfopen("roms/dells200/dell0.bin","rb");
|
||||
ff=romfopen("roms/dells200/dell1.bin","rb");
|
||||
f=romfopen(L"roms/dells200/dell0.bin",L"rb");
|
||||
ff=romfopen(L"roms/dells200/dell1.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
@@ -348,85 +319,65 @@ int loadbios()
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
/* case ROM_IBMAT386:
|
||||
f=romfopen("roms/at386/at386.bin","rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;*/
|
||||
case ROM_AMI386SX:
|
||||
f=romfopen("roms/ami386/ami386.bin","rb");
|
||||
f=romfopen(L"roms/ami386/ami386.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AMI386DX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
f=romfopen("roms/ami386dx/OPT495SX.AMI","rb");
|
||||
f=romfopen(L"roms/ami386dx/OPT495SX.AMI",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_MR386DX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
f=romfopen("roms/mr386dx/OPT495SX.MR","rb");
|
||||
f=romfopen(L"roms/mr386dx/OPT495SX.MR",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
#if 0
|
||||
case ROM_ACER386:
|
||||
f=romfopen("roms/acer386/acer386.bin","rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
rom[0xB0]=0xB0-0x51;
|
||||
rom[0x40d4]=0x51; /*PUSH CX*/
|
||||
f=romfopen("roms/acer386/oti067.bin","rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
case ROM_AMI286:
|
||||
f=romfopen("roms/ami286/amic206.bin","rb");
|
||||
f=romfopen(L"roms/ami286/amic206.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AWARD286:
|
||||
f=romfopen("roms/award286/award.bin","rb");
|
||||
f=romfopen(L"roms/award286/award.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_EUROPC:
|
||||
f=romfopen("roms/europc/50145","rb");
|
||||
case ROM_EUROPC:
|
||||
f=romfopen(L"roms/europc/50145",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0x8000,32768,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPC:
|
||||
f=romfopen("roms/ibmpc/pc102782.bin","rb");
|
||||
f=romfopen(L"roms/ibmpc/pc102782.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen("roms/ibmpc/basicc11.f6","rb");
|
||||
f=romfopen(L"roms/ibmpc/basicc11.f6",L"rb");
|
||||
if (!f) return 1; /*I don't really care if BASIC is there or not*/
|
||||
fread(rom+0x6000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen("roms/ibmpc/basicc11.f8","rb");
|
||||
f=romfopen(L"roms/ibmpc/basicc11.f8",L"rb");
|
||||
if (!f) break; /*But if some of it is there, then all of it must be*/
|
||||
fread(rom+0x8000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen("roms/ibmpc/basicc11.fa","rb");
|
||||
f=romfopen(L"roms/ibmpc/basicc11.fa",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xA000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen("roms/ibmpc/basicc11.fc","rb");
|
||||
f=romfopen(L"roms/ibmpc/basicc11.fc",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xC000,8192,1,f);
|
||||
fclose(f);
|
||||
@@ -434,8 +385,8 @@ int loadbios()
|
||||
|
||||
case ROM_MEGAPC:
|
||||
case ROM_MEGAPCDX:
|
||||
f = romfopen("roms/megapc/41651-bios lo.u18", "rb");
|
||||
ff = romfopen("roms/megapc/211253-bios hi.u19", "rb");
|
||||
f = romfopen(L"roms/megapc/41651-bios lo.u18", L"rb");
|
||||
ff = romfopen(L"roms/megapc/211253-bios hi.u19", L"rb");
|
||||
if (!f || !ff) break;
|
||||
fseek(f, 0x8000, SEEK_SET);
|
||||
fseek(ff, 0x8000, SEEK_SET);
|
||||
@@ -449,22 +400,21 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_AMI486:
|
||||
f=romfopen("roms/ami486/ami486.BIN","rb");
|
||||
f=romfopen(L"roms/ami486/ami486.BIN",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_WIN486:
|
||||
f=romfopen("roms/win486/ALI1429G.AMW","rb");
|
||||
f=romfopen(L"roms/win486/ALI1429G.AMW",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_SIS496:
|
||||
/* f = romfopen("roms/sis496/SIS496-1.AWA", "rb"); */
|
||||
f = romfopen("roms/sis496/SIS496_3.AWA", "rb");
|
||||
f = romfopen(L"roms/sis496/SIS496_3.AWA", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -473,7 +423,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_430VX:
|
||||
f = romfopen("roms/430vx/55XWUQ0E.BIN", "rb");
|
||||
f = romfopen(L"roms/430vx/55XWUQ0E.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -481,12 +431,12 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_REVENGE:
|
||||
f = romfopen("roms/revenge/1009AF2_.BIO", "rb");
|
||||
f = romfopen(L"roms/revenge/1009AF2_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/revenge/1009AF2_.BI1", "rb");
|
||||
f = romfopen(L"roms/revenge/1009AF2_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xc000, 1, f);
|
||||
@@ -494,12 +444,12 @@ int loadbios()
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
case ROM_ENDEAVOR:
|
||||
f = romfopen("roms/endeavor/1006CB0_.BIO", "rb");
|
||||
f = romfopen(L"roms/endeavor/1006CB0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/endeavor/1006CB0_.BI1", "rb");
|
||||
f = romfopen(L"roms/endeavor/1006CB0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xd000, 1, f);
|
||||
@@ -508,7 +458,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS1_2011:
|
||||
f = romfopen("roms/ibmps1es/f80000.bin", "rb");
|
||||
f = romfopen(L"roms/ibmps1es/f80000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x60000, SEEK_SET);
|
||||
fread(rom, 0x20000, 1, f);
|
||||
@@ -518,7 +468,7 @@ int loadbios()
|
||||
|
||||
case ROM_IBMPS1_2121:
|
||||
case ROM_IBMPS1_2121_ISA:
|
||||
f = romfopen("roms/ibmps1_2121/fc0000.bin", "rb");
|
||||
f = romfopen(L"roms/ibmps1_2121/fc0000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x20000, SEEK_SET);
|
||||
fread(rom, 0x20000, 1, f);
|
||||
@@ -531,8 +481,8 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_DESKPRO_386:
|
||||
f=romfopen("roms/deskpro386/109592-005.U11.bin","rb");
|
||||
ff=romfopen("roms/deskpro386/109591-005.U13.bin","rb");
|
||||
f=romfopen(L"roms/deskpro386/109592-005.U11.bin",L"rb");
|
||||
ff=romfopen(L"roms/deskpro386/109591-005.U13.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x8000; c += 2)
|
||||
{
|
||||
@@ -545,78 +495,63 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_AMIXT:
|
||||
f = romfopen("roms/amixt/AMI_8088_BIOS_31JAN89.BIN", "rb");
|
||||
f = romfopen(L"roms/amixt/AMI_8088_BIOS_31JAN89.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_LTXT:
|
||||
f = romfopen("roms/ltxt/27C64.bin", "rb");
|
||||
f = romfopen(L"roms/ltxt/27C64.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_LXT3:
|
||||
f = romfopen("roms/lxt3/27C64D.bin", "rb");
|
||||
f = romfopen(L"roms/lxt3/27C64D.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_SPC4200P: /*Samsung SPC-4200P*/
|
||||
f = romfopen("roms/spc4200p/U8.01", "rb");
|
||||
f = romfopen(L"roms/spc4200p/U8.01", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_SUPER286TR: /*Hyundai Super-286TR*/
|
||||
f = romfopen("roms/super286tr/hyundai_award286.bin", "rb");
|
||||
f = romfopen(L"roms/super286tr/hyundai_award286.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
#if 0
|
||||
case ROM_PX386: /*Phoenix 80386 BIOS*/
|
||||
f=romfopen("roms/px386/3iip001l.bin","rb");
|
||||
ff=romfopen("roms/px386/3iip001h.bin","rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x10000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
case ROM_DTK386: /*Uses NEAT chipset*/
|
||||
f = romfopen("roms/dtk386/3cto001.bin", "rb");
|
||||
f = romfopen(L"roms/dtk386/3cto001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PXXT:
|
||||
f = romfopen("roms/pxxt/000p001.bin", "rb");
|
||||
f = romfopen(L"roms/pxxt/000p001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_JUKOPC:
|
||||
f = romfopen("roms/jukopc/000o001.bin", "rb");
|
||||
f = romfopen(L"roms/jukopc/000o001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M30_286:
|
||||
f = romfopen("roms/ibmps2_m30_286/33f5381a.bin", "rb");
|
||||
f = romfopen(L"roms/ibmps2_m30_286/33f5381a.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -628,14 +563,14 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_DTK486:
|
||||
f = romfopen("roms/dtk486/4siw005.bin", "rb");
|
||||
f = romfopen(L"roms/dtk486/4siw005.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_R418:
|
||||
f = romfopen("roms/r418/r418i.bin", "rb");
|
||||
f = romfopen(L"roms/r418/r418i.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -644,7 +579,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_586MC1:
|
||||
f = romfopen("roms/586mc1/IS.34", "rb");
|
||||
f = romfopen(L"roms/586mc1/IS.34", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -652,12 +587,12 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_PLATO:
|
||||
f = romfopen("roms/plato/1016AX1_.BIO", "rb");
|
||||
f = romfopen(L"roms/plato/1016AX1_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/plato/1016AX1_.BI1", "rb");
|
||||
f = romfopen(L"roms/plato/1016AX1_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xd000, 1, f);
|
||||
@@ -666,7 +601,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_MB500N:
|
||||
f = romfopen("roms/mb500n/031396S.BIN", "rb"); /* Works */
|
||||
f = romfopen(L"roms/mb500n/031396S.BIN", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -674,7 +609,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_AP53:
|
||||
f = romfopen("roms/ap53/AP53R2C0.ROM", "rb"); /* Works */
|
||||
f = romfopen(L"roms/ap53/AP53R2C0.ROM", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -682,7 +617,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_P55T2S:
|
||||
f = romfopen("roms/p55t2s/S6Y08T.ROM", "rb"); /* Works */
|
||||
f = romfopen(L"roms/p55t2s/S6Y08T.ROM", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -690,7 +625,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_P54TP4XE:
|
||||
f = romfopen("roms/p54tp4xe/T15I0302.AWD", "rb");
|
||||
f = romfopen(L"roms/p54tp4xe/T15I0302.AWD", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -698,7 +633,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_ACERM3A:
|
||||
f = romfopen("roms/acerm3a/r01-b3.bin", "rb");
|
||||
f = romfopen(L"roms/acerm3a/r01-b3.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -706,7 +641,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_ACERV35N:
|
||||
f = romfopen("roms/acerv35n/V35ND1S1.BIN", "rb");
|
||||
f = romfopen(L"roms/acerv35n/V35ND1S1.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -714,7 +649,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_P55VA:
|
||||
f = romfopen("roms/p55va/VA021297.BIN", "rb");
|
||||
f = romfopen(L"roms/p55va/VA021297.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -722,7 +657,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_P55T2P4:
|
||||
f = romfopen("roms/p55t2p4/0207_J2.BIN", "rb");
|
||||
f = romfopen(L"roms/p55t2p4/0207_J2.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -730,7 +665,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_P55TVP4:
|
||||
f = romfopen("roms/p55tvp4/TV5I0204.AWD", "rb");
|
||||
f = romfopen(L"roms/p55tvp4/TV5I0204.AWD", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -738,7 +673,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_440FX:
|
||||
f = romfopen("roms/440fx/NTMAW501.BIN", "rb"); /* Working Tyan BIOS. */
|
||||
f = romfopen(L"roms/440fx/NTMAW501.BIN", L"rb"); /* Working Tyan BIOS. */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -746,7 +681,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_S1668:
|
||||
f = romfopen("roms/tpatx/S1668P.ROM", "rb"); /* Working Tyan BIOS. */
|
||||
f = romfopen(L"roms/tpatx/S1668P.ROM", L"rb"); /* Working Tyan BIOS. */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -754,12 +689,12 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_THOR:
|
||||
f = romfopen("roms/thor/1006CN0_.BIO", "rb");
|
||||
f = romfopen(L"roms/thor/1006CN0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/thor/1006CN0_.BI1", "rb");
|
||||
f = romfopen(L"roms/thor/1006CN0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0x10000, 1, f);
|
||||
@@ -768,7 +703,7 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_MRTHOR:
|
||||
f = romfopen("roms/mrthor/MR_ATX.BIO", "rb");
|
||||
f = romfopen(L"roms/mrthor/MR_ATX.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
@@ -776,12 +711,12 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_ZAPPA:
|
||||
f = romfopen("roms/zappa/1006BS0_.BIO", "rb");
|
||||
f = romfopen(L"roms/zappa/1006BS0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen("roms/zappa/1006BS0_.BI1", "rb");
|
||||
f = romfopen(L"roms/zappa/1006BS0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0x10000, 1, f);
|
||||
@@ -790,8 +725,8 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M50:
|
||||
f=romfopen("roms/i8550021/90x7423.zm14","rb");
|
||||
ff=romfopen("roms/i8550021/90x7426.zm16","rb");
|
||||
f=romfopen(L"roms/i8550021/90x7423.zm14",L"rb");
|
||||
ff=romfopen(L"roms/i8550021/90x7426.zm16",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x10000; c += 2)
|
||||
{
|
||||
@@ -800,8 +735,8 @@ int loadbios()
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f=romfopen("roms/i8550021/90x7420.zm13","rb");
|
||||
ff=romfopen("roms/i8550021/90x7429.zm18","rb");
|
||||
f=romfopen(L"roms/i8550021/90x7420.zm13",L"rb");
|
||||
ff=romfopen(L"roms/i8550021/90x7429.zm18",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x10000; c < 0x20000; c += 2)
|
||||
{
|
||||
@@ -814,8 +749,8 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M55SX:
|
||||
f=romfopen("roms/i8555081/33f8146.zm41","rb");
|
||||
ff=romfopen("roms/i8555081/33f8145.zm40","rb");
|
||||
f=romfopen(L"roms/i8555081/33f8146.zm41",L"rb");
|
||||
ff=romfopen(L"roms/i8555081/33f8145.zm40",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x20000; c += 2)
|
||||
{
|
||||
@@ -828,8 +763,8 @@ int loadbios()
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M80:
|
||||
f=romfopen("roms/i8580111/15f6637.bin","rb");
|
||||
ff=romfopen("roms/i8580111/15f6639.bin","rb");
|
||||
f=romfopen(L"roms/i8580111/15f6637.bin",L"rb");
|
||||
ff=romfopen(L"roms/i8580111/15f6639.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x20000; c += 2)
|
||||
{
|
||||
|
||||
@@ -107,8 +107,6 @@ void mem_write_null(uint32_t addr, uint8_t val, void *p);
|
||||
void mem_write_nullw(uint32_t addr, uint16_t val, void *p);
|
||||
void mem_write_nulll(uint32_t addr, uint32_t val, void *p);
|
||||
|
||||
FILE *romfopen(char *fn, char *mode);
|
||||
|
||||
mem_mapping_t bios_mapping[8];
|
||||
mem_mapping_t bios_high_mapping[8];
|
||||
|
||||
|
||||
@@ -858,7 +858,7 @@ static void *xebec_init()
|
||||
|
||||
xebec_set_switches(xebec);
|
||||
|
||||
rom_init(&xebec->bios_rom, "roms/ibm_xebec_62x0822_1985.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xebec->bios_rom, L"roms/ibm_xebec_62x0822_1985.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
io_sethandler(0x0320, 0x0004, xebec_read, NULL, NULL, xebec_write, NULL, NULL, xebec);
|
||||
|
||||
@@ -885,7 +885,7 @@ static void xebec_close(void *p)
|
||||
|
||||
static int xebec_available()
|
||||
{
|
||||
return rom_present("roms/ibm_xebec_62x0822_1985.bin");
|
||||
return rom_present(L"roms/ibm_xebec_62x0822_1985.bin");
|
||||
}
|
||||
|
||||
device_t mfm_xebec_device =
|
||||
@@ -923,7 +923,7 @@ static void *dtc_5150x_init()
|
||||
xebec->drives[1].cfg_cyl = xebec->drives[1].tracks;
|
||||
xebec->drives[1].cfg_hpc = xebec->drives[1].hpc;
|
||||
|
||||
rom_init(&xebec->bios_rom, "roms/dtc_cxd21a.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xebec->bios_rom, L"roms/dtc_cxd21a.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
io_sethandler(0x0320, 0x0004, xebec_read, NULL, NULL, xebec_write, NULL, NULL, xebec);
|
||||
|
||||
@@ -933,7 +933,7 @@ static void *dtc_5150x_init()
|
||||
}
|
||||
static int dtc_5150x_available()
|
||||
{
|
||||
return rom_present("roms/dtc_cxd21a.bin");
|
||||
return rom_present(L"roms/dtc_cxd21a.bin");
|
||||
}
|
||||
|
||||
device_t dtc_5150x_device =
|
||||
|
||||
@@ -1955,9 +1955,9 @@ void ne2000_pci_write(int func, int addr, uint8_t val, void *p)
|
||||
}
|
||||
}
|
||||
|
||||
void ne2000_rom_init(ne2000_t *ne2000, char *s)
|
||||
void ne2000_rom_init(ne2000_t *ne2000, wchar_t *s)
|
||||
{
|
||||
FILE *f = fopen(s, "rb");
|
||||
FILE *f = romfopen(s, "rb");
|
||||
uint32_t temp;
|
||||
if(!f)
|
||||
{
|
||||
@@ -2048,7 +2048,7 @@ void *ne2000_init()
|
||||
|
||||
if (!disable_netbios)
|
||||
{
|
||||
ne2000_rom_init(ne2000, "roms/ne2000.rom");
|
||||
ne2000_rom_init(ne2000, is_rtl8029as ? L"roms/rtl8029as.rom" : L"roms/ne2000.rom");
|
||||
|
||||
if (is_rtl8029as)
|
||||
{
|
||||
|
||||
242
src/nvr.c
242
src/nvr.c
@@ -1,8 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
#include "nvr.h"
|
||||
#include "pic.h"
|
||||
#include "rom.h"
|
||||
#include "timer.h"
|
||||
#include "rtc.h"
|
||||
|
||||
@@ -190,72 +192,60 @@ void loadnvr()
|
||||
oldromset=romset;
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_PC1512: f = romfopen(nvr_concat("pc1512.nvr"), "rb"); break;
|
||||
case ROM_PC1640: f = romfopen(nvr_concat("pc1640.nvr"), "rb"); break;
|
||||
case ROM_PC200: f = romfopen(nvr_concat("pc200.nvr"), "rb"); break;
|
||||
case ROM_PC2086: f = romfopen(nvr_concat("pc2086.nvr"), "rb"); break;
|
||||
case ROM_PC3086: f = romfopen(nvr_concat("pc3086.nvr"), "rb"); break;
|
||||
case ROM_IBMAT: f = romfopen(nvr_concat("at.nvr"), "rb"); break;
|
||||
case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS2_M30_286: f = romfopen(nvr_concat("ibmps2_m30_286.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS2_M50: f = romfopen("nvr/ibmps2_m50.nvr", "rb"); break;
|
||||
case ROM_IBMPS2_M55SX: f = romfopen("nvr/ibmps2_m55sx.nvr", "rb"); break;
|
||||
case ROM_IBMPS2_M80: f = romfopen("nvr/ibmps2_m80.nvr", "rb"); break;
|
||||
case ROM_CMDPC30: f = romfopen(nvr_concat("cmdpc30.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_PORTABLEII: f = romfopen(nvr_concat("portableii.nvr"), "rb"); break;
|
||||
case ROM_PORTABLEIII: f = romfopen(nvr_concat("portableiii.nvr"), "rb"); break;
|
||||
case ROM_AMI286: f = romfopen(nvr_concat("ami286.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_AWARD286: f = romfopen(nvr_concat("award286.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_DELL200: f = romfopen(nvr_concat("dell200.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_SUPER286TR: f = romfopen(nvr_concat("super286tr.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_SPC4200P: f = romfopen(nvr_concat("spc4200p.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_IBMAT386: f = romfopen(nvr_concat("at386.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_DESKPRO_386: f = romfopen(nvr_concat("deskpro386.nvr"), "rb"); break;
|
||||
case ROM_PORTABLEIII386: f = romfopen(nvr_concat("portableiii386.nvr"), "rb"); break;
|
||||
/* case ROM_ACER386: f = romfopen(nvr_concat("acer386.nvr"), "rb"); nvrmask = 127; break; */
|
||||
case ROM_MEGAPC: f = romfopen(nvr_concat("megapc.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_MEGAPCDX: f = romfopen(nvr_concat("megapcdx.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_AMI386SX: f = romfopen(nvr_concat("ami386.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_AMI486: f = romfopen(nvr_concat("ami486.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_WIN486: f = romfopen(nvr_concat("win486.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_PCI486: f = romfopen(nvr_concat("hot-433.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_SIS496: f = romfopen(nvr_concat("sis496.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_430VX: f = romfopen(nvr_concat("430vx.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_REVENGE: f = romfopen(nvr_concat("revenge.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_ENDEAVOR: f = romfopen(nvr_concat("endeavor.nvr"), "rb"); nvrmask = 127; break;
|
||||
/* case ROM_PX386: f = romfopen(nvr_concat("px386.nvr"), "rb"); nvrmask = 127; break; */
|
||||
case ROM_DTK386: f = romfopen(nvr_concat("dtk386.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_MR386DX_OPTI495: f = romfopen(nvr_concat("mr386dx_opti495.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_AMI386DX_OPTI495: f = romfopen(nvr_concat("ami386dx_opti495.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_DTK486: f = romfopen(nvr_concat("dtk486.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_R418: f = romfopen(nvr_concat("r418.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_586MC1: f = romfopen(nvr_concat("586mc1.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_PLATO: f = romfopen(nvr_concat("plato.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_MB500N: f = romfopen(nvr_concat("mb500n.nvr"), "rb"); nvrmask = 127; break;
|
||||
#if 0
|
||||
case ROM_POWERMATE_V: f = romfopen(nvr_concat("powermate_v.nvr"), "rb"); nvrmask = 127; break;
|
||||
#endif
|
||||
case ROM_P54TP4XE: f = romfopen(nvr_concat("p54tp4xe.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_AP53: f = romfopen(nvr_concat("ap53.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_P55T2S: f = romfopen(nvr_concat("p55t2s.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_ACERM3A: f = romfopen(nvr_concat("acerm3a.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_ACERV35N: f = romfopen(nvr_concat("acerv35n.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_P55VA: f = romfopen(nvr_concat("p55va.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_P55T2P4: f = romfopen(nvr_concat("p55t2p4.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_P55TVP4: f = romfopen(nvr_concat("p55tvp4.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_440FX: f = romfopen(nvr_concat("440fx.nvr"), "rb"); nvrmask = 127; break;
|
||||
#if 0
|
||||
case ROM_MARL: f = romfopen(nvr_concat("marl.nvr"), "rb"); nvrmask = 127; break;
|
||||
#endif
|
||||
case ROM_THOR: f = romfopen(nvr_concat("thor.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_MRTHOR: f = romfopen(nvr_concat("mrthor.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_ZAPPA: f = romfopen(nvr_concat("zappa.nvr"), "rb"); nvrmask = 127; break;
|
||||
#if 0
|
||||
case ROM_CMDPC60: f = romfopen(nvr_concat("cmdpc60.nvr"), "rb"); nvrmask = 127; break;
|
||||
#endif
|
||||
case ROM_S1668: f = romfopen(nvr_concat("tpatx.nvr"), "rb"); nvrmask = 127; break;
|
||||
case ROM_PC1512: f = nvrfopen(L"pc1512.nvr", L"rb"); break;
|
||||
case ROM_PC1640: f = nvrfopen(L"pc1640.nvr", L"rb"); break;
|
||||
case ROM_PC200: f = nvrfopen(L"pc200.nvr", L"rb"); break;
|
||||
case ROM_PC2086: f = nvrfopen(L"pc2086.nvr", L"rb"); break;
|
||||
case ROM_PC3086: f = nvrfopen(L"pc3086.nvr", L"rb"); break;
|
||||
case ROM_IBMAT: f = nvrfopen(L"at.nvr", L"rb"); break;
|
||||
case ROM_IBMPS1_2011: f = nvrfopen(L"ibmps1_2011.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS1_2121: f = nvrfopen(L"ibmps1_2121.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS1_2121_ISA: f = nvrfopen(L"ibmps1_2121_isa.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS2_M30_286: f = nvrfopen(L"ibmps2_m30_286.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_IBMPS2_M50: f = nvrfopen(L"ibmps2_m50.nvr", L"rb"); break;
|
||||
case ROM_IBMPS2_M55SX: f = nvrfopen(L"ibmps2_m55sx.nvr", L"rb"); break;
|
||||
case ROM_IBMPS2_M80: f = nvrfopen(L"ibmps2_m80.nvr", L"rb"); break;
|
||||
case ROM_CMDPC30: f = nvrfopen(L"cmdpc30.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_PORTABLEII: f = nvrfopen(L"portableii.nvr", L"rb"); break;
|
||||
case ROM_PORTABLEIII: f = nvrfopen(L"portableiii.nvr", L"rb"); break;
|
||||
case ROM_AMI286: f = nvrfopen(L"ami286.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_AWARD286: f = nvrfopen(L"award286.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_DELL200: f = nvrfopen(L"dell200.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_SUPER286TR: f = nvrfopen(L"super286tr.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_SPC4200P: f = nvrfopen(L"spc4200p.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_IBMAT386: f = nvrfopen(L"at386.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_DESKPRO_386: f = nvrfopen(L"deskpro386.nvr", L"rb"); break;
|
||||
case ROM_PORTABLEIII386: f = nvrfopen(L"portableiii386.nvr", L"rb"); break;
|
||||
case ROM_MEGAPC: f = nvrfopen(L"megapc.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_MEGAPCDX: f = nvrfopen(L"megapcdx.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_AMI386SX: f = nvrfopen(L"ami386.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_AMI486: f = nvrfopen(L"ami486.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_WIN486: f = nvrfopen(L"win486.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_SIS496: f = nvrfopen(L"sis496.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_430VX: f = nvrfopen(L"430vx.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_REVENGE: f = nvrfopen(L"revenge.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_ENDEAVOR: f = nvrfopen(L"endeavor.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_DTK386: f = nvrfopen(L"dtk386.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_MR386DX_OPTI495: f = nvrfopen(L"mr386dx_opti495.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_AMI386DX_OPTI495: f = nvrfopen(L"ami386dx_opti495.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_DTK486: f = nvrfopen(L"dtk486.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_R418: f = nvrfopen(L"r418.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_586MC1: f = nvrfopen(L"586mc1.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_PLATO: f = nvrfopen(L"plato.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_MB500N: f = nvrfopen(L"mb500n.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_P54TP4XE: f = nvrfopen(L"p54tp4xe.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_AP53: f = nvrfopen(L"ap53.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_P55T2S: f = nvrfopen(L"p55t2s.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_ACERM3A: f = nvrfopen(L"acerm3a.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_ACERV35N: f = nvrfopen(L"acerv35n.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_P55VA: f = nvrfopen(L"p55va.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_P55T2P4: f = nvrfopen(L"p55t2p4.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_P55TVP4: f = nvrfopen(L"p55tvp4.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_440FX: f = nvrfopen(L"440fx.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_THOR: f = nvrfopen(L"thor.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_MRTHOR: f = nvrfopen(L"mrthor.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_ZAPPA: f = nvrfopen(L"zappa.nvr", L"rb"); nvrmask = 127; break;
|
||||
case ROM_S1668: f = nvrfopen(L"tpatx.nvr", L"rb"); nvrmask = 127; break;
|
||||
default: return;
|
||||
}
|
||||
if (!f)
|
||||
@@ -287,72 +277,60 @@ void savenvr()
|
||||
FILE *f;
|
||||
switch (oldromset)
|
||||
{
|
||||
case ROM_PC1512: f = romfopen(nvr_concat("pc1512.nvr"), "wb"); break;
|
||||
case ROM_PC1640: f = romfopen(nvr_concat("pc1640.nvr"), "wb"); break;
|
||||
case ROM_PC200: f = romfopen(nvr_concat("pc200.nvr"), "wb"); break;
|
||||
case ROM_PC2086: f = romfopen(nvr_concat("pc2086.nvr"), "wb"); break;
|
||||
case ROM_PC3086: f = romfopen(nvr_concat("pc3086.nvr"), "wb"); break;
|
||||
case ROM_IBMAT: f = romfopen(nvr_concat("at.nvr"), "wb"); break;
|
||||
case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "wb"); break;
|
||||
case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "wb"); break;
|
||||
case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "wb"); break;
|
||||
case ROM_IBMPS2_M30_286: f = romfopen(nvr_concat("ibmps2_m30_286.nvr"), "wb"); break;
|
||||
case ROM_IBMPS2_M50: f = romfopen("nvr/ibmps2_m50.nvr", "wb"); break;
|
||||
case ROM_IBMPS2_M55SX: f = romfopen("nvr/ibmps2_m55sx.nvr", "wb"); break;
|
||||
case ROM_IBMPS2_M80: f = romfopen("nvr/ibmps2_m80.nvr", "wb"); break;
|
||||
case ROM_CMDPC30: f = romfopen(nvr_concat("cmdpc30.nvr"), "wb"); break;
|
||||
case ROM_PORTABLEII: f = romfopen(nvr_concat("portableii.nvr"), "wb"); break;
|
||||
case ROM_PORTABLEIII: f = romfopen(nvr_concat("portableiii.nvr"), "wb"); break;
|
||||
case ROM_AMI286: f = romfopen(nvr_concat("ami286.nvr"), "wb"); break;
|
||||
case ROM_AWARD286: f = romfopen(nvr_concat("award286.nvr"), "wb"); break;
|
||||
case ROM_DELL200: f = romfopen(nvr_concat("dell200.nvr"), "wb"); break;
|
||||
case ROM_SUPER286TR: f = romfopen(nvr_concat("super286tr.nvr"), "wb"); break;
|
||||
case ROM_SPC4200P: f = romfopen(nvr_concat("spc4200p.nvr"), "wb"); break;
|
||||
case ROM_IBMAT386: f = romfopen(nvr_concat("at386.nvr"), "wb"); break;
|
||||
case ROM_DESKPRO_386: f = romfopen(nvr_concat("deskpro386.nvr"), "wb"); break;
|
||||
case ROM_PORTABLEIII386: f = romfopen(nvr_concat("portableiii386.nvr"), "wb"); break;
|
||||
/* case ROM_ACER386: f = romfopen(nvr_concat("acer386.nvr"), "wb"); break; */
|
||||
case ROM_MEGAPC: f = romfopen(nvr_concat("megapc.nvr"), "wb"); break;
|
||||
case ROM_MEGAPCDX: f = romfopen(nvr_concat("megapcdx.nvr"), "wb"); break;
|
||||
case ROM_AMI386SX: f = romfopen(nvr_concat("ami386.nvr"), "wb"); break;
|
||||
case ROM_AMI486: f = romfopen(nvr_concat("ami486.nvr"), "wb"); break;
|
||||
case ROM_WIN486: f = romfopen(nvr_concat("win486.nvr"), "wb"); break;
|
||||
case ROM_PCI486: f = romfopen(nvr_concat("hot-433.nvr"), "wb"); break;
|
||||
case ROM_SIS496: f = romfopen(nvr_concat("sis496.nvr"), "wb"); break;
|
||||
case ROM_430VX: f = romfopen(nvr_concat("430vx.nvr"), "wb"); break;
|
||||
case ROM_REVENGE: f = romfopen(nvr_concat("revenge.nvr"), "wb"); break;
|
||||
case ROM_ENDEAVOR: f = romfopen(nvr_concat("endeavor.nvr"), "wb"); break;
|
||||
/* case ROM_PX386: f = romfopen(nvr_concat("px386.nvr"), "wb"); break; */
|
||||
case ROM_DTK386: f = romfopen(nvr_concat("dtk386.nvr"), "wb"); break;
|
||||
case ROM_MR386DX_OPTI495: f = romfopen(nvr_concat("mr386dx_opti495.nvr"), "wb"); break;
|
||||
case ROM_AMI386DX_OPTI495: f = romfopen(nvr_concat("ami386dx_opti495.nvr"), "wb"); break;
|
||||
case ROM_DTK486: f = romfopen(nvr_concat("dtk486.nvr"), "wb"); break;
|
||||
case ROM_R418: f = romfopen(nvr_concat("r418.nvr"), "wb"); break;
|
||||
case ROM_586MC1: f = romfopen(nvr_concat("586mc1.nvr"), "wb"); break;
|
||||
case ROM_PLATO: f = romfopen(nvr_concat("plato.nvr"), "wb"); break;
|
||||
case ROM_MB500N: f = romfopen(nvr_concat("mb500n.nvr"), "wb"); break;
|
||||
#if 0
|
||||
case ROM_POWERMATE_V: f = romfopen(nvr_concat("powermate_v.nvr"), "wb"); break;
|
||||
#endif
|
||||
case ROM_P54TP4XE: f = romfopen(nvr_concat("p54tp4xe.nvr"), "wb"); break;
|
||||
case ROM_AP53: f = romfopen(nvr_concat("ap53.nvr"), "wb"); break;
|
||||
case ROM_P55T2S: f = romfopen(nvr_concat("p55t2s.nvr"), "wb"); break;
|
||||
case ROM_ACERM3A: f = romfopen(nvr_concat("acerm3a.nvr"), "wb"); break;
|
||||
case ROM_ACERV35N: f = romfopen(nvr_concat("acerv35n.nvr"), "wb"); break;
|
||||
case ROM_P55VA: f = romfopen(nvr_concat("p55va.nvr"), "wb"); break;
|
||||
case ROM_P55T2P4: f = romfopen(nvr_concat("p55t2p4.nvr"), "wb"); break;
|
||||
case ROM_P55TVP4: f = romfopen(nvr_concat("p55tvp4.nvr"), "wb"); break;
|
||||
case ROM_440FX: f = romfopen(nvr_concat("440fx.nvr"), "wb"); break;
|
||||
#if 0
|
||||
case ROM_MARL: f = romfopen(nvr_concat("marl.nvr"), "wb"); break;
|
||||
#endif
|
||||
case ROM_THOR: f = romfopen(nvr_concat("thor.nvr"), "wb"); break;
|
||||
case ROM_MRTHOR: f = romfopen(nvr_concat("mrthor.nvr"), "wb"); break;
|
||||
case ROM_ZAPPA: f = romfopen(nvr_concat("zappa.nvr"), "wb"); break;
|
||||
#if 0
|
||||
case ROM_CMDPC60: f = romfopen(nvr_concat("cmdpc60.nvr"), "wb"); break;
|
||||
#endif
|
||||
case ROM_S1668: f = romfopen(nvr_concat("tpatx.nvr"), "wb"); break;
|
||||
case ROM_PC1512: f = nvrfopen(L"pc1512.nvr", L"wb"); break;
|
||||
case ROM_PC1640: f = nvrfopen(L"pc1640.nvr", L"wb"); break;
|
||||
case ROM_PC200: f = nvrfopen(L"pc200.nvr", L"wb"); break;
|
||||
case ROM_PC2086: f = nvrfopen(L"pc2086.nvr", L"wb"); break;
|
||||
case ROM_PC3086: f = nvrfopen(L"pc3086.nvr", L"wb"); break;
|
||||
case ROM_IBMAT: f = nvrfopen(L"at.nvr", L"wb"); break;
|
||||
case ROM_IBMPS1_2011: f = nvrfopen(L"ibmps1_2011.nvr", L"wb"); break;
|
||||
case ROM_IBMPS1_2121: f = nvrfopen(L"ibmps1_2121.nvr", L"wb"); break;
|
||||
case ROM_IBMPS1_2121_ISA: f = nvrfopen(L"ibmps1_2121_isa.nvr", L"wb"); break;
|
||||
case ROM_IBMPS2_M30_286: f = nvrfopen(L"ibmps2_m30_286.nvr", L"wb"); break;
|
||||
case ROM_IBMPS2_M50: f = nvrfopen(L"ibmps2_m50.nvr", L"wb"); break;
|
||||
case ROM_IBMPS2_M55SX: f = nvrfopen(L"ibmps2_m55sx.nvr", L"wb"); break;
|
||||
case ROM_IBMPS2_M80: f = nvrfopen(L"ibmps2_m80.nvr", L"wb"); break;
|
||||
case ROM_CMDPC30: f = nvrfopen(L"cmdpc30.nvr", L"wb"); break;
|
||||
case ROM_PORTABLEII: f = nvrfopen(L"portableii.nvr", L"wb"); break;
|
||||
case ROM_PORTABLEIII: f = nvrfopen(L"portableiii.nvr", L"wb"); break;
|
||||
case ROM_AMI286: f = nvrfopen(L"ami286.nvr", L"wb"); break;
|
||||
case ROM_AWARD286: f = nvrfopen(L"award286.nvr", L"wb"); break;
|
||||
case ROM_DELL200: f = nvrfopen(L"dell200.nvr", L"wb"); break;
|
||||
case ROM_SUPER286TR: f = nvrfopen(L"super286tr.nvr", L"wb"); break;
|
||||
case ROM_SPC4200P: f = nvrfopen(L"spc4200p.nvr", L"wb"); break;
|
||||
case ROM_IBMAT386: f = nvrfopen(L"at386.nvr", L"wb"); break;
|
||||
case ROM_DESKPRO_386: f = nvrfopen(L"deskpro386.nvr", L"wb"); break;
|
||||
case ROM_PORTABLEIII386: f = nvrfopen(L"portableiii386.nvr", L"wb"); break;
|
||||
case ROM_MEGAPC: f = nvrfopen(L"megapc.nvr", L"wb"); break;
|
||||
case ROM_MEGAPCDX: f = nvrfopen(L"megapcdx.nvr", L"wb"); break;
|
||||
case ROM_AMI386SX: f = nvrfopen(L"ami386.nvr", L"wb"); break;
|
||||
case ROM_AMI486: f = nvrfopen(L"ami486.nvr", L"wb"); break;
|
||||
case ROM_WIN486: f = nvrfopen(L"win486.nvr", L"wb"); break;
|
||||
case ROM_SIS496: f = nvrfopen(L"sis496.nvr", L"wb"); break;
|
||||
case ROM_430VX: f = nvrfopen(L"430vx.nvr", L"wb"); break;
|
||||
case ROM_REVENGE: f = nvrfopen(L"revenge.nvr", L"wb"); break;
|
||||
case ROM_ENDEAVOR: f = nvrfopen(L"endeavor.nvr", L"wb"); break;
|
||||
case ROM_DTK386: f = nvrfopen(L"dtk386.nvr", L"wb"); break;
|
||||
case ROM_MR386DX_OPTI495: f = nvrfopen(L"mr386dx_opti495.nvr", L"wb"); break;
|
||||
case ROM_AMI386DX_OPTI495: f = nvrfopen(L"ami386dx_opti495.nvr", L"wb"); break;
|
||||
case ROM_DTK486: f = nvrfopen(L"dtk486.nvr", L"wb"); break;
|
||||
case ROM_R418: f = nvrfopen(L"r418.nvr", L"wb"); break;
|
||||
case ROM_586MC1: f = nvrfopen(L"586mc1.nvr", L"wb"); break;
|
||||
case ROM_PLATO: f = nvrfopen(L"plato.nvr", L"wb"); break;
|
||||
case ROM_MB500N: f = nvrfopen(L"mb500n.nvr", L"wb"); break;
|
||||
case ROM_P54TP4XE: f = nvrfopen(L"p54tp4xe.nvr", L"wb"); break;
|
||||
case ROM_AP53: f = nvrfopen(L"ap53.nvr", L"wb"); break;
|
||||
case ROM_P55T2S: f = nvrfopen(L"p55t2s.nvr", L"wb"); break;
|
||||
case ROM_ACERM3A: f = nvrfopen(L"acerm3a.nvr", L"wb"); break;
|
||||
case ROM_ACERV35N: f = nvrfopen(L"acerv35n.nvr", L"wb"); break;
|
||||
case ROM_P55VA: f = nvrfopen(L"p55va.nvr", L"wb"); break;
|
||||
case ROM_P55T2P4: f = nvrfopen(L"p55t2p4.nvr", L"wb"); break;
|
||||
case ROM_P55TVP4: f = nvrfopen(L"p55tvp4.nvr", L"wb"); break;
|
||||
case ROM_440FX: f = nvrfopen(L"440fx.nvr", L"wb"); break;
|
||||
case ROM_THOR: f = nvrfopen(L"thor.nvr", L"wb"); break;
|
||||
case ROM_MRTHOR: f = nvrfopen(L"mrthor.nvr", L"wb"); break;
|
||||
case ROM_ZAPPA: f = nvrfopen(L"zappa.nvr", L"wb"); break;
|
||||
case ROM_S1668: f = nvrfopen(L"tpatx.nvr", L"wb"); break;
|
||||
default: return;
|
||||
}
|
||||
fwrite(nvrram,128,1,f);
|
||||
|
||||
71
src/pc.c
71
src/pc.c
@@ -76,7 +76,7 @@
|
||||
uint8_t ethif;
|
||||
int inum;
|
||||
|
||||
char nvr_path[1024];
|
||||
wchar_t nvr_path[1024];
|
||||
int path_len;
|
||||
|
||||
int window_w, window_h, window_x, window_y, window_remember;
|
||||
@@ -261,21 +261,21 @@ void pc_reset()
|
||||
ali1429_reset();
|
||||
}
|
||||
#undef printf
|
||||
void initpc(int argc, char *argv[])
|
||||
void initpc(int argc, wchar_t *argv[])
|
||||
{
|
||||
char *p;
|
||||
char *config_file = NULL;
|
||||
wchar_t *p;
|
||||
wchar_t *config_file = NULL;
|
||||
int c, i;
|
||||
FILE *ff;
|
||||
get_executable_name(pcempath,511);
|
||||
pclog("executable_name = %s\n", pcempath);
|
||||
p=get_filename(pcempath);
|
||||
*p=0;
|
||||
pclog("path = %s\n", pcempath);
|
||||
get_executable_name(pcempath, 511);
|
||||
pclog("executable_name = %ws\n", pcempath);
|
||||
p=get_filename_w(pcempath);
|
||||
*p=L'\0';
|
||||
pclog("path = %ws\n", pcempath);
|
||||
|
||||
for (c = 1; c < argc; c++)
|
||||
{
|
||||
if (!strcasecmp(argv[c], "--help"))
|
||||
if (!_wcsicmp(argv[c], L"--help"))
|
||||
{
|
||||
printf("PCem command line options :\n\n");
|
||||
printf("--config file.cfg - use given config file as initial configuration\n");
|
||||
@@ -283,22 +283,22 @@ void initpc(int argc, char *argv[])
|
||||
printf("--fullscreen - start in fullscreen mode\n");
|
||||
exit(-1);
|
||||
}
|
||||
else if (!strcasecmp(argv[c], "--config"))
|
||||
else if (!_wcsicmp(argv[c], L"--config"))
|
||||
{
|
||||
if ((c+1) == argc)
|
||||
break;
|
||||
config_file = argv[c+1];
|
||||
c++;
|
||||
}
|
||||
else if (!strcasecmp(argv[c], "--dump"))
|
||||
else if (!_wcsicmp(argv[c], L"--dump"))
|
||||
{
|
||||
dump_on_exit = 1;
|
||||
}
|
||||
else if (!strcasecmp(argv[c], "--fullscreen"))
|
||||
else if (!_wcsicmp(argv[c], L"--fullscreen"))
|
||||
{
|
||||
start_in_fullscreen = 1;
|
||||
}
|
||||
else if (!strcasecmp(argv[c], "--test"))
|
||||
else if (!_wcsicmp(argv[c], L"--test"))
|
||||
{
|
||||
/* some (undocumented) test function here.. */
|
||||
|
||||
@@ -313,11 +313,11 @@ void initpc(int argc, char *argv[])
|
||||
|
||||
if (config_file == NULL)
|
||||
{
|
||||
append_filename(config_file_default, pcempath, "86box.cfg", 511);
|
||||
append_filename_w(config_file_default, pcempath, L"86box.cfg", 511);
|
||||
}
|
||||
else
|
||||
{
|
||||
append_filename(config_file_default, pcempath, config_file, 511);
|
||||
append_filename_w(config_file_default, pcempath, config_file, 511);
|
||||
}
|
||||
|
||||
disc_random_init();
|
||||
@@ -700,12 +700,12 @@ void closepc()
|
||||
|
||||
END_OF_MAIN();*/
|
||||
|
||||
void loadconfig(char *fn)
|
||||
void loadconfig(wchar_t *fn)
|
||||
{
|
||||
int c, d;
|
||||
char s[512];
|
||||
char *p;
|
||||
WCHAR *wp;
|
||||
WCHAR *wp, *wq;
|
||||
char temps[512];
|
||||
|
||||
if (!fn)
|
||||
@@ -919,20 +919,27 @@ void loadconfig(char *fn)
|
||||
}
|
||||
}
|
||||
|
||||
memset(nvr_path, 0, 1024);
|
||||
p = (char *)config_get_string(NULL, "nvr_path", "nvr");
|
||||
if (p) {
|
||||
if (strlen(p) <= 992) strcpy(nvr_path, p);
|
||||
else strcpy(nvr_path, "nvr");
|
||||
memset(nvr_path, 0, 2048);
|
||||
wp = (char *)config_get_wstring(NULL, "nvr_path", "nvr");
|
||||
if (wp) {
|
||||
if (strlen(wp) <= 992) wcscpy(nvr_path, wp);
|
||||
else
|
||||
{
|
||||
append_filename_w(nvr_path, pcempath, L"nvr", 511);
|
||||
}
|
||||
}
|
||||
else strcpy(nvr_path, "nvr");
|
||||
else append_filename_w(nvr_path, pcempath, L"nvr", 511);
|
||||
|
||||
if (nvr_path[strlen(nvr_path)] != '/')
|
||||
if (nvr_path[wcslen(nvr_path) - 1] != L'/')
|
||||
{
|
||||
nvr_path[strlen(nvr_path)] = '/';
|
||||
if (nvr_path[wcslen(nvr_path) - 1] != L'\\')
|
||||
{
|
||||
nvr_path[wcslen(nvr_path)] = L'/';
|
||||
nvr_path[wcslen(nvr_path) + 1] = L'\0';
|
||||
}
|
||||
}
|
||||
|
||||
path_len = strlen(nvr_path);
|
||||
path_len = wcslen(nvr_path);
|
||||
|
||||
serial_enabled[0] = config_get_int(NULL, "serial1_enabled", 1);
|
||||
serial_enabled[1] = config_get_int(NULL, "serial2_enabled", 1);
|
||||
@@ -940,10 +947,14 @@ void loadconfig(char *fn)
|
||||
bugger_enabled = config_get_int(NULL, "bugger_enabled", 0);
|
||||
}
|
||||
|
||||
char *nvr_concat(char *to_concat)
|
||||
wchar_t *nvr_concat(wchar_t *to_concat)
|
||||
{
|
||||
memset(nvr_path + path_len, 0, 1024 - path_len);
|
||||
strcpy(nvr_path + path_len, to_concat);
|
||||
char *p = (char *) nvr_path;
|
||||
p += (path_len * 2);
|
||||
wchar_t *wp = (wchar_t *) p;
|
||||
|
||||
memset(wp, 0, (1024 - path_len) * 2);
|
||||
wcscpy(wp, to_concat);
|
||||
return nvr_path;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ void ps1mb_init()
|
||||
if (!enable_xtide)
|
||||
{
|
||||
rom_init(&ps1_high_rom,
|
||||
"roms/ibmps1es/f80000_shell.bin",
|
||||
L"roms/ibmps1es/f80000_shell.bin",
|
||||
0xf80000,
|
||||
0x80000,
|
||||
0x7ffff,
|
||||
@@ -142,8 +142,8 @@ void ps1mb_init()
|
||||
MEM_MAPPING_EXTERNAL);
|
||||
}
|
||||
/* rom_init_interleaved(&ps1_high_rom,
|
||||
"roms/ibmps1es/ibm_1057757_24-05-90.bin",
|
||||
"roms/ibmps1es/ibm_1057757_29-15-90.bin",
|
||||
L"roms/ibmps1es/ibm_1057757_24-05-90.bin",
|
||||
L"roms/ibmps1es/ibm_1057757_29-15-90.bin",
|
||||
0xfc0000,
|
||||
0x40000,
|
||||
0x3ffff,
|
||||
@@ -287,7 +287,7 @@ void ps1mb_m2121_init()
|
||||
io_sethandler(0x0190, 0x0001, ps1_m2121_read, NULL, NULL, ps1_m2121_write, NULL, NULL, NULL);
|
||||
|
||||
rom_init(&ps1_high_rom,
|
||||
"roms/ibmps1_2121/fc0000_shell.bin",
|
||||
L"roms/ibmps1_2121/fc0000_shell.bin",
|
||||
0xfc0000,
|
||||
0x40000,
|
||||
0x3ffff,
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "ps2_nvr.h"
|
||||
|
||||
typedef struct ps2_nvr_t
|
||||
@@ -56,7 +58,7 @@ static void *ps2_nvr_init()
|
||||
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_IBMPS2_M80: f = romfopen("nvr/ibmps2_m80_sec.nvr", "rb"); break;
|
||||
case ROM_IBMPS2_M80: f = nvrfopen(L"ibmps2_m80_sec.nvr", L"rb"); break;
|
||||
}
|
||||
if (f)
|
||||
{
|
||||
@@ -76,7 +78,7 @@ static void ps2_nvr_close(void *p)
|
||||
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_IBMPS2_M80: f = romfopen("nvr/ibmps2_m80_sec.nvr", "wb"); break;
|
||||
case ROM_IBMPS2_M80: f = nvrfopen(L"ibmps2_m80_sec.nvr", L"wb"); break;
|
||||
}
|
||||
if (f)
|
||||
{
|
||||
|
||||
46
src/rom.c
46
src/rom.c
@@ -9,25 +9,31 @@
|
||||
#include "rom.h"
|
||||
|
||||
|
||||
FILE *romfopen(char *fn, char *mode)
|
||||
FILE *romfopen(wchar_t *fn, wchar_t *mode)
|
||||
{
|
||||
char s[512];
|
||||
strcpy(s, pcempath);
|
||||
put_backslash(s);
|
||||
strcat(s, fn);
|
||||
return fopen(s, mode);
|
||||
wchar_t s[512];
|
||||
wcscpy(s, pcempath);
|
||||
put_backslash_w(s);
|
||||
wcscat(s, fn);
|
||||
return _wfopen(s, mode);
|
||||
}
|
||||
|
||||
|
||||
int rom_present(char *fn)
|
||||
FILE *nvrfopen(wchar_t *fn, wchar_t *mode)
|
||||
{
|
||||
return _wfopen(nvr_concat(fn), mode);
|
||||
}
|
||||
|
||||
|
||||
int rom_present(wchar_t *fn)
|
||||
{
|
||||
FILE *f;
|
||||
char s[512];
|
||||
wchar_t s[512];
|
||||
|
||||
strcpy(s, pcempath);
|
||||
put_backslash(s);
|
||||
strcat(s, fn);
|
||||
f = fopen(s, "rb");
|
||||
wcscpy(s, pcempath);
|
||||
put_backslash_w(s);
|
||||
wcscat(s, fn);
|
||||
f = _wfopen(s, L"rb");
|
||||
if (f)
|
||||
{
|
||||
fclose(f);
|
||||
@@ -70,13 +76,13 @@ uint32_t rom_readl(uint32_t addr, void *p)
|
||||
}
|
||||
|
||||
|
||||
int rom_init(rom_t *rom, char *fn, uint32_t address, int size, int mask, int file_offset, uint32_t flags)
|
||||
int rom_init(rom_t *rom, wchar_t *fn, uint32_t address, int size, int mask, int file_offset, uint32_t flags)
|
||||
{
|
||||
FILE *f = romfopen(fn, "rb");
|
||||
FILE *f = romfopen(fn, L"rb");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
pclog("ROM image not found : %s\n", fn);
|
||||
pclog("ROM image not found : %ws\n", fn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -101,20 +107,20 @@ int rom_init(rom_t *rom, char *fn, uint32_t address, int size, int mask, int fil
|
||||
}
|
||||
|
||||
|
||||
int rom_init_interleaved(rom_t *rom, char *fn_low, char *fn_high, uint32_t address, int size, int mask, int file_offset, uint32_t flags)
|
||||
int rom_init_interleaved(rom_t *rom, wchar_t *fn_low, wchar_t *fn_high, uint32_t address, int size, int mask, int file_offset, uint32_t flags)
|
||||
{
|
||||
FILE *f_low = romfopen(fn_low, "rb");
|
||||
FILE *f_high = romfopen(fn_high, "rb");
|
||||
FILE *f_low = romfopen(fn_low, L"rb");
|
||||
FILE *f_high = romfopen(fn_high, L"rb");
|
||||
int c;
|
||||
|
||||
if (!f_low || !f_high)
|
||||
{
|
||||
if (!f_low)
|
||||
pclog("ROM image not found : %s\n", fn_low);
|
||||
pclog("ROM image not found : %ws\n", fn_low);
|
||||
else
|
||||
fclose(f_low);
|
||||
if (!f_high)
|
||||
pclog("ROM image not found : %s\n", fn_high);
|
||||
pclog("ROM image not found : %ws\n", fn_high);
|
||||
else
|
||||
fclose(f_high);
|
||||
return -1;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
FILE *romfopen(char *fn, char *mode);
|
||||
int rom_present(char *fn);
|
||||
FILE *romfopen(wchar_t *fn, wchar_t *mode);
|
||||
FILE *nvrfopen(wchar_t *fn, wchar_t *mode);
|
||||
int rom_present(wchar_t *fn);
|
||||
|
||||
typedef struct rom_t
|
||||
{
|
||||
@@ -11,5 +12,5 @@ typedef struct rom_t
|
||||
mem_mapping_t mapping;
|
||||
} rom_t;
|
||||
|
||||
int rom_init(rom_t *rom, char *fn, uint32_t address, int size, int mask, int file_offset, uint32_t flags);
|
||||
int rom_init_interleaved(rom_t *rom, char *fn_low, char *fn_high, uint32_t address, int size, int mask, int file_offset, uint32_t flags);
|
||||
int rom_init(rom_t *rom, wchar_t *fn, uint32_t address, int size, int mask, int file_offset, uint32_t flags);
|
||||
int rom_init_interleaved(rom_t *rom, wchar_t *fn_low, wchar_t *fn_high, uint32_t address, int size, int mask, int file_offset, uint32_t flags);
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
|
||||
|
||||
#if AHA == AHA154xB
|
||||
# define ROMFILE "roms/adaptec/aha1540b310.bin"
|
||||
# define ROMFILE L"roms/adaptec/aha1540b310.bin"
|
||||
# define AHA_BID 'A' /* AHA-154x B */
|
||||
#endif
|
||||
|
||||
#if AHA == AHA154xC
|
||||
# define ROMFILE "roms/adaptec/aha1542c101.bin"
|
||||
# define ROMFILE L"roms/adaptec/aha1542c101.bin"
|
||||
# define AHA_BID 'D' /* AHA-154x C */
|
||||
# define ROM_FWHIGH 0x0022 /* firmware version (hi/lo) */
|
||||
# define ROM_SHRAM 0x3F80 /* shadow RAM address base */
|
||||
@@ -49,7 +49,7 @@
|
||||
#endif
|
||||
|
||||
#if AHA == AHA154xCF
|
||||
# define ROMFILE "roms/adaptec/aha1542cf201.bin"
|
||||
# define ROMFILE L"roms/adaptec/aha1542cf201.bin"
|
||||
# define AHA_BID 'E' /* AHA-154x CF */
|
||||
# define ROM_FWHIGH 0x0022 /* firmware version (hi/lo) */
|
||||
# define ROM_SHRAM 0x3F80 /* shadow RAM address base */
|
||||
@@ -59,7 +59,7 @@
|
||||
#endif
|
||||
|
||||
#if AHA == AHA154xCP
|
||||
# define ROMFILE "roms/adaptec/aha1542cp102.bin"
|
||||
# define ROMFILE L"roms/adaptec/aha1542cp102.bin"
|
||||
# define AHA_BID 'F' /* AHA-154x CP */
|
||||
# define ROM_FWHIGH 0x0055 /* firmware version (hi/lo) */
|
||||
# define ROM_SHRAM 0x3F80 /* shadow RAM address base */
|
||||
@@ -208,7 +208,7 @@ aha154x_init(uint16_t ioaddr, uint32_t memaddr, aha_info *aha)
|
||||
pclog("AHA154x: loading BIOS from '%s'\n", bios_path);
|
||||
|
||||
/* Open the BIOS image file and make sure it exists. */
|
||||
if ((f = fopen(bios_path, "rb")) == NULL) {
|
||||
if ((f = romfopen(bios_path, L"rb")) == NULL) {
|
||||
pclog("AHA154x: BIOS ROM not found!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ void *adgold_init()
|
||||
for (; c >= 0; c--)
|
||||
attenuation[c] = 0;
|
||||
|
||||
f = romfopen("nvr/adgold.bin", "rb");
|
||||
f = nvrfopen(L"adgold.bin", L"rb");
|
||||
if (f)
|
||||
{
|
||||
fread(adgold->adgold_eeprom, 0x18, 1, f);
|
||||
@@ -812,7 +812,7 @@ void adgold_close(void *p)
|
||||
FILE *f;
|
||||
adgold_t *adgold = (adgold_t *)p;
|
||||
|
||||
f = romfopen("nvr/adgold.bin", "wb");
|
||||
f = nvrfopen(L"adgold.bin", L"wb");
|
||||
if (f)
|
||||
{
|
||||
fwrite(adgold->adgold_eeprom, 0x18, 1, f);
|
||||
|
||||
@@ -671,7 +671,7 @@ void emu8k_init(emu8k_t *emu8k, int onboard_ram)
|
||||
int c;
|
||||
double out;
|
||||
|
||||
f = romfopen("roms/awe32.raw", "rb");
|
||||
f = romfopen(L"roms/awe32.raw", L"rb");
|
||||
if (!f)
|
||||
fatal("ROMS/AWE32.RAW not found\n");
|
||||
|
||||
|
||||
@@ -655,7 +655,7 @@ void *sb_16_init()
|
||||
|
||||
int sb_awe32_available()
|
||||
{
|
||||
return rom_present("roms/awe32.raw");
|
||||
return rom_present(L"roms/awe32.raw");
|
||||
}
|
||||
|
||||
void *sb_awe32_init()
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include <stdlib.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "mem.h"
|
||||
#include "io.h"
|
||||
#include "rom.h"
|
||||
#include "tandy_eeprom.h"
|
||||
|
||||
typedef struct
|
||||
@@ -124,10 +126,10 @@ void *tandy_eeprom_init()
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_TANDY1000HX:
|
||||
f = romfopen(nvr_concat("tandy1000hx.bin"), "rb");
|
||||
f = nvrfopen(L"tandy1000hx.bin", L"rb");
|
||||
break;
|
||||
case ROM_TANDY1000SL2:
|
||||
f = romfopen(nvr_concat("tandy1000sl2.bin"), "rb");
|
||||
f = nvrfopen(L"tandy1000sl2.bin", L"rb");
|
||||
break;
|
||||
}
|
||||
if (f)
|
||||
@@ -151,10 +153,10 @@ void tandy_eeprom_close(void *p)
|
||||
switch (eeprom->romset)
|
||||
{
|
||||
case ROM_TANDY1000HX:
|
||||
f = romfopen(nvr_concat("tandy1000hx.bin"), "wb");
|
||||
f = nvrfopen(L"tandy1000hx.bin", L"wb");
|
||||
break;
|
||||
case ROM_TANDY1000SL2:
|
||||
f = romfopen(nvr_concat("tandy1000sl2.bin"), "wb");
|
||||
f = nvrfopen(L"tandy1000sl2.bin", L"wb");
|
||||
break;
|
||||
}
|
||||
fwrite(eeprom->store, 128, 1, f);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "device.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "tandy_rom.h"
|
||||
|
||||
static uint8_t *tandy_rom;
|
||||
@@ -52,8 +53,8 @@ void *tandy_rom_init()
|
||||
|
||||
tandy_rom = malloc(0x80000);
|
||||
|
||||
f = romfopen("roms/tandy1000sl2/8079047.hu1" ,"rb");
|
||||
ff = romfopen("roms/tandy1000sl2/8079048.hu2","rb");
|
||||
f = romfopen(L"roms/tandy1000sl2/8079047.hu1", L"rb");
|
||||
ff = romfopen(L"roms/tandy1000sl2/8079048.hu2", L"rb");
|
||||
for (c = 0x0000; c < 0x80000; c += 2)
|
||||
{
|
||||
tandy_rom[c] = getc(f);
|
||||
|
||||
@@ -162,7 +162,7 @@ void *ati18800_init()
|
||||
ati18800_t *ati18800 = malloc(sizeof(ati18800_t));
|
||||
memset(ati18800, 0, sizeof(ati18800_t));
|
||||
|
||||
rom_init(&ati18800->bios_rom, "roms/vga88.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&ati18800->bios_rom, L"roms/vga88.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&ati18800->svga, ati18800, 1 << 19, /*512kb*/
|
||||
NULL,
|
||||
@@ -175,14 +175,14 @@ void *ati18800_init()
|
||||
|
||||
ati18800->svga.miscout = 1;
|
||||
|
||||
ati_eeprom_load(&ati18800->eeprom, "ati18800.nvr", 0);
|
||||
ati_eeprom_load(&ati18800->eeprom, L"ati18800.nvr", 0);
|
||||
|
||||
return ati18800;
|
||||
}
|
||||
|
||||
static int ati18800_available()
|
||||
{
|
||||
return rom_present("roms/vga88.BIN");
|
||||
return rom_present(L"roms/vga88.BIN");
|
||||
}
|
||||
|
||||
void ati18800_close(void *p)
|
||||
|
||||
@@ -361,19 +361,19 @@ void *ati28800_init()
|
||||
if (gfxcard == GFX_VGAWONDERXL)
|
||||
{
|
||||
rom_init_interleaved(&ati28800->bios_rom,
|
||||
"roms/XLEVEN.BIN",
|
||||
"roms/XLODD.BIN",
|
||||
L"roms/XLEVEN.BIN",
|
||||
L"roms/XLODD.BIN",
|
||||
0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
}
|
||||
else if (gfxcard == GFX_VGAWONDERXL24)
|
||||
{
|
||||
rom_init_interleaved(&ati28800->bios_rom,
|
||||
"roms/112-14318-102.bin",
|
||||
"roms/112-14319-102.bin",
|
||||
L"roms/112-14318-102.bin",
|
||||
L"roms/112-14319-102.bin",
|
||||
0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
}
|
||||
else
|
||||
rom_init(&ati28800->bios_rom, "roms/bios.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&ati28800->bios_rom, L"roms/bios.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&ati28800->svga, ati28800, memory, /*512kb*/
|
||||
ati28800_recalctimings,
|
||||
@@ -386,24 +386,24 @@ void *ati28800_init()
|
||||
|
||||
ati28800->svga.miscout = 1;
|
||||
|
||||
ati_eeprom_load(&ati28800->eeprom, "ati28800.nvr", 0);
|
||||
ati_eeprom_load(&ati28800->eeprom, L"ati28800.nvr", 0);
|
||||
|
||||
return ati28800;
|
||||
}
|
||||
|
||||
static int ati28800_available()
|
||||
{
|
||||
return rom_present("roms/bios.bin");
|
||||
return rom_present(L"roms/bios.bin");
|
||||
}
|
||||
|
||||
static int compaq_ati28800_available()
|
||||
{
|
||||
return (rom_present("roms/XLEVEN.bin") && rom_present("roms/XLODD.bin"));
|
||||
return (rom_present(L"roms/XLEVEN.bin") && rom_present(L"roms/XLODD.bin"));
|
||||
}
|
||||
|
||||
static int ati28800_wonderxl24_available()
|
||||
{
|
||||
return (rom_present("roms/112-14318-102.bin") && rom_present("roms/112-14319-102.bin"));
|
||||
return (rom_present(L"roms/112-14318-102.bin") && rom_present(L"roms/112-14319-102.bin"));
|
||||
}
|
||||
|
||||
void ati28800_close(void *p)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include "ibm.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "vid_ati_eeprom.h"
|
||||
|
||||
enum
|
||||
@@ -31,12 +33,12 @@ enum
|
||||
EEPROM_OP_EWEN = 3
|
||||
};
|
||||
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type)
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, wchar_t *fn, int type)
|
||||
{
|
||||
FILE *f;
|
||||
eeprom->type = type;
|
||||
strcpy(eeprom->fn, fn);
|
||||
f = romfopen(eeprom->fn, "rb");
|
||||
wcscpy(eeprom->fn, fn);
|
||||
f = nvrfopen(eeprom->fn, L"rb");
|
||||
if (!f)
|
||||
{
|
||||
memset(eeprom->data, 0, eeprom->type ? 512 : 128);
|
||||
@@ -48,7 +50,7 @@ void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type)
|
||||
|
||||
void ati_eeprom_save(ati_eeprom_t *eeprom)
|
||||
{
|
||||
FILE *f = romfopen(eeprom->fn, "wb");
|
||||
FILE *f = nvrfopen(eeprom->fn, L"wb");
|
||||
if (!f) return;
|
||||
fwrite(eeprom->data, 1, eeprom->type ? 512 : 128, f);
|
||||
fclose(f);
|
||||
|
||||
@@ -11,9 +11,9 @@ typedef struct ati_eeprom_t
|
||||
uint32_t dat;
|
||||
int type;
|
||||
|
||||
char fn[256];
|
||||
wchar_t fn[256];
|
||||
} ati_eeprom_t;
|
||||
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type);
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, wchar_t *fn, int type);
|
||||
void ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat);
|
||||
int ati_eeprom_read(ati_eeprom_t *eeprom);
|
||||
|
||||
@@ -3293,9 +3293,9 @@ static void *mach64gx_init()
|
||||
else
|
||||
mach64->config_stat0 |= 1; /*VLB, 256Kx16 DRAM*/
|
||||
|
||||
ati_eeprom_load(&mach64->eeprom, "mach64.nvr", 1);
|
||||
ati_eeprom_load(&mach64->eeprom, L"mach64.nvr", 1);
|
||||
|
||||
rom_init(&mach64->bios_rom, "roms/mach64gx/bios.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&mach64->bios_rom, L"roms/mach64gx/bios.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return mach64;
|
||||
}
|
||||
@@ -3310,9 +3310,9 @@ static void *mach64vt2_init()
|
||||
mach64->dac_cntl = 1 << 16; /*Internal 24-bit DAC*/
|
||||
mach64->config_stat0 = 4;
|
||||
|
||||
ati_eeprom_load(&mach64->eeprom, "mach64vt.nvr", 1);
|
||||
ati_eeprom_load(&mach64->eeprom, L"mach64vt.nvr", 1);
|
||||
|
||||
rom_init(&mach64->bios_rom, "roms/atimach64vt2pci.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&mach64->bios_rom, L"roms/atimach64vt2pci.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga->vblank_start = mach64_vblank_start;
|
||||
|
||||
@@ -3321,12 +3321,12 @@ static void *mach64vt2_init()
|
||||
|
||||
int mach64gx_available()
|
||||
{
|
||||
return rom_present("roms/mach64gx/bios.bin");
|
||||
return rom_present(L"roms/mach64gx/bios.bin");
|
||||
}
|
||||
|
||||
int mach64vt2_available()
|
||||
{
|
||||
return rom_present("roms/atimach64vt2pci.bin");
|
||||
return rom_present(L"roms/atimach64vt2pci.bin");
|
||||
}
|
||||
|
||||
void mach64_close(void *p)
|
||||
|
||||
@@ -806,7 +806,7 @@ uint8_t cirrus_read(uint32_t addr, void *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *clgd_common_init(char *romfn, uint8_t id)
|
||||
void *clgd_common_init(wchar_t *romfn, uint8_t id)
|
||||
{
|
||||
clgd = malloc(sizeof(clgd_t));
|
||||
svga_t *svga = &clgd->svga;
|
||||
@@ -880,92 +880,92 @@ void *clgd_common_init(char *romfn, uint8_t id)
|
||||
|
||||
void *gd6235_init()
|
||||
{
|
||||
return clgd_common_init("roms/vga6235.rom", CIRRUS_ID_CLGD6235);
|
||||
return clgd_common_init(L"roms/vga6235.rom", CIRRUS_ID_CLGD6235);
|
||||
}
|
||||
|
||||
void *gd5422_init()
|
||||
{
|
||||
return clgd_common_init("roms/CL5422.ROM", CIRRUS_ID_CLGD5422);
|
||||
return clgd_common_init(L"roms/CL5422.ROM", CIRRUS_ID_CLGD5422);
|
||||
}
|
||||
|
||||
void *gd5429_init()
|
||||
{
|
||||
return clgd_common_init("roms/5429.vbi", CIRRUS_ID_CLGD5429);
|
||||
return clgd_common_init(L"roms/5429.vbi", CIRRUS_ID_CLGD5429);
|
||||
}
|
||||
|
||||
void *gd5430_init()
|
||||
{
|
||||
return clgd_common_init("roms/pci.BIN", CIRRUS_ID_CLGD5430);
|
||||
return clgd_common_init(L"roms/pci.BIN", CIRRUS_ID_CLGD5430);
|
||||
}
|
||||
|
||||
void *dia5430_init()
|
||||
{
|
||||
return clgd_common_init("roms/diamondvlbus.BIN", CIRRUS_ID_CLGD5430);
|
||||
return clgd_common_init(L"roms/diamondvlbus.BIN", CIRRUS_ID_CLGD5430);
|
||||
}
|
||||
|
||||
void *gd5434_init()
|
||||
{
|
||||
return clgd_common_init("roms/japan.BIN", CIRRUS_ID_CLGD5434);
|
||||
return clgd_common_init(L"roms/japan.BIN", CIRRUS_ID_CLGD5434);
|
||||
}
|
||||
|
||||
void *gd5436_init()
|
||||
{
|
||||
return clgd_common_init("roms/5436.VBI", CIRRUS_ID_CLGD5436);
|
||||
return clgd_common_init(L"roms/5436.VBI", CIRRUS_ID_CLGD5436);
|
||||
}
|
||||
|
||||
void *gd5440_init()
|
||||
{
|
||||
return clgd_common_init("roms/5440BIOS.BIN", CIRRUS_ID_CLGD5440);
|
||||
return clgd_common_init(L"roms/5440BIOS.BIN", CIRRUS_ID_CLGD5440);
|
||||
}
|
||||
|
||||
void *gd5446_init()
|
||||
{
|
||||
return clgd_common_init("roms/5446BV.VBI", CIRRUS_ID_CLGD5446);
|
||||
return clgd_common_init(L"roms/5446BV.VBI", CIRRUS_ID_CLGD5446);
|
||||
}
|
||||
|
||||
static int gd5422_available()
|
||||
{
|
||||
return rom_present("roms/CL5422.ROM");
|
||||
return rom_present(L"roms/CL5422.ROM");
|
||||
}
|
||||
|
||||
static int gd5429_available()
|
||||
{
|
||||
return rom_present("roms/5429.vbi");
|
||||
return rom_present(L"roms/5429.vbi");
|
||||
}
|
||||
|
||||
static int gd5430_available()
|
||||
{
|
||||
return rom_present("roms/pci.BIN");
|
||||
return rom_present(L"roms/pci.BIN");
|
||||
}
|
||||
|
||||
static int dia5430_available()
|
||||
{
|
||||
return rom_present("roms/diamondvlbus.BIN");
|
||||
return rom_present(L"roms/diamondvlbus.BIN");
|
||||
}
|
||||
|
||||
static int gd5434_available()
|
||||
{
|
||||
return rom_present("roms/japan.BIN");
|
||||
return rom_present(L"roms/japan.BIN");
|
||||
}
|
||||
|
||||
static int gd5436_available()
|
||||
{
|
||||
return rom_present("roms/5436.VBI");
|
||||
return rom_present(L"roms/5436.VBI");
|
||||
}
|
||||
|
||||
static int gd5440_available()
|
||||
{
|
||||
return rom_present("roms/5440BIOS.BIN");
|
||||
return rom_present(L"roms/5440BIOS.BIN");
|
||||
}
|
||||
|
||||
static int gd5446_available()
|
||||
{
|
||||
return rom_present("roms/5446BV.VBI");
|
||||
return rom_present(L"roms/5446BV.VBI");
|
||||
}
|
||||
|
||||
static int gd6235_available()
|
||||
{
|
||||
return rom_present("roms/vga6235.rom");
|
||||
return rom_present(L"roms/vga6235.rom");
|
||||
}
|
||||
|
||||
void clgd_close(void *p)
|
||||
|
||||
@@ -900,7 +900,7 @@ void *ega_standalone_init()
|
||||
overscan_x = 16;
|
||||
overscan_y = 28;
|
||||
|
||||
rom_init(&ega->bios_rom, "roms/ibm_6277356_ega_card_u44_27128.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&ega->bios_rom, L"roms/ibm_6277356_ega_card_u44_27128.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
if (ega->bios_rom.rom[0x3ffe] == 0xaa && ega->bios_rom.rom[0x3fff] == 0x55)
|
||||
{
|
||||
@@ -938,7 +938,7 @@ void *cpqega_standalone_init()
|
||||
overscan_x = 16;
|
||||
overscan_y = 28;
|
||||
|
||||
rom_init(&ega->bios_rom, "roms/108281-001.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&ega->bios_rom, L"roms/108281-001.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
if (ega->bios_rom.rom[0x3ffe] == 0xaa && ega->bios_rom.rom[0x3fff] == 0x55)
|
||||
{
|
||||
@@ -974,7 +974,7 @@ void *sega_standalone_init()
|
||||
overscan_x = 16;
|
||||
overscan_y = 28;
|
||||
|
||||
rom_init(&ega->bios_rom, "roms/lega.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&ega->bios_rom, L"roms/lega.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
if (ega->bios_rom.rom[0x3ffe] == 0xaa && ega->bios_rom.rom[0x3fff] == 0x55)
|
||||
{
|
||||
@@ -1004,17 +1004,17 @@ void *sega_standalone_init()
|
||||
|
||||
static int ega_standalone_available()
|
||||
{
|
||||
return rom_present("roms/ibm_6277356_ega_card_u44_27128.bin");
|
||||
return rom_present(L"roms/ibm_6277356_ega_card_u44_27128.bin");
|
||||
}
|
||||
|
||||
static int cpqega_standalone_available()
|
||||
{
|
||||
return rom_present("roms/108281-001.bin");
|
||||
return rom_present(L"roms/108281-001.bin");
|
||||
}
|
||||
|
||||
static int sega_standalone_available()
|
||||
{
|
||||
return rom_present("roms/lega.vbi");
|
||||
return rom_present(L"roms/lega.vbi");
|
||||
}
|
||||
|
||||
void ega_close(void *p)
|
||||
|
||||
@@ -144,7 +144,7 @@ void *et4000_init()
|
||||
et4000_t *et4000 = malloc(sizeof(et4000_t));
|
||||
memset(et4000, 0, sizeof(et4000_t));
|
||||
|
||||
rom_init(&et4000->bios_rom, "roms/et4000.BIN", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&et4000->bios_rom, L"roms/et4000.BIN", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
io_sethandler(0x03c0, 0x0020, et4000_in, NULL, NULL, et4000_out, NULL, NULL, et4000);
|
||||
|
||||
@@ -159,7 +159,7 @@ void *et4000_init()
|
||||
|
||||
static int et4000_available()
|
||||
{
|
||||
return rom_present("roms/et4000.BIN");
|
||||
return rom_present(L"roms/et4000.BIN");
|
||||
}
|
||||
|
||||
void et4000_close(void *p)
|
||||
|
||||
@@ -1160,7 +1160,7 @@ void *et4000w32p_init()
|
||||
et4000w32p_hwcursor_draw,
|
||||
NULL);
|
||||
|
||||
rom_init(&et4000->bios_rom, "roms/et4000w32.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&et4000->bios_rom, L"roms/et4000w32.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&et4000->bios_rom.mapping);
|
||||
|
||||
@@ -1195,7 +1195,7 @@ void *et4000w32p_init()
|
||||
|
||||
int et4000w32p_available()
|
||||
{
|
||||
return rom_present("roms/et4000w32.bin");
|
||||
return rom_present(L"roms/et4000w32.bin");
|
||||
}
|
||||
|
||||
void et4000w32p_close(void *p)
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define GENIUS_YSIZE 1008
|
||||
|
||||
void updatewindowsize(int x, int y);
|
||||
void loadfont(char *s, int format);
|
||||
|
||||
extern uint8_t fontdat8x12[256][16];
|
||||
|
||||
@@ -606,7 +605,7 @@ void genius_close(void *p)
|
||||
|
||||
static int genius_available()
|
||||
{
|
||||
return rom_present("roms/8x12.bin");
|
||||
return rom_present(L"roms/8x12.bin");
|
||||
}
|
||||
|
||||
void genius_speed_changed(void *p)
|
||||
|
||||
@@ -2715,7 +2715,7 @@ static void *riva128_init()
|
||||
riva128_in, riva128_out,
|
||||
NULL, NULL);
|
||||
|
||||
rom_init(&riva128->bios_rom, "roms/Diamond_V330_rev-e.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&riva128->bios_rom, L"roms/Diamond_V330_rev-e.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&riva128->bios_rom.mapping);
|
||||
|
||||
@@ -2812,7 +2812,7 @@ static void riva128_close(void *p)
|
||||
|
||||
static int riva128_available()
|
||||
{
|
||||
return rom_present("roms/Diamond_V330_rev-e.vbi");
|
||||
return rom_present(L"roms/Diamond_V330_rev-e.vbi");
|
||||
}
|
||||
|
||||
static void riva128_speed_changed(void *p)
|
||||
@@ -3016,7 +3016,7 @@ static void *rivatnt_init()
|
||||
riva128_in, riva128_out,
|
||||
NULL, NULL);
|
||||
|
||||
rom_init(&riva128->bios_rom, "roms/NV4_diamond_revB.rom", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&riva128->bios_rom, L"roms/NV4_diamond_revB.rom", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&riva128->bios_rom.mapping);
|
||||
|
||||
@@ -3097,7 +3097,7 @@ static void rivatnt_close(void *p)
|
||||
|
||||
static int rivatnt_available()
|
||||
{
|
||||
return rom_present("roms/NV4_diamond_revB.rom");
|
||||
return rom_present(L"roms/NV4_diamond_revB.rom");
|
||||
}
|
||||
|
||||
static void rivatnt_speed_changed(void *p)
|
||||
@@ -3219,13 +3219,13 @@ static void *rivatnt2_init()
|
||||
switch(model)
|
||||
{
|
||||
case 0:
|
||||
rom_init(&riva128->bios_rom, "roms/NV5diamond.bin", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&riva128->bios_rom, L"roms/NV5diamond.bin", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
case 1:
|
||||
rom_init(&riva128->bios_rom, "roms/inno3d64bit.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&riva128->bios_rom, L"roms/inno3d64bit.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
case 2:
|
||||
rom_init(&riva128->bios_rom, "roms/creative.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&riva128->bios_rom, L"roms/creative.BIN", 0xc0000, 0x10000, 0xffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
}
|
||||
if (PCI)
|
||||
@@ -3308,7 +3308,7 @@ static void rivatnt2_close(void *p)
|
||||
|
||||
static int rivatnt2_available()
|
||||
{
|
||||
return rom_present("roms/NV5diamond.bin") || rom_present("roms/inno3d64bit.BIN") || rom_present("roms/creative.BIN");
|
||||
return rom_present(L"roms/NV5diamond.bin") || rom_present(L"roms/inno3d64bit.BIN") || rom_present(L"roms/creative.BIN");
|
||||
}
|
||||
|
||||
static void rivatnt2_speed_changed(void *p)
|
||||
|
||||
@@ -157,7 +157,7 @@ void oti067_recalctimings(svga_t *svga)
|
||||
}
|
||||
}
|
||||
|
||||
void *oti067_common_init(char *bios_fn, int vram_size, int chip_id)
|
||||
void *oti067_common_init(wchar_t *bios_fn, int vram_size, int chip_id)
|
||||
{
|
||||
oti067_t *oti067 = malloc(sizeof(oti067_t));
|
||||
memset(oti067, 0, sizeof(oti067_t));
|
||||
@@ -182,47 +182,26 @@ void *oti067_common_init(char *bios_fn, int vram_size, int chip_id)
|
||||
return oti067;
|
||||
}
|
||||
|
||||
/* void *oti037_init()
|
||||
{
|
||||
int vram_size = device_get_config_int("memory");
|
||||
return oti067_common_init("roms/hyundai_oti037c.bin", vram_size, 0);
|
||||
} */
|
||||
|
||||
void *oti067_init()
|
||||
{
|
||||
int vram_size = device_get_config_int("memory");
|
||||
return oti067_common_init("roms/oti067/bios.bin", vram_size, 2);
|
||||
return oti067_common_init(L"roms/oti067/bios.bin", vram_size, 2);
|
||||
}
|
||||
|
||||
void *oti077_init()
|
||||
{
|
||||
int vram_size = device_get_config_int("memory");
|
||||
return oti067_common_init("roms/oti077.vbi", vram_size, 5);
|
||||
return oti067_common_init(L"roms/oti077.vbi", vram_size, 5);
|
||||
}
|
||||
|
||||
void *oti067_acer386_init()
|
||||
{
|
||||
oti067_t *oti067 = oti067_common_init("roms/acer386/oti067.bin", 512, 2);
|
||||
|
||||
/* if (oti067)
|
||||
oti067->bios_rom.rom[0x5d] = 0x74; */
|
||||
|
||||
return oti067;
|
||||
}
|
||||
|
||||
/* static int oti037_available()
|
||||
{
|
||||
return rom_present("roms/hyundai_oti037c.bin");
|
||||
} */
|
||||
|
||||
static int oti067_available()
|
||||
{
|
||||
return rom_present("roms/oti067/bios.bin");
|
||||
return rom_present(L"roms/oti067/bios.bin");
|
||||
}
|
||||
|
||||
static int oti077_available()
|
||||
{
|
||||
return rom_present("roms/oti077.vbi");
|
||||
return rom_present(L"roms/oti077.vbi");
|
||||
}
|
||||
|
||||
void oti067_close(void *p)
|
||||
@@ -312,17 +291,6 @@ device_t oti067_device =
|
||||
oti067_add_status_info,
|
||||
oti067_config
|
||||
};
|
||||
device_t oti067_acer386_device =
|
||||
{
|
||||
"Oak OTI-067 (Acermate 386SX/25N)",
|
||||
0,
|
||||
oti067_acer386_init,
|
||||
oti067_close,
|
||||
oti067_available,
|
||||
oti067_speed_changed,
|
||||
oti067_force_redraw,
|
||||
oti067_add_status_info
|
||||
};
|
||||
device_t oti077_device =
|
||||
{
|
||||
"Oak OTI-077",
|
||||
|
||||
@@ -323,7 +323,7 @@ static void *paradise_pvga1a_pc2086_init()
|
||||
paradise_t *paradise = paradise_pvga1a_init();
|
||||
|
||||
if (paradise)
|
||||
rom_init(¶dise->bios_rom, "roms/pc2086/40186.ic171", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(¶dise->bios_rom, L"roms/pc2086/40186.ic171", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return paradise;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ static void *paradise_pvga1a_pc3086_init()
|
||||
paradise_t *paradise = paradise_pvga1a_init();
|
||||
|
||||
if (paradise)
|
||||
rom_init(¶dise->bios_rom, "roms/pc3086/c000.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(¶dise->bios_rom, L"roms/pc3086/c000.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return paradise;
|
||||
}
|
||||
@@ -343,8 +343,8 @@ static void *paradise_wd90c11_megapc_init()
|
||||
|
||||
if (paradise)
|
||||
rom_init_interleaved(¶dise->bios_rom,
|
||||
"roms/megapc/41651-bios lo.u18",
|
||||
"roms/megapc/211253-bios hi.u19",
|
||||
L"roms/megapc/41651-bios lo.u18",
|
||||
L"roms/megapc/211253-bios hi.u19",
|
||||
0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return paradise;
|
||||
@@ -352,24 +352,9 @@ static void *paradise_wd90c11_megapc_init()
|
||||
|
||||
static int paradise_wd90c11_standalone_available()
|
||||
{
|
||||
return rom_present("roms/megapc/41651-bios lo.u18") && rom_present("roms/megapc/211253-bios hi.u19");
|
||||
return rom_present(L"roms/megapc/41651-bios lo.u18") && rom_present(L"roms/megapc/211253-bios hi.u19");
|
||||
}
|
||||
|
||||
/* static void *cpqvga_init()
|
||||
{
|
||||
paradise_t *paradise = paradise_pvga1a_init();
|
||||
|
||||
if (paradise)
|
||||
rom_init(¶dise->bios_rom, "roms/1988-05-18.rom", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return paradise;
|
||||
}
|
||||
|
||||
static int cpqvga_standalone_available()
|
||||
{
|
||||
return rom_present("roms/1988-05-18.rom");
|
||||
} */
|
||||
|
||||
void paradise_close(void *p)
|
||||
{
|
||||
paradise_t *paradise = (paradise_t *)p;
|
||||
@@ -444,14 +429,3 @@ device_t paradise_wd90c11_device =
|
||||
paradise_force_redraw,
|
||||
paradise_add_status_info
|
||||
};
|
||||
/* device_t cpqvga_device =
|
||||
{
|
||||
"Compaq/Paradise VGA",
|
||||
0,
|
||||
cpqvga_init,
|
||||
paradise_close,
|
||||
cpqvga_standalone_available,
|
||||
paradise_speed_changed,
|
||||
paradise_force_redraw,
|
||||
paradise_add_status_info
|
||||
}; */
|
||||
|
||||
@@ -125,7 +125,7 @@ void *pc1640_init()
|
||||
ega_t *ega = &pc1640->ega;
|
||||
memset(pc1640, 0, sizeof(pc1640_t));
|
||||
|
||||
rom_init(&pc1640->bios_rom, "roms/pc1640/40100", 0xc0000, 0x8000, 0x7fff, 0, 0);
|
||||
rom_init(&pc1640->bios_rom, L"roms/pc1640/40100", 0xc0000, 0x8000, 0x7fff, 0, 0);
|
||||
|
||||
ega_init(&pc1640->ega);
|
||||
pc1640->cga.vram = pc1640->ega.vram;
|
||||
|
||||
30
src/vid_s3.c
30
src/vid_s3.c
@@ -2063,7 +2063,7 @@ static int vram_sizes[] =
|
||||
3 /*8 MB*/
|
||||
};
|
||||
|
||||
static void *s3_init(char *bios_fn, int chip)
|
||||
static void *s3_init(wchar_t *bios_fn, int chip)
|
||||
{
|
||||
s3_t *s3 = malloc(sizeof(s3_t));
|
||||
svga_t *svga = &s3->svga;
|
||||
@@ -2124,7 +2124,7 @@ static void *s3_init(char *bios_fn, int chip)
|
||||
return s3;
|
||||
}
|
||||
|
||||
void *s3_vision864_init(char *bios_fn)
|
||||
void *s3_vision864_init(wchar_t *bios_fn)
|
||||
{
|
||||
s3_t *s3 = s3_init(bios_fn, S3_VISION864);
|
||||
|
||||
@@ -2140,29 +2140,29 @@ void *s3_vision864_init(char *bios_fn)
|
||||
|
||||
void *s3_bahamas64_init()
|
||||
{
|
||||
s3_t *s3 = s3_vision864_init("roms/bahamas64.BIN");
|
||||
s3_t *s3 = s3_vision864_init(L"roms/bahamas64.BIN");
|
||||
return s3;
|
||||
}
|
||||
|
||||
void *s3_phoenix_vision864_init()
|
||||
{
|
||||
s3_t *s3 = s3_vision864_init("roms/86c864p.bin");
|
||||
s3_t *s3 = s3_vision864_init(L"roms/86c864p.bin");
|
||||
return s3;
|
||||
}
|
||||
|
||||
int s3_bahamas64_available()
|
||||
{
|
||||
return rom_present("roms/bahamas64.BIN");
|
||||
return rom_present(L"roms/bahamas64.BIN");
|
||||
}
|
||||
|
||||
int s3_phoenix_vision864_available()
|
||||
{
|
||||
return rom_present("roms/86c864p.bin");
|
||||
return rom_present(L"roms/86c864p.bin");
|
||||
}
|
||||
|
||||
void *s3_phoenix_trio32_init()
|
||||
{
|
||||
s3_t *s3 = s3_init("roms/86C732P.bin", S3_TRIO32);
|
||||
s3_t *s3 = s3_init(L"roms/86C732P.bin", S3_TRIO32);
|
||||
|
||||
s3->id = 0xe1; /*Trio32*/
|
||||
s3->id_ext = 0x10;
|
||||
@@ -2177,10 +2177,10 @@ void *s3_phoenix_trio32_init()
|
||||
|
||||
int s3_phoenix_trio32_available()
|
||||
{
|
||||
return rom_present("roms/86C732P.bin");
|
||||
return rom_present(L"roms/86C732P.bin");
|
||||
}
|
||||
|
||||
void *s3_trio64_init(char *bios_fn)
|
||||
void *s3_trio64_init(wchar_t *bios_fn)
|
||||
{
|
||||
int card_id = 0;
|
||||
s3_t *s3 = s3_init(bios_fn, S3_TRIO64);
|
||||
@@ -2206,35 +2206,35 @@ void *s3_trio64_init(char *bios_fn)
|
||||
|
||||
void *s3_9fx_init()
|
||||
{
|
||||
s3_t *s3 = s3_trio64_init("roms/s3_764.bin");
|
||||
s3_t *s3 = s3_trio64_init(L"roms/s3_764.bin");
|
||||
return s3;
|
||||
}
|
||||
|
||||
void *s3_phoenix_trio64_init()
|
||||
{
|
||||
s3_t *s3 = s3_trio64_init("roms/86C764X1.bin");
|
||||
s3_t *s3 = s3_trio64_init(L"roms/86C764X1.bin");
|
||||
return s3;
|
||||
}
|
||||
|
||||
void *s3_diamond_stealth64_init()
|
||||
{
|
||||
s3_t *s3 = s3_trio64_init("roms/STEALT64.BIN");
|
||||
s3_t *s3 = s3_trio64_init(L"roms/STEALT64.BIN");
|
||||
return s3;
|
||||
}
|
||||
|
||||
int s3_9fx_available()
|
||||
{
|
||||
return rom_present("roms/s3_764.bin");
|
||||
return rom_present(L"roms/s3_764.bin");
|
||||
}
|
||||
|
||||
int s3_phoenix_trio64_available()
|
||||
{
|
||||
return rom_present("roms/86C764X1.bin");
|
||||
return rom_present(L"roms/86C764X1.bin");
|
||||
}
|
||||
|
||||
int s3_diamond_stealth64_available()
|
||||
{
|
||||
return rom_present("roms/STEALT64.BIN");
|
||||
return rom_present(L"roms/STEALT64.BIN");
|
||||
}
|
||||
|
||||
void s3_close(void *p)
|
||||
|
||||
@@ -3707,7 +3707,7 @@ static void *s3_virge_init()
|
||||
s3_virge_hwcursor_draw,
|
||||
s3_virge_overlay_draw);
|
||||
|
||||
rom_init(&virge->bios_rom, "roms/s3virge.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&virge->bios_rom, L"roms/s3virge.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&virge->bios_rom.mapping);
|
||||
|
||||
@@ -3802,7 +3802,7 @@ static void *s3_virge_988_init()
|
||||
s3_virge_hwcursor_draw,
|
||||
s3_virge_overlay_draw);
|
||||
|
||||
rom_init(&virge->bios_rom, "roms/diamondstealth3000.VBI", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&virge->bios_rom, L"roms/diamondstealth3000.VBI", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&virge->bios_rom.mapping);
|
||||
|
||||
@@ -3897,7 +3897,7 @@ static void *s3_virge_375_init()
|
||||
s3_virge_hwcursor_draw,
|
||||
s3_virge_overlay_draw);
|
||||
|
||||
rom_init(&virge->bios_rom, "roms/86c375_1.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&virge->bios_rom, L"roms/86c375_1.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
if (PCI)
|
||||
mem_mapping_disable(&virge->bios_rom.mapping);
|
||||
|
||||
@@ -4003,17 +4003,17 @@ static void s3_virge_close(void *p)
|
||||
|
||||
static int s3_virge_available()
|
||||
{
|
||||
return rom_present("roms/s3virge.bin");
|
||||
return rom_present(L"roms/s3virge.bin");
|
||||
}
|
||||
|
||||
static int s3_virge_988_available()
|
||||
{
|
||||
return rom_present("roms/diamondstealth3000.VBI");
|
||||
return rom_present(L"roms/diamondstealth3000.VBI");
|
||||
}
|
||||
|
||||
static int s3_virge_375_available()
|
||||
{
|
||||
return rom_present("roms/86c375_1.bin");
|
||||
return rom_present(L"roms/86c375_1.bin");
|
||||
}
|
||||
|
||||
static void s3_virge_speed_changed(void *p)
|
||||
|
||||
@@ -510,7 +510,7 @@ void *tgui9440_init()
|
||||
tgui->vram_size = device_get_config_int("memory") << 20;
|
||||
tgui->vram_mask = tgui->vram_size - 1;
|
||||
|
||||
rom_init(&tgui->bios_rom, "roms/9440.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&tgui->bios_rom, L"roms/9440.vbi", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&tgui->svga, tgui, tgui->vram_size,
|
||||
tgui_recalctimings,
|
||||
@@ -536,7 +536,7 @@ void *tgui9440_init()
|
||||
|
||||
static int tgui9440_available()
|
||||
{
|
||||
return rom_present("roms/9440.vbi");
|
||||
return rom_present(L"roms/9440.vbi");
|
||||
}
|
||||
|
||||
void tgui_close(void *p)
|
||||
|
||||
@@ -285,7 +285,7 @@ void *tvga8900d_init()
|
||||
tvga->vram_size = device_get_config_int("memory") << 10;
|
||||
tvga->vram_mask = tvga->vram_size - 1;
|
||||
|
||||
rom_init(&tvga->bios_rom, "roms/TRIDENT.BIN", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&tvga->bios_rom, L"roms/TRIDENT.BIN", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&tvga->svga, tvga, tvga->vram_size,
|
||||
tvga_recalctimings,
|
||||
@@ -300,7 +300,7 @@ void *tvga8900d_init()
|
||||
|
||||
static int tvga8900d_available()
|
||||
{
|
||||
return rom_present("roms/TRIDENT.BIN");
|
||||
return rom_present(L"roms/TRIDENT.BIN");
|
||||
}
|
||||
|
||||
void tvga_close(void *p)
|
||||
|
||||
@@ -84,7 +84,7 @@ void *vga_init()
|
||||
vga_t *vga = malloc(sizeof(vga_t));
|
||||
memset(vga, 0, sizeof(vga_t));
|
||||
|
||||
rom_init(&vga->bios_rom, "roms/ibm_vga.bin", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&vga->bios_rom, L"roms/ibm_vga.bin", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&vga->svga, vga, 1 << 18, /*256kb*/
|
||||
NULL,
|
||||
@@ -100,36 +100,13 @@ void *vga_init()
|
||||
return vga;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void *vga_chips_init()
|
||||
{
|
||||
vga_t *vga = malloc(sizeof(vga_t));
|
||||
memset(vga, 0, sizeof(vga_t));
|
||||
|
||||
rom_init(&vga->bios_rom, "roms/SD620.04M", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&vga->svga, vga, 1 << 18, /*256kb*/
|
||||
NULL,
|
||||
vga_in, vga_out,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
io_sethandler(0x03c0, 0x0020, vga_in, NULL, NULL, vga_out, NULL, NULL, vga);
|
||||
|
||||
vga->svga.bpp = 8;
|
||||
vga->svga.miscout = 1;
|
||||
|
||||
return vga;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEV_BRANCH
|
||||
void *trigem_unk_init()
|
||||
{
|
||||
vga_t *vga = malloc(sizeof(vga_t));
|
||||
memset(vga, 0, sizeof(vga_t));
|
||||
|
||||
rom_init(&vga->bios_rom, "roms/ibm_vga.bin", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&vga->bios_rom, L"roms/ibm_vga.bin", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
svga_init(&vga->svga, vga, 1 << 18, /*256kb*/
|
||||
NULL,
|
||||
@@ -172,14 +149,9 @@ void *ps1vga_init()
|
||||
|
||||
static int vga_available()
|
||||
{
|
||||
return rom_present("roms/ibm_vga.bin");
|
||||
return rom_present(L"roms/ibm_vga.bin");
|
||||
}
|
||||
|
||||
/* static int vga_chips_available()
|
||||
{
|
||||
return rom_present("roms/SD620.04M");
|
||||
} */
|
||||
|
||||
void vga_close(void *p)
|
||||
{
|
||||
vga_t *vga = (vga_t *)p;
|
||||
@@ -221,17 +193,6 @@ device_t vga_device =
|
||||
vga_force_redraw,
|
||||
vga_add_status_info
|
||||
};
|
||||
/* device_t vga_chips_device =
|
||||
{
|
||||
"Chips VGA",
|
||||
0,
|
||||
vga_chips_init,
|
||||
vga_close,
|
||||
vga_chips_available,
|
||||
vga_speed_changed,
|
||||
vga_force_redraw,
|
||||
vga_add_status_info
|
||||
}; */
|
||||
#ifdef DEV_BRANCH
|
||||
device_t trigem_unk_device =
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "device.h"
|
||||
#include "mem.h"
|
||||
#include "pci.h"
|
||||
#include "rom.h"
|
||||
#include "thread.h"
|
||||
#include "timer.h"
|
||||
#include "video.h"
|
||||
@@ -7040,12 +7041,12 @@ void voodoo_close(void *p)
|
||||
int c;
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
f = romfopen("texram.dmp", "wb");
|
||||
f = romfopen(L"texram.dmp", L"wb");
|
||||
fwrite(voodoo->tex_mem[0], voodoo->texture_size*1024*1024, 1, f);
|
||||
fclose(f);
|
||||
if (voodoo->dual_tmus)
|
||||
{
|
||||
f = romfopen("texram2.dmp", "wb");
|
||||
f = romfopen(L"texram2.dmp", L"wb");
|
||||
fwrite(voodoo->tex_mem[1], voodoo->texture_size*1024*1024, 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define WY700_YSIZE 800
|
||||
|
||||
void updatewindowsize(int x, int y);
|
||||
void loadfont(char *s, int format);
|
||||
|
||||
|
||||
/* The Wyse 700 is an unusual video card. Though it has an MC6845 CRTC, this
|
||||
|
||||
@@ -358,9 +358,9 @@ int xsize=1,ysize=1;
|
||||
|
||||
PALETTE cgapal;
|
||||
|
||||
void loadfont(char *s, int format)
|
||||
void loadfont(wchar_t *s, int format)
|
||||
{
|
||||
FILE *f=romfopen(s,"rb");
|
||||
FILE *f=romfopen(s,L"rb");
|
||||
int c,d;
|
||||
if (!f)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ void ddraw_fs_take_screenshot(char *fn);
|
||||
|
||||
extern int cga_palette;
|
||||
|
||||
void loadfont(char *s, int format);
|
||||
void loadfont(wchar_t *s, int format);
|
||||
void initvideo();
|
||||
void video_init();
|
||||
void closevideo();
|
||||
|
||||
36
src/win.c
36
src/win.c
@@ -418,11 +418,9 @@ static void initmenu(void)
|
||||
}
|
||||
}
|
||||
|
||||
void get_executable_name(char *s, int size)
|
||||
void get_executable_name(WCHAR *s, int size)
|
||||
{
|
||||
WCHAR ws[512];
|
||||
GetModuleFileName(hinstance, ws, size);
|
||||
wcstombs(s, ws, (wcslen(ws) << 1) + 2);
|
||||
GetModuleFileName(hinstance, s, size);
|
||||
}
|
||||
|
||||
void set_window_title(WCHAR *s)
|
||||
@@ -525,26 +523,24 @@ void get_registry_key_map()
|
||||
}
|
||||
}
|
||||
|
||||
static char **argv;
|
||||
static wchar_t **argv;
|
||||
static int argc;
|
||||
static char *argbuf;
|
||||
static wchar_t *argbuf;
|
||||
|
||||
static void process_command_line()
|
||||
{
|
||||
WCHAR *wcmdline;
|
||||
char cmdline[2048];
|
||||
WCHAR *cmdline;
|
||||
int argc_max;
|
||||
int i, q;
|
||||
|
||||
wcmdline = GetCommandLine();
|
||||
wcstombs(cmdline, wcmdline, (wcslen(wcmdline) << 1) + 2);
|
||||
i = strlen(cmdline) + 1;
|
||||
argbuf = malloc(i);
|
||||
memcpy(argbuf, cmdline, i);
|
||||
cmdline = GetCommandLine();
|
||||
i = wcslen(cmdline) + 1;
|
||||
argbuf = malloc(i * 2);
|
||||
memcpy(argbuf, cmdline, i * 2);
|
||||
|
||||
argc = 0;
|
||||
argc_max = 64;
|
||||
argv = malloc(sizeof(char *) * argc_max);
|
||||
argv = malloc(sizeof(wchar_t *) * argc_max);
|
||||
if (!argv)
|
||||
{
|
||||
free(argbuf);
|
||||
@@ -556,12 +552,12 @@ static void process_command_line()
|
||||
/* parse commandline into argc/argv format */
|
||||
while (argbuf[i])
|
||||
{
|
||||
while (argbuf[i] == ' ')
|
||||
while (argbuf[i] == L' ')
|
||||
i++;
|
||||
|
||||
if (argbuf[i])
|
||||
{
|
||||
if ((argbuf[i] == '\'') || (argbuf[i] == '"'))
|
||||
if ((argbuf[i] == L'\'') || (argbuf[i] == L'"'))
|
||||
{
|
||||
q = argbuf[i++];
|
||||
if (!argbuf[i])
|
||||
@@ -575,7 +571,7 @@ static void process_command_line()
|
||||
if (argc >= argc_max)
|
||||
{
|
||||
argc_max += 64;
|
||||
argv = realloc(argv, sizeof(char *) * argc_max);
|
||||
argv = realloc(argv, sizeof(wchar_t *) * argc_max);
|
||||
if (!argv)
|
||||
{
|
||||
free(argbuf);
|
||||
@@ -583,7 +579,7 @@ static void process_command_line()
|
||||
}
|
||||
}
|
||||
|
||||
while ((argbuf[i]) && ((q) ? (argbuf[i] != q) : (argbuf[i] != ' ')))
|
||||
while ((argbuf[i]) && ((q) ? (argbuf[i] != q) : (argbuf[i] != L' ')))
|
||||
i++;
|
||||
|
||||
if (argbuf[i])
|
||||
@@ -1852,8 +1848,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
{
|
||||
if (msgbox_reset_yn(ghwnd) == IDYES)
|
||||
{
|
||||
loadconfig(openfilestring);
|
||||
config_save(config_file_default);
|
||||
loadconfig(wopenfilestring);
|
||||
mem_resize();
|
||||
loadbios();
|
||||
resetpchard();
|
||||
@@ -1865,7 +1861,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
case IDM_CONFIG_SAVE:
|
||||
pause = 1;
|
||||
if (!file_dlg_st(hwnd, 2174, "", 1))
|
||||
config_save(openfilestring);
|
||||
config_save(wopenfilestring);
|
||||
pause = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ extern WCHAR wopenfilestring[260];
|
||||
int getfile(HWND hwnd, char *f, char *fn);
|
||||
int getsfile(HWND hwnd, char *f, char *fn);
|
||||
|
||||
void get_executable_name(char *s, int size);
|
||||
void get_executable_name(WCHAR *s, int size);
|
||||
void set_window_title(WCHAR *s);
|
||||
|
||||
void startblit();
|
||||
|
||||
16
src/xtide.c
16
src/xtide.c
@@ -72,7 +72,7 @@ static void *xtide_init()
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
memset(xtide, 0, sizeof(xtide_t));
|
||||
|
||||
rom_init(&xtide->bios_rom, "roms/ide_xt.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xtide->bios_rom, L"roms/ide_xt.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
ide_init();
|
||||
ide_pri_disable();
|
||||
ide_sec_disable();
|
||||
@@ -86,7 +86,7 @@ static void *xtide_at_init()
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
memset(xtide, 0, sizeof(xtide_t));
|
||||
|
||||
rom_init(&xtide->bios_rom, "roms/ide_at.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xtide->bios_rom, L"roms/ide_at.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
ide_init();
|
||||
|
||||
return xtide;
|
||||
@@ -97,7 +97,7 @@ static void *xtide_ps2_init()
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
memset(xtide, 0, sizeof(xtide_t));
|
||||
|
||||
rom_init(&xtide->bios_rom, "roms/SIDE1V12.BIN", 0xc8000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xtide->bios_rom, L"roms/SIDE1V12.BIN", 0xc8000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
ide_init();
|
||||
ide_pri_disable();
|
||||
ide_sec_disable();
|
||||
@@ -111,7 +111,7 @@ static void *xtide_at_ps2_init()
|
||||
xtide_t *xtide = malloc(sizeof(xtide_t));
|
||||
memset(xtide, 0, sizeof(xtide_t));
|
||||
|
||||
rom_init(&xtide->bios_rom, "roms/ide_at_1_1_5.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
rom_init(&xtide->bios_rom, L"roms/ide_at_1_1_5.bin", 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
ide_init();
|
||||
|
||||
return xtide;
|
||||
@@ -126,22 +126,22 @@ static void xtide_close(void *p)
|
||||
|
||||
static int xtide_available()
|
||||
{
|
||||
return rom_present("roms/ide_xt.bin");
|
||||
return rom_present(L"roms/ide_xt.bin");
|
||||
}
|
||||
|
||||
static int xtide_at_available()
|
||||
{
|
||||
return rom_present("roms/ide_at.bin");
|
||||
return rom_present(L"roms/ide_at.bin");
|
||||
}
|
||||
|
||||
static int xtide_ps2_available()
|
||||
{
|
||||
return rom_present("roms/SIDE1V12.BIN");
|
||||
return rom_present(L"roms/SIDE1V12.BIN");
|
||||
}
|
||||
|
||||
static int xtide_at_ps2_available()
|
||||
{
|
||||
return rom_present("roms/ide_at_1_1_5.bin");
|
||||
return rom_present(L"roms/ide_at_1_1_5.bin");
|
||||
}
|
||||
|
||||
device_t xtide_device =
|
||||
|
||||
Reference in New Issue
Block a user