static int blit_maxcyclecounter, blit_slowdown, blit_totalcyclecounter;
static int blit_startcycles, blit_misscyclecounter;
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
extern uae_u8 cycle_line[256];
#endif
bltstate = BLT_read;
}
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
static int blitter_cyclecounter;
static int blitter_hcounter1, blitter_hcounter2;
blitter_doit ();
}
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
static uae_u32 preva, prevb;
STATIC_INLINE uae_u16 blitter_doblit (void)
if (real) {
p->config_version = 0;
config_newfilesystem = 0;
+ store_inputdevice_config (p);
//reset_inputdevice_config (p);
}
static int sprite_width, sprres;
int sprite_buffer_res;
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
uae_u8 cycle_line[256];
#endif
static int dbpl1mod_on, dbpl2mod_on;
static uaecptr prevbpl[2][MAXVPOS][8];
static uaecptr bplpt[8], bplptx[8];
+static uaecptr dbplpt[8];
+static int dbplpt_on[8], dbplpt_on2;
/*static int blitcount[256]; blitter debug */
STATIC_INLINE void alloc_cycle (int hpos, int type)
{
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
#if 0
if (cycle_line[hpos])
write_log (_T("hpos=%d, old=%d, new=%d\n"), hpos, cycle_line[hpos], type);
/* Programmed rates or superhires (!) disable normal DMA limits */
#define HARD_DDF_START (HARD_DDF_LIMITS_DISABLED ? 0x04 : 0x18)
-static void reset_bplmod (void)
+static void reset_bpldelays (void)
{
if (dbpl1mod_on > 0) {
bpl1mod = dbpl1mod;
bpl2mod = dbpl2mod;
dbpl2mod_on = 0;
}
+ if (dbplpt_on2) {
+ for (int i = 0; i < MAX_PLANES; i++) {
+ if (dbplpt_on[i] > 0) {
+ bplpt[i] = (bplpt[i] & 0xffff0000) | (dbplpt[i] & 0x0000fffe);
+ dbplpt_on[i] = 0;
+ }
+ }
+ dbplpt_on2 = 0;
+ }
}
static void add_modulo (int hpos, int nr)
mod = bpl1mod;
bplpt[nr] += mod;
bplptx[nr] += mod;
- reset_bplmod ();
+ reset_bpldelays ();
}
static void add_modulos (void)
{
int m1, m2;
- reset_bplmod ();
+ reset_bpldelays ();
if (fmode & 0x4000) {
if (((diwstrt >> 8) ^ vpos) & 1)
m1 = m2 = bpl2mod;
fetch_modulo_cycle = fetchunit - fetchstart;
// wacky pixels / raf megademo hires unaligned scroller feature
- if (thisline_decision.plfleft < 0) {
+ if ((thisline_decision.plfleft < 0) && bplcon0_res >= RES_HIRES) {
if (fetch_cycle & (fetchunit >> 1)) {
fetch_cycle &= ~(fetchunit_mask >> 1);
fetch_cycle += fetchunit;
{
/* Take care of the vertical DIW. */
if (vpos == plffirstline) {
- diwstate = DIW_waiting_stop;
- ddf_change = vpos;
+ // A1000 Agnus won't start bitplane DMA if vertical diw is zero.
+ if (vpos > 0 || (vpos == 0 && !currprefs.cs_dipagnus)) {
+ diwstate = DIW_waiting_stop;
+ ddf_change = vpos;
+ }
}
if (vpos == plflastline) {
diwstate = DIW_waiting_start;
bpldmasetupphase = 0;
ddfstrt_old_hpos = -1;
bpldmawasactive = false;
- reset_bplmod ();
+ reset_bpldelays ();
if (plf_state > plf_active)
plf_state = plf_idle;
{
decide_line (hpos);
decide_fetch (hpos);
+ if (dbplpt_on[num]) {
+ bplpt[num] = (bplpt[num] & 0xffff0000) | (dbplpt[num] & 0x0000fffe);
+ dbplpt_on[num] = 0;
+ }
bplpt[num] = (bplpt[num] & 0x0000ffff) | ((uae_u32)v << 16);
bplptx[num] = (bplptx[num] & 0x0000ffff) | ((uae_u32)v << 16);
//write_log (_T("%d:%d:BPL%dPTH %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip);
/* chipset feature: BPLxPTL write and next cycle doing DMA fetch using same pointer register ->
* this write goes nowhere (same happens with all DMA channels, not just BPL)
* (intro MoreNewStuffy by PlasmaForce)
+ *
+ * NEW: last fetch block does not have this side-effect, probably due to modulo adds.
+ * Also it seems only plane 0 fetches have this feature
*/
/* only detect copper accesses to prevent too fast CPU mode glitches */
- if (copper_access && is_bitplane_dma (hpos + 1) == num + 1)
+ if (copper_access && num == 0 && is_bitplane_dma (hpos + 1) == num + 1) {
+ if (plf_state < plf_wait_stop)
+ return;
+ /* modulo adds use old value! Argh! */
+ dbplpt[num] = (bplpt[num] & 0xffff0000) | (v & 0x0000fffe);
+ dbplpt_on[num] = hpos + 1;
+ dbplpt_on2 = 1;
return;
+ }
bplpt[num] = (bplpt[num] & 0xffff0000) | (v & 0x0000fffe);
bplptx[num] = (bplptx[num] & 0xffff0000) | (v & 0x0000fffe);
//write_log (_T("%d:%d:BPL%dPTL %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip);
// write to BPLxMOD one cycle before
// BPL fetch that also adds modulo:
// Old BPLxMOD value is added.
- if (is_bitplane_dma (hpos + 1) & 1) {
+ if (1 && (is_bitplane_dma (hpos + 1) & 1)) {
dbpl1mod = v;
dbpl1mod_on = hpos + 1;
} else {
decide_line (hpos);
decide_fetch (hpos);
}
- if (is_bitplane_dma (hpos + 1) & 2) {
+ if (1 && (is_bitplane_dma (hpos + 1) & 2)) {
dbpl2mod = v;
dbpl2mod_on = hpos + 1;
} else {
static void hsync_handler_post (bool onvsync)
{
last_copper_hpos = 0;
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
memset (cycle_line, 0, sizeof cycle_line);
}
vsync_handler_post ();
vpos_count = 0;
}
- // DIP Agnus (8361): vblank interrupt is triggered on line 1!
+ // A1000 DIP Agnus (8361): vblank interrupt is triggered on line 1!
if (currprefs.cs_dipagnus) {
if (vpos == 1)
send_interrupt (5, 1 * CYCLE_UNIT);
lof_lastline = lof_store != 0;
}
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
int hp = maxhpos - 1, i;
for (i = 0; i < 4; i++) {
currprefs.cs_mbdmac = changed_prefs.cs_mbdmac;
currprefs.cs_df0idhw = changed_prefs.cs_df0idhw;
currprefs.cs_slowmemisfast = changed_prefs.cs_slowmemisfast;
+ currprefs.cs_dipagnus = changed_prefs.cs_dipagnus;
+ currprefs.cs_denisenoehb = changed_prefs.cs_denisenoehb;
if (currprefs.chipset_mask != changed_prefs.chipset_mask ||
currprefs.picasso96_nocustom != changed_prefs.picasso96_nocustom ||
#endif
}
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
STATIC_INLINE void sync_copper (int hpos)
{
zfile_fwrite (sector, FS_FLOPPY_BLOCKSIZE, 1, dst);
}
-static void disk_checksum (uae_u8 *p, uae_u8 *c)
+static uae_u32 disk_checksum (uae_u8 *p, uae_u8 *c)
{
uae_u32 cs = 0;
int i;
for (i = 0; i < FS_FLOPPY_BLOCKSIZE; i+= 4)
cs += (p[i] << 24) | (p[i+1] << 16) | (p[i+2] << 8) | (p[i+3] << 0);
cs = -cs;
- c[0] = cs >> 24; c[1] = cs >> 16; c[2] = cs >> 8; c[3] = cs >> 0;
+ if (c) {
+ c[0] = cs >> 24; c[1] = cs >> 16; c[2] = cs >> 8; c[3] = cs >> 0;
+ }
+ return cs;
}
static int dirhash (const uae_char *name)
setamax ();
}
+static void load_track (int num, int cyl, int side, int *sectable)
+{
+ int oldcyl, oldside, drvsec;
+
+ drive *drv = &floppy[num];
+
+ oldcyl = drv->cyl;
+ oldside = side;
+ drv->cyl = cyl;
+ side = 0;
+ drv->buffered_cyl = -1;
+ drive_fill_bigbuf (drv, 1);
+ decode_buffer (drv->bigmfmbuf, drv->cyl, 11, drv->ddhd, drv->filetype, &drvsec, sectable, 1);
+ drv->cyl = oldcyl;
+ side = oldside;
+ drv->buffered_cyl = -1;
+}
+
int DISK_examine_image (struct uae_prefs *p, int num, struct diskinfo *di)
{
int drvsec;
int oldcyl, oldside;
ret = 0;
- memset (di, 0, sizeof di);
+ memset (di, 0, sizeof (struct diskinfo));
di->unreadable = true;
oldcyl = drv->cyl;
oldside = side;
side = oldside;
if (sectable[0] == 0 || sectable[1] == 0) {
ret = 2;
- goto end;
+ goto end2;
}
crc = crc2 = 0;
for (i = 0; i < 1024; i += 4) {
goto end;
}
di->bb_crc_valid = true;
+ writebuffer[4] = writebuffer[5] = writebuffer[6] = writebuffer[7] = 0;
+ if (get_crc32 (writebuffer, 0x31) == 0xae5e282c) {
+ di->bootblocktype = 1;
+ }
if (dos == 0x444f5300)
ret = 10;
else if (dos == 0x444f5301 || dos == 0x444f5302 || dos == 0x444f5303)
ret = 12;
else
ret = 4;
+ uae_u32 v = get_crc32 (writebuffer + 8, 0x5c - 8);
+ if (ret >= 10 && v == 0xe158ca4b) {
+ di->bootblocktype = 2;
+ }
end:
+ load_track (num, 40, 0, sectable);
+ if (sectable[0]) {
+ if (!disk_checksum (writebuffer, NULL) &&
+ writebuffer[0] == 0 && writebuffer[1] == 0 && writebuffer[2] == 0 && writebuffer[3] == 2 &&
+ writebuffer[508] == 0 && writebuffer[509] == 0 && writebuffer[510] == 0 && writebuffer[511] == 1) {
+ writebuffer[512 - 20 * 4 + 1 + writebuffer[512 - 20 * 4]] = 0;
+ TCHAR *n = au ((const char*)(writebuffer + 512 - 20 * 4 + 1));
+ if (_tcslen (n) >= sizeof (di->diskname))
+ n[sizeof (di->diskname) - 1] = 0;
+ _tcscpy (di->diskname, n);
+ xfree (n);
+ }
+ }
+end2:
drive_image_free (drv);
if (wasdelayed > 1) {
drive_eject (drv);
int ddf_left = dp_for_drawing->plfleft * 2 + DIW_DDF_OFFSET;
int ddf_right = dp_for_drawing->plfright * 2 + DIW_DDF_OFFSET;
int leftborderhidden;
+ int native_ddf_left2;
/* Compute datafetch start/stop in pixels; native display coordinates. */
native_ddf_left = coord_hw_to_window_x (ddf_left);
native_ddf_right = coord_hw_to_window_x (ddf_right);
-#if 0
- // this breaks Blerkenwiegel/Scoopex
+ // Blerkenwiegel/Scoopex workaround
+ native_ddf_left2 = native_ddf_left;
if (native_ddf_left < 0)
native_ddf_left = 0;
-#endif
+
if (native_ddf_right < native_ddf_left)
native_ddf_right = native_ddf_left;
pixels_offset = MAX_PIXELS_PER_LINE - (ddf_left << bplres);
ddf_left <<= bplres;
- leftborderhidden = playfield_start - native_ddf_left;
+ leftborderhidden = playfield_start - native_ddf_left2;
if (hblank_left_start > playfield_start)
leftborderhidden += hblank_left_start - playfield_start;
src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (leftborderhidden);
uae_u32 ad = 0;
static const int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static const int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
+ int exts[3];
+ int doext = 0;
if (!(extra & 0x4000)) {
if (fault_if_no_fpu (opcode, extra, 0, oldpc))
ad = x_cp_get_disp_ea_020 (m68k_getpc (), 0);
break;
case 4:
- ad = m68k_getpc ();
- m68k_setpc (ad + sz2[size]);
- if (size == 6)
- ad++;
+ doext = 1;
+ switch (size)
+ {
+ case 0:
+ case 1:
+ exts[0] = x_next_ilong ();
+ break;
+ case 2:
+ case 3:
+ exts[0] = x_next_ilong ();
+ exts[1] = x_next_ilong ();
+ exts[2] = x_next_ilong ();
+ break;
+ case 4:
+ exts[0] = x_next_iword ();
+ break;
+ case 5:
+ exts[0] = x_next_ilong ();
+ exts[1] = x_next_ilong ();
+ break;
+ case 6:
+ exts[0] = x_next_iword ();
+ break;
+ }
break;
default:
return 0;
switch (size)
{
case 0:
- *src = (fptype) (uae_s32) x_cp_get_long (ad);
+ *src = (fptype) (uae_s32) (doext ? exts[0] : x_cp_get_long (ad));
break;
case 1:
- *src = to_single (x_cp_get_long (ad));
+ *src = to_single ((doext ? exts[0] : x_cp_get_long (ad)));
break;
case 2:
{
if (fault_if_4060 (opcode, extra, ad, oldpc, FPU_EXP_UNIMP_DATATYPE))
return -1;
uae_u32 wrd1, wrd2, wrd3;
- wrd1 = x_cp_get_long (ad);
+ wrd1 = (doext ? exts[0] : x_cp_get_long (ad));
ad += 4;
- wrd2 = x_cp_get_long (ad);
+ wrd2 = (doext ? exts[1] : x_cp_get_long (ad));
ad += 4;
- wrd3 = x_cp_get_long (ad);
+ wrd3 = (doext ? exts[2] : x_cp_get_long (ad));
*src = to_exten (wrd1, wrd2, wrd3);
}
break;
if (fault_if_4060 (opcode, extra, ad, oldpc, FPU_EXP_UNIMP_DATATYPE))
return -1;
uae_u32 wrd1, wrd2, wrd3;
- wrd1 = x_cp_get_long (ad);
+ wrd1 = (doext ? exts[0] : x_cp_get_long (ad));
ad += 4;
- wrd2 = x_cp_get_long (ad);
+ wrd2 = (doext ? exts[1] : x_cp_get_long (ad));
ad += 4;
- wrd3 = x_cp_get_long (ad);
+ wrd3 = (doext ? exts[2] : x_cp_get_long (ad));
*src = to_pack (wrd1, wrd2, wrd3);
}
break;
case 4:
- *src = (fptype) (uae_s16) x_cp_get_word (ad);
+ *src = (fptype) (uae_s16) (doext ? exts[0] : x_cp_get_word (ad));
break;
case 5:
{
uae_u32 wrd1, wrd2;
- wrd1 = x_cp_get_long (ad);
+ wrd1 = (doext ? exts[0] : x_cp_get_long (ad));
ad += 4;
- wrd2 = x_cp_get_long (ad);
+ wrd2 = (doext ? exts[1] : x_cp_get_long (ad));
*src = to_double (wrd1, wrd2);
}
break;
case 6:
- *src = (fptype) (uae_s8) x_cp_get_byte (ad);
+ *src = (fptype) (uae_s8) (doext ? exts[0] : x_cp_get_byte (ad));
break;
default:
return 0;
case 3:
ad = x_cp_get_disp_ea_020 (m68k_getpc (), 0);
break;
+#if 0
case 4:
ad = m68k_getpc ();
m68k_setpc (ad + sz2[size]);
break;
+#endif
default:
return 0;
}
addcycles_ce020 (cycles, NULL);
}
-static void get_prefetch_ce020 (void)
+static void get_prefetch_020 (void)
{
- if (!using_ce020)
+ if (!using_prefetch_020)
return;
printf ("\tregs.irc = %s (%d);\n", prefetch_word, m68k_pc_offset);
}
-static void get_prefetch_ce020_0 (void)
+static void get_prefetch_020_0 (void)
{
- if (!using_ce020)
+ if (!using_prefetch_020)
return;
printf ("\tregs.irc = %s (0);\n", prefetch_word);
}
-
static void returntail (bool iswrite)
{
- if (!using_ce020)
+ if (!using_ce020) {
+ if (using_prefetch_020) {
+ if (!tail_ce020_done) {
+ if (!did_prefetch)
+ get_prefetch_020 ();
+ did_prefetch = 1;
+ tail_ce020_done = true;
+ }
+ }
return;
+ }
if (!tail_ce020_done) {
total_ce020 -= 2;
if (iswrite) {
total_ce020 = 1;
}
if (!did_prefetch)
- get_prefetch_ce020 ();
+ get_prefetch_020 ();
if (total_ce020 > 0)
addcycles_ce020 (total_ce020);
}
count_ncycles++;
fill_prefetch_next ();
- get_prefetch_ce020 ();
+ get_prefetch_020 ();
}
static void genmovemel_ce (uae_u16 opcode)
}
count_ncycles++;
fill_prefetch_next ();
- get_prefetch_ce020 ();
+ get_prefetch_020 ();
}
static void genmovemle_ce (uae_u16 opcode)
static void resetvars (void)
{
- memory_cycle_cnt = 4;
insn_n_cycles = using_prefetch ? 0 : 4;
insn_n_cycles020 = 0;
ir2irc = 0;
do_cycles = "do_cycles_ce020";
nextw = "next_iword_020ce";
nextl = "next_ilong_020ce";
- memory_cycle_cnt = 3;
} else if (using_ce020 == 2) {
// 68030 CE
disp020 = "x_get_disp_ea_ce030";
do_cycles = "do_cycles_ce020";
nextw = "next_iword_030ce";
nextl = "next_ilong_030ce";
- memory_cycle_cnt = 3;
} else if (using_prefetch_020) {
disp020 = "x_get_disp_ea_020";
prefetch_word = "get_word_020_prefetch";
dstb = "x_put_byte";
nextw = "next_iword_020_prefetch";
nextl = "next_ilong_020_prefetch";
- memory_cycle_cnt = 2;
}
#if 0
} else if (using_ce020) {
printf ("\tregs.sr = sr;\n");
setpc ("pc");
printf ("\tMakeFromSR ();\n");
+ } else if (cpu_level == 1 && using_prefetch) {
+ int old_brace_level = n_braces;
+ if (next_cpu_level < 0)
+ next_cpu_level = 0;
+ printf ("\tuae_u16 newsr; uae_u32 newpc;\n");
+ printf ("\tfor (;;) {\n");
+ printf ("\t\tuaecptr a = m68k_areg (regs, 7);\n");
+ printf ("\t\tuae_u16 sr = %s (a);\n", srcw);
+ printf ("\t\tuae_u32 pc = %s (a + 2);\n", srcl);
+ printf ("\t\tuae_u16 format = %s (a + 2 + 4);\n", srcw);
+ printf ("\t\tint frame = format >> 12;\n");
+ printf ("\t\tint offset = 8;\n");
+ printf ("\t\tnewsr = sr; newpc = pc;\n");
+ printf ("\t\tif (frame == 0x0) { m68k_areg (regs, 7) += offset; break; }\n");
+ printf ("\t\telse if (frame == 0x8) { m68k_areg (regs, 7) += offset + 50; break; }\n");
+ printf ("\t\telse { m68k_areg (regs, 7) += offset; Exception (14); goto %s; }\n", endlabelstr);
+ printf ("\t\tregs.sr = newsr; MakeFromSR ();\n}\n");
+ pop_braces (old_brace_level);
+ printf ("\tregs.sr = newsr; MakeFromSR ();\n");
+ printf ("\tif (newpc & 1) {\n");
+ printf ("\t\texception3i (0x%04X, newpc);\n", opcode);
+ printf ("\t\tgoto %s;\n", endlabelstr);
+ printf ("\t}\n");
+ setpc ("newpc");
+ printf ("\tipl_fetch ();\n");
+ need_endlabel = 1;
} else {
int old_brace_level = n_braces;
if (next_cpu_level < 0)
printf ("didnt_jump:;\n");
need_endlabel = 1;
sync_m68k_pc ();
- get_prefetch_ce020_0 ();
+ get_prefetch_020_0 ();
if (curi->size == sz_byte) {
addcycles000 (2);
irc2ir ();
printf ("\t}\n");
setpc ("oldpc + %d", m68k_pc_offset);
m68k_pc_offset = 0;
- get_prefetch_ce020_0 ();
+ get_prefetch_020_0 ();
fill_prefetch_full_000 ();
insn_n_cycles = 12;
need_endlabel = 1;
}
postfix = id;
- if (id == 0 || id == 11 || id == 12 || id == 20 || id == 21 || id == 22 || id == 31 || id == 32 || id == 33) {
+ if (id == 0 || id == 11 || id == 13 || id == 20 || id == 21 || id == 22 || id == 31 || id == 32 || id == 33) {
if (generate_stbl)
fprintf (stblfile, "#ifdef CPUEMU_%d%s\n", postfix, extraup);
postfix2 = postfix;
using_ce020 = 0;
using_mmu = 0;
using_waitstates = 0;
+ memory_cycle_cnt = 4;
mmu_postfix = "";
- if (id == 11 || id == 12) { // 11 = 68000 prefetch, 12 = 68000 cycle-exact
- cpu_level = 0;
+ if (id == 11 || id == 12) { // 11 = 68010 prefetch, 12 = 68000 prefetch
+ cpu_level = id == 11 ? 1 : 0;
using_prefetch = 1;
using_exception_3 = 1;
- if (id == 12)
- using_ce = 1;
- for (rp = 0; rp < nr_cpuop_funcs; rp++)
- opcode_next_clev[rp] = 0;
+ if (id == 11) {
+ read_counts ();
+ for (rp = 0; rp < nr_cpuop_funcs; rp++)
+ opcode_next_clev[rp] = cpu_level;
+ }
+ } else if (id == 13 || id == 14) { // 13 = 68010 cycle-exact, 14 = 68000 cycle-exact
+ cpu_level = id == 13 ? 1 : 0;
+ using_prefetch = 1;
+ using_exception_3 = 1;
+ using_ce = 1;
+ if (id == 13) {
+ read_counts ();
+ for (rp = 0; rp < nr_cpuop_funcs; rp++)
+ opcode_next_clev[rp] = cpu_level;
+ }
} else if (id == 20) { // 68020 prefetch
cpu_level = 2;
using_prefetch_020 = 2;
// clock memory accesses, 68020 has 3 clock
// memory accesses
using_waitstates = 1;
+ memory_cycle_cnt = 3;
read_counts ();
for (rp = 0; rp < nr_cpuop_funcs; rp++)
opcode_next_clev[rp] = cpu_level;
cpu_level = 3 + (24 - id);
using_ce020 = 2;
using_prefetch_020 = 2;
+ memory_cycle_cnt = 2;
if (id == 22) {
read_counts ();
for (rp = 0; rp < nr_cpuop_funcs; rp++)
using_ce = 0;
for (i = 0; i <= 33; i++) {
- if ((i >= 6 && i < 11) || (i > 12 && i < 20) || (i > 24 && i < 31))
+ if ((i >= 6 && i < 11) || (i > 14 && i < 20) || (i > 24 && i < 31))
continue;
generate_stbl = 1;
generate_cpu (i, 0);
x_do_cycles_post (clocks * cpucycleunit, val);
}
-STATIC_INLINE void resetcycles_ce020 (void)
-{
- regs.ce020memcycles = 0;
- regs.ce020memcycle_data = true;
-}
-
#if 0
STATIC_INLINE void do_head_cycles_ce020 (int h)
{
#endif
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
STATIC_INLINE void do_cycles_ce000 (int clocks)
{
uae_u32 crc32;
bool hd;
bool unreadable;
+ int bootblocktype;
+ TCHAR diskname[110];
};
extern void DISK_init (void);
extern void write_inputdevice_config (struct uae_prefs *p, struct zfile *f);
extern void read_inputdevice_config (struct uae_prefs *p, const TCHAR *option, TCHAR *value);
extern void reset_inputdevice_config (struct uae_prefs *pr);
+extern void store_inputdevice_config (struct uae_prefs *pr);
+extern void restore_inputdevice_config (struct uae_prefs *p, int portnum);
extern int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value, int portnum, int mode, int type);
extern int inputdevice_getjoyportdevice (int port, int val);
+extern void inputdevice_validate_jports (struct uae_prefs *p, int changedport);
extern void inputdevice_init (void);
extern void inputdevice_close (void);
extern const struct cputbl op_smalltbl_21_ff[]; // CE
/* 68010 */
extern const struct cputbl op_smalltbl_4_ff[];
+extern const struct cputbl op_smalltbl_11_ff[]; // prefetch
+extern const struct cputbl op_smalltbl_13_ff[]; // CE
/* 68000 */
extern const struct cputbl op_smalltbl_5_ff[];
-extern const struct cputbl op_smalltbl_11_ff[]; // prefetch
-extern const struct cputbl op_smalltbl_12_ff[]; // CE
+extern const struct cputbl op_smalltbl_12_ff[]; // prefetch
+extern const struct cputbl op_smalltbl_14_ff[]; // CE
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl");
for (i = 1; events[i].name; i++) {
if (!_tcscmp (s, events[i].confname)) {
- handle_input_event (i, _tstol (parm), 1, 0, false, false);
+ handle_input_event (i, parm ? _tstol (parm) : 0, 1, 0, false, false);
return 1;
}
}
x -= mouseoffset_x + 1;
y -= mouseoffset_y + 2;
- write_log (_T("%04dx%04d %08x\n"), x, y, buttonbits);
+ //write_log (_T("%04dx%04d %08x\n"), x, y, buttonbits);
p[MH_ABSX] = x >> 8;
p[MH_ABSX + 1] = x;
debug_parser (p + 4, NULL, -1);
} else if (!_tcsnicmp (p, _T("kbr "), 4)) {
inject_events (p + 4);
+ } else if (!_tcsnicmp (p, _T("evt "), 4)) {
+ TCHAR *pp = _tcschr (p + 4, ' ');
+ p += 4;
+ if (pp)
+ *pp++ = 0;
+ inputdevice_uaelib (p, pp);
} else {
cfgfile_parse_line (&changed_prefs, p, 0);
}
}
static uae_u8 keybuf[256];
-static int inputcode_pending, inputcode_pending_state;
+#define MAX_PENDING_EVENTS 20
+static int inputcode_pending[MAX_PENDING_EVENTS], inputcode_pending_state[MAX_PENDING_EVENTS];
void inputdevice_release_all_keys (void)
{
void inputdevice_add_inputcode (int code, int state)
{
- inputcode_pending = code;
- inputcode_pending_state = state;
+ for (int i = 0; i < MAX_PENDING_EVENTS; i++) {
+ if (inputcode_pending[i] == code && inputcode_pending_state[i] == state)
+ return;
+ }
+ for (int i = 0; i < MAX_PENDING_EVENTS; i++) {
+ if (inputcode_pending[i] == 0) {
+ inputcode_pending[i] = code;
+ inputcode_pending_state[i] = state;
+ return;
+ }
+ }
}
void inputdevice_do_keyboard (int code, int state)
return false;
}
-void inputdevice_handle_inputcode (void)
+static bool inputdevice_handle_inputcode2 (int code, int state)
{
static int swapperslot;
- int code = inputcode_pending;
- int state = inputcode_pending_state;
static int tracer_enable;
if (code == 0)
if (needcputrace (code) && can_cpu_tracer () == true && is_cpu_tracer () == false && !input_play && !input_record && !debugging) {
if (set_cpu_tracer (true)) {
tracer_enable = 1;
- return; // wait for next frame
+ return true; // wait for next frame
}
}
- inputcode_pending = 0;
-
if (vpos != 0)
write_log (_T("inputcode=%d but vpos = %d"), code, vpos);
#endif
if (!state)
- return;
+ return false;
switch (code)
{
case AKS_ENTERGUI:
set_cpu_tracer (false);
tracer_enable = 0;
}
+ return false;
+}
+
+void inputdevice_handle_inputcode (void)
+{
+ bool got = false;
+ for (int i = 0; i < MAX_PENDING_EVENTS; i++) {
+ int code = inputcode_pending[i];
+ int state = inputcode_pending_state[i];
+ if (code) {
+ if (!inputdevice_handle_inputcode2 (code, state))
+ inputcode_pending[i] = 0;
+ got = true;
+ }
+ }
+ if (!got)
+ inputdevice_handle_inputcode2 (0, 0);
}
+
static int getqualid (int evt)
{
if (evt > INPUTEVENT_SPC_QUALIFIER_START && evt < INPUTEVENT_SPC_QUALIFIER_END)
TCHAR *name = NULL;
int otherbuttonpressed = 0;
+ //write_log (_T("switchdevice '%s' %d %d\n"), id->name, num, buttonmode);
+
if (num >= 4)
return 0;
#ifdef RETROPLATFORM
} else {
newport = num ? 1 : 0;
}
+ //write_log (_T("newport = %d\n"), newport);
/* "GamePorts" switch if in GamePorts mode or Input mode and GamePorts port was not NONE */
if (currprefs.input_selected_setting == GAMEPORT_INPUT_SETTINGS || currprefs.jports[newport].id != JPORT_NONE) {
+ //write_log (_T("GAMEPORTS MODE\n"));
if ((num == 0 || num == 1) && currprefs.jports[newport].id != JPORT_CUSTOM) {
+ //write_log (_T("Port supported\n"));
int om = jsem_ismouse (num, &currprefs);
int om1 = jsem_ismouse (0, &currprefs);
int om2 = jsem_ismouse (1, &currprefs);
- if ((om1 >= 0 || om2 >= 0) && ismouse)
+ if ((om1 >= 0 || om2 >= 0) && ismouse) {
+ //write_log (_T("END3\n"));
return 0;
- if (flags)
+ }
+ if (flags) {
+ //write_log (_T("END2\n"));
return 0;
+ }
if (name) {
+#if 1
+ if (ismouse) {
+ int nummouse = 0; // count number of non-supermouse mice
+ int supermouse = -1;
+ for (i = 0; i < idev[IDTYPE_MOUSE].get_num (); i++) {
+ if (!idev[IDTYPE_MOUSE].get_flags (i))
+ nummouse++;
+ else
+ supermouse = i;
+ }
+ if (supermouse >= 0 && nummouse == 1) {
+ name = idev[IDTYPE_MOUSE].get_uniquename (supermouse);
+ }
+ }
+#endif
write_log (_T("inputdevice change '%s':%d->%d\n"), name, num, newport);
inputdevice_joyport_config (&changed_prefs, name, newport, -1, 2);
+ inputdevice_validate_jports (&changed_prefs, -1);
inputdevice_copyconfig (&changed_prefs, &currprefs);
return 1;
}
}
+ //write_log (_T("END1\n"));
return 0;
} else {
+ //write_log (_T("INPUTPANEL MODE\n"));
int oldport = getoldport (id);
int k, evt;
struct inputevent *ie, *ie2;
}
write_log (_T("inputdevice change '%s':%d->%d\n"), name, num, newport);
inputdevice_copyconfig (&currprefs, &changed_prefs);
+ inputdevice_validate_jports (&changed_prefs, -1);
inputdevice_copyconfig (&changed_prefs, &currprefs);
return 1;
}
return;
if (!joysticks[joy].enabled) {
if (v1 && v1 != v2)
- switchdevice (&joysticks[joy], axis * 2 + (v1 < 0 ? 0 : 1), false);
+ switchdevice (&joysticks[joy], v1 < 0 ? 0 : 1, false);
return;
}
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
return v;
}
+static struct jport stored_ports[MAX_JPORTS];
+
+static void fixjport (struct jport *port, int add)
+{
+ int vv = port->id;
+ if (vv == JPORT_CUSTOM || vv == JPORT_NONE)
+ return;
+ if (vv >= JSEM_JOYS && vv < JSEM_MICE) {
+ vv -= JSEM_JOYS;
+ vv += add;
+ if (vv >= inputdevice_get_device_total (IDTYPE_JOYSTICK))
+ vv = 0;
+ vv += JSEM_JOYS;
+ } else if (vv >= JSEM_MICE && vv < JSEM_END) {
+ vv -= JSEM_MICE;
+ vv += add;
+ if (vv >= inputdevice_get_device_total (IDTYPE_MOUSE))
+ vv = 0;
+ vv += JSEM_MICE;
+ } else if (vv >= JSEM_KBDLAYOUT && vv < JSEM_LASTKBD) {
+ vv -= JSEM_KBDLAYOUT;
+ vv += add;
+ if (vv >= JSEM_LASTKBD)
+ vv = 0;
+ vv += JSEM_KBDLAYOUT;
+ }
+ port->id = vv;
+}
+
+void inputdevice_validate_jports (struct uae_prefs *p, int changedport)
+{
+ int i, j;
+ for (i = 0; i < MAX_JPORTS; i++)
+ fixjport (&p->jports[i], 0);
+ for (i = 0; i < MAX_JPORTS; i++) {
+ if (p->jports[i].id < 0)
+ continue;
+ for (j = 0; j < MAX_JPORTS; j++) {
+ if (p->jports[j].id < 0)
+ continue;
+ if (j == i)
+ continue;
+ if (p->jports[i].id == p->jports[j].id) {
+ if (i == changedport) {
+ restore_inputdevice_config (p, j);
+ } else if (j == changedport) {
+ restore_inputdevice_config (p, i);
+ }
+ int cnt = 0;
+ while (p->jports[i].id == p->jports[j].id) {
+ int k;
+ if (i == changedport) {
+ k = j;
+ } else {
+ k = i;
+ }
+ fixjport (&p->jports[k], 1);
+ cnt++;
+ if (cnt > 10)
+ p->jports[k].id = JSEM_KBDLAYOUT;
+ if (cnt > 20)
+ break;
+ }
+ }
+ }
+ }
+}
+
+static bool inputdevice_inserted (struct uae_prefs *p, int portnum, int id, int mode, int type)
+{
+ for (int k = 0; k < MAX_JPORTS; k++) {
+ if (p->jports[k].id == id && k != portnum) {
+ if (type == IDTYPE_JOYSTICK) {
+ // if this joystick is already in port 0, reset port 0 back to original
+ // and insert joystick in port 1. Probably what user wanted.
+ if (k == 0 && portnum == 1) {
+ memcpy (&p->jports[0], &stored_ports[0], sizeof (struct jport));
+ return false;
+ }
+ } else if (type == IDTYPE_MOUSE) {
+ return true;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+void store_inputdevice_config (struct uae_prefs *p)
+{
+ for (int i = 0; i < MAX_JPORTS; i++) {
+ memcpy (&stored_ports[i], &p->jports[i], sizeof (struct jport));
+ }
+}
+void restore_inputdevice_config (struct uae_prefs *p, int portnum)
+{
+ memcpy (&p->jports[portnum], &stored_ports[portnum], sizeof (struct jport));
+}
+
int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value, int portnum, int mode, int type)
{
switch (type)
TCHAR *name1 = idf->get_friendlyname (i);
TCHAR *name2 = idf->get_uniquename (i);
if ((name1 && !_tcscmp (name1, value)) || (name2 && !_tcscmp (name2, value))) {
- p->jports[portnum].id = idnum + i;
- if (mode >= 0)
- p->jports[portnum].mode = mode;
- set_config_changed ();
- return 1;
+ if (!inputdevice_inserted (p, portnum, idnum + 1, mode, type)) {
+ p->jports[portnum].id = idnum + i;
+ if (mode >= 0)
+ p->jports[portnum].mode = mode;
+ set_config_changed ();
+ return 1;
+ }
+ return 0;
}
}
}
case 0:
{
int start = JPORT_NONE, got = 0, max = -1;
+ int type = -1;
const TCHAR *pp = 0;
if (_tcsncmp (value, _T("kbd"), 3) == 0) {
start = JSEM_KBDLAYOUT;
got = 1;
max = JSEM_LASTKBD;
} else if (_tcsncmp (value, _T("joy"), 3) == 0) {
+ type = IDTYPE_JOYSTICK;
start = JSEM_JOYS;
pp = value + 3;
got = 1;
max = idev[IDTYPE_JOYSTICK].get_num ();
} else if (_tcsncmp (value, _T("mouse"), 5) == 0) {
+ type = IDTYPE_MOUSE;
start = JSEM_MICE;
pp = value + 5;
got = 1;
}
}
if (got == 2) {
+ if (inputdevice_inserted (p, portnum, start, mode, type))
+ return 0;
p->jports[portnum].id = start;
if (mode >= 0)
p->jports[portnum].mode = mode;
p->cpu_compatible = 1;
p->address_space_24 = 1;
#endif
-#if !defined (CPUEMU_11) && !defined (CPUEMU_12)
+#if !defined (CPUEMU_11) && !defined (CPUEMU_13)
p->cpu_compatible = 0;
p->address_space_24 = 0;
#endif
-#if !defined (CPUEMU_12)
+#if !defined (CPUEMU_13)
p->cpu_cycle_exact = p->blitter_cycle_exact = 0;
#endif
#ifndef AGA
#if !defined (UAESERIAL)
p->uaeserial = 0;
#endif
-#if defined (CPUEMU_12)
+#if defined (CPUEMU_13)
if (p->cpu_cycle_exact) {
if (p->gfx_framerate > 1) {
error_log (_T("Cycle-exact requires disabled frameskip."));
} else if (!currprefs.cpu_cycle_exact) {
// 68020+ no ce
if (currprefs.cpu_compatible) {
- if (currprefs.cpu_model == 68020) {
+ if (currprefs.cpu_model == 68020 && !currprefs.cachesize) {
x_prefetch = get_word_prefetch;
x_prefetch_long = get_long_prefetch;
x_get_ilong = get_long_020_prefetch;
x_do_cycles_pre = do_cycles;
x_do_cycles_post = do_cycles_post;
} else {
- // 68030+ does not have real prefetch only emulation
+ // JIT or 68030+ does not have real prefetch only emulation
x_prefetch = NULL;
x_prefetch_long = NULL;
x_get_ilong = get_ilong;
case 68010:
lvl = 1;
tbl = op_smalltbl_4_ff;
+#ifdef CPUEMU_11
+ if (currprefs.cpu_compatible)
+ tbl = op_smalltbl_11_ff; /* prefetch */
+#endif
+#ifdef CPUEMU_13
+ if (currprefs.cpu_cycle_exact)
+ tbl = op_smalltbl_13_ff; /* prefetch and cycle-exact */
+#endif
break;
#endif
#endif
tbl = op_smalltbl_5_ff;
#ifdef CPUEMU_11
if (currprefs.cpu_compatible)
- tbl = op_smalltbl_11_ff; /* prefetch */
+ tbl = op_smalltbl_12_ff; /* prefetch */
#endif
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
if (currprefs.cpu_cycle_exact)
- tbl = op_smalltbl_12_ff; /* prefetch and cycle-exact */
+ tbl = op_smalltbl_14_ff; /* prefetch and cycle-exact */
#endif
break;
}
|| currprefs.fpu_no_unimplemented != changed_prefs.fpu_no_unimplemented
|| currprefs.cpu_compatible != changed_prefs.cpu_compatible
|| currprefs.cpu_cycle_exact != changed_prefs.cpu_cycle_exact) {
-
+ bool doprefetch = !currprefs.cpu_compatible && changed_prefs.cpu_compatible;
prefs_changed_cpu ();
- if (!currprefs.cpu_compatible && changed_prefs.cpu_compatible)
+ if (doprefetch)
fill_prefetch ();
build_cpufunctbl ();
changed = true;
#endif
}
-#ifdef CPUEMU_12
+#ifdef CPUEMU_13
/* cycle-exact exception handler, 68000 only */
write_log (_T("Exception %d (%x) at %x -> %x!\n"), nr, last_addr_for_exception_3, currpc, get_long (4 * nr));
goto kludge_me_do;
}
- m68k_areg (regs, 7) -= 6;
- x_put_word (m68k_areg (regs, 7) + 4, currpc); // write low address
- if (interrupt) {
- // fetch interrupt vector number
- nr = x_get_byte (0x00fffff1 | ((nr - 24) << 1));
- x_do_cycles (4 * cpucycleunit);
+ if (currprefs.cpu_model == 68010) {
+ // 68010 creates only format 0 and 8 stack frames
+ m68k_areg (regs, 7) -= 8;
+ x_put_word (m68k_areg (regs, 7) + 4, currpc); // write low address
+ if (interrupt) {
+ // fetch interrupt vector number
+ nr = x_get_byte (0x00fffff1 | ((nr - 24) << 1));
+ x_do_cycles (4 * cpucycleunit);
+ }
+ x_put_word (m68k_areg (regs, 7) + 0, regs.sr); // write SR
+ x_put_word (m68k_areg (regs, 7) + 2, currpc >> 16); // write high address
+ x_put_word (m68k_areg (regs, 7) + 6, nr * 4);
+ } else {
+ m68k_areg (regs, 7) -= 6;
+ x_put_word (m68k_areg (regs, 7) + 4, currpc); // write low address
+ if (interrupt) {
+ // fetch interrupt vector number
+ nr = x_get_byte (0x00fffff1 | ((nr - 24) << 1));
+ x_do_cycles (4 * cpucycleunit);
+ }
+ x_put_word (m68k_areg (regs, 7) + 0, regs.sr); // write SR
+ x_put_word (m68k_areg (regs, 7) + 2, currpc >> 16); // write high address
}
- x_put_word (m68k_areg (regs, 7) + 0, regs.sr); // write SR
- x_put_word (m68k_areg (regs, 7) + 2, currpc >> 16); // write high address
kludge_me_do:
- newpc = x_get_word (4 * nr) << 16; // read high address
- newpc |= x_get_word (4 * nr + 2); // read low address
+ newpc = x_get_word (regs.vbr + 4 * nr) << 16; // read high address
+ newpc |= x_get_word (regs.vbr + 4 * nr + 2); // read low address
if (newpc & 1) {
if (nr == 2 || nr == 3)
cpu_halt (2);
if (currprefs.cachesize)
regs.instruction_pc = address == -1 ? m68k_getpc () : address;
#endif
-#ifdef CPUEMU_12
- if (currprefs.cpu_cycle_exact && currprefs.cpu_model == 68000)
+#ifdef CPUEMU_13
+ if (currprefs.cpu_cycle_exact && currprefs.cpu_model <= 68010)
Exception_ce000 (nr);
else
#endif
}
#endif
do_cycles (cpu_cycles);
+ r->instruction_pc = m68k_getpc ();
cpu_cycles = (*cpufunctbl[opcode])(opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
if (r->spcflags) {
#endif /* CPUEMU_11 */
-#ifndef CPUEMU_12
+#ifndef CPUEMU_13
static void m68k_run_1_ce (void)
{
inprec_playdebug_cpu (1);
}
+ r->instruction_pc = m68k_getpc ();
(*cpufunctbl[opcode])(opcode);
if (cpu_tracer) {
cputrace.state = 0;
x_do_cycles (cpu_cycles);
- opcode = get_word_020_prefetch (0);
+ opcode = regs.irc;
count_instr (opcode);
cpu_cycles = (*cpufunctbl[opcode])(opcode);
run_func = m68k_run_mmu;
} else {
#endif
- run_func = currprefs.cpu_cycle_exact && currprefs.cpu_model == 68000 ? m68k_run_1_ce :
- currprefs.cpu_compatible && currprefs.cpu_model == 68000 ? m68k_run_1 :
+ run_func = currprefs.cpu_cycle_exact && currprefs.cpu_model <= 68010 ? m68k_run_1_ce :
+ currprefs.cpu_compatible && currprefs.cpu_model <= 68010 ? m68k_run_1 :
#ifdef JIT
currprefs.cpu_model >= 68020 && currprefs.cachesize ? m68k_run_jit :
#endif
// these are also used by 68030.
#define RESET_CE020_CYCLES \
- resetcycles_ce020 ()
+ regs.ce020memcycles = 0; \
+ regs.ce020memcycle_data = true;
#define STORE_CE020_CYCLES \
unsigned long cycs = get_cycles ()
#define ADD_CE020_CYCLES \
uaecptr pc = m68k_getpc ();
pc &= ~3;
fill_icache030 (pc);
- do_cycles_ce020 (2);
+ if (currprefs.cpu_cycle_exact)
+ do_cycles_ce020 (2);
regs.prefetch020[0] = regs.cacheholdingdata020;
fill_icache030 (pc + 4);
- do_cycles_ce020 (2);
+ if (currprefs.cpu_cycle_exact)
+ do_cycles_ce020 (2);
regs.prefetch020[1] = regs.cacheholdingdata020;
regs.irc = get_word_ce030_prefetch (0);
}
uae_u32 (*fetch)(uaecptr) = currprefs.cpu_cycle_exact ? mem_access_delay_longi_read_ce020 : get_longi;
pc &= ~3;
fill_icache020 (pc, fetch);
- do_cycles_ce020 (2);
+ if (currprefs.cpu_cycle_exact)
+ do_cycles_ce020 (2);
regs.prefetch020[0] = regs.cacheholdingdata020;
fill_icache020 (pc + 4, fetch);
- do_cycles_ce020 (2);
+ if (currprefs.cpu_cycle_exact)
+ do_cycles_ce020 (2);
regs.prefetch020[1] = regs.cacheholdingdata020;
regs.irc = get_word_020_prefetch (0);
}
if (size64 > MAXZ3MEM32)
size64 = MAXZ3MEM32;
}
- if (maxmem < 0)
+ if (maxmem < 0) {
size64 = MAXZ3MEM64;
- else if (maxmem > 0)
+ if (!os_64bit) {
+ if (totalphys64 < 1536 * 1024 * 1024)
+ max_allowed_mman = 256;
+ if (max_allowed_mman < 256)
+ max_allowed_mman = 256;
+ }
+ } else if (maxmem > 0) {
size64 = maxmem * 1024 * 1024;
+ }
if (size64 < 8 * 1024 * 1024)
size64 = 8 * 1024 * 1024;
if (max_allowed_mman * 1024 * 1024 > size64)
max_allowed_mman = size64 / (1024 * 1024);
- if (!os_64bit) {
- if (max_allowed_mman * 1024 * 1024 > (totalphys64 / 2))
- max_allowed_mman = (totalphys64 / 2) / (1024 * 1024);
- }
natmem_size = (max_allowed_mman + 1) * 1024 * 1024;
if (natmem_size < 17 * 1024 * 1024)
#define IDS_JOYMODE_WHEELMOUSE 389
#define IDD_ERRORLOG 389
#define IDS_NUMSG_KS68030PLUS 390
+#define IDD_DISKINFO 390
#define IDS_SELECTTAPE 391
#define IDS_TAPE 392
#define IDS_QS_MODELS 1000
#define IDC_DD_SURFACETYPE 1791
#define IDC_RTG_SCALE_ALLOW 1791
#define IDC_CPU_FREQUENCY 1791
+#define IDC_LOGENABLE2 1791
#define IDC_RTG_SCALE_ASPECTRATIO 1792
#define IDC_ASSOCIATE_ON 1792
#define IDC_DD_SURFACETYPE2 1792
#define IDC_TAPE_RW 1834
#define IDC_ERRORLOGMESSAGE 1835
#define IDC_ERRORLOGCLEAR 1836
+#define IDC_DISKINFOBOX 1837
+#define IDC_SAVEBOOTBLOCK 1838
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 390
+#define _APS_NEXT_RESOURCE_VALUE 391
#define _APS_NEXT_COMMAND_VALUE 40050
-#define _APS_NEXT_CONTROL_VALUE 1837
+#define _APS_NEXT_CONTROL_VALUE 1839
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// Microsoft Visual C++ generated resource script.
//
-#include "winres.h"
#include "resource.h"
+#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
// English resources
CONTROL "Use relative paths",IDC_PATHS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,199,231,189,11
EDITTEXT IDC_LOGPATH,7,281,324,13,ES_READONLY
PUSHBUTTON "Open [] Open selected file.",IDC_LOGOPEN,337,280,51,14
- COMBOBOX IDC_LOGSELECT,7,263,169,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- CONTROL "Enable full logging (temporary)",IDC_LOGENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,264,140,12
+ COMBOBOX IDC_LOGSELECT,7,263,137,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Enable full logging",IDC_LOGENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,264,93,12
PUSHBUTTON "Save All [] Save and open both logs and config file.",IDC_LOGSAVE,337,264,51,14
GROUPBOX "Debug logging",IDC_STATIC,1,248,393,53
+ CONTROL "Log window",IDC_LOGENABLE2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,254,264,68,12
END
IDD_QUICKSTART DIALOGEX 0, 0, 396, 262
CONTROL "Read/write",IDC_TAPE_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,313,39,67,10
END
+IDD_DISKINFO DIALOGEX 0, 0, 491, 323
+STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Disk image information"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,220,303,50,14
+ EDITTEXT IDC_DISKINFOBOX,5,4,481,292,ES_MULTILINE | ES_READONLY | WS_VSCROLL
+ PUSHBUTTON "Save bootblock",IDC_SAVEBOOTBLOCK,397,303,89,14,NOT WS_VISIBLE
+END
+
/////////////////////////////////////////////////////////////////////////////
//
IDD_TAPEDRIVE, DIALOG
BEGIN
END
+
+ IDD_DISKINFO, DIALOG
+ BEGIN
+ END
END
#endif // APSTUDIO_INVOKED
del cpuemu_0.cpp
del cpuemu_11.cpp
del cpuemu_12.cpp
+del cpuemu_13.cpp
del cpuemu_20.cpp
del cpuemu_21.cpp
del cpuemu_22.cpp
#define MMUEMU /* Aranym 68040 MMU */
#define FULLMMU /* Aranym 68040 MMU */
#define CPUEMU_0 /* generic 680x0 emulation */
-#define CPUEMU_11 /* 68000 prefetch emulation */
-#define CPUEMU_12 /* 68000 cycle-exact cpu&blitter */
+#define CPUEMU_11 /* 68000/68010 prefetch emulation */
+#define CPUEMU_13 /* 68000/68010 cycle-exact cpu&blitter */
#define CPUEMU_20 /* 68020 prefetch */
#define CPUEMU_21 /* 68020 "cycle-exact" + blitter */
#define CPUEMU_22 /* 68030 (040/060) "cycle-exact" + blitter */
#define OPENGL
#endif
#define CAPS
-#define CPUEMU_12
+#define CPUEMU_13
#define CPUEMU_11
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("9")
+#define WINUAEBETA _T("10")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2013, 10, 20)
+#define WINUAEDATE MAKEBD(2013, 10, 26)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
//#define WINUAEEXTRA _T("Amiga Forever Edition")
ShowWindow (w, hide ? SW_HIDE : SW_SHOW);
}
+static int stringboxdialogactive;
+static INT_PTR CALLBACK StringBoxDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg)
+ {
+ case WM_DESTROY:
+ PostQuitMessage (0);
+ return TRUE;
+ case WM_CLOSE:
+ stringboxdialogactive = 0;
+ DestroyWindow (hDlg);
+ return TRUE;
+ case WM_INITDIALOG:
+ return TRUE;
+ case WM_COMMAND:
+ switch (LOWORD (wParam))
+ {
+ case IDOK:
+ stringboxdialogactive = -1;
+ DestroyWindow (hDlg);
+ return TRUE;
+ case IDCANCEL:
+ stringboxdialogactive = 0;
+ DestroyWindow (hDlg);
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
static int CALLBACK BrowseForFolderCallback (HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
}
}
-static void infofloppy (int n)
+static void infofloppy (HWND hDlg, int n)
{
struct diskinfo di;
- FILE *f;
- TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
+ TCHAR tmp2[MAX_DPATH];
+ TCHAR text[20000];
DISK_examine_image (&workprefs, n, &di);
- tmp[0] = 0;
- if (GetTempPath (MAX_DPATH, tmp) <= 0)
- return;
- _tcscat (tmp, _T("floppy_info.txt"));
- f = _tfopen (tmp, _T("wt, ccs=UTF-8"));
- if (f) {
+ _stprintf (tmp2,
+ _T("'%s'\r\nDisk readable: %s\r\nCRC32: %08X\r\nBoot block checksum valid: %s\r\nBoot block type: %s\r\n"),
+ workprefs.floppyslots[n].df,
+ di.unreadable ? _T("No") : _T("Yes"),
+ di.crc32,
+ di.bb_crc_valid ? _T("Yes") : _T("No"),
+ di.bootblocktype == 0 ? _T("Custom") : (di.bootblocktype == 1 ? _T("Standard 1.x") : _T("Standard 2.x+"))
+ );
+ _tcscpy (text, tmp2);
+ if (di.diskname[0]) {
_stprintf (tmp2,
- _T("\nDisk readable: %s\nCRC32: %08X\nBoot block checksum valid: %s\n\n"),
- di.unreadable ? _T("No") : _T("Yes"),
- di.crc32,
- di.bb_crc_valid ? _T("Yes") : _T("No")
- );
- fputws (tmp2, f);
- int w = 32;
- for (int i = 0; i < 1024; i += w) {
- for (int j = 0; j < w; j++) {
- uae_u8 b = di.bootblock[i + j];
- _stprintf (tmp2 + j * 2, _T("%02X"), b);
- if (b >= 32 && b < 127)
- tmp2[w * 2 + 1 + j] = (TCHAR)b;
- else
- tmp2[w * 2 + 1 + j] = '.';
+ _T("Label: '%s'\r\n"), di.diskname);
+ _tcscat (text, tmp2);
+ }
+ _tcscat (text, _T("\r\n"));
+
+ int w = 32;
+ for (int i = 0; i < 1024; i += w) {
+ for (int j = 0; j < w; j++) {
+ uae_u8 b = di.bootblock[i + j];
+ _stprintf (tmp2 + j * 2, _T("%02X"), b);
+ if (b >= 32 && b < 127)
+ tmp2[w * 2 + 1 + j] = (TCHAR)b;
+ else
+ tmp2[w * 2 + 1 + j] = '.';
+ }
+ tmp2[w * 2] = ' ';
+ tmp2[w * 2 + 1 + w] = 0;
+ _tcscat (text, tmp2);
+ _tcscat (text, _T("\r\n"));
+ }
+
+ stringboxdialogactive = 1;
+ HWND hwnd = CustomCreateDialog (IDD_DISKINFO, hDlg, StringBoxDialogProc);
+ if (hwnd == NULL)
+ return;
+
+ HFONT font = CreateFont (12, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Lucida Console"));
+ if (font)
+ SendMessage (GetDlgItem (hwnd, IDC_DISKINFOBOX), WM_SETFONT, WPARAM(font), FALSE);
+ SendMessage (GetDlgItem (hwnd, IDC_DISKINFOBOX), WM_SETTEXT, 0, (LPARAM)text);
+ while (stringboxdialogactive == 1) {
+ MSG msg;
+ int ret;
+ WaitMessage ();
+ while ((ret = GetMessage (&msg, NULL, 0, 0))) {
+ if (ret == -1)
+ break;
+ if (!IsWindow (hwnd) || !IsDialogMessage (hwnd, &msg)) {
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
}
- tmp2[w * 2] = ' ';
- tmp2[w * 2 + 1 + w] = 0;
- fputws (tmp2, f);
- fputws (_T("\n"), f);
}
- fclose (f);
- ShellExecute (NULL, _T("open"), tmp, NULL, NULL, SW_SHOWNORMAL);
+ if (stringboxdialogactive == -1)
+ break;
}
+ DeleteObject (font);
}
static void ejectfloppy (int n)
SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_SETCURSEL, 0, 0);
CheckDlgButton (hDlg, IDC_LOGENABLE, winuaelog_temporary_enable || (full_property_sheet == 0 && currprefs.win32_logfile));
ew (hDlg, IDC_LOGENABLE, winuaelog_temporary_enable == false && full_property_sheet);
+ extern int consoleopen;
+ if (consoleopen || !full_property_sheet) {
+ CheckDlgButton (hDlg, IDC_LOGENABLE2, consoleopen ? TRUE : FALSE);
+ ew (hDlg, IDC_LOGENABLE2, FALSE);
+ }
values_to_pathsdialog (hDlg);
recursive--;
return TRUE;
case IDC_LOGENABLE:
winuaelog_temporary_enable = ischecked (hDlg, IDC_LOGENABLE);
break;
+ case IDC_LOGENABLE2:
+ extern int console_logging;
+ console_logging = 1;
+ break;
case IDC_LOGOPEN:
flush_log ();
val = SendDlgItemMessage (hDlg, IDC_LOGSELECT, CB_GETCURSEL, 0, 0L);
{
int enable = workprefs.cpu_cycle_exact ? FALSE : TRUE;
-#if !defined (CPUEMU_12)
+#if !defined (CPUEMU_13)
ew (hDlg, IDC_CYCLEEXACT, FALSE);
#endif
ew (hDlg, IDC_GENLOCK, full_property_sheet);
#ifdef JIT
oldcache = workprefs.cachesize;
- jitena = ischecked (hDlg, IDC_JITENABLE) ? 1 : 0;
+ jitena = (ischecked (hDlg, IDC_JITENABLE) ? 1 : 0) && !workprefs.address_space_24 && workprefs.cpu_model >= 68020;
workprefs.cachesize = SendMessage (GetDlgItem (hDlg, IDC_CACHE), TBM_GETPOS, 0, 0) * 1024;
- if (!workprefs.cachesize)
- setchecked (hDlg, IDC_JITENABLE, false);
if (!jitena) {
cachesize_prev = workprefs.cachesize;
trust_prev = workprefs.comptrustbyte;
workprefs.comptrustlong = trust_prev;
workprefs.comptrustnaddr = trust_prev;
}
+ if (!workprefs.cachesize)
+ setchecked (hDlg, IDC_JITENABLE, false);
if (oldcache == 0 && candirect && workprefs.cachesize > 0)
canbang = 1;
#endif
break;
case IDC_INFO0:
case IDC_INFO0Q:
- infofloppy (0);
+ infofloppy (hDlg, 0);
break;
case IDC_INFO1:
case IDC_INFO1Q:
- infofloppy (1);
+ infofloppy (hDlg, 1);
break;
case IDC_INFO2:
- infofloppy (2);
+ infofloppy (hDlg, 2);
break;
case IDC_INFO3:
- infofloppy (3);
+ infofloppy (hDlg, 3);
break;
case IDC_EJECT0:
case IDC_EJECT0Q:
static int joysm[] = { IDC_PORT0_JOYSMODE, IDC_PORT1_JOYSMODE, -1, -1 };
static int joysaf[] = { IDC_PORT0_AF, IDC_PORT1_AF, -1, -1 };
-static void updatejoyport (HWND hDlg)
+static void updatejoyport (HWND hDlg, int changedport)
{
int i, j;
TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
}
}
-static void fixjport (struct jport *port, int v)
+static void values_from_gameportsdlg (HWND hDlg, int d, int changedport)
{
- int vv = port->id;
- if (vv == JPORT_CUSTOM || vv == JPORT_NONE)
- return;
- if (vv != v)
- return;
- if (vv >= JSEM_JOYS && vv < JSEM_MICE) {
- vv -= JSEM_JOYS;
- vv++;
- if (vv >= inputdevice_get_device_total (IDTYPE_JOYSTICK))
- vv = 0;
- vv += JSEM_JOYS;
- }
- if (vv >= JSEM_MICE && vv < JSEM_END) {
- vv -= JSEM_MICE;
- vv++;
- if (vv >= inputdevice_get_device_total (IDTYPE_MOUSE))
- vv = 0;
- vv += JSEM_MICE;
- }
- if (vv >= JSEM_KBDLAYOUT && vv < JSEM_LASTKBD) {
- vv -= JSEM_KBDLAYOUT;
- vv++;
- if (vv >= JSEM_LASTKBD)
- vv = 0;
- vv += JSEM_KBDLAYOUT;
- }
- port->id = vv;
-}
-
-static void values_from_gameportsdlg (HWND hDlg, int d)
-{
- int i, j, success;
+ int i, success;
int changed = 0;
if (d) {
if (*port != prevport)
changed = 1;
}
- if (changed) {
- for (i = 0; i < MAX_JPORTS; i++) {
- for (j = 0; j < MAX_JPORTS; j++) {
- if (j != i)
- fixjport (&workprefs.jports[i], workprefs.jports[j].id);
- }
- }
- }
-
+ if (changed)
+ inputdevice_validate_jports (&workprefs, changedport);
}
static int midi2dev (struct midiportinfo **mid, int idx, int def)
{
if (reset)
inputdevice_compa_clear (&workprefs, port);
- values_from_gameportsdlg (hDlg, 0);
+ values_from_gameportsdlg (hDlg, 0, port);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, port);
inputdevice_updateconfig (NULL, &workprefs);
inputdevice_config_change ();
+ reset_inputdevice_config (&workprefs);
}
/* Handle messages for the Joystick Settings page of our property-sheet */
inputdevice_updateconfig (NULL, &workprefs);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
recursive--;
break;
case WM_USER:
recursive++;
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
recursive--;
return TRUE;
joyxprevious[0] = joyxprevious[1];
joyxprevious[1] = temp;
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
} else if (LOWORD (wParam) == IDC_PORT0_REMAP) {
ports_remap (hDlg, 0);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
} else if (LOWORD (wParam) == IDC_PORT1_REMAP) {
ports_remap (hDlg, 1);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
} else if (LOWORD (wParam) == IDC_PORT2_REMAP) {
ports_remap (hDlg, 2);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
} else if (LOWORD (wParam) == IDC_PORT3_REMAP) {
ports_remap (hDlg, 3);
enable_for_gameportsdlg (hDlg);
- updatejoyport (hDlg);
+ updatejoyport (hDlg, -1);
} else if (HIWORD (wParam) == CBN_SELCHANGE) {
switch (LOWORD (wParam))
{
}
}
} else {
- values_from_gameportsdlg (hDlg, 1);
+ values_from_gameportsdlg (hDlg, 1, -1);
enable_for_gameportsdlg (hDlg);
}
recursive--;
currentpage = IOPORTS_ID;
init_portsdlg (hDlg);
inputdevice_updateconfig (NULL, &workprefs);
+ reset_inputdevice_config (&workprefs);
enable_for_portsdlg (hDlg);
values_to_portsdlg (hDlg);
recursive--;
CheckDlgButton (hDlg, IDC_INPUTDEVICEDISABLE, (!input_total_devices || inputdevice_get_device_status (input_selected_device)) ? BST_CHECKED : BST_UNCHECKED);
}
-static int stringboxdialogactive;
-static INT_PTR CALLBACK StringBoxDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch(msg)
- {
- case WM_DESTROY:
- PostQuitMessage (0);
- return TRUE;
- case WM_CLOSE:
- stringboxdialogactive = 0;
- DestroyWindow (hDlg);
- return TRUE;
- case WM_INITDIALOG:
- return TRUE;
- case WM_COMMAND:
- switch (LOWORD (wParam))
- {
- case IDOK:
- stringboxdialogactive = -1;
- DestroyWindow (hDlg);
- return TRUE;
- case IDCANCEL:
- stringboxdialogactive = 0;
- DestroyWindow (hDlg);
- return TRUE;
- }
- break;
- }
- return FALSE;
-}
-
static int askinputcustom (HWND hDlg, TCHAR *custom, int maxlen, DWORD titleid)
{
HWND hwnd;
<ClCompile Include="..\..\archivers\zip\unzip.cpp" />
<ClCompile Include="..\..\aros.rom.cpp" />
<ClCompile Include="..\..\calc.cpp" />
+ <ClCompile Include="..\..\cpuemu_13.cpp" />
<ClCompile Include="..\..\cpuemu_21.cpp" />
<ClCompile Include="..\..\cpuemu_22.cpp" />
<ClCompile Include="..\..\cpuemu_32.cpp" />
<ClCompile Include="..\..\cpudefs.cpp" />
<ClCompile Include="..\..\cpuemu_0.cpp" />
<ClCompile Include="..\..\cpuemu_11.cpp" />
- <ClCompile Include="..\..\cpuemu_12.cpp" />
<ClCompile Include="..\..\cpuemu_20.cpp" />
<ClCompile Include="..\..\cpuemu_31.cpp" />
<ClCompile Include="..\..\cpummu.cpp" />
<ClCompile Include="..\..\cpuemu_11.cpp">
<Filter>common</Filter>
</ClCompile>
- <ClCompile Include="..\..\cpuemu_12.cpp">
- <Filter>common</Filter>
- </ClCompile>
<ClCompile Include="..\..\cpuemu_20.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\luascript.cpp">
<Filter>common</Filter>
</ClCompile>
+ <ClCompile Include="..\..\cpuemu_13.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\resources\35floppy.ico">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>v110</PlatformToolset>
+ <PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FullRelease|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ClCompile Include="..\..\archivers\zip\unzip.cpp" />
<ClCompile Include="..\..\aros.rom.cpp" />
<ClCompile Include="..\..\calc.cpp" />
+ <ClCompile Include="..\..\cpuemu_13.cpp" />
<ClCompile Include="..\..\cpuemu_21.cpp" />
<ClCompile Include="..\..\cpuemu_22.cpp" />
<ClCompile Include="..\..\cpuemu_32.cpp" />
<ClCompile Include="..\..\cpudefs.cpp" />
<ClCompile Include="..\..\cpuemu_0.cpp" />
<ClCompile Include="..\..\cpuemu_11.cpp" />
- <ClCompile Include="..\..\cpuemu_12.cpp" />
<ClCompile Include="..\..\cpuemu_20.cpp" />
<ClCompile Include="..\..\cpuemu_31.cpp" />
<ClCompile Include="..\..\cpummu.cpp" />
<ClCompile Include="..\..\cpuemu_11.cpp">
<Filter>common</Filter>
</ClCompile>
- <ClCompile Include="..\..\cpuemu_12.cpp">
- <Filter>common</Filter>
- </ClCompile>
<ClCompile Include="..\..\cpuemu_20.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\luascript.cpp">
<Filter>common</Filter>
</ClCompile>
+ <ClCompile Include="..\..\cpuemu_13.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\resources\35floppy.ico">