Ejemplo n.º 1
0
void retro_run( void )
{
  bool updated = false;

  if ( env_cb( RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated ) && updated )
  {
    int res = update_variables();
    
    if ( res & UPDATE_RESET )
    {
      retro_reset();
    }
    
    if ( res & UPDATE_AV )
    {
      struct retro_system_av_info info;
      retro_get_system_av_info( &info );
      env_cb( RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &info );
    }
  }
  
  input_poll_cb();
  
  uint16_t* fb = TVFB + WinL + WinT * TVP / 2;

  eo_tick();
  keybovl_update( input_state_cb, state.devices, fb, TVP / 2, state.transp, state.scaled, state.ms, 20 );
  video_cb( (void*)fb, WinR - WinL, WinB - WinT, TVP );
}
Ejemplo n.º 2
0
void retro_deinit(void)
{
   retro_reset();
   initialized = false;

   if(lynx)
      delete lynx;
}
Ejemplo n.º 3
0
void retro_deinit(void)
{
    retro_reset();
    initialized = false;

    if(NULL != lynx)
    {
        delete lynx;
    }
}
Ejemplo n.º 4
0
bool retro_load_game( const struct retro_game_info* info )
{
  log_cb( RETRO_LOG_ERROR, "\n%s", eo_gitstamp );
  
  enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
  
  if ( !env_cb( RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt ) )
  {
    log_cb( RETRO_LOG_ERROR, "EightyOne needs RGB565\n" );
    return false;
  }
  
  memset( (void*)&state, 0, sizeof( state ) );
  state.size = info->size;
  state.data = malloc( info->size );
  
  if ( !state.data )
  {
    log_cb( RETRO_LOG_ERROR, "Error allocating memory for game data\n" );
    return false;
  }
  
  memcpy( state.data, info->data, state.size );
  
  state.cfg.machine = MACHINEZX81;
  state.cfg.LambdaColour = COLOURDISABLED;
  state.cfg.LowRAMContents = LOWRAM_ROMSHADOW;
  state.cfg.ProtectROM = 1;
  state.cfg.ZXPrinter = 0;
  state.cfg.NTSC = 0;
  state.cfg.M1Not = 0;
  state.cfg.TS2050 = 0;
  state.cfg.ChrGen = CHRGENSINCLAIR;
  state.cfg.RamPack = RAMPACK16;
  state.cfg.HiRes = HIRESDISABLED;
  state.cfg.SoundCard = AY_TYPE_DISABLED;
  state.cfg.Chroma81 = 0;
  
  state.scaled = -1;
  TZXFile.AddTextBlock( "" ); // prevent a crash if the user does a LOAD ""
  TZXFile.FlashLoad = true;
  
  SHA1Context sha1;
  SHA1Reset( &sha1 );
  SHA1Input( &sha1, (const unsigned char*)info->data, info->size );
  SHA1Result( &sha1 );
  memcpy( state.sha1, sha1.Message_Digest, sizeof(state.sha1) );
  
  update_variables();
  retro_reset();
  keybovl_set( &zx81ovl );
  return true;
}
Ejemplo n.º 5
0
static void check_variables(void)
{
   struct retro_variable var = {0};

   var.key = "ngp_language";

   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
   {
      if (strcmp(var.value, "japanese") == 0)
         setting_ngp_language = 0;
      else if (strcmp(var.value, "english") == 0)
         setting_ngp_language = 1;    
      retro_reset();
   }
}
Ejemplo n.º 6
0
void retro_deinit(void) { retro_reset(); }