}
static uae_u32 heartbeat;
-static int heartbeat_count;
+static int heartbeat_count, heartbeat_count_cont;
static int heartbeat_task;
bool filesys_heartbeat(void)
{
- return heartbeat_count > 0;
+ return heartbeat_count_cont > 0;
}
// This uses filesystem process to reduce resource usage
if (heartbeat == get_long_host(rtarea_bank.baseaddr + RTAREA_HEARTBEAT)) {
if (heartbeat_count > 0)
heartbeat_count--;
+ if (heartbeat_count_cont > 0)
+ heartbeat_count_cont--;
return;
}
heartbeat = get_long_host(rtarea_bank.baseaddr + RTAREA_HEARTBEAT);
+ heartbeat_count_cont = 10;
cia_heartbeat ();
for (u = units; u; u = u->next) {
static HWND chwnd;
static HDC hdc;
static uaecptr clipboard_data;
-static int vdelay, signaling, initialized;
+static int vdelay, vdelay2;
+static int signaling, initialized;
static uae_u8 *to_amiga;
static uae_u32 to_amiga_size;
+static int to_amiga_phase;
static int clipopen;
static int clipactive;
static int clipboard_change;
static uae_u32 to_amiga_start_cb(TrapContext *ctx, void *ud)
{
- if (!filesys_heartbeat())
- return 0;
if (trap_get_long(ctx, clipboard_data) != 0)
return 0;
if (clipboard_debug) {
#endif
trap_put_long(ctx, clipboard_data, to_amiga_size);
uae_Signal(trap_get_long(ctx, clipboard_data + 8), 1 << 13);
+ to_amiga_phase = 2;
return 1;
}
static void to_amiga_start(TrapContext *ctx)
{
+ to_amiga_phase = 0;
if (!initialized)
return;
if (!clipboard_data)
return;
- if (!ctx) {
- trap_callback(to_amiga_start_cb, NULL);
- } else {
- to_amiga_start_cb(ctx, NULL);
- }
+ to_amiga_phase = 1;
}
static uae_char *pctoamiga (const uae_char *txt)
void clipboard_vsync(void)
{
- if (!signaling || !clipboard_data)
- return;
if (!filesys_heartbeat())
return;
- vdelay--;
- if (vdelay > 0)
+ if (!clipboard_data)
return;
- trap_callback(clipboard_vsync_cb, NULL);
- vdelay = 50;
+
+ if (signaling) {
+ vdelay--;
+ if (vdelay > 0)
+ return;
+
+ trap_callback(clipboard_vsync_cb, NULL);
+ vdelay = 50;
+ }
+
+ if (vdelay2 > 0) {
+ vdelay2--;
+ //write_log(_T("vdelay2 = %d\n"), vdelay2);
+ }
+
+ if (to_amiga_phase == 1 && vdelay2 <= 0) {
+ trap_callback(to_amiga_start_cb, NULL);
+ }
+
}
void clipboard_reset(void)
{
write_log (_T("clipboard: reset (%08x)\n"), clipboard_data);
- vdelay = 100;
+ clipboard_unsafeperiod();
clipboard_free_delayed ();
clipboard_data = 0;
signaling = 0;
xfree (to_amiga);
to_amiga = NULL;
to_amiga_size = 0;
+ to_amiga_phase = 0;
clip_disabled = false;
ReleaseDC (chwnd, hdc);
}
{
clipboard_read(NULL, chwnd, true);
}
+
+// force 2 second delay before accepting new data
+void clipboard_unsafeperiod(void)
+{
+ vdelay2 = 100;
+ if (vdelay < 60)
+ vdelay = 60;
+}
#include "rp.h"
#endif
#include "statusline.h"
+#include "devices.h"
#define DM_DX_FULLSCREEN 1
#define DM_W_FULLSCREEN 2
gfxboard_toggle(r->monitor_id, -1, -1);
if (mode < -1)
return true;
+ devices_unsafeperiod();
gfxboard_rtg_disable(monid, old_index);
// can always switch from RTG to custom
if (ad->picasso_requested_on && ad->picasso_on) {
v = GFX_WINDOW;
}
*p = v;
+ devices_unsafeperiod();
updatewinfsmode(monid, &changed_prefs);
}