}
}
+/* delay interrupt after current CIA register access if
+ * interrupt would have triggered mid access
+ */
static int cia_interrupt_disabled;
-
-static bool access_last_eclock(void)
-{
- if (!currprefs.cpu_cycle_exact)
- return false;
- return true;
-}
+static int cia_interrupt_delay;
static void ICR (uae_u32 data)
{
INTREQ_0 (0x8000 | data);
}
+
static void ICRA (uae_u32 data)
{
- if (cia_interrupt_disabled & 1) {
- event2_newevent_xx (-1, 4 * CYCLE_UNIT, data, ICRA);
+ ciaaicr |= 0x40;
+#if 1
+ if (currprefs.cpu_cycle_exact && !(ciaaicr & 0x20) && (cia_interrupt_disabled & 1)) {
+ cia_interrupt_delay |= 1;
+#if CIAB_DEBUG_IRQ
+ write_log(_T("ciab interrupt disabled ICR=%02X PC=%x\n"), ciabicr, M68K_GETPC);
+#endif
return;
}
- ICR (data);
- ciaaicr |= 0x40;
+#endif
+ ciaaicr |= 0x20;
+ ICR (0x0008);
}
+
static void ICRB (uae_u32 data)
{
- if (cia_interrupt_disabled & 2) {
+ ciabicr |= 0x40;
+#if 1
+ if (currprefs.cpu_cycle_exact && !(ciabicr & 0x20) && (cia_interrupt_disabled & 2)) {
+ cia_interrupt_delay |= 2;
#if CIAB_DEBUG_IRQ
write_log(_T("ciab interrupt disabled ICR=%02X PC=%x\n"), ciabicr, M68K_GETPC);
#endif
- event2_newevent_xx (-1, 4 * CYCLE_UNIT, data, ICRB);
return;
}
- ICR (data);
- ciabicr |= 0x40;
+#endif
+ ciabicr |= 0x20;
+ ICR (0x2000);
}
static void RethinkICRA (void)
if (!(ciaaicr & 0x80)) {
ciaaicr |= 0x80;
if (currprefs.cpu_cycle_exact) {
- event2_newevent_xx (-1, DIV10 + 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0x0008, ICRA);
+ event2_newevent_xx (-1, DIV10 + 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0, ICRA);
} else {
ICRA (0x0008);
}
if (!(ciabicr & 0x80)) {
ciabicr |= 0x80;
if (currprefs.cpu_cycle_exact) {
- event2_newevent_xx (-1, DIV10 + 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0x2000, ICRB);
+ event2_newevent_xx (-1, DIV10 + 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0, ICRB);
} else {
- ICRB (0x2000);
+ ICRB (0);
}
}
}
void rethink_cias (void)
{
if (ciaaicr & 0x40)
- ICRA (0x0008);
+ ICRA (0);
if (ciabicr & 0x40)
- ICRB (0x2000);
+ ICRB (0);
}
/* Figure out how many CIA timer cycles have passed for each timer since the
#endif
return ciaasdr;
case 13:
- tmp = ciaaicr & ~0x40;
+ tmp = ciaaicr & ~(0x40 | 0x20);
ciaaicr = 0;
return tmp;
case 14:
if (ciabicr & (0x80 | 0x40))
write_log (_T("CIAB IRQ cleared PC=%x\n"), M68K_GETPC);
#endif
- tmp = ciabicr & ~0x40;
+ tmp = ciabicr & ~(0x40 | 0x20);
ciabicr = 0;
return tmp;
case 14:
do_cycles (c);
if (currprefs.cpu_cycle_exact) {
cia_interrupt_disabled &= ~cianummask;
+ if ((cia_interrupt_delay & cianummask) & 1) {
+ cia_interrupt_delay &= ~1;
+ ICR(0x0008);
+ }
+ if ((cia_interrupt_delay & cianummask) & 2) {
+ cia_interrupt_delay &= ~2;
+ ICR(0x2000);
+ }
}
}
+ if (!currprefs.cpu_cycle_exact && cia_interrupt_delay) {
+ int v = cia_interrupt_delay;
+ cia_interrupt_delay = 0;
+ if (v & 1)
+ ICR(0x0008);
+ if (v & 2)
+ ICR(0x2000);
+ }
}
static bool iscia(uaecptr addr)
putpixel (buf, bpp, dx + 3, 0);
}
+#define HEATMAP_COUNT 50
static struct memory_heatmap *heatmap;
struct memory_heatmap
{
static void record_dma_heatmap (uaecptr addr, int type)
{
- if (currprefs.address_space_24 || !heatmap)
+ if (addr >= 0x01000000 || !heatmap)
return;
struct memory_heatmap *hp = &heatmap[addr / 2];
- if (hp->type != type)
- hp->cnt = 0;
+ hp->cnt = HEATMAP_COUNT;
hp->type = type;
}
#define DISK_WORDSYNC 2
#define DISK_REVOLUTION 4 /* 8,16,32,64 */
-#define DSKREADY_UP_TIME 20
-#define DSKREADY_DOWN_TIME 50
+#define DSKREADY_UP_TIME 18
+#define DSKREADY_DOWN_TIME 45
#define DSKDMA_OFF 0
#define DSKDMA_INIT 1
gui_disk_image_change (dnum, fname, drv->wrprot);
if (!drv->motoroff) {
- drv->dskready_up_time = DSKREADY_UP_TIME;
+ drv->dskready_up_time = DSKREADY_UP_TIME * 312 + (uaerand() & 511);
drv->dskready_down_time = 0;
}
if (!drive_empty (drv))
drv->dskchange = 0;
if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) {
- if (disk_debug_logging > 1)
- write_log (_T(" step ignored drive %d, %d\n"),
+ write_log (_T(" step ignored drive %d, %d\n"),
drv - floppy, (get_cycles() - drv->steplimitcycle) / CYCLE_UNIT);
return;
}
static void drive_motor (drive * drv, bool off)
{
if (drv->motoroff && !off) {
- drv->dskready_up_time = DSKREADY_UP_TIME;
+ drv->dskready_up_time = DSKREADY_UP_TIME * 312 + (uaerand() & 511);
rand_shifter (drv);
#ifdef DRIVESOUND
if (isfloppysound (drv))
}
if (!drv->motoroff && off) {
drv->drive_id_scnt = 0; /* Reset id shift reg counter */
- drv->dskready_down_time = DSKREADY_DOWN_TIME;
+ drv->dskready_down_time = DSKREADY_DOWN_TIME * 312 + (uaerand() & 511);
#ifdef DRIVESOUND
driveclick_motor (drv - floppy, 0);
#endif
void DISK_reinsert (int num)
{
drive_eject (&floppy[num]);
- setdskchangetime (&floppy[num], 100);
+ setdskchangetime (&floppy[num], 2 * 50 * 312);
}
int disk_setwriteprotect (struct uae_prefs *p, int num, const TCHAR *name, bool writeprotected)
* called from DISK_check_change() after 2 second delay
* this makes sure that all programs detect disk change correctly
*/
- setdskchangetime (drv, 100);
+ setdskchangetime (drv, 2 * 50 * 312);
} else {
- setdskchangetime (drv, 1);
+ setdskchangetime (drv, 1 * 312);
}
}
drive *drv = floppy + i;
if (drv->dskchange_time == 0 && _tcscmp (currprefs.floppyslots[i].df, changed_prefs.floppyslots[i].df))
disk_insert (i, changed_prefs.floppyslots[i].df, changed_prefs.floppyslots[i].forcedwriteprotect);
- 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)) {
- drv->dskready_up_time--;
- if (drv->dskready_up_time == 0 && !drv->motoroff)
- drv->dskready = true;
- }
- /* delay until new disk image is inserted */
- if (drv->dskchange_time > 0) {
- drv->dskchange_time--;
- if (drv->dskchange_time == 0) {
- drive_insert (drv, &currprefs, i, drv->newname, false, drv->newnamewriteprotected);
- if (disk_debug_logging > 0)
- write_log (_T("delayed insert, drive %d, image '%s'\n"), i, drv->newname);
- update_drive_gui (i, false);
- }
- }
}
}
static void disk_dma_debugmsg (void)
{
- write_log (_T("LEN=%04X (%d) SYNC=%04X PT=%08X ADKCON=%04X PC=%08X\n"),
- dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, M68K_GETPC);
+ write_log (_T("LEN=%04X (%d) SYNC=%04X PT=%08X ADKCON=%04X INTREQ=%04X PC=%08X\n"),
+ dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, intreq, M68K_GETPC);
}
/* this is very unoptimized. DSKBYTR is used very rarely, so it should not matter. */
drv->steplimit--;
if (drv->revolution_check)
drv->revolution_check--;
+
+ 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)) {
+ drv->dskready_up_time--;
+ if (drv->dskready_up_time == 0 && !drv->motoroff)
+ drv->dskready = true;
+ }
+ /* delay until new disk image is inserted */
+ if (drv->dskchange_time > 0) {
+ drv->dskchange_time--;
+ if (drv->dskchange_time == 0) {
+ drive_insert (drv, &currprefs, dr, drv->newname, false, drv->newnamewriteprotected);
+ if (disk_debug_logging > 0)
+ write_log (_T("delayed insert, drive %d, image '%s'\n"), dr, drv->newname);
+ update_drive_gui (dr, false);
+ }
+ }
+
+
}
if (indexdecay)
indexdecay--;
}
}
+static void decode_ham_border(int pix, int stoppos, bool blank)
+{
+ int todraw_amiga = res_shift_from_window (stoppos - pix);
+ while (todraw_amiga-- > 0)
+ ham_linebuf[ham_decode_pixel++] = 0;
+}
+
static void gen_pfield_tables (void)
{
int i;
}
}
+
+STATIC_INLINE bool have_color_changes(struct draw_info *di)
+{
+ return (di->nr_color_changes == 0 || (di->nr_color_changes == 1 && curr_color_changes[di->first_color_change].regno == -1));
+}
+
enum double_how {
dh_buf,
dh_line,
sprites. */
if (dp_for_drawing->ham_seen) {
init_ham_decoding ();
- if (dip_for_drawing->nr_color_changes == 0) {
+ if (!have_color_changes(dip_for_drawing)) {
/* The easy case: need to do HAM decoding only once for the
* full line. */
decode_ham (visible_left_border, visible_right_border, false);
} else /* Argh. */ {
int ohposblank = hposblank;
- do_color_changes (dummy_worker, decode_ham, lineno);
+ do_color_changes (decode_ham_border, decode_ham, lineno);
hposblank = ohposblank;
// reset colors to state before above do_color_changes()
adjust_drawing_colors (dp_for_drawing->ctable, (dp_for_drawing->ham_seen || bplehb) ? -1 : 0);
}
#endif
- if (!dosprites && (dip_for_drawing->nr_color_changes == 0 || (dip_for_drawing->nr_color_changes == 1 && curr_color_changes[dip_for_drawing->first_color_change].regno == -1))) {
+ if (!dosprites && have_color_changes(dip_for_drawing)) {
if (dp_for_drawing->plfleft < -1) {
// blanked border line
int tmp = hposblank;
int myy = (amigawin_rect.bottom - amigawin_rect.top) / 2;
mx = mx - mxx;
my = my - myy;
- if (abs(mx) < windowmouse_max_w && abs(my) < windowmouse_max_h) {
- //write_log (_T("%d:%dx%d\n"), dinput_winmouse(), mx, my);
- setmousestate (dinput_winmouse (), 0, mx, 0);
- setmousestate (dinput_winmouse (), 1, my, 0);
- } else {
- ;//write_log (_T("!!! %d:%dx%d\n"), dinput_winmouse(), mx, my);
- }
+ setmousestate (dinput_winmouse (), 0, mx, 0);
+ setmousestate (dinput_winmouse (), 1, my, 0);
}
- } else if (isfocus () < 0 && (istablet || currprefs.input_tablet >= TABLET_MOUSEHACK)) {
+ } else if (isfocus () < 0 && (istablet || currprefs.input_tablet >= TABLET_MOUSEHACK)) {
setmousestate (0, 0, mx, 1);
setmousestate (0, 1, my, 1);
}
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("1")
+#define WINUAEBETA _T("2")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2014, 5, 14)
+#define WINUAEDATE MAKEBD(2014, 5, 21)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
//#define WINUAEEXTRA _T("Amiga Forever Edition")
break;
case IDC_EJECT0:
case IDC_EJECT0Q:
- SetDlgItemText (hDlg, IDC_DF0TEXT, _T(""));
- SetDlgItemText (hDlg, IDC_DF0TEXTQ, _T(""));
+ SendDlgItemMessage (hDlg, IDC_DF0TEXT, CB_SETCURSEL, -1, 0);
+ SendDlgItemMessage (hDlg, IDC_DF0TEXTQ, CB_SETCURSEL, -1, 0);
ejectfloppy (0);
addfloppytype (hDlg, 0);
break;
case IDC_EJECT1:
case IDC_EJECT1Q:
- SetDlgItemText (hDlg, IDC_DF1TEXT, _T(""));
- SetDlgItemText (hDlg, IDC_DF1TEXTQ, _T(""));
+ SendDlgItemMessage (hDlg, IDC_DF1TEXT, CB_SETCURSEL, -1, 0);
+ SendDlgItemMessage (hDlg, IDC_DF1TEXTQ, CB_SETCURSEL, -1, 0);
ejectfloppy (1);
addfloppytype (hDlg, 1);
break;
case IDC_EJECT2:
- SetDlgItemText (hDlg, IDC_DF2TEXT, _T(""));
+ SendDlgItemMessage (hDlg, IDC_DF2TEXT, CB_SETCURSEL, -1, 0);
ejectfloppy (2);
addfloppytype (hDlg, 2);
break;
case IDC_EJECT3:
- SetDlgItemText (hDlg, IDC_DF3TEXT, _T(""));
+ SendDlgItemMessage (hDlg, IDC_DF3TEXT, CB_SETCURSEL, -1, 0);
ejectfloppy (3);
addfloppytype (hDlg, 3);
break;
1 -> E (ABC) : 0,1FE,70,70,70,70,.. (C)
1 -> F (ABCD): 0,1FE,70,70,74,70,70,70,74,70,70,70,74,.. (CCCA)
+Things that may happen in 2015:
+
+- Minium Windows version will be Windows 7.
+- CPU must be SSE 2 capable.
+- DirectDraw support will be removed.
+- and more
+
- restore only single input target to default.
+Beta 2:
+
+- Quickstart GUI disk eject button was unreliable.
+- HAM mode right border in some situations (Uridium 2 title screeen in some filter modes), also restored
+ proper operation (got broken long time ago) of original "fast mode" if HAM scanline does not have any
+ color register changes.
+- CIA update (which I forgot to mention in b1 changelog) improved, was not fully compatible if CPU was faster
+ than 68000 , do not trigger CIA interrupt while CPU is accessing any CIA register (not 100% confirmed but
+ seems to be true), this also made b1 CPU mode switching unreliable.
+- Reduced diskready (motor rotating at full speed) activation time by small amount, fixes Critical Mass / Parallax.
+- Disk inserted (if replacing existing disk) and disk ready bit setting time is now more "random", now delay time
+ counts scanlines, previously it counted vblanks (=disk was always inserted at vblank)
+- Removed 270b16 Windows 8.1 mouse bug workaround, bug seems to be fixed.
+
Beta 1:
- Audio DMA CPU wait hack (that tries to prevent missing samples if program has CPU timed audio DMA wait)