25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: emul_parse.c,v 1.32 2005/06/24 09:33:34 debug Exp $ |
* $Id: emul_parse.c,v 1.35 2005/11/06 21:15:55 debug Exp $ |
29 |
* |
* |
30 |
* Set up an emulation by parsing a config file. |
* Set up an emulation by parsing a config file. |
31 |
* |
* |
228 |
static char cur_machine_serial_nr[10]; |
static char cur_machine_serial_nr[10]; |
229 |
static char cur_machine_emulated_hz[10]; |
static char cur_machine_emulated_hz[10]; |
230 |
static char cur_machine_memory[10]; |
static char cur_machine_memory[10]; |
231 |
|
static char cur_machine_max_random_cycles[10]; |
232 |
#define MAX_N_LOAD 15 |
#define MAX_N_LOAD 15 |
233 |
#define MAX_LOAD_LEN 2000 |
#define MAX_LOAD_LEN 2000 |
234 |
static char *cur_machine_load[MAX_N_LOAD]; |
static char *cur_machine_load[MAX_N_LOAD]; |
386 |
cur_machine_serial_nr[0] = '\0'; |
cur_machine_serial_nr[0] = '\0'; |
387 |
cur_machine_emulated_hz[0] = '\0'; |
cur_machine_emulated_hz[0] = '\0'; |
388 |
cur_machine_memory[0] = '\0'; |
cur_machine_memory[0] = '\0'; |
389 |
|
cur_machine_max_random_cycles[0] = '\0'; |
390 |
return; |
return; |
391 |
} |
} |
392 |
|
|
557 |
sizeof(cur_machine_old_bintrans)); |
sizeof(cur_machine_old_bintrans)); |
558 |
m->old_bintrans_enable = parse_on_off(cur_machine_old_bintrans); |
m->old_bintrans_enable = parse_on_off(cur_machine_old_bintrans); |
559 |
|
|
560 |
if (!m->bintrans_enable && m->old_bintrans_enable) { |
if (!m->bintrans_enable && m->old_bintrans_enable) |
561 |
fatal("cannot use old bintrans when bintrans is" |
m->old_bintrans_enable = 0; |
|
" disabled.\n"); |
|
|
exit(1); |
|
|
} |
|
562 |
|
|
563 |
/* TODO: Hm... */ |
/* TODO: Hm... */ |
564 |
if (m->bintrans_enable) |
if (m->bintrans_enable && m->arch == ARCH_MIPS) |
565 |
m->speed_tricks = 0; |
m->speed_tricks = 0; |
566 |
|
|
567 |
if (cur_machine_bintrans_size[0]) |
if (cur_machine_bintrans_size[0]) |
604 |
sizeof(cur_machine_memory)); |
sizeof(cur_machine_memory)); |
605 |
m->physical_ram_in_mb = atoi(cur_machine_memory); |
m->physical_ram_in_mb = atoi(cur_machine_memory); |
606 |
|
|
607 |
|
if (cur_machine_max_random_cycles[0]) { |
608 |
|
if (m->bintrans_enable) { |
609 |
|
fprintf(stderr, "max_random_cycles doesn't" |
610 |
|
" work with bintrans\n"); |
611 |
|
exit(1); |
612 |
|
} |
613 |
|
m->max_random_cycles_per_chunk = atoi( |
614 |
|
cur_machine_max_random_cycles); |
615 |
|
} |
616 |
|
|
617 |
if (!cur_machine_x11_scaledown[0]) |
if (!cur_machine_x11_scaledown[0]) |
618 |
m->x11_scaledown = 1; |
m->x11_scaledown = 1; |
619 |
else { |
else { |
620 |
m->x11_scaledown = atoi(cur_machine_x11_scaledown); |
m->x11_scaledown = atoi(cur_machine_x11_scaledown); |
621 |
if (m->x11_scaledown < 0) { |
if (m->x11_scaledown < 0) { |
622 |
|
m->x11_scaleup = 0 - m->x11_scaledown; |
623 |
|
m->x11_scaledown = 1; |
624 |
|
} |
625 |
|
if (m->x11_scaledown < 1) { |
626 |
fprintf(stderr, "Invalid scaledown value" |
fprintf(stderr, "Invalid scaledown value" |
627 |
" (%i)\n", m->x11_scaledown); |
" (%i)\n", m->x11_scaledown); |
628 |
exit(1); |
exit(1); |
701 |
WORD("n_gfx_cards", cur_machine_n_gfx_cards); |
WORD("n_gfx_cards", cur_machine_n_gfx_cards); |
702 |
WORD("emulated_hz", cur_machine_emulated_hz); |
WORD("emulated_hz", cur_machine_emulated_hz); |
703 |
WORD("memory", cur_machine_memory); |
WORD("memory", cur_machine_memory); |
704 |
|
WORD("max_random_cycles", cur_machine_max_random_cycles); |
705 |
WORD("start_paused", cur_machine_start_paused); |
WORD("start_paused", cur_machine_start_paused); |
706 |
|
|
707 |
if (strcmp(word, "load") == 0) { |
if (strcmp(word, "load") == 0) { |