3ds-SDL: multiple fixes#57
Conversation
| SDL_PrivateJoystickButton (joystick, 7, SDL_PRESSED); | ||
| } | ||
| if ((key_press & KEY_START)) { | ||
| SDL_PrivateJoystickButton (joystick, 8, SDL_PRESSED); |
There was a problem hiding this comment.
This is why the Start button didn't work… I'm surprised nobody noticed it until now 😂
| pos= 1<<i; | ||
| if(hidkey&pos) keymap[i]=key; | ||
| } | ||
| // Do nothing |
There was a problem hiding this comment.
This function can't be removed, SDL relies on it.
| } | ||
| } | ||
|
|
||
| if (hidKeysHeld() & KEY_TOUCH) { |
There was a problem hiding this comment.
Not super happy about it, but I guess it doesn't hurt, so I left the touchscreen mapping to the mouse API. Proper support for touchscreens was added to SDL2, so I guess this is better than nothing.
| keymap[0]=SDLK_a; //KEY_A | ||
| keymap[1]=SDLK_b; // KEY_B | ||
| keymap[2]=SDLK_ESCAPE; //KEY_SELECT | ||
| keymap[3]=SDLK_RETURN; //KEY_START |
There was a problem hiding this comment.
Random button-to-key mapping like this makes no sense in a SDL port IMO.
There was a problem hiding this comment.
Good call. This belongs in the port using SDL, not SDL itself.
There was a problem hiding this comment.
Yep, I also had to work around this in OpenJazz.
There was a problem hiding this comment.
Thanks for reporting that so we could do something about it @carstene1ns. Much appreciated.
There was a problem hiding this comment.
Well, I found no sane way to have this backward compatible. This breaks quite a lot homebrew this way unfortunately.
Right now you will get an undefined reference, because include/SDL_keyboard.h was not updated to remove the function.
There was a problem hiding this comment.
But I didn't remove the implementation either, because otherwise it crashes in runtime. I left the implementation empty: https://github.com/devkitPro/SDL/pull/57/files#r432952006
Is that what you were referring to?
There was a problem hiding this comment.
😱 You're right, that bit didn't make it into this PR, not sure how it went missing. I'm AFK right now but I will fix it ASAP
There was a problem hiding this comment.
Oh I didn't miss it when I cherry picked the changes, I never deleted it. However, it doesn't fail with undefined reference because it's never used. Anyway, I'll clean it up in a PR in a few hours, sorry about that!
|
Nice job. Was worth keeping the individual commits as well so I rebased rather than the usual squash. |
| palette[i] = N3DS_MAP_RGB(colors[i].r, colors[i].g, colors[i].b); | ||
| { | ||
| int colorIndex = i - firstcolor; | ||
| palette[i] = N3DS_MAP_RGB(colors[colorIndex].r, colors[colorIndex].g, colors[colorIndex].b); |
This PR fixes a bunch of bugs that I found while porting https://github.com/sergiou87/open-supaplex to 3DS:
SetColorsfunction for 3DS, which assumed the inputcolorsarray was a 256 colors array, but it's not. That parameter hasncolorsinside.