sys_command_close (DF_IOCTL, ou);
}
if (sys_command_open (DF_IOCTL, i) > 0) {
+ struct device_info di = { 0 };
+ sys_command_info (DF_IOCTL, 0, &di);
unitnum = i;
cd_hunt = 0;
- write_log (L"CD32: autodetected unit %d\n", unitnum);
+ write_log (L"CD32: autodetected unit %d ('%s')\n", unitnum, di.label);
}
}
if (!done && (!currprefs.blitter_cycle_exact || (currprefs.chipset_mask & CSMASK_AGA)))
return;
blit_interrupt = 1;
- INTREQ (0x8040);
+ send_interrupt (6, 2);
if (debug_dma)
record_dma_event (DMA_EVENT_BLITIRQ, hpos, vpos);
}
if (blt_delayed_irq > 0 && hsync) {
blt_delayed_irq--;
if (!blt_delayed_irq)
- INTREQ (0x8040);
+ send_interrupt (6, 2);
}
if (bltstate == BLT_done)
#include "blkdev.h"
#include "scsidev.h"
+#include "savestate.h"
static struct device_functions *device_func[2];
static int have_ioctl;
#ifdef _WIN32
-static int initialized;
-
#include "od-win32/win32.h"
extern struct device_functions devicefunc_win32_aspi;
{
int installed = 0;
+ device_func[DF_IOCTL] = NULL;
device_func[DF_SCSI] = &devicefunc_win32_aspi;
if (devicefunc_cdimage.openbus (0)) {
device_func[DF_IOCTL] = &devicefunc_cdimage;
void device_func_reset (void)
{
- initialized = 0;
have_ioctl = 0;
}
int support_scsi = 0, support_ioctl = 0;
int oflags = (flags & DEVICE_TYPE_SCSI) ? 0 : (1 << INQ_ROMD);
- if (initialized)
- return initialized;
install_driver (flags);
if (device_func[DF_IOCTL])
have_ioctl = 1;
support_scsi = device_func[DF_SCSI]->openbus (oflags) ? 1 : 0;
if (have_ioctl)
support_ioctl = device_func[DF_IOCTL]->openbus (1 << INQ_ROMD) ? 1 : 0;
- initialized = 1;
write_log (L"support_scsi = %d support_ioctl = %d\n", support_scsi, support_ioctl);
return (support_scsi ? (1 << DF_SCSI) : 0) | (support_ioctl ? (1 << DF_IOCTL) : 0);
}
if (quick)
return -1;
memset(&di, 0, sizeof di);
- device_func[DF_SCSI]->info (unitnum, &di);
+ if (device_func[DF_SCSI]->info (unitnum, &di) == NULL)
+ return -1;
return di.media_inserted;
} else {
return device_func[DF_IOCTL]->ismedia (unitnum, quick);
write_log (L"\n");
}
}
+
+uae_u8 *save_cd (int num, int *len)
+{
+ uae_u8 *dstbak, *dst;
+
+ if (num != 0)
+ return NULL;
+ if (!currprefs.cdimagefile[0])
+ return NULL;
+
+ dstbak = dst = xmalloc (4 + 256);
+ save_u32 (4);
+ save_string (currprefs.cdimagefile);
+ *len = dst - dstbak;
+ return dstbak;
+}
+
+uae_u8 *restore_cd (int unit, uae_u8 *src)
+{
+ uae_u32 flags;
+ TCHAR *s;
+
+ flags = restore_u32 ();
+ s = restore_string ();
+ if ((flags & 4) && unit == 0)
+ _tcscpy (changed_prefs.cdimagefile, s);
+ return src;
+}
+
#include "gui.h"
#include "fsdb.h"
#include "threaddep/thread.h"
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
#define USE 1
static int msf2lsn (int msf)
{
int sector = (((msf >> 16) & 0xff) * 60 * 75 + ((msf >> 8) & 0xff) * 75 + ((msf >> 0) & 0xff));
- return sector - 150;
+ sector -= 150;
+ return sector;
}
/* convert logical sector number -> minutes, seconds and frames */
if (oldplay != cdda_play) {
struct cdtoc *t;
int sector;
+
+ cdda_pos = cdda_start;
+ oldplay = cdda_play;
+
sector = cdda_start;
t = findtoc (§or);
- if (!t)
+ if (!t) {
write_log (L"CDDA: illegal sector number %d\n", cdda_start);
- else
+ } else {
write_log (L"CDDA: playing track %d (file '%s', offset %d, secoffset %d)\n",
t->track, t->fname, t->offset, sector);
- cdda_pos = cdda_start;
- oldplay = cdda_play;
- if (t->mp3 && !t->data) {
- if (mp3decoder_open ()) {
- t->data = mp3decoder_get (t->handle, t->filesize);
+ if (t->mp3 && !t->data) {
+ if (mp3decoder_open ()) {
+ t->data = mp3decoder_get (t->handle, t->filesize);
+ }
}
}
}
}
bufon[bufnum] = 0;
- if ((cdda_pos < cdda_end || cdda_end == 0xffffffff) && !cdda_paused && cdda_play) {
+ if ((cdda_pos < cdda_end || cdda_end == 0xffffffff) && !cdda_paused && cdda_play > 0) {
struct cdtoc *t;
- int sector;
-
- sector = cdda_pos;
- t = findtoc (§or);
- if (t && t->handle) {
- if (t->mp3) {
- if (t->data)
- memcpy (px[bufnum], t->data + sector * t->size + t->offset, t->size * num_sectors);
- else
- memset (px[bufnum], 0, t->size * num_sectors);
- } else {
- zfile_fseek (t->handle, sector * t->size + t->offset, SEEK_SET);
- if (zfile_fread (px[bufnum], t->size, num_sectors, t->handle) < num_sectors) {
- int i = num_sectors - 1;
- memset (px[bufnum], 0, t->size * num_sectors);
- while (i > 0) {
- if (zfile_fread (px[bufnum], t->size, i, t->handle) == i)
- break;
- i--;
+ int sector, cnt;
+ int dofinish = 0;
+
+ memset (px[bufnum], 0, num_sectors * 2352);
+ for (cnt = 0; cnt < num_sectors; cnt++) {
+ sector = cdda_pos;
+
+ cdda_pos++;
+ if (cdda_pos - num_sectors < cdda_end && cdda_pos >= cdda_end)
+ dofinish = 1;
+ cd_last_pos = cdda_pos;
+
+ t = findtoc (§or);
+ if (t) {
+ if (t->handle && !(t->ctrl & 4)) {
+ uae_u8 *dst = px[bufnum] + cnt * t->size;
+ if (t->mp3 && t->data) {
+ memcpy (dst, t->data + sector * t->size + t->offset, t->size);
+ } else if (!t->mp3) {
+ if (sector * t->size + t->offset + t->size < t->filesize) {
+ zfile_fseek (t->handle, sector * t->size + t->offset, SEEK_SET);
+ zfile_fread (dst, t->size, 1, t->handle);
+ }
}
- if (i == 0)
- write_log (L"CDDA: read error, track %d (file '%s' offset %d secoffset %d)\n",
- t->track, t->fname, t->offset, sector);
}
}
}
break;
}
- cdda_pos += num_sectors;
- if (cdda_pos >= cdda_end)
+ if (dofinish) {
cdda_play_finished = 1;
- cd_last_pos = cdda_pos;
+ cdda_play = -1;
+ cdda_pos = cdda_end + 1;
+ }
}
p = buf;
status = AUDIO_STATUS_NO_STATUS;
- if (cdda_play) {
+ if (cdda_play > 0) {
status = AUDIO_STATUS_IN_PROGRESS;
if (cdda_paused)
status = AUDIO_STATUS_PAUSED;
return out;
}
-static int open_device (int unitnum)
+static int parse_image (void)
{
struct zfile *zcue;
TCHAR *fname, *fnametype;
- int tracknum;
+ int tracknum, index0, pregap;
int offset, secoffset, newfile;
int i;
TCHAR *p;
TCHAR *img = currprefs.cdimagefile;
int ctrl;
- if (unitnum || !img)
+ if (!img)
return 0;
- zcue = zfile_fopen (img, L"rb", 0);
+ zcue = zfile_fopen (img, L"rb", ZFD_ARCHIVE);
if (!zcue)
return 0;
+ oldcurdir[0] = 0;
fname = NULL;
fnametype = NULL;
tracknum = 0;
secoffset = 0;
newfile = 0;
ctrl = 0;
+ index0 = -1;
+ pregap = 0;
- zfile_fseek (zcue, 0, SEEK_END);
- siz = zfile_ftell (zcue);
- zfile_fseek (zcue, 0, SEEK_SET);
+ siz = zfile_size (zcue);
if (siz >= 16384) {
if ((siz % 2048) == 0 || (siz % 2352) == 0) {
struct cdtoc *t = &toc[0];
t->fname = my_strdup (img);
t->handle = zcue;
t->size = (siz % 2048) == 0 ? 2048 : 2352;
+ t->filesize = siz;
write_log (L"CUE: plain CD image mounted!\n");
zcue = NULL;
goto isodone;
TCHAR *tracktype;
p += 5;
+ //pregap = 0;
+ index0 = -1;
tracknum = _tstoi (nextstring (&p));
tracktype = nextstring (&p);
size = 2352;
}
newfile = 0;
- ztrack = zfile_fopen (fname, L"rb", 0);
+ ztrack = zfile_fopen (fname, L"rb", ZFD_ARCHIVE);
if (!ztrack) {
TCHAR tmp[MAX_DPATH];
_tcscpy (tmp, fname);
p = tmp + _tcslen (tmp);
while (p > tmp) {
if (*p == '/' || *p == '\\') {
- ztrack = zfile_fopen (p + 1, L"rb", 0);
+ ztrack = zfile_fopen (p + 1, L"rb", ZFD_ARCHIVE);
if (ztrack) {
xfree (fname);
fname = my_strdup (p + 1);
p--;
}
}
+ if (!ztrack) {
+ TCHAR tmp[MAX_DPATH];
+ TCHAR *s2;
+ _tcscpy (tmp, zfile_getname (zcue));
+ s2 = _tcsrchr (tmp, '\\');
+ if (!s2)
+ s2 = _tcsrchr (tmp, '/');
+ if (s2) {
+ s2[0] = 0;
+ _tcscat (tmp, L"\\");
+ _tcscat (tmp, fname);
+ ztrack = zfile_fopen (tmp, L"rb", ZFD_ARCHIVE);
+ }
+ }
t->track = tracknum;
t->ctrl = ctrl;
t->adr = 1;
t->fname = my_strdup (fname);
if (tracknum > tracks)
tracks = tracknum;
- zfile_fseek (t->handle, 0, SEEK_END);
- t->filesize = zfile_ftell (t->handle);
- zfile_fseek (t->handle, 0, SEEK_SET);
+ if (t->handle)
+ t->filesize = zfile_size (t->handle);
}
+ } else if (!_tcsnicmp (p, L"PREGAP", 6)) {
+ TCHAR *tt;
+ int tn;
+ p += 6;
+ tt = nextstring (&p);
+ tn = _tstoi (tt) * 60 * 75;
+ tn += _tstoi (tt + 3) * 75;
+ tn += _tstoi (tt + 6);
+ pregap += tn;
} else if (!_tcsnicmp (p, L"INDEX", 5)) {
int idxnum;
int tn = 0;
tn = _tstoi (tt) * 60 * 75;
tn += _tstoi (tt + 3) * 75;
tn += _tstoi (tt + 6);
- if (tracknum >= 1 && tracknum <= 99) {
+ if (idxnum == 0) {
+ index0 = tn;
+ } else if (idxnum == 1 && tracknum >= 1 && tracknum <= 99) {
struct cdtoc *t = &toc[tracknum - 1];
if (!t->address) {
t->address = tn + secoffset;
+ t->address += pregap;
if (tracknum > 1) {
offset += t->address - t[-1].address;
} else {
isodone:
if (tracks && toc[tracks - 1].handle) {
struct cdtoc *t = &toc[tracks - 1];
- int size = t->filesize - offset * t->size;
+ int size = t->filesize ;
+ if (!secoffset)
+ size -= offset * t->size;
if (size < 0)
size = 0;
- toc[tracks].address = toc[tracks - 1].address + size / t->size;
+ toc[tracks].address = t->address + size / t->size;
}
xfree (fname);
if (oldcurdir[0])
write_log (L"%7d %02d:%02d:%02d",
t->address, (msf >> 16) & 0xff, (msf >> 8) & 0xff, (msf >> 0) & 0xff);
if (i < tracks)
- write_log (L" %s %x %10d %s", (t->ctrl & 4) ? L"DATA" : L"CDA ", t->ctrl, t->offset, t->handle == NULL ? L"FILE ERROR" : L"");
+ write_log (L" %s %x %10d %s", (t->ctrl & 4) ? L"DATA" : L"CDA ", t->ctrl, t->offset, t->handle == NULL ? L"[FILE ERROR]" : L"");
write_log (L"\n");
if (i < tracks)
write_log (L" - %s\n", t->fname);
mp3decoder_close ();
return 1;
}
-static void close_device (int unitnum)
+
+static void unload_image (void)
{
int i;
tracks = 0;
}
+static int open_device (int unitnum)
+{
+ if (unitnum)
+ return 0;
+ return parse_image ();
+}
+
+static void close_device (int unitnum)
+{
+ unload_image ();
+}
+
+static int imagechange;
+static TCHAR newfile[MAX_DPATH];
+
+void cdimage_vsync (void)
+{
+ if (imagechange == 0)
+ return;
+ imagechange--;
+ if (imagechange > 0)
+ return;
+ _tcscpy (currprefs.cdimagefile, newfile);
+ _tcscpy (changed_prefs.cdimagefile, newfile);
+ newfile[0] = 0;
+ write_log (L"CD: delayed insert '%s'\n", currprefs.cdimagefile);
+ parse_image ();
+#ifdef RETROPLATFORM
+ rp_cd_change (0, 0);
+#endif
+}
+
static int ismedia (int unitnum, int quick)
{
+
+ if (_tcscmp (changed_prefs.cdimagefile, currprefs.cdimagefile)) {
+ _tcscpy (newfile, changed_prefs.cdimagefile);
+ changed_prefs.cdimagefile[0] = currprefs.cdimagefile[0] = 0;
+ imagechange = 5 * 50;
+ write_log (L"CD: eject\n");
+ unload_image ();
+#ifdef RETROPLATFORM
+ rp_cd_change (unitnum, 1);
+#endif
+ }
return currprefs.cdimagefile[0] ? 1 : 0;
}
static int open_bus (int flags)
{
- return ismedia (0, 1);
+ int v;
+ if (imagechange)
+ return 1;
+ v = ismedia (0, 1);
+#ifdef RETROPLATFORM
+ if (v)
+ rp_cd_change (0, 0);
+#endif
+ return v;
}
static void close_bus (void)
di->write_protected = 1;
di->type = INQ_ROMD;
di->id = 1;
- _tcscpy (di->label, L"IMG");
+ _tcscpy (di->label, L"IMG_EMU");
return di;
}
sys_command_close (DF_IOCTL, unitnum);
}
if (sys_command_open (DF_IOCTL, i) > 0) {
+ struct device_info di = { 0 };
+ sys_command_info (DF_IOCTL, 0, &di);
unitnum = i;
cd_hunt = 0;
- write_log (L"CDTV: autodetected unit %d\n", unitnum);
+ write_log (L"CDTV: autodetected unit %d ('%s')\n", unitnum, di.label);
} else {
unitnum = -1;
}
static const TCHAR *lorestype2[] = { L"true", L"false" };
static const TCHAR *loresmode[] = { L"normal", L"filtered", 0 };
#ifdef GFXFILTER
-static const TCHAR *filtermode1[] = { L"no_16", L"bilinear_16", L"no_32", L"bilinear_32", 0 };
static const TCHAR *filtermode2[] = { L"0x", L"1x", L"2x", L"3x", L"4x", 0 };
#endif
static const TCHAR *cartsmode[] = { L"none", L"hrtmon", 0 };
static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix_9pin", L"epson_matrix_24pin", L"epson_matrix_48pin", 0 };
static const TCHAR *aspects[] = { L"none", L"vga", L"tv", 0 };
static const TCHAR *vsyncmodes[] = { L"false", L"true", L"autoswitch", 0 };
+static const TCHAR *filterapi[] = { L"directdraw", L"direct3d", 0 };
static const TCHAR *dongles[] =
{
L"none",
cfgfile_write_str (f, L"gfx_center_vertical", centermode1[p->gfx_ycenter]);
cfgfile_write_str (f, L"gfx_colour_mode", colormode1[p->color_mode]);
cfgfile_write_bool (f, L"gfx_blacker_than_black", p->gfx_blackerthanblack);
+ cfgfile_write_str (f, L"gfx_api", filterapi[p->gfx_api]);
#ifdef GFXFILTER
if (p->gfx_filter > 0) {
cfgfile_dwrite_str (f, L"gfx_filter", uf->cfgname);
if (uf->type == p->gfx_filter) {
if (uf->x[0]) {
- cfgfile_dwrite_str (f, L"gfx_filter_mode", filtermode1[p->gfx_filter_filtermode]);
+ cfgfile_dwrite_str (f, L"gfx_filter_mode", filtermode2[1]);
} else {
int mt[4], i = 0;
if (uf->x[1])
cfgfile_dwrite (f, L"gfx_filter_gamma", L"%d", p->gfx_filter_gamma);
cfgfile_dwrite (f, L"gfx_filter_blur", L"%d", p->gfx_filter_blur);
cfgfile_dwrite (f, L"gfx_filter_noise", L"%d", p->gfx_filter_noise);
+ cfgfile_dwrite_bool (f, L"gfx_filter_bilinear", p->gfx_filter_bilinear);
cfgfile_dwrite_str (f, L"gfx_filter_keep_aspect", aspects[p->gfx_filter_keep_aspect]);
cfgfile_dwrite_str (f, L"gfx_filter_autoscale", autoscale[p->gfx_filter_autoscale]);
cfgfile_dwrite (f, L"gfx_filter_aspect_ratio", L"%d:%d",
cfgfile_dwrite_bool (f, L"resetwarning", p->cs_resetwarning);
cfgfile_dwrite_bool (f, L"denise_noehb", p->cs_denisenoehb);
cfgfile_dwrite_bool (f, L"agnus_bltbusybug", p->cs_agnusbltbusybug);
+ cfgfile_dwrite_bool (f, L"ics_agnus", p->cs_dipagnus);
cfgfile_write (f, L"fastmem_size", L"%d", p->fastmem_size / 0x100000);
cfgfile_write (f, L"a3000mem_size", L"%d", p->mbresmem_low_size / 0x100000);
|| cfgfile_intval (option, value, L"gfx_filter_gamma", &p->gfx_filter_gamma, 1)
|| cfgfile_intval (option, value, L"gfx_filter_blur", &p->gfx_filter_blur, 1)
|| cfgfile_intval (option, value, L"gfx_filter_noise", &p->gfx_filter_noise, 1)
+ || cfgfile_intval (option, value, L"gfx_filter_bilinear", &p->gfx_filter_bilinear, 1)
|| cfgfile_intval (option, value, L"gfx_luminance", &p->gfx_luminance, 1)
|| cfgfile_intval (option, value, L"gfx_contrast", &p->gfx_contrast, 1)
|| cfgfile_intval (option, value, L"gfx_gamma", &p->gfx_gamma, 1)
|| cfgfile_strval (option, value, L"gfx_max_horizontal", &p->gfx_max_horizontal, maxhoriz, 0)
|| cfgfile_strval (option, value, L"gfx_max_vertical", &p->gfx_max_vertical, maxvert, 0)
|| cfgfile_strval (option, value, L"gfx_filter_autoscale", &p->gfx_filter_autoscale, autoscale, 0)
+ || cfgfile_strval (option, value, L"gfx_api", &p->gfx_api, filterapi, 0)
|| cfgfile_strval (option, value, L"magic_mousecursor", &p->input_magic_mouse_cursor, magiccursors, 0)
|| cfgfile_strval (option, value, L"gfx_filter_keep_aspect", &p->gfx_filter_keep_aspect, aspects, 0)
|| cfgfile_strval (option, value, L"absolute_mouse", &p->input_tablet, abspointers, 0))
*s++ = 0;
p->gfx_filtershader[0] = 0;
p->gfx_filter = 0;
- while(uaefilters[i].name) {
- if (!_tcscmp (uaefilters[i].cfgname, value)) {
- p->gfx_filter = uaefilters[i].type;
- if (s)
- _tcscpy (p->gfx_filtershader, s);
- break;
+ if (!_tcscmp (value, L"direct3d")) {
+ p->gfx_api = 1; // forwards compatibiity
+ } else {
+ while(uaefilters[i].name) {
+ if (!_tcscmp (uaefilters[i].cfgname, value)) {
+ p->gfx_filter = uaefilters[i].type;
+ if (s)
+ _tcscpy (p->gfx_filtershader, s);
+ break;
+ }
+ i++;
}
- i++;
}
return 1;
}
while(uaefilters[i].name) {
uf = &uaefilters[i];
if (uf->type == p->gfx_filter) {
- if (uf->x[0]) {
- cfgfile_strval (option, value, L"gfx_filter_mode", &p->gfx_filter_filtermode, filtermode1, 0);
- } else {
+ if (!uf->x[0]) {
int mt[4], j;
i = 0;
if (uf->x[1])
|| cfgfile_yesno (option, value, L"ksmirror_a8", &p->cs_ksmirror_a8)
|| cfgfile_yesno (option, value, L"resetwarning", &p->cs_resetwarning)
|| cfgfile_yesno (option, value, L"denise_noehb", &p->cs_denisenoehb)
+ || cfgfile_yesno (option, value, L"ics_agnus", &p->cs_dipagnus)
|| cfgfile_yesno (option, value, L"agnus_bltbusybug", &p->cs_agnusbltbusybug)
|| cfgfile_yesno (option, value, L"kickshifter", &p->kickshifter)
p->gfx_filtershader[0] = 0;
p->gfx_filter_horiz_zoom_mult = 0;
p->gfx_filter_vert_zoom_mult = 0;
+ p->gfx_filter_bilinear = 0;
p->gfx_filter_filtermode = 0;
p->gfx_filter_scanlineratio = (1 << 4) | 1;
p->gfx_filter_keep_aspect = 0;
p->dfxtype[1] = DRV_NONE;
p->cs_compatible = CP_A1000;
p->cs_slowmemisfast = 1;
+ p->cs_dipagnus = 1;
+ p->cs_agnusbltbusybug = 1;
built_in_chipset_prefs (p);
if (config > 0)
p->cs_denisenoehb = 1;
p->cs_ksmirror_e0 = 0;
p->cs_rtc = 0;
p->cs_agnusbltbusybug = 1;
+ p->cs_dipagnus = 1;
break;
case CP_A1200: // A1200
p->cs_ide = IDE_A600A1200;
{
if (ciaaimask & ciaaicr) {
ciaaicr |= 0x80;
- INTREQ_0 (0x8000 | 0x0008);
+ send_interrupt (3, 2);
}
}
{
if (ciabimask & ciabicr) {
ciabicr |= 0x80;
- INTREQ_0 (0x8000 | 0x2000);
+ send_interrupt (13, 2);
}
}
#include "a2091.h"
#include "a2065.h"
#include "ncr_scsi.h"
+#include "blkdev.h"
#define CUSTOM_DEBUG 0
#define SPRITE_DEBUG 0
diw_hcounter += maxhpos * 2;
if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos == equ_vblank_endline - 1)
diw_hcounter++;
- if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > equ_vblank_endline) {
+ if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > equ_vblank_endline || (currprefs.cs_dipagnus && vpos == 0)) {
diw_hcounter = maxhpos * 2;
last_hdiw = 2 - 1;
}
return currprefs.cpu_cycle_exact != 0;
}
-static void send_interrupt (void)
+static void send_interrupt_do (uae_u32 v)
{
- int lev = intlev ();
- if (lev < 0)
- lev = 0;
- if (lev != regs.ipl)
- event2_newevent_xx (-1, 5 * CYCLE_UNIT, lev, prepare_interrupt);
+ INTREQ_0 (0x8000 | (1 << v));
+}
+
+void send_interrupt (int num, int delay)
+{
+ if (use_eventmode () && delay > 0) {
+ if (!(intreqr & (1 << num)))
+ event2_newevent_xx (-1, delay * CYCLE_UNIT, num, send_interrupt_do);
+ } else {
+ send_interrupt_do (num);
+ }
}
STATIC_INLINE void INTENA (uae_u16 v)
if (v & 0x40)
write_log (L"INTENA %04X (%04X) %p\n", intena, v, M68K_GETPC);
#endif
+#if 0
if (use_eventmode ()) {
send_interrupt ();
} else if (v & 0x8000) {
doint ();
}
+#endif
+ if (v & 0x8000)
+ doint ();
}
void INTREQ_0 (uae_u16 v)
if (v & (0x80 | 0x100 | 0x200 | 0x400))
audio_update_irq (v);
intreqr = intreq;
+#if 0
if (use_eventmode ()) {
if (tmp != intreq)
send_interrupt ();
} else {
doint ();
}
+#endif
+ doint ();
}
void INTREQ (uae_u16 data)
if ((intreq & 0x0020) && (intena & 0x0020))
write_log (L"vblank interrupt not cleared\n");
#endif
- INTREQ (0x8000 | 0x0020);
if (bplcon0 & 4)
lof ^= 1;
picasso_handle_vsync ();
#endif
audio_vsync ();
+ cdimage_vsync ();
if (quit_program > 0) {
/* prevent possible infinite loop at wait_cycles().. */
if (currprefs.cs_ciaatod == 0)
CIA_vsync_prehandler (!(bplcon0 & 2) || ((bplcon0 & 2) && currprefs.genlock));
}
+ // DIP Agnus (8361): vblank interrupt is triggered on line 1!
+ if (currprefs.cs_dipagnus) {
+ if (vpos == 1)
+ send_interrupt (5, 0);
+ } else {
+ if (vpos == 0)
+ send_interrupt (5, 0);
+ }
#ifdef CPUEMU_12
if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
currprefs.gfx_filter_horiz_offset = changed_prefs.gfx_filter_horiz_offset;
currprefs.gfx_filter_vert_offset = changed_prefs.gfx_filter_vert_offset;
currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines;
- currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
#endif
}
static uae_u16 bigmfmbufw[0x4000 * DDHDMULT];
static drive floppy[MAX_FLOPPY_DRIVES];
-static TCHAR dfxhistory[MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
+static TCHAR dfxhistory[2][MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
static uae_u8 exeheader[]={0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00};
static uae_u8 bootblock[]={
xfree (chunk);
zfile_fclose (f);
if (f)
- DISK_history_add (name, -1, TRUE);
+ DISK_history_add (name, -1, HISTORY_FLOPPY, TRUE);
}
update_drive_gui (num);
}
-int DISK_history_add (const TCHAR *name, int idx, int donotcheck)
+int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck)
{
int i;
if (idx >= MAX_PREVIOUS_FLOPPIES)
return 0;
if (name == NULL) {
- dfxhistory[idx][0] = 0;
+ dfxhistory[type][idx][0] = 0;
return 1;
}
if (name[0] == 0)
if (idx >= 0) {
if (idx >= MAX_PREVIOUS_FLOPPIES)
return 0;
- dfxhistory[idx][0] = 0;
+ dfxhistory[type][idx][0] = 0;
for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
- if (!_tcscmp (dfxhistory[i], name))
+ if (!_tcscmp (dfxhistory[type][i], name))
return 0;
}
- _tcscpy (dfxhistory[idx], name);
+ _tcscpy (dfxhistory[type][idx], name);
return 1;
}
for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
- if (!_tcscmp (dfxhistory[i], name)) {
+ if (!_tcscmp (dfxhistory[type][i], name)) {
while (i < MAX_PREVIOUS_FLOPPIES - 1) {
- _tcscpy (dfxhistory[i], dfxhistory[i + 1]);
+ _tcscpy (dfxhistory[type][i], dfxhistory[type][i + 1]);
i++;
}
- dfxhistory[MAX_PREVIOUS_FLOPPIES - 1][0] = 0;
+ dfxhistory[type][MAX_PREVIOUS_FLOPPIES - 1][0] = 0;
break;
}
}
for (i = MAX_PREVIOUS_FLOPPIES - 2; i >= 0; i--)
- _tcscpy (dfxhistory[i + 1], dfxhistory[i]);
- _tcscpy (dfxhistory[0], name);
+ _tcscpy (dfxhistory[type][i + 1], dfxhistory[type][i]);
+ _tcscpy (dfxhistory[type][0], name);
return 1;
}
-TCHAR *DISK_history_get (int idx)
+TCHAR *DISK_history_get (int idx, int type)
{
if (idx >= MAX_PREVIOUS_FLOPPIES)
- return 0;
- return dfxhistory[idx];
+ return NULL;
+ return dfxhistory[type][idx];
}
static void disk_insert_2 (int num, const TCHAR *name, int forced)
return;
_tcscpy (drv->newname, name);
_tcscpy (currprefs.df[num], name);
- DISK_history_add (name, -1, 0);
+ DISK_history_add (name, -1, HISTORY_FLOPPY, 0);
if (name[0] == 0) {
disk_eject (num);
} else if (!drive_empty(drv) || drv->dskchange_time > 0) {
if (dstptr)
dstbak = dst = dstptr;
else
- dstbak = dst = malloc (2+1+1+1+1+4+4+256);
+ dstbak = dst = xmalloc (2+1+1+1+1+4+4+256);
save_u32 (drv->drive_id); /* drive type ID */
save_u8 ((drv->motoroff ? 0:1) | ((disabled & (1 << num)) ? 2 : 0) | (drv->idbit ? 4 : 0) | (drv->dskchange ? 8 : 0));
save_u8 (drv->cyl); /* cylinder */
if (dstptr)
dstbak = dst = dstptr;
else
- dstbak = dst = (uae_u8*)malloc(2+1+1+1+1+2);
+ dstbak = dst = xmalloc (2 + 1 + 1 + 1 + 1 + 2);
save_u16 (word); /* current fifo (low word) */
save_u8 (bitoffset); /* dma bit offset */
save_u8 (dma_enable); /* disk sync found */
fill_prefetch_full ();
break;
case i_RTE:
- if (cpu_level == 0) {
- genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL);
- genamode (Aipi, "7", sz_long, "pc", 1, 0, GF_NOREFILL);
- printf ("\tregs.sr = sr;\n");
- setpc ("pc");
- printf ("\tMakeFromSR ();\n");
+ if (using_mmu) {
+ printf ("\tm68k_do_rte_mmu ();\n");
} else {
- int old_brace_level = n_braces;
- if (next_cpu_level < 0)
- next_cpu_level = 0;
- genamode (Aipi, "7", sz_word, "sr", 1, 0, 0);
- genamode (Aipi, "7", sz_long, "pc", 1, 0, 0);
- genamode (Aipi, "7", sz_word, "format", 1, 0, 0);
- printf ("\tm68k_do_rte (pc, sr, format, 0x%04x);\n", opcode);
+ if (cpu_level == 0) {
+ genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL);
+ genamode (Aipi, "7", sz_long, "pc", 1, 0, GF_NOREFILL);
+ printf ("\tregs.sr = sr;\n");
+ setpc ("pc");
+ printf ("\tMakeFromSR ();\n");
+ } else {
+ int old_brace_level = n_braces;
+ if (next_cpu_level < 0)
+ next_cpu_level = 0;
+ genamode (Aipi, "7", sz_word, "sr", 1, 0, 0);
+ genamode (Aipi, "7", sz_long, "pc", 1, 0, 0);
+ genamode (Aipi, "7", sz_word, "format", 1, 0, 0);
+ printf ("\tm68k_do_rte (pc, sr, format, 0x%04x);\n", opcode);
+ }
+ /* PC is set and prefetch filled. */
}
- /* PC is set and prefetch filled. */
m68k_pc_offset = 0;
fill_prefetch_full ();
break;
break;
case i_UNLK:
// ce confirmed
- genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
- printf ("\tm68k_areg (regs, 7) = src;\n");
- genamode (Aipi, "7", sz_long, "old", 1, 0, 0);
- fill_prefetch_next ();
- genastore ("old", curi->smode, "srcreg", curi->size, "src");
+ if (using_mmu) {
+ genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
+ printf ("\tuae_s32 old = get_long_mmu (src);\n");
+ printf ("\tm68k_areg (regs, 7) = src + 4;\n");
+ printf ("\tm68k_areg (regs, srcreg) = old;\n");
+ } else {
+ genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
+ printf ("\tm68k_areg (regs, 7) = src;\n");
+ genamode (Aipi, "7", sz_long, "old", 1, 0, 0);
+ fill_prefetch_next ();
+ genastore ("old", curi->smode, "srcreg", curi->size, "src");
+ }
break;
case i_RTS:
if (using_ce)
int bus, target, lun;
int id;
TCHAR label[MAX_DPATH];
+ TCHAR ident[16];
};
struct device_scsi_info {
void scsi_log_before (uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen);
void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen);
+
+extern void cdimage_vsync (void);
\ No newline at end of file
STATIC_INLINE void prefetch_common_ce000 (void)
{
- regs.lastfetch = get_cycles () + CYCLE_UNIT;
+ regs.lastfetch = get_cycles ();
}
#ifdef CPUEMU_20
}
extern void m68k_do_rts_mmu (void);
+extern void m68k_do_rte_mmu (void);
extern void m68k_do_bsr_mmu (uaecptr oldpc, uae_s32 offset);
struct mmufixup
extern void INTREQ (uae_u16);
extern void INTREQ_0 (uae_u16);
extern void INTREQ_f (uae_u32);
+extern void send_interrupt (int num, int delay);
extern uae_u16 INTREQR (void);
/* maximums for statically allocated tables */
typedef enum { DRV_NONE = -1, DRV_35_DD = 0, DRV_35_HD, DRV_525_SD, DRV_35_DD_ESCOM } drive_type;
+#define HISTORY_FLOPPY 0
+#define HISTORY_CD 1
+
extern void DISK_init (void);
extern void DISK_free (void);
extern void DISK_select (uae_u8 data);
extern int disk_setwriteprotect (int num, const TCHAR *name, int protect);
extern void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk_name);
extern void dumpdisk (void);
-extern int DISK_history_add (const TCHAR *name, int idx, int donotcheck);
-extern TCHAR *DISK_history_get (int idx);
+extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
+extern TCHAR *DISK_history_get (int idx, int type);
int DISK_examine_image (struct uae_prefs *p, int num, uae_u32 *crc32);
extern TCHAR *DISK_get_saveimagepath (const TCHAR *name);
extern void DISK_reinsert (int num);
extern void S2X_render (void);
extern void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd);
extern void S2X_free (void);
+extern int S2X_getmult (void);
extern void PAL_init (void);
extern void PAL_1x1_32 (uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height);
extern void _cdecl hq4x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
#define UAE_FILTER_NULL 1
-#define UAE_FILTER_DIRECT3D 2
-//#define UAE_FILTER_OPENGL 3
-#define UAE_FILTER_SCALE2X 3
+#define UAE_FILTER_SCALE2X 2
+#define UAE_FILTER_HQ 3
#define UAE_FILTER_SUPEREAGLE 4
#define UAE_FILTER_SUPER2XSAI 5
#define UAE_FILTER_2XSAI 6
#define UAE_FILTER_PAL 7
-#define UAE_FILTER_HQ 8
+#define UAE_FILTER_LAST 7
#define UAE_FILTER_MODE_16 16
#define UAE_FILTER_MODE_16_16 16
#define INPREC_VSYNC 6
#define INPREC_CIAVSYNC 7
#define INPREC_END 0xff
+#define INPREC_QUIT 0xfe
extern int input_recording;
extern void inprec_close (void);
int gfx_saturation, gfx_luminance, gfx_contrast, gfx_gamma;
int gfx_blackerthanblack;
int gfx_backbuffers;
+ int gfx_api;
int color_mode;
int gfx_filter;
int gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
int gfx_filter_horiz_offset, gfx_filter_vert_offset;
int gfx_filter_filtermode;
+ int gfx_filter_bilinear;
int gfx_filter_noise, gfx_filter_blur;
int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast, gfx_filter_gamma;
int gfx_filter_keep_aspect, gfx_filter_aspect;
int cs_slowmemisfast;
int cs_resetwarning;
int cs_denisenoehb;
+ int cs_dipagnus;
int cs_agnusbltbusybug;
TCHAR df[4][MAX_DPATH];
extern uae_u8 *restore_ide (uae_u8 *src);
extern uae_u8 *save_ide (int num, int *len);
+extern uae_u8 *save_cd (int num, int *len);
+extern uae_u8 *restore_cd (int, uae_u8 *src);
+
extern uae_u8 *save_configuration (int *len);
extern uae_u8 *restore_configuration (uae_u8 *src);
extern uae_u8 *save_log (int, int *len);
extern void zfile_fclose (struct zfile *);
extern uae_s64 zfile_fseek (struct zfile *z, uae_s64 offset, int mode);
extern uae_s64 zfile_ftell (struct zfile *z);
+extern uae_s64 zfile_size (struct zfile *z);
extern size_t zfile_fread (void *b, size_t l1, size_t l2, struct zfile *z);
extern size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z);
extern TCHAR *zfile_fgets (TCHAR *s, int size, struct zfile *z);
#define ZFILE_STATEFILE 6
#define ZFILE_NVR 7
#define ZFILE_HDFRDB 8
+#define ZFILE_CDIMAGE 9
extern const TCHAR *uae_archive_extensions[];
extern const TCHAR *uae_ignoreextensions[];
if (p[5 + 1] == INPREC_END) {
inprec_close ();
return 0;
+ } else if (p[5 + 1] == INPREC_QUIT) {
+ inprec_close ();
+ uae_quit ();
+ return 0;
}
hc_orig = hc;
hc /= inprec_div;
}
if (nr == 2) {
+ write_log (L"%08x %08x %08x\n", currpc, oldpc, regs.mmu_fault_addr);
+ if (currpc == 0x0013b5e2)
+ activate_debugger ();
// bus error
for (i = 0 ; i < 7 ; i++) {
m68k_areg (regs, 7) -= 4;
STATIC_INLINE int time_for_interrupt (void)
{
if (interrupt_cycles_active) {
- if (interrupt_cycle != regs.lastfetch) {
+ if (regs.lastfetch - interrupt_cycle >= 2 * CYCLE_UNIT) {
interrupt_cycles_active = 0;
return 1;
} else {
return 1;
}
-void prepare_interrupt (uae_u32 lev)
-{
- // CPU IPLx lines change state now
- // but we may need to wait for next S4 state
- // before CPU sees it
- regs.ipl = lev;
- if (currprefs.cpu_model == 68000) {
- interrupt_cycle = get_cycles ();
- if ((regs.lastfetch - interrupt_cycle) >= 0) {
- // interrupt arrived too late
- // wait for next memory cycle
- interrupt_cycles_active = 1;
- }
- }
- set_special (SPCFLAG_INT);
-}
-
void doint (void)
{
- if (currprefs.cpu_cycle_exact)
+ regs.ipl = intlev ();
+ if (currprefs.cpu_cycle_exact) {
+ set_special (SPCFLAG_INT);
+ interrupt_cycle = get_cycles ();
+ interrupt_cycles_active = 1;
return;
+ }
if (currprefs.cpu_compatible)
set_special (SPCFLAG_INT);
else
do_copper ();
if (currprefs.cpu_cycle_exact) {
- if (time_for_interrupt ()) {
- int intr = regs.ipl;
- if (intr > 0 && intr > regs.intmask)
- do_interrupt (intr);
+ if (regs.ipl > 0 && regs.ipl > regs.intmask) {
+ if (time_for_interrupt ())
+ do_interrupt (regs.ipl);
}
} else {
if (regs.spcflags & (SPCFLAG_INT | SPCFLAG_DOINT)) {
do_trace ();
if (currprefs.cpu_cycle_exact) {
- if (time_for_interrupt ()) {
- int intr = regs.ipl;
- if (intr > 0 && intr > regs.intmask)
- do_interrupt (intr);
+ if (regs.ipl > 0 && (regs.ipl > regs.intmask || regs.ipl == 7)) {
+ if (time_for_interrupt ())
+ do_interrupt (regs.ipl);
}
} else {
if (regs.spcflags & SPCFLAG_INT) {
{
}
+void m68k_do_rte_mmu (void)
+{
+ uaecptr src = m68k_areg (regs, 7);
+ uae_s16 sr = get_word_mmu (src);
+ uae_s32 pc = get_long_mmu (src + 2);
+ uae_s16 format = get_word_mmu (src + 6);
+ m68k_areg (regs, 7) += 8;
+ m68k_do_rte (pc, sr, format, 0x4e73);
+}
+
void m68k_do_rts_mmu (void)
{
m68k_setpc (get_long_mmu (m68k_areg (regs, 7)));
#include <winioctl.h>
#include <setupapi.h> // for SetupDiXxx functions.
#include <stddef.h>
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
#include <ntddscsi.h>
+#define IOCTL_DATA_BUFFER 8192
+#define CDDA_BUFFERS 6
+
struct dev_info_ioctl {
HANDLE h;
uae_u8 *tempbuffer;
uae_u32 cd_last_pos;
HWAVEOUT cdda_wavehandle;
int cdda_start, cdda_end;
+ uae_u8 subcode[96 * CDDA_BUFFERS];
};
-#define IOCTL_DATA_BUFFER 8192
-#define CDDA_BUFFERS 6
-
static int MCICDA;
static struct dev_info_ioctl ciw32[MAX_TOTAL_DEVICES];
int unitnum = ciw32 - ciw;
int cdda_pos;
int num_sectors = CDDA_BUFFERS;
- int quit = 0;
int bufnum;
int buffered;
uae_u8 *px[2], *p;
seterrormode (unitnum);
rri.DiskOffset.QuadPart = 2048 * (cdda_pos - 150);
rri.SectorCount = num_sectors;
- rri.TrackMode = CDDA;
- if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * 2352, &len, NULL)) {
- DWORD err = GetLastError ();
- write_log (L"IOCTL_CDROM_RAW_READ CDDA returned %d\n", err);
- quit = 1;
+ rri.TrackMode = RawWithSubCode;
+ if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * CD_RAW_SECTOR_WITH_SUBCODE_SIZE, &len, NULL)) {
+ rri.TrackMode = CDDA;
+ if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * 2352, &len, NULL)) {
+ DWORD err = GetLastError ();
+ write_log (L"IOCTL_CDROM_RAW_READ CDDA returned %d\n", err);
+ ciw->cdda_play_finished = 1;
+ ciw->cdda_play = -1;
+ }
+ } else {
+ for (i = 0; i < num_sectors; i++) {
+ memcpy (ciw->subcode + i * 96, px[bufnum] + CD_RAW_SECTOR_WITH_SUBCODE_SIZE * i + 2352, 96);
+ }
+ for (i = 1; i < num_sectors; i++) {
+ memmove (px[bufnum] + 2352 * i, px[bufnum] + CD_RAW_SECTOR_WITH_SUBCODE_SIZE * i, 2352);
+ }
}
reseterrormode (unitnum);
- if (quit)
- break;
bufon[bufnum] = 1;
if (volume != ciw->cdda_volume || volume_main != currprefs.sound_volume) {
}
cdda_pos += num_sectors;
- if (cdda_pos >= ciw->cdda_end)
+ if (cdda_pos - num_sectors < ciw->cdda_end && cdda_pos >= ciw->cdda_end) {
ciw->cdda_play_finished = 1;
+ ciw->cdda_play = -1;
+ cdda_pos = ciw->cdda_end;
+ }
ciw->cd_last_pos = cdda_pos;
}
static int ioctl_ismedia (int unitnum, int quick)
{
if (!unitcheck (unitnum))
- return 0;
+ return -1;
if (quick) {
struct dev_info_ioctl *ciw = &ciw32[unitnum];
return ciw->mediainserted;
write_log (L"IOCTL: media change %c %d\n", driveletter, insert);
ciw32[i].mediainserted = insert;
scsi_do_disk_change (driveletter, insert);
+#ifdef RETROPLATFORM
+ rp_cd_change (i, insert ? 0 : 1);
+#endif
}
}
}
#include "blkdev.h"
#include "scsidev.h"
#include "gui.h"
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
#include <stddef.h>
TCHAR *drvpath;
TCHAR *name;
TCHAR *inquirydata;
+ TCHAR *ident;
int mediainserted;
HANDLE handle;
int isatapi;
{
struct dev_info_spti *dispti;
if (unitnum >= MAX_TOTAL_DEVICES || dev_info[unitnum].handle == INVALID_HANDLE_VALUE)
- return 0;
+ return NULL;
dispti = &dev_info[unitnum];
_tcscpy (di->label, dispti->name);
di->bus = 0;
write_log (L"SPTI: media change %c %d\n", driveletter, insert);
dev_info[i].mediainserted = now;
scsi_do_disk_change (i + 1, insert);
+#ifdef RETROPLATFORM
+ rp_cd_change (i, now ? 0 : 1);
+#endif
}
}
}
hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
- switch (currprefs.gfx_filter_filtermode & 1)
+ switch (currprefs.gfx_filter_bilinear)
{
case 0:
v = D3DTEXF_POINT;
l1 = (currprefs.gfx_filter_scanlineratio >> 0) & 15;
l2 = (currprefs.gfx_filter_scanlineratio >> 4) & 15;
+ if (l1 + l2 <= 0)
+ return;
hr = IDirect3DTexture9_LockRect (sltexture, 0, &locked, NULL, 0);
if (FAILED (hr)) {
write_log (L"SL IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
D3D_free ();
D3D_canshaders ();
d3d_enabled = 0;
- if (currprefs.gfx_filter != UAE_FILTER_DIRECT3D) {
+ if (!currprefs.gfx_api) {
_tcscpy (errmsg, L"D3D: not enabled");
return errmsg;
}
+
d3dx = LoadLibrary (L"d3dx9_42.dll");
if (d3dx == NULL) {
_tcscpy (errmsg, L"Direct3D: August 2009 or newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513");
tex_square, tex_pow2, tex_dynamic,
max_texture_w, max_texture_h);
+ t_w *= S2X_getmult ();
+ t_h *= S2X_getmult ();
+
if (max_texture_w < t_w || max_texture_h < t_h) {
_stprintf (errmsg, L"Direct3D: %d * %d or bigger texture support required\nYour card's maximum texture size is only %d * %d",
t_w, t_h, max_texture_w, max_texture_h);
hr = D3DXCreateSprite (d3ddev, &sprite);
if (FAILED (hr)) {
- write_log (L"LED D3DXSprite filaed: %s\n", D3D_ErrorString (hr));
+ write_log (L"LED D3DXSprite failed: %s\n", D3D_ErrorString (hr));
}
createscanlines (1);
D3D_render2 (0);
}
-int D3D_locktexture (void)
+uae_u8 *D3D_locktexture (int *pitch)
{
D3DLOCKED_RECT locked;
HRESULT hr;
ShowWindow (d3dhwnd, SW_MINIMIZE);
}
}
- return 0;
+ return NULL;
}
locked.pBits = NULL;
if (hr != D3DERR_DRIVERINTERNALERROR) {
write_log (L"IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
D3D_unlocktexture ();
- return 0;
+ return NULL;
}
}
if (locked.pBits == NULL || locked.Pitch == 0) {
write_log (L"IDirect3DTexture9_LockRect return NULL texture\n");
D3D_unlocktexture ();
- return 0;
+ return NULL;
}
- gfxvidinfo.bufmem = locked.pBits;
- gfxvidinfo.rowbytes = locked.Pitch;
- init_row_map ();
- return 1;
+ *pitch = locked.Pitch;
+ return locked.pBits;
}
void D3D_refresh (void)
extern void D3D_render (void);
extern void D3D_getpixelformat (int depth,int *rb, int *bb, int *gb, int *rs, int *bs, int *gs, int *ab, int *ar, int *a);
extern void D3D_refresh (void);
-extern int D3D_locktexture(void);
+extern uae_u8 *D3D_locktexture(int*);
extern void D3D_unlocktexture(void);
extern void D3D_guimode (int guion);
extern HDC D3D_getDC(HDC hdc);
#define IDS_RES_HIRES 357
#define IDS_RES_SUPERHIRES 358
#define IDS_PRINTER_EPSON48 359
+#define IDS_SELECTCD 360
+#define IDS_CD 361
#define IDS_QS_MODELS 1000
#define IDS_QS_MODEL_A500 1001
#define IDS_QS_MODEL_A500P 1002
#define IDC_PATHS_RIPS 1680
#define IDC_QUICKSTART_SETCONFIG 1681
#define IDC_CONFIGAUTO 1682
+#define IDC_CD0Q_TYPE 1682
#define IDC_DF0TEXTQ 1683
#define IDC_CONFIGNOLINK 1683
#define IDC_DF0WPQ 1684
#define IDC_DBG_CCR 1744
#define IDC_CS_NOEHB 1744
#define IDC_DBG_AMEM 1745
-#define IDC_CS_BLITTERBUG 1745
+#define IDC_CS_DIPAGNUS 1745
#define IDC_DBG_SP_VBR 1746
#define IDC_DBG_MMISC 1747
#define IDC_DBG_PC 1748
#define IDC_RTG_SCALE_ASPECTRATIO 1792
#define IDC_ASSOCIATE_ON 1792
#define IDC_RTG_VBLANKRATE 1793
+#define IDC_DF0WPTEXTQ 1793
+#define IDC_DF1WPTEXTQ 1794
+#define IDC_FILTERD3D 1795
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 354
#define _APS_NEXT_COMMAND_VALUE 40045
-#define _APS_NEXT_CONTROL_VALUE 1793
+#define _APS_NEXT_CONTROL_VALUE 1796
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
CONTROL "CIA ROM Overlay",IDC_CS_CIAOVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,95,80,10\r
CONTROL "KB Reset Warning",IDC_CS_RESETWARNING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,80,10\r
CONTROL "No-EHB Denise",IDC_CS_NOEHB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,159,80,10\r
- CONTROL "Blitter Busy Bug",IDC_CS_BLITTERBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,159,80,10\r
+ CONTROL "A1000 Agnus (8361)",IDC_CS_DIPAGNUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,159,94,10\r
END\r
\r
IDD_AVIOUTPUT DIALOGEX 0, 0, 288, 217\r
COMBOBOX IDC_FILTERASPECT,14,151,73,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Keep aspect ratio",IDC_FILTERKEEPASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,168,85,10\r
RTEXT "Automatic scaling:",-1,9,38,79,10,SS_CENTERIMAGE\r
- COMBOBOX IDC_FILTERAUTOSCALE,105,36,140,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_FILTERAUTOSCALE,132,36,83,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
COMBOBOX IDC_FILTERASPECT2,14,180,73,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ CONTROL "Direct3D",IDC_FILTERD3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,38,63,10\r
END\r
\r
IDD_HARDDRIVE DIALOGEX 0, 0, 380, 76\r
GROUPBOX "Host Configuration",IDC_QUICKSTART_HOST,3,91,294,33\r
RTEXT "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE\r
COMBOBOX IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- GROUPBOX "Emulated Floppy Drives",IDC_QUICKSTART_DF,3,126,294,84\r
- CONTROL "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,136,72,15\r
- PUSHBUTTON "Select disk image",IDC_DF0QQ,85,136,98,15\r
- RTEXT "Write-protected",IDC_STATIC,185,139,56,10,SS_CENTERIMAGE\r
+ GROUPBOX "Emulated Drives",IDC_QUICKSTART_DF,3,126,294,84\r
+ CONTROL "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,136,72,15\r
+ PUSHBUTTON "Select image file",IDC_DF0QQ,85,136,98,15\r
+ RTEXT "Write-protected",IDC_DF0WPTEXTQ,185,139,56,10,SS_CENTERIMAGE\r
CONTROL "",IDC_DF0WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,137,10,15\r
PUSHBUTTON "Eject",IDC_EJECT0Q,261,136,30,15\r
COMBOBOX IDC_DF0TEXTQ,9,154,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Floppy drive DF1:",IDC_DF1QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,172,71,15\r
- PUSHBUTTON "Select disk image",IDC_DF1QQ,85,172,98,15\r
- RTEXT "Write-protected",IDC_STATIC,185,175,55,10,SS_CENTERIMAGE\r
+ PUSHBUTTON "Select image file",IDC_DF1QQ,85,172,98,15\r
+ RTEXT "Write-protected",IDC_DF1WPTEXTQ,185,175,55,10,SS_CENTERIMAGE\r
CONTROL "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,173,10,15\r
PUSHBUTTON "Eject",IDC_EJECT1Q,261,172,30,15\r
COMBOBOX IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Set configuration",IDC_QUICKSTART_SETCONFIG,9,219,72,15,NOT WS_VISIBLE\r
GROUPBOX "Mode",IDC_STATIC,190,211,107,27,BS_LEFT\r
CONTROL "Start in Quickstart mode",IDC_QUICKSTARTMODE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,197,222,94,10\r
+ COMBOBOX IDC_CD0Q_TYPE,191,173,63,50,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP\r
END\r
\r
IDD_FRONTEND DIALOGEX 0, 0, 420, 242\r
IDS_RES_HIRES "Hires (normal)"\r
IDS_RES_SUPERHIRES "SuperHires"\r
IDS_PRINTER_EPSON48 "Epson Matrix Printer Emulation, 48pin"\r
+ IDS_SELECTCD "Select a CD image file..."\r
+ IDS_CD "CD image files"\r
END\r
\r
#endif // English (Neutral) resources\r
#include "filesys.h"
#include "savestate.h"
#include "gfxfilter.h"
+#include "blkdev.h"
static int initialized;
static RPGUESTINFO guestinfo;
rp_harddrive_image_change (num, uci->rootdir);
}
}
+ for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
+ int v = sys_command_ismedia (DF_IOCTL, i, 1);
+ if (v >= 0) {
+ struct device_info di = { 0 };
+ sys_command_info (DF_IOCTL, i, &di);
+ cd_mask |= 1 << i;
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
+ rp_cd_image_change (i, v == 0 ? L"" : di.ident);
+ }
+
+ }
rp_update_volume (&currprefs);
rp_turbo (currprefs.turbo_emulation);
{
rp_device_change (RP_DEVICE_HD, num, name);
}
+void rp_cd_image_change (int num, const TCHAR *name)
+{
+ rp_device_change (RP_DEVICE_CD, num, name);
+}
void rp_floppydrive_change (int num, int removed)
{
extern void rp_input_change (int num);
extern void rp_disk_image_change (int num, const TCHAR *name);
extern void rp_harddrive_image_change (int num, const TCHAR *name);
+extern void rp_cd_image_change (int num, const TCHAR *name);
return;
if (!_tcscmp (name, L"FloppyPath"))
_tcscat (out, L"..\\shared\\adf\\");
+ if (!_tcscmp (name, L"CDPath"))
+ _tcscat (out, L"..\\shared\\cd\\");
if (!_tcscmp (name, L"hdfPath"))
_tcscat (out, L"..\\shared\\hdf\\");
if (!_tcscmp (name, L"KickstartPath"))
_tcscat (out, L"Configurations\\");
if (start_data >= 0)
regquerystr (NULL, name, out, &size);
+ if (GetFileAttributes (out) == INVALID_FILE_ATTRIBUTES)
+ _tcscpy (out, start_path_data);
if (out[0] == '\\' && (_tcslen (out) >= 2 && out[1] != '\\')) { /* relative? */
_tcscpy (out, start_path_data);
if (start_data >= 0) {
_tcscpy (savestate_fname, path);
fetch_path (L"InputPath", path, sizeof (path) / sizeof (TCHAR));
createdir (path);
- regclosetree (read_disk_history ());
+ regclosetree (read_disk_history (HISTORY_FLOPPY));
+ regclosetree (read_disk_history (HISTORY_CD));
associate_init_extensions ();
read_rom_list ();
load_keyring (NULL, NULL);
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"Beta 4"
-#define WINUAEDATE MAKEBD(2010, 1, 16)
+#define WINUAEBETA L"Beta 5"
+#define WINUAEDATE MAKEBD(2010, 1, 22)
#define WINUAEEXTRA L""
#define WINUAEREV L""
#include "dxwrap.h"
#include "statusline.h"
#include "drawing.h"
+#include "direct3d.h"
#include <float.h>
{
{ UAE_FILTER_NULL, 0, 1, L"Null filter", L"null", 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
- { UAE_FILTER_DIRECT3D, 0, 1, L"Direct3D", L"direct3d", 1, 0, 0, 0, 0 },
-
-#ifdef OPENGL
- { UAE_FILTER_OPENGL, 0, 1, L"OpenGL (unsupported)", L"opengl", 1, 0, 0, 0, 0 },
-#endif
-
{ UAE_FILTER_SCALE2X, 0, 2, L"Scale2X", L"scale2x", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
{ UAE_FILTER_HQ, 0, 2, L"hq2x/3x/4x", L"hqx", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 },
static int cleartemp;
static uae_u32 rc[256], gc[256], bc[256];
static int deskw, deskh;
+static int d3d;
void getfilteroffset (int *dx, int *dy, int *mx, int *my)
{
int res_shift;
S2X_free ();
+ d3d = currprefs.gfx_api;
changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen | STATUSLINE_TARGET;
+ if (d3d)
+ dd = ad;
+
if (dd == 32)
alloc_colors_rgb (8, 8, 8, 16, 8, 0, 0, 0, 0, 0, rc, gc, bc);
else
amiga_depth = ad;
scale = mult;
- temp_width = dst_width * 3;
- if (temp_width > dxcaps.maxwidth)
- temp_width = dxcaps.maxwidth;
- temp_height = dst_height * 3;
- if (temp_height > dxcaps.maxheight)
- temp_height = dxcaps.maxheight;
- if (temp_width < dst_width)
- temp_width = dst_width;
- if (temp_height < dst_height)
- temp_height = dst_height;
+ if (d3d) {
+ temp_width = dst_width * mult;
+ temp_height = dst_height * mult;
+ } else {
+ temp_width = dst_width * 3;
+ if (temp_width > dxcaps.maxwidth)
+ temp_width = dxcaps.maxwidth;
+ temp_height = dst_height * 3;
+ if (temp_height > dxcaps.maxheight)
+ temp_height = dxcaps.maxheight;
+ if (temp_width < dst_width)
+ temp_width = dst_width;
+ if (temp_height < dst_height)
+ temp_height = dst_height;
+ }
if (usedfilter->type == UAE_FILTER_HQ) {
int w = amiga_width > dst_width ? amiga_width : dst_width;
int h = amiga_height > dst_height ? amiga_height : dst_height;
tempsurf2 = xmalloc (w * h * (amiga_depth / 8) * ((scale + 1) / 2));
tempsurf3 = xmalloc (w * h *(dst_depth / 8) * 4 * scale);
- tempsurf = allocsystemsurface (temp_width, temp_height);
+ if (!d3d)
+ tempsurf = allocsystemsurface (temp_width, temp_height);
} else {
- tempsurf = allocsurface (temp_width, temp_height);
+ if (!d3d)
+ tempsurf = allocsurface (temp_width, temp_height);
}
- if (!tempsurf)
+ if (!tempsurf && !d3d)
write_log (L"DDRAW: failed to create temp surface (%dx%d)\n", temp_width, temp_height);
}
RECT sr, dr, zr;
DDSURFACEDESC2 desc;
DWORD pitch;
+ uae_u8 *surfstart;
aw = amiga_width;
ah = amiga_height;
return;
if (aw < 16)
return;
- if (tempsurf == NULL)
- return;
sptr = gfxvidinfo.bufmem;
endsptr = gfxvidinfo.bufmemend;
bufmem_ptr = sptr;
- if (cleartemp) {
- clearsurface (tempsurf);
- cleartemp = 0;
+ if (d3d) {
+ surfstart = D3D_locktexture (&pitch);
+ if (surfstart == NULL)
+ return;
+ } else {
+ if (tempsurf == NULL)
+ return;
+ if (cleartemp) {
+ clearsurface (tempsurf);
+ cleartemp = 0;
+ }
+ if (!locksurface (tempsurf, &desc))
+ return;
+ pitch = desc.lPitch;
+ surfstart = (uae_u8*)desc.lpSurface;
}
- if (!locksurface (tempsurf, &desc))
- return;
- pitch = desc.lPitch;
- dptr = (uae_u8*)desc.lpSurface;
+ dptr = surfstart;
enddptr = dptr + pitch * temp_height;
- dptr = getfilterrect1 (&sr, &dr, dst_depth, aw, ah, scale, temp_width, temp_height, dptr, pitch);
+ if (!d3d) {
+ dptr = getfilterrect1 (&sr, &dr, dst_depth, aw, ah, scale, temp_width, temp_height, dptr, pitch);
+ }
if (!dptr) /* weird things can happen */
goto end;
- if (dptr < (uae_u8*)desc.lpSurface)
- goto endfail;
+ if (dptr < surfstart)
+ dptr = surfstart;
- if (usedfilter->type == UAE_FILTER_SCALE2X ) { /* 16+32/2X */
+ if (usedfilter->type == UAE_FILTER_SCALE2X) { /* 16+32/2X */
if (amiga_depth == 16 && dst_depth == 16) {
AdMame2x (sptr, gfxvidinfo.rowbytes, dptr, pitch, aw, ah);
}
-endfail:
-
if (ok == 0 && currprefs.gfx_filter) {
usedfilter = &uaefilters[0];
changed_prefs.gfx_filter = usedfilter->type;
}
end:
- unlocksurface (tempsurf);
-
- getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height);
- //write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
- OffsetRect (&sr, zr.left, zr.top);
- if (sr.left >= 0 && sr.top >= 0 && sr.right < temp_width && sr.bottom < temp_height) {
- if (sr.left < sr.right && sr.top < sr.bottom)
- DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr);
+ if (d3d) {
+ D3D_unlocktexture ();
+ } else {
+ unlocksurface (tempsurf);
+
+ getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height);
+ //write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
+ OffsetRect (&sr, zr.left, zr.top);
+ if (sr.left >= 0 && sr.top >= 0 && sr.right < temp_width && sr.bottom < temp_height) {
+ if (sr.left < sr.right && sr.top < sr.bottom)
+ DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr);
+ }
+ statusline ();
}
- statusline ();
}
void S2X_refresh (void)
S2X_render ();
}
+int S2X_getmult (void)
+{
+ int j, i;
+
+ if (!usedfilter)
+ return 1;
+ j = 0;
+ for (i = 1; i <= 4; i++) {
+ if (usedfilter->x[i])
+ j++;
+ }
+ i = currprefs.gfx_filter_filtermode;
+ if (i >= j)
+ i = 0;
+ j = 0;
+ while (i >= 0) {
+ while (!usedfilter->x[j])
+ j++;
+ if(i-- > 0)
+ j++;
+ }
+ return j;
+}
+
#endif
OGL_render ();
#endif
} else if (currentmode->flags & DM_D3D) {
+ if (currentmode->flags & DM_SWSCALE)
+ S2X_render ();
return;
#ifdef GFXFILTER
} else if (currentmode->flags & DM_SWSCALE) {
#ifdef D3D
if (D3D_needreset ())
WIN32GFX_DisplayChangeRequested ();
- ret = D3D_locktexture ();
+ if (currentmode->flags & DM_SWSCALE) {
+ ret = 1;
+ } else {
+ gfxvidinfo.bufmem = D3D_locktexture (&gfxvidinfo.rowbytes);
+ if (gfxvidinfo.bufmem) {
+ init_row_map ();
+ ret = 1;
+ }
+ }
#endif
} else if (currentmode->flags & DM_SWSCALE) {
ret = 1;
void unlockscr (void)
{
if (currentmode->flags & DM_D3D) {
-#ifdef D3D
+ if (currentmode->flags & DM_SWSCALE)
+ return;
D3D_unlocktexture ();
-#endif
} else if (currentmode->flags & DM_SWSCALE) {
return;
} else if (currentmode->flags & DM_DDRAW) {
if (currentmode->current_depth < 15)
currentmode->current_depth = 16;
}
- if (!screen_is_picasso) {
- if (usedfilter->type == UAE_FILTER_DIRECT3D) {
- flags |= DM_D3D;
- if (flags & DM_DX_FULLSCREEN) {
- flags &= ~DM_DX_FULLSCREEN;
- flags |= DM_D3D_FULLSCREEN;
- }
- flags &= ~DM_DDRAW;
- }
-#if defined (OPENGL)
- if (usedfilter->type == UAE_FILTER_OPENGL) {
- flags |= DM_OPENGL;
- flags &= ~DM_DDRAW;
- }
-#endif
- }
}
#endif
+ if (!screen_is_picasso) {
+ if (currprefs.gfx_api) {
+ flags |= DM_D3D;
+ if (flags & DM_DX_FULLSCREEN) {
+ flags &= ~DM_DX_FULLSCREEN;
+ flags |= DM_D3D_FULLSCREEN;
+ }
+ flags &= ~DM_DDRAW;
+ }
+ }
currentmode->flags = flags;
if (flags & DM_SWSCALE)
currentmode->fullfill = 1;
c |= currprefs.gfx_pvsync != changed_prefs.gfx_pvsync ? 2 | 16 : 0;
c |= currprefs.gfx_refreshrate != changed_prefs.gfx_refreshrate ? 2 | 16 : 0;
c |= currprefs.gfx_autoresolution != changed_prefs.gfx_autoresolution ? (2|8) : 0;
+ c |= currprefs.gfx_api != changed_prefs.gfx_api ? (1|8) : 0;
c |= currprefs.gfx_filter != changed_prefs.gfx_filter ? (2|8) : 0;
c |= _tcscmp (currprefs.gfx_filtershader, changed_prefs.gfx_filtershader) ? (2|8|32) : 0;
c |= currprefs.gfx_filter_filtermode != changed_prefs.gfx_filter_filtermode ? (2|8|32) : 0;
+ c |= currprefs.gfx_filter_bilinear != changed_prefs.gfx_filter_bilinear ? (2|8|32) : 0;
c |= currprefs.gfx_filter_horiz_zoom_mult != changed_prefs.gfx_filter_horiz_zoom_mult ? (1|8) : 0;
c |= currprefs.gfx_filter_vert_zoom_mult != changed_prefs.gfx_filter_vert_zoom_mult ? (1|8) : 0;
c |= currprefs.gfx_filter_noise != changed_prefs.gfx_filter_noise ? (1|8) : 0;
currprefs.gfx_autoresolution = changed_prefs.gfx_autoresolution;
currprefs.color_mode = changed_prefs.color_mode;
+ currprefs.gfx_api = changed_prefs.gfx_api;
if (changed_prefs.gfx_afullscreen == 1) {
- if (currprefs.gfx_filter == UAE_FILTER_DIRECT3D && changed_prefs.gfx_filter != UAE_FILTER_DIRECT3D)
- display_change_requested = 1;
-#ifdef OPENGL
- if (currprefs.gfx_filter == UAE_FILTER_OPENGL && changed_prefs.gfx_filter != UAE_FILTER_OPENGL)
- display_change_requested = 1;
- if (changed_prefs.gfx_filter == UAE_FILTER_OPENGL && currprefs.gfx_filter != UAE_FILTER_OPENGL)
- display_change_requested = 1;
-#endif
- if (changed_prefs.gfx_filter == UAE_FILTER_DIRECT3D && currprefs.gfx_filter != UAE_FILTER_DIRECT3D)
+ if (currprefs.gfx_api != changed_prefs.gfx_api)
display_change_requested = 1;
}
currprefs.gfx_filter = changed_prefs.gfx_filter;
_tcscpy (currprefs.gfx_filtershader, changed_prefs.gfx_filtershader);
currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
+ currprefs.gfx_filter_bilinear = changed_prefs.gfx_filter_bilinear;
currprefs.gfx_filter_horiz_zoom_mult = changed_prefs.gfx_filter_horiz_zoom_mult;
currprefs.gfx_filter_vert_zoom_mult = changed_prefs.gfx_filter_vert_zoom_mult;
currprefs.gfx_filter_noise = changed_prefs.gfx_filter_noise;
updatemodes ();
update_gfxparams ();
clearscreen ();
- if (currprefs.gfx_afullscreen != currprefs.gfx_pfullscreen ||
- (currprefs.gfx_afullscreen == 1 && (currprefs.gfx_filter == UAE_FILTER_DIRECT3D
-#ifdef OPENGL
- || currprefs.gfx_filter == UAE_FILTER_OPENGL
-#endif
- ))) {
- mode = 1;
+ if (currprefs.gfx_afullscreen != currprefs.gfx_pfullscreen || (currprefs.gfx_afullscreen == 1 && currprefs.gfx_api)) {
+ mode = 1;
} else {
mode = modeswitchneeded (&wc);
if (!mode)
currentmode->amiga_width = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
currentmode->amiga_height = AMIGA_HEIGHT_MAX << (currprefs.gfx_linedbl ? 1 : 0);
if (usedfilter) {
- if (usedfilter->x[0]) {
- currentmode->current_depth = (currprefs.gfx_filter_filtermode / 2) ? 32 : 16;
+ mult = S2X_getmult ();
+ if ((usedfilter->x[mult] & (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) == (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) {
+ currentmode->current_depth = currentmode->native_depth;
} else {
- int j, i;
- j = 0;
- for (i = 1; i <= 4; i++) {
- if (usedfilter->x[i])
- j++;
- }
- i = currprefs.gfx_filter_filtermode;
- if (i >= j)
- i = 0;
- j = 0;
- while (i >= 0) {
- while (!usedfilter->x[j])
- j++;
- if(i-- > 0)
- j++;
- }
- if ((usedfilter->x[j] & (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) == (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) {
- currentmode->current_depth = currentmode->native_depth;
- } else {
- currentmode->current_depth = (usedfilter->x[j] & UAE_FILTER_MODE_16) ? 16 : 32;
- }
- mult = j;
+ currentmode->current_depth = (usedfilter->x[mult] & UAE_FILTER_MODE_32) ? 32 : 16;
}
}
currentmode->pitch = currentmode->amiga_width * currentmode->current_depth >> 3;
;
- } else if (!(currentmode->flags & DM_SWSCALE)) {
-
- int size = currentmode->amiga_width * currentmode->amiga_height * gfxvidinfo.pixbytes;
- gfxvidinfo.realbufmem = xmalloc (size);
- gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
- gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
- gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size;
-
- } else if (!(currentmode->flags & DM_D3D)) {
+ } else if (currentmode->flags & DM_SWSCALE) {
int w = currentmode->amiga_width * 2;
int h = currentmode->amiga_height * 2;
gfxvidinfo.rowbytes = w * 2 * gfxvidinfo.pixbytes;
gfxvidinfo.bufmemend = gfxvidinfo.realbufmem + size - gfxvidinfo.rowbytes;
+ } else if (currentmode->flags & DM_D3D) {
+
+ int size = currentmode->amiga_width * currentmode->amiga_height * gfxvidinfo.pixbytes;
+ gfxvidinfo.realbufmem = xmalloc (size);
+ gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
+ gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
+ gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size;
+
}
init_row_map ();
#define USS_FORMAT_STRING_SAVE L"(*.uss)\0*.uss\0"
#define HDF_FORMAT_STRING L"(*.hdf;*.vhd;*.rdf;*.hdz;*.rdz)\0*.hdf;*.vhd;*.rdf;*.hdz;*.rdz\0"
#define INP_FORMAT_STRING L"(*.inp)\0*.inp\0"
+#define CD_FORMAT_STRING L"(*.cue;*.iso)\0*.cue;*.iso\0"
#define CONFIG_HOST L"Host"
#define CONFIG_HARDWARE L"Hardware"
LoadString (hInst, id, string, dwStringLen);
}
+static DWORD quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
+static DWORD quickstart_floppy = 1, quickstart_cd = 0;
+static DWORD quickstart_cdtype = 0;
+static int quickstart_ok, quickstart_ok_floppy;
+static void addfloppytype (HWND hDlg, int n);
+static void addfloppyhistory (HWND hDlg);
+
static int C_PAGES;
#define MAX_C_PAGES 30
static int LOADSAVE_ID = -1, MEMORY_ID = -1, KICKSTART_ID = -1, CPU_ID = -1,
SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
EnableWindow (w, !!enable);
}
+static void hide (HWND hDlg, DWORD id, int hide)
+{
+ HWND w;
+ if (id < 0)
+ return;
+ w = GetDlgItem (hDlg, id);
+ if (!w)
+ return;
+ if (hide && w == GetFocus ())
+ SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
+ ShowWindow (w, hide ? SW_HIDE : SW_SHOW);
+}
+
static int CALLBACK BrowseForFolderCallback (HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
return val;
}
-void write_disk_history (void)
+static void write_disk_history2 (int type)
{
int i, j;
TCHAR tmp[16];
UAEREG *fkey;
- fkey = regcreatetree (NULL, L"DiskImageMRUList");
+ fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList");
if (fkey == NULL)
return;
j = 1;
for (i = 0; i <= MAX_PREVIOUS_FLOPPIES; i++) {
- TCHAR *s = DISK_history_get (i);
+ TCHAR *s = DISK_history_get (i, type);
if (s == 0 || _tcslen (s) == 0)
continue;
_stprintf (tmp, L"Image%02d", j);
}
regclosetree (fkey);
}
+void write_disk_history (void)
+{
+ write_disk_history2 (HISTORY_FLOPPY);
+ write_disk_history2 (HISTORY_CD);
+}
void reset_disk_history (void)
{
int i;
- for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++)
- DISK_history_add (NULL, i, 0);
+ for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
+ DISK_history_add (NULL, i, HISTORY_FLOPPY, 0);
+ DISK_history_add (NULL, i, HISTORY_CD, 0);
+ }
write_disk_history ();
}
-UAEREG *read_disk_history (void)
+UAEREG *read_disk_history (int type)
{
static int regread;
TCHAR tmp2[1000];
TCHAR tmp[1000];
DWORD size;
- fkey = regcreatetree (NULL, L"DiskImageMRUList");
- if (fkey == NULL || regread)
+ fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList");
+ if (fkey == NULL || (regread & (1 << type)))
return fkey;
idx = 0;
if (_tcslen (tmp) == 7) {
idx2 = _tstol (tmp + 5) - 1;
if (idx2 >= 0)
- DISK_history_add (tmp2, idx2, TRUE);
+ DISK_history_add (tmp2, idx2, type, TRUE);
}
idx++;
}
- regread = 1;
+ regread |= 1 << type;
return fkey;
}
updatewinfsmode (&changed_prefs);
}
+static int iscd (int n)
+{
+ if (quickstart_cd && n == 1)
+ return 1;
+ return 0;
+}
+
static const GUID diskselectionguids[] = {
{ 0x4fa8fa15, 0xc209, 0x4112, { 0x94, 0x7b, 0xc6, 0x00, 0x8e, 0x1f, 0xa3, 0x29 } },
{ 0x32073f09, 0x752d, 0x4783, { 0x84, 0x6c, 0xaa, 0x66, 0x48, 0x84, 0x14, 0x45 } },
{ 0x8047f7ea, 0x8a42, 0x4695, { 0x94, 0x52, 0xf5, 0x0d, 0xb8, 0x43, 0x00, 0x58 } },
{ 0x2412c4e7, 0xf608, 0x4333, { 0x83, 0xd2, 0xa1, 0x2f, 0xdf, 0x66, 0xac, 0xe5 } },
{ 0xe3741dff, 0x11f2, 0x445f, { 0x94, 0xb0, 0xa3, 0xe7, 0x58, 0xe2, 0xcb, 0xb5 } },
- { 0x2056d641, 0xba13, 0x4312, { 0xaa, 0x75, 0xc5, 0xeb, 0x52, 0xa8, 0x1c, 0xe3 } }
+ { 0x2056d641, 0xba13, 0x4312, { 0xaa, 0x75, 0xc5, 0xeb, 0x52, 0xa8, 0x1c, 0xe3 } },
+ { 0x05aa5db2, 0x470b, 0x4725, { 0x96, 0x03, 0xee, 0x61, 0x30, 0xfc, 0x54, 0x99 } }
};
+
static void getfilter (int num, TCHAR *name, int *filter, TCHAR *fname)
{
_tcscpy (fname, name);
return FALSE;
}
+static void selectdisk (struct uae_prefs *prefs, HWND hDlg, int num, int id, TCHAR *full_path)
+{
+ SetDlgItemText (hDlg, id, full_path);
+ if (iscd (num)) {
+ _tcscpy (prefs->cdimagefile, full_path);
+ DISK_history_add (full_path, -1, HISTORY_CD, 0);
+ } else {
+ _tcscpy(prefs->df[num], full_path);
+ DISK_history_add (full_path, -1, HISTORY_FLOPPY, 0);
+ }
+}
+
// Common routine for popping up a file-requester
// flag - 0 for floppy loading, 1 for floppy creation, 2 for loading hdf, 3 for saving hdf
// flag = 14 for loading filesystem
// flag = 15 for loading input
// flag = 16 for recording input
+// flag = 17 for CD image
int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, TCHAR *path_out, int *multi)
{
static int previousfilter[20];
fetch_path (L"InputPath", init_path, sizeof (init_path) / sizeof (TCHAR));
guid = &diskselectionguids[5];
break;
+ case 17:
+ getfilter(flag, L"CDPath", previousfilter, filtername);
+ fetch_path (L"CDPath", init_path, sizeof (init_path) / sizeof (TCHAR));
+ guid = &diskselectionguids[6];
+ break;
}
}
_tcscpy (szFilter + _tcslen (szFilter) + 1, ARCHIVE_STRING);
initialdir = path_out;
break;
+ case 17:
+ WIN32GUI_LoadUIString (IDS_SELECTCD, szTitle, MAX_DPATH);
+ WIN32GUI_LoadUIString (IDS_CD, szFormat, MAX_DPATH);
+ _stprintf (szFilter, L"%s ", szFormat);
+ memcpy (szFilter + _tcslen (szFilter), CD_FORMAT_STRING, sizeof (CD_FORMAT_STRING) + sizeof (TCHAR));
+ defext = L"CUE";
+ break;
}
if (all) {
p = szFilter;
break;
case IDC_DF0:
case IDC_DF0QQ:
- SetDlgItemText (hDlg, IDC_DF0TEXT, full_path);
- _tcscpy(prefs->df[0], full_path);
- DISK_history_add (full_path, -1, 0);
+ selectdisk (prefs, hDlg, 0, IDC_DF0TEXT, full_path);
next = IDC_DF1;
break;
case IDC_DF1:
case IDC_DF1QQ:
- SetDlgItemText (hDlg, IDC_DF1TEXT, full_path);
- _tcscpy(prefs->df[1], full_path);
- DISK_history_add (full_path, -1, 0);
+ selectdisk (prefs, hDlg, 1, IDC_DF1TEXT, full_path);
next = IDC_DF2;
break;
case IDC_DF2:
- SetDlgItemText (hDlg, IDC_DF2TEXT, full_path);
- _tcscpy(prefs->df[2], full_path);
- DISK_history_add (full_path, -1, 0);
+ selectdisk (prefs, hDlg, 2, IDC_DF2TEXT, full_path);
next = IDC_DF3;
break;
case IDC_DF3:
- SetDlgItemText (hDlg, IDC_DF3TEXT, full_path);
- _tcscpy (prefs->df[3], full_path);
- DISK_history_add (full_path, -1, 0);
+ selectdisk (prefs, hDlg, 3, IDC_DF3TEXT, full_path);
break;
case IDC_DOSAVESTATE:
case IDC_DOLOADSTATE:
*amiga_path = 0;
regsetstr (NULL, L"hdfPath", openFileName.lpstrFile);
}
+ } else if (flag == 17) {
+ amiga_path = _tcsstr (openFileName.lpstrFile, openFileName.lpstrFileTitle);
+ if (amiga_path && amiga_path != openFileName.lpstrFile) {
+ *amiga_path = 0;
+ regsetstr (NULL, L"CDPath", openFileName.lpstrFile);
+ }
}
}
if (!multi)
{ -1 }
};
-static DWORD quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1, quickstart_floppy = 1;
-static int quickstart_ok, quickstart_ok_floppy;
-static void addfloppytype (HWND hDlg, int n);
-static void addfloppyhistory (HWND hDlg);
-
static void enable_for_quickstart (HWND hDlg)
{
int v = quickstart_ok && quickstart_ok_floppy ? TRUE : FALSE;
ew (guiDlg, IDC_RESETAMIGA, FALSE);
workprefs.nr_floppies = quickstart_floppy;
quickstart_ok = built_in_prefs (&workprefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck);
+ quickstart_cd = workprefs.dfxtype[0] == DRV_NONE;
enable_for_quickstart (hDlg);
addfloppytype (hDlg, 0);
addfloppytype (hDlg, 1);
regqueryint (NULL, L"QuickStartConfiguration", &quickstart_conf);
regqueryint (NULL, L"QuickStartCompatibility", &quickstart_compa);
regqueryint (NULL, L"QuickStartFloppies", &quickstart_floppy);
+ regqueryint (NULL, L"QuickStartCDType", &quickstart_cdtype);
if (quickstart) {
workprefs.df[0][0] = 0;
workprefs.df[1][0] = 0;
workprefs.df[2][0] = 0;
workprefs.df[3][0] = 0;
+ workprefs.cdimagefile[0] = 0;
load_quickstart (hDlg, 1);
quickstarthost (hDlg, hostconf);
}
ew (hDlg, IDC_QUICKSTART_COMPATIBILITY, i > 1);
SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETRANGE, TRUE, MAKELONG (0, i > 1 ? i - 1 : 1));
SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPAGESIZE, 0, 1);
- SendDlgItemMessage( hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPOS, TRUE, quickstart_compa);
+ SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPOS, TRUE, quickstart_compa);
SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_RESETCONTENT, 0, 0L);
WIN32GUI_LoadUIString (IDS_DEFAULT_HOST, tmp1, sizeof (tmp1) / sizeof (TCHAR));
case IDC_QUICKSTARTMODE:
quickstart = IsDlgButtonChecked (hDlg, IDC_QUICKSTARTMODE);
regsetint (NULL, L"QuickStartMode", quickstart);
+ quickstart_cd = 0;
if (quickstart) {
init_quickstartdlg (hDlg);
load_quickstart (hDlg, 0);
case 4:
*fs = 2;
if (workprefs.gfx_filter == 0 && *fs != ofs) {
- if (D3D_goodenough ()) {
- workprefs.gfx_filter = 2;
- workprefs.gfx_filter_filtermode = 2;
- } else {
- workprefs.gfx_filter = 1;
- }
+ workprefs.gfx_filter = 1;
workprefs.gfx_filter_horiz_zoom = 0;
workprefs.gfx_filter_vert_zoom = 0;
workprefs.gfx_filter_horiz_zoom_mult = 0;
CheckDlgButton (hDlg, IDC_CS_COMPATIBLE, workprefs.cs_compatible);
CheckDlgButton (hDlg, IDC_CS_RESETWARNING, workprefs.cs_resetwarning);
CheckDlgButton (hDlg, IDC_CS_NOEHB, workprefs.cs_denisenoehb);
- CheckDlgButton (hDlg, IDC_CS_BLITTERBUG, workprefs.cs_agnusbltbusybug);
+ CheckDlgButton (hDlg, IDC_CS_DIPAGNUS, workprefs.cs_dipagnus);
CheckDlgButton (hDlg, IDC_CS_KSMIRROR_E0, workprefs.cs_ksmirror_e0);
CheckDlgButton (hDlg, IDC_CS_KSMIRROR_A8, workprefs.cs_ksmirror_a8);
CheckDlgButton (hDlg, IDC_CS_CIAOVERLAY, workprefs.cs_ciaoverlay);
workprefs.cs_compatible = IsDlgButtonChecked (hDlg, IDC_CS_COMPATIBLE);
workprefs.cs_resetwarning = IsDlgButtonChecked (hDlg, IDC_CS_RESETWARNING);
workprefs.cs_denisenoehb = IsDlgButtonChecked (hDlg, IDC_CS_NOEHB);
- workprefs.cs_agnusbltbusybug = IsDlgButtonChecked (hDlg, IDC_CS_BLITTERBUG);
+ workprefs.cs_dipagnus = IsDlgButtonChecked (hDlg, IDC_CS_DIPAGNUS);
+ workprefs.cs_agnusbltbusybug = workprefs.cs_dipagnus;
workprefs.cs_ksmirror_e0 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_E0);
workprefs.cs_ksmirror_a8 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_A8);
workprefs.cs_ciaoverlay = IsDlgButtonChecked (hDlg, IDC_CS_CIAOVERLAY);
ew (hDlg, IDC_CS_CDTVRAMEXP, e);
ew (hDlg, IDC_CS_RESETWARNING, e);
ew (hDlg, IDC_CS_NOEHB, e);
- ew (hDlg, IDC_CS_BLITTERBUG, e);
+ ew (hDlg, IDC_CS_DIPAGNUS, e);
ew (hDlg, IDC_CS_KSMIRROR_E0, e);
ew (hDlg, IDC_CS_KSMIRROR_A8, e);
ew (hDlg, IDC_CS_CIAOVERLAY, e);
SetDlgItemText (hDlg, IDC_FLOPPYSPDTEXT, txt);
}
-#define BUTTONSPERFLOPPY 7
+#define BUTTONSPERFLOPPY 8
static int floppybuttons[][BUTTONSPERFLOPPY] = {
- { IDC_DF0TEXT,IDC_DF0,IDC_EJECT0,IDC_DF0TYPE,IDC_DF0WP,IDC_SAVEIMAGE0,IDC_DF0ENABLE },
- { IDC_DF1TEXT,IDC_DF1,IDC_EJECT1,IDC_DF1TYPE,IDC_DF1WP,IDC_SAVEIMAGE1,IDC_DF1ENABLE },
- { IDC_DF2TEXT,IDC_DF2,IDC_EJECT2,IDC_DF2TYPE,IDC_DF2WP,IDC_SAVEIMAGE2,IDC_DF2ENABLE },
- { IDC_DF3TEXT,IDC_DF3,IDC_EJECT3,IDC_DF3TYPE,IDC_DF3WP,IDC_SAVEIMAGE3,IDC_DF3ENABLE }
+ { IDC_DF0TEXT,IDC_DF0,IDC_EJECT0,IDC_DF0TYPE,IDC_DF0WP,-1,IDC_SAVEIMAGE0,IDC_DF0ENABLE },
+ { IDC_DF1TEXT,IDC_DF1,IDC_EJECT1,IDC_DF1TYPE,IDC_DF1WP,-1,IDC_SAVEIMAGE1,IDC_DF1ENABLE },
+ { IDC_DF2TEXT,IDC_DF2,IDC_EJECT2,IDC_DF2TYPE,IDC_DF2WP,-1,IDC_SAVEIMAGE2,IDC_DF2ENABLE },
+ { IDC_DF3TEXT,IDC_DF3,IDC_EJECT3,IDC_DF3TYPE,IDC_DF3WP,-1,IDC_SAVEIMAGE3,IDC_DF3ENABLE }
};
static int floppybuttonsq[][BUTTONSPERFLOPPY] = {
- { IDC_DF0TEXTQ,IDC_DF0QQ,IDC_EJECT0Q,-1,IDC_DF0WPQ,-1,IDC_DF0QENABLE },
- { IDC_DF1TEXTQ,IDC_DF1QQ,IDC_EJECT1Q,-1,IDC_DF1WPQ,-1,IDC_DF1QENABLE },
+ { IDC_DF0TEXTQ,IDC_DF0QQ,IDC_EJECT0Q,-1,IDC_DF0WPQ,IDC_DF0WPTEXTQ,-1,IDC_DF0QENABLE },
+ { IDC_DF1TEXTQ,IDC_DF1QQ,IDC_EJECT1Q,-1,IDC_DF1WPQ,IDC_DF1WPTEXTQ,-1,IDC_DF1QENABLE },
{ -1,-1,-1,-1,-1,-1,-1 },
{ -1,-1,-1,-1,-1,-1,-1 }
};
SendMessage (ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
}
-static void addfloppyhistory_2 (HWND hDlg, UAEREG *fkey, int n, int f_text)
+static void addfloppyhistory_2 (HWND hDlg, int n, int f_text)
{
int i, j;
- TCHAR *s;
- int nn = workprefs.dfxtype[n] + 1;
+ TCHAR *s, *text;
+ UAEREG *fkey;
+ int nn, type;
if (f_text < 0)
return;
SendDlgItemMessage (hDlg, f_text, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage (hDlg, f_text, WM_SETTEXT, 0, (LPARAM)workprefs.df[n]);
+ if (iscd (n)) {
+ nn = 1;
+ type = HISTORY_CD;
+ text = workprefs.cdimagefile;
+ } else {
+ nn = workprefs.dfxtype[n] + 1;
+ type = HISTORY_FLOPPY;
+ text = workprefs.df[n];
+ }
+ fkey = read_disk_history (type);
+ if (fkey == NULL)
+ return;
+ SendDlgItemMessage (hDlg, f_text, WM_SETTEXT, 0, (LPARAM)text);
i = 0;
- while (s = DISK_history_get (i)) {
+ while (s = DISK_history_get (i, type)) {
TCHAR tmpname[MAX_DPATH], tmppath[MAX_DPATH], *p, *p2;
if (_tcslen (s) == 0)
break;
}
if (f_text >= 0)
SendDlgItemMessage (hDlg, f_text, CB_ADDSTRING, 0, (LPARAM)tmpname);
- if (!_tcscmp (workprefs.df[n], s)) {
+ if (!_tcscmp (text, s)) {
if (f_text >= 0)
SendDlgItemMessage (hDlg, f_text, CB_SETCURSEL, i - 1, 0);
}
if (nn <= 0)
break;
}
+ regclosetree (fkey);
}
static void addfloppyhistory (HWND hDlg)
{
- UAEREG *fkey;
int f_text, max, n;
if (currentpage == QUICKSTART_ID)
max = 1;
else
return;
- fkey = read_disk_history ();
for (n = 0; n < max; n++) {
if (currentpage == QUICKSTART_ID)
f_text = floppybuttonsq[n][0];
f_text = floppybuttons[n][0];
else
f_text = IDC_DISKTEXT;
- addfloppyhistory_2 (hDlg, fkey, n, f_text);
+ addfloppyhistory_2 (hDlg, n, f_text);
+ }
+}
+
+static void ejectfloppy (int n)
+{
+ if (iscd (n)) {
+ workprefs.cdimagefile[0] = 0;
+ quickstart_cdtype = 0;
+ } else {
+ workprefs.df[n][0] = 0;
}
- regclosetree (fkey);
}
static void addfloppytype (HWND hDlg, int n)
{
int state, chk;
int nn = workprefs.dfxtype[n] + 1;
+ int showcd = 0;
+ TCHAR *text;
int f_text = floppybuttons[n][0];
int f_drive = floppybuttons[n][1];
int f_eject = floppybuttons[n][2];
int f_type = floppybuttons[n][3];
int f_wp = floppybuttons[n][4];
- int f_si = floppybuttons[n][5];
- int f_enable = floppybuttons[n][6];
+ int f_wptext = floppybuttons[n][5];
+ int f_si = floppybuttons[n][6];
+ int f_enable = floppybuttons[n][7];
+ text = workprefs.df[n];
if (currentpage == QUICKSTART_ID) {
f_text = floppybuttonsq[n][0];
f_drive = floppybuttonsq[n][1];
f_type = -1;
f_eject = floppybuttonsq[n][2];
f_wp = floppybuttonsq[n][4];
+ f_wptext = floppybuttonsq[n][5];
f_si = -1;
- f_enable = floppybuttonsq[n][6];
+ f_enable = floppybuttonsq[n][7];
+ if (iscd (n))
+ showcd = 1;
+ if (showcd) {
+ nn = 1;
+ hide (hDlg, f_wp, 1);
+ hide (hDlg, f_wptext, 1);
+ ew (hDlg, f_enable, FALSE);
+ SetWindowText (GetDlgItem (hDlg, f_enable), L"CD");
+ SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_ADDSTRING, 0, (LPARAM)L"Autodetect");
+ SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_ADDSTRING, 0, (LPARAM)L"Image file");
+ if (workprefs.cdimagefile[0])
+ quickstart_cdtype = 1;
+ SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_SETCURSEL, quickstart_cdtype, 0);
+ hide (hDlg, IDC_CD0Q_TYPE, 0);
+ text = workprefs.cdimagefile;
+ } else {
+ hide (hDlg, f_wp, 0);
+ hide (hDlg, f_wptext, 0);
+ }
+ }
+ if (!showcd && f_enable > 0 && n == 1 && currentpage == QUICKSTART_ID) {
+ ew (hDlg, f_enable, TRUE);
+ SetWindowText (GetDlgItem (hDlg, f_enable), L"Floppy drive DF1:");
+ hide (hDlg, IDC_CD0Q_TYPE, 1);
}
if (nn <= 0)
if (f_type >= 0)
SendDlgItemMessage (hDlg, f_type, CB_SETCURSEL, nn, 0);
if (f_si >= 0)
- ShowWindow (GetDlgItem(hDlg, f_si), zfile_exists (DISK_get_saveimagepath (workprefs.df[n])) ? SW_SHOW : SW_HIDE);
+ ShowWindow (GetDlgItem(hDlg, f_si), !showcd && zfile_exists (DISK_get_saveimagepath (text)) ? SW_SHOW : SW_HIDE);
if (f_text >= 0)
ew (hDlg, f_text, state);
if (f_drive >= 0)
ew (hDlg, f_drive, state);
if (f_enable >= 0) {
- if (currentpage == QUICKSTART_ID)
- ew (hDlg, f_enable, n > 0 && workprefs.nr_floppies > 0);
- else
+ if (currentpage == QUICKSTART_ID) {
+ ew (hDlg, f_enable, (n > 0 && workprefs.nr_floppies > 0) && !showcd);
+ } else {
ew (hDlg, f_enable, TRUE);
+ }
CheckDlgButton(hDlg, f_enable, state ? BST_CHECKED : BST_UNCHECKED);
}
- chk = disk_getwriteprotect (workprefs.df[n]) && state == TRUE ? BST_CHECKED : 0;
+ chk = !showcd && disk_getwriteprotect (text) && state == TRUE ? BST_CHECKED : 0;
if (f_wp >= 0)
CheckDlgButton(hDlg, f_wp, chk);
- chk = state && DISK_validate_filename (workprefs.df[n], 0, NULL, NULL) ? TRUE : FALSE;
- if (f_wp >= 0)
+ chk = !showcd && state && DISK_validate_filename (text, 0, NULL, NULL) ? TRUE : FALSE;
+ if (f_wp >= 0) {
ew (hDlg, f_wp, chk);
+ ew (hDlg, f_wptext, chk);
+ }
}
static void getfloppytype (HWND hDlg, int n)
}
static void getfloppytypeq (HWND hDlg, int n)
{
- int f_enable = currentpage == QUICKSTART_ID ? floppybuttonsq[n][6] : floppybuttons[n][6];
+ int f_enable = currentpage == QUICKSTART_ID ? floppybuttonsq[n][7] : floppybuttons[n][7];
int chk;
if (f_enable <= 0 || (n == 0 && currentpage == QUICKSTART_ID))
return;
+ if (iscd (n))
+ return;
chk = IsDlgButtonChecked (hDlg, f_enable) ? 0 : -1;
if (chk != workprefs.dfxtype[n]) {
workprefs.dfxtype[n] = chk;
}
}
-static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen)
+static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen, int type)
{
LRESULT val;
TCHAR *p1, *p2, *p;
}
xfree (tmp);
i = 0;
- while ((p = DISK_history_get (i))) {
+ while ((p = DISK_history_get (i, type))) {
if (!_tcscmp (p, out)) {
- DISK_history_add (out, -1, 0);
+ DISK_history_add (out, -1, type, 0);
break;
}
i++;
static void getfloppyname (HWND hDlg, int n)
{
int f_text = currentpage == QUICKSTART_ID ? floppybuttonsq[n][0] : floppybuttons[n][0];
+ int cd = iscd (n);
TCHAR tmp[MAX_DPATH];
- if (getfloppybox (hDlg, f_text, tmp, sizeof (tmp) / sizeof (TCHAR))) {
- disk_insert (n, tmp);
- _tcscpy (workprefs.df[n], tmp);
+ if (getfloppybox (hDlg, f_text, tmp, sizeof (tmp) / sizeof (TCHAR), cd ? HISTORY_CD : HISTORY_FLOPPY)) {
+ if (!cd) {
+ disk_insert (n, tmp);
+ _tcscpy (workprefs.df[n], tmp);
+ } else {
+ _tcscpy (workprefs.cdimagefile, tmp);
+ }
}
}
static void floppysetwriteprotect (HWND hDlg, int n, int protect)
{
- disk_setwriteprotect (n, workprefs.df[n], protect);
- addfloppytype (hDlg, n);
+ if (!iscd (n)) {
+ disk_setwriteprotect (n, workprefs.df[n], protect);
+ addfloppytype (hDlg, n);
+ }
}
static void deletesaveimage (HWND hDlg, int num)
{
- TCHAR *p = DISK_get_saveimagepath (workprefs.df[num]);
+ TCHAR *p;
+ if (!iscd (num))
+ return;
+ p = DISK_get_saveimagepath (workprefs.df[num]);
if (zfile_exists (p)) {
DeleteFile (p);
DISK_reinsert (num);
static void diskselect (HWND hDlg, WPARAM wParam, struct uae_prefs *p, int drv, TCHAR *defaultpath)
{
- MultiDiskSelection (hDlg, wParam, 0, &workprefs, defaultpath);
- disk_insert (0, p->df[0]);
- disk_insert (1, p->df[1]);
- disk_insert (2, p->df[2]);
- disk_insert (3, p->df[3]);
+ int cd = iscd (drv);
+ MultiDiskSelection (hDlg, wParam, cd ? 17 : 0, &workprefs, defaultpath);
+ if (!cd) {
+ disk_insert (0, p->df[0]);
+ disk_insert (1, p->df[1]);
+ disk_insert (2, p->df[2]);
+ disk_insert (3, p->df[3]);
+ }
addfloppytype (hDlg, drv);
addfloppyhistory (hDlg);
}
case IDC_EJECT0Q:
SetDlgItemText (hDlg, IDC_DF0TEXT, L"");
SetDlgItemText (hDlg, IDC_DF0TEXTQ, L"");
- workprefs.df[0][0] = 0;
+ ejectfloppy (0);
addfloppytype (hDlg, 0);
break;
case IDC_EJECT1:
case IDC_EJECT1Q:
SetDlgItemText (hDlg, IDC_DF1TEXT, L"");
SetDlgItemText (hDlg, IDC_DF1TEXTQ, L"");
- workprefs.df[1][0] = 0;
+ ejectfloppy (1);
addfloppytype (hDlg, 1);
break;
case IDC_EJECT2:
SetDlgItemText (hDlg, IDC_DF2TEXT, L"");
- workprefs.df[2][0] = 0;
+ ejectfloppy (2);
addfloppytype (hDlg, 2);
break;
case IDC_EJECT3:
SetDlgItemText (hDlg, IDC_DF3TEXT, L"");
- workprefs.df[3][0] = 0;
+ ejectfloppy (3);
addfloppytype (hDlg, 3);
break;
case IDC_SAVEIMAGE0:
case IDC_DISKLISTINSERT:
if (entry >= 0) {
- if (getfloppybox (hDlg, IDC_DISKTEXT, tmp, sizeof (tmp) / sizeof (TCHAR))) {
+ if (getfloppybox (hDlg, IDC_DISKTEXT, tmp, sizeof (tmp) / sizeof (TCHAR), HISTORY_FLOPPY)) {
_tcscpy (workprefs.dfxlist[entry], tmp);
addfloppyhistory (hDlg);
InitializeListView (hDlg);
vv3 = TRUE;
if (v && uf->x[0])
vv4 = TRUE;
+ if (workprefs.gfx_api)
+ v = vv = vv2 = vv3 = vv4 = TRUE;
+
ew (hDlg, IDC_FILTERHZ, v);
ew (hDlg, IDC_FILTERVZ, v);
ew (hDlg, IDC_FILTERHZMULT, v && !as);
int *varw, *varc;
int min, max, step;
};
-static struct filterxtra *filter_extra, *filter_selected;
+static struct filterxtra *filter_extra[4], *filter_selected;
+static int filter_selected_num;
static struct filterxtra filter_pal_extra[] =
{
};
static struct filterxtra filter_3d_extra[] =
{
+ L"Bilinear", &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
L"Scanline transparency", &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
L"Scanline level", &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
NULL
&workprefs.gfx_filter_luminance, &workprefs.gfx_filter_contrast, &workprefs.gfx_filter_saturation,
&workprefs.gfx_filter_gamma, &workprefs.gfx_filter_blur, &workprefs.gfx_filter_noise,
&workprefs.gfx_filter_keep_aspect, &workprefs.gfx_filter_aspect,
- &workprefs.gfx_filter_autoscale,
+ &workprefs.gfx_filter_autoscale, &workprefs.gfx_filter_bilinear,
NULL
};
static int *filtervars2[] = {
&currprefs.gfx_filter_luminance, &currprefs.gfx_filter_contrast, &currprefs.gfx_filter_saturation,
&currprefs.gfx_filter_gamma, &currprefs.gfx_filter_blur, &currprefs.gfx_filter_noise,
&currprefs.gfx_filter_keep_aspect, &currprefs.gfx_filter_aspect,
- &workprefs.gfx_filter_autoscale,
+ &currprefs.gfx_filter_autoscale, &currprefs.gfx_filter_bilinear,
NULL
};
static struct filterpreset filterpresets[] =
{
{ L"PAL", UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0 },
- { L"D3D Autoscale", UAE_FILTER_DIRECT3D, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 },
- { L"D3D Full Scaling", UAE_FILTER_DIRECT3D, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 },
+ { L"D3D Autoscale", 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 },
+ { L"D3D Full Scaling", 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 },
{ NULL }
};
static void values_to_hw3ddlg (HWND hDlg)
{
TCHAR txt[100], tmp[100];
- int i, j, nofilter, fltnum, modenum;
+ int i, j, fltnum, modenum;
struct uae_filter *uf;
+ int fxidx = 0, fxcnt;
UAEREG *fkey;
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_SETCURSEL,
(workprefs.gfx_filter_aspect == 16 * 256 + 10) ? 6 : 0, 0);
CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gfx_filter_keep_aspect);
+ CheckDlgButton (hDlg, IDC_FILTERD3D, workprefs.gfx_api);
SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_SETCURSEL,
workprefs.gfx_filter_keep_aspect, 0);
WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH);
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
uf = &uaefilters[0];
- nofilter = 0; fltnum = 0;
+ fltnum = 0;
i = 0; j = 1;
while (uaefilters[i].name) {
- switch (uaefilters[i].type)
- {
-#if 0
-#ifndef D3D
- case UAE_FILTER_DIRECT3D:
- nofilter = 1;
- break;
-#endif
-#ifndef OPENGL
- case UAE_FILTER_OPENGL:
- nofilter = 1;
- break;
-#endif
-#endif
- default:
- nofilter = 0;
- break;
- }
- if (nofilter == 0) {
- SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name);
- if (uaefilters[i].type == workprefs.gfx_filter) {
- uf = &uaefilters[i];
- fltnum = j;
- }
- j++;
+ SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name);
+ if (uaefilters[i].type == workprefs.gfx_filter) {
+ uf = &uaefilters[i];
+ fltnum = j;
}
+ j++;
i++;
}
if (D3D_canshaders ()) {
_stprintf (tmp2, L"D3D: %s", wfd.cFileName);
tmp2[_tcslen (tmp2) - 3] = 0;
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2);
- if (uf->type == UAE_FILTER_DIRECT3D && !_tcscmp (workprefs.gfx_filtershader, wfd.cFileName))
+ if (workprefs.gfx_api && !_tcscmp (workprefs.gfx_filtershader, wfd.cFileName))
fltnum = j;
j++;
if (!FindNextFile (h, &wfd)) {
}
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_SETCURSEL, fltnum, 0);
- filter_extra = NULL;
+ filter_extra[fxidx] = NULL;
SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_RESETCONTENT, 0, 0L);
- if (uf->x[0]) {
- WIN32GUI_LoadUIString (IDS_3D_NO_FILTER, txt, sizeof (txt) / sizeof (TCHAR));
- _stprintf (tmp, txt, 16);
- SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
- WIN32GUI_LoadUIString (IDS_3D_BILINEAR, txt, sizeof (txt) / sizeof (TCHAR));
- _stprintf (tmp, txt, 16);
- SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
- WIN32GUI_LoadUIString (IDS_3D_NO_FILTER, txt, sizeof (txt) / sizeof (TCHAR));
- _stprintf (tmp, txt, 32);
- SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
- WIN32GUI_LoadUIString (IDS_3D_BILINEAR, txt, sizeof (txt) / sizeof (TCHAR));
- _stprintf (tmp, txt, 32);
- SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
- modenum = 4;
- filter_extra = filter_3d_extra;
- } else {
+ if (workprefs.gfx_api) {
+ filter_extra[fxidx++] = filter_3d_extra;
+ filter_extra[fxidx] = NULL;
+ }
+ if (!uf->x[0]) {
modenum = 0;
for (i = 1; i <= 4; i++) {
if (uf->x[i]) {
}
}
if (uf->yuv) {
- filter_extra = filter_pal_extra;
+ filter_extra[fxidx++] = filter_pal_extra;
+ filter_extra[fxidx] = NULL;
}
}
SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETRANGE, TRUE, MAKELONG ( 0, +1000));
SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPAGESIZE, 0, 1);
- if (filter_extra) {
+ if (filter_extra[0]) {
+ struct filterxtra *prev = filter_selected;
int idx2 = -1;
int idx = SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_GETCURSEL, 0, 0L);
if (idx == CB_ERR)
idx = -1;
+ fxcnt = 0;
+ filter_selected = &filter_extra[0][0];
SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_RESETCONTENT, 0, 0L);
- for (i = 0; filter_extra[i].label; i++) {
- if (filter_selected == &filter_extra[i] && idx < 0)
- idx2 = i;
- SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_ADDSTRING, 0, (LPARAM)filter_extra[i].label);
- }
- if (idx2 >= 0)
- filter_selected = &filter_extra[idx2];
- else if (idx >= 0)
- filter_selected = &filter_extra[idx];
- else
- filter_selected = &filter_extra[0];
- SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_SETCURSEL, filter_selected - &filter_extra[0], 0);
+ for (j = 0; filter_extra[j]; j++) {
+ struct filterxtra *fx = filter_extra[j];
+ for (i = 0; fx[i].label; i++) {
+ if (prev == &fx[i] && idx < 0) {
+ idx2 = i;
+ filter_selected = &fx[idx2];
+ filter_selected_num = fxcnt;
+ }
+ SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_ADDSTRING, 0, (LPARAM)fx[i].label);
+ if (idx == 0) {
+ filter_selected = &fx[i];
+ filter_selected_num = fxcnt;
+ }
+ fxcnt++;
+ idx--;
+ }
+ }
+ SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_SETCURSEL, filter_selected_num, 0);
SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETRANGE, TRUE, MAKELONG (filter_selected->min, filter_selected->max));
SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPAGESIZE, 0, filter_selected->step);
- if (filter_selected) {
- SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw));
- SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw), TRUE);
- }
+ SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw));
+ SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw), TRUE);
}
if (workprefs.gfx_filter_filtermode >= modenum)
workprefs.gfx_filtershader[0] = 0;
workprefs.gfx_filter = 0;
if (item > 0) {
- item--;
- if (item > UAE_FILTER_PAL) {
- item = UAE_FILTER_DIRECT3D - 1;
+ if (item > UAE_FILTER_LAST) {
_stprintf (workprefs.gfx_filtershader, L"%s.fx", tmp + 5);
+ } else {
+ item--;
}
workprefs.gfx_filter = uaefilters[item].type;
item = SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_GETCURSEL, 0, 0L);
hw3d_changed = 1;
}
}
- if (workprefs.gfx_filter == 0)
+ if (workprefs.gfx_filter == 0 && !workprefs.gfx_api)
workprefs.gfx_filter_autoscale = 0;
}
enable_for_hw3ddlg (hDlg);
filter_preset (hDlg, wParam);
recursive++;
break;
+ case IDC_FILTERD3D:
+ workprefs.gfx_api = IsDlgButtonChecked (hDlg, IDC_FILTERD3D) ? 1 : 0;
+ break;
case IDC_FILTERKEEPASPECT:
{
if (IsDlgButtonChecked (hDlg, IDC_FILTERKEEPASPECT))
_tcscpy (savestate_fname, file);
ret = 1;
break;
+ case ZFILE_CDIMAGE:
+ _tcscpy (workprefs.cdimagefile, file);
+ break;
default:
if (currentpage < 0 && !full_property_sheet) {
do_filesys_insert (file);
extern void pre_gui_message (const TCHAR*,...);
extern void gui_message_id (int id);
int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage);
-UAEREG *read_disk_history (void);
+UAEREG *read_disk_history (int type);
void write_disk_history (void);
struct newresource
+Beta 5:
+
+- save cdimage path to statefile (if set)
+- cdimage on the fly change support (CD32 CD detection may not always
+ notice it without reboot, something wrong with detection)
+- cd images inside archives supported but all tracks will be unpacked
+ before emulation starts = do not use with big images.. (this is
+ something that can be improved someday..)
+- GUI added (quickstart only). "Automatic" and "Image file" does not
+ really do anything, only tries to show that real CDs are still
+ autodetected like in older versions..
+- disk image selection always used DF0: (b4)
+- replaced advanced chipset blitter busy bug checkbox with A1000 Agnus
+ (DIP package 8361/8367) because there are more differences, first
+ vblank strobe is triggered on line 1, not line 0.. (Alcatraz Megademo
+ 2) Perhaps someday this gets moved to main chipset panel.. Thanks to
+ yaqube for finding this hardware "feature" accidentally :)
+- more 68000 CE interrupt timing changes
+
+Big DirectDraw/Direct3D change. Anything can be broken..
+
+- Direct3D filter mode is now a checkbox, there is now DirectDraw
+ and Direct3D "render backend" (instead of DirectDraw and D3D
+ filter hack) All software filters are available in both modes
+ (of course pixel shader filters only in D3D mode) This is part of
+ graphics subsystem unification, RTG is still DirectDraw only.
+- point/bilinear setting moved to filter extra menu
+- 16bit/32bit setting removed, uses desktop/fullscreen depth, selects
+ 16bit if selected software filter is 16bit only (and lets D3D do
+ the conversion automatically)
+
Beta 4:
- ADDX and SUBX timing updates
end = restore_gayle (chunk);
else if (!_tcscmp (name, L"IDE "))
end = restore_ide (chunk);
+ else if (!_tcsncmp (name, L"CDU", 3))
+ end = restore_cd (name[3] - '0', chunk);
else if (!_tcscmp (name, L"CONF"))
end = restore_configuration (chunk);
else if (!_tcscmp (name, L"LOG "))
}
}
+ for (i = 0; i < 10; i++) {
+ dst = save_cd (i, &len);
+ if (dst) {
+ _stprintf (name, L"CDU%d", i);
+ save_chunk (f, dst, len, name, 0);
+ }
+ }
+
/* add fake END tag, makes it easy to strip CONF and LOG hunks */
/* move this if you want to use CONF or LOG hunks when restoring state */
zfile_fwrite (endhunk, 1, 8, f);
Model (1,2,3) 4
path to rom image
RAM space (depends on model)
-ROM CRC 4
+ROM CRC 4
+
+"CDx "
+
+Flags 4 (bit 0 = scsi, bit 1 = ide, bit 2 = image)
+Path (for example image file or drive letter)
END
hunk "END " ends, remember hunk size 8!
return ZFILE_NVR;
if (strcasecmp (ext, L"uae") == 0)
return ZFILE_CONFIGURATION;
+ if (strcasecmp (ext, L"cue") == 0)
+ return ZFILE_CDIMAGE;
}
memset (buf, 0, sizeof (buf));
zfile_fread (buf, 8, 1, z);
int zfile_is_ignore_ext (const TCHAR *name)
{
int i;
+ TCHAR *ext;
+ ext = _tcsrchr (name, '.');
+ if (!ext)
+ return 0;
for (i = 0; uae_ignoreextensions[i]; i++) {
- if (_tcslen(name) > _tcslen (uae_ignoreextensions[i]) &&
- !strcasecmp (uae_ignoreextensions[i], name + _tcslen (name) - _tcslen (uae_ignoreextensions[i])))
+ if (!strcasecmp (uae_ignoreextensions[i], ext))
return 1;
}
return 0;
{
int i;
+ TCHAR *ext = _tcsrchr (name, '.');
+ if (!ext)
+ return 0;
i = 0;
while (uae_diskimageextensions[i]) {
- if (_tcslen (name) > 3 && !strcasecmp (name + _tcslen (name) - 4, uae_diskimageextensions[i]))
- return 1;
+ if (!strcasecmp (ext, uae_diskimageextensions[i]))
+ return HISTORY_FLOPPY;
i++;
}
- return 0;
+ if (!_tcsicmp (ext, L".cue"))
+ return HISTORY_CD;
+ return -1;
}
return l;
}
+uae_s64 zfile_size (struct zfile *z)
+{
+ return z->size;
+}
+
uae_s64 zfile_ftell (struct zfile *z)
{
uae_s64 v;
TCHAR tmphist[MAX_DPATH];
struct zfile *z = NULL;
int we_have_file;
+ int diskimg;
int canhistory = (zf->zfdmask & ZFD_DISKHISTORY) && !(zf->zfdmask & ZFD_CHECKONLY);
if (retcode)
first = 1;
zn = &zv->root;
while (zn) {
- int isok = 1, diskimg = 0;
-
+ int isok = 1;
+
+ diskimg = -1;
if (zn->type != ZNODE_FILE)
isok = 0;
if (zfile_is_ignore_ext (zn->fullname))
isok = 0;
- if (zfile_is_diskimage (zn->fullname))
- diskimg = 1;
+ diskimg = zfile_is_diskimage (zn->fullname);
if (isok) {
if (tmphist[0]) {
#ifndef _CONSOLE
- if (diskimg && canhistory)
- DISK_history_add (tmphist, -1, 1);
+ if (diskimg >= 0 && canhistory)
+ DISK_history_add (tmphist, -1, diskimg, 1);
#endif
tmphist[0] = 0;
first = 0;
}
if (first) {
- if (diskimg)
+ if (diskimg >= 0)
_tcscpy (tmphist, zn->fullname);
} else {
_tcscpy (tmphist, zn->fullname);
#ifndef _CONSOLE
- if (diskimg && canhistory)
- DISK_history_add (tmphist, -1, 1);
+ if (diskimg >= 0 && canhistory)
+ DISK_history_add (tmphist, -1, diskimg, 1);
#endif
tmphist[0] = 0;
}
zn = zn->next;
}
#ifndef _CONSOLE
- if (zfile_is_diskimage (zfile_getname (zf)) && first && tmphist[0] && canhistory)
- DISK_history_add (zfile_getname (zf), -1, 1);
+ diskimg = zfile_is_diskimage (zfile_getname (zf));
+ if (diskimg >= 0 && first && tmphist[0] && canhistory)
+ DISK_history_add (zfile_getname (zf), -1, diskimg, 1);
#endif
zfile_fclose_archive (zv);
if (z) {