--- trunk/src/emul_parse.c 2007/10/08 16:18:27 10 +++ trunk/src/emul_parse.c 2007/10/08 16:19:23 20 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $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 $ * * Set up an emulation by parsing a config file. * @@ -228,6 +228,7 @@ static char cur_machine_serial_nr[10]; static char cur_machine_emulated_hz[10]; static char cur_machine_memory[10]; +static char cur_machine_max_random_cycles[10]; #define MAX_N_LOAD 15 #define MAX_LOAD_LEN 2000 static char *cur_machine_load[MAX_N_LOAD]; @@ -385,6 +386,7 @@ cur_machine_serial_nr[0] = '\0'; cur_machine_emulated_hz[0] = '\0'; cur_machine_memory[0] = '\0'; + cur_machine_max_random_cycles[0] = '\0'; return; } @@ -555,14 +557,11 @@ sizeof(cur_machine_old_bintrans)); m->old_bintrans_enable = parse_on_off(cur_machine_old_bintrans); - if (!m->bintrans_enable && m->old_bintrans_enable) { - fatal("cannot use old bintrans when bintrans is" - " disabled.\n"); - exit(1); - } + if (!m->bintrans_enable && m->old_bintrans_enable) + m->old_bintrans_enable = 0; /* TODO: Hm... */ - if (m->bintrans_enable) + if (m->bintrans_enable && m->arch == ARCH_MIPS) m->speed_tricks = 0; if (cur_machine_bintrans_size[0]) @@ -605,11 +604,25 @@ sizeof(cur_machine_memory)); m->physical_ram_in_mb = atoi(cur_machine_memory); + if (cur_machine_max_random_cycles[0]) { + if (m->bintrans_enable) { + fprintf(stderr, "max_random_cycles doesn't" + " work with bintrans\n"); + exit(1); + } + m->max_random_cycles_per_chunk = atoi( + cur_machine_max_random_cycles); + } + if (!cur_machine_x11_scaledown[0]) m->x11_scaledown = 1; else { m->x11_scaledown = atoi(cur_machine_x11_scaledown); if (m->x11_scaledown < 0) { + m->x11_scaleup = 0 - m->x11_scaledown; + m->x11_scaledown = 1; + } + if (m->x11_scaledown < 1) { fprintf(stderr, "Invalid scaledown value" " (%i)\n", m->x11_scaledown); exit(1); @@ -688,6 +701,7 @@ WORD("n_gfx_cards", cur_machine_n_gfx_cards); WORD("emulated_hz", cur_machine_emulated_hz); WORD("memory", cur_machine_memory); + WORD("max_random_cycles", cur_machine_max_random_cycles); WORD("start_paused", cur_machine_start_paused); if (strcmp(word, "load") == 0) {