Skip to content

Commit

Permalink
bugfix: fixed crash on startup on x86_64 platform
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Nov 1, 2023
1 parent e0ed44d commit 9e69a80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/osdep/amiberry_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void fixbuttons(struct didata* did)
write_log(_T("'%s' has no buttons, adding single default button\n"), did->name.c_str());
did->buttonmappings[0] = 0;
did->buttonsort[0] = 0;
did->buttonname[0] ="Button";
did->buttonname[0] = "Button";
did->buttons++;
}

Expand Down
24 changes: 14 additions & 10 deletions src/osdep/amiberry_input.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#pragma once
#include "options.h"

#ifdef AMIBERRY
#define MAX_MAPPINGS 128
#else
#define MAX_MAPPINGS 256
#endif

#define AXISTYPE_NORMAL 0
#define AXISTYPE_POV_X 1
Expand Down Expand Up @@ -49,18 +53,18 @@ struct didata {
uae_s16 axles{};
uae_s16 buttons{}, buttons_real{};

uae_s16 axismappings[MAX_MAPPINGS]{};
std::string axisname[MAX_MAPPINGS]{};
uae_s16 axissort[MAX_MAPPINGS]{};
uae_s16 axistype[MAX_MAPPINGS]{};
std::array<uae_s16, MAX_MAPPINGS> axismappings;
std::array<std::string, MAX_MAPPINGS> axisname;
std::array<uae_s16, MAX_MAPPINGS> axissort;
std::array<uae_s16, MAX_MAPPINGS> axistype;
bool analogstick{};

uae_s16 buttonmappings[MAX_MAPPINGS]{};
std::string buttonname[MAX_MAPPINGS]{};
uae_s16 buttonsort[MAX_MAPPINGS]{};
uae_s16 buttonaxisparent[MAX_MAPPINGS]{};
uae_s16 buttonaxisparentdir[MAX_MAPPINGS]{};
uae_s16 buttonaxistype[MAX_MAPPINGS]{};
std::array<uae_s16, MAX_MAPPINGS> buttonmappings;
std::array<std::string, MAX_MAPPINGS> buttonname;
std::array<uae_s16, MAX_MAPPINGS> buttonsort;
std::array<uae_s16, MAX_MAPPINGS> buttonaxisparent;
std::array<uae_s16, MAX_MAPPINGS> buttonaxisparentdir;
std::array<uae_s16, MAX_MAPPINGS> buttonaxistype;
};

//Analog joystick dead zone
Expand Down

0 comments on commit 9e69a80

Please sign in to comment.