@@ -111,6 +111,7 @@ int autorunCartridge = 0;
111
111
int atari_joyhack = 0 ;
112
112
int paddle_mode = 0 ;
113
113
int paddle_speed = 3 ;
114
+ int atarixegs_keyboard_detached = 0 ;
114
115
115
116
extern int INPUT_joy_5200_center ;
116
117
extern int INPUT_joy_5200_min ;
@@ -514,6 +515,9 @@ void retro_set_environment(retro_environment_t cb)
514
515
libretro_set_core_options (environ_cb , & option_cats_supported );
515
516
516
517
cb (RETRO_ENVIRONMENT_SET_CONTROLLER_INFO , (void * )ports );
518
+
519
+ bool no_content = true;
520
+ cb (RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME , & no_content );
517
521
}
518
522
519
523
static void update_variables (void )
@@ -525,7 +529,9 @@ static void update_variables(void)
525
529
var .value = NULL ;
526
530
527
531
/* Moved here for better consistency and when system options that require EMU reset to occur */
528
- if (HandleExtension ((char * )RPATH , "a52" ) || HandleExtension ((char * )RPATH , "A52" ))
532
+ if (strcmp (RPATH , "" ) == 0 ) // Start core with no content
533
+ autorunCartridge = 0 ;
534
+ else if (HandleExtension ((char * )RPATH , "a52" ) || HandleExtension ((char * )RPATH , "A52" ))
529
535
autorunCartridge = 1 ;
530
536
else if (HandleExtension ((char * )RPATH , "bin" ) || HandleExtension ((char * )RPATH , "BIN" )
531
537
|| HandleExtension ((char * )RPATH , "rom" ) || HandleExtension ((char * )RPATH , "ROM" ))
@@ -665,6 +671,17 @@ static void update_variables(void)
665
671
Atari800_builtin_game = FALSE;
666
672
Atari800_keyboard_detached = FALSE;
667
673
}
674
+ else if (strcmp (var .value , "XEGS" ) == 0 )
675
+ {
676
+ Atari800_machine_type = Atari800_MACHINE_XLXE ;
677
+ MEMORY_ram_size = 64 ;
678
+ Atari800_builtin_basic = TRUE;
679
+ Atari800_keyboard_leds = FALSE;
680
+ Atari800_f_keys = FALSE;
681
+ Atari800_jumper = FALSE;
682
+ Atari800_builtin_game = TRUE;
683
+ Atari800_keyboard_detached = atarixegs_keyboard_detached ;
684
+ }
668
685
669
686
if (!libretro_runloop_active || (strcmp (var .value , old_Atari800_machine_type ) != 0 ))
670
687
{
@@ -845,6 +862,21 @@ static void update_variables(void)
845
862
}
846
863
}
847
864
865
+ var .key = "atarixegs_keyboard_detached" ;
866
+ var .value = NULL ;
867
+
868
+ if (environ_cb (RETRO_ENVIRONMENT_GET_VARIABLE , & var ) && var .value )
869
+ {
870
+ if (strcmp (var .value , "attached" ) == 0 )
871
+ {
872
+ atarixegs_keyboard_detached = 0 ;
873
+ }
874
+ else if (strcmp (var .value , "detached" ) == 0 )
875
+ {
876
+ atarixegs_keyboard_detached = 1 ;
877
+ }
878
+ }
879
+
848
880
/* Digital Joystick/Paddle Sensitivity */
849
881
var .key = "pot_digital_sensitivity" ;
850
882
var .value = NULL ;
@@ -1232,54 +1264,55 @@ static void keyboard_cb(bool down, unsigned keycode,
1232
1264
1233
1265
bool retro_load_game (const struct retro_game_info * info )
1234
1266
{
1235
- const char * full_path ;
1236
- bool media_is_disk_tape = TRUE;
1237
-
1238
- (void )info ;
1239
-
1240
1267
struct retro_keyboard_callback cb = { keyboard_cb };
1268
+ environ_cb (RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK , & cb );
1241
1269
1242
- environ_cb (RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK , & cb );
1270
+ if (info != NULL ) {
1271
+ const char * full_path ;
1272
+ bool media_is_disk_tape = TRUE;
1243
1273
1244
- full_path = info -> path ;
1274
+ ( void ) info ;
1245
1275
1246
- // If it's a m3u file
1247
- if (strendswith (full_path , "M3U" ))
1248
- {
1249
- // Parse the m3u file
1250
- dc_parse_m3u (dc , full_path );
1251
-
1252
- // Some debugging
1253
- //log_cb(RETRO_LOG_INFO, "m3u file parsed, %d file(s) found\n", dc->count);
1254
- //for (unsigned i = 0; i < dc->count; i++)
1255
- //{
1256
- // fprintf(fp, "file %d: %s\n", i + 1, dc->files[i]);
1257
- // log_cb(RETRO_LOG_INFO, "file %d: %s\n", i + 1, dc->files[i]);
1258
- //}
1259
- }
1260
- else if (strendswith (full_path , "XFD" ) ||
1261
- strendswith (full_path , "ATR" ) ||
1262
- strendswith (full_path , "DCM" ) ||
1263
- strendswith (full_path , "ATX" ) ||
1264
- strendswith (full_path , "CAS" ))
1265
- {
1266
- // Add the file to disk control context
1267
- // Maybe, in a later version of retroarch, we could add disk on the fly (didn't find how to do this)
1268
- dc_add_file (dc , full_path );
1269
- }
1270
- else
1271
- media_is_disk_tape = FALSE;
1276
+ full_path = info -> path ;
1272
1277
1273
- if (media_is_disk_tape )
1274
- {
1275
- // Init first disk
1276
- dc -> index = 0 ;
1277
- dc -> eject_state = false;
1278
- log_cb (RETRO_LOG_INFO , "Disk/Cassette (%d) inserted into drive 1 : %s\n" , dc -> index + 1 , dc -> files [dc -> index ]);
1279
- strcpy (RPATH , dc -> files [0 ]);
1278
+ // If it's a m3u file
1279
+ if (strendswith (full_path , "M3U" ))
1280
+ {
1281
+ // Parse the m3u file
1282
+ dc_parse_m3u (dc , full_path );
1283
+
1284
+ // Some debugging
1285
+ //log_cb(RETRO_LOG_INFO, "m3u file parsed, %d file(s) found\n", dc->count);
1286
+ //for (unsigned i = 0; i < dc->count; i++)
1287
+ //{
1288
+ // fprintf(fp, "file %d: %s\n", i + 1, dc->files[i]);
1289
+ // log_cb(RETRO_LOG_INFO, "file %d: %s\n", i + 1, dc->files[i]);
1290
+ //}
1291
+ }
1292
+ else if (strendswith (full_path , "XFD" ) ||
1293
+ strendswith (full_path , "ATR" ) ||
1294
+ strendswith (full_path , "DCM" ) ||
1295
+ strendswith (full_path , "ATX" ) ||
1296
+ strendswith (full_path , "CAS" ))
1297
+ {
1298
+ // Add the file to disk control context
1299
+ // Maybe, in a later version of retroarch, we could add disk on the fly (didn't find how to do this)
1300
+ dc_add_file (dc , full_path );
1301
+ }
1302
+ else
1303
+ media_is_disk_tape = FALSE;
1304
+
1305
+ if (media_is_disk_tape )
1306
+ {
1307
+ // Init first disk
1308
+ dc -> index = 0 ;
1309
+ dc -> eject_state = false;
1310
+ log_cb (RETRO_LOG_INFO , "Disk/Cassette (%d) inserted into drive 1 : %s\n" , dc -> index + 1 , dc -> files [dc -> index ]);
1311
+ strcpy (RPATH , dc -> files [0 ]);
1312
+ }
1313
+ else
1314
+ strcpy (RPATH , full_path );
1280
1315
}
1281
- else
1282
- strcpy (RPATH , full_path );
1283
1316
1284
1317
update_variables ();
1285
1318
@@ -1333,10 +1366,6 @@ size_t retro_serialize_size(void)
1333
1366
size = Retro_SaveAtariState (data_ , A800_SAVE_STATE_SIZE , 1 );
1334
1367
free (data_ );
1335
1368
1336
- //FILE* fp1 = fopen("E:\\debugme.txt", "a");
1337
- //fprintf(fp1, "Estimated savestate size %i\n", size);
1338
- //fclose(fp1);
1339
-
1340
1369
return size ;
1341
1370
}
1342
1371
@@ -1346,10 +1375,6 @@ bool retro_serialize(void* data_, size_t size)
1346
1375
1347
1376
returned_size = Retro_SaveAtariState (data_ , size , 1 );
1348
1377
1349
- //FILE* fp1 = fopen("E:\\debugme.txt", "a");
1350
- //fprintf(fp1, "Actual savestate size %i\n", returned_size);
1351
- //fclose(fp1);
1352
-
1353
1378
return returned_size ;
1354
1379
}
1355
1380
@@ -1359,10 +1384,6 @@ bool retro_unserialize(const void* data_, size_t size)
1359
1384
1360
1385
returned_size = Retro_ReadAtariState (data_ , size );
1361
1386
1362
- //FILE* fp1 = fopen("E:\\debugme.txt", "a");
1363
- //fprintf(fp1, "Savestate size read in %i\nFor game %s\n", returned_size,RPATH);
1364
- //fclose(fp1);
1365
-
1366
1387
return returned_size ;
1367
1388
}
1368
1389
0 commit comments