void vc4000_state::vc4000(machine_config &config) { /* basic machine hardware */ // MCFG_DEVICE_ADD("maincpu", S2650, 865000) /* 3550000/4, 3580000/3, 4430000/3 */ S2650(config, m_maincpu, 3546875/4); m_maincpu->set_addrmap(AS_PROGRAM, &vc4000_state::vc4000_mem); m_maincpu->sense_handler().set(FUNC(vc4000_state::vc4000_vsync_r)); m_maincpu->set_periodic_int(FUNC(vc4000_state::vc4000_video_line), attotime::from_hz(312*53)); // GOLF needs this exact value /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(50); m_screen->set_size(226, 312); m_screen->set_visarea(8, 184, 0, 269); m_screen->set_screen_update(FUNC(vc4000_state::screen_update_vc4000)); m_screen->set_palette("palette"); PALETTE(config, "palette", FUNC(vc4000_state::vc4000_palette), 8); /* sound hardware */ SPEAKER(config, "mono").front_center(); VC4000_SND(config, m_custom, 0).add_route(ALL_OUTPUTS, "mono", 0.50); /* quickload */ quickload_image_device &quickload(QUICKLOAD(config, "quickload")); quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(vc4000_state, vc4000), this), "pgm,tvc"); /* cartridge */ VC4000_CART_SLOT(config, "cartslot", vc4000_cart, nullptr); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("vc4000"); }
void spectrum_state::spectrum_common(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, X1 / 4); /* This is verified only for the ZX Spectrum. Other clones are reported to have different clocks */ m_maincpu->set_addrmap(AS_PROGRAM, &spectrum_state::spectrum_mem); m_maincpu->set_addrmap(AS_IO, &spectrum_state::spectrum_io); m_maincpu->set_addrmap(AS_OPCODES, &spectrum_state::spectrum_fetch); m_maincpu->set_vblank_int("screen", FUNC(spectrum_state::spec_interrupt)); config.m_minimum_quantum = attotime::from_hz(60); MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum ) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(X1 / 2, 448, 0, 352, 312, 0, 296); m_screen->set_screen_update(FUNC(spectrum_state::screen_update_spectrum)); m_screen->screen_vblank().set(FUNC(spectrum_state::screen_vblank_spectrum)); m_screen->set_palette("palette"); PALETTE(config, "palette", FUNC(spectrum_state::spectrum_palette), 16); GFXDECODE(config, "gfxdecode", "palette", gfx_spectrum); MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum) /* sound hardware */ SPEAKER(config, "mono").front_center(); WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25); SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); /* expansion port */ SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, "kempjoy"); m_exp->irq_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_exp->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); /* devices */ snapshot_image_device &snapshot(SNAPSHOT(config, "snapshot")); snapshot.set_handler(snapquick_load_delegate(&SNAPSHOT_LOAD_NAME(spectrum_state, spectrum), this), "ach,frz,plusd,prg,sem,sit,sna,snp,snx,sp,z80,zx"); quickload_image_device &quickload(QUICKLOAD(config, "quickload")); quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(spectrum_state, spectrum), this), "raw,scr", attotime::from_seconds(2)); // The delay prevents the screen from being cleared by the RAM test at boot CASSETTE(config, m_cassette); m_cassette->set_formats(tzx_cassette_formats); m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED); m_cassette->set_interface("spectrum_cass"); SOFTWARE_LIST(config, "cass_list").set_original("spectrum_cass"); }
void instruct_state::instruct(machine_config &config) { /* basic machine hardware */ S2650(config, m_maincpu, XTAL(3'579'545) / 4); m_maincpu->set_addrmap(AS_PROGRAM, &instruct_state::mem_map); m_maincpu->set_addrmap(AS_IO, &instruct_state::io_map); m_maincpu->set_addrmap(AS_DATA, &instruct_state::data_map); m_maincpu->set_periodic_int(FUNC(instruct_state::t2l_int), attotime::from_hz(120)); m_maincpu->sense_handler().set(FUNC(instruct_state::sense_r)); m_maincpu->flag_handler().set(FUNC(instruct_state::flag_w)); /* video hardware */ config.set_default_layout(layout_instruct); /* quickload */ quickload_image_device &quickload(QUICKLOAD(config, "quickload")); quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(instruct_state, instruct), this), "pgm", attotime::from_seconds(1)); /* cassette */ CASSETTE(config, m_cass); SPEAKER(config, "mono").front_center(); WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25); }
QUICKLOAD_LOAD_MEMBER(n64_mess_state,n64dd) { return quickload(image, file_type, quickload_size); }
void mtx_state::mtx512(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &mtx_state::mtx_mem); m_maincpu->set_addrmap(AS_IO, &mtx_state::mtx_io); m_maincpu->set_daisy_config(mtx_daisy_chain); /* video hardware */ tms9929a_device &vdp(TMS9929A(config, "tms9929a", 10.6875_MHz_XTAL)); vdp.set_screen("screen"); vdp.set_vram_size(0x4000); vdp.int_callback().set(FUNC(mtx_state::mtx_tms9929a_interrupt)); SCREEN(config, "screen", SCREEN_TYPE_RASTER); /* sound hardware */ SPEAKER(config, "mono").front_center(); SN76489A(config, m_sn, 4_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.00); /* devices */ Z80CTC(config, m_z80ctc, 4_MHz_XTAL); m_z80ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_z80ctc->zc_callback<1>().set(FUNC(mtx_state::ctc_trg1_w)); m_z80ctc->zc_callback<2>().set(FUNC(mtx_state::ctc_trg2_w)); TIMER(config, "z80ctc_timer").configure_periodic(FUNC(mtx_state::ctc_tick), attotime::from_hz(4_MHz_XTAL/13)); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(FUNC(mtx_state::write_centronics_busy)); m_centronics->fault_handler().set(FUNC(mtx_state::write_centronics_fault)); m_centronics->perror_handler().set(FUNC(mtx_state::write_centronics_perror)); m_centronics->select_handler().set(FUNC(mtx_state::write_centronics_select)); output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); m_centronics->set_output_latch(cent_data_out); snapshot_image_device &snapshot(SNAPSHOT(config, "snapshot")); snapshot.set_handler(snapquick_load_delegate(&SNAPSHOT_LOAD_NAME(mtx_state, mtx), this), "mtx", attotime::from_seconds(1)); quickload_image_device &quickload(QUICKLOAD(config, "quickload")); quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(mtx_state, mtx), this), "run", attotime::from_seconds(1)); CASSETTE(config, m_cassette); m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED); m_cassette->set_interface("mtx_cass"); TIMER(config, "cassette_timer").configure_periodic(FUNC(mtx_state::cassette_tick), attotime::from_hz(44100)); /* internal ram */ RAM(config, m_ram).set_default_size("64K").set_extra_options("96K,128K,192K,320K,448K,512K"); /* rom extension board */ GENERIC_SOCKET(config, m_extrom, generic_plain_slot, "mtx_rom", "bin,rom"); m_extrom->set_device_load(device_image_load_delegate(&mtx_state::device_image_load_extrom_load, this)); /* rs232 board with disk drive bus */ MTX_EXP_SLOT(config, m_exp, mtx_expansion_devices, nullptr); m_exp->set_program_space(m_maincpu, AS_PROGRAM); m_exp->set_io_space(m_maincpu, AS_IO); m_exp->int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_exp->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); m_exp->busreq_handler().set_inputline(m_maincpu, Z80_INPUT_LINE_BUSRQ); /* cartridge slot */ GENERIC_CARTSLOT(config, m_rompak, generic_plain_slot, "mtx_cart", "bin,rom"); m_rompak->set_device_load(device_image_load_delegate(&mtx_state::device_image_load_rompak_load, this)); /* software lists */ SOFTWARE_LIST(config, "cass_list").set_original("mtx_cass"); SOFTWARE_LIST(config, "flop_list").set_original("mtx_flop"); SOFTWARE_LIST(config, "cart_list").set_original("mtx_cart"); SOFTWARE_LIST(config, "rom_list").set_original("mtx_rom"); }
FastQSPWindow::FastQSPWindow(QWidget *parent) : QMainWindow(parent), gameWidth(800), gameHeight(600), aspectRatio(qreal(gameWidth) / qreal(gameHeight)), scaleFactor(1), gameIsOpen(false), netManager(), settings (QSettings::IniFormat, QSettings::UserScope, "FastQSP", "config") { // Init audio #if QT_VERSION < 0x050000 media = new Phonon::MediaObject(this); audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(media, audioOutput); #else player = new QMediaPlayer(); #endif // Start timer timer.start(); // Init view scene = new QGraphicsScene(this); graphicsView = new QGraphicsView(scene, this); graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); graphicsView->setUpdatesEnabled(true); graphicsView->setFrameStyle(QFrame::NoFrame); webView = new QGraphicsWebView(); webView->page()->setNetworkAccessManager(&netManager); webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); webView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); scene->addItem(webView); scene->setBackgroundBrush(QBrush(QColor(0, 0, 0))); webView->setRenderHints( QPainter::Antialiasing | QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform | QPainter::NonCosmeticDefaultPen); webView->settings()->setAttribute(QWebSettings::AutoLoadImages, true); webView->setAutoFillBackground(false); videoPlayer = new QMediaPlayer(); videoItem = new QGraphicsVideoItem(); videoItem->setSize(QSize(gameWidth + 4, gameHeight + 4)); videoItem->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); videoPlayer->setVideoOutput(videoItem); videoPlayer->setMuted(true); videoPlayer->setNotifyInterval(500); scene->addItem(videoItem); videoItem->hide(); savestatus = new QGraphicsTextItem; savestatus->setDefaultTextColor(Qt::yellow); QFont f; f.setBold(true); f.setPixelSize(20); savestatus->setFont(f); savestatus->setVisible(false); scene->addItem(savestatus); connect(videoPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(replayVideo(qint64))); // Filter context menu event graphicsView->viewport()->installEventFilter(this); // Creating menu //-File menu-------------------------------------------------------- QMenu *fileMenu = new QMenu("File"); fileMenu->addAction("Open file\tCtrl+O", this, SLOT(openFileDialog())); QShortcut *openFile = new QShortcut(QKeySequence("Ctrl+O"), this); connect(openFile, SIGNAL(activated()), SLOT(openFileDialog())); // fileMenu->addAction("Reload QSP file\tc", this, SLOT(openFileDialog())); //for powerairmax // QShortcut *reloadFile = new QShortcut(QKeySequence("c"), this); //for powerairmax fileMenu->addAction("Reload QSP file\tF3", this, SLOT(reloadQSP())); QShortcut *reloadFile = new QShortcut(QKeySequence("F3"), this); connect(reloadFile, SIGNAL(activated()), SLOT(reloadQSP())); fileMenu->addAction("Exit\tCtrl+Q", this, SLOT(close())); QShortcut *exit = new QShortcut(QKeySequence("Ctrl+Q"), this); connect(exit, SIGNAL(activated()), SLOT(close())); menuBar()->addMenu(fileMenu); //-Game menu-------------------------------------------------------- gameMenu = new QMenu("Game"); gameMenu->addAction("Save\tCtrl+S", this, SLOT(saveGameDialog())); QShortcut *save = new QShortcut(QKeySequence("Ctrl+S"), this); connect(save, SIGNAL(activated()), SLOT(saveGameDialog())); gameMenu->addAction("Load\tCtrl+L", this, SLOT(loadGameDialog())); QShortcut *load = new QShortcut(QKeySequence("Ctrl+L"), this); connect(load, SIGNAL(activated()), SLOT(loadGameDialog())); // gameMenu->addAction("Quicksave\tz", this, SLOT(saveGameDialog())); //for powerairmax // QShortcut *quicksave = new QShortcut(QKeySequence("z"), this); //for powerairmax gameMenu->addAction("Quicksave\tF5", this, SLOT(quicksave())); QShortcut *quicksave = new QShortcut(QKeySequence("F5"), this); connect(quicksave, SIGNAL(activated()), SLOT(quicksave())); // gameMenu->addAction("Quickload\tx", this, SLOT(loadGameDialog())); //for powerairmax // QShortcut *quickload = new QShortcut(QKeySequence("x"), this); //for powerairmax gameMenu->addAction("Quickload\tF2", this, SLOT(quickload())); QShortcut *quickload = new QShortcut(QKeySequence("F2"), this); connect(quickload, SIGNAL(activated()), SLOT(quickload())); gameMenu->addAction("Restart\tCtrl+R", this, SLOT(restartGame())); QShortcut *restart = new QShortcut(QKeySequence("Ctrl+R"), this); connect(restart, SIGNAL(activated()), SLOT(restartGame())); //Game shortcuts QShortcut *next = new QShortcut(QKeySequence("space"), this); connect(next, SIGNAL(activated()), SLOT(nextScreen())); QShortcut *prev= new QShortcut(QKeySequence("backspace"), this); connect(prev, SIGNAL(activated()), SLOT(prevScreen())); QShortcut *main_screen= new QShortcut(QKeySequence("escape"), this); connect(main_screen, SIGNAL(activated()), SLOT(gotoMainScreen())); ignoreCRCAction = new QAction("Ignore version check when loading", this); ignoreCRCAction->setCheckable(true); ignoreCRCAction->setChecked(settings.value("ignoreCRC", false).toBool()); connect(ignoreCRCAction, SIGNAL(toggled(bool)), this, SLOT(saveIgnoreCRCState())); gameMenu->addAction(ignoreCRCAction); // TODO: slows the game, move saving to diffrent thread autosaveAction = new QAction("Autosave", this); autosaveAction->setCheckable(true); autosaveAction->setChecked(false); // gameMenu->addAction(autosave); menuBar()->addMenu(gameMenu); gameMenu->setDisabled(true); //-Other menu------------------------------------------------------- QMenu *otherMenu = new QMenu("Other"); otherMenu->addAction("Fullscreen\tAlt+Enter", this, SLOT(toggleFullscreen())); QShortcut *fullscreen = new QShortcut(QKeySequence(Qt::Key_Return + Qt::AltModifier), this); otherMenu->addAction("Show html", this, SLOT(showHtml())); connect(fullscreen, SIGNAL(activated()), SLOT(toggleFullscreen())); muteAction = new QAction("Mute sound", this); muteAction ->setCheckable(true); muteAction ->setChecked(settings.value("mutedState", false).toBool()); connect(muteAction, SIGNAL(toggled(bool)), this, SLOT(saveMutedState())); otherMenu->addAction(muteAction); menuBar()->addMenu(otherMenu); //-Help menu-------------------------------------------------------- QMenu *helpMenu = new QMenu("Help"); helpMenu->addAction("About", this, SLOT(about())); menuBar()->addMenu(helpMenu); //------------------------------------------------------------------ connect(webView, SIGNAL(linkClicked(const QUrl &)), SLOT(linkClicked(const QUrl &)), Qt::DirectConnection); connect(webView, SIGNAL(loadFinished(bool)), SLOT(toggleUpdate()), Qt::DirectConnection); connect(webView, SIGNAL(loadStarted()), SLOT(toggleUpdate()), Qt::DirectConnection); setCentralWidget(graphicsView); // Initializing QSP QSPInit(); QSPCallback::QSPCallback(); // qDebug() << "QSP init finished"; }