comparison blastem.c @ 1201:aee2177a1630

Use filename for game title in SMS mode
author Michael Pavone <pavone@retrodev.com>
date Wed, 25 Jan 2017 09:41:12 -0800
parents f99650ff8e97
children a477cc22a960
comparison
equal deleted inserted replaced
1200:9661b30bd3f7 1201:aee2177a1630
267 } 267 }
268 lock_on.size = load_rom(argv[i], &lock_on.buffer, NULL); 268 lock_on.size = load_rom(argv[i], &lock_on.buffer, NULL);
269 if (!lock_on.size) { 269 if (!lock_on.size) {
270 fatal_error("Failed to load lock on cartridge %s\n", argv[i]); 270 fatal_error("Failed to load lock on cartridge %s\n", argv[i]);
271 } 271 }
272 lock_on.name = basename_no_extension(argv[i]);
272 lock_on.extension = path_extension(argv[i]); 273 lock_on.extension = path_extension(argv[i]);
273 cart.chain = &lock_on; 274 cart.chain = &lock_on;
274 break; 275 break;
275 } 276 }
276 case 'h': 277 case 'h':
299 } 300 }
300 } else if (!loaded) { 301 } else if (!loaded) {
301 if (!(cart.size = load_rom(argv[i], &cart.buffer, stype == SYSTEM_UNKNOWN ? &stype : NULL))) { 302 if (!(cart.size = load_rom(argv[i], &cart.buffer, stype == SYSTEM_UNKNOWN ? &stype : NULL))) {
302 fatal_error("Failed to open %s for reading\n", argv[i]); 303 fatal_error("Failed to open %s for reading\n", argv[i]);
303 } 304 }
305 cart.name = basename_no_extension(argv[i]);
304 cart.extension = path_extension(argv[i]); 306 cart.extension = path_extension(argv[i]);
305 romfname = argv[i]; 307 romfname = argv[i];
306 loaded = 1; 308 loaded = 1;
307 } else if (width < 0) { 309 } else if (width < 0) {
308 width = atoi(argv[i]); 310 width = atoi(argv[i]);
332 cart.size = rom_size; 334 cart.size = rom_size;
333 } 335 }
334 } 336 }
335 //force system detection, value on command line is only for games not the menu 337 //force system detection, value on command line is only for games not the menu
336 stype = detect_system_type(&cart); 338 stype = detect_system_type(&cart);
339 cart.name = basename_no_extension(romfname);
337 cart.extension = path_extension(romfname); 340 cart.extension = path_extension(romfname);
338
339 loaded = 1; 341 loaded = 1;
340 } 342 }
341 343
342 int def_width = 0; 344 int def_width = 0;
343 char *config_width = tern_find_path(config, "video\0width\0").ptrval; 345 char *config_width = tern_find_path(config, "video\0width\0").ptrval;
397 current_system->arena = start_new_arena(); 399 current_system->arena = start_new_arena();
398 } 400 }
399 if (!(cart.size = load_rom(menu_context->next_rom, &cart.buffer, &stype))) { 401 if (!(cart.size = load_rom(menu_context->next_rom, &cart.buffer, &stype))) {
400 fatal_error("Failed to open %s for reading\n", menu_context->next_rom); 402 fatal_error("Failed to open %s for reading\n", menu_context->next_rom);
401 } 403 }
404 cart.name = basename_no_extension(menu_context->next_rom);
402 cart.extension = path_extension(menu_context->next_rom); 405 cart.extension = path_extension(menu_context->next_rom);
403 stype = force_stype; 406 stype = force_stype;
404 if (stype == SYSTEM_UNKNOWN) { 407 if (stype == SYSTEM_UNKNOWN) {
405 stype = detect_system_type(&cart); 408 stype = detect_system_type(&cart);
406 } 409 }