if (full) {
fprintf(f, "\nOptions:\n"
"\t [file] -- ram image to load initially\n"
- "\t -v -- verbose execution tracing\n"
+ "\t -v -- displays slightly more information\n"
"\t -h -- this screen\n");
fprintf(f, "\n%78s\n", src_id_);
COMMAND_IMPL(quit) {
(void)vm, (void)arg_count, (void)arg_vector;
- VERBOSE_PRINTF("done\n");
+
return -1;
}
COMMAND_HELP(quit) {
}
while (count--) {
- VERBOSE_PRINTF("executing next cycle, instruction: ");
- dcpu16_disassemble_print(vm, vm->pc), printf("\n");
-
+ dcpu16_disassemble_print(vm, vm->pc);
+ printf("\n");
dcpu16_step(vm);
- if (opt_.verbose)
+ if (count > 1 && opt_.verbose)
dcpu16_state_print(vm);
}
while(running_) {
dcpu16_step(vm);
- if (opt_.verbose)
+ if (opt_.verbose > 1)
dcpu16_state_print(vm);
+ else if (opt_.verbose) {
+ dcpu16_disassemble_print(vm, vm->pc);
+ printf("\n");
+ }
}
/* restore the old interrupt signal handler */
return -1;
}
- VERBOSE_PRINTF("interrupted...\n");
+ printf("interrupted...\n");
return 0;
}
fprintf(f, "\trun\n");
if (summary) return;
- fprintf(f, "Begins executing continuously.\n");
+ fprintf(f, "Begins executing continuously.\n"
+ "May be interrupted with SIGINT.\n");
}
/* gather all these together into a searchable table */
fprintf(f, "\thelp [command]\n");
if (summary) return;
- fprintf(f, "Displays a list of available commands, or help on a specific command.\n");
+ fprintf(f, "Displays a list of available commands, or detailed help on a specific command.\n");
}
argv += optind;
if ((vm = dcpu16_new()) == NULL) {
- fprintf(stderr, "could not allocate new dcpu instance\n");
+ fprintf(stderr, "could not allocate new dcpu16 instance\n");
exit(EX_UNAVAILABLE);
}