]> Shamusworld >> Repos - virtualjaguar/commitdiff
Quick fix to make controller #1 work properly again. Controller #2 is disabled.
authorShamus Hammons <jlhamm@acm.org>
Mon, 8 Aug 2011 23:11:41 +0000 (23:11 +0000)
committerShamus Hammons <jlhamm@acm.org>
Mon, 8 Aug 2011 23:11:41 +0000 (23:11 +0000)
src/gui/help.cpp
src/gui/mainwin.cpp
src/joystick.cpp

index cb4f2ebc0901fe8592a0ae7b22f8153929acab7a..8bafe985bfccf48dcd60b5134b831f59729aec93 100644 (file)
@@ -25,7 +25,7 @@ HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
        resize(560, 480);
 
        layout = new QVBoxLayout();
-       layout->setSizeConstraint(QLayout::SetFixedSize);
+//     layout->setSizeConstraint(QLayout::SetFixedSize);
        setLayout(layout);
 
 //     image = new QLabel();
@@ -37,7 +37,7 @@ HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
        QString s;// = QString("");
        s.append(tr(
                "<h1>Virtual Jaguar Documentation</h1>"
-               "<br><br>"
+               "<br>"
                "<b><i>Coming soon!</i></b>"
        ));
        text = new QTextBrowser;
index 48411906dec629ebe3ede9591305b07a8a4c41f5..41c1a0ea70fa26116b29fb170c304f700b4c7b41 100644 (file)
 // - Add dbl click/enter to select in cart list, ESC to dimiss [DONE]
 // - Autoscan/autoload all available BIOS from 'software' folder [DONE]
 // - Add 1 key jumping in cartridge list (press 'R', jumps to carts starting with 'R', etc) [DONE]
+// - Controller configuration [DONE]
 //
 // STILL TO BE DONE:
 //
-// - Controller configuration
 // - Remove SDL dependencies (sound, mainly) from Jaguar core lib
 // - Fix inconsistency with trailing slashes in paths (eeproms needs one, software doesn't)
 //
@@ -325,23 +325,27 @@ void MainWin::HandleKeys(QKeyEvent * e, bool state)
                joypad_0_buttons[BUTTON_U] = 0;
 
        if (e->key() == (int)vjs.p2KeyBindings[BUTTON_L] && joypad_1_buttons[BUTTON_R])
-               joypad_0_buttons[BUTTON_R] = 0;
+               joypad_1_buttons[BUTTON_R] = 0;
        if (e->key() == (int)vjs.p2KeyBindings[BUTTON_R] && joypad_1_buttons[BUTTON_L])
-               joypad_0_buttons[BUTTON_L] = 0;
+               joypad_1_buttons[BUTTON_L] = 0;
        if (e->key() == (int)vjs.p2KeyBindings[BUTTON_U] && joypad_1_buttons[BUTTON_D])
-               joypad_0_buttons[BUTTON_D] = 0;
+               joypad_1_buttons[BUTTON_D] = 0;
        if (e->key() == (int)vjs.p2KeyBindings[BUTTON_D] && joypad_1_buttons[BUTTON_U])
-               joypad_0_buttons[BUTTON_U] = 0;
+               joypad_1_buttons[BUTTON_U] = 0;
 #endif
 
        // No bad combos exist, let's stuff the emulator key buffers...!
        for(int i=BUTTON_FIRST; i<=BUTTON_LAST; i++)
        {
                if (e->key() == (int)vjs.p1KeyBindings[i])
-                       joypad_0_buttons[i] = (uint8)state;
+//                     joypad_0_buttons[i] = (uint8)state;
+                       joypad_0_buttons[i] = (state ? 0x01 : 0x00);
 
+// Pad #2 is screwing up pad #1. Prolly a problem in joystick.cpp...
+// So let's try to fix it there. :-P
                if (e->key() == (int)vjs.p2KeyBindings[i])
-                       joypad_1_buttons[i] = (uint8)state;
+//                     joypad_1_buttons[i] = (uint8)state;
+                       joypad_1_buttons[i] = (state ? 0x01 : 0x00);
        }
 }
 
index fd8977fb8f2cd77303efab92941807ef33a73e2c..894301d9b99bccea78044dbe24988e347b88b00b 100644 (file)
@@ -325,6 +325,9 @@ void JoystickDone(void)
 
 uint8 JoystickReadByte(uint32 offset)
 {
+// For now, until we can fix the 2nd controller... :-P
+memset(joypad_1_buttons, 0, 21);
+
 #warning "No bounds checking done in JoystickReadByte!"
 //     extern bool hardwareTypeNTSC;
        offset &= 0x03;