cfgfile_dwrite_bool (f, L"agnus_bltbusybug", p->cs_agnusbltbusybug);
cfgfile_dwrite_bool (f, L"ics_agnus", p->cs_dipagnus);
+ cfgfile_dwrite_bool (f, L"autoconfig", p->autoconfig);
cfgfile_write (f, L"fastmem_size", L"%d", p->fastmem_size / 0x100000);
cfgfile_dwrite (f, L"fastmem2_size", L"%d", p->fastmem2_size / 0x100000);
cfgfile_write (f, L"a3000mem_size", L"%d", p->mbresmem_low_size / 0x100000);
|| 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"autoconfig", &p->autoconfig)
|| cfgfile_yesno (option, value, L"kickshifter", &p->kickshifter)
|| cfgfile_yesno (option, value, L"ntsc", &p->ntscmode)
int cfgfile_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value, int type)
{
+ if (!_tcscmp (option, L"debug")) {
+ write_log (L"CONFIG DEBUG: '%s'\n", value);
+ return 1;
+ }
if (!_tcscmp (option, L"config_hardware"))
return 1;
if (!_tcscmp (option, L"config_host"))
p->gfx_autoresolution_minh = 0;
p->color_mode = 2;
p->gfx_blackerthanblack = 0;
- p->gfx_apmode[0].gfx_backbuffers = 1;
- p->gfx_apmode[1].gfx_backbuffers = 1;
+ p->gfx_apmode[0].gfx_backbuffers = 2;
+ p->gfx_apmode[1].gfx_backbuffers = 2;
p->immediate_blits = 0;
p->waiting_blits = 0;
p->custom_memory_sizes[0] = 0;
p->custom_memory_addrs[1] = 0;
p->custom_memory_sizes[1] = 0;
+ p->autoconfig = true;
p->nr_floppies = 2;
p->floppy_read_only = false;
static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck)
{
- int roms[4];
+ int roms[2];
roms[0] = 24;
- roms[1] = 23;
- roms[2] = -1;
+ roms[1] = -1;
p->chipset_mask = 0;
p->bogomem_size = 0;
p->sound_filter = FILTER_SOUND_ON;
p->cs_a1000ram = 0;
p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = 0;
- p->cs_cdtvcd = p->cs_cdtvram = 0;
+ p->cs_cdtvcd = p->cs_cdtvram = p->cs_cdtvscsi = 0;
+ p->cs_a2091 = p->cs_a4091 = 0;
p->cs_fatgaryrev = -1;
p->cs_ide = 0;
p->cs_ramseyrev = -1;
p->cs_deniserev = -1;
p->cs_agnusrev = -1;
+ p->cs_denisenoehb = 0;
+ p->cs_dipagnus = 0;
+ p->cs_agnusbltbusybug = 0;
p->cs_mbdmac = 0;
- p->cs_a2091 = 0;
p->cs_pcmcia = 0;
p->cs_ksmirror_e0 = 1;
+ p->cs_ksmirror_a8 = 0;
p->cs_ciaoverlay = 1;
p->cs_ciaatod = 0;
+ p->cs_rtc = 1;
+ p->cs_rtc_adjust_mode = p->cs_rtc_adjust = 0;
p->cs_df0idhw = 1;
p->cs_resetwarning = 1;
+ p->cs_slowmemisfast = 0;
switch (p->cs_compatible)
{
#include "ncr_scsi.h"
#include "blkdev.h"
#include "sampler.h"
+#include "clipboard.h"
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
#define CUSTOM_DEBUG 0
#define SPRITE_DEBUG 0
static int lol;
static int next_lineno, prev_lineno;
static enum nln_how nextline_how;
-static int lof_changed = 0, interlace_changed = 0;
+static int lof_changed = 0, lof_changing = 0, interlace_changed = 0;
static int scandoubled_line;
static bool vsync_rendered, frame_shown;
static int jitcount = 0;
+#define LOF_TOGGLES_NEEDED 4
+#define NLACE_CNT_NEEDED 50
+static int lof_togglecnt_lace, lof_togglecnt_nlace, lof_previous, nlace_cnt;
+
/* Stupid genlock-detection prevention hack.
* We should stop calling vsync_handler() and
* hstop_handler() completely but it is not
if (first_bpl_vpos < 0)
first_bpl_vpos = vpos;
- if (doflickerfix () && interlace_seen && !scandoubled_line) {
+ if (doflickerfix () && interlace_seen > 0 && !scandoubled_line) {
int i;
for (i = 0; i < 8; i++) {
prevbpl[lof_current][vpos][i] = bplptx[i];
return maxvpos + (lof_store ? 1 : 0);
}
+static void checklacecount (bool lace)
+{
+ if (!interlace_changed) {
+ if (nlace_cnt >= NLACE_CNT_NEEDED && lace) {
+ lof_togglecnt_lace = LOF_TOGGLES_NEEDED;
+ lof_togglecnt_nlace = 0;
+ write_log (L"immediate lace\n");
+ nlace_cnt = 0;
+ } else if (nlace_cnt <= -NLACE_CNT_NEEDED && !lace) {
+ lof_togglecnt_nlace = LOF_TOGGLES_NEEDED;
+ lof_togglecnt_lace = 0;
+ write_log (L"immediate nlace\n");
+ nlace_cnt = 0;
+ }
+ }
+ if (lace) {
+ if (nlace_cnt > 0)
+ nlace_cnt = 0;
+ nlace_cnt--;
+ if (nlace_cnt < -NLACE_CNT_NEEDED * 2)
+ nlace_cnt = -NLACE_CNT_NEEDED * 2;
+ } else if (!lace) {
+ if (nlace_cnt < 0)
+ nlace_cnt = 0;
+ nlace_cnt++;
+ if (nlace_cnt > NLACE_CNT_NEEDED * 2)
+ nlace_cnt = NLACE_CNT_NEEDED * 2;
+ }
+}
+
struct chipset_refresh *get_chipset_refresh (void)
{
- int islace = (bplcon0 & 4) ? 1 : 0;
+ int islace = interlace_seen ? 1 : 0;
int isntsc = (beamcon0 & 0x20) ? 0 : 1;
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
static void compute_framesync (void)
{
- int islace = (bplcon0 & 4) ? 1 : 0;
+ int islace = interlace_seen ? 1 : 0;
int isntsc = (beamcon0 & 0x20) ? 0 : 1;
bool found = false;
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
}
stored_chipset_refresh = cr;
- interlace_changed = islace;
+ interlace_changed = 0;
if (beamcon0 & 0x80) {
int res = GET_RES_AGNUS (bplcon0);
compute_vsynctime ();
- write_log (L"%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d\n",
+ write_log (L"%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s)\n",
isntsc ? L"NTSC" : L"PAL",
islace ? L" laced" : L"",
doublescan > 0 ? L" dblscan" : L"",
vblank_hz, vblank_hz * maxvpos_nom,
maxhpos, maxvpos, lof_store ? 1 : 0,
- cr ? cr->index : -1
- );
+ cr ? cr->index : -1,
+ cr != NULL && cr->label != NULL ? cr->label : L"<unknown>"
+ );
config_changed = 1;
}
}
beamcon0 = new_beamcon0;
isntsc = (beamcon0 & 0x20) ? 0 : 1;
- islace = (bplcon0 & 4) ? 1 : 0;
+ islace = (interlace_seen) ? 1 : 0;
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
isntsc = currprefs.ntscmode ? 1 : 0;
if (!isntsc) {
write_log (L"VPOSW %04X PC=%08x\n", v, M68K_GETPC);
#endif
if (lof_store != ((v & 0x8000) ? 1 : 0)) {
- lof_changed = 1;
lof_store = (v & 0x8000) ? 1 : 0;
+ lof_changing = lof_store ? 1 : -1;
}
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) {
lol = (v & 0x0080) ? 1 : 0;
if (!islinetoggle ())
lol = 0;
}
- if (lof_changed)
+ if (lof_changing)
return;
vpos &= 0x00ff;
v &= 7;
hpos_previous = hpos;
}
+ if ((bplcon0 & 4) != (v & 4))
+ checklacecount ((v & 4) != 0);
+
bplcon0 = v;
bpldmainitdelay (hpos);
timehack_alive--;
inputdevice_vsync ();
-
filesys_vsync ();
-
sampler_vsync ();
+ clipboard_vsync ();
+#ifdef RETROPLATFORM
+ rp_vsync ();
+#endif
if (!vsync_rendered) {
vsync_handle_redraw (lof_store, lof_changed);
render_screen ();
if (!frame_shown) {
frame_shown = true;
- show_screen_maybe (true);
+ show_screen_maybe (isvsync_chipset () >= 0);
}
}
}
vblank_hz_state = 1;
vsync_handle_check ();
+ checklacecount ((bplcon0 & 4) != 0);
}
// emulated hardware vsync
write_log (L"vblank interrupt not cleared\n");
#endif
DISK_vsync ();
+
if (bplcon0 & 4)
lof_store = lof_store ? 0 : 1;
lof_current = lof_store;
+ if (lof_togglecnt_lace >= LOF_TOGGLES_NEEDED) {
+ interlace_changed = notice_interlace_seen (true);
+ } else if (lof_togglecnt_nlace >= LOF_TOGGLES_NEEDED) {
+ interlace_changed = notice_interlace_seen (false);
+ if (interlace_changed) {
+ if (currprefs.gfx_scandoubler && currprefs.gfx_vresolution)
+ notice_screen_contents_lost ();
+ }
+ }
+ if (lof_changing) {
+ // still same? Trigger change now.
+ if ((!lof_store && lof_changing < 0) || (lof_store && lof_changing > 0)) {
+ lof_changed = 1;
+ }
+ lof_changing = 0;
+ }
if (debug_copper)
record_copper_reset ();
vpos_count = p96refresh_active;
vtotal = vpos_count;
}
- if ((beamcon0 & (0x20 | 0x80)) != (new_beamcon0 & (0x20 | 0x80)) || (abs (vpos_count - vpos_count_prev) > 1))
+ if ((beamcon0 & (0x20 | 0x80)) != (new_beamcon0 & (0x20 | 0x80)) || (abs (vpos_count - vpos_count_prev) > 1) || lof_changed)
init_hz ();
- else if (lof_changed || interlace_changed != ((bplcon0 & 4) ? 1 : 0) || changed_chipset_refresh ())
+ else if (interlace_changed || changed_chipset_refresh ())
compute_framesync ();
-#if 0
- if (lof_changed)
- compute_vsynctime ();
-#endif
+
vpos_count_prev = vpos_count;
lof_changed = 0;
lightpen_triggered = 1;
}
hardware_line_completed (next_lineno);
- if (doflickerfix () && interlace_seen)
+ if (doflickerfix () && interlace_seen > 0)
hsync_scandoubler ();
}
CIA_vsync_posthandler (ciasyncs);
}
- if (vpos == equ_vblank_endline + 1 && lof_current != lof_store) {
- // argh, line=0 field decision was wrong, someone did
- // something stupid and changed LOF
- // lof_current = lof_store;
- // don't really know what to do here exactly without corrupt display
+ if (vpos == equ_vblank_endline + 1) {
+ if (lof_current != lof_store) {
+ // argh, line=0 field decision was wrong, someone did
+ // something stupid and changed LOF
+ // lof_current = lof_store;
+ // don't really know what to do here exactly without corrupt display
+ }
+ if (lof_store != lof_previous) {
+ if (lof_togglecnt_lace < LOF_TOGGLES_NEEDED)
+ lof_togglecnt_lace++;
+ if (lof_togglecnt_lace >= LOF_TOGGLES_NEEDED)
+ lof_togglecnt_nlace = 0;
+ } else {
+ if (lof_togglecnt_nlace < LOF_TOGGLES_NEEDED)
+ lof_togglecnt_nlace++;
+ if (lof_togglecnt_nlace >= LOF_TOGGLES_NEEDED)
+ lof_togglecnt_lace = 0;
+ }
+ lof_previous = lof_store;
}
inputdevice_hsync ();
int lineno = vpos;
if (lineno >= MAXVPOS)
lineno %= MAXVPOS;
- if ((bplcon0 & 4) && currprefs.gfx_vresolution)
- notice_interlace_seen ();
nextline_how = nln_normal;
- if (doflickerfix () && interlace_seen) {
+ if (doflickerfix () && interlace_seen > 0) {
lineno *= 2;
} else if (currprefs.gfx_vresolution && (doublescan <= 0 || interlace_seen > 0)) {
lineno *= 2;
vsync_handle_redraw (lof_store, lof_changed);
if (vblank_hz_state) {
render_screen ();
- show_screen_maybe (true);
+ show_screen_maybe (false);
}
frame_shown = true;
}
dmal = 0;
init_hz_full ();
vpos_lpen = -1;
+ lof_changing = 0;
+ lof_togglecnt_nlace = lof_togglecnt_lace = 0;
+ lof_previous = lof_store;
+ nlace_cnt = NLACE_CNT_NEEDED;
audio_reset ();
if (!isrestore ()) {
}
}
-static void REGPARAM2 custom_lput(uaecptr addr, uae_u32 value)
+static void REGPARAM2 custom_lput (uaecptr addr, uae_u32 value)
{
#ifdef JIT
special_mem |= S_WRITE;
if (framecnt == 0)
finish_drawing_frame ();
+#if 0
if (interlace_seen > 0) {
interlace_seen = -1;
} else if (interlace_seen == -1) {
if (currprefs.gfx_scandoubler && currprefs.gfx_vresolution)
notice_screen_contents_lost ();
}
+#endif
if (quit_program < 0) {
#ifdef SAVESTATE
gfxvidinfo.drawbuffer.unlockscr = dummy_unlock;
}
-void notice_interlace_seen (void)
+bool notice_interlace_seen (bool lace)
{
+ bool changed = false;
// non-lace to lace switch (non-lace active at least one frame)?
- if (interlace_seen == 0)
- frame_redraw_necessary = 2;
- interlace_seen = 1;
+ if (lace) {
+ if (interlace_seen == 0) {
+ frame_redraw_necessary = 2;
+ changed = true;
+ write_log (L"->lace\n");
+ }
+ interlace_seen = currprefs.gfx_vresolution ? 1 : -1;
+ } else {
+ if (interlace_seen) {
+ changed = true;
+ write_log (L"->non-lace\n");
+ }
+ interlace_seen = 0;
+ }
+ return changed;
}
static void clearbuffer (struct vidbuffer *dst)
allocate_expamem ();
expamem_bank.name = L"Autoconfig [reset]";
+ if (!currprefs.autoconfig)
+ do_mount = 0;
/* check if Kickstart version is below 1.3 */
- if (kickstart_version
+ if (kickstart_version && do_mount
&& (/* Kickstart 1.0 & 1.1! */
kickstart_version == 0xFFFF
/* Kickstart < 1.3 */
if (need_uae_boot_rom () == 0)
do_mount = 0;
if (fastmemory != NULL && currprefs.chipmem_size <= 2 * 1024 * 1024) {
- card_name[cardno] = L"Z2Fast";
- card_init[cardno] = expamem_init_fastcard;
- card_map[cardno++] = expamem_map_fastcard;
+ card_name[cardno] = L"Z2Fast";
+ card_init[cardno] = expamem_init_fastcard;
+ card_map[cardno++] = expamem_map_fastcard;
+ if (!currprefs.autoconfig || !do_mount)
+ map_banks (&fastmem_bank, 0x00200000 >> 16, allocated_fastmem >> 16, 0);
}
#ifdef CDTV
rdbmnt
flags = rl (buf + 20);
- if (flags & 2) { /* do not mount */
+ if ((flags & 2) || uip->bootpri <= -129) { /* do not mount */
err = -1;
write_log (L"RDB: Automount disabled, not mounting\n");
goto error;
}
- if (!(flags & 1)) /* not bootable */
+ if (!(flags & 1) || uip->bootpri <= -128) /* not bootable */
m68k_dreg (regs, 7) = m68k_dreg (regs, 7) & ~1;
buf[37 + buf[36]] = 0; /* zero terminate BSTR */
}
}
-static void ide_execute_drive_diagnostics (void)
+static void ide_execute_drive_diagnostics (bool irq)
{
ide->regs->ide_error = 1;
ide->regs->ide_sector = ide->regs->ide_nsector = 1;
ide->regs->ide_select = 0;
ide->regs->ide_lcyl = ide->regs->ide_hcyl = 0;
- ide->status &= ~IDE_STATUS_BSY;
+ if (irq)
+ ide_interrupt ();
+ else
+ ide->status = ~IDE_STATUS_BSY;
}
static void ide_initialize_drive_parameters (void)
} else if (cmd == 0xec) { /* identify drive */
ide_identify_drive ();
} else if (cmd == 0x90) { /* execute drive diagnostics */
- ide_execute_drive_diagnostics ();
+ ide_execute_drive_diagnostics (true);
} else if (cmd == 0x91) { /* initialize drive parameters */
ide_initialize_drive_parameters ();
} else if (cmd == 0xc6) { /* set multiple mode */
break;
case IDE_DEVCON:
if ((ide->regs->ide_devcon & 4) == 0 && (val & 4) != 0)
- ide_execute_drive_diagnostics ();
+ ide_execute_drive_diagnostics (false);
ide->regs->ide_devcon = val;
break;
case IDE_DATA:
extern void init_hardware_for_drawing_frame (void);
extern void reset_drawing (void);
extern void drawing_init (void);
-extern void notice_interlace_seen (void);
+extern bool notice_interlace_seen (bool);
extern void frame_drawn (void);
extern void redraw_frame (void);
extern int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy);
int rtgmem_type;
uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
+ bool autoconfig;
bool kickshifter;
bool filesys_no_uaefsdb;
// 16 = potgo
// 32 = vsync
-int inputdevice_logging = 1;
+int inputdevice_logging = 0;
#define IE_INVERT 0x80
#define IE_CDTV 0x100
{
fixup_prefs_dim2 (&prefs->gfx_size_fs);
fixup_prefs_dim2 (&prefs->gfx_size_win);
- if (prefs->gfx_filter == 0 && prefs->gfx_filter_autoscale && !prefs->gfx_api)
- prefs->gfx_filter = 1;
if (prefs->gfx_apmode[1].gfx_vsync)
prefs->gfx_apmode[1].gfx_vsyncmode = 1;
if (prefs->gfx_apmode[0].gfx_vsync && !prefs->gfx_apmode[0].gfx_vsyncmode && prefs->gfx_apmode[0].gfx_backbuffers < 1)
for (int i = 0; i < 2; i++) {
struct apmode *ap = &prefs->gfx_apmode[i];
ap->gfx_vflip = false;
- if (ap->gfx_backbuffers >= 1)
- ap->gfx_vflip = true; // true = wait for vblank flip, false = immediate flip
+ if (ap->gfx_vsync) {
+ if (ap->gfx_vsyncmode) {
+ // low latency vsync: no flip only if no-buffer
+ if (ap->gfx_backbuffers >= 1)
+ ap->gfx_vflip = true; // true = wait for vblank flip, false = immediate flip
+ } else {
+ // legacy vsync: always wait for flip
+ ap->gfx_vflip = true;
+ }
+ } else {
+ // no vsync: wait if tripple bufferirng
+ if (ap->gfx_backbuffers >= 2)
+ ap->gfx_vflip = true;
+ }
}
+ if (prefs->gfx_filter == 0 && ((prefs->gfx_filter_autoscale && !prefs->gfx_api) || (prefs->gfx_apmode[0].gfx_vsyncmode)))
+ prefs->gfx_filter = 1;
}
void fixup_cpu (struct uae_prefs *p)
static int extractbits (uae_u32 val, int bits, bool issigned)
{
if (issigned)
- return val & (hidmask (bits)) ? val | (bits >= 32 ? 0x80000000 : (-1 << bits)) : val;
+ return (val & (bits >= 32 ? 0x80000000 : (1 << (bits - 1)))) ? val | (bits >= 32 ? 0x80000000 : (-1 << bits)) : val;
else
return val & hidmask (bits);
}
v -= logicalrange + vcaps->LogicalMin;
- //if (axisnum == 0)
- // write_log (L"%d\n", v);
+ if (axisnum == 0)
+ write_log (L"%d\n", v);
data = v;
LPD3DXBUFFER Errors = NULL;
LPD3DXBUFFER BufferEffect = NULL;
HRESULT hr;
- TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
+ TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH], tmp3[MAX_DPATH];
LPD3DXEFFECT effect = NULL;
static int first;
DWORD compileflags = psEnabled ? 0 : D3DXSHADER_USE_LEGACY_D3DX9_31_DLL;
compileflags |= EFFECTCOMPILERFLAGS;
plugin_path = get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"filtershaders\\direct3d");
- if (filenotificationhandle == NULL)
- filenotificationhandle = FindFirstChangeNotification (tmp, FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE);
+ _tcscpy (tmp3, tmp);
_tcscat (tmp, shaderfile);
if (!full) {
struct zfile *z = zfile_fopen (tmp, L"r", 0);
if (FAILED (hr)) {
const char *str = psEnabled ? fx20 : fx10;
int len = strlen (str);
-#if 0
- if ((!existsfile || canusefile == 0) && plugin_path) {
+ if (!existsfile && plugin_path) {
struct zfile *z = zfile_fopen (tmp, L"w", 0);
if (z) {
zfile_fwrite ((void*)str, len, 1, z);
zfile_fclose (z);
}
}
-#endif
hr = D3DXCreateEffectCompiler (str, len, NULL, NULL, compileflags, &EffectCompiler, &Errors);
if (FAILED (hr)) {
write_log (L"%s: D3DXCreateEffectCompilerFromResource failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
goto end;
}
ret = 1;
+ if (plugin_path && filenotificationhandle == NULL)
+ filenotificationhandle = FindFirstChangeNotification (tmp3, FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE);
end:
if (Errors)
Errors->Release ();
static void invalidatedeviceobjects (void)
{
+ if (filenotificationhandle != NULL)
+ FindCloseChangeNotification (filenotificationhandle);
+ filenotificationhandle = NULL;
if (query) {
query->Release();
query = NULL;
static void D3D_free2 (void)
{
- if (filenotificationhandle != NULL)
- FindCloseChangeNotification (filenotificationhandle);
- filenotificationhandle = NULL;
invalidatedeviceobjects ();
if (d3dswapchain) {
d3dswapchain->Release ();
write_log (L"DYNAMIC ");
write_log (L"\n");
- write_log (L"%s: PS=%d.%d VS=%d.%d %d*%d*%d%s VS=%d B=%d%s%s %d-bit %d\n",
+ write_log (L"%s: PS=%d.%d VS=%d.%d %d*%d*%d%s VS=%d B=%d%s %d-bit %d\n",
D3DHEAD,
(d3dCaps.PixelShaderVersion >> 8) & 0xff, d3dCaps.PixelShaderVersion & 0xff,
(d3dCaps.VertexShaderVersion >> 8) & 0xff, d3dCaps.VertexShaderVersion & 0xff,
max_texture_w, max_texture_h,
dpp.FullScreen_RefreshRateInHz,
dpp.Windowed ? L"" : L" FS",
- vsync, dpp.BackBufferCount,
- dpp.PresentationInterval & D3DPRESENT_INTERVAL_IMMEDIATE ? L"I" : L"F",
- ap->gfx_backbuffers == 0 ? L"E" : L"",
+ vsync, ap->gfx_backbuffers,
+ ap->gfx_vflip ? L"W" : L"I",
t_depth, adapter
);
write_log (L"%s: CreateQuery(D3DQUERYTYPE_EVENT) failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
}
if (d3ddevex) {
- hr = d3ddevex->SetMaximumFrameLatency (vsync < 0 && ap->gfx_backbuffers == 0 ? 1 : 0);
+ hr = d3ddevex->SetMaximumFrameLatency (vsync < 0 ? 1 : 0);
if (FAILED (hr))
write_log (L"%s: SetMaximumFrameLatency() failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
}
return (uae_u8*)lock.pBits;
}
+static void flushgpu (bool wait)
+{
+ if (query) {
+ HRESULT hr = query->Issue (D3DISSUE_END);
+ if (SUCCEEDED (hr)) {
+ while (query->GetData (NULL, 0, D3DGETDATA_FLUSH) == S_FALSE) {
+ if (!wait)
+ return;
+ }
+ } else {
+ static int reported;
+ if (reported < 10) {
+ reported++;
+ write_log (L"%s: query->Issue (D3DISSUE_END) failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
+ }
+ }
+ }
+}
+
bool D3D_renderframe (void)
{
static int vsync2_cnt;
while (WaitForSingleObject (filenotificationhandle, 0) == WAIT_OBJECT_0) {
FindNextChangeNotification (filenotificationhandle);
devicelost = 2;
+ write_log (L"%s: Shader file modification notification\n", D3DHEAD);
}
}
}
D3D_render2 ();
+ flushgpu (false);
- if (query) {
- HRESULT hr = query->Issue (D3DISSUE_END);
- if (SUCCEEDED (hr)) {
- while (query->GetData (NULL, 0, D3DGETDATA_FLUSH) == S_FALSE);
- } else {
- static int reported;
- if (reported < 10) {
- reported++;
- write_log (L"query->Issue (D3DISSUE_END) failed: %s\n", D3DHEAD, D3D_ErrorString (hr));
- }
- }
- }
return true;
}
D3D_showframe2 (true);
}
}
+ flushgpu (true);
}
void D3D_refresh (void)
} else {
ddrval = DD_FALSE;
}
- write_log (L"DDRAW: primary surface %p, secondary %p (%dx%dx%d) bb=%d\n",
- dxdata.primary, surf, width, height, dxdata.native.ddpfPixelFormat.dwRGBBitCount, dxdata.backbuffers);
+ write_log (L"DDRAW: %dx%d B=%d%s %d-bit\n",
+ width, height,
+ ap->gfx_backbuffers, ap->gfx_vflip ? L"W" : L"I",
+ dxdata.native.ddpfPixelFormat.dwRGBBitCount
+ );
return ddrval;
}
int thisisvsync = 1;
int vsync = isvsync_rtg ();
int mult;
+ bool rendered = false;
-#ifdef RETROPLATFORM
- rp_vsync ();
-#endif
-
- clipboard_vsync ();
- if (!picasso_on)
- createwindowscursor (0, 0, 0, 0, 0, 1);
+ if (vsync < 0) {
+ vsync_busywait_end ();
+ vsync_busywait_do (NULL, false, false);
+ }
getvsyncrate (currprefs.chipset_refreshrate, &mult);
- if (vsync >= 0 && mult < 0) {
+ if (vsync && mult < 0) {
vsynccnt++;
if (vsynccnt < 2)
thisisvsync = 0;
vsynccnt = 0;
}
- if (thisisvsync && currprefs.win32_rtgvblankrate == 0 && !vsync)
- picasso_trigger_vblank ();
-
- if (!picasso_on)
- return;
-
framecnt++;
mouseupdate ();
if (thisisvsync) {
- if (!rtg_render ())
- rtg_show ();
+ rendered = rtg_render ();
}
if (setupcursor_needed)
setupcursor ();
+ if (thisisvsync)
+ picasso_trigger_vblank ();
+
+ if (vsync < 0) {
+ vsync_busywait_start ();
+ }
+
+ if (thisisvsync && !rendered)
+ rtg_show ();
}
static int p96hsync;
void picasso_handle_vsync (void)
{
- int vsync = isvsync_rtg ();
-
+ if (currprefs.rtgmem_size == 0)
+ return;
+
if (!picasso_on) {
+ createwindowscursor (0, 0, 0, 0, 0, 1);
picasso_trigger_vblank ();
return;
}
+ int vsync = isvsync_rtg ();
if (vsync < 0) {
p96hsync = 0;
- vsync_busywait_end ();
- vsync_busywait_do (NULL, false, false);
- framecnt++;
- mouseupdate ();
- bool rendered = rtg_render ();
- picasso_trigger_vblank ();
- clipboard_vsync ();
- vsync_busywait_start ();
- if (!rendered)
- rtg_show ();
- } else {
+ picasso_handle_vsync2 ();
+ } else if (currprefs.win32_rtgvblankrate == 0) {
picasso_handle_vsync2 ();
}
}
void picasso_handle_hsync (void)
{
- int vsync = isvsync_rtg ();
+ if (currprefs.rtgmem_size == 0)
+ return;
+ int vsync = isvsync_rtg ();
if (vsync < 0) {
p96hsync++;
if (p96hsync >= p96syncrate * 3) {
return;
}
- if (currprefs.rtgmem_size == 0)
- return;
- if (currprefs.win32_rtgvblankrate == 0 && !vsync)
+ if (currprefs.win32_rtgvblankrate == 0)
return;
p96hsync++;
if (p96hsync >= p96syncrate) {
- picasso_trigger_vblank ();
+ if (!picasso_on) {
+ createwindowscursor (0, 0, 0, 0, 0, 1);
+ picasso_trigger_vblank ();
+ } else {
+ picasso_handle_vsync2 ();
+ }
p96hsync = 0;
}
}
width = picasso96_state.Width;
height = picasso96_state.Height;
}
- flushpixels ();
} else {
write_log (L"ERROR - picasso_refresh() can't refresh!\n");
}
showcursor = 0;
}
-void setmouseactive (int active)
+static void setmouseactive2 (int active, bool allowpause)
{
//write_log (L"setmouseactive %d->%d\n", mouseactive, active);
if (active == 0)
} else {
inputdevice_acquire (FALSE);
}
- if (!active)
+ if (!active && allowpause)
checkpause ();
setmaintitle (hMainWnd);
#ifdef RETROPLATFORM
rp_mouse_magic (magicmouse_alive ());
#endif
}
+void setmouseactive (int active)
+{
+ setmouseactive2 (active, true);
+}
-static const int hotkeys[] = { VK_VOLUME_UP, VK_VOLUME_DOWN, VK_VOLUME_MUTE, -1 };
+static int hotkeys[] = { VK_VOLUME_UP, VK_VOLUME_DOWN, VK_VOLUME_MUTE, -1 };
static void winuae_active (HWND hWnd, int minimized)
{
if (sound_closed < 0) {
resumesoundpaused ();
} else {
- if (currprefs.win32_iconified_pause)
+ if (currprefs.win32_iconified_pause && !currprefs.win32_inactive_pause)
resumepaused (1);
- if (currprefs.win32_inactive_pause)
+ else if (currprefs.win32_inactive_pause)
resumepaused (2);
}
sound_closed = 0;
getcapslock ();
wait_keyrelease ();
inputdevice_acquire (TRUE);
- if (isfullscreen() != 0 && !gui_active)
+ if (isfullscreen () != 0 && !gui_active)
setmouseactive (1);
#ifdef LOGITECHLCD
if (!minimized)
}
}
}
- wait_keyrelease ();
setpriority (pri);
#ifdef FILESYS
filesys_flush_cache ();
ShowWindow (hMainWnd, SW_MINIMIZE);
}
+void enablecapture (void)
+{
+ setmouseactive (1);
+ if (sound_closed < 0) {
+ resumesoundpaused ();
+ sound_closed = 0;
+ }
+ if (currprefs.win32_inactive_pause) {
+ resumepaused (2);
+ }
+}
+
void disablecapture (void)
{
setmouseactive (0);
focus = 0;
+ if (currprefs.win32_inactive_pause && sound_closed == 0) {
+ setpaused (2);
+ sound_closed = 1;
+ } else if (currprefs.win32_inactive_nosound && sound_closed == 0) {
+ setsoundpaused ();
+ sound_closed = -1;
+ }
}
void gui_gameport_button_change (int port, int button, int onoff)
//write_log (L"%d %d %d %d %d %d %dx%d %dx%d\n", wm, mouseactive, focus, showcursor, recapture, isfullscreen (), mx, my, mouseposx, mouseposy);
if (recapture && isfullscreen () <= 0) {
- setmouseactive (1);
+ enablecapture ();
return 0;
}
if (wm < 0 && (istablet || currprefs.input_tablet >= TABLET_MOUSEHACK)) {
#define LANG_DLL 1
//#define WINUAEBETA L""
-#define WINUAEBETA L"Beta 16"
-#define WINUAEDATE MAKEBD(2012, 2, 10)
+#define WINUAEBETA L"Beta 17"
+#define WINUAEDATE MAKEBD(2012, 2, 15)
#define WINUAEEXTRA L""
//#define WINUAEEXTRA L"AmiKit Preview"
#define WINUAEREV L""
}
static void doflipevent (void)
{
+ if (flipevent == NULL)
+ return;
waitflipevent ();
flipevent_mode = 1;
SetEvent (flipevent);
bool show_screen_maybe (bool show)
{
struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
- if (ap->gfx_vsync >= 0 || !ap->gfx_vflip) {
+ if (!ap->gfx_vflip || ap->gfx_vsyncmode == 0 || !ap->gfx_vsync) {
if (show)
show_screen ();
return false;
if (!p) {
LeaveCriticalSection (&screen_cs);
} else {
+ rtg_locked = true;
if (doclear) {
uae_u8 *p2 = p;
for (int h = 0; h < picasso_vidinfo.height; h++) {
c |= currprefs.gfx_filter_gamma != changed_prefs.gfx_filter_gamma ? (1|8) : 0;
//c |= currprefs.gfx_filter_ != changed_prefs.gfx_filter_ ? (1|8) : 0;
+ c |= currprefs.gfx_luminance != changed_prefs.gfx_luminance ? (1|8) : 0;
+ c |= currprefs.gfx_contrast != changed_prefs.gfx_contrast ? (1|8) : 0;
+ c |= currprefs.gfx_gamma != changed_prefs.gfx_gamma ? (1|8) : 0;
+
c |= currprefs.gfx_resolution != changed_prefs.gfx_resolution ? (128) : 0;
c |= currprefs.gfx_vresolution != changed_prefs.gfx_vresolution ? (128) : 0;
c |= currprefs.gfx_autoresolution_minh != changed_prefs.gfx_autoresolution_minh ? (128) : 0;
currprefs.gfx_filter_autoscale = changed_prefs.gfx_filter_autoscale;
//currprefs.gfx_filter_ = changed_prefs.gfx_filter_;
+ currprefs.gfx_luminance = changed_prefs.gfx_luminance;
+ currprefs.gfx_contrast = changed_prefs.gfx_contrast;
+ currprefs.gfx_gamma = changed_prefs.gfx_gamma;
+
currprefs.gfx_resolution = changed_prefs.gfx_resolution;
currprefs.gfx_vresolution = changed_prefs.gfx_vresolution;
currprefs.gfx_autoresolution_minh = changed_prefs.gfx_autoresolution_minh;
{
int quick = 0;
int idx = screen_is_picasso ? 1 : 0;
+ struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
updatewinfsmode (&changed_prefs);
open_windows (0);
+ if (isvsync () < 0)
+ vblank_calibrate (0, false);
+
if (isfullscreen () <= 0)
DirectDraw_FillPrimary ();
{
vsync_notvblank ();
while (!vblank_found && vblankthread_mode == VBLANKTH_ACTIVE) {
- vsync_sleep (true);
+ vsync_sleep (false);
}
changevblankthreadmode (VBLANKTH_ACTIVE_WAIT);
return thread_vblank_time;
void vsync_busywait_start (void)
{
+ vsync_notvblank ();
changevblankthreadmode (VBLANKTH_ACTIVE_START);
vblank_prev_time = thread_vblank_time;
}
CheckDlgButton (hDlg, IDC_HDF_AUTOBOOT, current_hfdlg.autoboot);
CheckDlgButton (hDlg, IDC_HDF_DONOTMOUNT, current_hfdlg.donotmount);
ew (hDlg, IDC_HDF_RDB, !rdb);
- ew (hDlg, IDC_HDF_AUTOBOOT, !rdb);
- ew (hDlg, IDC_HDF_DONOTMOUNT, !rdb);
+ ew (hDlg, IDC_HDF_AUTOBOOT, TRUE);
+ ew (hDlg, IDC_HDF_DONOTMOUNT, TRUE);
SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_SETCURSEL, current_hfdlg.controller, 0);
}
+Beta 17:
+
+- Fixed b16 low latency vsync issues.
+- Possible fix for no buffer vsync tearing in D3D mode on some systems.
+- Tweaked b4 too fast cpu audio hack, it broke routines that start playing empty sample (with length=1)
+ and then near immediately reset audio pointer to correct sample. Hack detected this as a bad
+ behavior and "fixed" it causing corrupt sound. (Game Solid 2 AGA)
+- Release keys before pausing, stuck Alt if Alt-Tab pressed and emulation was set to pause when inactive.
+- Magic mouse triggered window activation/deactivation didn't handle inactive pause or sound correctly.
+- UAE controller mounted RDB hardfiles support bootable and do not mount checkboxes. "Do not mount" ticked
+ = ignore all RDB hardfile partitions, "Bootable" unticked = do not boot from any RDB hardfile
+ partition. Other boot priority values are ignored.
+- Execute drive diagnostics IDE command should also set interrupt state (if enabled)
+- Enable null filter if none and low latency vsync selected. It can't work with "none" filter.
+- gfx_contrast/gfx_luminance/gfx_gamma didn't work on the fly using uae-configuration.
+- Interlace mode detection rewritten. This should improve interlace emulation of weird programs
+ doing weird things with interlace... Do not simply mirror BPLCON0 LACE bit but also check
+ that LOF bit toggles correctly.
+- Only enable vblank waits in non-vsync modes if triple buffering is enabled. I always forget that
+ it is bad idea because on some systems it works fine, on some others it causes huge slowdowns.
+- Some Advanced Chipset panel settings were not overridden if compatible settings was enabled.
+ This could have caused strange compatibility problems even in Quickstart modes if default.uae
+ had modified advanced chipset config entries.
+- On the fly RTG vsync mode switch does not freeze the emulation anymore.
+- Fixed A1000 Quickstart ROM missing message.
+- KS 1.2 or older: map Z2 FastRAM as a non-autoconfig memory board.
+- HID joystick negative axis values broke in b15.
+
Beta 16:
- AROS CDFS update, disabled annoying and pointless "Write protected" requester.