147
147
#endif
148
148
#if defined(__LIBRETRO__ )
149
149
extern const char * retro_system_directory ;
150
+ extern int legacy_configuration_file ;
150
151
#endif /* __LIBRETRO__ */
151
152
152
153
int Atari800_machine_type = Atari800_MACHINE_XLXE ;
@@ -308,7 +309,7 @@ static int load_roms(void)
308
309
int basic_ver , xegame_ver ;
309
310
SYSROM_ChooseROMs (Atari800_machine_type , MEMORY_ram_size , Atari800_tv_mode , & Atari800_os_version , & basic_ver , & xegame_ver );
310
311
if (Atari800_os_version == -1
311
- || !Atari800_LoadImage ( SYSROM_roms [ Atari800_os_version ]. filename , MEMORY_os , SYSROM_roms [ Atari800_os_version ]. size )) {
312
+ || !SYSROM_LoadImage ( Atari800_os_version , MEMORY_os )) {
312
313
/* Missing OS ROM. */
313
314
Atari800_os_version = -1 ;
314
315
if (Atari800_machine_type != Atari800_MACHINE_5200 && emuos_mode == 1 )
@@ -319,15 +320,15 @@ static int load_roms(void)
319
320
}
320
321
else if (Atari800_machine_type != Atari800_MACHINE_5200 ) {
321
322
/* OS ROM found, try loading BASIC. */
322
- MEMORY_have_basic = basic_ver != -1 && Atari800_LoadImage ( SYSROM_roms [ basic_ver ]. filename , MEMORY_basic , SYSROM_roms [ basic_ver ]. size );
323
+ MEMORY_have_basic = basic_ver != -1 && SYSROM_LoadImage ( basic_ver , MEMORY_basic );
323
324
if (!MEMORY_have_basic )
324
325
/* Missing BASIC ROM. Don't fail when it happens. */
325
326
Atari800_builtin_basic = FALSE;
326
327
327
328
if (Atari800_builtin_game ) {
328
329
/* Try loading built-in XEGS game. */
329
330
if (xegame_ver == -1
330
- || !Atari800_LoadImage ( SYSROM_roms [ xegame_ver ]. filename , MEMORY_xegame , SYSROM_roms [ xegame_ver ]. size ))
331
+ || !SYSROM_LoadImage ( xegame_ver , MEMORY_xegame ))
331
332
/* Missing XEGS game ROM. */
332
333
Atari800_builtin_game = FALSE;
333
334
}
@@ -427,18 +428,25 @@ int Atari800_Initialise(int *argc, char *argv[])
427
428
}
428
429
* argc = j ;
429
430
}
431
+
430
432
//LIBRETRO HACK
431
- //#ifndef ANDROID
432
- #if !defined(ANDROID ) || defined(__LIBRETRO__ )
433
+ #if !defined(ANDROID ) || defined(__LIBRETRO__ )
434
+ #if defined(__LIBRETRO__ )
435
+ if (legacy_configuration_file )
436
+ got_config = CFG_LoadConfig (rtconfig_filename );
437
+ else
438
+ got_config = FALSE;
439
+ #else
433
440
got_config = CFG_LoadConfig (rtconfig_filename );
441
+ #endif // __LIBRETRO__
434
442
#else
435
443
got_config = TRUE; /* pretend we got a config file -- not needed in Android */
436
444
#endif
437
-
445
+ //LIBRETRO HACK
438
446
/* try to find ROM images if the configuration file is not found
439
447
or it does not specify some ROM paths (blank paths count as specified) */
440
- //LIBRETRO HACK
441
- //#ifndef ANDROID
448
+
449
+
442
450
#if !defined(ANDROID ) || defined(__LIBRETRO__ )
443
451
#if defined(__LIBRETRO__ )
444
452
SYSROM_FindInDir (retro_system_directory , TRUE);
@@ -476,7 +484,11 @@ SYSROM_FindInDir("fs:/vol/external01/retroarch/cores/system/atari800", TRUE);
476
484
SYSROM_SetDefaults ();
477
485
478
486
/* if no configuration file read, try to save one with the defaults */
487
+ #if defined(__LIBRETRO__ )
488
+ if (!got_config && legacy_configuration_file )
489
+ #else
479
490
if (!got_config )
491
+ #endif /* __LIBRETRO__*/
480
492
CFG_WriteConfig ();
481
493
482
494
#endif /* __PLUS */
@@ -974,7 +986,11 @@ int Atari800_Exit(int run_monitor)
974
986
if (!restart ) {
975
987
/* We'd better save the configuration before calling the *_Exit() functions -
976
988
there's a danger that they might change some emulator settings. */
989
+ #if defined(__LIBRETRO__ )
990
+ if (CFG_save_on_exit && legacy_configuration_file )
991
+ #else
977
992
if (CFG_save_on_exit )
993
+ #endif
978
994
CFG_WriteConfig ();
979
995
980
996
/* Cleanup functions, in reverse order as the init functions in
0 commit comments