Skip to content

Commit

Permalink
huge patch for joystick buttons and memory gap for SKSE
Browse files Browse the repository at this point in the history
  • Loading branch information
Patola committed Jun 22, 2020
1 parent 2409bd1 commit ab8d19c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dlls/joy.cpl/joy.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct Joystick {
struct Effect *effects;
};

#define TEST_MAX_BUTTONS 32
#define TEST_MAX_AXES 4
#define TEST_MAX_BUTTONS 64
#define TEST_MAX_AXES 8

struct Graphics {
HWND hwnd;
Expand Down
10 changes: 10 additions & 0 deletions dlls/joy.cpl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,16 @@ static DWORD WINAPI input_thread(void *param)
axes_pos[1][1] = state.lRy;
axes_pos[2][0] = state.lZ;
axes_pos[2][1] = state.lRz;
axes_pos[3][0] = 0;
axes_pos[3][1] = 0;
axes_pos[4][0] = 0;
axes_pos[4][1] = 0;
axes_pos[5][0] = 0;
axes_pos[5][1] = 0;
axes_pos[6][0] = 0;
axes_pos[6][1] = 0;
axes_pos[7][0] = 0;
axes_pos[7][1] = 0;

/* Set pov values */
for (j = 0; j < ARRAY_SIZE(pov_val); j++)
Expand Down
4 changes: 2 additions & 2 deletions dlls/ntdll/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,11 +1759,11 @@ static NTSTATUS map_image( HANDLE hmapping, ACCESS_MASK access, int fd, int top_
server_enter_uninterrupted_section( &csVirtual, &sigset );

if (base >= (char *)address_space_start) /* make sure the DOS area remains free */
status = map_view( &view, base, total_size, 0, top_down, SEC_IMAGE | SEC_FILE |
status = map_view( &view, base, total_size, 0, TRUE, SEC_IMAGE | SEC_FILE |
VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits_64 );

if (status != STATUS_SUCCESS)
status = map_view( &view, NULL, total_size, 0, top_down, SEC_IMAGE | SEC_FILE |
status = map_view( &view, NULL, total_size, 0, TRUE, SEC_IMAGE | SEC_FILE |
VPROT_COMMITTED | VPROT_READ | VPROT_EXEC | VPROT_WRITECOPY, zero_bits_64 );

if (status != STATUS_SUCCESS) goto error;
Expand Down
10 changes: 5 additions & 5 deletions dlls/winebus.sys/bus_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ static BOOL build_report_descriptor(struct platform_private *ext)
report_size = 0;

axis_count = pSDL_JoystickNumAxes(ext->sdl_joystick);
if (axis_count > 6)
if (axis_count > 16)
{
FIXME("Clamping joystick to 6 axis\n");
axis_count = 6;
FIXME("Clamping joystick to 16 axis\n");
axis_count = 16;
}

ext->axis_start = report_size;
Expand All @@ -470,9 +470,9 @@ static BOOL build_report_descriptor(struct platform_private *ext)
ext->ball_start = report_size;
if (ball_count)
{
if ((ball_count*2) + axis_count > 9)
if ((ball_count*2) + axis_count > 19)
{
FIXME("Capping ball + axis at 9\n");
FIXME("Capping ball + axis at 19\n");
ball_count = (9-axis_count)/2;

This comment has been minimized.

Copy link
@ananace

ananace Jul 20, 2020

I think this should be a 19 too?

This comment has been minimized.

Copy link
@Patola

Patola Jul 20, 2020

Author Owner

damn. Yes, it should. I'll try and rebuild with that. Sorry.

This comment has been minimized.

}
descript_size += sizeof(REPORT_AXIS_HEADER);
Expand Down
5 changes: 3 additions & 2 deletions dlls/winejoystick.drv/joystick_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize)
lpCaps->wUmax = 0xFFFF;
lpCaps->wVmin = 0;
lpCaps->wVmax = 0xFFFF;
lpCaps->wMaxAxes = 6; /* same as MS Joystick Driver */
lpCaps->wMaxAxes = 16; /* same as MS Joystick Driver */
lpCaps->wNumAxes = 0; /* nr of axes in use */
lpCaps->wMaxButtons = 32; /* same as MS Joystick Driver */
lpCaps->wMaxButtons = 64; /* same as MS Joystick Driver */
lpCaps->szRegKey[0] = 0;
lpCaps->szOEMVxD[0] = 0;
lpCaps->wCaps = 0;
Expand Down Expand Up @@ -326,6 +326,7 @@ LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo)
switch (jstck->axesMap[ev.number]) {
case 0: /* X */
case 8: /* Wheel */
case 40: /* Mouse-like */
jstck->x = ev.value;
break;
case 1: /* Y */
Expand Down

0 comments on commit ab8d19c

Please sign in to comment.