25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: main.c,v 1.296 2007/03/31 15:11:26 debug Exp $ |
* $Id: main.c,v 1.311 2007/06/28 14:58:38 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
45 |
#include "misc.h" |
#include "misc.h" |
46 |
#include "settings.h" |
#include "settings.h" |
47 |
#include "timer.h" |
#include "timer.h" |
48 |
|
#include "useremul.h" |
|
#ifdef TEST_NATIVE_X86 |
|
|
#include "native_x86.h" |
|
|
#endif |
|
49 |
|
|
50 |
|
|
51 |
extern volatile int single_step; |
extern int single_step; |
52 |
extern int force_debugger_at_exit; |
extern int force_debugger_at_exit; |
53 |
|
|
54 |
extern int optind; |
extern int optind; |
61 |
char *progname; |
char *progname; |
62 |
|
|
63 |
size_t dyntrans_cache_size = DEFAULT_DYNTRANS_CACHE_SIZE; |
size_t dyntrans_cache_size = DEFAULT_DYNTRANS_CACHE_SIZE; |
64 |
int native_code_translation_enabled = 0; |
static int skip_srandom_call = 0; |
|
int skip_srandom_call = 0; |
|
65 |
|
|
66 |
|
|
67 |
/***************************************************************************** |
/***************************************************************************** |
196 |
*/ |
*/ |
197 |
static void usage(int longusage) |
static void usage(int longusage) |
198 |
{ |
{ |
199 |
printf("GXemul"); |
printf("GXemul "VERSION" Copyright (C) 2003-2007 Anders Gavare\n"); |
|
#ifdef VERSION |
|
|
printf(" " VERSION); |
|
|
#endif |
|
|
printf(" Copyright (C) 2003-2007 Anders Gavare\n"); |
|
200 |
printf("Read the source code and/or documentation for " |
printf("Read the source code and/or documentation for " |
201 |
"other Copyright messages.\n"); |
"other Copyright messages.\n"); |
202 |
|
|
203 |
printf("\nusage: %s [machine, other, and general options] [file " |
printf("\nusage: %s [machine, other, and general options] [file " |
204 |
"[...]]\n", progname); |
"[...]]\n", progname); |
205 |
printf(" or %s [general options] @configfile\n", progname); |
printf(" or %s [general options] @configfile\n", progname); |
|
#ifdef UNSTABLE_DEVEL |
|
206 |
printf(" or %s [userland, other, and general options] file " |
printf(" or %s [userland, other, and general options] file " |
207 |
"[args ...]\n", progname); |
"[args ...]\n", progname); |
|
#endif |
|
208 |
|
|
209 |
if (!longusage) { |
if (!longusage) { |
210 |
printf("\nRun %s -h for help on command line options.\n", |
printf("\nRun %s -h for help on command line options.\n", |
298 |
printf(" -z disp add disp as an X11 display to use for " |
printf(" -z disp add disp as an X11 display to use for " |
299 |
"framebuffers\n"); |
"framebuffers\n"); |
300 |
|
|
|
#ifdef UNSTABLE_DEVEL |
|
301 |
printf("\nUserland options:\n"); |
printf("\nUserland options:\n"); |
302 |
printf(" -u emul userland-only (syscall) emulation (use -H to" |
printf(" -u emul userland-only (syscall) emulation (use -H to" |
303 |
" get a list of\n available emulation modes)\n"); |
" get a list of\n available emulation modes)\n"); |
|
#endif |
|
304 |
|
|
305 |
printf("\nGeneral options:\n"); |
printf("\nGeneral options:\n"); |
|
#ifdef UNSTABLE_DEVEL |
|
|
printf(" -b enable native code generation\n"); |
|
|
printf(" -B disable native code generation\n"); |
|
|
#endif |
|
306 |
printf(" -c cmd add cmd as a command to run before starting " |
printf(" -c cmd add cmd as a command to run before starting " |
307 |
"the simulation\n"); |
"the simulation\n"); |
308 |
printf(" -D skip the srandom call at startup\n"); |
printf(" -D skip the srandom call at startup\n"); |
326 |
"To load a raw binary into memory, add \"address:\" in front " |
"To load a raw binary into memory, add \"address:\" in front " |
327 |
"of the filename,\n" |
"of the filename,\n" |
328 |
"or \"address:skiplen:\" or \"address:skiplen:initialpc:\".\n" |
"or \"address:skiplen:\" or \"address:skiplen:initialpc:\".\n" |
329 |
"Examples:\n" |
"\nExamples:\n" |
330 |
" 0xbfc00000:rom.bin for a raw ROM image\n" |
" 0xbfc00000:rom.bin for a raw ROM image\n" |
331 |
" 0xbfc00000:0x100:rom.bin for an image with " |
" 0xbfc00000:0x100:rom.bin for an image with " |
332 |
"0x100 bytes header\n" |
"0x100 bytes header\n" |
333 |
" 0xbfc00000:0x100:0xbfc00884:rom.bin " |
" 0xbfc00000:0x100:0xbfc00884:rom.bin " |
334 |
"start with pc=0xbfc00884\n"); |
"start with pc=0xbfc00884\n\n"); |
335 |
} |
} |
336 |
|
|
337 |
|
|
348 |
char *type = NULL, *subtype = NULL; |
char *type = NULL, *subtype = NULL; |
349 |
int n_cpus_set = 0; |
int n_cpus_set = 0; |
350 |
int msopts = 0; /* Machine-specific options used */ |
int msopts = 0; /* Machine-specific options used */ |
351 |
struct machine *m = emul_add_machine(emul, "default"); |
struct machine *m = emul_add_machine(emul, NULL); |
352 |
|
|
353 |
char *opts = |
char *opts = |
354 |
#ifdef UNSTABLE_DEVEL |
"C:c:Dd:E:e:HhI:iJj:k:KM:Nn:Oo:p:QqRrSs:TtUu:VvW:" |
|
"bB" |
|
|
#endif |
|
|
"C:c:Dd:E:e:HhI:iJj:k:KM:Nn:Oo:p:QqRrSs:TtU" |
|
|
#ifdef UNSTABLE_DEVEL |
|
|
"u:" |
|
|
#endif |
|
|
"VvW:" |
|
355 |
#ifdef WITH_X11 |
#ifdef WITH_X11 |
356 |
"XxY:" |
"XxY:" |
357 |
#endif |
#endif |
359 |
|
|
360 |
while ((ch = getopt(argc, argv, opts)) != -1) { |
while ((ch = getopt(argc, argv, opts)) != -1) { |
361 |
switch (ch) { |
switch (ch) { |
|
#ifdef UNSTABLE_DEVEL |
|
|
case 'b': |
|
|
#ifndef NATIVE_CODE_GENERATION |
|
|
printf("-b is not available on this host arch.\n"); |
|
|
exit(1); |
|
|
#else |
|
|
native_code_translation_enabled = 1; |
|
|
break; |
|
|
#endif |
|
|
case 'B': |
|
|
native_code_translation_enabled = 0; |
|
|
break; |
|
|
#endif /* UNSTABLE_DEVEL */ |
|
362 |
case 'C': |
case 'C': |
363 |
m->cpu_name = strdup(optarg); |
CHECK_ALLOCATION(m->cpu_name = strdup(optarg)); |
364 |
msopts = 1; |
msopts = 1; |
365 |
break; |
break; |
366 |
case 'c': |
case 'c': |
367 |
emul->n_debugger_cmds ++; |
emul->n_debugger_cmds ++; |
368 |
emul->debugger_cmds = realloc(emul->debugger_cmds, |
CHECK_ALLOCATION(emul->debugger_cmds = |
369 |
emul->n_debugger_cmds * sizeof(char *)); |
realloc(emul->debugger_cmds, |
370 |
if (emul->debugger_cmds == NULL) { |
emul->n_debugger_cmds * sizeof(char *))); |
371 |
fatal("out of memory\n"); |
CHECK_ALLOCATION(emul->debugger_cmds[emul-> |
372 |
exit(1); |
n_debugger_cmds-1] = strdup(optarg)); |
|
} |
|
|
emul->debugger_cmds[emul->n_debugger_cmds-1] = |
|
|
strdup(optarg); |
|
373 |
break; |
break; |
374 |
case 'D': |
case 'D': |
375 |
skip_srandom_call = 1; |
skip_srandom_call = 1; |
377 |
case 'd': |
case 'd': |
378 |
/* diskimage_add() is called further down */ |
/* diskimage_add() is called further down */ |
379 |
(*n_diskimagesp) ++; |
(*n_diskimagesp) ++; |
380 |
(*diskimagesp) = realloc(*diskimagesp, |
CHECK_ALLOCATION( (*diskimagesp) = |
381 |
sizeof(char *) * (*n_diskimagesp)); |
realloc(*diskimagesp, |
382 |
if (*diskimagesp == NULL) { |
sizeof(char *) * (*n_diskimagesp)) ); |
383 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION( (*diskimagesp)[(*n_diskimagesp) - 1] = |
384 |
exit(1); |
strdup(optarg) ); |
|
} |
|
|
(*diskimagesp)[(*n_diskimagesp) - 1] = strdup(optarg); |
|
385 |
using_switch_d = 1; |
using_switch_d = 1; |
386 |
msopts = 1; |
msopts = 1; |
387 |
break; |
break; |
420 |
msopts = 1; |
msopts = 1; |
421 |
break; |
break; |
422 |
case 'j': |
case 'j': |
423 |
m->boot_kernel_filename = strdup(optarg); |
CHECK_ALLOCATION(m->boot_kernel_filename = |
424 |
if (m->boot_kernel_filename == NULL) { |
strdup(optarg)); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
425 |
msopts = 1; |
msopts = 1; |
426 |
break; |
break; |
427 |
case 'k': |
case 'k': |
453 |
msopts = 1; |
msopts = 1; |
454 |
break; |
break; |
455 |
case 'o': |
case 'o': |
456 |
m->boot_string_argument = strdup(optarg); |
CHECK_ALLOCATION(m->boot_string_argument = |
457 |
if (m->boot_string_argument == NULL) { |
strdup(optarg)); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
458 |
msopts = 1; |
msopts = 1; |
459 |
break; |
break; |
460 |
case 'p': |
case 'p': |
461 |
if (m->n_breakpoints >= MAX_BREAKPOINTS) { |
machine_add_breakpoint_string(m, optarg); |
|
fprintf(stderr, "too many breakpoints\n"); |
|
|
exit(1); |
|
|
} |
|
|
m->breakpoint_string[m->n_breakpoints] = strdup(optarg); |
|
|
if (m->breakpoint_string[m->n_breakpoints] == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
|
m->breakpoint_flags[m->n_breakpoints] = 0; |
|
|
m->n_breakpoints ++; |
|
462 |
msopts = 1; |
msopts = 1; |
463 |
break; |
break; |
464 |
case 'Q': |
case 'Q': |
482 |
break; |
break; |
483 |
case 's': |
case 's': |
484 |
machine_statistics_init(m, optarg); |
machine_statistics_init(m, optarg); |
|
native_code_translation_enabled = 0; |
|
485 |
msopts = 1; |
msopts = 1; |
486 |
break; |
break; |
487 |
case 'T': |
case 'T': |
497 |
msopts = 1; |
msopts = 1; |
498 |
break; |
break; |
499 |
case 'u': |
case 'u': |
500 |
m->userland_emul = strdup(optarg); |
CHECK_ALLOCATION(m->userland_emul = strdup(optarg)); |
|
if (m->userland_emul == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
501 |
m->machine_type = MACHINE_USERLAND; |
m->machine_type = MACHINE_USERLAND; |
502 |
msopts = 1; |
msopts = 1; |
503 |
break; |
break; |
511 |
internal_w(optarg); |
internal_w(optarg); |
512 |
exit(0); |
exit(0); |
513 |
case 'X': |
case 'X': |
514 |
m->use_x11 = 1; |
m->x11_md.in_use = 1; |
515 |
msopts = 1; |
msopts = 1; |
516 |
/* FALL-THROUGH */ |
/* FALL-THROUGH */ |
517 |
case 'x': |
case 'x': |
518 |
console_allow_slaves(1); |
console_allow_slaves(1); |
519 |
break; |
break; |
520 |
case 'Y': |
case 'Y': |
521 |
m->x11_scaledown = atoi(optarg); |
m->x11_md.scaledown = atoi(optarg); |
522 |
if (m->x11_scaledown < -1) { |
if (m->x11_md.scaledown < -1) { |
523 |
m->x11_scaleup = - m->x11_scaledown; |
m->x11_md.scaleup = - m->x11_md.scaledown; |
524 |
m->x11_scaledown = 1; |
m->x11_md.scaledown = 1; |
525 |
} |
} |
526 |
if (m->x11_scaledown < 1) { |
if (m->x11_md.scaledown < 1) { |
527 |
fprintf(stderr, "Invalid scaledown value.\n"); |
fprintf(stderr, "Invalid scaledown value.\n"); |
528 |
exit(1); |
exit(1); |
529 |
} |
} |
535 |
msopts = 1; |
msopts = 1; |
536 |
break; |
break; |
537 |
case 'z': |
case 'z': |
538 |
m->x11_n_display_names ++; |
m->x11_md.n_display_names ++; |
539 |
m->x11_display_names = realloc( |
CHECK_ALLOCATION(m->x11_md.display_names = realloc( |
540 |
m->x11_display_names, |
m->x11_md.display_names, |
541 |
m->x11_n_display_names * sizeof(char *)); |
m->x11_md.n_display_names * sizeof(char *))); |
542 |
if (m->x11_display_names == NULL) { |
CHECK_ALLOCATION(m->x11_md.display_names[ |
543 |
fprintf(stderr, "out of memory\n"); |
m->x11_md.n_display_names-1] = strdup(optarg)); |
|
exit(1); |
|
|
} |
|
|
m->x11_display_names[m->x11_n_display_names-1] = |
|
|
strdup(optarg); |
|
|
if (m->x11_display_names |
|
|
[m->x11_n_display_names-1] == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
544 |
msopts = 1; |
msopts = 1; |
545 |
break; |
break; |
546 |
default: |
default: |
625 |
else |
else |
626 |
s2 ++; |
s2 ++; |
627 |
|
|
628 |
m->boot_kernel_filename = strdup(s2); |
CHECK_ALLOCATION(m->boot_kernel_filename = strdup(s2)); |
|
if (m->boot_kernel_filename == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
629 |
} |
} |
630 |
|
|
631 |
if (m->n_gfx_cards < 0 || m->n_gfx_cards > 3) { |
if (m->n_gfx_cards < 0 || m->n_gfx_cards > 3) { |
633 |
exit(1); |
exit(1); |
634 |
} |
} |
635 |
|
|
636 |
if (!using_switch_Z && !m->use_x11) |
if (!using_switch_Z && !m->x11_md.in_use) |
637 |
m->n_gfx_cards = 0; |
m->n_gfx_cards = 0; |
638 |
|
|
639 |
return 0; |
return 0; |
658 |
const int constant_no = 0; |
const int constant_no = 0; |
659 |
const int constant_false = 0; |
const int constant_false = 0; |
660 |
|
|
661 |
struct emul **emuls; |
struct emul *emul; |
662 |
|
int config_file = 0; |
663 |
|
|
664 |
char **diskimages = NULL; |
char **diskimages = NULL; |
665 |
int n_diskimages = 0; |
int n_diskimages = 0; |
|
int n_emuls; |
|
666 |
int i; |
int i; |
667 |
|
|
668 |
|
|
|
/* |
|
|
* Experimental profil() code, which works on my laptop. |
|
|
* Don't use it for anything else. |
|
|
*/ |
|
|
#ifdef USE_PROFIL |
|
|
uint16_t samples[0x100000]; |
|
|
memset(samples, 0, sizeof(samples)); |
|
|
profil((char *)samples, sizeof(samples), (vm_offset_t) 0x400000, 8192); |
|
|
#endif |
|
|
|
|
|
#ifndef NATIVE_CODE_GENERATION |
|
|
native_code_translation_enabled = 0; |
|
|
#endif |
|
|
|
|
|
|
|
|
/* Experimental test code: */ |
|
|
#ifdef TEST_NATIVE_X86 |
|
|
test_native_x86(); |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
669 |
progname = argv[0]; |
progname = argv[0]; |
670 |
|
|
671 |
|
|
687 |
SETTINGS_FORMAT_BOOL, (void *)&constant_false); |
SETTINGS_FORMAT_BOOL, (void *)&constant_false); |
688 |
|
|
689 |
/* Read-only settings: */ |
/* Read-only settings: */ |
|
settings_add(global_settings, "native_code_translation_enabled", 0, |
|
|
SETTINGS_TYPE_INT, SETTINGS_FORMAT_YESNO, |
|
|
(void *)&native_code_translation_enabled); |
|
690 |
settings_add(global_settings, "single_step", 0, |
settings_add(global_settings, "single_step", 0, |
691 |
SETTINGS_TYPE_INT, SETTINGS_FORMAT_YESNO, (void *)&single_step); |
SETTINGS_TYPE_INT, SETTINGS_FORMAT_YESNO, (void *)&single_step); |
692 |
|
|
707 |
timer_init(); |
timer_init(); |
708 |
useremul_init(); |
useremul_init(); |
709 |
|
|
710 |
emuls = malloc(sizeof(struct emul *)); |
/* Create a simple emulation setup: */ |
711 |
if (emuls == NULL) { |
emul = emul_new(NULL); |
712 |
fprintf(stderr, "out of memory\n"); |
settings_add(global_settings, "emul", 1, |
713 |
exit(1); |
SETTINGS_TYPE_SUBSETTINGS, 0, emul->settings); |
|
} |
|
|
|
|
|
/* Allocate space for a simple emul setup: */ |
|
|
n_emuls = 1; |
|
|
emuls[0] = emul_new(NULL, 0); |
|
|
if (emuls[0] == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
|
settings_add(global_settings, "emul[0]", 1, |
|
|
SETTINGS_TYPE_SUBSETTINGS, 0, emuls[0]->settings); |
|
714 |
|
|
715 |
get_cmd_args(argc, argv, emuls[0], &diskimages, &n_diskimages); |
get_cmd_args(argc, argv, emul, &diskimages, &n_diskimages); |
716 |
|
|
717 |
if (!skip_srandom_call) { |
if (!skip_srandom_call) { |
718 |
struct timeval tv; |
struct timeval tv; |
721 |
} |
} |
722 |
|
|
723 |
/* Print startup message: */ |
/* Print startup message: */ |
724 |
debug("GXemul"); |
debug("GXemul "VERSION" Copyright (C) 2003-2007 Anders Gavare\n" |
725 |
#ifdef VERSION |
"Read the source code and/or documentation for other Copyright " |
726 |
debug(" " VERSION); |
"messages.\n\n"); |
|
#endif |
|
|
debug(" Copyright (C) 2003-2007 Anders Gavare\n"); |
|
|
debug("Read the source code and/or documentation for " |
|
|
"other Copyright messages.\n\n"); |
|
|
|
|
|
if (emuls[0]->machines[0]->machine_type == MACHINE_NONE) { |
|
|
n_emuls --; |
|
|
} else { |
|
|
for (i=0; i<n_diskimages; i++) |
|
|
diskimage_add(emuls[0]->machines[0], diskimages[i]); |
|
|
} |
|
727 |
|
|
728 |
/* Simple initialization, from command line arguments: */ |
/* Simple initialization, from command line arguments: */ |
729 |
if (n_emuls > 0) { |
if (emul->machines[0]->machine_type != MACHINE_NONE) { |
730 |
|
for (i=0; i<n_diskimages; i++) |
731 |
|
diskimage_add(emul->machines[0], diskimages[i]); |
732 |
|
|
733 |
/* Make sure that there are no configuration files as well: */ |
/* Make sure that there are no configuration files as well: */ |
734 |
for (i=1; i<argc; i++) |
for (i=1; i<argc; i++) |
735 |
if (argv[i][0] == '@') { |
if (argv[i][0] == '@') { |
742 |
} |
} |
743 |
|
|
744 |
/* Initialize one emul: */ |
/* Initialize one emul: */ |
745 |
emul_simple_init(emuls[0]); |
emul_simple_init(emul); |
746 |
} |
} |
747 |
|
|
748 |
/* Initialize emulations from config files: */ |
/* Initialize an emulation from a config file: */ |
749 |
for (i=1; i<argc; i++) { |
for (i=1; i<argc; i++) { |
750 |
if (argv[i][0] == '@') { |
if (argv[i][0] == '@') { |
|
char tmpstr[50]; |
|
751 |
char *s = argv[i] + 1; |
char *s = argv[i] + 1; |
752 |
if (strlen(s) == 0 && i+1 < argc && |
|
753 |
argv[i+1][0] != '@') { |
if (config_file) { |
754 |
i++; |
fprintf(stderr, "More than one configuration " |
755 |
s = argv[i]; |
"file cannot be used.\n"); |
|
} |
|
|
n_emuls ++; |
|
|
emuls = realloc(emuls, sizeof(struct emul *) * n_emuls); |
|
|
if (emuls == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
756 |
exit(1); |
exit(1); |
757 |
} |
} |
758 |
|
|
759 |
/* Always allow slave xterms when using multiple |
if (strlen(s) == 0 && i+1 < argc && *argv[i+1] != '@') |
760 |
emulations: */ |
s = argv[++i]; |
761 |
|
|
762 |
|
/* Always allow slave xterms: */ |
763 |
console_allow_slaves(1); |
console_allow_slaves(1); |
764 |
|
|
765 |
/* Destroy the temporary emuls[0], since it will |
/* Destroy the temporary emul, since it will |
766 |
be overwritten: */ |
be overwritten: */ |
767 |
if (n_emuls == 1) { |
if (emul != NULL) { |
768 |
emul_destroy(emuls[0]); |
emul_destroy(emul); |
769 |
settings_remove(global_settings, "emul[0]"); |
settings_remove(global_settings, "emul"); |
770 |
|
emul = NULL; |
771 |
} |
} |
772 |
|
|
773 |
emuls[n_emuls - 1] = |
emul = emul_create_from_configfile(s); |
774 |
emul_create_from_configfile(s, n_emuls - 1); |
|
775 |
|
settings_add(global_settings, "emul", 1, |
776 |
|
SETTINGS_TYPE_SUBSETTINGS, 0, emul->settings); |
777 |
|
|
778 |
snprintf(tmpstr, sizeof(tmpstr), "emul[%i]", n_emuls-1); |
config_file = 1; |
|
settings_add(global_settings, tmpstr, 1, |
|
|
SETTINGS_TYPE_SUBSETTINGS, 0, |
|
|
emuls[n_emuls-1]->settings); |
|
779 |
} |
} |
780 |
} |
} |
781 |
|
|
782 |
if (n_emuls == 0) { |
if (emul->n_machines == 0) { |
783 |
fprintf(stderr, "No emulations defined. Maybe you forgot to " |
fprintf(stderr, "No emulations defined. Maybe you forgot to " |
784 |
"use -E xx and/or -e yy, to specify\nthe machine type." |
"use -E xx and/or -e yy, to specify\nthe machine type." |
785 |
" For example:\n\n %s -e 3max -d disk.img\n\n" |
" For example:\n\n %s -e 3max -d disk.img\n\n" |
792 |
console_warn_if_slaves_are_needed(1); |
console_warn_if_slaves_are_needed(1); |
793 |
|
|
794 |
|
|
795 |
/* Run all emulations: */ |
/* Run the emulation: */ |
796 |
emul_run(emuls, n_emuls); |
emul_run(emul); |
797 |
|
|
798 |
|
|
799 |
/* |
/* |
802 |
|
|
803 |
console_deinit(); |
console_deinit(); |
804 |
|
|
805 |
for (i=0; i<n_emuls; i++) |
emul_destroy(emul); |
|
emul_destroy(emuls[i]); |
|
806 |
|
|
807 |
settings_remove_all(global_settings); |
settings_remove_all(global_settings); |
808 |
settings_destroy(global_settings); |
settings_destroy(global_settings); |
809 |
|
|
|
#ifdef USE_PROFIL |
|
|
{ |
|
|
int i; |
|
|
FILE *f = fopen("output.txt", "w"); |
|
|
for (i=0; i<sizeof(samples) / sizeof(uint16_t); ++i) { |
|
|
if (samples[i] != 0) |
|
|
fprintf(f, "%i %p\n", samples[i], |
|
|
(void *) (size_t) (0x400000 + i * 16)); |
|
|
} |
|
|
} |
|
|
#endif |
|
|
|
|
810 |
return 0; |
return 0; |
811 |
} |
} |
812 |
|
|