alpineTab->edit2->setText(vjs.absROMPath);
alpineTab->writeROM->setChecked(vjs.allowWritesToROM);
}
+
+ for(int i=0; i<21; i++)
+ controllerTab->p1Keys[i] = vjs.p1KeyBindings[i];
}
void ConfigDialog::UpdateVJSettings(void)
strcpy(vjs.absROMPath, alpineTab->edit2->text().toAscii().data());
vjs.allowWritesToROM = alpineTab->writeROM->isChecked();
}
+
+ for(int i=0; i<21; i++)
+ vjs.p1KeyBindings[i] = controllerTab->p1Keys[i];
}
#include "controllertab.h"
#include "joystick.h"
+#include "keygrabber.h"
ControllerTab::ControllerTab(QWidget * parent/*= 0*/): QWidget(parent)
void ControllerTab::DefineAllKeys(void)
{
+ char jagButtonName[21][10] = { "Up", "Down", "Left", "Right",
+ "*", "7", "4", "1", "0", "8", "5", "2", "#", "9", "6", "3",
+ "A", "B", "C", "Option", "Pause" };
+ int orderToDefine[21] = { 0, 1, 2, 3, 18, 17, 16, 20, 19, 7, 11, 15, 6, 10, 14, 5, 9, 13, 8, 4, 12 };
+ KeyGrabber keyGrab(this);
+
+ for(int i=BUTTON_FIRST; i<=BUTTON_LAST; i++)
+ {
+ keyGrab.SetText(jagButtonName[orderToDefine[i]]);
+ keyGrab.exec();
+ int key = keyGrab.key;
+
+ if (key == Qt::Key_Escape)
+ break;
+
+ // Otherwise, populate the appropriate spot in the settings...
+ p1Keys[orderToDefine[i]] = key;
+ }
}
#if 0
protected slots:
void DefineAllKeys(void);
- public:
+ private:
QPushButton * redefineAll;
+
+ public:
+ int p1Keys[21];
};
#endif // __CONTROLLERTAB_H__
--- /dev/null
+//
+// keygrabber.cpp - Widget to grab a key and dismiss itself
+//
+// by James L. Hammons
+// (C) 2011 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -------------------------------------------------------------
+// JLH 07/18/2011 Created this file
+//
+
+#include "keygrabber.h"
+
+
+KeyGrabber::KeyGrabber(QWidget * parent/*= 0*/): QDialog(parent)
+{
+ label = new QLabel(this);
+ QVBoxLayout * mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(label);
+ setLayout(mainLayout);
+ setWindowTitle(tr("Grab"));
+}
+
+KeyGrabber::~KeyGrabber()
+{
+}
+
+void KeyGrabber::SetText(QString keyText)
+{
+ QString text = QString(tr("Press key for \"%1\"<br>(ESC to cancel)")).arg(keyText);
+ label->setText(text);
+}
+
+void KeyGrabber::keyPressEvent(QKeyEvent * e)
+{
+ key = e->key();
+ accept();
+}
--- /dev/null
+//
+// keygrabber.h - Widget to grab a key and dismiss itself
+//
+// by James L. Hammons
+// (C) 2011 Underground Software
+//
+
+#ifndef __KEYGRABBER_H__
+#define __KEYGRABBER_H__
+
+#include <QtGui>
+
+//class GeneralTab;
+//class ControllerTab;
+//class AlpineTab;
+
+class KeyGrabber: public QDialog
+{
+ Q_OBJECT
+
+ public:
+ KeyGrabber(QWidget * parent = 0);
+ ~KeyGrabber();
+// void UpdateVJSettings(void);
+ void SetText(QString);
+// int GetKeyGrabbed(void);
+
+ protected:
+ void keyPressEvent(QKeyEvent *);
+
+// private:
+// void LoadDialogFromSettings(void);
+
+ private:
+// QTabWidget * tabWidget;
+// QDialogButtonBox * buttonBox;
+ QLabel * label;
+
+ public:
+ int key;
+// GeneralTab * generalTab;
+// ControllerTab * controllerTab;
+// AlpineTab * alpineTab;
+};
+
+#endif // __KEYGRABBER_H__
//Hm, it seems that the OP needs to execute from zero, so let's try it:
// And it works! But need to do some optimizations in the OP to keep it from attempting
// to do a scanline render in the non-display area... [DONE]
-#if 0
+//this seems to cause a regression in certain games, like rayman
+#if 1
if (scanline >= (uint16)GET16(tomRam8, VDB) && scanline < (uint16)GET16(tomRam8, VDE))
{
if (render)
src/gui/generaltab.h \
src/gui/glwidget.h \
src/gui/imagedelegate.h \
+ src/gui/keygrabber.h \
src/gui/mainwin.h
SOURCES = \
src/gui/generaltab.cpp \
src/gui/glwidget.cpp \
src/gui/imagedelegate.cpp \
+ src/gui/keygrabber.cpp \
src/gui/mainwin.cpp