if (is_board_enabled(&currprefs, ROMTYPE_CUBO, 0)) {
cubo_nvram = cd32_nvram + currprefs.cs_cd32nvram_size;
}
- cd32_flashfile = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+ cd32_flashfile = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
if (!cd32_flashfile)
- cd32_flashfile = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
+ cd32_flashfile = zfile_fopen (path, _T("wb"), 0);
if (cd32_flashfile) {
int size = zfile_fread(cd32_nvram, 1, currprefs.cs_cd32nvram_size, cd32_flashfile);
if (size == currprefs.cs_cd32nvram_size && maxlen > currprefs.cs_cd32nvram_size)
static void nvram_write (void)
{
- struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+ struct zfile *f = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
if (!f) {
- f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
+ f = zfile_fopen (path, _T("wb"), 0);
if (!f)
return;
}
{
struct zfile *f;
- f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL);
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (path, _T("rb"), ZFD_NORMAL);
memset (arbmemory + nvram_offset, 0, NVRAM_SIZE);
if (!f)
return;
static void alg_nvram_write (void)
{
- struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+ struct zfile *f = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
if (!f) {
- f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
+ f = zfile_fopen (path, _T("wb"), 0);
if (!f)
return;
}
{
struct zfile *f;
- f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL);
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (path, _T("rb"), ZFD_NORMAL);
memset (algmemory, 0, ALG_NVRAM_SIZE);
if (!f)
return;
#define CDTV_NVRAM_MASK 16383
#define CDTV_NVRAM_SIZE 32768
static uae_u8 cdtv_battram[CDTV_NVRAM_SIZE];
+static TCHAR flashfilepath[MAX_DPATH];
static void cdtv_loadcardmem (uae_u8 *p, int size)
{
if (!size)
return;
memset (p, 0, size);
- f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL);
+ cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (flashfilepath, _T("rb"), ZFD_NORMAL);
if (!f)
return;
zfile_fseek (f, CDTV_NVRAM_SIZE, SEEK_SET);
if (!size)
return;
- f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
if (!f)
return;
zfile_fseek (f, CDTV_NVRAM_SIZE, SEEK_SET);
int v;
memset (cdtv_battram, 0, CDTV_NVRAM_SIZE);
- f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
if (!f) {
- f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
+ f = zfile_fopen (flashfilepath, _T("wb"), 0);
if (f) {
zfile_fwrite (cdtv_battram, CDTV_NVRAM_SIZE, 1, f);
zfile_fclose (f);
if (cdtv_battram[offset] == v)
return;
cdtv_battram[offset] = v;
- f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
if (!f)
return;
zfile_fseek (f, offset, SEEK_SET);
static volatile int subcodebufferoffset, subcodebufferoffsetw;
static uae_u8 subcodebufferinuse[MAX_SUBCODEBUFFER];
static uae_u8 subcodebuffer[MAX_SUBCODEBUFFER * SUB_CHANNEL_SIZE];
+static TCHAR flashfilepath[MAX_DPATH];
static void cdtvcr_battram_reset (void)
{
int v;
memset (cdtvcr_ram, 0, CDTVCR_RAM_SIZE);
- f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+ f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
if (!f) {
- f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
+ f = zfile_fopen (flashfilepath, _T("wb"), 0);
if (f) {
zfile_fwrite (cdtvcr_ram, CDTVCR_RAM_SIZE, 1, f);
zfile_fclose (f);
if (cdtvcr_ram[offset] == v)
return;
cdtvcr_ram[offset] = v;
- f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
if (!f)
return;
zfile_fseek (f, offset, SEEK_SET);
case PATH_CD:
s = cfgfile_subst_path_load(UNEXPANDED, &p->path_cd, path, false);
break;
+ case PATH_ROM:
+ s = cfgfile_subst_path_load(UNEXPANDED, &p->path_rom, path, false);
+ break;
case PATH_FLOPPY:
_tcscpy(out, path);
cfgfile_adjust_path(out, MAX_DPATH, &p->path_floppy);
cfgfile_write_board_rom(p, f, &p->path_rom, &p->expansionboard[i]);
}
- cfgfile_write_path (f, &p->path_rom, _T("flash_file"), p->flashfile);
+ cfgfile_write_str(f, _T("flash_file"), p->flashfile);
cfgfile_write_path (f, &p->path_rom, _T("cart_file"), p->cartfile);
- cfgfile_write_path (f, &p->path_rom, _T("rtc_file"), p->rtcfile);
+ cfgfile_write_str(f, _T("rtc_file"), p->rtcfile);
if (p->cartident[0])
cfgfile_write_str (f, _T("cart"), p->cartident);
cfgfile_dwrite_path (f, &p->path_rom, _T("picassoiv_rom_file"), p->picassoivromfile);
|| cfgfile_path (option, value, _T("kickstart_ext_rom_file2"), p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR), &p->path_rom)
|| cfgfile_rom(option, value, _T("kickstart_rom_file_id"), p->romfile, sizeof p->romfile / sizeof(TCHAR))
|| cfgfile_rom (option, value, _T("kickstart_ext_rom_file_id"), p->romextfile, sizeof p->romextfile / sizeof (TCHAR))
- || cfgfile_path (option, value, _T("flash_file"), p->flashfile, sizeof p->flashfile / sizeof (TCHAR), &p->path_rom)
+ || cfgfile_string(option, value, _T("flash_file"), p->flashfile, sizeof p->flashfile / sizeof (TCHAR))
|| cfgfile_path (option, value, _T("cart_file"), p->cartfile, sizeof p->cartfile / sizeof (TCHAR), &p->path_rom)
- || cfgfile_path (option, value, _T("rtc_file"), p->rtcfile, sizeof p->rtcfile / sizeof (TCHAR), &p->path_rom)
+ || cfgfile_string(option, value, _T("rtc_file"), p->rtcfile, sizeof p->rtcfile / sizeof (TCHAR))
|| cfgfile_path(option, value, _T("picassoiv_rom_file"), p->picassoivromfile, sizeof p->picassoivromfile / sizeof(TCHAR), &p->path_rom)
|| cfgfile_string(option, value, _T("genlock_image"), p->genlock_image_file, sizeof p->genlock_image_file / sizeof(TCHAR))
|| cfgfile_string(option, value, _T("genlock_video"), p->genlock_video_file, sizeof p->genlock_video_file / sizeof(TCHAR))
{
if (!currprefs.rtcfile[0] || currprefs.cs_rtc == 0)
return;
- struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("wb"));
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
+ struct zfile *f = zfile_fopen (path, _T("wb"));
if (f) {
struct tm *ct;
time_t t = time (0);
rtc_ricoh.delayed_write = 0;
}
if (currprefs.rtcfile[0]) {
- struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("rb"));
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
+ struct zfile *f = zfile_fopen (path, _T("rb"));
if (f) {
uae_u8 empty[13];
zfile_fread (empty, 13, 1, f);
#define PATH_GENLOCK_IMAGE 6
#define PATH_GENLOCK_VIDEO 7
#define PATH_GEO 8
+#define PATH_ROM 9
struct strlist {
struct strlist *next;
memcpy(&currprefs.path_hardfile, &p->path_hardfile, sizeof(struct multipath));
memcpy(&currprefs.path_floppy, &p->path_floppy, sizeof(struct multipath));
memcpy(&currprefs.path_cd, &p->path_cd, sizeof(struct multipath));
+ memcpy(&currprefs.path_rom, &p->path_rom, sizeof(struct multipath));
}
int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, int isdefault)
ct2 = 0;
regqueryint (NULL, _T("ConfigFile_NoAuto"), &ct2);
v = cfgfile_load (p, fname, &type2, ct2, isdefault ? 0 : 1);
- if (p == &workprefs) {
- memcpy(&currprefs.path_hardfile, &p->path_hardfile, sizeof(struct multipath));
- memcpy(&currprefs.path_floppy, &p->path_floppy, sizeof(struct multipath));
- }
if (!v)
return v;
if (type > 0)
break;
case IDC_FLASHFILE:
_tcscpy (workprefs.flashfile, full_path);
- fullpath (workprefs.flashfile, MAX_DPATH);
break;
case IDC_RTCFILE:
_tcscpy (workprefs.rtcfile, full_path);
- fullpath (workprefs.rtcfile, MAX_DPATH);
break;
case IDC_CARTFILE:
_tcscpy (workprefs.cartfile, full_path);
TIMER_Init(dosbox_sec);
FPU_Init(dosbox_sec);
if (xb->type >= TYPE_2286) {
+ TCHAR path[MAX_DPATH];
+ cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
xb->cmossize = xb->type == TYPE_2386 ? 192 : 64;
- xb->cmosfile = zfile_fopen(currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
+ xb->cmosfile = zfile_fopen(path, _T("rb+"), ZFD_NORMAL);
if (!xb->cmosfile) {
- xb->cmosfile = zfile_fopen(currprefs.flashfile, _T("wb"));
+ xb->cmosfile = zfile_fopen(path, _T("wb"));
}
memset(xb->cmosregs, 0, sizeof xb->cmosregs);
if (xb->cmosfile) {