mirror of https://github.com/mgba-emu/mgba.git
Vita: L2/R2 and L3/R3 can now be mapped on PSTV (fixes #1292)
This commit is contained in:
parent
9b9aeb0c2b
commit
7b12516df4
1
CHANGES
1
CHANGES
|
@ -51,6 +51,7 @@ Misc:
|
|||
- Qt: Improve sync code
|
||||
- Switch: Dynamic display resizing
|
||||
- Qt: Make mute menu option also toggle fast-forward mute (fixes mgba.io/i/1424)
|
||||
- Vita: L2/R2 and L3/R3 can now be mapped on PSTV (fixes mgba.io/i/1292)
|
||||
|
||||
0.7.2: (2019-05-25)
|
||||
Emulation fixes:
|
||||
|
|
|
@ -41,7 +41,7 @@ static void _drawEnd(void) {
|
|||
|
||||
static uint32_t _pollInput(const struct mInputMap* map) {
|
||||
SceCtrlData pad;
|
||||
sceCtrlPeekBufferPositive(0, &pad, 1);
|
||||
sceCtrlPeekBufferPositiveExt2(0, &pad, 1);
|
||||
int input = mInputMapKeyBits(map, PSP2_INPUT, pad.buttons, 0);
|
||||
|
||||
if (pad.buttons & SCE_CTRL_UP || pad.ly < 64) {
|
||||
|
@ -127,17 +127,17 @@ int main() {
|
|||
.id = PSP2_INPUT,
|
||||
.keyNames = (const char*[]) {
|
||||
"Select",
|
||||
0,
|
||||
0,
|
||||
"L3",
|
||||
"R3",
|
||||
"Start",
|
||||
"Up",
|
||||
"Right",
|
||||
"Down",
|
||||
"Left",
|
||||
"L",
|
||||
"R",
|
||||
0, // L2?
|
||||
0, // R2?
|
||||
"L2",
|
||||
"R2",
|
||||
"L1",
|
||||
"R1",
|
||||
"\1\xC",
|
||||
"\1\xA",
|
||||
"\1\xB",
|
||||
|
|
|
@ -267,7 +267,7 @@ static void _postAudioBuffer(struct mAVStream* stream, blip_t* left, blip_t* rig
|
|||
|
||||
uint16_t mPSP2PollInput(struct mGUIRunner* runner) {
|
||||
SceCtrlData pad;
|
||||
sceCtrlPeekBufferPositive(0, &pad, 1);
|
||||
sceCtrlPeekBufferPositiveExt2(0, &pad, 1);
|
||||
|
||||
int activeKeys = mInputMapKeyBits(&runner->core->inputMap, PSP2_INPUT, pad.buttons, 0);
|
||||
int angles = mInputMapAxis(&runner->core->inputMap, PSP2_INPUT, 0, pad.ly);
|
||||
|
@ -313,8 +313,8 @@ void mPSP2Setup(struct mGUIRunner* runner) {
|
|||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_DOWN, GBA_KEY_DOWN);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_LEFT, GBA_KEY_LEFT);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_RIGHT, GBA_KEY_RIGHT);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_LTRIGGER, GBA_KEY_L);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_RTRIGGER, GBA_KEY_R);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_L1, GBA_KEY_L);
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_R1, GBA_KEY_R);
|
||||
|
||||
struct mInputAxis desc = { GBA_KEY_DOWN, GBA_KEY_UP, 192, 64 };
|
||||
mInputBindAxis(&runner->core->inputMap, PSP2_INPUT, 0, &desc);
|
||||
|
@ -398,6 +398,18 @@ void mPSP2LoadROM(struct mGUIRunner* runner) {
|
|||
interframeBlending = fakeBool;
|
||||
}
|
||||
|
||||
// Backcompat: Old versions of mGBA use an older binding system that has different mappings for L/R
|
||||
if (!sceKernelIsPSVitaTV()) {
|
||||
int key = mInputMapKey(&runner->core->inputMap, PSP2_INPUT, __builtin_ctz(SCE_CTRL_L2));
|
||||
if (key >= 0) {
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_L1, key);
|
||||
}
|
||||
key = mInputMapKey(&runner->core->inputMap, PSP2_INPUT, __builtin_ctz(SCE_CTRL_R2));
|
||||
if (key >= 0) {
|
||||
mPSP2MapKey(&runner->core->inputMap, SCE_CTRL_R1, key);
|
||||
}
|
||||
}
|
||||
|
||||
MutexInit(&audioContext.mutex);
|
||||
ConditionInit(&audioContext.cond);
|
||||
memset(audioContext.buffer, 0, sizeof(audioContext.buffer));
|
||||
|
|
Loading…
Reference in New Issue