do_blitter2 (hpos, copper);
return;
}
+ if (!dmaen (DMA_BLITTER) || !blt_info.got_cycle)
+ return;
// previous blit may have last write cycle left
// and we must let it finish
blit_startcycles = BLITTER_STARTUP_CYCLES;
mmu_flush_atc_all(true);
#if 0
regs.urp = regs.srp = 0;
- regs.itt0 = regs.itt0 = 0;
- regs.dtt0 = regs.dtt0 = 0;
+ regs.itt0 = regs.itt1 = 0;
+ regs.dtt0 = regs.dtt1 = 0;
regs.mmusr = 0;
#endif
}
int ret, err = ERROR_NO_FREE_STORE;
int blocksize, nr;
uae_u32 dostype;
- bool fs = false;
+ bool fs = false, media = false;
blocksize = 512;
/* not FFS because it is not understood by WB1.x C:Info */
if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
ret = zfile_fs_usage_archive (unit->ui.rootdir, 0, &fsu);
fs = true;
+ media = filesys_isvolume (unit);
} else if (unit->volflags & MYVOLUMEINFO_CDFS) {
struct isofs_info ii;
ret = isofs_mediainfo (unit->ui.cdfs_superblock, &ii) ? 0 : 1;
if (!ret) {
+ media = ii.media;
+ nr = unit->unit - cd_unit_offset;
+ blocksize = ii.blocksize;
if (ii.media) {
fsu.fsu_blocks = ii.blocks;
fsu.fsu_bavail = 0;
- blocksize = ii.blocksize;
- nr = unit->unit - cd_unit_offset;
- } else {
- ret = ERROR_NO_DISK;
}
}
} else {
if (ret)
err = dos_errno ();
fs = true;
+ media = filesys_isvolume (unit);
}
if (ret != 0) {
PUT_PCK_RES1 (packet, DOS_FALSE);
put_long (info + 8, unit->ui.readonly || unit->ui.locked ? 80 : 82); /* state */
put_long (info + 20, blocksize); /* bytesperblock */
put_long (info + 32, 0); /* inuse */
- if (disk_info && unit->ui.unknown_media) {
+ if (unit->ui.unknown_media) {
+ if (!disk_info) {
+ PUT_PCK_RES1 (packet, DOS_FALSE);
+ PUT_PCK_RES2 (packet, ERROR_NOT_A_DOS_DISK);
+ return;
+ }
put_long (info + 12, 0);
put_long (info + 16, 0);
put_long (info + 24, ('B' << 24) | ('A' << 16) | ('D' << 8) | (0 << 0)); /* ID_UNREADABLE_DISK */
put_long (info + 28, 0);
- } else if (disk_info && !filesys_isvolume (unit)) {
+ } else if (!media) {
+ if (!disk_info) {
+ PUT_PCK_RES1 (packet, DOS_FALSE);
+ PUT_PCK_RES2 (packet, ERROR_NO_DISK);
+ return;
+ }
put_long (info + 12, 0);
put_long (info + 16, 0);
put_long (info + 24, -1); /* ID_NO_DISK_PRESENT */
printf ("\tint ru = (src >> 6) & 7;\n");
printf ("\tint rc = src & 7;\n");
genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, rc)", "dst");
+ sync_m68k_pc ();
printf ("\tif (GET_ZFLG ())");
old_brace_level = n_braces;
start_brace ();
pop_braces (old_brace_level);
printf ("else");
start_brace ();
- printf ("m68k_dreg (regs, rc) = dst;\n");
+ switch (curi->size) {
+ case sz_byte:
+ printf ("\tm68k_dreg(regs, rc) = (m68k_dreg(regs, rc) & ~0xff) | (dst & 0xff);\n");
+ break;
+ case sz_word:
+ printf ("\tm68k_dreg(regs, rc) = (m68k_dreg(regs, rc) & ~0xffff) | (dst & 0xffff);\n");
+ break;
+ default:
+ printf ("\tm68k_dreg(regs, rc) = dst;\n");
+ break;
+ }
pop_braces (old_brace_level);
}
break;
genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, extra & 7)", "dst2");
printf ("\tif (GET_ZFLG ()) {\n");
printf ("\t%s (rn1, m68k_dreg (regs, (extra >> 22) & 7));\n", dstw);
- printf ("\t%s (rn1, m68k_dreg (regs, (extra >> 6) & 7));\n", dstw);
+ printf ("\t%s (rn2, m68k_dreg (regs, (extra >> 6) & 7));\n", dstw);
printf ("\t}}\n");
pop_braces (old_brace_level);
printf ("\tif (! GET_ZFLG ()) {\n");
- printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = (m68k_dreg (regs, (extra >> 22) & 7) & ~0xffff) | (dst1 & 0xffff);\n");
printf ("\tm68k_dreg (regs, (extra >> 6) & 7) = (m68k_dreg (regs, (extra >> 6) & 7) & ~0xffff) | (dst2 & 0xffff);\n");
+ printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = (m68k_dreg (regs, (extra >> 22) & 7) & ~0xffff) | (dst1 & 0xffff);\n");
printf ("\t}\n");
} else {
int old_brace_level = n_braces;
genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, extra & 7)", "dst2");
printf ("\tif (GET_ZFLG ()) {\n");
printf ("\t%s (rn1, m68k_dreg (regs, (extra >> 22) & 7));\n", dstl);
- printf ("\t%s (rn1, m68k_dreg (regs, (extra >> 6) & 7));\n", dstl);
+ printf ("\t%s (rn2, m68k_dreg (regs, (extra >> 6) & 7));\n", dstl);
printf ("\t}}\n");
pop_braces (old_brace_level);
printf ("\tif (! GET_ZFLG ()) {\n");
- printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = dst1;\n");
printf ("\tm68k_dreg (regs, (extra >> 6) & 7) = dst2;\n");
+ printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = dst1;\n");
printf ("\t}\n");
}
break;
extern void inputdevice_do_keyboard (int code, int state);
extern int inputdevice_iskeymapped (int keyboard, int scancode);
extern int inputdevice_synccapslock (int, int*);
-extern void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state);
+extern void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state, int max);
extern int inputdevice_get_compatibility_input (struct uae_prefs*, int, int*, int**, int**);
extern struct inputevent *inputdevice_get_eventinfo (int evt);
extern bool inputdevice_get_eventname (const struct inputevent *ie, TCHAR *out);
extern int inputdevice_uaelib (const TCHAR *, const TCHAR *);
-extern int inputdevice_testread (int*, int*, int*);
+extern int inputdevice_testread (int*, int*, int*, bool);
extern int inputdevice_istest (void);
extern void inputdevice_settest (int);
extern int inputdevice_testread_count (void);
int testmode_wtype;
int testmode_wnum;
int testmode_state;
+ int testmode_max;
};
#define TESTMODE_MAX 2
static int testmode_count;
{
TCHAR name[256];
struct inputevent *ie;
+ int sub;
+ if (evtnum < 0) {
+ joysticks = prefs->joystick_settings[GAMEPORT_INPUT_SETTINGS];
+ mice = prefs->mouse_settings[GAMEPORT_INPUT_SETTINGS];
+ keyboards = prefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS];
+ for (sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) {
+ int port2 = 0;
+ inputdevice_get_mapping (devnum, num, NULL, &port2, NULL, NULL, sub);
+ if (port2 == port + 1) {
+ inputdevice_set_mapping (devnum, num, NULL, NULL, 0, 0, sub);
+ }
+ }
+ return true;
+ }
ie = inputdevice_get_eventinfo (evtnum);
if (!inputdevice_get_eventname (ie, name))
return false;
mice = prefs->mouse_settings[GAMEPORT_INPUT_SETTINGS];
keyboards = prefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS];
- int sub = 0;
+ sub = 0;
if (inputdevice_get_widget_type (devnum, num, NULL) != IDEV_WIDGET_KEY) {
for (sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) {
+ int port2 = 0;
+ int evt = inputdevice_get_mapping (devnum, num, NULL, &port2, NULL, NULL, sub);
+ if (port2 == port + 1 && evt == evtnum)
+ break;
if (!inputdevice_get_mapping (devnum, num, NULL, NULL, NULL, NULL, sub))
break;
}
idev[IDTYPE_KEYBOARD].unacquire (-1);
}
-void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state)
+void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state, int max)
{
+ //write_log (_T("%d %d %d %d %d/%d\n"), type, num, wtype, wnum, state, max);
+
if (wnum < 0) {
testmode = -1;
return;
continue;
if (ts2->testmode_num != num || ts2->testmode_type != type || ts2->testmode_wtype != wtype || ts2->testmode_wnum != wnum)
continue;
- if (state)
- continue;
+ if (max <= 0) {
+ if (state)
+ continue;
+ } else {
+ if (state < -(max / 2) || state > (max / 2))
+ continue;
+ }
ts2->testmode_num = -1;
}
- if (!state)
- return;
+ if (max <= 0) {
+ if (!state)
+ return;
+ } else {
+ if (state >= -(max / 2) && state <= (max / 2))
+ return;
+ }
- //write_log (_T("%d %d %d %d %d\n"), type, num, wtype, wnum, state);
+ //write_log (_T("%d %d %d %d %d/%d\n"), type, num, wtype, wnum, state, max);
struct teststore *ts = &testmode_data[testmode_count];
ts->testmode_type = type;
ts->testmode_num = num;
ts->testmode_wtype = wtype;
ts->testmode_wnum = wnum;
ts->testmode_state = state;
+ ts->testmode_max = max;
testmode_count++;
}
return testmode_count;
}
-int inputdevice_testread (int *devnum, int *wtype, int *state)
+int inputdevice_testread (int *devnum, int *wtype, int *state, bool doread)
{
- inputdevice_read ();
- if (testmode != 1) {
- testmode = 0;
- return -1;
+ if (doread) {
+ inputdevice_read ();
+ if (testmode != 1) {
+ testmode = 0;
+ return -1;
+ }
}
if (testmode_count > 0) {
testmode_count--;
void setjoybuttonstate (int joy, int button, int state)
{
if (testmode) {
- inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_BUTTON, button, state);
+ inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_BUTTON, button, state, -1);
if (state < 0)
- inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_BUTTON, button, 0);
+ inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_BUTTON, button, 0, -1);
return;
}
#if 0
{
uae_u32 obuttonmask = mice2[mouse].buttonmask;
if (testmode) {
- inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_BUTTON, button, state);
+ inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_BUTTON, button, state, -1);
return;
}
setbuttonstateall (&mice[mouse], &mice2[mouse], button, state);
int i, v1, v2;
if (testmode) {
- inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_AXIS, axis, state);
+ inputdevice_testrecord (IDTYPE_JOYSTICK, joy, IDEV_WIDGET_AXIS, axis, state, max);
return;
}
v1 = state;
static double fract[MAX_INPUT_DEVICES][MAX_INPUT_DEVICE_EVENTS];
if (testmode) {
- inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_AXIS, axis, data);
+ inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_AXIS, axis, data, -1);
// fake "release" event
- inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_AXIS, axis, 0);
+ inputdevice_testrecord (IDTYPE_MOUSE, mouse, IDEV_WIDGET_AXIS, axis, 0, -1);
return;
}
if (input_play)
if (!sb)
return true;
struct isofs_sb_info *sbi = ISOFS_SB(sb);
+ ii->blocksize = 2048;
if (sys_command_ismedia (sb->unitnum, true)) {
struct device_info di;
uae_u32 totalblocks = 0;
_tcscpy (ii->devname, di.label);
}
ii->unknown_media = sb->unknown_media;
- ii->blocksize = 2048;
if (sb->root) {
_tcscpy (ii->volumename, sb->root->name);
ii->blocks = sbi->s_max_size;
* (c) 1995 Bernd Schmidt
*/
-#define DEBUG_STUPID 1
+#define DEBUG_STUPID 0
#include "sysconfig.h"
#include "sysdeps.h"
uae_s16 buttonsort[MAX_MAPPINGS];
uae_s16 buttonaxisparent[MAX_MAPPINGS];
uae_s16 buttonaxisparentdir[MAX_MAPPINGS];
+ uae_s16 buttonaxistype[MAX_MAPPINGS];
};
did->buttonsort[did->buttons] = 1000 + (did->axismappings[i] + did->axistype[i]) * 2 + j;
did->buttonaxisparent[did->buttons] = i;
did->buttonaxisparentdir[did->buttons] = j;
+ did->buttonaxistype[did->buttons] = did->axistype[i];
did->buttons++;
}
}
tmpc = did->buttonname[i]; did->buttonname[i] = did->buttonname[j]; did->buttonname[j] = tmpc;
tmpi = did->buttonaxisparent[i]; did->buttonaxisparent[i] = did->buttonaxisparent[j]; did->buttonaxisparent[j] = tmpi;
tmpi = did->buttonaxisparentdir[i]; did->buttonaxisparentdir[i] = did->buttonaxisparentdir[j]; did->buttonaxisparentdir[j] = tmpi;
+ tmpi = did->buttonaxistype[i]; did->buttonaxistype[i] = did->buttonaxistype[j]; did->buttonaxistype[j] = tmpi;
}
}
}
int ht;
for (ht = 0; hidtable[ht].name; ht++) {
if (hidtable[ht].usage == acnt && hidtable[ht].page == vcaps[i].UsagePage) {
- if (hidtable[ht].page == 0x01 && acnt == 0x39) { // POV
- if (axiscnt + 1 < MAX_MAPPINGS) {
- for (int l = 0; l < 2; l++) {
- TCHAR tmp[256];
- _stprintf (tmp, _T("%s (%c)"), hidtable[ht].name, l == 0 ? 'X' : 'Y');
- did->axisname[axiscnt] = my_strdup (tmp);
- did->axissort[axiscnt] = hidtable[ht].priority * 2 + l;
- did->axismappings[axiscnt] = acnt;
- memcpy (&did->hidvcaps[axiscnt], &vcaps[i], sizeof HIDP_VALUE_CAPS);
- did->axistype[axiscnt] = l + 1;
- axiscnt++;
+ int k;
+ for (k = 0; k < axiscnt; k++) {
+ if (did->axismappings[k] == acnt)
+ break;
+ }
+ if (k == axiscnt) {
+ if (hidtable[ht].page == 0x01 && acnt == 0x39) { // POV
+ if (axiscnt + 1 < MAX_MAPPINGS) {
+ for (int l = 0; l < 2; l++) {
+ TCHAR tmp[256];
+ _stprintf (tmp, _T("%s (%c)"), hidtable[ht].name, l == 0 ? 'X' : 'Y');
+ did->axisname[axiscnt] = my_strdup (tmp);
+ did->axissort[axiscnt] = hidtable[ht].priority * 2 + l;
+ did->axismappings[axiscnt] = acnt;
+ memcpy (&did->hidvcaps[axiscnt], &vcaps[i], sizeof HIDP_VALUE_CAPS);
+ did->axistype[axiscnt] = l + 1;
+ axiscnt++;
+ }
}
+ } else {
+ did->axissort[axiscnt] = hidtable[ht].priority * 2;
+ did->axisname[axiscnt] = my_strdup (hidtable[ht].name);
+ did->axismappings[axiscnt] = acnt;
+ memcpy (&did->hidvcaps[axiscnt], &vcaps[i], sizeof HIDP_VALUE_CAPS);
+ fixhidvcaps (&rdi->hid, &did->hidvcaps[axiscnt]);
+ did->axistype[axiscnt] = hidtable[ht].type;
+ axiscnt++;
+ did->analogstick = true;
}
- } else {
- did->axissort[axiscnt] = hidtable[ht].priority * 2;
- did->axisname[axiscnt] = my_strdup (hidtable[ht].name);
- did->axismappings[axiscnt] = acnt;
- memcpy (&did->hidvcaps[axiscnt], &vcaps[i], sizeof HIDP_VALUE_CAPS);
- fixhidvcaps (&rdi->hid, &did->hidvcaps[axiscnt]);
- did->axistype[axiscnt] = hidtable[ht].type;
- axiscnt++;
- did->analogstick = true;
+ break;
}
- break;
}
}
if (hidtable[ht].name == NULL)
int type = did->axistype[axisnum];
int logicalrange = (vcaps->LogicalMax - vcaps->LogicalMin) / 2;
uae_u32 mask = hidmask (vcaps->BitSize);
+ int buttonaxistype;
if (type == AXISTYPE_POV_X || type == AXISTYPE_POV_Y) {
if (val == min + 3 && type == AXISTYPE_POV_X)
data = -127;
}
+ logicalrange = 127;
+ digitalrange = logicalrange / 2;
+ buttonaxistype = type == AXISTYPE_POV_X ? 1 : 2;
} else {
data = 0;
//write_log (_T("%d %d: (%d-%d) %d\n"), num, axisnum, did->axismin[axisnum], did->axismax[axisnum], data);
}
+ buttonaxistype = -1;
}
if (data != axisold[num][axisnum] && logicalrange) {
- //write_log (_T("%d %d: %d->%d\n"), num, axisnum, axisold[num][axisnum], data);
+ //write_log (_T("%d %d: %d->%d %d\n"), num, axisnum, axisold[num][axisnum], data, logicalrange);
axisold[num][axisnum] = data;
int bstate = -1;
int bstate2 = 0;
for (j = 0; j < did->buttons; j++) {
- if (did->buttonaxisparent[j] >= 0 && did->buttonmappings[j] == usage) {
+ if (did->buttonaxisparent[j] >= 0 && did->buttonmappings[j] == usage && (did->buttonaxistype[j] == buttonaxistype || buttonaxistype < 0)) {
+ int axistype = did->axistype[j];
if (did->buttonaxisparentdir[j] == 0 && data < -digitalrange) {
bstate = j;
bstate2 = 1;
- } else if (did->buttonaxisparentdir[j] && data > digitalrange) {
+ } else if (did->buttonaxisparentdir[j] != 0 && data > digitalrange) {
bstate = j;
bstate2 = 1;
- } else if (data > - digitalrange && data < digitalrange) {
+ } else if (data >= -digitalrange && data <= digitalrange) {
bstate = j;
bstate2 = 0;
}
- //write_log (_T("%d %d %d\n"), num, bstate, bstate2);
+
if (bstate >= 0 && buttonold[num][bstate] != bstate2) {
+ //write_log (_T("%d %d %d (%s)\n"), num, bstate, bstate2, did->buttonname[bstate]);
buttonold[num][bstate] = bstate2;
setjoybuttonstate (num, bstate, bstate2);
}
if (scancode == DIK_F12)
scancode = -1;
if (scancode == DIK_F11) {
- inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, 0x100, 1);
- inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, 0x100, 0);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, 0x100, 1, -1);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, 0x100, 0, -1);
} else {
- inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, scancode, pressed);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, num, IDEV_WIDGET_BUTTON, scancode, pressed, -1);
}
} else {
scancode = keyhack (scancode, pressed, num);
if (scancode == DIK_F12)
scancode = -1;
if (scancode == DIK_F11) {
- inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, 0x100, 1);
- inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, 0x100, 0);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, 0x100, 1, -1);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, 0x100, 0, -1);
} else {
- inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, scancode, pressed);
+ inputdevice_testrecord (IDTYPE_KEYBOARD, i, IDEV_WIDGET_BUTTON, scancode, pressed, -1);
}
} else {
if (stopoutput == 0)
put_long (p2 + 14, base + CARD_IRQFLAG);
put_long (p2 + 18, c);
- put_word (c, 0x4a11); c += 2; // tst.b (a1)
+ put_word (c, 0x4a11); c += 2; // tst.b (a1) CARD_IRQFLAG
put_word (c, 0x670e); c += 2; // beq.s label
put_word (c, 0x4211); c += 2; // clr.b (a1)
- put_long (c, 0x22690004); c += 4; // move.l 4(a1),a1
- put_long (c, 0x2c780004); c += 4; // move.l 4.w,a6
+ put_long (c, 0x2c690008); c += 4; // move.l 8(a1),a6 CARD_IRQEXECBASE
+ put_long (c, 0x22690004); c += 4; // move.l 4(a1),a1 CARD_IRQPTR
put_long (c, 0x4eaeff4c); c += 4; // jsr Cause(a6)
put_word (c, 0x7000); c += 2; // label: moveq #0,d0
put_word (c, RTS); // rts
RTGCALLDEFAULT(PSSO_BoardInfo_UpdatePlanar, PSSO_BoardInfo_UpdatePlanarDefault);
RTGCALLDEFAULT(PSSO_BoardInfo_DrawLine, PSSO_BoardInfo_DrawLineDefault);
- RTGCALL2(PSSO_BoardInfo_SetInterrupt, picasso_SetInterrupt);
+ if (currprefs.rtg_hardwareinterrupt)
+ RTGCALL2(PSSO_BoardInfo_SetInterrupt, picasso_SetInterrupt);
write_log (_T("uaegfx.card magic code: %08X-%08X ABI=%08X\n"), start, here (), ABI);
m68k_dreg (regs, 0) = 0;
put_long (uaegfx_base + CARD_EXPANSIONBASE, CallLib (ctx, exec, -0x228)); /* OpenLibrary */
put_long (uaegfx_base + CARD_EXECBASE, exec);
+ put_long (uaegfx_base + CARD_IRQEXECBASE, exec);
put_long (uaegfx_base + CARD_NAME, uaegfx_resname);
put_long (uaegfx_base + CARD_RESLIST, uaegfx_base + CARD_SIZEOF);
put_long (uaegfx_base + CARD_RESLISTSIZE, extrasize);
#define CARD_PORTSIRQ (CARD_VBLANKIRQ + 22)
#define CARD_IRQFLAG (CARD_PORTSIRQ + 22)
#define CARD_IRQPTR (CARD_IRQFLAG + 4)
-#define CARD_IRQCODE (CARD_IRQPTR + 4)
+#define CARD_IRQEXECBASE (CARD_IRQPTR + 4)
+#define CARD_IRQCODE (CARD_IRQEXECBASE + 4)
#define CARD_END (CARD_IRQCODE + 11 * 2)
#define CARD_SIZEOF CARD_END
showcursor = 0;
}
+void updatemouseclip (void)
+{
+ if (showcursor) {
+ ClipCursor (&amigawin_rect);
+ //write_log (_T("CLIP %dx%d %dx%d\n"), amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom);
+ }
+}
+
static void setmouseactive2 (int active, bool allowpause)
{
//write_log (_T("setmouseactive %d->%d\n"), mouseactive, active);
if (!showcursor) {
ShowCursor (FALSE);
SetCapture (hAmigaWnd);
- ClipCursor (&amigawin_rect);
+ updatemouseclip ();
}
showcursor = 1;
setcursor (-30000, -30000);
changed_prefs.gfx_size_win.y = amigawin_rect.top;
config_changed = 1;
}
+ updatemouseclip ();
}
notice_screen_contents_lost ();
}
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("23")
-#define WINUAEDATE MAKEBD(2012, 10, 31)
+#define WINUAEBETA _T("24")
+#define WINUAEDATE MAKEBD(2012, 11, 5)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern void setmouseactive (int active);
extern void minimizewindow (void);
extern uae_u32 OSDEP_minimize_uae (void);
+extern void updatemouseclip (void);
extern void resumepaused (int priority);
extern void setpaused (int priority);
setpriority (&priorities[currprefs.win32_active_capture_priority]);
for (i = 0; i < NUM_LEDS; i++)
gui_led (i, -1);
+ gui_led (LED_POWER, gui_data.powerled);
gui_fps (0, 0, 0);
inputdevice_acquire (TRUE);
} else if (startminimized) {
GetWindowRect (hMainWnd, &mainwin_rect);
if (d3dfs || dxfs)
SetCursorPos (x + w / 2, y + h / 2);
- write_log (_T("window already open\n"));
+ write_log (_T("window already open (%dx%d %dx%d)\n"),
+ amigawin_rect.left, amigawin_rect.top, amigawin_rect.right - amigawin_rect.left, amigawin_rect.bottom - amigawin_rect.top);
+ updatemouseclip ();
#ifdef RETROPLATFORM
rp_set_hwnd (hAmigaWnd);
#endif
}
static int inputmap_port = -1, inputmap_port_remap = -1;
-static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, int *inputmap_portp, int *inputmap_indexp, int state)
+static int inputmap_groupindex[32];
+static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, int *inputmap_portp, int *inputmap_indexp, int state, int *inputmap_itemindexp)
{
int cntitem, cntgroup, portnum;
int mode, *events, *axistable;
lvstruct.lParam = 0;
lvstruct.iSubItem = 0;
lvstruct.iGroupId = cntgroup;
+ if (inputmap_itemindexp)
+ inputmap_itemindexp[cntgroup] = -1;
}
atpidx = 0;
lvstruct.pszText = target;
lvstruct.iItem = cntgroup * 256 + cntitem;
item = ListView_InsertItem (list, &lvstruct);
+ if (inputmap_itemindexp && inputmap_itemindexp[cntgroup - 1] < 0)
+ inputmap_itemindexp[cntgroup - 1] = item;
} else if (currentdevnum == devnum) {
if (currentwidgetnum == j) {
*inputmap_portp = portnum;
lvstruct.pszText = _T("");
lvstruct.iItem = cntgroup * 256 + cntitem;
item = ListView_InsertItem (list, &lvstruct);
+ if (inputmap_itemindexp && inputmap_itemindexp[cntgroup - 1] < 0)
+ inputmap_itemindexp[cntgroup - 1] = item;
}
cntitem++;
}
ListView_EnableGroupView (list, TRUE);
- inputmap_handle (list, -1, -1, NULL, NULL, 0);
+ inputmap_handle (list, -1, -1, NULL, NULL, 0, inputmap_groupindex);
}
static int clicked_entry = -1;
}
if (!cnt)
return;
- int ret = inputdevice_testread (&devnum, &wtype, &state);
+ int ret = inputdevice_testread (&devnum, &wtype, &state, true);
if (ret > 0) {
if (wtype < 0) {
if (!state)
// F11
if (inputmap == 1) {
int mode, *events, *axistable;
- inputmap_remap_counter++;
- ListView_EnsureVisible (h, inputmap_remap_counter, FALSE);
- ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
- ListView_SetItemState (h, inputmap_remap_counter, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, &events, &axistable);
+ inputmap_remap_counter++;
if (inputmap_remap_counter >= max)
- inputmap_remap_counter = -1;
+ inputmap_remap_counter = 0;
+ inputmap_index = inputmap_groupindex[inputmap_remap_counter];
+ ListView_EnsureVisible (h, inputmap_index, FALSE);
+ ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_SetItemState (h, inputmap_index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
} else if (inputmap == 2) {
int itemcnt = ListView_GetItemCount (h);
if (inputmap_view_offset >= itemcnt - 1 || inputmap_view_offset < 0) {
if (inputmap == 1) { // ports panel / remap
static int skipbuttonaxis;
+ static int prevtype2, prevtype, prevwidget, prevevtnum, prevaxisevent, prevaxisstate;
+ int widgets[10], widgetstate[10];
+ int wcnt, found, axisevent, axisstate;
HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
int mode, *events, *axistable, *axistable2;
- int cntadd = 1;
int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, &events, &axistable);
int evtnum = events[inputmap_remap_counter];
int type2 = intputdevice_compa_get_eventtype (evtnum, &axistable2);
- if (type == IDEV_WIDGET_BUTTONAXIS) {
- if (skipbuttonaxis) {
- skipbuttonaxis = false;
- return;
+ if (inputmap_remap_counter == 0) {
+ prevtype = prevtype2 = prevwidget = prevevtnum = prevaxisevent = -1;
+ }
+
+ axisevent = -1;
+ axisstate = 0;
+ wcnt = 0;
+ widgets[wcnt] = input_selected_widget;
+ widgetstate[wcnt] = state;
+ wcnt++;
+ for (;;) {
+ ret = inputdevice_testread (&devnum, &wtype, &state, false);
+ if (ret <= 0)
+ break;
+ if (devnum != input_selected_device)
+ continue;
+ if (wcnt < 10) {
+ widgets[wcnt] = wtype;
+ widgetstate[wcnt] = state;
+ wcnt++;
}
- if (type2 != IDEV_WIDGET_BUTTON && type2 != IDEV_WIDGET_KEY)
- return;
- } else if (type == IDEV_WIDGET_AXIS) {
- skipbuttonaxis = false;
- if (type2 == IDEV_WIDGET_BUTTON || type2 == IDEV_WIDGET_KEY)
- return;
- if (type2 == IDEV_WIDGET_BUTTONAXIS) {
- if (inputmap_remap_counter & 1)
- return;
- // use VERT or HORIZ events, not UP/DOWN/LEFT/RIGHT
- evtnum = axistable2[0];
- cntadd = 2;
- skipbuttonaxis = true;
+ }
+
+ found = 0;
+ for (int i = 0; i < wcnt; i++) {
+ input_selected_widget = widgets[i];
+ type = inputdevice_get_widget_type (input_selected_device, input_selected_widget, NULL);
+ if (type == IDEV_WIDGET_BUTTONAXIS) {
+ found = 1;
+ break;
+ }
+ }
+ for (int i = 0; i < wcnt; i++) {
+ int typex = inputdevice_get_widget_type (input_selected_device, widgets[i], NULL);
+ if (typex == IDEV_WIDGET_AXIS) {
+ if (!found) {
+ found = 1;
+ input_selected_widget = widgets[i];
+ } else if (found && type == IDEV_WIDGET_BUTTONAXIS) {
+ axisevent = widgets[i];
+ axisstate = widgetstate[i];
+ }
+ break;
+ }
+ }
+ if (!found) {
+ for (int i = 0; i < wcnt; i++) {
+ input_selected_widget = widgets[i];
+ type = inputdevice_get_widget_type (input_selected_device, input_selected_widget, NULL);
+ if (type == IDEV_WIDGET_BUTTON || type == IDEV_WIDGET_KEY) {
+ found = 1;
+ break;
+ }
+ }
+ }
+ if (!found)
+ return;
+
+ // if (inputmap_remap_counter > 4)
+ // write_log (_T("*"));
+
+ //write_log (_T("%d %d %d %d %d\n"), input_selected_device, input_selected_widget, type, evtnum, type2);
+
+ // if this and previous are same axis and they match (up/down or left/right)
+ if ((inputmap_remap_counter & 1) == 1) {
+ if (type2 == IDEV_WIDGET_BUTTONAXIS && prevtype2 == IDEV_WIDGET_BUTTONAXIS) {
+ if (type == IDEV_WIDGET_BUTTONAXIS && prevtype == IDEV_WIDGET_BUTTONAXIS) {
+ if (axisevent == prevaxisevent && (axisstate > 0 && prevaxisstate < 0)) {
+ for (int i = 0; i < wcnt; i++) {
+ wtype = widgets[i];
+ if (inputdevice_get_widget_type (input_selected_device, wtype, NULL) == IDEV_WIDGET_AXIS) {
+ inputdevice_set_gameports_mapping (&workprefs, input_selected_device, prevwidget, -1, 0, inputmap_port);
+ inputdevice_set_gameports_mapping (&workprefs, input_selected_device, wtype, axistable2[0], 0, inputmap_port);
+ evtnum = -1;
+ break;
+ }
+ }
+ }
+ }
}
}
- //write_log (_T("%d %d %d %s\n"), input_selected_device, input_selected_widget, evtnum, name);
- inputdevice_set_gameports_mapping (&workprefs, input_selected_device, input_selected_widget, evtnum, 0, inputmap_port);
+// write_log (_T("%d %d %d\n"), input_selected_device, input_selected_widget, evtnum);
+ if (evtnum >= 0)
+ inputdevice_set_gameports_mapping (&workprefs, input_selected_device, input_selected_widget, evtnum, 0, inputmap_port);
InitializeListView (hDlg);
- inputmap_remap_counter += cntadd;
- ListView_EnsureVisible (h, inputmap_remap_counter, FALSE);
- ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
- ListView_SetItemState (h, inputmap_remap_counter, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
+ inputmap_remap_counter++;
if (inputmap_remap_counter >= max)
- inputmap_remap_counter = -1;
+ inputmap_remap_counter = 0;
+
+ inputmap_index = inputmap_groupindex[inputmap_remap_counter];
+ ListView_EnsureVisible (h, inputmap_index, FALSE);
+ ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_SetItemState (h, inputmap_index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
TCHAR tmp[256];
tmp[0] = 0;
inputdevice_get_widget_type (input_selected_device, input_selected_widget, tmp);
_tcscat (tmp, _T(", "));
_tcscat (tmp, inputdevice_get_device_name2 (input_selected_device));
SetWindowText (GetDlgItem (hDlg, IDC_INPUTMAPOUT), tmp);
+
+ prevtype = type;
+ prevtype2 = type2;
+ prevwidget = input_selected_widget;
+ prevevtnum = evtnum;
+ prevaxisevent = axisevent;
+ prevaxisstate = axisstate;
} else if (inputmap == 2) { // ports panel / test
bool found = false;
HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
int op = inputmap_port;
- if (inputmap_handle (NULL, input_selected_device, input_selected_widget, &op, &inputmap_index, state)) {
+ if (inputmap_handle (NULL, input_selected_device, input_selected_widget, &op, &inputmap_index, state, NULL)) {
if (op == inputmap_port) {
ListView_EnsureVisible (h, 1, FALSE);
ListView_EnsureVisible (h, inputmap_index, FALSE);
- restore only single input target to default.
+Beta 24:
+
+- CDFS: ACTION_DISK_INFO no disk status really works now.
+- Fixed "Windows mouse" sometimes hitting invisible barriers in windowed mode if window size changed and mouse was captured. (Quite old bug)
+- blitter_cycle_exact=true and cpu_cycle_exact=false confused blitter emulation if BLTSIZE was written twice while DMA was disabled.
+- CAS and CAS2 instruction fixes from Aranym (I guess these are practically never used on Amiga..)
+- Ignore duplicate USB HID axis IDs. (I was lazy and only added duplicate button check previously..)
+- USB HID D-Pad/POV axis may have caused ghost events.
+- GamePorts panel Remap separated axis configuration support (for example up can be mapped to button and down can be normal down axis),
+ and multiple input sources can be mapped to single input target. Selection cursor now wraps around to allow multiconfiguration.
+
Beta 23:
- CDFS: Joliet CDs didn't work and caused crashes. Directory listing worked but it was only possible to open non-existing files :)