#include "od-win32/win32.h"
-extern struct device_functions devicefunc_win32_aspi;
extern struct device_functions devicefunc_win32_spti;
extern struct device_functions devicefunc_win32_ioctl;
#ifdef _WIN32
&devicefunc_win32_ioctl,
&devicefunc_win32_spti,
- &devicefunc_win32_aspi,
#endif
NULL
};
device_func[i] = devicetable[SCSI_UNIT_SPTI];
}
break;
- case SCSI_UNIT_ASPI:
- device_func[i] = devicetable[SCSI_UNIT_ASPI];
- break;
}
}
}
p->cdslots[i].inuse = true;
}
- // blkdev_win32_aspi.cpp does not support multi units
- if (currprefs.win32_uaescsimode >= UAESCSI_ASPI_FIRST) {
- for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
- if (cdscsidevicetype[i] != SCSI_UNIT_DISABLED)
- cdscsidevicetype[i] = SCSI_UNIT_ASPI;
- }
- return;
- }
-
for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
if (cdscsidevicetype[i] != SCSI_UNIT_DEFAULT)
continue;
} else if (currprefs.scsi) {
if (currprefs.win32_uaescsimode == UAESCSI_CDEMU)
cdscsidevicetype[i] = SCSI_UNIT_IOCTL;
- else if (currprefs.win32_uaescsimode >= UAESCSI_ASPI_FIRST)
- cdscsidevicetype[i] = SCSI_UNIT_ASPI;
else
cdscsidevicetype[i] = SCSI_UNIT_SPTI;
} else {
static void set_68020_compa (struct uae_prefs *p, int compa, int cd32)
{
- if (compa == 0) {
+ switch (compa)
+ {
+ case 0:
p->blitter_cycle_exact = 1;
p->m68k_speed = 0;
if (p->cpu_model == 68020 && p->cachesize == 0) {
p->cpu_cycle_exact = 1;
p->cpu_clock_multiplier = 4 << 8;
}
- }
- if (compa > 1) {
+ break;
+ case 1:
+ p->cpu_compatible = true;
+ p->m68k_speed = 0;
+ break;
+ case 2:
+ p->cpu_compatible = 0;
+ p->m68k_speed = -1;
+ p->address_space_24 = 0;
+ break;
+ case 3:
p->cpu_compatible = 0;
p->address_space_24 = 0;
p->cachesize = 8192;
+ break;
}
}
write_log (_T("KB: reset warning forced reset. Phase=%d\n"), resetwarning_phase);
resetwarning_phase = -1;
kblostsynccnt = 0;
+ send_internalevent (INTERNALEVENT_KBRESET);
uae_reset (0);
}
}
write_log (_T("KB: reset warning end by software. reset.\n"));
resetwarning_phase = -1;
kblostsynccnt = 0;
+ send_internalevent (INTERNALEVENT_KBRESET);
uae_reset (0);
}
}
hardware_line_completed (next_lineno);
if (doflickerfix () && interlace_seen > 0)
hsync_scandoubler ();
- notice_resolution_seen (GET_RES_AGNUS (bplcon0), interlace_seen > 0);
+ notice_resolution_seen (GET_RES_AGNUS (bplcon0), interlace_seen != 0);
}
#ifdef A2065
}
}
} else {
- if (!vsync_isdone () && !currprefs.turbo_emulation && (vpos + 1 < maxvpos + lof_store && (vpos == maxvpos_nom * 1 / 3 || vpos == maxvpos_nom * 2 / 3))) {
- frame_time_t rpt = read_processor_time ();
+ if (vpos + 1 < maxvpos + lof_store && (vpos == maxvpos_nom * 1 / 3 || vpos == maxvpos_nom * 2 / 3)) {
vsyncmintime += vsynctimeperline;
- // sleep if more than 2ms "free" time
- while (!vsync_isdone () && (int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0 && (int)vsyncmintime - (int)rpt < vsynctimebase) {
- sleep_millis_main (1);
- rpt = read_processor_time ();
- //write_log (_T("*"));
+ if (!vsync_isdone () && !currprefs.turbo_emulation) {
+ frame_time_t rpt = read_processor_time ();
+ // sleep if more than 2ms "free" time
+ while (!vsync_isdone () && (int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0 && (int)vsyncmintime - (int)rpt < vsynctimebase) {
+ sleep_millis_main (1);
+ rpt = read_processor_time ();
+ //write_log (_T("*"));
+ }
}
}
}
int bp = 0;
pc = munge24 (m68k_getpc ());
- opcode = (currprefs.cpu_compatible || currprefs.cpu_cycle_exact) ? regs.ir : get_word (pc);
+ opcode = currprefs.cpu_model < 68020 && (currprefs.cpu_compatible || currprefs.cpu_cycle_exact) ? regs.ir : get_word (pc);
for (i = 0; i < BREAKPOINT_TOTAL; i++) {
if (!bpnodes[i].enabled)
static FILE *stblfile;
static int using_prefetch, using_indirect, using_mmu;
-static int using_ce020;
+static int using_prefetch_020, using_ce020;
static int using_exception_3;
static int using_ce;
static int using_tracer;
}
count_read += table68k[opcode].size == sz_long ? 2 : 1;
printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0));
- printf ("\tunsigned int dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n");
+ printf ("\tuae_u32 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n");
genamode (table68k[opcode].dmode, "dstreg", table68k[opcode].size, "src", 2, 1, 0);
start_brace ();
printf ("\twhile (dmask) { m68k_dreg (regs, movem_index1[dmask]) = %s; srca += %d; dmask = movem_next[dmask]; }\n",
{
int size = table68k[opcode].size == sz_long ? 4 : 2;
printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0));
- printf ("\tunsigned int dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n");
+ printf ("\tuae_u32 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n");
printf ("\tuae_u32 v;\n");
genamode (table68k[opcode].dmode, "dstreg", table68k[opcode].size, "src", 2, 1, GF_AA);
if (table68k[opcode].dmode == Ad8r || table68k[opcode].dmode == PC8r)
if (using_indirect) {
// tracer
- if (!using_ce020) {
+ if (!using_ce020 && !using_prefetch_020) {
prefetch_word = "get_word_ce000_prefetch";
srcli = "x_get_ilong";
srcwi = "x_get_iword";
* get_word_ce020_prefetch()
*/
disp020 = "x_get_disp_ea_ce020";
- prefetch_long = "get_long_ce020_prefetch";
prefetch_word = "get_word_ce020_prefetch";
+ prefetch_long = "get_long_ce020_prefetch";
srcli = "x_get_ilong";
srcwi = "x_get_iword";
srcbi = "x_get_ibyte";
do_cycles = "do_cycles_ce020";
nextw = "next_iword_020ce";
nextl = "next_ilong_020ce";
+ } else if (using_prefetch_020) {
+ prefetch_word = "get_word_020_prefetch";
+ prefetch_long = "get_long_020_prefetch";
+ srcli = "x_get_ilong";
+ srcwi = "x_get_iword";
+ srcbi = "x_get_ibyte";
+ srcl = "x_get_long";
+ dstl = "x_put_long";
+ srcw = "x_get_word";
+ dstw = "x_put_word";
+ srcb = "x_get_byte";
+ dstb = "x_put_byte";
+ nextw = "next_iword_020";
+ nextl = "next_ilong_020";
}
} else if (using_ce020) {
printf ("/* %s */\n", outopcode (opcode));
if (i68000)
printf("#ifndef CPUEMU_68000_ONLY\n");
- printf ("%s REGPARAM2 CPUFUNC(op_%04lx_%d%s)(uae_u32 opcode)\n{\n", (using_ce || using_ce020) ? "void" : "unsigned long", opcode, postfix, extra);
+ printf ("%s REGPARAM2 CPUFUNC(op_%04lx_%d%s)(uae_u32 opcode)\n{\n", (using_ce || using_ce020) ? "void" : "uae_u32", opcode, postfix, extra);
switch (table68k[opcode].stype) {
case 0: smsk = 7; break;
}
postfix = id;
- if (id == 0 || id == 11 || id == 12 || id == 20 || id == 21 || id == 31) {
+ if (id == 0 || id == 11 || id == 12 || id == 20 || id == 21 || id == 22 || id == 31) {
if (generate_stbl)
fprintf (stblfile, "#ifdef CPUEMU_%d%s\n", postfix, extraup);
postfix2 = postfix;
using_mmu = 0;
using_prefetch = 0;
+ using_prefetch_020 = 0;
using_ce = 0;
using_ce020 = 0;
using_mmu = 0;
using_ce = 1;
for (rp = 0; rp < nr_cpuop_funcs; rp++)
opcode_next_clev[rp] = 0;
- } else if (id == 20) { // 68020 cycle-exact
+ } else if (id == 20) { // 68020 prefetch
+ cpu_level = 2;
+ using_prefetch_020 = 2;
+ read_counts ();
+ for (rp = 0; rp < nr_cpuop_funcs; rp++)
+ opcode_next_clev[rp] = cpu_level;
+ } else if (id == 21) { // 68020 cycle-exact
cpu_level = 2;
using_ce020 = 1;
read_counts ();
for (rp = 0; rp < nr_cpuop_funcs; rp++)
opcode_next_clev[rp] = cpu_level;
- } else if (id == 21 || id == 22 || id == 23) { // 68030+ "cycle-exact"
- cpu_level = 3 + (23 - id);
+ } else if (id == 22 || id == 23 || id == 24) { // 68030+ "cycle-exact"
+ cpu_level = 3 + (24 - id);
using_ce020 = 2;
- if (id == 21) {
+ if (id == 22) {
read_counts ();
for (rp = 0; rp < nr_cpuop_funcs; rp++)
opcode_next_clev[rp] = cpu_level;
} else {
cpu_level = 5 - id; // "generic"
}
- using_indirect = using_ce || using_ce020;
+ using_indirect = using_ce || using_ce020 || using_prefetch_020;
if (generate_stbl) {
if ((id > 0 && id < 10) || (id >= 20))
using_ce = 0;
for (i = 0; i < 32; i++) {
- if ((i >= 6 && i < 11) || (i > 12 && i < 20) || (i > 23 && i < 31))
+ if ((i >= 6 && i < 11) || (i > 12 && i < 20) || (i > 24 && i < 31))
continue;
generate_stbl = 1;
generate_cpu (i, 0);
#define SCSI_UNIT_IMAGE 1
#define SCSI_UNIT_IOCTL 2
#define SCSI_UNIT_SPTI 3
-#define SCSI_UNIT_ASPI 4
//#define device_debug write_log
#define device_debug
#ifdef CPUEMU_20
+extern uae_u32 get_word_020_prefetch (int);
+
+STATIC_INLINE uae_u32 next_iword_020 (void)
+{
+ uae_u32 r = get_word_020_prefetch (0);
+ m68k_incpc (2);
+ return r;
+}
+STATIC_INLINE uae_u32 next_ilong_020 (void)
+{
+ uae_u32 r = next_iword_020 () << 16;
+ r |= next_iword_020 ();
+ return r;
+}
+
+STATIC_INLINE uae_u32 get_long_020_prefetch (int o)
+{
+ uae_u32 r = get_word_020_prefetch (o) << 16;
+ r |= get_word_020_prefetch (o + 2);
+ return r;
+}
+
+#endif
+
+#ifdef CPUEMU_21
+
STATIC_INLINE void do_cycles_ce020 (int clocks)
{
x_do_cycles (clocks * cpucycleunit);
return r;
}
+
+
STATIC_INLINE void m68k_do_bsr_ce020 (uaecptr oldpc, uae_s32 offset)
{
m68k_areg (regs, 7) -= 4;
#endif
-#ifdef CPUEMU_21
+#ifdef CPUEMU_22
extern uae_u32 get_word_ce030_prefetch (int);
extern void write_dcache030 (uaecptr, uae_u32, int);
#define IDTYPE_JOYSTICK 0
#define IDTYPE_MOUSE 1
#define IDTYPE_KEYBOARD 2
+#define IDTYPE_INTERNALEVENT 3
+#define IDTYPE_MAX 4
struct inputdevice_functions {
int (*init)(void);
#define ID_FLAG_GAMEPORTSCUSTOM_MASK (ID_FLAG_GAMEPORTSCUSTOM1 | ID_FLAG_GAMEPORTSCUSTOM2)
#define ID_FLAG_AUTOFIRE_MASK (ID_FLAG_TOGGLE | ID_FLAG_INVERTTOGGLE | ID_FLAG_AUTOFIRE)
-#define ID_FLAG_CANRELEASE 0x2000
-#define ID_FLAG_TOGGLED 0x4000
-#define ID_FLAG_CUSTOMEVENT_TOGGLED 0x8000
+
#define ID_FLAG_QUALIFIER1 0x00010000
#define ID_FLAG_QUALIFIER2 0x00020000
#define ID_FLAG_QUALIFIER3 0x00040000
#define ID_FLAG_QUALIFIER_ALT 0x08000000
#define ID_FLAG_QUALIFIER_MASK 0x0fff0000
-#define ID_FLAG_SAVE_MASK_CONFIG 0xff
-#define ID_FLAG_SAVE_MASK_QUALIFIERS ID_FLAG_QUALIFIER_MASK
-#define ID_FLAG_SAVE_MASK_FULL (ID_FLAG_SAVE_MASK_CONFIG | ID_FLAG_SAVE_MASK_QUALIFIERS)
-
#define IDEV_WIDGET_NONE 0
#define IDEV_WIDGET_BUTTON 1
#define IDEV_WIDGET_AXIS 2
extern void inputdevice_updateconfig_internal (struct uae_prefs *prefs);
extern void inputdevice_devicechange (struct uae_prefs *prefs);
+#define INTERNALEVENT_CPURESET 0
+#define INTERNALEVENT_KBRESET 1
+
+extern void send_internalevent (int eventid);
+
extern int inputdevice_translatekeycode (int keyboard, int scancode, int state);
extern void inputdevice_checkqualifierkeycode (int keyboard, int scancode, int state);
extern void inputdevice_setkeytranslation (struct uae_input_device_kbr_default **trans, int **kbmaps);
extern int fpp_movem_next[256];
#endif
-typedef unsigned long REGPARAM3 cpuop_func (uae_u32) REGPARAM;
+typedef uae_u32 REGPARAM3 cpuop_func (uae_u32) REGPARAM;
typedef void REGPARAM3 cpuop_func_ce (uae_u32) REGPARAM;
struct cputbl {
};
#ifdef JIT
-typedef unsigned long REGPARAM3 compop_func (uae_u32) REGPARAM;
+typedef uae_u32 REGPARAM3 compop_func (uae_u32) REGPARAM;
struct comptbl {
compop_func *handler;
};
#endif
-extern unsigned long REGPARAM3 op_illg (uae_u32) REGPARAM;
+extern uae_u32 REGPARAM3 op_illg (uae_u32) REGPARAM;
typedef uae_u8 flagtype;
/* 68060 */
extern const struct cputbl op_smalltbl_0_ff[];
-extern const struct cputbl op_smalltbl_20_ff[]; // CE
+extern const struct cputbl op_smalltbl_22_ff[]; // CE
/* 68040 */
extern const struct cputbl op_smalltbl_1_ff[];
-extern const struct cputbl op_smalltbl_21_ff[]; // CE
+extern const struct cputbl op_smalltbl_23_ff[]; // CE
extern const struct cputbl op_smalltbl_31_ff[]; // MMU
/* 68030 */
extern const struct cputbl op_smalltbl_2_ff[];
-extern const struct cputbl op_smalltbl_22_ff[]; // CE
+extern const struct cputbl op_smalltbl_24_ff[]; // CE
/* 68020 */
extern const struct cputbl op_smalltbl_3_ff[];
-extern const struct cputbl op_smalltbl_23_ff[]; // CE
+extern const struct cputbl op_smalltbl_20_ff[]; // prefetch
+extern const struct cputbl op_smalltbl_21_ff[]; // CE
/* 68010 */
extern const struct cputbl op_smalltbl_4_ff[];
/* 68000 */
extern const struct cputbl op_smalltbl_5_ff[];
-/* 68000 slow but compatible. */
-extern const struct cputbl op_smalltbl_11_ff[];
-/* 68000 slow but compatible and cycle-exact. */
-extern const struct cputbl op_smalltbl_12_ff[];
+extern const struct cputbl op_smalltbl_11_ff[]; // prefetch
+extern const struct cputbl op_smalltbl_12_ff[]; // CE
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl");
#define MAX_TOTAL_SCSI_DEVICES 8
/* maximum number native input devices supported (single type) */
-#define MAX_INPUT_DEVICES 8
+#define MAX_INPUT_DEVICES 16
/* maximum number of native input device's buttons and axles supported */
#define MAX_INPUT_DEVICE_EVENTS 256
/* 4 different customization settings */
#define MAX_INPUT_SUB_EVENT_ALL 9
#define SPARE_SUB_EVENT 8
+#define INTERNALEVENT_COUNT 1
+
struct uae_input_device {
TCHAR *name;
TCHAR *configname;
struct uae_input_device joystick_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
struct uae_input_device mouse_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
struct uae_input_device keyboard_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
+ struct uae_input_device internalevent_settings[MAX_INPUT_SETTINGS][INTERNALEVENT_COUNT];
TCHAR input_config_name[GAMEPORT_INPUT_SETTINGS][256];
int dongle;
int input_contact_bounce;
#define UAESCSI_CDEMU 0
#define UAESCSI_SPTI 1
#define UAESCSI_SPTISCAN 2
-#define UAESCSI_ASPI_FIRST 3
-#define UAESCSI_ADAPTECASPI 3
-#define UAESCSI_NEROASPI 4
-#define UAESCSI_FROGASPI 5
+#define UAESCSI_LAST 2
#endif
\ No newline at end of file
int inputdevice_logging = 0;
+
+#define ID_FLAG_CANRELEASE 0x1000
+#define ID_FLAG_TOGGLED 0x2000
+#define ID_FLAG_CUSTOMEVENT_TOGGLED1 0x4000
+#define ID_FLAG_CUSTOMEVENT_TOGGLED2 0x8000
+
+#define ID_FLAG_SAVE_MASK_CONFIG 0xff
+#define ID_FLAG_SAVE_MASK_QUALIFIERS ID_FLAG_QUALIFIER_MASK
+#define ID_FLAG_SAVE_MASK_FULL (ID_FLAG_SAVE_MASK_CONFIG | ID_FLAG_SAVE_MASK_QUALIFIERS)
+
#define IE_INVERT 0x80
#define IE_CDTV 0x100
static int handle_input_event (int nr, int state, int max, int autofire, bool canstoprecord, bool playbackevent);
-static struct inputdevice_functions idev[3];
+static struct inputdevice_functions idev[IDTYPE_MAX];
static int isdevice (struct uae_input_device *id)
{
static struct uae_input_device *joysticks;
static struct uae_input_device *mice;
static struct uae_input_device *keyboards;
+static struct uae_input_device *internalevents;
static struct uae_input_device_kbr_default *keyboard_default, **keyboard_default_table;
#define KBR_DEFAULT_MAP_FIRST 0
static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf)
{
- TCHAR tmp2[MAX_DPATH];
+ TCHAR tmp2[CONFIG_BLEN];
if (idnum == GAMEPORT_INPUT_SETTINGS) {
if (!isdevice (id))
static void write_config2 (struct zfile *f, int idnum, int i, int offset, const TCHAR *extra, struct uae_input_device *id)
{
- TCHAR tmp2[200], tmp3[200], *p;
+ TCHAR tmp2[CONFIG_BLEN], tmp3[CONFIG_BLEN], *p;
int evt, got, j, k;
TCHAR *custom;
const int *slotorder;
static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae_input_device *kbr, struct inputdevice_functions *idf)
{
- TCHAR tmp1[200], tmp2[200], tmp3[200], tmp4[200], tmp5[200], *p;
+ TCHAR tmp1[CONFIG_BLEN], tmp2[CONFIG_BLEN], tmp3[CONFIG_BLEN], tmp4[CONFIG_BLEN], tmp5[CONFIG_BLEN], *p;
int i, j, k, evt, skip;
const int *slotorder;
}
}
-static void write_config (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct uae_input_device2 *id2, struct inputdevice_functions *idf)
+static void write_config (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf)
{
TCHAR tmp1[MAX_DPATH];
int i;
cfgfile_dwrite_str (f, tmp, p->input_config_name[id]);
}
for (i = 0; i < MAX_INPUT_DEVICES; i++)
- write_config (f, id, i, _T("joystick"), &p->joystick_settings[id][i], &joysticks2[i], &idev[IDTYPE_JOYSTICK]);
+ write_config (f, id, i, _T("joystick"), &p->joystick_settings[id][i], &idev[IDTYPE_JOYSTICK]);
for (i = 0; i < MAX_INPUT_DEVICES; i++)
- write_config (f, id, i, _T("mouse"), &p->mouse_settings[id][i], &mice2[i], &idev[IDTYPE_MOUSE]);
+ write_config (f, id, i, _T("mouse"), &p->mouse_settings[id][i], &idev[IDTYPE_MOUSE]);
for (i = 0; i < MAX_INPUT_DEVICES; i++)
write_kbr_config (f, id, i, &p->keyboard_settings[id][i], &idev[IDTYPE_KEYBOARD]);
+ write_config (f, id, 0, _T("internal"), &p->internalevent_settings[id][0], &idev[IDTYPE_INTERNALEVENT]);
}
}
static TCHAR *getstring (const TCHAR **pp)
{
int i;
- static TCHAR str[1000];
+ static TCHAR str[CONFIG_BLEN];
const TCHAR *p = *pp;
if (*p == 0)
p = option + 9;
} else if (_tcsncmp (option, _T("keyboard."), 9) == 0) {
p = option + 9;
+ } else if (_tcsncmp (option, _T("internal."), 9) == 0) {
+ p = option + 9;
} else
return;
} else if (_tcsncmp (option, _T("keyboard."), 9) == 0) {
id = &pr->keyboard_settings[idnum][devnum];
joystick = -1;
+ } else if (_tcsncmp (option, _T("internal."), 9) == 0) {
+ if (devnum > 0)
+ return;
+ id = &pr->internalevent_settings[idnum][devnum];
+ joystick = 1;
}
if (!id)
return;
} while (handle_msgpump ());
}
-static int handle_custom_event (TCHAR *custom)
+static int handle_custom_event (const TCHAR *custom)
{
TCHAR *p, *buf, *nextp;
while (*nextp == ' ')
nextp++;
}
+ //write_log (L"-> '%s'\n", p);
cfgfile_parse_line (&changed_prefs, p, 0);
p = nextp;
}
if (!r && currprefs.cs_resetwarning && resetwarning_do (1))
return;
memset (keybuf, 0, sizeof (keybuf));
+ send_internalevent (INTERNALEVENT_KBRESET);
uae_reset (r);
}
if (record_key ((uae_u8)((key << 1) | (key >> 7)))) {
}
-static void process_custom_event (struct uae_input_device *id, int offset, int state, int qualmask, int autofire, int sub)
+static bool process_custom_event (struct uae_input_device *id, int offset, int state, int qualmask, int autofire, int sub)
{
int idx, slotoffset, flags, custompos, qual;
TCHAR *custom;
- queue_input_event (-1, NULL, -1, 0, 0, 1);
-
if (!id)
- return;
+ return false;
slotoffset = sub / 4;
flags = id->flags[offset][slotoffset];
qual = flags & ID_FLAG_QUALIFIER_MASK;
- custompos = (flags & ID_FLAG_CUSTOMEVENT_TOGGLED) ? 1 : 0;
+ int af = flags & ID_FLAG_AUTOFIRE_MASK;
- // check that slots 0 and 2 have same qualifiers, only allow toggle if both are same
- if ((id->flags[offset][slotoffset + 2] & ID_FLAG_QUALIFIER_MASK) != qual) {
- id->flags[offset][slotoffset] &= ~ID_FLAG_CUSTOMEVENT_TOGGLED;
+ // check that slots 0 and 2 have same qualifiers, only allow toggle if both are same and neither has autofire
+ if ((id->flags[offset][slotoffset + 2] & ID_FLAG_QUALIFIER_MASK) != qual ||
+ (id->custom[offset][slotoffset] == NULL && id->custom[offset][slotoffset + 2] == NULL) ||
+ (id->flags[offset][slotoffset + 2] & ID_FLAG_AUTOFIRE_MASK) || (af & ID_FLAG_AUTOFIRE_MASK)) {
+ id->flags[offset][slotoffset] &= ~(ID_FLAG_CUSTOMEVENT_TOGGLED1 | ID_FLAG_CUSTOMEVENT_TOGGLED2);
if (checkqualifiers (id->eventid[offset][slotoffset + sub], id->flags[offset][slotoffset + sub], qualmask)) {
custom = id->custom[offset][slotoffset + sub];
- if (custom) {
+ if (state && custom) {
if (autofire)
queue_input_event (-1, custom, 1, 1, currprefs.input_autofire_linecnt, 1);
- if (state && custom)
- handle_custom_event (custom);
+ handle_custom_event (custom);
+ return true;
}
- return;
}
+ return false;
}
if (sub != 0)
- return;
+ return false;
slotoffset = 0;
if (!checkqualifiers (id->eventid[offset][slotoffset], id->flags[offset][slotoffset], qualmask)) {
slotoffset = 4;
if (!checkqualifiers (id->eventid[offset][slotoffset], id->flags[offset][slotoffset], qualmask))
- return;
+ return false;
}
flags = id->flags[offset][slotoffset];
- custompos = (flags & ID_FLAG_CUSTOMEVENT_TOGGLED) ? 1 : 0;
+ custompos = (flags & ID_FLAG_CUSTOMEVENT_TOGGLED1) ? 1 : 0;
+ custompos |= (flags & ID_FLAG_CUSTOMEVENT_TOGGLED2) ? 2 : 0;
- idx = -1;
if (state < 0) {
idx = 0;
custompos = 0;
} else {
- idx = state > 0 ? 0 : 1;
- if (custompos)
- idx += 2;
- if (state == 0)
- custompos ^= 1;
+ if (state > 0) {
+ if (custompos & 1)
+ return false; // waiting for release
+ } else {
+ if (!(custompos & 1))
+ return false; // waiting for press
+ }
+ idx = custompos;
+ custompos++;
}
- custom = id->custom[offset][idx + slotoffset];
- if (custom == NULL) {
- if (idx >= 2)
- custom = id->custom[offset][idx - 2 + slotoffset];
+ queue_input_event (-1, NULL, -1, 0, 0, 1);
+
+ if ((id->flags[offset][slotoffset + idx] & ID_FLAG_QUALIFIER_MASK) == qual) {
+ custom = id->custom[offset][slotoffset + idx];
+ if (autofire)
+ queue_input_event (-1, custom, 1, 1, currprefs.input_autofire_linecnt, 1);
+ if (custom)
+ handle_custom_event (custom);
}
- if (autofire)
- queue_input_event (-1, custom, 1, 1, currprefs.input_autofire_linecnt, 1);
- if (state && custom)
- handle_custom_event (custom);
+ id->flags[offset][slotoffset] &= ~(ID_FLAG_CUSTOMEVENT_TOGGLED1 | ID_FLAG_CUSTOMEVENT_TOGGLED2);
+ id->flags[offset][slotoffset] |= (custompos & 1) ? ID_FLAG_CUSTOMEVENT_TOGGLED1 : 0;
+ id->flags[offset][slotoffset] |= (custompos & 2) ? ID_FLAG_CUSTOMEVENT_TOGGLED2 : 0;
- id->flags[offset][slotoffset] &= ~ID_FLAG_CUSTOMEVENT_TOGGLED;
- id->flags[offset][slotoffset] |= custompos ? ID_FLAG_CUSTOMEVENT_TOGGLED : 0;
+ return true;
}
static void setbuttonstateall (struct uae_input_device *id, struct uae_input_device2 *id2, int button, int state)
static frame_time_t switchdevice_timeout;
int i;
uae_u32 mask = 1 << button;
- uae_u32 omask = id2->buttonmask & mask;
+ uae_u32 omask = id2 ? id2->buttonmask & mask : 0;
uae_u32 nmask = (state ? 1 : 0) << button;
int qualmask;
bool qualonly;
qualmask = getqualmask (id, ID_BUTTON_OFFSET + button, &qualonly);
+ bool didcustom = false;
+
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
uae_u32 *flagsp = &id->flags[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
int evt = evt = id->eventid[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
int inverttoggle = (flags & ID_FLAG_INVERTTOGGLE) ? 1 : 0;
if (!state) {
- process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
+ didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
}
setqualifiers (flags, state > 0);
continue;
handle_input_event (evt, 1, 1, 0, true, false);
queue_input_event (evt, NULL, 0, 1, 1, 0); /* send release event next frame */
- process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, 0, i);
+ didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, 0, i);
} else if (inverttoggle) {
/* pressed = firebutton, not pressed = autofire */
if (state) {
} else {
handle_input_event (evt, 1, 1, autofire, true, false);
}
- process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
+ didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
} else if (toggle) {
if (!state)
continue;
*flagsp ^= ID_FLAG_TOGGLED;
int toggled = (*flagsp & ID_FLAG_TOGGLED) ? 1 : 0;
handle_input_event (evt, toggled, 1, autofire, true, false);
- process_custom_event (id, ID_BUTTON_OFFSET + button, toggled, qualmask, autofire, i);
+ didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, toggled, qualmask, autofire, i);
} else {
if (!checkqualifiers (evt, flags, qualmask)) {
if (!state && !(flags & ID_FLAG_CANRELEASE)) {
if ((omask ^ nmask) & mask) {
handle_input_event (evt, state, 1, autofire, true, false);
if (state)
- process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
+ didcustom |= process_custom_event (id, ID_BUTTON_OFFSET + button, state, qualmask, autofire, i);
}
}
}
- if ((omask ^ nmask) & mask) {
+ if (!didcustom)
+ queue_input_event (-1, NULL, -1, 0, 0, 1);
+
+ if (id2 && ((omask ^ nmask) & mask)) {
if (state)
id2->buttonmask |= mask;
else
disableifempty2 (&mice[l]);
disableifempty2 (&keyboards[l]);
}
+ prefs->internalevent_settings[0]->enabled = true;
}
static void matchdevices (struct inputdevice_functions *inf, struct uae_input_device *uid)
joysticks = prefs->joystick_settings[prefs->input_selected_setting];
mice = prefs->mouse_settings[prefs->input_selected_setting];
keyboards = prefs->keyboard_settings[prefs->input_selected_setting];
+
if (prefs->input_selected_setting != GAMEPORT_INPUT_SETTINGS) {
int xflags, xport;
TCHAR xname[MAX_DPATH], xcustom[MAX_DPATH];
joysticks = prefs->joystick_settings[prefs->input_selected_setting];
mice = prefs->mouse_settings[prefs->input_selected_setting];
keyboards = prefs->keyboard_settings[prefs->input_selected_setting];
+ internalevents = prefs->internalevent_settings[prefs->input_selected_setting];
matchdevices_all (prefs);
joysticks = prefs->joystick_settings[GAMEPORT_INPUT_SETTINGS];
mice = prefs->mouse_settings[GAMEPORT_INPUT_SETTINGS];
keyboards = prefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS];
+ internalevents = prefs->internalevent_settings[GAMEPORT_INPUT_SETTINGS];
+
for (i = 0; i < MAX_INPUT_SETTINGS; i++) {
joysticks[i].enabled = 0;
mice[i].enabled = 0;
}
+
compatibility_copy (prefs, true);
joysticks = prefs->joystick_settings[prefs->input_selected_setting];
mice = prefs->mouse_settings[prefs->input_selected_setting];
keyboards = prefs->keyboard_settings[prefs->input_selected_setting];
+ internalevents = prefs->internalevent_settings[prefs->input_selected_setting];
+
if (prefs->input_selected_setting != GAMEPORT_INPUT_SETTINGS) {
compatibility_copy (prefs, false);
}
struct uae_input_device *na = &keyboards[keyboard];
int j, k;
int handled = 0;
+ bool didcustom = false;
if (!keyboards || scancode < 0)
return handled;
- if (!state)
- process_custom_event (NULL, 0, 0, 0, 0, 0);
+// if (!state)
+// process_custom_event (NULL, 0, 0, 0, 0, 0);
j = 0;
while (j < MAX_INPUT_DEVICE_EVENTS && na->extra[j] >= 0) {
continue;
if (!state) {
- process_custom_event (na, j, state, qualmask, autofire, k);
+ didcustom |= process_custom_event (na, j, state, qualmask, autofire, k);
}
// if evt == caps and scan == caps: sync with native caps led
} else {
handled |= handle_input_event (evt, 1, 1, autofire, true, false);
}
- process_custom_event (na, j, state, qualmask, autofire, k);
+ didcustom |= process_custom_event (na, j, state, qualmask, autofire, k);
} else if (toggle) {
if (!state)
continue;
toggled = (*flagsp & ID_FLAG_TOGGLED) ? 1 : 0;
handled |= handle_input_event (evt, toggled, 1, autofire, true, false);
if (k == 0)
- process_custom_event (na, j, state, qualmask, autofire, k);
+ didcustom |= process_custom_event (na, j, state, qualmask, autofire, k);
} else {
if (!checkqualifiers (evt, flags, qualmask)) {
if (!state && !(flags & ID_FLAG_CANRELEASE))
else
*flagsp &= ~ID_FLAG_CANRELEASE;
handled |= handle_input_event (evt, state, 1, autofire, true, false);
- process_custom_event (na, j, state, qualmask, autofire, k);
+ didcustom |= process_custom_event (na, j, state, qualmask, autofire, k);
}
}
+ if (!didcustom)
+ queue_input_event (-1, NULL, -1, 0, 0, 1);
return handled;
}
j++;
inputdevice_translatekeycode_2 (keyboard, scancode, state, true);
}
+static const TCHAR *internaleventlabels[] = {
+ _T("CPU reset"),
+ _T("Keyboard reset"),
+ NULL
+};
+static int init_int (void)
+{
+ return 1;
+}
+static void close_int (void)
+{
+}
+static int acquire_int (int num, int flags)
+{
+ return 1;
+}
+static void unacquire_int (int num)
+{
+}
+static void read_int (void)
+{
+}
+static int get_int_num (void)
+{
+ return 1;
+}
+static TCHAR *get_int_friendlyname (int num)
+{
+ return _T("Internal events");
+}
+static TCHAR *get_int_uniquename (int num)
+{
+ return _T("INTERNALEVENTS1");
+}
+static int get_int_widget_num (int num)
+{
+ int i;
+ for (i = 0; internaleventlabels[i]; i++);
+ return i;
+}
+static int get_int_widget_type (int kb, int num, TCHAR *name, uae_u32 *code)
+{
+ if (code)
+ *code = num;
+ if (name)
+ _tcscpy (name, internaleventlabels[num]);
+ return IDEV_WIDGET_BUTTON;
+}
+static int get_int_widget_first (int kb, int type)
+{
+ return 0;
+}
+static int get_int_flags (int num)
+{
+ return 0;
+}
+static struct inputdevice_functions inputdevicefunc_internalevent = {
+ init_int, close_int, acquire_int, unacquire_int, read_int,
+ get_int_num, get_int_friendlyname, get_int_uniquename,
+ get_int_widget_num, get_int_widget_type,
+ get_int_widget_first,
+ get_int_flags
+};
+
+void send_internalevent (int eventid)
+{
+ setbuttonstateall (&internalevents[0], NULL, eventid, -1);
+}
+
+
void inputdevice_init (void)
{
idev[IDTYPE_JOYSTICK] = inputdevicefunc_joystick;
idev[IDTYPE_MOUSE].init ();
idev[IDTYPE_KEYBOARD] = inputdevicefunc_keyboard;
idev[IDTYPE_KEYBOARD].init ();
+ idev[IDTYPE_INTERNALEVENT] = inputdevicefunc_internalevent;
+ idev[IDTYPE_INTERNALEVENT].init ();
}
void inputdevice_close (void)
idev[IDTYPE_JOYSTICK].close ();
idev[IDTYPE_MOUSE].close ();
idev[IDTYPE_KEYBOARD].close ();
+ idev[IDTYPE_INTERNALEVENT].close ();
inprec_close (true);
}
uid = &mice[devnum];
} else if (id == &idev[IDTYPE_KEYBOARD]) {
uid = &keyboards[devnum];
+ } else if (id == &idev[IDTYPE_INTERNALEVENT]) {
+ uid = &internalevents[devnum];
}
return uid;
}
return -1;
}
+static TCHAR *stripstrdup (const TCHAR *s)
+{
+ TCHAR *out = my_strdup (s);
+ if (!out)
+ return NULL;
+ for (int i = 0; out[i]; i++) {
+ if (out[i] < ' ')
+ out[i] = ' ';
+ }
+ return out;
+}
+
static int put_event_data (const struct inputdevice_functions *id, int devnum, int num, int eventid, TCHAR *custom, int flags, int port, int sub)
{
struct uae_input_device *uid = get_uid (id, devnum);
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? my_strdup (custom) : NULL;
+ uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
ret = i;
} else if (type == IDEV_WIDGET_AXIS) {
i = num - id->get_widget_first (devnum, type) + ID_AXIS_OFFSET;
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? my_strdup (custom) : NULL;
+ uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
ret = i;
} else if (type == IDEV_WIDGET_KEY) {
i = num - id->get_widget_first (devnum, type);
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? my_strdup (custom) : NULL;
+ uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
ret = i;
}
if (ret < 0)
// device based index from global device index
int inputdevice_get_device_index (int devnum)
{
- if (devnum < idev[IDTYPE_JOYSTICK].get_num ())
+ int jcnt = idev[IDTYPE_JOYSTICK].get_num ();
+ int mcnt = idev[IDTYPE_MOUSE].get_num ();
+ int kcnt = idev[IDTYPE_KEYBOARD].get_num ();
+
+ if (devnum < jcnt)
return devnum;
- else if (devnum < idev[IDTYPE_JOYSTICK].get_num () + idev[IDTYPE_MOUSE].get_num ())
- return devnum - idev[IDTYPE_JOYSTICK].get_num ();
- else if (devnum < idev[IDTYPE_JOYSTICK].get_num () + idev[IDTYPE_MOUSE].get_num () + idev[IDTYPE_KEYBOARD].get_num ())
- return devnum - idev[IDTYPE_JOYSTICK].get_num () - idev[IDTYPE_MOUSE].get_num ();
- else
- return -1;
+ else if (devnum < jcnt + mcnt)
+ return devnum - jcnt;
+ else if (devnum < jcnt + mcnt + kcnt)
+ return devnum - (jcnt + mcnt);
+ else if (devnum < jcnt + mcnt + kcnt + INTERNALEVENT_COUNT)
+ return devnum - (jcnt + mcnt + kcnt);
+ return -1;
}
static int getdevnum (int type, int devnum)
{
+ int jcnt = idev[IDTYPE_JOYSTICK].get_num ();
+ int mcnt = idev[IDTYPE_MOUSE].get_num ();
+ int kcnt = idev[IDTYPE_KEYBOARD].get_num ();
+
if (type == IDTYPE_JOYSTICK)
return devnum;
- if (type == IDTYPE_MOUSE)
- return idev[IDTYPE_JOYSTICK].get_num () + devnum;
- if (type == IDTYPE_KEYBOARD)
- return idev[IDTYPE_JOYSTICK].get_num () + idev[IDTYPE_MOUSE].get_num () + devnum;
+ else if (type == IDTYPE_MOUSE)
+ return jcnt + devnum;
+ else if (type == IDTYPE_KEYBOARD)
+ return jcnt + mcnt + devnum;
+ else if (type == IDTYPE_INTERNALEVENT)
+ return jcnt + mcnt + kcnt + devnum;
return -1;
}
static int gettype (int devnum)
{
- if (devnum < idev[IDTYPE_JOYSTICK].get_num ())
+ int jcnt = idev[IDTYPE_JOYSTICK].get_num ();
+ int mcnt = idev[IDTYPE_MOUSE].get_num ();
+ int kcnt = idev[IDTYPE_KEYBOARD].get_num ();
+
+ if (devnum < jcnt)
return IDTYPE_JOYSTICK;
- else if (devnum < idev[IDTYPE_JOYSTICK].get_num () + idev[IDTYPE_MOUSE].get_num ())
+ else if (devnum < jcnt + mcnt)
return IDTYPE_MOUSE;
- else if (devnum < idev[IDTYPE_JOYSTICK].get_num () + idev[IDTYPE_MOUSE].get_num () + idev[IDTYPE_KEYBOARD].get_num ())
+ else if (devnum < jcnt + mcnt + kcnt)
return IDTYPE_KEYBOARD;
- else
- return -1;
+ else if (devnum < jcnt + mcnt + kcnt + INTERNALEVENT_COUNT)
+ return IDTYPE_INTERNALEVENT;
+ return -1;
}
static struct inputdevice_functions *getidf (int devnum)
if (noflags) {
fprintf (stblfile, "{ op_%lx_%d_comp_nf, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, name);
fprintf (headerfile, "extern compop_func op_%lx_%d_comp_nf;\n", opcode, postfix);
- printf ("unsigned long REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
+ printf ("uae_u32 REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
} else {
fprintf (stblfile, "{ op_%lx_%d_comp_ff, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, name);
fprintf (headerfile, "extern compop_func op_%lx_%d_comp_ff;\n", opcode, postfix);
- printf ("unsigned long REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
+ printf ("uae_u32 REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
}
com_flush();
}
#include "gayle.h"
#include "cia.h"
#include "inputrecord.h"
+#include "inputdevice.h"
#ifdef JIT
#include "jit/compemu.h"
#include <signal.h>
{
}
-static unsigned long REGPARAM2 op_illg_1 (uae_u32 opcode)
+static uae_u32 REGPARAM2 op_illg_1 (uae_u32 opcode)
{
op_illg (opcode);
return 4;
lvl = 5;
tbl = op_smalltbl_0_ff;
if (currprefs.cpu_cycle_exact)
- tbl = op_smalltbl_21_ff;
+ tbl = op_smalltbl_22_ff;
if (currprefs.mmu_model)
tbl = op_smalltbl_31_ff;
break;
lvl = 4;
tbl = op_smalltbl_1_ff;
if (currprefs.cpu_cycle_exact)
- tbl = op_smalltbl_22_ff;
+ tbl = op_smalltbl_23_ff;
if (currprefs.mmu_model)
tbl = op_smalltbl_31_ff;
break;
lvl = 3;
tbl = op_smalltbl_2_ff;
if (currprefs.cpu_cycle_exact)
- tbl = op_smalltbl_23_ff;
+ tbl = op_smalltbl_24_ff;
break;
case 68020:
lvl = 2;
tbl = op_smalltbl_3_ff;
- if (currprefs.cpu_cycle_exact)
+#ifdef CPUEMU_20
+ if (currprefs.cpu_compatible)
tbl = op_smalltbl_20_ff;
+#endif
+#ifdef CPUEMU_21
+ if (currprefs.cpu_cycle_exact)
+ tbl = op_smalltbl_21_ff;
+#endif
break;
case 68010:
lvl = 1;
fill_prefetch_quick ();
}
-unsigned long REGPARAM2 op_illg (uae_u32 opcode)
+uae_u32 REGPARAM2 op_illg (uae_u32 opcode)
{
uaecptr pc = m68k_getpc ();
static int warned;
}
}
+#ifdef CPUEMU_31
+
/* Aranym MMU 68040 */
static void m68k_run_mmu040 (void)
{
}
+#endif
+
/* "cycle exact" 68020/030 */
STATIC_INLINE void docodece020 (uae_u32 opcode)
}
}
+#ifdef CPUEMU_20
+
/* emulate simple prefetch */
+
+uae_u32 get_word_020_prefetch (int o)
+{
+ uae_u32 pc = m68k_getpc () + o;
+
+ if (pc == regs.prefetch020addr) {
+ uae_u32 v = regs.prefetch020[0];
+ regs.prefetch020[0] = regs.prefetch020[1];
+ regs.prefetch020[1] = regs.prefetch020[2];
+ regs.prefetch020[2] = x_get_word (pc + 6);
+ regs.prefetch020addr += 2;
+ return v;
+ } else {
+ regs.prefetch020addr = pc + 2;
+ regs.prefetch020[0] = x_get_word (pc + 2);
+ regs.prefetch020[1] = x_get_word (pc + 4);
+ regs.prefetch020[2] = x_get_word (pc + 6);
+ return x_get_word (pc);
+ }
+}
+
static void m68k_run_2p (void)
{
- uae_u32 prefetch, prefetch_pc;
struct regstruct *r = ®s;
- prefetch_pc = m68k_getpc ();
- prefetch = x_get_long (prefetch_pc);
for (;;) {
- uae_u32 pc = m68k_getpc ();
uae_u16 opcode;
- r->instruction_pc = pc;
+ r->instruction_pc = m68k_getpc ();
#if DEBUG_CD32CDTVIO
out_cd32io (m68k_getpc ());
x_do_cycles (cpu_cycles);
- if (pc == prefetch_pc) {
- opcode = prefetch >> 16;
- } else if (pc == prefetch_pc + 2) {
- opcode = prefetch;
- } else {
- opcode = x_get_word (pc);
- prefetch_pc = pc + 2;
- prefetch = x_get_long (prefetch_pc);
- }
+ opcode = get_word_020_prefetch (0);
count_instr (opcode);
}
}
+#endif
+
//static int used[65536];
/* Same thing, but don't use prefetch to get opcode. */
uaecptr ksboot = 0xf80002 - 2; /* -2 = RESET hasn't increased PC yet */
uae_u16 ins;
+ send_internalevent (INTERNALEVENT_CPURESET);
if (currprefs.cpu_compatible || currprefs.cpu_cycle_exact) {
custom_reset (0);
return;
write_log (L"ReportCount: %u\n", caps.ReportCount);
write_log (L"UnitsExp: %u\n", caps.UnitsExp);
write_log (L"Units: %u\n", caps.Units);
- write_log (L"LogicalMin: %u\n", caps.LogicalMin);
- write_log (L"LogicalMax: %u\n", caps.LogicalMax);
- write_log (L"PhysicalMin: %u\n", caps.PhysicalMin);
- write_log (L"PhysicalMax: %u\n", caps.PhysicalMax);
+ write_log (L"LogicalMin: %u (%d)\n", caps.LogicalMin, extractbits (caps.LogicalMin, caps.BitSize, caps.LogicalMin < 0));
+ write_log (L"LogicalMax: %u (%d)\n", caps.LogicalMax, extractbits (caps.LogicalMax, caps.BitSize, caps.LogicalMin < 0));
+ write_log (L"PhysicalMin: %u (%d)\n", caps.PhysicalMin, extractbits (caps.PhysicalMin, caps.BitSize, caps.PhysicalMin < 0));
+ write_log (L"PhysicalMax: %u (%d)\n", caps.PhysicalMax, extractbits (caps.PhysicalMax, caps.BitSize, caps.PhysicalMax < 0));
if (caps.IsRange) {
write_log (L"UsageMin: %u\n", caps.Range.UsageMin);
write_log (L"UsageMax: %u\n", caps.Range.UsageMax);
write_log (_T("NumberFeatureDataIndices: %u\n"), caps.NumberFeatureDataIndices);
}
+static void dumphidend (void)
+{
+ write_log (_T("\n"));
+ }
+
static bool initialize_rawinput (void)
{
RAWINPUTDEVICELIST *ridl = 0;
}
}
xfree (vcaps);
+ dumphidend ();
}
}
if (ok) {
</PreLinkEvent>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
- <OutputFile>gencpu.exe</OutputFile>
+ <OutputFile>debug\gencpu.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/gencpu.pdb</ProgramDatabaseFile>
</Link>
<PostBuildEvent>
<Message>generating gencpu files</Message>
- <Command>cd ..\..
-od-win32\gencpu_msvc\gencpu.exe
-</Command>
+ <Command>
+ </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
#define IDC_RTG_DISPLAYSELECT 1809
#define IDC_MISCLIST 1810
#define IDC_STATENAME 1811
+#define IDC_EDIT1 1812
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 386
#define _APS_NEXT_COMMAND_VALUE 40050
-#define _APS_NEXT_CONTROL_VALUE 1812
+#define _APS_NEXT_CONTROL_VALUE 1813
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
CTEXT "x",IDC_PROGRESSBAR_TEXT,23,5,187,10,SS_CENTERIMAGE | WS_TABSTOP\r
END\r
\r
-IDD_STRINGBOX DIALOGEX 0, 0, 229, 58\r
+IDD_STRINGBOX DIALOGEX 0, 0, 229, 107\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU\r
CAPTION "Enter text..."\r
FONT 8, "MS Sans Serif", 0, 0, 0x0\r
BEGIN\r
- EDITTEXT IDC_STRINGBOXEDIT,7,17,214,14,ES_AUTOHSCROLL | ES_WANTRETURN\r
- DEFPUSHBUTTON "OK",IDOK,48,39,50,14\r
- PUSHBUTTON "Cancel",IDCANCEL,151,39,50,14\r
+ EDITTEXT IDC_STRINGBOXEDIT,7,8,214,65,ES_MULTILINE\r
+ DEFPUSHBUTTON "OK",IDOK,48,84,50,14\r
+ PUSHBUTTON "Cancel",IDCANCEL,151,84,50,14\r
END\r
\r
IDD_DEBUGGER DIALOGEX 0, 0, 454, 368\r
\r
IDD_STRINGBOX, DIALOG\r
BEGIN\r
+ BOTTOMMARGIN, 58\r
END\r
\r
IDD_EXPANSION, DIALOG\r
del cpuemu_12.cpp
del cpuemu_20.cpp
del cpuemu_21.cpp
+del cpuemu_22.cpp
del cpuemu_31.cpp
del linetoscr.cpp
+del aros.rom.cpp
cd jit
del compemu.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_11 /* 68000 prefetch emulation */
#define CPUEMU_12 /* 68000 cycle-exact cpu&blitter */
-#define CPUEMU_20 /* 68020 "cycle-exact" + blitter */
-#define CPUEMU_21 /* 68030 (040/060) "cycle-exact" + blitter */
+#define CPUEMU_20 /* 68020 prefetch */
+#define CPUEMU_21 /* 68020 "cycle-exact" + blitter */
+#define CPUEMU_22 /* 68030 (040/060) "cycle-exact" + blitter */
#define CPUEMU_31 /* 68040 Aranym MMU */
#define ACTION_REPLAY /* Action Replay 1/2/3 support */
#define PICASSO96 /* Picasso96 display card emulation */
#include "cloanto/RetroPlatformIPC.h"
#endif
-extern int harddrive_dangerous, do_rdbdump, aspi_allow_all, no_rawinput;
+extern int harddrive_dangerous, do_rdbdump, no_rawinput;
extern int force_directsound;
extern int log_a2065, a2065_promiscuous;
extern int rawinput_enabled_hid, rawinput_log;
{
extern bool win32_spti_media_change (TCHAR driveletter, int insert);
extern bool win32_ioctl_media_change (TCHAR driveletter, int insert);
- extern bool win32_aspi_media_change (TCHAR driveletter, int insert);
DEV_BROADCAST_HDR *pBHdr = (DEV_BROADCAST_HDR *)lParam;
static int waitfornext;
matched |= win32_spti_media_change (drive, inserted);
matched |= win32_ioctl_media_change (drive, inserted);
#endif
- matched |= win32_aspi_media_change (drive, inserted);
}
if (type == DRIVE_REMOVABLE || type == DRIVE_CDROM || !inserted) {
write_log (_T("WM_DEVICECHANGE '%s' type=%d inserted=%d\n"), drvname, type, inserted);
return keybuf;
}
-
-extern const TCHAR *get_aspi_path (int);
-
-static int get_aspi (int old)
-{
- if (old == UAESCSI_NEROASPI && get_aspi_path (1))
- return old;
- if (old == UAESCSI_FROGASPI && get_aspi_path (2))
- return old;
- if (old == UAESCSI_ADAPTECASPI && get_aspi_path (0))
- return old;
- if (get_aspi_path (1))
- return UAESCSI_NEROASPI;
- else if (get_aspi_path (2))
- return UAESCSI_FROGASPI;
- else if (get_aspi_path (0))
- return UAESCSI_ADAPTECASPI;
- else
- return UAESCSI_SPTI;
-}
-
-
/***
*static void parse_cmdline(cmdstart, argv, args, numargs, numchars)
*
void target_fixup_options (struct uae_prefs *p)
{
if (p->win32_automount_cddrives && !p->scsi)
- p->scsi = 1;
+ p->scsi = UAESCSI_SPTI;
+ if (p->scsi > UAESCSI_LAST)
+ p->scsi = UAESCSI_SPTI;
bool paused = false;
bool nosound = false;
if (!paused) {
}
}
-static const TCHAR *scsimode[] = { _T("SCSIEMU"), _T("SPTI"), _T("SPTI+SCSISCAN"), _T("AdaptecASPI"), _T("NeroASPI"), _T("FrogASPI"), NULL };
+static const TCHAR *scsimode[] = { _T("SCSIEMU"), _T("SPTI"), _T("SPTI+SCSISCAN"), NULL };
static const TCHAR *statusbarmode[] = { _T("none"), _T("normal"), _T("extended"), NULL };
static struct midiportinfo *getmidiport (struct midiportinfo **mi, int devid)
return 1;
}
if (!_tcscmp (arg, _T("noaspifiltering"))) {
- aspi_allow_all = 1;
+ //aspi_allow_all = 1;
return 1;
}
#endif
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("4")
-#define WINUAEDATE MAKEBD(2012, 6, 3)
+#define WINUAEBETA _T("5")
+#define WINUAEDATE MAKEBD(2012, 6, 18)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern int pause_emulation;
extern int sound_available;
extern int framecnt;
-extern TCHAR prtname[];
extern TCHAR VersionStr[256];
extern TCHAR BetaStr[64];
extern int os_winnt_admin, os_64bit, os_vista, os_winxp, os_win7, cpu_number;
{ 4, IDS_QS_MODEL_A500P }, // "Amiga 500+"
{ 4, IDS_QS_MODEL_A600 }, // "Amiga 600"
{ 4, IDS_QS_MODEL_A1000 }, // "Amiga 1000"
- { 3, IDS_QS_MODEL_A1200 }, // "Amiga 1200"
+ { 4, IDS_QS_MODEL_A1200 }, // "Amiga 1200"
{ 1, IDS_QS_MODEL_A3000 }, // "Amiga 3000"
{ 1, IDS_QS_MODEL_A4000 }, // "Amiga 4000"
{ 0, }, //{ 1, IDS_QS_MODEL_A4000T }, // "Amiga 4000T"
}
-extern const TCHAR *get_aspi_path (int);
-
static void misc_scsi (HWND hDlg)
{
SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SCSI Emulation *"));
SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SPTI"));
SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SPTI + SCSI SCAN"));
- SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (0)) ? _T("AdaptecASPI") : _T("(AdaptecASPI)")));
- SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (1)) ? _T("NeroASPI") : _T("(NeroASPI)")));
- SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (2)) ? _T("FrogASPI") : _T("(FrogASPI)")));
SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_SETCURSEL, workprefs.win32_uaescsimode, 0);
}
for (i = 0; i < inputdevice_get_device_total (IDTYPE_KEYBOARD); i++) {
SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_KEYBOARD, i));
}
+ for (i = 0; i < inputdevice_get_device_total (IDTYPE_INTERNALEVENT); i++) {
+ SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_INTERNALEVENT, i));
+ }
input_total_devices = inputdevice_get_device_total (IDTYPE_JOYSTICK) +
inputdevice_get_device_total (IDTYPE_MOUSE) +
- inputdevice_get_device_total (IDTYPE_KEYBOARD);
+ inputdevice_get_device_total (IDTYPE_KEYBOARD) +
+ inputdevice_get_device_total (IDTYPE_INTERNALEVENT);
if (input_selected_device >= input_total_devices)
input_selected_device = 0;
InitializeListView (hDlg);
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;C:\dev\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;C:\dev\lib;C:\dev\WinDDK\7600.16385.1\lib\win7\i386;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;C:\dev\lib;C:\dev\WinDDK\7600.16385.1\lib\win7\i386;$(LibraryPath)</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;C:\dev\include;$(IncludePath)</IncludePath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='FullRelease|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;C:\dev\include;$(IncludePath)</IncludePath>
+ <ReferencePath Condition="'$(Configuration)|$(Platform)'=='FullRelease|Win32'">$(ReferencePath)</ReferencePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='FullRelease|Win32'">C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;C:\dev\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<ClCompile Include="..\..\aros.rom.cpp" />
<ClCompile Include="..\..\calc.cpp" />
<ClCompile Include="..\..\cpuemu_21.cpp" />
+ <ClCompile Include="..\..\cpuemu_22.cpp" />
<ClCompile Include="..\..\events.cpp" />
<ClCompile Include="..\..\hrtmon.rom.cpp" />
<ClCompile Include="..\..\inputrecord.cpp" />
<ClCompile Include="..\ahidsound_dsonly.cpp" />
<ClCompile Include="..\ahidsound_new.cpp" />
<ClCompile Include="..\avioutput.cpp" />
- <ClCompile Include="..\blkdev_win32_aspi.cpp" />
<ClCompile Include="..\blkdev_win32_ioctl.cpp" />
<ClCompile Include="..\blkdev_win32_spti.cpp" />
<ClCompile Include="..\bsdsock.cpp" />
<ClCompile Include="..\avioutput.cpp">
<Filter>win32</Filter>
</ClCompile>
- <ClCompile Include="..\blkdev_win32_aspi.cpp">
- <Filter>win32</Filter>
- </ClCompile>
<ClCompile Include="..\blkdev_win32_ioctl.cpp">
<Filter>win32</Filter>
</ClCompile>
<ClCompile Include="..\..\isofs.cpp">
<Filter>common</Filter>
</ClCompile>
+ <ClCompile Include="..\..\cpuemu_22.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\resources\35floppy.ico">
- hdd from command line
- no-buffer tearing updates
+Beta 5:
+
+- More custom input event fixes.
+- Replaced custom event single line string dialog with larger multiline dialog, increased allowed custom event string length.
+- Autoresolution didn't detect interlaced mode in some situations.
+- Added "Internal events" input device category. Currently it only contains two events:
+ "CPU reset" and "Keyboard reset". It can be used to customize what happens when emulated Amiga is reset.
+ For example: set CPU mode back to fastest possible, eject or insert disks, quit emulator, etc..
+- Added 68020 prefetch CPU core. Emulates instruction prefetch without cycle-exact. "More compatible" option
+ enables this mode (Previously it did nothing in 68020 mode)
+- A1200/CD32 Quickstart compatibility slider changed: cycle-exact/prefetch/fastest possible without JIT/JIT
+- ASPI support removed.
+
Beta 4:
- Custom input event autofire wasn't always canceled when shortcut included qualifier(s).