}
if (!cdu->tracks) {
uae_u64 siz = zfile_size (zcue);
- if (siz >= 16384 && (siz % 2048) == 0 || (siz % 2352) == 0) {
+ if (siz >= 16384 && ((siz % 2048) == 0 || (siz % 2352) == 0)) {
struct cdtoc *t = &cdu->toc[0];
cdu->tracks = 1;
t->ctrl = 4;
t->handle = zcue;
t->size = (siz % 2048) == 0 ? 2048 : 2352;
t->filesize = siz;
- write_log (L"CUE: plain CD image mounted!\n");
+ write_log (L"CD: plain CD image mounted!\n");
cdu->toc[1].address = t->address + t->filesize / t->size;
zcue = NULL;
}
}
+ if (!cdu->tracks)
+ write_log (L"CD: couldn't mount '%s'!\n", img);
+
for (i = 0; i <= cdu->tracks; i++) {
struct cdtoc *t = &cdu->toc[i];
uae_u32 msf = lsn2msf (t->address);
cfgfile_dwrite_bool (f, L"magic_mouse", p->input_magic_mouse);
cfgfile_dwrite_str (f, L"magic_mousecursor", magiccursors[p->input_magic_mouse_cursor]);
cfgfile_dwrite_str (f, L"absolute_mouse", abspointers[p->input_tablet]);
+ cfgfile_dwrite_bool (f, L"clipboard_sharing", p->clipboard_sharing);
cfgfile_write (f, L"gfx_display", L"%d", p->gfx_display);
cfgfile_write_str (f, L"gfx_display_name", p->gfx_display_name);
|| cfgfile_yesno (option, value, L"magic_mouse", &p->input_magic_mouse)
|| cfgfile_yesno (option, value, L"warp", &p->turbo_emulation)
|| cfgfile_yesno (option, value, L"headless", &p->headless)
+ || cfgfile_yesno (option, value, L"clipboard_sharing", &p->clipboard_sharing)
|| cfgfile_yesno (option, value, L"bsdsocket_emu", &p->socket_emu))
return 1;
p->picasso96_nocustom = 1;
p->cart_internal = 1;
p->sana2 = 0;
+ p->clipboard_sharing = true;
p->cs_compatible = 1;
p->cs_rtc = 2;
#endif
audio_vsync ();
blkdev_vsync ();
- DISK_vsync ();
CIA_vsync_prehandler ();
if (quit_program > 0) {
if ((intreq & 0x0020) && (intena & 0x0020))
write_log (L"vblank interrupt not cleared\n");
#endif
+ DISK_vsync ();
if (bplcon0 & 4)
lof_store = lof_store ? 0 : 1;
lof_current = lof_store;
}
set_hpos ();
#if 0
- static int ppp = 1;
- if (input_record && hsync_counter == 50 * 313 + 1) {
+ static int ppp = 2;
+ if (input_record && hsync_counter == 100 * 313 + 1) {
ppp--;
if (ppp == 0)
activate_debugger ();
sprite_width = GET_SPRITEWIDTH (fmode);
beamcon0 = new_beamcon0 = currprefs.ntscmode ? 0x00 : 0x20;
bltstate = BLT_done;
+ blit_interrupt = 1;
lof_store = lof_current = 1;
}
{
int hpos, hpos_old;
- if (cpu_tracer < 0)
- return current_hpos ();
blitter_nasty = 1;
+ if (cpu_tracer == -1)
+ return current_hpos ();
for (;;) {
int bpldma;
int blitpri = dmacon & DMA_BLITPRI;
return dr;
}
-static void decode_dma_record (int hpos, int vpos, int toggle)
+static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile)
{
struct dma_rec *dr;
int h, i, maxh, cnt;
+ uae_u32 cycles;
if (!dma_record[0])
return;
dr = &dma_record[dma_record_toggle ^ toggle][vpos * NR_DMA_REC_HPOS];
- console_out_f (L"Line: %02X %3d HPOS %02X %3d:\n", vpos, vpos, hpos, hpos);
+ if (logfile)
+ write_dlog (L"Line: %02X %3d HPOS %02X %3d:\n", vpos, vpos, hpos, hpos);
+ else
+ console_out_f (L"Line: %02X %3d HPOS %02X %3d:\n", vpos, vpos, hpos, hpos);
h = hpos;
dr += hpos;
maxh = hpos + 80;
if (maxh > maxhpos)
maxh = maxhpos;
+ cycles = vsync_cycles;
+ if (toggle)
+ cycles -= maxvpos * maxhpos * CYCLE_UNIT;
cnt = 0;
while (h < maxh) {
int col = 9;
l3[cl2++] = 'I';
if (dr->evt & DMA_EVENT_INTREQ)
l3[cl2++] = 'i';
- _stprintf (l5 + cl, L"%08X", vsync_cycles + (vpos * maxhpos + (hpos + cnt)) * CYCLE_UNIT);
+ _stprintf (l5 + cl, L"%08X", cycles + (vpos * maxhpos + (hpos + cnt)) * CYCLE_UNIT);
if (i < cols - 1 && h < maxh - 1) {
l1[cl + col - 1] = 32;
l2[cl + col - 1] = 32;
}
cnt++;
}
- console_out_f (L"%s\n", l1);
- console_out_f (L"%s\n", l2);
- console_out_f (L"%s\n", l3);
- console_out_f (L"%s\n", l4);
- console_out_f (L"%s\n", l5);
- console_out_f (L"\n");
+ if (logfile) {
+ write_dlog (L"%s\n", l1);
+ write_dlog (L"%s\n", l2);
+ write_dlog (L"%s\n", l3);
+ write_dlog (L"%s\n", l4);
+ write_dlog (L"%s\n", l5);
+ write_dlog (L"\n");
+ } else {
+ console_out_f (L"%s\n", l1);
+ console_out_f (L"%s\n", l2);
+ console_out_f (L"%s\n", l3);
+ console_out_f (L"%s\n", l4);
+ console_out_f (L"%s\n", l5);
+ console_out_f (L"\n");
+ }
}
}
+void log_dma_record (void)
+{
+ if (!debug_dma)
+ debug_dma = 1;
+ decode_dma_record (0, 0, 0, true);
+}
void record_copper (uaecptr addr, int hpos, int vpos)
{
uaecptr execbase = get_long (4);
uaecptr list = 0, node;
+ if (_totupper (t) == 'I') {
+ static const int it[] = { 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 };
+ static const int it2[] = { 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7 };
+ list = execbase + 84;
+ for (int i = 0; i < 16; i++) {
+ console_out_f (L"%2d %d: %08x\n", i + 1, it2[i], list);
+ if (it[i]) {
+ console_out_f (L" [H] %08x\n", get_long (list));
+ node = get_long (list + 8);
+ if (node) {
+ uae_u8 *addr = get_real_address (get_long (node + 10));
+ TCHAR *name = addr ? au ((char*)addr) : au("<null>");
+ console_out_f (L" %08x (C=%08X D=%08X) '%s'\n", node, get_long (list + 4), get_long (list), name);
+ xfree (name);
+ }
+ } else {
+ int cnt = 0;
+ node = get_long (list);
+ node = get_long (node);
+ while (get_long (node)) {
+ uae_u8 *addr = get_real_address (get_long (node + 10));
+ TCHAR *name = addr ? au ((char*)addr) : au("<null>");
+ console_out_f (L" [S] %08x (C=%08x D=%08X) '%s'\n", node, get_long (node + 18), get_long (node + 14), name);
+ if (i == 4 - 1 || i == 14 - 1) {
+ if (!_tcsicmp (name, L"cia-a") || !_tcsicmp (name, L"cia-b")) {
+ static const TCHAR *ciai[] = { L"A", L"B", L"ALRM", L"SP", L"FLG" };
+ uaecptr cia = node + 22;
+ for (int j = 0; j < 5; j++) {
+ uaecptr ciap = get_long (cia);
+ console_out_f (L" %5s: %08x", ciai[j], ciap);
+ if (ciap) {
+ uae_u8 *addr2 = get_real_address (get_long (ciap + 10));
+ TCHAR *name2 = addr ? au ((char*)addr2) : au("<null>");
+ console_out_f (L" (C=%08x D=%08X) '%s'", get_long (ciap + 18), get_long (ciap + 14), name2);
+ xfree (name2);
+ }
+ console_out_f (L"\n");
+ cia += 4;
+ }
+ }
+ }
+ xfree (name);
+ node = get_long (node);
+ cnt++;
+ }
+ if (!cnt)
+ console_out_f (L" [S] <none>\n");
+ }
+ list += 12;
+ }
+ return;
+ }
+
switch (_totupper (t))
{
case 'R':
if (more_params (&inptr))
v2 = readint (&inptr);
if (debug_dma) {
- decode_dma_record (v2, v1, cmd == 'v');
+ decode_dma_record (v2, v1, cmd == 'v', false);
} else {
debug_dma = v1 < 0 ? -v1 : 1;
console_out_f (L"DMA debugger enabled, mode=%d.\n", debug_dma);
if (drv->dskready_down_time > 0)
drv->dskready_down_time--;
/* emulate drive motor turn on time */
- if (drv->dskready_up_time > 0 && !drive_empty(drv)) {
+ if (drv->dskready_up_time > 0 && !drive_empty (drv)) {
drv->dskready_up_time--;
if (drv->dskready_up_time == 0 && !drv->motoroff)
drv->dskready = true;
if (disk_debug_logging > 0)
write_log (L"delayed insert, drive %d, image '%s'\n", i, drv->newname);
update_drive_gui (i);
-
}
}
}
step_pulse = data & 1;
if (disk_debug_logging > 1)
- write_log (L"%08X %02X %s drvmask=%x", M68K_GETPC, data, tobin(data), selected ^ 15);
+ write_log (L"%08X %02X->%02X %s drvmask=%x", M68K_GETPC, prev_data, data, tobin(data), selected ^ 15);
#ifdef AMAX
if (currprefs.amaxromfile[0])
write_log (L"disk %s DMA started, drvmask=%x motormask=%x PC=%08x\n",
dskdmaen == 3 ? L"write" : L"read", selected ^ 15, motormask, M68K_GETPC);
noselected = 1;
+ activate_debugger();
} else {
if (disk_debug_logging > 0) {
write_log (L"disk %s DMA started, drvmask=%x track %d mfmpos %d dmaen=%d PC=%08X\n",
void restore_disk_finish (void)
{
+ int cnt = 0;
+ for (int i = 0; i < MAX_FLOPPY_DRIVES; i++) {
+ if (currprefs.floppyslots[i].dfxtype >= 0)
+ cnt++;
+ }
+ currprefs.nr_floppies = changed_prefs.nr_floppies = cnt;
DISK_check_change ();
setamax ();
if (dskdmaen)
} else {
drv->motoroff = (state & 1) ? 0 : 1;
drv->idbit = (state & 4) ? 1 : 0;
- if (changed_prefs.nr_floppies < num)
- changed_prefs.nr_floppies = num;
switch (drv->drive_id)
{
case DRIVE_ID_35HD:
dfxtype = DRV_35_DD;
break;
}
- changed_prefs.floppyslots[num].dfxtype = dfxtype;
+ currprefs.floppyslots[num].dfxtype = changed_prefs.floppyslots[num].dfxtype = dfxtype;
}
drv->dskchange = (state & 8) ? 1 : 0;
side = (state & 16) ? 1 : 0;
_tcscpy (old, currprefs.floppyslots[num].df);
_tcsncpy (changed_prefs.floppyslots[num].df, s, 255);
xfree (s);
+ int dskready_up_time = restore_u16 ();
+ int dskready_down_time = restore_u16 ();
newis = changed_prefs.floppyslots[num].df[0] ? 1 : 0;
if (!(disabled & (1 << num))) {
if (!newis && old[0]) {
}
drv->mfmpos = mfmpos;
drv->prevtracklen = drv->tracklen;
+ drv->dskready_up_time = dskready_up_time;
+ drv->dskready_down_time = dskready_down_time;
reset_drive_gui (num);
return src;
}
if (m & 2)
drv->tracktiming[j] = restore_u16 ();
}
- drv->dskready_up_time = restore_u16 ();
- drv->dskready_down_time = restore_u16 ();
}
return src;
}
save_u32 (drv->mfmpos); /* disk position */
save_u32 (getadfcrc (drv)); /* CRC of disk image */
save_string (usepath ? currprefs.floppyslots[num].df : L"");/* image name */
+ save_u16 (drv->dskready_up_time);
+ save_u16 (drv->dskready_down_time);
*len = dst - dstbak;
return dstbak;
}
if (drv->tracktiming[0])
save_u16 (drv->tracktiming[j]);
}
- save_u16 (drv->dskready_up_time);
- save_u16 (drv->dskready_down_time);
*len = dst - dstbak;
return dstbak;
if (gclow > 0 && gcloh > 0)
ret = -1;
+ last_planes_vpos = (last_planes_vpos) & ~1;
+ plflastline_total = (plflastline_total) & ~1;
+ if (!plflastline_total)
+ plflastline_total = last_planes_vpos;
+
if (doublescan <= 0) {
int min = coord_diw_to_window_x (94);
int max = coord_diw_to_window_x (460);
#endif
addr &= 0xFFFF;
b = expamem[addr];
- //write_log (L"%08x=%02X\n", addr, b);
return b;
}
} else if (mode == 14) {
amiga_clipboard_task_start (m68k_dreg (regs, 0));
} else if (mode == 15) {
+ if (!currprefs.clipboard_sharing)
+ return 0;
amiga_clipboard_init ();
} else if (mode == 16) {
uaecptr a2 = m68k_areg (regs, 2);
addr &= 0xffff;
if (addr == 0x1000) {
/* Gayle ID */
- if ((gayle_id_cnt & 3) == 2)
- v = 0x7f;
- else
+ if (gayle_id_cnt == 0 || gayle_id_cnt == 1 || gayle_id_cnt == 3 || ((currprefs.chipset_mask & CSMASK_AGA) && gayle_id_cnt == 7))
v = 0x80;
+ else
+ v = 0x00;
gayle_id_cnt++;
}
return v;
extern void update_debug_info (void);
extern int instruction_breakpoint (TCHAR **c);
extern int debug_bankchange (int);
+extern void log_dma_record (void);
#define BREAKPOINT_TOTAL 8
struct breakpoint_node {
uae_u32 cacheholdingaddr020;
struct cache020 caches020[CACHELINES020];
+ uae_u32 startcycles;
+ int needendcycles;
int memoryoffset;
int cyclecounter, cyclecounter_pre, cyclecounter_post;
int readcounter, writecounter;
bool filesys_custom_uaefsdb;
bool mmkeyboard;
int uae_hide;
+ bool clipboard_sharing;
int mountitems;
struct uaedev_config_info mountconfig[MOUNT_CONFIG_SIZE];
struct uae_input_device mouse_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
struct uae_input_device keyboard_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
int dongle;
+ int input_contact_bounce;
};
extern int config_changed;
static int bouncy;
static signed long bouncy_cycles;
-#define BOUNCY_CYCLES 30
static int handle_input_event (int nr, int state, int max, int autofire, bool canstoprecord, bool playbackevent);
static int mouse_axis[MAX_INPUT_DEVICES][MAX_INPUT_DEVICE_EVENTS];
static int oldm_axis[MAX_INPUT_DEVICES][MAX_INPUT_DEVICE_EVENTS];
-static int mouse_x[MAX_JPORTS], mouse_y[MAX_JPORTS];
-static int mouse_delta[MAX_JPORTS][MAX_INPUT_DEVICE_EVENTS];
-static int mouse_deltanoreset[MAX_JPORTS][MAX_INPUT_DEVICE_EVENTS];
+#define MOUSE_AXIS_TOTAL 4
+
+static uae_s16 mouse_x[MAX_JPORTS], mouse_y[MAX_JPORTS];
+static uae_s16 mouse_delta[MAX_JPORTS][MOUSE_AXIS_TOTAL];
+static uae_s16 mouse_deltanoreset[MAX_JPORTS][MOUSE_AXIS_TOTAL];
static int joybutton[MAX_JPORTS];
static int joydir[MAX_JPORTS];
static int joydirpot[MAX_JPORTS][2];
-static int mouse_frame_x[MAX_JPORTS], mouse_frame_y[MAX_JPORTS];
+static uae_s16 mouse_frame_x[MAX_JPORTS], mouse_frame_y[MAX_JPORTS];
static int mouse_port[NORMAL_JPORTS];
static int cd32_shifter[NORMAL_JPORTS];
cfgfile_write (f, L"input.analog_joystick_offset", L"%d", p->input_analog_joystick_offset);
cfgfile_write (f, L"input.mouse_speed", L"%d", p->input_mouse_speed);
cfgfile_write (f, L"input.autofire_speed", L"%d", p->input_autofire_linecnt);
+ cfgfile_dwrite (f, L"input.contact_bounce", L"%d", p->input_contact_bounce);
for (id = 0; id < MAX_INPUT_SETTINGS; id++) {
for (i = 0; i < MAX_INPUT_DEVICES; i++)
write_config (f, id, i, L"joystick", &p->joystick_settings[id][i], &joysticks2[i], &idev[IDTYPE_JOYSTICK]);
pr->input_analog_joystick_mult = _tstol (value);
if (!strcasecmp (p, L"analog_joystick_offset"))
pr->input_analog_joystick_offset = _tstol (value);
+ if (!strcasecmp (p, L"contact_bounce"))
+ pr->input_contact_bounce = _tstol (value);
idnum = _tstol (p);
if (idnum <= 0 || idnum > MAX_INPUT_SETTINGS)
}
if (ie->data == 0 && old != (joybutton[joy] & (1 << ie->data)) && currprefs.cpu_cycle_exact) {
- if (!input_record && !input_play) {
+ if (!input_record && !input_play && currprefs.input_contact_bounce) {
// emulate contact bounce, 1st button only, others have capacitors
bouncy = 1;
- bouncy_cycles = get_cycles () + CYCLE_UNIT * BOUNCY_CYCLES;
+ bouncy_cycles = get_cycles () + CYCLE_UNIT * currprefs.input_contact_bounce;
}
}
save_u16 (joydirpot[i][j]);
}
}
+ for (int i = 0; i < NORMAL_JPORTS; i++) {
+ for (int j = 0; j < MOUSE_AXIS_TOTAL; j++) {
+ save_u16 (mouse_delta[i][j]);
+ save_u16 (mouse_deltanoreset[i][j]);
+ }
+ save_u16 (mouse_frame_x[i]);
+ save_u16 (mouse_frame_y[i]);
+ }
*len = dst - dstbak;
return dstbak;
}
joydirpot[i][j] = restore_u16 ();
}
}
+ for (int i = 0; i < NORMAL_JPORTS; i++) {
+ for (int j = 0; j < MOUSE_AXIS_TOTAL; j++) {
+ mouse_delta[i][j] = restore_u16 ();
+ mouse_deltanoreset[i][j] = restore_u16 ();
+ }
+ mouse_frame_x[i] = restore_u16 ();
+ mouse_frame_y[i] = restore_u16 ();
+ }
return src;
}
hc2_orig = hc2;
if (type2 == type && hc > hc2) {
write_log (L"INPREC: %010d/%03d > %010d/%03d: %d missed!\n", hc, hpos, hc2, hpos2, p[0]);
+#if ENABLE_DEBUGGER == 0
gui_message (L"INPREC missed error");
+#else
+ activate_debugger ();
+#endif
lastcycle = cycles;
inprec_plast = p;
inprec_plastptr = p + 12;
inprec_zf = zfile_fopen (fname, input_record ? L"wb" : L"rb", ZFD_NORMAL);
if (inprec_zf == NULL)
return 0;
+
+ currprefs.cs_rtc = changed_prefs.cs_rtc = 0;
+
inprec_path[0] = 0;
if (fname)
getpathpart (inprec_path, sizeof inprec_path / sizeof (TCHAR), fname);
while (inprec_pstart (INPREC_DISKINSERT)) {
int drv = inprec_pu8 ();
bool wp = inprec_pu8 () != 0;
- TCHAR tmp[MAX_DPATH];
+ TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
inprec_pstr (tmp);
+ _tcscpy (tmp2, tmp);
if (!zfile_exists (tmp)) {
- TCHAR tmp2[MAX_DPATH];
- _tcscpy (tmp2, inprec_path);
- _tcscat (tmp2, tmp);
- _tcscpy (tmp, tmp2);
+ TCHAR tmp3[MAX_DPATH];
+ _tcscpy (tmp3, inprec_path);
+ _tcscat (tmp3, tmp);
+ _tcscpy (tmp, tmp3);
+ }
+ if (!zfile_exists (tmp)) {
+ gui_message (L"INPREC: Disk image\n'%s'\nnot found!\n", tmp2);
}
_tcscpy (currprefs.floppyslots[drv].df, tmp);
_tcscpy (changed_prefs.floppyslots[drv].df, tmp);
if (inprec_pstart (INPREC_EVENT)) {
*nr = inprec_ps16 ();
*state = inprec_ps16 ();
- *max = inprec_ps16 ();
+ *max = inprec_pu16 ();
*autofire = inprec_ps16 () & 1;
inprec_pend ();
return true;
inprec_realtime (false);
}
+static void savelog (const TCHAR *path, const TCHAR *file)
+{
+ TCHAR tmp[MAX_DPATH];
+
+ _tcscpy (tmp, path);
+ _tcscat (tmp, file);
+ _tcscat (tmp, L".log.txt");
+ struct zfile *zfd = zfile_fopen (tmp, L"wb");
+ if (zfd) {
+ int loglen;
+ uae_u8 *log;
+ loglen = 0;
+ log = save_log (TRUE, &loglen);
+ if (log)
+ zfile_fwrite (log, loglen, 1, zfd);
+ xfree (log);
+ loglen = 0;
+ log = save_log (FALSE, &loglen);
+ if (log)
+ zfile_fwrite (log, loglen, 1, zfd);
+ xfree (log);
+ zfile_fclose (zfd);
+ write_log (L"log '%s' saved\n", tmp);
+ }
+}
+
static int savedisk (const TCHAR *path, const TCHAR *file, uae_u8 *data, uae_u8 *outdata)
{
int len = 0;
}
xfree (data);
zfile_fclose (zf);
+ savelog (path, file);
write_log (L"inputfile '%s' saved\n", filename);
} else {
write_log (L"failed to open '%s'\n", filename);
uaecptr a2 = a - 32;
uaecptr a3 = m68k_getpc () - 32;
write_log (L"Your Amiga program just did something terribly stupid %08X PC=%08X\n", a, M68K_GETPC);
+ //activate_debugger();
m68k_dumpstate (0, 0);
for (i = 0; i < 10; i++) {
write_log (L"%08X ", i >= 5 ? a3 : a2);
{
if (!cpu_tracer)
return true;
+ if (!cputrace.readcounter && !cputrace.writecounter && !cputrace.cyclecounter) {
+ if (cpu_tracer != -2) {
+ write_log (L"CPU trace: dma_cycle() enabled. %08x %08x NOW=%08X\n",
+ cputrace.cyclecounter_pre, cputrace.cyclecounter_post, get_cycles ());
+ cpu_tracer = -2; // dma_cycle() allowed to work now
+ }
+ }
if (cputrace.readcounter || cputrace.writecounter ||
cputrace.cyclecounter || cputrace.cyclecounter_pre || cputrace.cyclecounter_post)
return false;
x_do_cycles = x2_do_cycles;
x_do_cycles_pre = x2_do_cycles_pre;
x_do_cycles_post = x2_do_cycles_post;
- write_log (L"CPU tracer playback complete\n");
+ write_log (L"CPU tracer playback complete. STARTCYCLES=%08x NOWCYCLES=%08x\n", cputrace.startcycles, get_cycles ());
+ cputrace.needendcycles = 1;
cpu_tracer = 0;
return true;
}
struct cputracememory *ctm = &cputrace.ctm[i];
if (ctm->addr == addr && ctm->mode == mode) {
ctm->mode = 0;
- write_log (L"CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d\n",
+ write_log (L"CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d (%08X)\n",
i, cputrace.pc, addr, ctm->data, accessmode, size,
cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post,
- cputrace.readcounter, cputrace.writecounter);
+ cputrace.readcounter, cputrace.writecounter, get_cycles ());
if (accessmode == 1)
cputrace.writecounter--;
else
cputrace.cyclecounter_post = 0;
x_do_cycles (c);
} else if (cputrace.cyclecounter_pre) {
- cputrace.cyclecounter_pre = 0;
check_trace ();
return true; // argh, need to rerun the memory access..
}
x2_do_cycles (cycles);
}
}
+
+static void cputracefunc2_x_do_cycles (unsigned long cycles)
+{
+ if (cputrace.cyclecounter > cycles) {
+ cputrace.cyclecounter -= cycles;
+ return;
+ }
+ cycles -= cputrace.cyclecounter;
+ cputrace.cyclecounter = 0;
+ check_trace ();
+ x_do_cycles = x2_do_cycles;
+ if (cycles > 0)
+ x_do_cycles (cycles);
+}
+
static void cputracefunc_x_do_cycles_pre (unsigned long cycles)
{
cputrace.cyclecounter_post = 0;
}
cputrace.cyclecounter_pre = 0;
}
-static void cputracefunc_x_do_cycles_post (unsigned long cycles, uae_u32 v)
-{
- struct cputracememory *ctm = &cputrace.ctm[cputrace.memoryoffset - 1];
- ctm->data = v;
- cputrace.cyclecounter_post = cycles;
- cputrace.cyclecounter_pre = 0;
- while (cycles >= CYCLE_UNIT) {
- cycles -= CYCLE_UNIT;
- cputrace.cyclecounter_post -= CYCLE_UNIT;
- x2_do_cycles (CYCLE_UNIT);
- }
- if (cycles > 0) {
- cputrace.cyclecounter_post -= cycles;
- x2_do_cycles (cycles);
- }
- cputrace.cyclecounter_post = 0;
-}
-
-static void cputracefunc2_x_do_cycles (unsigned long cycles)
-{
- if (cputrace.cyclecounter > cycles) {
- cputrace.cyclecounter -= cycles;
- return;
- }
- cycles -= cputrace.cyclecounter;
- cputrace.cyclecounter = 0;
- check_trace ();
- x_do_cycles = x2_do_cycles;
- if (cycles > 0)
- x_do_cycles (cycles);
-}
// cyclecounter_pre = how many cycles we need to SWALLOW
// -1 = rerun whole access
static void cputracefunc2_x_do_cycles_pre (unsigned long cycles)
cputrace.cyclecounter_pre = 0;
check_trace ();
check_trace2 ();
+ x_do_cycles (cycles);
return;
}
if (cputrace.cyclecounter_pre > cycles) {
if (cycles > 0)
x_do_cycles (cycles);
}
+
+static void cputracefunc_x_do_cycles_post (unsigned long cycles, uae_u32 v)
+{
+ struct cputracememory *ctm = &cputrace.ctm[cputrace.memoryoffset - 1];
+ ctm->data = v;
+ cputrace.cyclecounter_post = cycles;
+ cputrace.cyclecounter_pre = 0;
+ while (cycles >= CYCLE_UNIT) {
+ cycles -= CYCLE_UNIT;
+ cputrace.cyclecounter_post -= CYCLE_UNIT;
+ x2_do_cycles (CYCLE_UNIT);
+ }
+ if (cycles > 0) {
+ cputrace.cyclecounter_post -= cycles;
+ x2_do_cycles (cycles);
+ }
+ cputrace.cyclecounter_post = 0;
+}
// cyclecounter_post = how many cycles we need to WAIT
static void cputracefunc2_x_do_cycles_post (unsigned long cycles, uae_u32 v)
{
if ((opcode & 0xF000) == 0xF000) {
if (warned < 20) {
- write_log (L"B-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p);
+ //write_log (L"B-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p);
warned++;
}
Exception (0xB);
}
if ((opcode & 0xF000) == 0xA000) {
if (warned < 20) {
- write_log (L"A-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p);
+ //write_log (L"A-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p);
warned++;
}
Exception (0xA);
}
while (regs.spcflags & SPCFLAG_STOP) {
+ if (cpu_tracer > 0) {
+ cputrace.stopped = regs.stopped;
+ cputrace.state = 1;
+ cputrace.pc = m68k_getpc ();
+ cputrace.memoryoffset = 0;
+ cputrace.cyclecounter = cputrace.cyclecounter_pre = cputrace.cyclecounter_post = 0;
+ cputrace.readcounter = cputrace.writecounter = 0;
+ }
x_do_cycles (currprefs.cpu_cycle_exact ? 2 * CYCLE_UNIT : 4 * CYCLE_UNIT);
if (regs.spcflags & SPCFLAG_COPPER)
do_copper ();
for (;;) {
uae_u16 opcode = r->ir;
+
#if DEBUG_CD32CDTVIO
out_cd32io (m68k_getpc ());
#endif
cputrace.stopped = r->stopped;
cputrace.state = 1;
cputrace.pc = m68k_getpc ();
+ cputrace.startcycles = get_cycles ();
cputrace.memoryoffset = 0;
cputrace.cyclecounter = cputrace.cyclecounter_pre = cputrace.cyclecounter_post = 0;
cputrace.readcounter = cputrace.writecounter = 0;
cputrace.state = 0;
}
cont:
+ if (cputrace.needendcycles) {
+ cputrace.needendcycles = 0;
+ write_log (L"STARTCYCLES=%08x ENDCYCLES=%08x\n", cputrace.startcycles, get_cycles ());
+ log_dma_record ();
+ }
+
if (r->spcflags || time_for_interrupt ()) {
if (do_specialties (0))
return;
struct regstruct *r = ®s;
for (;;) {
+ r->instruction_pc = m68k_getpc ();
uae_u16 opcode = get_iword (0);
count_instr (opcode);
+
#if 0
if (!used[opcode]) {
write_log (L"%04X ", opcode);
save_u32 (cputrace.readcounter);
save_u32 (cputrace.writecounter);
save_u32 (cputrace.memoryoffset);
- write_log (L"CPUT SAVE: PC=%08x %08x %08x %08x %d %d %d\n",
- cputrace.pc, cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post,
+ write_log (L"CPUT SAVE: PC=%08x C=%08X %08x %08x %08x %d %d %d\n",
+ cputrace.pc, cputrace.startcycles,
+ cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post,
cputrace.readcounter, cputrace.writecounter, cputrace.memoryoffset);
for (int i = 0; i < cputrace.memoryoffset; i++) {
save_u32 (cputrace.ctm[i].addr);
save_u32 (cputrace.ctm[i].mode);
write_log (L"CPUT%d: %08x %08x %08x\n", i, cputrace.ctm[i].addr, cputrace.ctm[i].data, cputrace.ctm[i].mode);
}
+ save_u32 (cputrace.startcycles);
*len = dst - dstbak;
+ cputrace.needendcycles = 1;
return dstbak;
}
cputrace.ctm[i].data = restore_u32 ();
cputrace.ctm[i].mode = restore_u32 ();
}
+ cputrace.startcycles = restore_u32 ();
+ cputrace.needendcycles = 1;
if (v && cputrace.state)
cpu_tracer = -1;
data = 0;
}
if (axisold[i][k] != data) {
- setjoystickstate (i, k, data, 32768);
+ setjoystickstate (i, k, data, 32767);
axisold[i][k] = data;
}
}
#else
#define TRACE(x)
#endif
-#define MIDI_INBUFFERS 800 //use 13 MB Buffer with this settings
+#define MIDI_INBUFFERS 100 //use 13 MB Buffer with this settings
//on my system it work ok with 10 but who
//know when windows rest for a while
//with sysex size of 40 win can 8 sec sleep
-#define INBUFFLEN 16000 //if this is not enough a warning come
+#define INBUFFLEN 24000 //if this is not enough a warning come
static int overflow,only_one_time;
BOOL midi_ready = FALSE;
BOOL midi_in_ready = FALSE;
#endif
if (seriallog)
- console_out_f (L"%c", dochar (w));
+ write_log (L"%c", dochar (w));
if (serper == 372) {
if (enforcermode & 2) {
fseek (f, 0, SEEK_END);
size = ftell (f);
fseek (f, 0, SEEK_SET);
- if (size > 30000)
- size = 30000;
+ if (*len > 0 && size > *len)
+ size = *len;
if (size > 0) {
dst = xcalloc (uae_u8, size + 1);
if (dst)
int loglen;
musip = NULL;
+ loglen = 30000;
log = save_log (TRUE, &loglen);
if (log) {
musi.UserStreamArray = mus;
musp->Buffer = log;
musp->BufferSize = loglen;
musip = &musi;
+ loglen = 30000;
log = save_log (FALSE, &loglen);
if (log) {
musi.UserStreamCount++;
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"3"
-#define WINUAEDATE MAKEBD(2010, 10, 26)
+#define WINUAEBETA L"4"
+#define WINUAEDATE MAKEBD(2010, 11, 13)
#define WINUAEEXTRA L""
#define WINUAEREV L""
lastresize--;
if (lastresize > 0) {
if (cw != lcw || ch != lch || cx != lcx || cy != lcy)
- lastresize = 50;
+ lastresize = 10;
useold = 1;
} else if (lastdelay == 0) {
lastdelay = 2;
och = ch;
ocx = cx;
ocy = cy;
- lastresize = 50;
+ lastresize = 10;
lastdelay = 0;
}
-
SetRect (sr, 0, 0, cw * scale, ch * scale);
dr->left = (temp_width - aws) /2;
dr->top = (temp_height - ahs) / 2;
OffsetRect (zr, cx * scale, cy * scale);
int ww = dr->right - dr->left;
int hh = dr->bottom - dr->top;
+ int oldwinw = currprefs.gfx_size_win.width;
+ int oldwinh = currprefs.gfx_size_win.width;
changed_prefs.gfx_size_win.width = ww;
changed_prefs.gfx_size_win.height = hh;
fixup_prefs_dimensions (&changed_prefs);
+ if (oldwinw != changed_prefs.gfx_size_win.width || oldwinh != changed_prefs.gfx_size_win.height)
+ config_changed = 1;
OffsetRect (zr, -(changed_prefs.gfx_size_win.width - ww + 1) / 2, -(changed_prefs.gfx_size_win.height - hh + 1) / 2);
filteroffsetx = -zr->left / scale;
filteroffsety = -zr->top / scale;
+Beta 4:
+
+- automatically disable battery backed up clock when input recorder is enabled
+- automatic resize didn't set "configuration changed" flag when window size changed, size timeout also changed to 10 frames (was 50)
+- 2352 byte sector plain iso images didn't mount (misplaced parenthesis in mode test..)
+- exception return address error in non-JIT fastest possible CPU modes (b1)
+- increased MIDI sysex buffer size (16000 byte buffer is not large enough, some devices send about 18000 bytes)
+- copy also log file (if enabled) when saving input recording
+- clipboard sharing can be disabled (config file only)
+- joystick/mouse button contact bounce is now off by default (config file only)
+- Gayle ID update, 0xD1 (AA), 0xD0 (normal). Real A600/A1200 confirmed (unless there are other revisions)
+
Rerecorder features:
Re-recorder = combined input and state recorder.
return out;
}
-
void write_dlog (const TCHAR *format, ...)
{
int count;
TCHAR buffer[WRITE_LOG_BUF_SIZE];
- TCHAR *ts;
+ int bufsize = WRITE_LOG_BUF_SIZE;
+ TCHAR *bufp;
va_list parms;
- if (!SHOW_CONSOLE && !console_logging && !debugfile)
+ if (!cs_init)
return;
+ premsg ();
+
EnterCriticalSection (&cs);
va_start (parms, format);
- count = _vsntprintf (buffer, WRITE_LOG_BUF_SIZE - 1, format, parms);
- ts = writets ();
+ bufp = buffer;
+ for (;;) {
+ count = _vsntprintf (bufp, bufsize - 1, format, parms);
+ if (count < 0) {
+ bufsize *= 10;
+ if (bufp != buffer)
+ xfree (bufp);
+ bufp = xmalloc (TCHAR, bufsize);
+ continue;
+ }
+ break;
+ }
+ bufp[bufsize - 1] = 0;
+ if (!_tcsncmp (bufp, L"write ", 6))
+ bufsize--;
+ if (bufp[0] == '*')
+ count++;
if (SHOW_CONSOLE || console_logging) {
- if (lfdetected && ts)
- writeconsole (ts);
- writeconsole (buffer);
+ writeconsole (bufp);
}
if (debugfile) {
- if (lfdetected && ts)
- _ftprintf (debugfile, L"%s", ts);
- _ftprintf (debugfile, L"%s", buffer);
+ _ftprintf (debugfile, L"%s", bufp);
}
lfdetected = 0;
- if (_tcslen (buffer) > 0 && buffer[_tcslen(buffer) - 1] == '\n')
+ if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n')
lfdetected = 1;
va_end (parms);
+ if (bufp != buffer)
+ xfree (bufp);
+ if (always_flush_log)
+ flush_log ();
LeaveCriticalSection (&cs);
}
if (!cs_init)
return;
- premsg();
+ premsg ();
EnterCriticalSection (&cs);
va_start (parms, format);
save_chunk (f, dst, len, L"CONF", comp);
xfree(dst);
}
+ len = 30000;
dst = save_log (TRUE, &len);
if (dst) {
save_chunk (f, dst, len, L"LOG ", comp);