o switch to v46

This commit is contained in:
David Voswinkel
2009-05-12 22:17:42 +02:00
parent 7a878eab39
commit 8e877d38d4
217 changed files with 1440 additions and 31284 deletions

View File

@@ -1,16 +0,0 @@
class AboutWindow : public QObject {
Q_OBJECT
public:
QWidget *window;
QVBoxLayout *layout;
struct Logo : public QWidget {
void paintEvent(QPaintEvent*);
} *logo;
QLabel *info;
QWidget *spacer;
void setup();
public slots:
} *winAbout;

View File

@@ -1,13 +0,0 @@
class HtmlViewerWindow : public QObject {
Q_OBJECT
public:
QWidget *window;
QVBoxLayout *layout;
QTextBrowser *document;
void setup();
void show(const char *title, const char *htmlData);
public slots:
} *winHtmlViewer;

View File

@@ -93,7 +93,7 @@ void LoaderWindow::loadBsxSlottedCartridge(const char *filebase, const char *fil
slot1File->setText(fileSlot1);
syncUi();
mode = ModeBsxSlotted;
mode = SNES::Cartridge::ModeBsxSlotted;
showWindow("Load BS-X Slotted Cartridge");
}
@@ -109,7 +109,7 @@ void LoaderWindow::loadBsxCartridge(const char *fileBase, const char *fileSlot1)
slot1File->setText(fileSlot1);
syncUi();
mode = ModeBsx;
mode = SNES::Cartridge::ModeBsx;
showWindow("Load BS-X Cartridge");
}
@@ -127,8 +127,24 @@ void LoaderWindow::loadSufamiTurboCartridge(const char *fileBase, const char *fi
slot2File->setText(fileSlot2);
syncUi();
mode = ModeSufamiTurbo;
mode = SNES::Cartridge::ModeSufamiTurbo;
showWindow("Load Sufami Turbo Cartridge");
}
void LoaderWindow::loadSuperGameBoyCartridge(const char *fileBase, const char *fileSlot1) {
window->hide();
baseLabel->show(), baseFile->show(), baseBrowse->show(), baseClear->show();
slot1Label->show(), slot1File->show(), slot1Browse->show(), slot1Clear->show();
slot2Label->hide(), slot2File->hide(), slot2Browse->hide(), slot2Clear->hide();
slot1Label->setText("Game Boy cartridge:");
baseFile->setText(fileBase);
slot1File->setText(fileSlot1);
syncUi();
mode = SNES::Cartridge::ModeSuperGameBoy;
showWindow("Load Super Game Boy Cartridge");
}
void LoaderWindow::showWindow(const char *title) {
@@ -177,18 +193,23 @@ void LoaderWindow::onLoad() {
string slot2 = slot2File->text().toUtf8().data();
switch(mode) {
case ModeBsxSlotted: {
case SNES::Cartridge::ModeBsxSlotted: {
utility.loadCartridgeBsxSlotted(base, slot1);
} break;
case ModeBsx: {
snes.config.path.bsx = base;
case SNES::Cartridge::ModeBsx: {
config.path.bsx = base;
utility.loadCartridgeBsx(base, slot1);
} break;
case ModeSufamiTurbo: {
snes.config.path.st = base;
case SNES::Cartridge::ModeSufamiTurbo: {
config.path.st = base;
utility.loadCartridgeSufamiTurbo(base, slot1, slot2);
} break;
case SNES::Cartridge::ModeSuperGameBoy: {
config.path.sgb = base;
utility.loadCartridgeSuperGameBoy(base, slot1);
} break;
}
}

View File

@@ -1,45 +0,0 @@
class LoaderWindow : public QObject {
Q_OBJECT
public:
QWidget *window;
QVBoxLayout *layout;
QGridLayout *grid;
QLabel *baseLabel;
QLineEdit *baseFile;
QPushButton *baseBrowse;
QPushButton *baseClear;
QLabel *slot1Label;
QLineEdit *slot1File;
QPushButton *slot1Browse;
QPushButton *slot1Clear;
QLabel *slot2Label;
QLineEdit *slot2File;
QPushButton *slot2Browse;
QPushButton *slot2Clear;
QHBoxLayout *controls;
QPushButton *load;
QPushButton *cancel;
QWidget *spacer;
void setup();
void syncUi();
void loadBsxSlottedCartridge(const char*, const char*);
void loadBsxCartridge(const char*, const char*);
void loadSufamiTurboCartridge(const char*, const char*, const char*);
public slots:
void selectBaseCartridge();
void clearBaseCartridge();
void selectSlot1Cartridge();
void clearSlot1Cartridge();
void selectSlot2Cartridge();
void clearSlot2Cartridge();
void onLoad();
void onCancel();
private:
enum mode_t { ModeBsxSlotted, ModeBsx, ModeSufamiTurbo } mode;
void showWindow(const char *title);
} *winLoader;

View File

@@ -3,7 +3,7 @@ void MainWindow::setup() {
window->setObjectName("main-window");
window->setWindowTitle(BSNES_TITLE);
system = window->menuBar()->addMenu("&System");
system = window->menuBar()->addMenu("System");
system_load = system->addAction("&Load Cartridge ...");
system->addSeparator();
system_power = system->addMenu("&Power");
@@ -41,7 +41,7 @@ void MainWindow::setup() {
system_exit = system->addAction("E&xit");
system_exit->setMenuRole(QAction::QuitRole);
settings = window->menuBar()->addMenu("S&ettings");
settings = window->menuBar()->addMenu("Settings");
settings_videoMode = settings->addMenu("&Video Mode");
settings_videoMode_1x = settings_videoMode->addAction("Scale &1x");
settings_videoMode_1x->setCheckable(true);
@@ -110,7 +110,7 @@ void MainWindow::setup() {
settings_configuration = settings->addAction("&Configuration ...");
settings_configuration->setMenuRole(QAction::PreferencesRole);
help = window->menuBar()->addMenu("&Help");
help = window->menuBar()->addMenu("Help");
help_documentation = help->addAction("Documentation ...");
help_license = help->addAction("License ...");
help->addSeparator();
@@ -195,22 +195,22 @@ void MainWindow::setup() {
}
void MainWindow::syncUi() {
system_power->setEnabled(cartridge.loaded());
system_power->setEnabled(SNES::cartridge.loaded());
system_power_on->setChecked (application.power == true);
system_power_off->setChecked(application.power == false);
system_reset->setEnabled(cartridge.loaded() && application.power);
system_reset->setEnabled(SNES::cartridge.loaded() && application.power);
system_port1_none->setChecked (snes.config.controller_port1 == SNES::Input::DeviceNone);
system_port1_joypad->setChecked (snes.config.controller_port1 == SNES::Input::DeviceJoypad);
system_port1_multitap->setChecked (snes.config.controller_port1 == SNES::Input::DeviceMultitap);
system_port1_mouse->setChecked (snes.config.controller_port1 == SNES::Input::DeviceMouse);
system_port2_none->setChecked (snes.config.controller_port2 == SNES::Input::DeviceNone);
system_port2_joypad->setChecked (snes.config.controller_port2 == SNES::Input::DeviceJoypad);
system_port2_multitap->setChecked (snes.config.controller_port2 == SNES::Input::DeviceMultitap);
system_port2_mouse->setChecked (snes.config.controller_port2 == SNES::Input::DeviceMouse);
system_port2_superscope->setChecked(snes.config.controller_port2 == SNES::Input::DeviceSuperScope);
system_port2_justifier->setChecked (snes.config.controller_port2 == SNES::Input::DeviceJustifier);
system_port2_justifiers->setChecked(snes.config.controller_port2 == SNES::Input::DeviceJustifiers);
system_port1_none->setChecked (SNES::config.controller_port1 == SNES::Input::DeviceNone);
system_port1_joypad->setChecked (SNES::config.controller_port1 == SNES::Input::DeviceJoypad);
system_port1_multitap->setChecked (SNES::config.controller_port1 == SNES::Input::DeviceMultitap);
system_port1_mouse->setChecked (SNES::config.controller_port1 == SNES::Input::DeviceMouse);
system_port2_none->setChecked (SNES::config.controller_port2 == SNES::Input::DeviceNone);
system_port2_joypad->setChecked (SNES::config.controller_port2 == SNES::Input::DeviceJoypad);
system_port2_multitap->setChecked (SNES::config.controller_port2 == SNES::Input::DeviceMultitap);
system_port2_mouse->setChecked (SNES::config.controller_port2 == SNES::Input::DeviceMouse);
system_port2_superscope->setChecked(SNES::config.controller_port2 == SNES::Input::DeviceSuperScope);
system_port2_justifier->setChecked (SNES::config.controller_port2 == SNES::Input::DeviceJustifier);
system_port2_justifiers->setChecked(SNES::config.controller_port2 == SNES::Input::DeviceJustifiers);
settings_videoMode_1x->setChecked (config.video.context->multiplier == 1);
settings_videoMode_2x->setChecked (config.video.context->multiplier == 2);
@@ -252,17 +252,17 @@ void MainWindow::powerOn() { utility.modifySystemState(Utility::PowerOn); }
void MainWindow::powerOff() { utility.modifySystemState(Utility::PowerOff); }
void MainWindow::reset() { utility.modifySystemState(Utility::Reset); }
void MainWindow::setPort1None() { snes.config.controller_port1 = SNES::Input::DeviceNone; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Joypad() { snes.config.controller_port1 = SNES::Input::DeviceJoypad; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Multitap() { snes.config.controller_port1 = SNES::Input::DeviceMultitap; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Mouse() { snes.config.controller_port1 = SNES::Input::DeviceMouse; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2None() { snes.config.controller_port2 = SNES::Input::DeviceNone; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Joypad() { snes.config.controller_port2 = SNES::Input::DeviceJoypad; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Multitap() { snes.config.controller_port2 = SNES::Input::DeviceMultitap; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Mouse() { snes.config.controller_port2 = SNES::Input::DeviceMouse; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2SuperScope() { snes.config.controller_port2 = SNES::Input::DeviceSuperScope; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Justifier() { snes.config.controller_port2 = SNES::Input::DeviceJustifier; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Justifiers() { snes.config.controller_port2 = SNES::Input::DeviceJustifiers; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1None() { SNES::config.controller_port1 = SNES::Input::DeviceNone; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Joypad() { SNES::config.controller_port1 = SNES::Input::DeviceJoypad; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Multitap() { SNES::config.controller_port1 = SNES::Input::DeviceMultitap; utility.updateControllers(); syncUi(); }
void MainWindow::setPort1Mouse() { SNES::config.controller_port1 = SNES::Input::DeviceMouse; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2None() { SNES::config.controller_port2 = SNES::Input::DeviceNone; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Joypad() { SNES::config.controller_port2 = SNES::Input::DeviceJoypad; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Multitap() { SNES::config.controller_port2 = SNES::Input::DeviceMultitap; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Mouse() { SNES::config.controller_port2 = SNES::Input::DeviceMouse; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2SuperScope() { SNES::config.controller_port2 = SNES::Input::DeviceSuperScope; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Justifier() { SNES::config.controller_port2 = SNES::Input::DeviceJustifier; utility.updateControllers(); syncUi(); }
void MainWindow::setPort2Justifiers() { SNES::config.controller_port2 = SNES::Input::DeviceJustifiers; utility.updateControllers(); syncUi(); }
void MainWindow::quit() {
application.terminate = true;
@@ -356,7 +356,7 @@ void CanvasObject::dropEvent(QDropEvent *event) {
//custom video render and mouse capture functionality
QPaintEngine* CanvasWidget::paintEngine() const {
if(cartridge.loaded()) return 0;
if(SNES::cartridge.loaded()) return 0;
return QWidget::paintEngine();
}

View File

@@ -1,129 +0,0 @@
class CanvasObject : public QWidget {
public:
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
};
class CanvasWidget : public CanvasObject {
public:
QPaintEngine* paintEngine() const;
void mouseReleaseEvent(QMouseEvent*);
void paintEvent(QPaintEvent*);
};
class MainWindow : public QObject {
Q_OBJECT
public:
struct Window : public QMainWindow {
void closeEvent(QCloseEvent*);
} *window;
QVBoxLayout *layout;
QMenu *system;
QAction *system_load;
QMenu *system_power;
QAction *system_power_on;
QAction *system_power_off;
QAction *system_reset;
QMenu *system_port1;
QAction *system_port1_none;
QAction *system_port1_joypad;
QAction *system_port1_multitap;
QAction *system_port1_mouse;
QMenu *system_port2;
QAction *system_port2_none;
QAction *system_port2_joypad;
QAction *system_port2_multitap;
QAction *system_port2_mouse;
QAction *system_port2_superscope;
QAction *system_port2_justifier;
QAction *system_port2_justifiers;
QAction *system_exit;
QMenu *settings;
QMenu *settings_videoMode;
QAction *settings_videoMode_1x;
QAction *settings_videoMode_2x;
QAction *settings_videoMode_3x;
QAction *settings_videoMode_4x;
QAction *settings_videoMode_max;
QAction *settings_videoMode_correctAspectRatio;
QAction *settings_videoMode_fullscreen;
QAction *settings_videoMode_ntsc;
QAction *settings_videoMode_pal;
QMenu *settings_videoFilter;
QAction *settings_videoFilter_point;
QAction *settings_videoFilter_linear;
QAction *settings_videoFilter_none;
QAction *settings_videoFilter_scanline;
QAction *settings_videoFilter_scale2x;
QAction *settings_videoFilter_hq2x;
QAction *settings_videoFilter_ntsc;
QAction *settings_muteAudio;
QMenu *settings_emulationSpeed;
QAction *settings_emulationSpeed_slowest;
QAction *settings_emulationSpeed_slow;
QAction *settings_emulationSpeed_normal;
QAction *settings_emulationSpeed_fast;
QAction *settings_emulationSpeed_fastest;
QAction *settings_emulationSpeed_syncVideo;
QAction *settings_emulationSpeed_syncAudio;
QAction *settings_configuration;
QMenu *help;
QAction *help_documentation;
QAction *help_license;
QAction *help_about;
//
CanvasObject *canvasContainer;
QVBoxLayout *canvasLayout;
CanvasWidget *canvas;
QLabel *systemState;
void setup();
void syncUi();
public slots:
void loadCartridge();
void powerOn();
void powerOff();
void reset();
void setPort1None();
void setPort1Joypad();
void setPort1Multitap();
void setPort1Mouse();
void setPort2None();
void setPort2Joypad();
void setPort2Multitap();
void setPort2Mouse();
void setPort2SuperScope();
void setPort2Justifier();
void setPort2Justifiers();
void quit();
void setVideoMode1x();
void setVideoMode2x();
void setVideoMode3x();
void setVideoMode4x();
void setVideoModeMax();
void toggleAspectCorrection();
void toggleFullscreen();
void setVideoNtsc();
void setVideoPal();
void setPointFilter();
void setLinearFilter();
void setNoFilter();
void setScanlineFilter();
void setScale2xFilter();
void setHq2xFilter();
void setNtscFilter();
void muteAudio();
void setSpeedSlowest();
void setSpeedSlow();
void setSpeedNormal();
void setSpeedFast();
void setSpeedFastest();
void syncVideo();
void syncAudio();
void showConfigWindow();
void showDocumentation();
void showLicense();
void showAbout();
} *winMain;