Mercurial > repos > blastem
comparison blastem.c @ 1507:2455662378ed mame_interp
Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 30 Dec 2017 18:27:06 -0800 |
parents | 4929325c3ce0 |
children | b7ecd0d6a77b |
comparison
equal
deleted
inserted
replaced
1506:ded16f3d7eb4 | 1507:2455662378ed |
---|---|
9 #include <ctype.h> | 9 #include <ctype.h> |
10 | 10 |
11 #include "system.h" | 11 #include "system.h" |
12 #include "68kinst.h" | 12 #include "68kinst.h" |
13 #include "m68k_core.h" | 13 #include "m68k_core.h" |
14 #ifdef USE_NATIVE | |
14 #include "z80_to_x86.h" | 15 #include "z80_to_x86.h" |
16 #else | |
17 #include "mame_z80/z80.h" | |
18 #endif | |
15 #include "mem.h" | 19 #include "mem.h" |
16 #include "vdp.h" | 20 #include "vdp.h" |
17 #include "render.h" | 21 #include "render.h" |
18 #include "genesis.h" | 22 #include "genesis.h" |
19 #include "gdb_remote.h" | 23 #include "gdb_remote.h" |
267 //allow debugging the menu | 271 //allow debugging the menu |
268 if (argv[i][2] == 'm') { | 272 if (argv[i][2] == 'm') { |
269 debug_target = 1; | 273 debug_target = 1; |
270 } | 274 } |
271 break; | 275 break; |
276 #ifdef USE_NATIVE | |
272 case 'D': | 277 case 'D': |
273 gdb_remote_init(); | 278 gdb_remote_init(); |
274 dtype = DEBUGGER_GDB; | 279 dtype = DEBUGGER_GDB; |
275 start_in_debugger = 1; | 280 start_in_debugger = 1; |
276 break; | 281 break; |
282 #endif | |
277 case 'f': | 283 case 'f': |
278 fullscreen = !fullscreen; | 284 fullscreen = !fullscreen; |
279 break; | 285 break; |
280 case 'g': | 286 case 'g': |
281 use_gl = 0; | 287 use_gl = 0; |
474 if (current_system->next_rom) { | 480 if (current_system->next_rom) { |
475 char *next_rom = current_system->next_rom; | 481 char *next_rom = current_system->next_rom; |
476 current_system->next_rom = NULL; | 482 current_system->next_rom = NULL; |
477 if (game_system) { | 483 if (game_system) { |
478 game_system->persist_save(game_system); | 484 game_system->persist_save(game_system); |
485 #ifdef USE_NATIVE | |
479 //swap to game context arena and mark all allocated pages in it free | 486 //swap to game context arena and mark all allocated pages in it free |
480 if (menu) { | 487 if (menu) { |
481 current_system->arena = set_current_arena(game_system->arena); | 488 current_system->arena = set_current_arena(game_system->arena); |
482 } | 489 } |
483 mark_all_free(); | 490 mark_all_free(); |
491 #endif | |
484 game_system->free_context(game_system); | 492 game_system->free_context(game_system); |
485 } else { | 493 } else { |
494 #ifdef USE_NATIVE | |
486 //start a new arena and save old one in suspended genesis context | 495 //start a new arena and save old one in suspended genesis context |
487 current_system->arena = start_new_arena(); | 496 current_system->arena = start_new_arena(); |
497 #endif | |
488 } | 498 } |
489 if (!(cart.size = load_rom(next_rom, &cart.buffer, &stype))) { | 499 if (!(cart.size = load_rom(next_rom, &cart.buffer, &stype))) { |
490 fatal_error("Failed to open %s for reading\n", next_rom); | 500 fatal_error("Failed to open %s for reading\n", next_rom); |
491 } | 501 } |
492 free(cart.dir); | 502 free(cart.dir); |
518 current_system = game_system; | 528 current_system = game_system; |
519 current_system->debugger_type = dtype; | 529 current_system->debugger_type = dtype; |
520 current_system->enter_debugger = start_in_debugger && menu == debug_target; | 530 current_system->enter_debugger = start_in_debugger && menu == debug_target; |
521 current_system->start_context(current_system, statefile); | 531 current_system->start_context(current_system, statefile); |
522 } else if (menu && game_system) { | 532 } else if (menu && game_system) { |
533 #ifdef USE_NATIVE | |
523 current_system->arena = set_current_arena(game_system->arena); | 534 current_system->arena = set_current_arena(game_system->arena); |
535 #endif | |
524 current_system = game_system; | 536 current_system = game_system; |
525 menu = 0; | 537 menu = 0; |
526 current_system->resume_context(current_system); | 538 current_system->resume_context(current_system); |
527 } else if (!menu && menu_system) { | 539 } else if (!menu && menu_system) { |
540 #ifdef USE_NATIVE | |
528 current_system->arena = set_current_arena(menu_system->arena); | 541 current_system->arena = set_current_arena(menu_system->arena); |
542 #endif | |
529 current_system = menu_system; | 543 current_system = menu_system; |
530 menu = 1; | 544 menu = 1; |
531 current_system->resume_context(current_system); | 545 current_system->resume_context(current_system); |
532 } else { | 546 } else { |
533 break; | 547 break; |