diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-11-14 09:49:39 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-11-14 09:49:39 -0800 |
commit | 2e22886d47388740a5a75e5702dd63402338bb5e (patch) | |
tree | 70364259c121c2095ce13de1d18ad50ec6445c4c /blastem.c | |
parent | 62fdcbc92ba3c4a71742293d75d853c95eb5f3c7 (diff) |
Allow menu ROM to be debugged
Diffstat (limited to 'blastem.c')
-rw-r--r-- | blastem.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -969,6 +969,7 @@ int main(int argc, char ** argv) int rom_size; uint8_t * debuggerfun = NULL; uint8_t fullscreen = FULLSCREEN_DEFAULT, use_gl = 1; + uint8_t debug_target = 0; for (int i = 1; i < argc; i++) { if (argv[i][0] == '-') { switch(argv[i][1]) { @@ -982,6 +983,10 @@ int main(int argc, char ** argv) break; case 'd': debuggerfun = (uint8_t *)debugger; + //allow debugging the menu + if (argv[i][2] == 'm') { + debug_target = 1; + } break; case 'D': gdb_remote_init(); @@ -1141,7 +1146,7 @@ int main(int argc, char ** argv) } set_keybindings(genesis->ports); - start_genesis(genesis, menu ? NULL : statefile, menu ? NULL : debuggerfun); + start_genesis(genesis, menu ? NULL : statefile, menu == debug_target ? debuggerfun : NULL); for(;;) { if (menu && menu_context->next_rom) { @@ -1193,7 +1198,7 @@ int main(int argc, char ** argv) genesis = game_context; genesis->m68k->options->address_log = address_log; map_all_bindings(genesis->ports); - start_genesis(genesis, statefile, debuggerfun); + start_genesis(genesis, statefile, menu == debug_target ? debuggerfun : NULL); } else if (menu && game_context) { genesis->arena = set_current_arena(game_context->arena); |