Ejemplo n.º 1
0
//////////////////////////////////////////////////////////
//
// CInstallManager::_ShowCrashFailDialog
//
//
//
//////////////////////////////////////////////////////////
SString CInstallManager::_ShowCrashFailDialog ( void )
{
    // Crashed before gta game started ?
    if ( WatchDogIsSectionOpen ( "L1" ) )
        WatchDogIncCounter ( "CR1" );

    HideSplash ();

    // Transfer gta-fopen-last info
    if ( GetApplicationSetting ( "diagnostics", "gta-fopen-fail" ).empty() )
        SetApplicationSetting ( "diagnostics", "gta-fopen-fail", GetApplicationSetting ( "diagnostics", "gta-fopen-last" ) );
    SetApplicationSetting ( "diagnostics", "gta-fopen-last", "" );

    SString strMessage = GetApplicationSetting ( "diagnostics", "last-crash-info" );
    SString strReason = GetApplicationSetting ( "diagnostics", "last-crash-reason" );
    SetApplicationSetting ( "diagnostics", "last-crash-reason", "" );
    if ( strReason == "direct3ddevice-reset" )
    {
        strMessage += _("** The crash was caused by a graphics driver error **\n\n** Please update your graphics drivers **");
    }
    else
    {
        strMessage += strReason;
    }

    strMessage = strMessage.Replace ( "\r", "" ).Replace ( "\n", "\r\n" );
    SString strResult = ShowCrashedDialog ( g_hInstance, strMessage );
    HideCrashedDialog ();

    CheckAndShowFileOpenFailureMessage ();

    return strResult;
}
Ejemplo n.º 2
0
//////////////////////////////////////////////////////////
//
// HandleNotUsedMainMenu
//
// Called when a problem occured before the main menu was used by user
// If fullscreen, then maybe change fullscreen mode
//
//////////////////////////////////////////////////////////
void HandleNotUsedMainMenu ( void )
{
    AddReportLog( 9310, "Loader - HandleNotUsedMainMenu" );
    {
        // Slighty hacky way of checking in-game settings
        SString strCoreConfigFilename = CalcMTASAPath( PathJoin( "mta", "config", "coreconfig.xml" ) );
        SString strCoreConfig;
        FileLoad( strCoreConfigFilename, strCoreConfig );
        SString strWindowed        = strCoreConfig.SplitRight( "<display_windowed>" ).Left( 1 );
        SString strFullscreenStyle = strCoreConfig.SplitRight( "<display_fullscreen_style>" ).Left( 1 );
        if ( strFullscreenStyle == "1" )
        {
            AddReportLog( 9315, "Loader - HandleNotUsedMainMenu - Already Borderless window" );
        }
        else
        if ( !strWindowed.empty() && !strFullscreenStyle.empty())
        {
            if ( strWindowed == "0" && strFullscreenStyle == "0" )   // 0=FULLSCREEN_STANDARD
            {
                // Inform user
                SString strMessage = _("Are you having problems running MTA:SA?.\n\nDo you want to change the following setting?");
                strMessage += "\n" + _("Fullscreen mode:") + " -> " + _("Borderless window");
                HideSplash();
                int iResponse = MessageBoxUTF8 ( NULL, strMessage, "MTA: San Andreas", MB_YESNO | MB_ICONQUESTION | MB_TOPMOST );
                if ( iResponse == IDYES )
                {
                    // Very hacky way of changing in-game settings
                    strCoreConfig = strCoreConfig.Replace( "<display_fullscreen_style>0", "<display_fullscreen_style>1" );
                    FileSave( strCoreConfigFilename, strCoreConfig );
                    AddReportLog( 9311, "Loader - HandleNotUsedMainMenu - User change to Borderless window" );
                }
                else
                    AddReportLog( 9313, "Loader - HandleNotUsedMainMenu - User said no" );
            }
            else
                AddReportLog( 9314, "Loader - HandleNotUsedMainMenu - Mode not fullscreen standard" );
        }
        else
        {
            // If no valid settings file yet, do the change without asking
            strCoreConfig = "<mainconfig><settings><display_fullscreen_style>1</display_fullscreen_style></settings></mainconfig>";
            FileSave( strCoreConfigFilename, strCoreConfig );
            AddReportLog( 9312, "Loader - HandleNotUsedMainMenu - Set Borderless window" );
        }
    }

    // Check if Evolve is active
    for ( auto processId : MyEnumProcesses( true ) )
    {
        SString strFilename = ExtractFilename( GetProcessPathFilename( processId ) );
        if ( strFilename.BeginsWithI( "Evolve" ) )
        {
            SString strMessage = _("Are you having problems running MTA:SA?.\n\nTry disabling the following products for GTA and MTA:");
            strMessage += "\n\nEvolve";
            DisplayErrorMessageBox ( strMessage, _E("CL43"), "not-used-menu-evolve" );
            break;
        }
    }
}
Ejemplo n.º 3
0
__geta4 void main(void)
#endif
{
  DEBUG_FUNC_IN();

  uint32_t spiclk;
  fileTYPE sd_boot_file;

  HideSplash();
  SPI_fast();

  // boot message
  draw_boot_logo();
  BootPrintEx("**** MINIMIG-DE1 ****");
  BootPrintEx("Minimig by Dennis van Weeren");
  BootPrintEx("Updates by Jakub Bednarski, Tobias Gubener, Sascha Boing, A.M. Robinson & others");
  BootPrintEx("DE1 port by Rok Krajnc ([email protected])");
  BootPrintEx(" ");
  sprintf(s, "Build git commit: %s", __BUILD_REV);
  BootPrintEx(s);
  sprintf(s, "Build git tag: %s", __BUILD_TAG);
  BootPrintEx(s);
  BootPrintEx(" ");
  BootPrintEx("For updates & code see https://github.com/rkrajnc/minimig-de1");
  BootPrintEx("For support, see http://www.minimig.net");
  BootPrintEx(" ");

  printf("\r\r**** MINIMIG-DE1 ****\r\r");
  printf("Minimig by Dennis van Weeren\r");
  printf("Updates by Jakub Bednarski, Tobias Gubener, Sascha Boing, A.M. Robinson & others\r");
  printf("DE1 port by Rok Krajnc ([email protected])\r\r");
  printf("Build no. ");
  printf(__BUILD_NUM);
  //printf(" by ");
  //printf(__BUILD_USER);
  printf("\rgit commit ");
  printf(__BUILD_REV);
  printf("\rgit tag");
  printf(__BUILD_TAG);
  printf("\r\r");
  printf("For updates & code see https://github.com/rkrajnc/minimig-de1\r");
  printf("For support, see http://www.minimig.net/\r\r");

  spiclk = 100000 / (20*(read32(REG_SPI_DIV_ADR) + 2));
  printf("SPI divider: %u\r", read32(REG_SPI_DIV_ADR));
  sprintf(s, "SPI clock: %u.%uMHz", spiclk/100, spiclk%100);
  BootPrintEx(s);
  printf("%s\r", s);

  if (!MMC_Init()) FatalError(1);
  BootPrintEx("SD card found ...");
  printf("SD card found ...\r");

  if (!FindDrive()) FatalError(2);
  BootPrintEx("Drive found ...");
  printf("Drive found ...\r");

  ChangeDirectory(DIRECTORY_ROOT);

  //eject all disk
  df[0].status = 0;
  df[1].status = 0;
  df[2].status = 0;
  df[3].status = 0;
 
  BootPrintEx("Booting ...");
  printf("Booting ...\r");

  TIMER_wait(8000);
  config.kickstart.name[0]=0;
  SetConfigurationFilename(0); // Use default config
  LoadConfiguration(0);  // Use slot-based config filename

  // main loop
  while (1) {
    HandleFpga();
    HandleUI();
  }

  DEBUG_FUNC_OUT();
}