コード例 #1
0
ファイル: libretro.cpp プロジェクト: mdl8bit/nestopia
void retro_run(void)
{
   update_input();
   emulator.Execute(video, audio, input);

   if (Api::Input(emulator).GetConnectedController(1) == 5)
      draw_crosshair(crossx, crossy);
   
   unsigned frames = is_pal ? 44100 / 50 : 44100 / 60;
   for (unsigned i = 0; i < frames; i++)
      audio_stereo_buffer[(i << 1) + 0] = audio_stereo_buffer[(i << 1) + 1] = audio_buffer[i];
   audio_batch_cb(audio_stereo_buffer, frames);
   
   bool updated = false;
   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
   {
      check_variables();
      delete video;
      video = 0;
      video = new Api::Video::Output(video_buffer, video_width * sizeof(uint32_t));
   }
   
   bool overscan = blargg_ntsc || use_overscan;
   
   video_cb(video_buffer + (overscan ? 0 : (256 * 8)),
         video_width,
         Api::Video::Output::HEIGHT - (overscan ? 0 : 16),
         pitch);
}
コード例 #2
0
ファイル: libretro.cpp プロジェクト: anikom15/nestopia
void retro_run(void)
{
   update_input();
   emulator.Execute(video, audio, input);

   video_cb(video_buffer, 256, 240, 1024);

   unsigned frames = is_pal ? 44100 / 50 : 44100 / 60;
   for (unsigned i = 0; i < frames; i++)
      audio_stereo_buffer[(i << 1) + 0] = audio_stereo_buffer[(i << 1) + 1] = audio_buffer[i];
   audio_batch_cb(audio_stereo_buffer, frames);

   bool updated = false;
   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
      check_variables();
}
コード例 #3
0
ファイル: libretro.cpp プロジェクト: RushJet1/nestopia
void retro_run(void)
{
   update_input();
   emulator.Execute(video, audio, input);
   
   delete video;
   video = 0;

   video = new Api::Video::Output(video_buffer, video_width * sizeof(uint32_t));

   unsigned frames = is_pal ? 44100 / 50 : 44100 / 60;
   for (unsigned i = 0; i < frames; i++)
      audio_stereo_buffer[(i << 1) + 0] = audio_stereo_buffer[(i << 1) + 1] = audio_buffer[i];
   audio_batch_cb(audio_stereo_buffer, frames);

   bool updated = false;
   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
      check_variables();
      
   video_cb(video_buffer, video_width, Api::Video::Output::HEIGHT, pitch);
}