Fix joystick fire ghost keys and independent axis arming
Filter keyboard rows grounded by joystick buttons before processing actions, preventing right fire from acting as A/D/E and undoing its release rotation. Arm X and Y independently so an uncentered vertical axis cannot block steering. Reproduce both defects in host regressions, retain ordinary CMOC input APIs, and update official project membership. Compact unchanged display data and make render profiling optional to preserve the original memory and stack bounds. Deliver QUADPSL02.DSK with fresh scores. Retire the old artifact from tracking while leaving the loaded local disk untouched. Host suites, official Release build and MC6809/512 KB keyboard/audio smoke checks pass. Actual joystick-port confirmation and the reported normal-window buzz remain pending.
This commit is contained in:
1 parent
356a7fc895
commit
2e163049d1
28 files changed
+382
-81
No files matched your search
@@ -4,6 +4,7 @@
|
||||
#include <Player.h>
|
||||
#include "rules.h"
|
||||
#include "input.h"
|
||||
#include "keyboard.h"
|
||||
#include "preferences.h"
|
||||
#include "video.h"
|
||||
#include "disk_store.h"
|
||||
@@ -53,28 +54,6 @@ static void new_game(void)
|
||||
q_start(&game,&options);active=1;score_eligible=1;enter(PLAY);
|
||||
}
|
||||
|
||||
typedef struct { Q8 probe,bit;Q16 action; } KeyBinding;
|
||||
#define BIND(name,action) {KEY_PROBE_##name,KEY_BIT_##name,action}
|
||||
static const KeyBinding keys[]={
|
||||
BIND(LEFT,Q_LEFT),BIND(RIGHT,Q_RIGHT),BIND(UP,Q_UP),BIND(DOWN,Q_DOWN),
|
||||
BIND(ENTER,Q_CONFIRM),BIND(BREAK,Q_BACK),
|
||||
BIND(A,Q_LEFT),BIND(D,Q_RIGHT),BIND(W,Q_UP),BIND(S,Q_DOWN),
|
||||
BIND(Q,Q_CCW),BIND(E,Q_CW),BIND(SPACE,Q_CONFIRM),BIND(H,Q_HOLD),BIND(P,Q_PAUSE)
|
||||
};
|
||||
static Q16 keyboard(void)
|
||||
{
|
||||
Q16 held=0,action;Q8 i,count=scene==INITIALS?6:sizeof(keys)/sizeof(keys[0]);
|
||||
for(i=0;i<count;++i)if(isKeyPressed(keys[i].probe,keys[i].bit)){
|
||||
action=keys[i].action;
|
||||
if(scene==PLAY){
|
||||
if(action==Q_UP)action=preferences.clockwise?Q_CW:Q_CCW;
|
||||
if(i==12)action=Q_HARD;
|
||||
}
|
||||
held|=action;
|
||||
}
|
||||
return held;
|
||||
}
|
||||
|
||||
static QActions sample(Q16 ms)
|
||||
{
|
||||
const byte *axes;
|
||||
@@ -84,7 +63,7 @@ static QActions sample(Q16 ms)
|
||||
joystick_buttons=readJoystickButtons();
|
||||
Player_disableSound(); /* Reassert idle silence after the shared analog-input APIs. */
|
||||
if(port<2)button=!(joystick_buttons&(port==1?JOYSTK_BUTTON_1_LEFT:JOYSTK_BUTTON_1_RIGHT));
|
||||
return q_input_step(&input,keyboard(),button,joystick_axes[index],joystick_axes[index+1],
|
||||
return q_input_step(&input,keyboard_read(joystick_buttons,scene==PLAY?(Q8)(KEYBOARD_PLAY|(preferences.clockwise<<1)):scene==INITIALS?(Q8)KEYBOARD_INITIALS:(Q8)0),button,joystick_axes[index],joystick_axes[index+1],
|
||||
preferences.centers[index],preferences.centers[index+1],port<2,ms,scene==PLAY,preferences.clockwise);
|
||||
}
|
||||
|
||||
@@ -153,50 +132,52 @@ static void settings_picture(void)
|
||||
video_text(1,22,ui_label(74));
|
||||
}
|
||||
|
||||
static const Q8 captions[][4]={
|
||||
{0,5,20,1},
|
||||
{0,6,22,2},
|
||||
{2,1,20,3},
|
||||
{4,1,1,4},
|
||||
{4,1,3,5},
|
||||
{4,1,5,6},
|
||||
{4,1,7,7},
|
||||
{4,1,10,8},
|
||||
{4,1,12,9},
|
||||
{4,1,14,10},
|
||||
{4,1,16,11},
|
||||
{4,1,18,12},
|
||||
{4,1,19,13},
|
||||
{4,1,20,14},
|
||||
{6,1,1,15},
|
||||
{6,1,3,16},
|
||||
{6,1,5,17},
|
||||
{6,1,6,18},
|
||||
{6,1,7,19},
|
||||
{6,1,9,20},
|
||||
{6,1,11,21},
|
||||
{6,1,12,22},
|
||||
{6,1,14,23},
|
||||
{6,1,16,24},
|
||||
{9,1,2,25},
|
||||
{9,1,5,26},
|
||||
{9,1,7,94},
|
||||
{10,1,2,27},
|
||||
{10,1,14,28},
|
||||
{10,1,16,29},
|
||||
{5,1,0,30},
|
||||
{5,1,4,31},
|
||||
{5,1,18,32},
|
||||
{5,1,20,33},
|
||||
{11,2,1,34},
|
||||
{11,1,19,35},
|
||||
{11,1,21,36},
|
||||
/* Caption columns fit three bits; keep scene and column in one byte. */
|
||||
static const Q8 captions[][3]={
|
||||
{5,20,1},
|
||||
{6,22,2},
|
||||
{17,20,3},
|
||||
{33,1,4},
|
||||
{33,3,5},
|
||||
{33,5,6},
|
||||
{33,7,7},
|
||||
{33,10,8},
|
||||
{33,12,9},
|
||||
{33,14,10},
|
||||
{33,16,11},
|
||||
{33,18,12},
|
||||
{33,19,13},
|
||||
{33,20,14},
|
||||
{49,1,15},
|
||||
{49,3,16},
|
||||
{49,5,17},
|
||||
{49,6,18},
|
||||
{49,7,19},
|
||||
{49,9,20},
|
||||
{49,11,21},
|
||||
{49,12,22},
|
||||
{49,14,23},
|
||||
{49,16,24},
|
||||
{73,2,25},
|
||||
{73,5,26},
|
||||
{73,7,94},
|
||||
{81,2,27},
|
||||
{81,14,28},
|
||||
{81,16,29},
|
||||
{41,0,30},
|
||||
{41,4,31},
|
||||
{41,18,32},
|
||||
{41,20,33},
|
||||
{90,1,34},
|
||||
{89,19,35},
|
||||
{89,21,36},
|
||||
|
||||
};
|
||||
|
||||
static void fixed_captions(void)
|
||||
{
|
||||
Q8 i;for(i=0;i<sizeof(captions)/sizeof(captions[0]);++i)
|
||||
if(captions[i][0]==scene)video_text(captions[i][1],captions[i][2],ui_label(captions[i][3]));
|
||||
if((captions[i][0]>>3)==scene)video_text(captions[i][0]&7,captions[i][1],ui_label(captions[i][2]));
|
||||
}
|
||||
|
||||
static void picture(void)
|
||||
|
||||
Reference in new issue
Block a user