freescsi (scsis[ch]);
scsis[ch] = NULL;
hfd = xcalloc (struct hd_hardfiledata, 1);
- if (!hdf_hd_open (hfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
+ if (!hdf_hd_open (hfd, path, blocksize, readonly, devname, 0, sectors, surfaces, reserved, bootpri, filesys, 0, 0, 0))
return 0;
hfd->ansi_version = scsi_level;
scsis[ch] = scsi_alloc (ch, hfd);
memset (subcodebufferinuse, 0,sizeof (subcodebufferinuse));
subcodebufferoffsetw = subcodebufferoffset = 0;
uae_sem_post (&sub_sem);
- write_log (_T("CD32: subcode buffer overflow 1\n"));
+ //write_log (_T("CD32: subcode buffer overflow 1\n"));
return;
}
int offset = subcodebufferoffsetw;
return 0;
if (status == -2)
return 150;
+#if 1
if (cdrom_audiostatus != status) {
if (status == AUDIO_STATUS_IN_PROGRESS) {
cdrom_playing = 1;
}
}
cdrom_audiostatus = status;
+#endif
return 0;
}
return;
#if AKIKO_DEBUG_IO_CMD
- write_log (_T("OUT IDX=0x%02X-0x%02X LEN=%d:"), cdcomrxinx, cdcomrxcmp, cdrom_receive_length);
+ write_log (_T("OUT IDX=0x%02X-0x%02X LEN=%d,%08x:"), cdcomrxinx, cdcomrxcmp, cdrom_receive_length, cmd_buf);
#endif
if (cdrom_receive_offset < 0) {
if (cdcomrxinx == cdcomrxcmp) {
set_status (CDINTERRUPT_RXDMADONE);
#if AKIKO_DEBUG_IO_CMD
- write_log (L"RXDMADONE %d/%d\n", cdrom_receive_offset, cdrom_receive_length);
+ write_log (_T("RXDMADONE %d/%d\n"), cdrom_receive_offset, cdrom_receive_length);
#endif
}
write_log (_T("PLAY FROM %06X (%d) to %06X (%d) SCAN=%d\n"),
seekpos, msf2lsn (seekpos), endpos, msf2lsn (endpos), scan);
#endif
+ //cdrom_result_buffer[1] |= CDS_PLAYING;
cdrom_playing = 1;
if (!cd_play_audio (seekpos, endpos, 0)) {
// play didn't start, report it in next status packet
cdrom_audiotimeout = -3;
}
- cdrom_result_buffer[1] |= CDS_PLAYING;
} else {
#if AKIKO_DEBUG_IO_CMD
write_log (_T("SEEKTO %06X\n"),seekpos);
cdrom_audiotimeout--;
if (cdrom_audiotimeout == 1) { // play start
cdrom_playing = 1;
- ;//cdrom_start_return_data (cdrom_playend_notify (0));
+ //cdrom_start_return_data (cdrom_playend_notify (0));
cdrom_audiotimeout = 0;
}
if (cdrom_audiotimeout == -1) { // play finished (or disk end)
uci->devname ? uci->devname : _T(""), str,
uci->sectors, uci->surfaces, uci->reserved, uci->blocksize,
bp, uci->filesys ? uci->filesys : _T(""), hdcontrollers[uci->controller]);
+ if (uci->cyls || (uci->pcyls && uci->pheads && uci->psecs)) {
+ TCHAR *s = tmp + _tcslen (tmp);
+ _stprintf (s, _T(",%d,%d/%d/%d"), uci->cyls, uci->pcyls, uci->pheads, uci->psecs);
+ }
cfgfile_write_str (f, _T("hardfile2"), tmp);
#if 0
_stprintf (tmp2, _T("hardfile=%s,%d,%d,%d,%d,%s"),
}
struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
- TCHAR *devname, TCHAR *volname, TCHAR *rootdir, bool readonly,
- int secspertrack, int surfaces, int reserved,
+ const TCHAR *devname, const TCHAR *volname, const TCHAR *rootdir, bool readonly,
+ int cyls, int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri,
- TCHAR *filesysdir, int hdc, int flags)
+ const TCHAR *filesysdir, int hdc, int flag,
+ int pcyls, int psecs, int pheads)
{
struct uaedev_config_info *uci;
int i;
validatedevicename (uci->devname);
validatevolumename (uci->volname);
uci->readonly = readonly;
+ uci->cyls = cyls;
uci->sectors = secspertrack;
uci->surfaces = surfaces;
uci->reserved = reserved;
uci->bootpri = bootpri;
uci->donotmount = 0;
uci->autoboot = 0;
+ uci->pcyls = pcyls;
+ uci->pheads = pheads;
+ uci->psecs = psecs;
if (bootpri < -128)
uci->donotmount = 1;
else if (bootpri >= -127)
static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, bool hdf, TCHAR *value)
{
- int secs, heads, reserved, bs, bp, hdcv;
+ int cyls, secs, heads, reserved, bs, bp, hdcv;
+ int pcyls, pheads, psecs;
bool ro;
TCHAR *dname = NULL, *aname = _T(""), *root = NULL, *fs = NULL, *hdc;
TCHAR *tmpp = _tcschr (value, ',');
ro = false;
else
goto invalid_fs;
- secs = 0; heads = 0; reserved = 0; bs = 0; bp = 0;
+ cyls = 0,secs = 0; heads = 0; reserved = 0; bs = 0; bp = 0;
fs = 0; hdc = 0; hdcv = 0;
+ pcyls = pheads = psecs = 0;
value = tmpp;
if (!hdf) {
tmpp = _tcschr (tmpp, ',');
if (tmpp != 0) {
*tmpp++ = 0;
- hdcv = get_filesys_controller (tmpp);
+ TCHAR *tmpp2 = _tcschr (tmpp, ',');
+ if (tmpp2)
+ *tmpp2++ = 0;
+ hdcv = get_filesys_controller (tmpp);
+ if (tmpp2) {
+ if (getintval2 (&tmpp2, &cyls, ',')) {
+ getintval (&tmpp2, &pcyls, '/');
+ getintval (&tmpp2, &pheads, '/');
+ getintval2 (&tmpp2, &psecs, '/');
+ }
+ }
}
}
}
str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, false);
}
#ifdef FILESYS
- add_filesys_config (p, nr, dname, aname, str, ro, secs, heads, reserved, bs, bp, fs, hdcv, 0);
+ add_filesys_config (p, nr, dname, aname, str, ro, cyls, secs, heads, reserved, bs, bp, fs, hdcv, 0, pcyls, pheads, psecs);
#endif
xfree (str);
return 1;
}
str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, true);
#ifdef FILESYS
- add_filesys_config (p, -1, NULL, aname, str, ro, secs, heads, reserved, bs, 0, NULL, 0, 0);
+ add_filesys_config (p, -1, NULL, aname, str, ro, 0, secs, heads, reserved, bs, 0, NULL, 0, 0, 0, 0, 0);
#endif
xfree (str);
return 1;
}
#endif
#ifdef FILESYS
- add_filesys_config (p, -1, NULL, buf, s2, readonly, 0, 0, 0, 0, 0, 0, 0, 0);
+ add_filesys_config (p, -1, NULL, buf, s2, readonly, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
#endif
} else {
write_log (_T("Usage: [-m | -M] VOLNAME:mount_point\n"));
goto argh;
*x4++ = '\0';
#ifdef FILESYS
- add_filesys_config (p, -1, NULL, NULL, x4, 0, _tstoi (x0), _tstoi (x1), _tstoi (x2), _tstoi (x3), 0, 0, 0, 0);
+ add_filesys_config (p, -1, NULL, NULL, x4, 0, 0, _tstoi (x0), _tstoi (x1), _tstoi (x2), _tstoi (x3), 0, 0, 0, 0, 0, 0, 0);
#endif
free (x0);
return;
p->cs_rtc = 2;
p->cs_fatgaryrev = 0;
p->cs_ide = -1;
- p->cs_mbdmac = 1;
+ p->cs_mbdmac = -1;
p->cs_ramseyrev = 0x0f;
break;
case CP_CDTV: // CDTV
#endif
if (!isgaylenocia (addr))
- return 0xffffffff;
+ return v;
cia_wait_pre ();
switch ((addr >> 12) & 3)
//p->win32_automount_drives = 2;
//p->win32_automount_cddrives = 2;
- add_filesys_config (p, -1, _T("DH0"), _T("CLIBOOT"), _T("."), 1, 0, 0, 0, 0, 15, NULL, 0, 0);
+ add_filesys_config (p, -1, _T("DH0"), _T("CLIBOOT"), _T("."), 1, 0, 0, 0, 0, 0, 15, NULL, 0, 0, 0, 0, 0);
}
static void *console_thread (void *v)
}
}
} else {
- v = 0xffff;
+ if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
+ v = 0xffff;
+ else
+ v = l;
}
#if CUSTOM_DEBUG > 0
write_log (_T("%08X read = %04X. Value written=%04X PC=%08x\n"), 0xdff000 | addr, v, l, M68K_GETPC);
#endif
#define TRACING_ENABLED 1
-int log_filesys;
+int log_filesys = 0;
#if TRACING_ENABLED
#define TRACE(x) if (log_filesys > 0) { write_log x; }
}
}
mi->size = ui->hf.virtsize;
- mi->nrcyls = (int)(uci->sectors * uci->surfaces ? (ui->hf.virtsize / uci->blocksize) / (uci->sectors * uci->surfaces) : 0);
+ if (uci->cyls) {
+ mi->nrcyls = uci->cyls;
+ } else {
+ mi->nrcyls = (int)(uci->sectors * uci->surfaces ? (ui->hf.virtsize / uci->blocksize) / (uci->sectors * uci->surfaces) : 0);
+ }
if (!uci->ishdf)
return FILESYS_VIRTUAL;
if (uci->reserved == 0 && uci->sectors == 0 && uci->surfaces == 0) {
}
static int set_filesys_unit_1 (int nr,
- TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
- int secspertrack, int surfaces, int reserved,
+ const TCHAR *devname, const TCHAR *volname, const TCHAR *rootdir, bool readonly,
+ int cyls, int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, bool donotmount, bool autoboot,
- TCHAR *filesysdir, int hdc, int flags)
+ const TCHAR *filesysdir, int hdc, int flags)
{
UnitInfo *ui;
int i;
write_log (_T("Hardfile %s too small\n"), ui->hf.device_name);
goto err;
}
- ui->hf.nrcyls = (int)(ui->hf.secspertrack * ui->hf.surfaces ? (ui->hf.virtsize / ui->hf.blocksize) / (ui->hf.secspertrack * ui->hf.surfaces) : 0);
+ if (cyls) {
+ ui->hf.nrcyls = cyls;
+ } else {
+ ui->hf.nrcyls = (int)(ui->hf.secspertrack * ui->hf.surfaces ? (ui->hf.virtsize / ui->hf.blocksize) / (ui->hf.secspertrack * ui->hf.surfaces) : 0);
+ }
}
}
ui->self = 0;
}
static int set_filesys_unit (int nr,
- TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
- int secspertrack, int surfaces, int reserved,
+ const TCHAR *devname, const TCHAR *volname, const TCHAR *rootdir, bool readonly,
+ int cyls, int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, bool donotmount, bool autoboot,
- TCHAR *filesysdir, int hdc, int flags)
+ const TCHAR *filesysdir, int hdc, int flags)
{
int ret;
ret = set_filesys_unit_1 (nr, devname, volname, rootdir, readonly,
- secspertrack, surfaces, reserved, blocksize, bootpri, donotmount, autoboot,
+ cyls, secspertrack, surfaces, reserved, blocksize, bootpri, donotmount, autoboot,
filesysdir, hdc, flags);
return ret;
}
-static int add_filesys_unit (TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
- int secspertrack, int surfaces, int reserved,
+static int add_filesys_unit (const TCHAR *devname, const TCHAR *volname, const TCHAR *rootdir, bool readonly,
+ int cyls, int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, bool donotmount, bool autoboot,
- TCHAR *filesysdir, int hdc, int flags)
+ const TCHAR *filesysdir, int hdc, int flags)
{
int ret;
return -1;
ret = set_filesys_unit_1 (-1, devname, volname, rootdir, readonly,
- secspertrack, surfaces, reserved, blocksize,
+ cyls, secspertrack, surfaces, reserved, blocksize,
bootpri, donotmount, autoboot, filesysdir, hdc, flags);
#ifdef RETROPLATFORM
if (ret >= 0) {
struct uaedev_config_info *uci = &currprefs.mountconfig[nr];
if (uci->controller == HD_CONTROLLER_UAE) {
int idx = set_filesys_unit_1 (-1, uci->devname, uci->ishdf ? NULL : uci->volname, uci->rootdir,
- uci->readonly, uci->sectors, uci->surfaces, uci->reserved,
+ uci->readonly, uci->cyls, uci->sectors, uci->surfaces, uci->reserved,
uci->blocksize, uci->bootpri, uci->donotmount, uci->autoboot, uci->filesys, 0, MYVOLUMEINFO_REUSABLE);
allocuci (&currprefs, nr, idx);
}
TCHAR cdname[30];
_stprintf (cdname, _T("CD%d"), i);
cd_unit_number++;
- int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
+ int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 0, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
allocuci (&currprefs, nr, idx);
nr++;
}
continue;
if (uci->controller <= HD_CONTROLLER_IDE3) {
gayle_add_ide_unit (uci->controller - HD_CONTROLLER_IDE0, uci->rootdir, uci->blocksize, uci->readonly,
- uci->devname, uci->sectors, uci->surfaces, uci->reserved,
- uci->bootpri, uci->filesys);
+ uci->devname, uci->cyls, uci->sectors, uci->surfaces, uci->reserved,
+ uci->bootpri, uci->filesys, uci->pcyls, uci->pheads, uci->psecs);
allocuci (&currprefs, nr, -1);
} else if (uci->controller <= HD_CONTROLLER_SCSI6) {
- if (currprefs.cs_mbdmac) {
+ if (currprefs.cs_mbdmac > 0) {
#ifdef A2091
a3000_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
if (!mountertask)
return 0;
+
+ write_log (_T("filesys_insert(%d,'%s','%s','%d','%d)\n"), nr, volume ? volume : _T("<?>"), rootdir, readonly, flags);
+
if (nr < 0) {
for (u = units; u; u = u->next) {
if (is_virtual (u->unit)) {
u->mount_readonly = readonly;
u->mount_flags = flags;
+ write_log (_T("filesys_insert %d done!\n"), nr);
+
put_byte (u->volume + 172 - 32, -3); // wait for insert
uae_Signal (get_long (u->volume + 176 - 32), 1 << 13);
return 0;
if (automountunit >= 0)
return -1;
+
+ write_log (_T("filesys_media_change('%s',%d,%p)\n"), rootdir, inserted, uci);
+
nr = -1;
for (u = units; u; u = u->next) {
if (is_virtual (u->unit)) {
_tcscpy (devname, uci->devname);
else
_stprintf (devname, _T("RDH%d"), nr_units ());
- nr = add_filesys_unit (devname, volptr, rootdir, 0, 0, 0, 0, 0, 0, 0, 1, NULL, 0, MYVOLUMEINFO_REUSABLE);
+ nr = add_filesys_unit (devname, volptr, rootdir, 0, 0, 0, 0, 0, 0, 0, 0, 1, NULL, 0, MYVOLUMEINFO_REUSABLE);
if (nr < 0)
return 0;
if (inserted > 1)
return;
}
TRACE((_T("{ next=0x%lx, mode=%ld, handler=0x%lx, volume=0x%lx, aino %lx "),
- get_long (lock) << 2, get_long (lock+8),
- get_long (lock+12), get_long (lock+16),
+ get_long (lock) << 2, get_long (lock + 8),
+ get_long (lock + 12), get_long (lock + 16),
get_long (lock + 4)));
a = lookup_aino (unit, get_long (lock + 4));
if (a == 0) {
volname = NULL;
}
if (set_filesys_unit (devno, devname, volname, rootdir, readonly,
- ui->hf.secspertrack, ui->hf.surfaces, ui->hf.reservedblocks, ui->hf.blocksize,
+ ui->hf.cylinders, ui->hf.secspertrack, ui->hf.surfaces, ui->hf.reservedblocks, ui->hf.blocksize,
bootpri, false, true, filesysdir[0] ? filesysdir : NULL, 0, 0) < 0) {
write_log (_T("filesys '%s' failed to restore\n"), rootdir);
goto end;
}
static struct ide_hdf *add_ide_unit (int ch, const TCHAR *path, int blocksize, int readonly,
- const TCHAR *devname, int sectors, int surfaces, int reserved,
- int bootpri, TCHAR *filesys)
+ const TCHAR *devname, int cyls, int sectors, int surfaces, int reserved,
+ int bootpri, const TCHAR *filesys,
+ int pcyls, int pheads, int psecs)
{
struct ide_hdf *ide;
alloc_ide_mem (idedrive, TOTAL_IDE * 2);
ide = idedrive[ch];
- if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
+ if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, cyls, sectors, surfaces, reserved, bootpri, filesys, pcyls, pheads, psecs))
return NULL;
ide->blocksize = blocksize;
ide->lba48 = ide->hdhfd.size >= 128 * (uae_u64)0x40000000 ? 1 : 0;
if (type == PCMCIA_SRAM) {
if (reset) {
if (path)
- hdf_hd_open (pcmcia_sram, path, 512, readonly, NULL, 0, 0, 0, 0, NULL);
+ hdf_hd_open (pcmcia_sram, path, 512, readonly, NULL, 0, 0, 0, 0, 0, NULL, 0, 0, 0);
} else {
pcmcia_sram->hfd.drive_empty = 0;
}
if (reset) {
if (path)
- add_ide_unit (PCMCIA_IDE_ID * 2, path, 512, readonly, NULL, 0, 0, 0, 0, NULL);
+ add_ide_unit (PCMCIA_IDE_ID * 2, path, 512, readonly, NULL, 0, 0, 0, 0, 0, NULL, 0, 0, 0);
}
pcmcia_common_size = 0;
}
#endif
-int gayle_add_ide_unit (int ch, TCHAR *path, int blocksize, int readonly,
- TCHAR *devname, int sectors, int surfaces, int reserved,
- int bootpri, TCHAR *filesys)
+int gayle_add_ide_unit (int ch, const TCHAR *path, int blocksize, int readonly, const TCHAR *devname,
+ int cyls, int sectors, int surfaces, int reserved, int bootpri, const TCHAR *filesys,
+ int pcyls, int pheads, int psecs)
{
struct ide_hdf *ide;
if (ch >= 2 * 2)
return -1;
- ide = add_ide_unit (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys);
+ ide = add_ide_unit (ch, path, blocksize, readonly, devname, cyls, sectors, surfaces, reserved, bootpri, filesys, pcyls, pheads, psecs);
if (ide == NULL)
return 0;
- write_log (_T("GAYLE_IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n"),
- ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48);
+ write_log (_T("GAYLE_IDE%d '%s', LCHS=%d/%d/%d. PCHS=%d/%d/%d %uM. LBA48=%d\n"),
+ ch, path,
+ ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack,
+ pcyls, pheads, psecs,
+ (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48);
ide->type = IDE_GAYLE;
//dumphdf (&ide->hdhfd.hfd);
return 1;
ide->hdhfd.bootpri = restore_u32 ();
if (ide->hdhfd.hfd.virtual_size)
gayle_add_ide_unit (num, path, blocksize, readonly, ide->hdhfd.hfd.device_name,
- ide->hdhfd.hfd.secspertrack, ide->hdhfd.hfd.heads, ide->hdhfd.hfd.reservedblocks, ide->hdhfd.bootpri, NULL);
+ 0, ide->hdhfd.hfd.secspertrack, ide->hdhfd.hfd.heads, ide->hdhfd.hfd.reservedblocks, ide->hdhfd.bootpri, NULL, 0, 0, 0);
else
- gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0);
+ gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
xfree (path);
return src;
}
}
int hdf_hd_open (struct hd_hardfiledata *hfd, const TCHAR *path, int blocksize, int readonly,
- const TCHAR *devname, int sectors, int surfaces, int reserved,
- int bootpri, const TCHAR *filesys)
+ const TCHAR *devname, int cyls, int sectors, int surfaces, int reserved,
+ int bootpri, const TCHAR *filesys,
+ int pcyls, int pheads, int psecs)
{
memset (hfd, 0, sizeof (struct hd_hardfiledata));
hfd->bootpri = bootpri;
if (!hdf_open (&hfd->hfd, path))
return 0;
hfd->path = my_strdup(path);
+ hfd->hfd.cylinders = cyls;
hfd->hfd.heads = surfaces;
hfd->hfd.reservedblocks = reserved;
hfd->hfd.secspertrack = sectors;
if (devname)
_tcscpy (hfd->hfd.device_name, devname);
- getchshd (&hfd->hfd, &hfd->cyls, &hfd->heads, &hfd->secspertrack);
+ if (pcyls && pheads && psecs) {
+ hfd->cyls = pcyls;
+ hfd->heads = pheads;
+ hfd->secspertrack = psecs;
+ } else if (cyls && surfaces && sectors) {
+ hfd->cyls = cyls;
+ hfd->heads = surfaces;
+ hfd->secspertrack = sectors;
+ } else {
+ getchshd (&hfd->hfd, &hfd->cyls, &hfd->heads, &hfd->secspertrack);
+ }
hfd->cyls_def = hfd->cyls;
hfd->secspertrack_def = hfd->secspertrack;
hfd->heads_def = hfd->heads;
void hdf_hd_close(struct hd_hardfiledata *hfd);
int hdf_hd_open(struct hd_hardfiledata *hfd, const TCHAR *path, int blocksize, int readonly,
- const TCHAR *devname, int sectors, int surfaces, int reserved,
- int bootpri, const TCHAR *filesys);
+ const TCHAR *devname, int cyls, int sectors, int surfaces, int reserved,
+ int bootpri, const TCHAR *filesys,
+ int pcyls, int pheads, int psectors);
extern int vhd_create (const TCHAR *name, uae_u64 size, uae_u32);
extern void gayle_reset (int);
extern void gayle_hsync (void);
-extern int gayle_add_ide_unit (int ch, TCHAR *path, int blocksize, int readonly,
- TCHAR *devname, int sectors, int surfaces, int reserved,
- int bootpri, TCHAR *filesys);
+extern int gayle_add_ide_unit (int ch, const TCHAR *path, int blocksize, int readonly,
+ const TCHAR *devname, int cyls, int sectors, int surfaces, int reserved,
+ int bootpri, const TCHAR *filesys, int pcyls, int pheads, int psecs);
extern int gayle_modify_pcmcia_sram_unit (const TCHAR *path, int readonly, int insert);
extern int gayle_modify_pcmcia_ide_unit (const TCHAR *path, int readonly, int insert);
extern int gayle_add_pcmcia_sram_unit (const TCHAR *path, int readonly);
bool autoboot;
bool donotmount;
TCHAR filesys[MAX_DPATH];
+ int cyls; // zero if detected from size
int surfaces;
int sectors;
int reserved;
int blocksize;
int configoffset;
int controller;
+ // zero if default
+ int pcyls, pheads, psecs;
};
enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
extern void cfgfile_backup (const TCHAR *path);
extern struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
- TCHAR *devname, TCHAR *volname, TCHAR *rootdir, bool readonly,
- int secspertrack, int surfaces, int reserved,
- int blocksize, int bootpri, TCHAR *filesysdir, int hdc, int flags);
+ const TCHAR *devname, const TCHAR *volname, const TCHAR *rootdir, bool readonly,
+ int cyls, int secspertrack, int surfaces, int reserved,
+ int blocksize, int bootpri, const TCHAR *filesysdir, int hdc, int flags,
+ int pcyls, int pheads, int psecs);
extern void default_prefs (struct uae_prefs *, int);
extern void discard_prefs (struct uae_prefs *, int);
}
#endif
set_x_funcs ();
- if (startup)
+ if (startup) {
custom_prepare ();
+ protect_roms (true);
+ }
startup = 0;
if (mmu_enabled && !currprefs.cachesize) {
run_func = m68k_run_mmu;
currprefs.cpu_model >= 68020 && currprefs.cpu_cycle_exact ? m68k_run_2ce :
currprefs.cpu_compatible ? (currprefs.cpu_model <= 68020 ? m68k_run_2p : m68k_run_2pf) : m68k_run_2;
}
- protect_roms (true);
run_func ();
- protect_roms (false);
}
+ protect_roms (false);
in_m68k_go--;
}
#include <devguid.h> // Device guids
#include <setupapi.h> // for SetupDiXxx functions.
#include <cfgmgr32.h> // for SetupDiXxx functions.
+#include <Ntddscsi.h>
#endif
#include <stddef.h>
}
#endif
+#if 0
+static void queryidentifydevice (struct hardfiledata *hfd)
+{
+ DWORD r, size;
+ uae_u8 *b;
+ ATA_PASS_THROUGH_EX *ata;
+
+ size = sizeof (ATA_PASS_THROUGH_EX) + 512;
+ b = xcalloc (uae_u8, size);
+ ata = (ATA_PASS_THROUGH_EX*)b;
+
+ ata->Length = sizeof ata;
+ ata->DataTransferLength = 512;
+ ata->TimeOutValue = 10;
+ ata->AtaFlags = ATA_FLAGS_DRDY_REQUIRED | ATA_FLAGS_DATA_IN;
+ ata->CurrentTaskFile[6] = 0xec;
+ ata->DataBufferOffset = ata->Length;
+
+ if (!DeviceIoControl (hfd->handle->h, IOCTL_ATA_PASS_THROUGH, b, size, b, size, &r, NULL)) {
+ write_log (_T("IOCTL_ATA_PASS_THROUGH_DIRECT Identify Device failed %d\n"), GetLastError ());
+ }
+}
+#endif
+
int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
{
HANDLE h = INVALID_HANDLE_VALUE;
hfd->handle->h = h;
if (h == INVALID_HANDLE_VALUE)
goto end;
- if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL))
+ if (!DeviceIoControl (h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL))
write_log (_T("WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n"), name, GetLastError ());
+ //queryidentifydevice (hfd);
_tcsncpy (hfd->vendor_id, udi->vendor_id, 8);
_tcsncpy (hfd->product_id, udi->product_id, 16);
_tcsncpy (hfd->product_rev, udi->product_rev, 4);
{
struct shmid_ds *shm;
- if (!currprefs.cachesize || currprefs.comptrustbyte || currprefs.comptrustword || currprefs.comptrustlong)
- return;
+ if (protect) {
+ // protect only if JIT enabled, always allow unprotect
+ if (!currprefs.cachesize || currprefs.comptrustbyte || currprefs.comptrustword || currprefs.comptrustlong)
+ return;
+ }
for (int i = 0; i < MAX_SHMID; i++) {
DWORD old;
shm = &shmids[i];
CONTROL "Fastest possible",IDC_CS_HOST,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,115,18,195,10\r
CONTROL "Approximate A500/A1200 or cycle-exact",IDC_CS_68000,\r
"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,115,32,195,10\r
- CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,116,51,192,20\r
- RTEXT "CPU Speed",IDC_STATIC,115,76,55,9,SS_CENTERIMAGE\r
- EDITTEXT IDC_CPUTEXT,178,75,30,12,ES_CENTER | ES_READONLY\r
- RTEXT "CPU Idle",IDC_STATIC,213,76,62,9\r
- CONTROL "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,282,71,69,21\r
+ CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,116,50,192,20\r
+ RTEXT "CPU Speed",IDC_STATIC,115,78,55,9,SS_CENTERIMAGE\r
+ EDITTEXT IDC_CPUTEXT,178,77,30,12,ES_CENTER | ES_READONLY\r
+ RTEXT "CPU Idle",IDC_STATIC,213,78,62,9\r
+ CONTROL "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,282,73,69,21\r
GROUPBOX "Cycle-exact CPU Emulation Speed",IDC_STATIC,110,105,284,55\r
RTEXT "CPU Frequency",IDC_STATIC,113,129,67,10,SS_CENTERIMAGE\r
COMBOBOX IDC_CPU_FREQUENCY,189,128,46,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
FONT 8, "MS Sans Serif", 0, 0, 0x0\r
BEGIN\r
- CONTROL "Compatible Settings",IDC_CS_COMPATIBLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,8,234,10\r
- GROUPBOX "Battery Backed Up Real Time Clock",IDC_STATIC,1,24,393,29\r
+ CONTROL "Compatible Settings",IDC_CS_COMPATIBLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,6,234,10\r
+ GROUPBOX "Battery Backed Up Real Time Clock",IDC_STATIC,1,22,393,31\r
CONTROL "None",IDC_CS_RTC1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,40,36,81,10\r
CONTROL "MSM6242B",IDC_CS_RTC2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,129,36,77,10\r
CONTROL "RF5C01A",IDC_CS_RTC3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,210,36,67,10\r
} SHNOTIFYSTRUCT;
TCHAR path[MAX_PATH];
- if (lParam == SHCNE_MEDIAINSERTED || lParam == SHCNE_MEDIAREMOVED) {
+ if (lParam == SHCNE_MEDIAINSERTED || lParam == SHCNE_DRIVEADD || lParam == SHCNE_MEDIAREMOVED || lParam == SHCNE_DRIVEREMOVED) {
SHNOTIFYSTRUCT *shns = (SHNOTIFYSTRUCT*)wParam;
if (SHGetPathFromIDList ((struct _ITEMIDLIST *)(shns->dwItem1), path)) {
- int inserted = lParam == SHCNE_MEDIAINSERTED ? 1 : 0;
+ int inserted = lParam == SHCNE_MEDIAINSERTED || lParam == SHCNE_DRIVEADD ? 1 : 0;
UINT errormode = SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
write_log (_T("Shell Notification %d '%s'\n"), inserted, path);
if (!win32_hardfile_media_change (path, inserted)) {
#define LOG_NORMAL _T("winuaelog.txt")
static bool createbootlog = true;
+static bool logging_disabled = false;
void logging_open (int bootlog, int append)
{
TCHAR *outpath;
TCHAR debugfilename[MAX_DPATH];
+ if (logging_disabled && !winuaelog_temporary_enable)
+ return;
+
outpath = logpath;
debugfilename[0] = 0;
#ifndef SINGLEFILE
return 0;
argv2 = WIN32_InitRegistry (argv);
+
+ if (regqueryint (NULL, _T("log_disabled"), &i)) {
+ if (i)
+ logging_disabled = true;
+ }
+
getstartpaths ();
makeverstr (VersionStr);
static HDEVNOTIFY hdn;
static int wtson;
LPITEMIDLIST ppidl;
- SHCHANGENOTIFYREGISTER pSHChangeNotifyRegister;
- SHCHANGENOTIFYDEREGISTER pSHChangeNotifyDeregister;
- pSHChangeNotifyRegister = (SHCHANGENOTIFYREGISTER)GetProcAddress (
- GetModuleHandle (_T("shell32.dll")), "SHChangeNotifyRegister");
- pSHChangeNotifyDeregister = (SHCHANGENOTIFYDEREGISTER)GetProcAddress (
- GetModuleHandle (_T("shell32.dll")), "SHChangeNotifyDeregister");
if (remove) {
- if (ret > 0 && pSHChangeNotifyDeregister)
- pSHChangeNotifyDeregister (ret);
+ if (ret > 0)
+ SHChangeNotifyDeregister (ret);
ret = 0;
if (hdn)
UnregisterDeviceNotification (hdn);
wtson = 0;
} else {
DEV_BROADCAST_DEVICEINTERFACE NotificationFilter = { 0 };
- if(pSHChangeNotifyRegister && SHGetSpecialFolderLocation (hwnd, CSIDL_DESKTOP, &ppidl) == NOERROR) {
+ if(SHGetSpecialFolderLocation (hwnd, CSIDL_DESKTOP, &ppidl) == NOERROR) {
SHChangeNotifyEntry shCNE;
shCNE.pidl = ppidl;
shCNE.fRecursive = TRUE;
- ret = pSHChangeNotifyRegister (hwnd, SHCNE_DISKEVENTS, SHCNE_MEDIAINSERTED | SHCNE_MEDIAREMOVED,
+ ret = SHChangeNotifyRegister (hwnd, SHCNE_DISKEVENTS, SHCNE_MEDIAINSERTED | SHCNE_MEDIAREMOVED | SHCNE_DRIVEREMOVED | SHCNE_DRIVEADD,
WM_USER + 2, 1, &shCNE);
}
NotificationFilter.dbcc_size =
pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
#endif
- log_open (NULL, 0, 0, NULL);
+ log_open (NULL, 0, -1, NULL);
__try {
WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow);
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("21")
-#define WINUAEDATE MAKEBD(2012, 10, 21)
+#define WINUAEBETA _T("22")
+#define WINUAEDATE MAKEBD(2012, 10, 28)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
}
#endif
//write_log (_T("Drive type %d: '%s' '%s'\n"), drivetype, volumepath, volumename);
- add_filesys_unit (devname[0] ? devname : NULL, volumename, volumepath, !rw, 0, 0, 0, 0, -20 - drvnum, 0, 1, 0, 0, 0);
+ add_filesys_unit (devname[0] ? devname : NULL, volumename, volumepath, !rw, 0, 0, 0, 0, 0, -20 - drvnum, 0, 1, 0, 0, 0);
drvnum++;
} /* if drivemask */
dwDriveMask >>= 1;
}
static int gui_width, gui_height;
-static bool gui_resize;
+static bool gui_resize_enabled;
static bool gui_resize_allowed;
// Internal panel max size: 396, 318
misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]);
misc_kbled (hDlg, IDC_KBLED3, workprefs.keyboard_leds[2]);
CheckDlgButton (hDlg, IDC_KBLED_USB, workprefs.win32_kbledmode);
- CheckDlgButton (hDlg, IDC_GUI_RESIZE, gui_resize);
+ CheckDlgButton (hDlg, IDC_GUI_RESIZE, gui_resize_enabled);
ew (hDlg, IDC_GUI_RESIZE, gui_resize_allowed);
misc_scsi (hDlg);
v--;
v = 110 - v * 10;
}
- gui_width = GUI_INTERNAL_WIDTH * v / 100;
- gui_height = GUI_INTERNAL_HEIGHT * v / 100;
+ double m = scaleresource_getdpimult ();
+ gui_width = (int)(GUI_INTERNAL_WIDTH * v * m / 100);
+ gui_height = (int)(GUI_INTERNAL_HEIGHT * v * m / 100);
scaleresource_setmult (guiDlg, gui_width, gui_height);
gui_size_changed = 1;
}
misc_gui_font (hDlg, 1);
break;
case IDC_GUI_RESIZE:
- gui_resize = ischecked (hDlg, IDC_GUI_RESIZE);
+ gui_resize_enabled = ischecked (hDlg, IDC_GUI_RESIZE);
gui_size_changed = 2;
break;
case IDC_ASSOCIATE_ON:
int sectors;
int reserved;
int surfaces;
- int cylinders;
+ int cylinders, forcedcylinders;
int blocksize;
bool rw;
bool rdb;
}
if (!memcmp (tmp, "RDSK\0\0\0", 7) || !memcmp (tmp, "DRKS\0\0", 6) || (tmp[0] == 0x53 && tmp[1] == 0x10 && tmp[2] == 0x9b && tmp[3] == 0x13 && tmp[4] == 0 && tmp[5] == 0)) {
// RDSK or ADIDE "encoded" RDSK
+ hdf->cylinders = hdf->forcedcylinders = 0;
hdf->sectors = 0;
hdf->surfaces = 0;
hdf->reserved = 0;
sethardfile (hDlg);
}
-static void updatehdfinfo (HWND hDlg, bool force)
+
+static void updatehdfinfo (HWND hDlg, bool force, bool defaults)
{
static uae_u64 bsize;
static uae_u8 id[512];
TCHAR tmp[200], tmp2[200];
TCHAR idtmp[9];
+ bsize = 0;
if (force) {
bool open = false;
struct hardfiledata hfd;
if (i == 16)
hdf_read (&hfd, id, 0, 512);
}
- if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
+ if (defaults && current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
getchsgeometry_hdf (open ? &hfd : NULL, bsize, ¤t_hfdlg.cylinders, ¤t_hfdlg.surfaces, ¤t_hfdlg.sectors);
current_hfdlg.original = 0;
}
hdf_close (&hfd);
}
- cyls = 0;
- if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
+ cyls = current_hfdlg.forcedcylinders;
+ if (!cyls && current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
cyls = bsize / (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces);
}
blocks = cyls * (current_hfdlg.sectors * current_hfdlg.surfaces);
}
}
_tcscat (tmp, tmp2);
+ if (hDlg != NULL)
+ SetDlgItemText (hDlg, IDC_HDFINFO, tmp);
}
- SetDlgItemText (hDlg, IDC_HDFINFO, tmp);
}
static void hardfileselecthdf (HWND hDlg, TCHAR *newpath)
fullpath (current_hfdlg.filename, sizeof current_hfdlg.filename / sizeof (TCHAR));
inithardfile (hDlg);
hardfile_testrdb (hDlg, ¤t_hfdlg);
- updatehdfinfo (hDlg, true);
+ updatehdfinfo (hDlg, true, true);
sethardfile (hDlg);
}
LRESULT res, posn;
TCHAR tmp[MAX_DPATH], fs[MAX_DPATH], dev[MAX_DPATH];
int hdctrlr;
+ int v;
switch (msg) {
case WM_DROPFILES:
inithardfile (hDlg);
sethardfile (hDlg);
sethfdostype (hDlg, 0);
- updatehdfinfo (hDlg, true);
+ updatehdfinfo (hDlg, true, false);
setac (hDlg, IDC_PATH_NAME);
recursive--;
customDlgType = IDD_HARDFILE;
current_hfdlg.donotmount = 0;
sethardfile (hDlg);
break;
+ case IDC_SECTORS:
+ v = current_hfdlg.sectors;
+ current_hfdlg.sectors = GetDlgItemInt (hDlg, IDC_SECTORS, NULL, FALSE);
+ if (v != current_hfdlg.sectors)
+ updatehdfinfo (hDlg, true, false);
+ break;
+ case IDC_RESERVED:
+ current_hfdlg.reserved = GetDlgItemInt (hDlg, IDC_RESERVED, NULL, FALSE);
+ break;
+ case IDC_HEADS:
+ v = current_hfdlg.surfaces;
+ current_hfdlg.surfaces = GetDlgItemInt (hDlg, IDC_HEADS, NULL, FALSE);
+ if (v != current_hfdlg.surfaces)
+ updatehdfinfo (hDlg, true, false);
+ break;
+ case IDC_BLOCKSIZE:
+ v = current_hfdlg.blocksize;
+ current_hfdlg.blocksize = GetDlgItemInt (hDlg, IDC_BLOCKSIZE, NULL, FALSE);
+ if (v != current_hfdlg.blocksize)
+ updatehdfinfo (hDlg, true, false);
+ break;
+ case IDC_HARDFILE_BOOTPRI:
+ current_hfdlg.bootpri = GetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, NULL, TRUE);
+ break;
+ case IDC_PATH_FILESYS:
+ GetDlgItemText (hDlg, IDC_PATH_FILESYS, current_hfdlg.fsfilename, sizeof current_hfdlg.fsfilename / sizeof (TCHAR));
+ break;
+ case IDC_HARDFILE_DEVICE:
+ GetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, current_hfdlg.devicename, sizeof current_hfdlg.devicename / sizeof (TCHAR));
+ break;
+ case IDC_HDF_CONTROLLER:
+ posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0);
+ if (posn != CB_ERR)
+ current_hfdlg.controller = posn;
+ break;
+ case IDC_PATH_NAME:
+ GetDlgItemText (hDlg, IDC_PATH_NAME, tmp, sizeof tmp / sizeof (TCHAR));
+ if (_tcscmp (tmp, current_hfdlg.filename)) {
+ _tcscpy (current_hfdlg.filename, tmp);
+ updatehdfinfo (hDlg, true, false);
+ }
+ break;
}
-
- current_hfdlg.sectors = GetDlgItemInt (hDlg, IDC_SECTORS, NULL, FALSE);
- current_hfdlg.reserved = GetDlgItemInt (hDlg, IDC_RESERVED, NULL, FALSE);
- current_hfdlg.surfaces = GetDlgItemInt (hDlg, IDC_HEADS, NULL, FALSE);
- current_hfdlg.blocksize = GetDlgItemInt (hDlg, IDC_BLOCKSIZE, NULL, FALSE);
- current_hfdlg.bootpri = GetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, NULL, TRUE);
- GetDlgItemText (hDlg, IDC_PATH_NAME, tmp, sizeof tmp / sizeof (TCHAR));
- if (_tcscmp (tmp, current_hfdlg.filename)) {
- _tcscpy (current_hfdlg.filename, tmp);
- updatehdfinfo (hDlg, true);
- }
- GetDlgItemText (hDlg, IDC_PATH_FILESYS, current_hfdlg.fsfilename, sizeof current_hfdlg.fsfilename / sizeof (TCHAR));
- GetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, current_hfdlg.devicename, sizeof current_hfdlg.devicename / sizeof (TCHAR));
- posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0);
- if (posn != CB_ERR)
- current_hfdlg.controller = posn;
- updatehdfinfo (hDlg, false);
recursive--;
break;
int bp = tweakbootpri (current_fsvdlg.bootpri, current_fsvdlg.autoboot, current_fsvdlg.donotmount);
uci = add_filesys_config (&workprefs, entry, current_fsvdlg.device, current_fsvdlg.volume,
- current_fsvdlg.rootdir, ! current_fsvdlg.rw, 0, 0, 0, 0, bp, 0, 0, 0);
+ current_fsvdlg.rootdir, ! current_fsvdlg.rw, 0, 0, 0, 0, 0, bp, 0, 0, 0, 0, 0, 0);
if (uci) {
if (uci->rootdir[0])
filesys_media_change (uci->rootdir, 1, uci);
uci = add_filesys_config (&workprefs, entry, current_hfdlg.devicename, 0,
current_hfdlg.filename, ! current_hfdlg.rw,
- current_hfdlg.sectors, current_hfdlg.surfaces,
+ 0, current_hfdlg.sectors, current_hfdlg.surfaces,
current_hfdlg.reserved, current_hfdlg.blocksize,
bp, current_hfdlg.fsfilename,
- current_hfdlg.controller, 0);
+ current_hfdlg.controller, 0,
+ 0, 0, 0);
if (uci)
hardfile_do_disk_change (uci, 1);
}
struct uaedev_config_info *uci;
uci = add_filesys_config (&workprefs, entry, 0, 0,
- current_hfdlg.filename, ! current_hfdlg.rw, 0, 0,
- 0, current_hfdlg.blocksize, 0, 0, current_hfdlg.controller, 0);
+ current_hfdlg.filename, ! current_hfdlg.rw, 0, 0, 0,
+ 0, current_hfdlg.blocksize, 0, 0, current_hfdlg.controller, 0,
+ 0, 0, 0);
if (uci)
hardfile_do_disk_change (uci, 1);
}
if(type == FILESYS_HARDFILE || type == FILESYS_HARDFILE_RDB)
{
+ current_hfdlg.forcedcylinders = uci->cyls;
current_hfdlg.sectors = uci->sectors;
current_hfdlg.surfaces = uci->surfaces;
current_hfdlg.reserved = uci->reserved;
if (customDlgType == IDD_HARDFILE) {
_tcscpy (current_hfdlg.filename, file);
SetDlgItemText (hDlg, IDC_PATH_NAME, current_hfdlg.filename);
- updatehdfinfo (customDlg, true);
+ updatehdfinfo (customDlg, true, true);
+ sethardfile (customDlg);
continue;
}
diskswapper_addfile (prefs, file);
} else if (currentpage == HARDDISK_ID) {
add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0,
- 0, 0, 0, 0, 0, NULL, 0, 0);
+ 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0);
} else {
drv = floppyslot_addfile (prefs, file, drv, firstdrv, i);
if (drv < 0)
do_filesys_insert (file);
else
add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0,
- 0, 0, 0, 0, 0, NULL, 0, 0);
+ 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0);
} else {
+ current_hfdlg.forcedcylinders = 0;
+ current_hfdlg.sectors = 32;
+ current_hfdlg.surfaces = 1;
+ current_hfdlg.blocksize = 512;
+ _tcscpy (current_hfdlg.filename, file);
+ updatehdfinfo (NULL, true, true);
add_filesys_config (&workprefs, -1, NULL, NULL, file, 0,
- 32, 1, 2, 512, 0, NULL, 0, 0);
+ 0, current_hfdlg.sectors, current_hfdlg.surfaces, 2, current_hfdlg.blocksize, 0, NULL, 0, 0,
+ 0, 0, 0);
}
break;
case ZFILE_HDFRDB:
add_filesys_config (&workprefs, -1, NULL, NULL, file, 0,
- 0, 0, 0, 512, 0, NULL, 0, 0);
+ 0, 0, 0, 0, 512, 0, NULL, 0, 0, 0, 0, 0);
break;
case ZFILE_NVR:
_tcscpy (prefs->flashfile, file);
do_filesys_insert (file);
} else if (currentpage == HARDDISK_ID) {
add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0,
- 0, 0, 0, 0, 0, NULL, 0, 0);
+ 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0);
if (!full_property_sheet)
do_filesys_insert (file);
} else {
{
case WM_SIZING:
{
- if (!recursive && gui_resize_allowed) {
+ if (!recursive && gui_resize_enabled) {
RECT *r = (RECT*)lParam;
if (r->right - r->left < MIN_GUI_INTERNAL_WIDTH)
r->right = r->left + MIN_GUI_INTERNAL_WIDTH;
break;
}
case WM_ENTERSIZEMOVE:
- if (!recursive && gui_resize_allowed) {
+ if (!recursive && gui_resize_enabled) {
getguisize (hDlg, &oldwidth, &oldheight);
return FALSE;
}
break;
case WM_EXITSIZEMOVE:
- if (!recursive && gui_resize_allowed) {
+ if (!recursive && gui_resize_enabled) {
int w, h;
getguisize (hDlg, &w, &h);
if (w != oldwidth || h != oldheight) {
int fmultx = 0, fmulty = 0;
for (;;) {
int v = 0;
+ int regexists;
setdefaultguisize ();
- regqueryint (NULL, _T("GUIResize"), &v);
- gui_resize_allowed = gui_resize = v != 0;
+ regexists = regqueryint (NULL, _T("GUIResize"), &v);
+ gui_resize_allowed = true;
+ gui_resize_enabled = v != 0;
if (full_property_sheet || isfullscreen () == 0) {
regqueryint (NULL, _T("GUISizeX"), &gui_width);
regqueryint (NULL, _T("GUISizeY"), &gui_height);
regqueryint (NULL, _T("GUISizeFSY"), &gui_height);
scaleresource_init (_T("FS"));
}
- if (gui_width < 100 || gui_width > 4096 || gui_height < 100 || gui_height > 4096) {
+ if (!regexists) {
scaleresource_setdefaults ();
setdefaultguisize ();
+ double m = scaleresource_getdpimult ();
+ gui_width = (int)(gui_width * m);
+ gui_height = (int)(gui_height * m);
fmultx = 0;
- write_log (_T("GUI size reset\n"));
+ write_log (_T("GUI default size\n"));
+ regsetint (NULL, _T("GUIResize"), 0);
+ } else {
+ if (gui_width < 100 || gui_width > 4096 || gui_height < 100 || gui_height > 4096) {
+ scaleresource_setdefaults ();
+ setdefaultguisize ();
+ fmultx = 0;
+ write_log (_T("GUI size reset\n"));
+ }
}
if (all_options || !configstore)
}
}
- tres = scaleresource (panelresource, hwnd, gui_resize_allowed);
+ tres = scaleresource (panelresource, hwnd, gui_resize_enabled);
dhwnd = CreateDialogIndirect (tres->inst, tres->resource, hwnd, DialogProc);
dialog_rect.top = dialog_rect.left = 0;
dialog_rect.right = tres->width;
regsetint (NULL, _T("GUISizeFSX"), gui_width);
regsetint (NULL, _T("GUISizeFSY"), gui_height);
}
- regsetint (NULL, _T("GUIResize"), gui_resize ? 1 : 0);
+ regsetint (NULL, _T("GUIResize"), gui_resize_enabled ? 1 : 0);
gui_size_changed = 0;
quit_program = 0;
}
extern int scaleresource_choosefont (HWND hDlg, int fonttype);
extern void scaleresource_setdefaults (void);
extern void scaleresource_setfont (HWND hDlg);
+extern double scaleresource_getdpimult (void);
#endif
static int lpx, lpy;
+double scaleresource_getdpimult (void)
+{
+ HDC hdc = GetDC (NULL);
+ int m = GetDeviceCaps (hdc, LOGPIXELSY);
+ ReleaseDC (NULL, hdc);
+ if (m > 96) {
+ m -= 96;
+ return 1.0 + m / 250.0;
+ }
+ return 1.0;
+}
+
void scaleresource_init (const TCHAR *prefix)
{
if (os_vista)
- restore only single input target to default.
+Beta 22:
+
+- "Generic" Amiga model incorrectly enabled A3000 DMAC emulation which caused most programs that require UAE Boot ROM in
+ normal 0xF00000 area to crash. (Old bug, b20 adv.chipset caused it to appear much more commonly)
+- Disable ROM protection when switching JIT off on the fly.
+- Dragging standard HDF to Hardfiles panel sets correct default geometry.
+- Added logical cylinder value to HDF config data, default is zero = calculate from size of the HDF (same as previously)
+- Added "physical" CHS values to HDF config data, can be used to override autogenerared IDE emulation CHS values.
+ (append ",logical cyls,C/H/S" to hardfile2 config entry. No GUI support.)
+- GUI resize button was permanently disabled after it was unticked once.
+- log_disabled=1 in registry (DWORD) or ini disables winuaebootlog.txt.
+- Check DPI value when selecting default GUI size.
+- CD32 audio emulation update, Guardian CD32 (and possible some others) had muted audio since b1. Immediate reply
+ to CD play command should not have "play active" bit set. It should be only set in later status packets.
+
Beta 21:
- Use software volume also in WASAPI non-exclusive because WASAPI main volume control also affects waveOut used by CD audio.
}
}
}
- bootlogmode = bootlog;
} else if (1) {
TCHAR *c = GetCommandLine ();
if (_tcsstr (c, _T(" -console"))) {
}
}
}
-
+ bootlogmode = bootlog;
return f;
}