コード例 #1
0
ファイル: libretro.c プロジェクト: RobLoach/snes9x-next
bool retro_load_game(const struct retro_game_info *game)
{ 
   int loaded;
   struct retro_memory_map map;

   init_descriptors();
   memorydesc_c = 0;
   map.descriptors    = memorydesc + MAX_MAPS - memorydesc_c;
   map.num_descriptors = memorydesc_c;

   /* Hack. S9x cannot do stuff from RAM. <_< */
   memstream_set_buffer((uint8_t*)game->data, game->size);

   loaded = LoadROM("");
   if (!loaded)
   {
      if (log_cb)
         log_cb(RETRO_LOG_ERROR, "ROM loading failed...\n");
      return FALSE;
   }

   check_variables();


   environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);

   return TRUE;
}
コード例 #2
0
ファイル: libsnes.c プロジェクト: anhhuybidv/snes9xnext
EXPORT bool snes_load_cartridge_normal(const char * a, const uint8_t *rom_data, unsigned rom_size)
{
	int loaded;
   /* Hack. S9x cannot do stuff from RAM. <_< */
   memstream_set_buffer((uint8_t*)rom_data, rom_size);

   loaded = LoadROM("foo");
   if (!loaded)
   {
      fprintf(stderr, "[libsnes]: Rom loading failed...\n");
      return FALSE;
   }

   if (environ_cb)
   {
	   struct snes_system_timing timing;
	   timing.sample_rate = 32040.5;
	   if (!Settings.PAL)
		   timing.fps = 21477272.0 / 357366.0;
	   else
		   timing.fps = 21281370.0 / 425568.0;

	   environ_cb(SNES_ENVIRONMENT_SET_TIMING, &timing);
   }
   
   return TRUE;
}
コード例 #3
0
ファイル: mainwindow.cpp プロジェクト: fr3d741/C64Emulator
void MainWindow::slotLoad()
{
    QString filename = QFileDialog::getOpenFileName(this,"Select the C64 ROM");
    if (filename.isEmpty() || filename.isNull())
        return;

    if (!_recentFiles.contains(filename))
        _recentFiles.push_front(filename);

    LoadROM(filename);
}
コード例 #4
0
ファイル: main.cpp プロジェクト: FenrisulfrX/citra
void GMainWindow::BootGame(const QString& filename) {
    LOG_INFO(Frontend, "Citra starting...");
    StoreRecentFile(filename); // Put the filename on top of the list

    if (!LoadROM(filename))
        return;

    // Create and start the emulation thread
    emu_thread = std::make_unique<EmuThread>(render_window);
    emit EmulationStarting(emu_thread.get());
    render_window->moveContext();
    emu_thread->start();

    connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
    // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
    // before the CPU continues
    connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()),
            Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget,
            SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeEntered()), callstackWidget,
            SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeEntered()), waitTreeWidget,
            SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeLeft()), disasmWidget, SLOT(OnDebugModeLeft()),
            Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()),
            Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeLeft()), callstackWidget, SLOT(OnDebugModeLeft()),
            Qt::BlockingQueuedConnection);
    connect(emu_thread.get(), SIGNAL(DebugModeLeft()), waitTreeWidget, SLOT(OnDebugModeLeft()),
            Qt::BlockingQueuedConnection);

    // Update the GUI
    registersWidget->OnDebugModeEntered();
    callstackWidget->OnDebugModeEntered();
    if (ui.action_Single_Window_Mode->isChecked()) {
        game_list->hide();
    }
    status_bar_update_timer.start(2000);

    render_window->show();
    render_window->setFocus();

    emulation_running = true;
    OnStartGame();
}
コード例 #5
0
ファイル: emusettings.cpp プロジェクト: xc700/gpSP4Symbian
void EmuSettings::loadROM()
    {    
    __DEBUG_IN
    QDir dir(gpspsettings.iLastROM);
    QString rom = QFileDialog::getOpenFileName(this,
                    tr("Open File"),
                    dir.absolutePath(),
                    tr("ROMs (*.GBA *.gba *.zip *.ZIP);;"));
    if( rom.isEmpty() )
        {
		return;
        }
    
    gpspsettings.iLastROM = rom;
    savecurrentSettings();
    fileview->setRomLabel( rom );
    emit( LoadROM( rom,gpspsettings ));
    romloaded = true;
    __DEBUG_OUT
    }
コード例 #6
0
ファイル: emusettings.cpp プロジェクト: xc700/gpSP4Symbian
void EmuSettings::continueClicked()
	{
    if( settingsChanged )
    	{
		savecurrentSettings();
		emit( updateSettings(gpspsettings) );
		settingsChanged = false;
    	}
    
	//if there was no ROM loaded, load previous ROM
	if( !romloaded )
		{
		emit( LoadROM( gpspsettings.iLastROM, gpspsettings ));
	    romloaded = true;
		}
	//just continue the game
	else
		{
		emit( continueGame() );
		}
	}
コード例 #7
0
ファイル: libretro.c プロジェクト: exsinner/snes9x-next
bool retro_load_game(const struct retro_game_info *game)
{ 
   int loaded;
   struct retro_memory_map map;

   init_descriptors();
   memorydesc_c = 0;
   map.descriptors    = memorydesc + MAX_MAPS - memorydesc_c;
   map.num_descriptors = memorydesc_c;

   /* Hack. S9x cannot do stuff from RAM. <_< */
   memstream_set_buffer((uint8_t*)game->data, game->size);

   loaded = LoadROM("");
   if (!loaded)
   {
      struct retro_message msg; 
      char msg_local[256];

      snprintf(msg_local,
            sizeof(msg_local), "ROM loading failed...");
      if (log_cb)
         log_cb(RETRO_LOG_ERROR, "ROM loading failed...\n");
      msg.msg    = msg_local;
      msg.frames = 360;
      if (environ_cb)
         environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg);
      return FALSE;
   }

   check_variables();


   environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);

   return TRUE;
}
コード例 #8
0
void EmuSettings::continueClicked()
	{
    if( settingsChanged )
    	{
		savecurrentSettings();
		emit( updateSettings(gpspsettings) );
		settingsChanged = false;
    	}
    
	//if there was no ROM loaded, load previous ROM
	if( !romloaded )
		{
                //sanitycheck that we actually have a ROM to load
                if(  gpspsettings.iLastROM.length() < 3 )
                    return;
		emit( LoadROM( gpspsettings.iLastROM, gpspsettings ));
                romloaded = true;
		}
	//just continue the game
	else
		{
		emit( continueGame() );
		}
	}
コード例 #9
0
void MainWindow::loadCartridge(std::string path)
{
    cartridge = LoadROM(path);
    mapper = std::shared_ptr<Mapper>(new Mapper(cartridge));
    cpu = std::shared_ptr<CPU_6502>(new CPU_6502(mapper, bridgeCPU));
}
コード例 #10
0
ファイル: mainwindow.cpp プロジェクト: fr3d741/C64Emulator
void MainWindow::slotRecentTriggered()
{
    QAction* sndr = reinterpret_cast<QAction*>(sender());
    LoadROM(sndr->text());
}