}
}
-static bool isgaylenocia (uaecptr addr)
+static bool iscia(uaecptr addr)
+{
+ uaecptr mask = addr & 0xf000;
+ return mask == 0xe000 || mask == 0xd000;
+}
+
+static bool isgaylenocia(uaecptr addr)
{
- // gayle CIA region is only 4096 bytes at 0xbfd000 and 0xbfe000
if (!isgayle ())
return true;
- uaecptr mask = addr & 0xf000;
- bool cia = mask == 0xe000 || mask == 0xd000;
- return cia;
+ // gayle CIA region is only 4096 bytes at 0xbfd000 and 0xbfe000
+ return iscia(addr);
+}
+
+static bool isgarynocia(uaecptr addr)
+{
+ return !iscia(addr) && currprefs.cs_fatgaryrev >= 0;
}
static uae_u32 REGPARAM2 cia_bget (uaecptr addr)
special_mem |= S_READ;
#endif
+ if (isgarynocia(addr))
+ return dummy_get(addr, 1, false);
+
if (!isgaylenocia (addr))
return v;
special_mem |= S_READ;
#endif
+ if (isgarynocia(addr))
+ return dummy_get(addr, 2, false);
+
if (!isgaylenocia (addr))
return v;
special_mem |= S_WRITE;
#endif
+ if (isgarynocia(addr)) {
+ dummy_put(addr, 1, false);
+ return;
+ }
+
if (!isgaylenocia (addr))
return;
special_mem |= S_WRITE;
#endif
+ if (isgarynocia(addr)) {
+ dummy_put(addr, 2, false);
+ return;
+ }
+
if (!isgaylenocia (addr))
return;
static uae_u32 REGPARAM2 clock_lget (uaecptr addr)
{
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 4, false);
+
return (clock_wget (addr) << 16) | clock_wget (addr + 2);
}
static uae_u32 REGPARAM2 clock_wget (uaecptr addr)
{
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 2, false);
+
return (clock_bget (addr) << 8) | clock_bget (addr + 1);
}
#ifdef JIT
special_mem |= S_READ;
#endif
+
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 1, false);
+
#ifdef CDTV
- if (currprefs.cs_cdtvram && addr >= 0xdc8000)
+ if (currprefs.cs_cdtvram && (addr & 0xffff) >= 0x8000)
return cdtv_battram_read (addr);
#endif
+
addr &= 0x3f;
if ((addr & 3) == 2 || (addr & 3) == 0 || currprefs.cs_rtc == 0) {
if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible)
static void REGPARAM2 clock_lput (uaecptr addr, uae_u32 value)
{
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 4, value);
+ return;
+ }
+
clock_wput (addr, value >> 16);
clock_wput (addr + 2, value);
}
static void REGPARAM2 clock_wput (uaecptr addr, uae_u32 value)
{
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 2, value);
+ return;
+ }
+
clock_bput (addr, value >> 8);
clock_bput (addr + 1, value);
}
special_mem |= S_WRITE;
#endif
// write_log(_T("W: %x (%x): %x, PC=%08x\n"), addr, (addr & 0xff) >> 2, value & 0xff, M68K_GETPC);
+
+ if ((addr & 0xffff) >= 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 1, value);
+ return;
+ }
+
#ifdef CDTV
- if (currprefs.cs_cdtvram && addr >= 0xdc8000) {
+ if (currprefs.cs_cdtvram && (addr & 0xffff) >= 0x8000) {
cdtv_battram_write (addr, value);
return;
}
#endif
+
addr &= 0x3f;
if ((addr & 1) != 1 || currprefs.cs_rtc == 0)
return;
{
uae_u32 v;
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 2, false);
if (addr & 1) {
/* think about move.w $dff005,d0.. (68020+ only) */
addr &= ~1;
#ifdef JIT
special_mem |= S_READ;
#endif
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 1, false);
v = custom_wget2 (addr & ~1, true);
v >>= (addr & 1 ? 0 : 8);
return v;
#ifdef JIT
special_mem |= S_READ;
#endif
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0)
+ return dummy_get(addr, 4, false);
return ((uae_u32)custom_wget (addr) << 16) | custom_wget (addr + 2);
}
static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int noget)
#ifdef JIT
special_mem |= S_WRITE;
#endif
+
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 2, value);
+ return;
+ }
#if CUSTOM_DEBUG > 2
write_log (_T("%d:%d:wput: %04X %04X pc=%p\n"), hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ());
#endif
static int warned;
uae_u16 rval;
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 1, value);
+ return;
+ }
if (currprefs.chipset_mask & CSMASK_AGA) {
if (addr & 1) {
rval = value & 0xff;
#ifdef JIT
special_mem |= S_WRITE;
#endif
+ if ((addr & 0xffff) < 0x8000 && currprefs.cs_fatgaryrev >= 0) {
+ dummy_put(addr, 4, value);
+ return;
+ }
custom_wput (addr & 0xfffe, value >> 16);
custom_wput ((addr + 2) & 0xfffe, (uae_u16)value);
}
}
}
-STATIC_INLINE void fill_line2 (int startpos, int len)
+static void fill_line2 (int startpos, int len)
{
int shift;
int nints, nrem;
}
}
-static void fill_line (void)
+static void fill_line_border (void)
{
- int hs = coord_hw_to_window_x (hsyncstartpos * 2);
+ int lastpos = visible_left_border;
+ int endpos = visible_left_border + gfxvidinfo.drawbuffer.inwidth;
+
+ // full hblank
if (hposblank) {
hposblank = 3;
- fill_line2 (visible_left_border, gfxvidinfo.drawbuffer.inwidth);
- } else if (hs >= gfxvidinfo.drawbuffer.inwidth) {
- fill_line2 (visible_left_border, gfxvidinfo.drawbuffer.inwidth);
- } else {
- fill_line2 (visible_left_border, hs);
- hposblank = 2;
- fill_line2 (visible_left_border + hs, gfxvidinfo.drawbuffer.inwidth);
+ fill_line2(lastpos, gfxvidinfo.drawbuffer.inwidth);
+ return;
+ }
+ // hblank not visible
+ if (hblank_left_start <= lastpos && hblank_right_stop >= endpos) {
+ fill_line2(lastpos, gfxvidinfo.drawbuffer.inwidth);
+ return;
+ }
+
+ // left, right or both hblanks visible
+ if (lastpos < hblank_left_start) {
+ int t = hblank_left_start < endpos ? hblank_left_start : endpos;
+ pfield_do_fill_line(lastpos, t, true);
+ lastpos = t;
+ }
+ if (lastpos < hblank_right_stop) {
+ int t = hblank_right_stop < endpos ? hblank_right_stop : endpos;
+ pfield_do_fill_line(lastpos, t, false);
+ lastpos = t;
+ }
+ if (lastpos < endpos) {
+ pfield_do_fill_line(lastpos, endpos, true);
}
}
if (dip_for_drawing->nr_sprites)
pfield_erase_hborder_sprites ();
- } else if (border > 0) {
- // border > 0: top or bottom border
+
+ } else if (border > 0) { // border > 0: top or bottom border
+
bool dosprites = false;
adjust_drawing_colors (dp_for_drawing->ctable, 0);
#endif
if (!dosprites && dip_for_drawing->nr_color_changes == 0) {
- fill_line ();
+ fill_line_border ();
do_flush_line (vb, gfx_ypos);
if (do_double) {
if (dh == dh_buf) {
xlinebuffer = row_map[follow_ypos] - linetoscr_x_adjust_bytes;
- fill_line ();
+ fill_line_border ();
}
/* If dh == dh_line, do_flush_line will re-use the rendered line
* from linemem. */
// top or bottom blanking region
int tmp = hposblank;
hposblank = 1;
- fill_line ();
+ fill_line_border ();
do_flush_line (vb, gfx_ypos);
hposblank = tmp;
xvbin = vbin;
xvbout = vbout;
+// int largest = 0;
for (i = 0; i < max_ypos_thisframe; i++) {
int i1 = i + min_ypos_for_screen;
int line = i + thisframe_y_adjust_real;
if (where2 < 0)
continue;
+// if (largest < where2)
+// largest = where2;
hposblank = 0;
pfield_draw_line (vbout, line, where2, amiga2aspect_line_map[i1 + 1]);
}
+ //write_log (_T("%d\n"), largest);
}
bool draw_frame (struct vidbuffer *vb)
}
static uae_u8 ramsey_config;
-static int gary_coldboot;
-static int gary_timeout;
static int garyidoffset;
+static int gary_coldboot;
+int gary_timeout;
int gary_toenb;
static void mbres_write (uaecptr addr, uae_u32 val, int size)
{
- addr &= 0xffff;
+ if ((addr & 0xffff) >= 0x8000) {
+ dummy_put(addr, size, val);
+ return;
+ }
+ addr &= 0xffff;
if (MBRES_LOG > 0)
write_log (_T("MBRES_WRITE %08X=%08X (%d) PC=%08X S=%d\n"), addr, val, size, M68K_GETPC, regs.s);
- if (1 || regs.s) { /* CPU FC = supervisor only */
+ if (addr < 0x8000 && (1 || regs.s)) { /* CPU FC = supervisor only */
uae_u32 addr2 = addr & 3;
uae_u32 addr64 = (addr >> 6) & 3;
if (addr == 0x1002)
static uae_u32 mbres_read (uaecptr addr, int size)
{
uae_u32 v = 0;
+
+ if ((addr & 0xffff) >= 0x8000)
+ return dummy_get(addr, size, false);
+
addr &= 0xffff;
if (1 || regs.s) { /* CPU FC = supervisor only (only newest ramsey/gary? never implemented?) */
extern void gayle_map_pcmcia (void);
extern int gary_toenb; // non-existing memory access = bus error.
+extern int gary_timeout; // non-existing memory access = delay
#define PCMCIA_COMMON_START 0x600000
#define PCMCIA_COMMON_SIZE 0x400000
/* Default memory access functions */
+extern void dummy_put (uaecptr addr, int size, uae_u32 val);
+extern uae_u32 dummy_get (uaecptr addr, int size, bool inst);
+
extern int REGPARAM3 default_check(uaecptr addr, uae_u32 size) REGPARAM;
extern uae_u8 *REGPARAM3 default_xlate(uaecptr addr) REGPARAM;
/* 680x0 opcode fetches */
}
}
-static void dummy_put (uaecptr addr, int size)
+// 250ms delay
+static void gary_wait(uaecptr addr, int size)
{
- if (gary_toenb && currprefs.mmu_model)
- exception2 (addr, true, size, regs.s ? 4 : 0);
+ static int cnt = 50;
+
+#if 0
+ int lines = 313 * 12;
+ while (lines-- > 0)
+ x_do_cycles(228 * CYCLE_UNIT);
+#endif
+
+ if (cnt > 0) {
+ write_log (_T("Gary timeout: %08x %d\n"), addr, size);
+ cnt--;
+ }
+}
+
+static bool gary_nonrange(uaecptr addr)
+{
+ if (addr <= 0xb80000)
+ return false;
+ if (addr >= 0xd00000 && addr < 0xdc0000)
+ return true;
+ if (addr >= 0xdd0000 && addr < 0xde0000)
+ return true;
+ if (addr >= 0xdf8000 && addr < 0xe00000)
+ return false;
+ if (addr >= 0xe80000 && addr < 0xf80000)
+ return false;
+ return true;
+}
+
+void dummy_put (uaecptr addr, int size, uae_u32 val)
+{
+ if (gary_nonrange(addr) || (size > 1 && gary_nonrange(addr + size - 1))) {
+ if (gary_timeout)
+ gary_wait (addr, size);
+ if (gary_toenb && currprefs.mmu_model)
+ exception2 (addr, true, size, regs.s ? 4 : 0);
+ }
}
-static uae_u32 dummy_get (uaecptr addr, int size, bool inst)
+uae_u32 dummy_get (uaecptr addr, int size, bool inst)
{
uae_u32 v = NONEXISTINGDATA;
- if (gary_toenb && currprefs.mmu_model) {
- exception2 (addr, false, size, (regs.s ? 4 : 0) | (inst ? 0 : 1));
+ if (gary_nonrange(addr) || (size > 1 && gary_nonrange(addr + size - 1))) {
+ if (gary_timeout)
+ gary_wait (addr, size);
+ if (gary_toenb && currprefs.mmu_model)
+ exception2 (addr, false, size, (regs.s ? 4 : 0) | (inst ? 0 : 1));
return v;
}
#endif
if (currprefs.illegal_mem)
dummylog (1, addr, 4, l, 0);
- dummy_put (addr, 4);
+ dummy_put (addr, 4, l);
}
static void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w)
{
#endif
if (currprefs.illegal_mem)
dummylog (1, addr, 2, w, 0);
- dummy_put (addr, 2);
+ dummy_put (addr, 2, w);
}
static void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b)
{
#endif
if (currprefs.illegal_mem)
dummylog (1, addr, 1, b, 0);
- dummy_put (addr, 1);
+ dummy_put (addr, 1, b);
}
static int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size)
void init_m68k (void)
{
- int i;
-
prefs_changed_cpu ();
update_68k_cycles ();
- for (i = 0 ; i < 256 ; i++) {
+ for (int i = 0 ; i < 256 ; i++) {
int j;
for (j = 0 ; j < 8 ; j++) {
if (i & (1 << j)) break;
}
movem_index1[i] = j;
- movem_index2[i] = 7-j;
+ movem_index2[i] = 7 - j;
movem_next[i] = i & (~(1 << j));
}
}
}
- if (regs.spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE)) {
- unset_special (SPCFLAG_BRK);
- // SPCFLAG_BRK breaks STOP condition, need to prefetch
- m68k_resumestopped ();
+ if (regs.spcflags & SPCFLAG_MODE_CHANGE) {
+ m68k_resumestopped();
return 1;
}
set_special (SPCFLAG_INT);
}
- if (regs.spcflags & SPCFLAG_BRK)
- return 1;
+ if (regs.spcflags & SPCFLAG_BRK) {
+ unset_special(SPCFLAG_BRK);
+#ifdef DEBUGGER
+ if (debugging)
+ debug();
+#endif
+ }
return 0;
}
#if 0
}
#endif
- unset_special(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
+ unset_special(SPCFLAG_MODE_CHANGE);
+ unset_special(SPCFLAG_BRK);
//activate_debugger();
run_func();
}
static void disasm_size (TCHAR *instrname, struct instr *dp)
{
if (dp->unsized) {
- _tcscat(instrname, _T(" "));
+ _tcscat(instrname, _T(" "));
return;
}
switch (dp->size)
_tcscat (instrname, _T(".L "));
break;
default:
- _tcscat (instrname, _T(" "));
+ _tcscat (instrname, _T(" "));
break;
}
}
p = instrname + _tcslen(instrname);
if (lookup->mnemo == i_BFFFO || lookup->mnemo == i_BFEXTS || lookup->mnemo == i_BFEXTU)
_stprintf(p, _T(",D%d"), reg);
+ } else if (lookup->mnemo == i_CPUSHA || lookup->mnemo == i_CPUSHL || lookup->mnemo == i_CPUSHP) {
+ if ((opcode & 0xc0) == 0xc0)
+ _tcscat(instrname, _T("BC"));
+ else if (opcode & 0x80)
+ _tcscat(instrname, _T("IC"));
+ else if (opcode & 0x40)
+ _tcscat(instrname, _T("DC"));
+ else
+ _tcscat(instrname, _T("?"));
+ if (lookup->mnemo == i_CPUSHL || lookup->mnemo == i_CPUSHP) {
+ TCHAR *p = instrname + _tcslen(instrname);
+ _stprintf(p, _T(",(A%d)"), opcode & 7);
+ }
} else if (lookup->mnemo == i_FPP) {
TCHAR *p;
int ins = extra & 0x3f;
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("16")
+#define WINUAEBETA _T("17")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2014, 4, 17)
+#define WINUAEDATE MAKEBD(2014, 4, 22)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
//#define WINUAEEXTRA _T("Amiga Forever Edition")
cy = (v >> (VRES_MAX - currprefs.gfx_vresolution)) - cy;
v = currprefs.gfx_xcenter_size;
- if (v <= 0)
- cw = native ? AMIGA_WIDTH_MAX * 4 : gfxvidinfo.outbuffer->outwidth;
- else
+ if (v <= 0) {
+ if (programmedmode && native) {
+ cw = gfxvidinfo.outbuffer->outwidth << (RES_MAX - currprefs.gfx_resolution);
+ } else {
+ cw = native ? AMIGA_WIDTH_MAX << RES_MAX : gfxvidinfo.outbuffer->outwidth;
+ }
+ } else {
cw = v;
+ }
cw >>= (RES_MAX - currprefs.gfx_resolution);
v = currprefs.gfx_ycenter_size;
- if (v <= 0)
- ch = native ? AMIGA_HEIGHT_MAX * 2 : gfxvidinfo.outbuffer->outheight;
- else
+ if (v <= 0) {
+ if (programmedmode && native) {
+ ch = gfxvidinfo.outbuffer->outheight << (VRES_MAX - currprefs.gfx_vresolution);
+ } else {
+ ch = native ? AMIGA_HEIGHT_MAX << VRES_MAX : gfxvidinfo.outbuffer->outheight;
+ }
+ } else {
ch = v;
+ }
ch >>= (VRES_MAX - currprefs.gfx_vresolution);
*cxp = cx;
store_custom_limits (cw, ch, cx, cy);
}
- int cw2 = cw + filter_horiz_zoom;
- int ch2 = ch + filter_vert_zoom;
+ int cw2 = cw + cw * filter_horiz_zoom;
+ int ch2 = ch + ch * filter_vert_zoom;
extraw = 0;
extrah = 0;
_tcscat (mask, _T("*.*"));
myd = my_opendir (path, mask);
int cnt = 0;
- while (cnt < 30) {
+ while (myd && cnt < 30) {
TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
if (!my_readdir (myd, tmp))
break;
discard_prefs (p, 0);
}
type2 = type;
- if (type == 0) {
+ if (type == 0 || type == 3) {
default_prefs (p, type);
#if 0
if (isdefault == 0) {
i++;
SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_SETCURSEL, i, 0);
- int range1 = workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL ? -1 : -9999;
- int range2 = workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL ? 1800 : 9999;
+ int range1, range2;
+
+ if (workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL) {
+ range1 = -1;
+ range2 = 1800;
+ } else if (workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_INTEGER || workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_INTEGER_AUTOSCALE) {
+ range1 = -99;
+ range2 = 99;
+ } else {
+ range1 = -9999;
+ range2 = 9999;
+ }
SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (range1, range2));
SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 1);
dialogreturn = 0;
if (allow_quit) {
quit_program = UAE_QUIT;
- regs.spcflags |= SPCFLAG_BRK;
+ regs.spcflags |= SPCFLAG_MODE_CHANGE;
}
}
return TRUE;
DestroyWindow (hDlg);
if (allow_quit) {
quit_program = UAE_QUIT;
- regs.spcflags |= SPCFLAG_BRK;
+ regs.spcflags |= SPCFLAG_MODE_CHANGE;
}
guiDlg = NULL;
return TRUE;
- restore only single input target to default.
+Beta 17:
+
+- Debugger breakpoints work again. (b14)
+- Full CPUSHA/CPUSHL/CPUSHP disassembly implemented.
+- Integer scale mode compatibility improved with programmed display modes.
+- Integer scale mode changes Filter panel zoom slider range to -99 to 99 and is used to adjust integer
+ scaling calculation. For example -10 means if next largest scaling factor is selected even if
+ display height is 10% too big to fit normally. (This was implemented already but it didn't
+ work properly)
+- Fixed fill_line() top/bottom background line drawing buffer overflow in some programmed modes.
+- Some programmed modes had single short background colored line in left horizontal blanking area.
+- Command line (or icon doubleclick) loaded config didn't reset previously loaded config (default.uae,
+ if it existed)
+- Emulated more Fat Gary address regions that are unmapped (CIA is same as Gayle, upper 32k in
+ clock space and Gary register space are unmapped, 0xdf0000-0xdf7fff is also unmapped)
+- Emulate Fat Gary invalid address space access timeout if Gary timeout bit is set, first 50 timeouts
+ are always logged. To prevent last moment stupid bugs or bug reports, delay is not yet enabled.
+
Beta 16:
- Borderblank blanked sprites incorrectly in some situations (b11, Roots AGA)