--- trunk/src/machine.c 2007/10/08 16:19:37 22 +++ trunk/src/machine.c 2007/10/08 16:19:56 24 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: machine.c,v 1.664 2006/02/05 10:26:35 debug Exp $ + * $Id: machine.c,v 1.671 2006/06/16 18:31:24 debug Exp $ */ #include @@ -90,10 +90,6 @@ m->serial_nr = 1; m->machine_type = MACHINE_NONE; m->machine_subtype = MACHINE_NONE; -#ifdef BINTRANS - m->bintrans_enable = 1; - m->old_bintrans_enable = 1; -#endif m->arch_pagesize = 4096; /* Should be overriden in emul.c for other pagesizes. */ m->dyntrans_alignment_check = 1; @@ -108,7 +104,6 @@ m->n_gfx_cards = 1; m->dbe_on_nonexistant_memaccess = 1; m->show_symbolic_register_names = 1; - m->bintrans_size = DEFAULT_BINTRANS_SIZE_IN_MB * 1048576; symbol_init(&m->symbol_context); return m; @@ -219,9 +214,15 @@ * * Adds a tick function (a function called every now and then, depending on * clock cycle count) to a machine. + * + * If tickshift is non-zero, a tick will occur every (1 << tickshift) cycles. + * This is used for the normal (fast dyntrans) emulation modes. + * + * If tickshift is zero, then this is a cycle-accurate tick function. + * The hz value is used in this case. */ void machine_add_tickfunction(struct machine *machine, void (*func) - (struct cpu *, void *), void *extra, int clockshift) + (struct cpu *, void *), void *extra, int tickshift, double hz) { int n = machine->n_tick_entries; @@ -231,17 +232,25 @@ exit(1); } - /* Don't use too low clockshifts, that would be too inefficient - with bintrans. */ - if (clockshift < N_SAFE_BINTRANS_LIMIT_SHIFT) - fatal("WARNING! clockshift = %i, less than " - "N_SAFE_BINTRANS_LIMIT_SHIFT (%i)\n", - clockshift, N_SAFE_BINTRANS_LIMIT_SHIFT); + if (!machine->cycle_accurate) { + /* + * The dyntrans subsystem wants to run code in relatively + * large chunks without checking for external interrupts, + * so we cannot allow too low tickshifts: + */ + if (tickshift < N_SAFE_DYNTRANS_LIMIT_SHIFT) { + fatal("ERROR! tickshift = %i, less than " + "N_SAFE_DYNTRANS_LIMIT_SHIFT (%i)\n", + tickshift, N_SAFE_DYNTRANS_LIMIT_SHIFT); + exit(1); + } + } machine->ticks_till_next[n] = 0; - machine->ticks_reset_value[n] = 1 << clockshift; + machine->ticks_reset_value[n] = 1 << tickshift; machine->tick_func[n] = func; machine->tick_extra[n] = extra; + machine->tick_hz[n] = hz; machine->n_tick_entries ++; } @@ -323,18 +332,6 @@ debug(", dbe_on_nonexistant_memaccess"); debug("\n"); - if (m->single_step_on_bad_addr) - debug("single-step on bad addresses\n"); - - if (m->arch == ARCH_MIPS) { - if (m->bintrans_enable) - debug("bintrans enabled (%i MB cache)\n", - (int) (m->bintrans_size / 1048576)); - else - debug("bintrans disabled, other speedtricks %s\n", - m->speed_tricks? "enabled" : "disabled"); - } - debug("clock: "); if (m->automatic_clock_adjustment) debug("adjusted automatically"); @@ -1075,11 +1072,13 @@ "that actually work. Use the alias\nwhen selecting a machine type " "or subtype, not the real name.\n"); +#ifdef UNSTABLE_DEVEL debug("\n"); useremul_list_emuls(); debug("Userland emulation works for programs with the complexity" " of Hello World,\nbut not much more.\n"); +#endif }