comparison blastem.c @ 197:7c227a8ec53d

Add instruction address logging to translator and support for reading an address log to the disassembler
author Mike Pavone <pavone@retrodev.com>
date Thu, 17 Jan 2013 20:00:07 -0800
parents c615061f7914
children 209a37eed3e7
comparison
equal deleted inserted replaced
196:f8955d33486d 197:7c227a8ec53d
801 return 1; 801 return 1;
802 } 802 }
803 int width = -1; 803 int width = -1;
804 int height = -1; 804 int height = -1;
805 int debug = 0; 805 int debug = 0;
806 FILE *address_log = NULL;
806 for (int i = 2; i < argc; i++) { 807 for (int i = 2; i < argc; i++) {
807 if (argv[i][0] == '-') { 808 if (argv[i][0] == '-') {
808 switch(argv[i][1]) { 809 switch(argv[i][1]) {
809 case 'd': 810 case 'd':
810 debug = 1; 811 debug = 1;
812 break;
813 case 'l':
814 address_log = fopen("address.log", "w");
811 break; 815 break;
812 default: 816 default:
813 fprintf(stderr, "Unrecognized switch %s\n", argv[i]); 817 fprintf(stderr, "Unrecognized switch %s\n", argv[i]);
814 return 1; 818 return 1;
815 } 819 }
826 x86_68k_options opts; 830 x86_68k_options opts;
827 m68k_context context; 831 m68k_context context;
828 vdp_context v_context; 832 vdp_context v_context;
829 833
830 init_x86_68k_opts(&opts); 834 init_x86_68k_opts(&opts);
835 opts.address_log = address_log;
831 init_68k_context(&context, opts.native_code_map, &opts); 836 init_68k_context(&context, opts.native_code_map, &opts);
832 init_vdp_context(&v_context); 837 init_vdp_context(&v_context);
833 context.next_context = &v_context; 838 context.next_context = &v_context;
834 //cartridge ROM 839 //cartridge ROM
835 context.mem_pointers[0] = cart; 840 context.mem_pointers[0] = cart;