void c_addr_label (int labelled) { if (labelled || return_target || (get_bitpos () == 0x1c)) { cout ("\tcase (0x%x):\n", get_bitpos ()); } cln ("#ifdef M68K_DEBUG"); cln (" line_no = %d;", line_no); #ifdef DUMP_LOADS_OF_CRAP cln (" DumpRegsChanged ();"); #endif /* DUMP_LOADS_OF_CRAP */ cln ("#endif"); }
void c_func_jsr (ea_t *dest) { char buf[256]; if (gen_mode != GEN_CALL) return; snprintf (buf, sizeof (buf), "%x", get_bitpos ()); add_label (buf, C_ADDR, get_bitpos () - BASE); add_fixup (0, C_ADDR, buf); snprintf (buf, sizeof (buf), "__D%x", get_bitpos ()); cln ("Regs[15]._s32 -= 4;"); cln ("wrlong (Regs[15]._s32, %s);", buf); c_jump (dest); }
static void make_funcname (char *buf, int len) { snprintf (buf, len, "__F%x", get_bitpos ()); }
int main(int argc, char *argv[]) { struct sigaction sigact; struct hardware hw; int ch, min, res; bool raw = false, verbose = true; while ((ch = getopt(argc, argv, "qr")) != -1) { switch (ch) { case 'q' : verbose = false; break; case 'r' : raw = true; break; default: printf("usage: %s [-qr]\n", argv[0]); return EX_USAGE; } } res = read_config_file(ETCDIR"/config.txt"); if (res != 0) { cleanup(); return res; } res = set_mode_live(); if (res != 0) { cleanup(); return res; } hw = get_hardware_parameters(); sigact.sa_handler = do_cleanup; sigemptyset(&sigact.sa_mask); sigact.sa_flags = 0; sigaction(SIGINT, &sigact, (struct sigaction *)NULL); min = -1; for (;;) { struct bitinfo bi; struct GB_result bit; if (raw) { struct timespec slp; slp.tv_sec = 1.0 / hw.freq; slp.tv_nsec = 1e9 / hw.freq; printf("%i", get_pulse()); fflush(stdout); while (nanosleep(&slp, &slp)) ; continue; } bit = get_bit_live(); bi = get_bitinfo(); if (verbose) { if (bi.freq_reset) printf("!"); /* display first bi->t pulses */ for (unsigned long long i = 0; i < bi.t / 8; i++) for (unsigned j = 0; j < 8; j++) printf("%c", (bi.signal[i] & (1 << j)) > 0 ? '+' : '-'); /* * display pulses in the last partially filled item * bi.t is 0-based, hence the <= comparison */ for (unsigned j = 0; j <= (bi.t & 7); j++) printf("%c", (bi.signal[bi.t / 8] & (1 << j)) > 0 ? '+' : '-'); printf("\n"); } if (bit.marker == emark_toolong || bit.marker == emark_late) min++; printf("%i %i %u %llu %llu %llu %i:%i\n", bi.tlow, bi.tlast0, bi.t, bi.bit0, bi.bit20, bi.realfreq, min, get_bitpos()); if (bit.marker == emark_minute) min++; bit = next_bit(); } /* NOTREACHED */ }