comparison blastem.c @ 265:c6d12878ea93

Add -n flag for disabling the Z80 core
author Mike Pavone <pavone@retrodev.com>
date Wed, 01 May 2013 20:15:33 -0700
parents 8fd6652e56f8
children 376df762ddf5
comparison
equal deleted inserted replaced
264:8fd6652e56f8 265:c6d12878ea93
24 24
25 io_port gamepad_1; 25 io_port gamepad_1;
26 io_port gamepad_2; 26 io_port gamepad_2;
27 27
28 int headless = 0; 28 int headless = 0;
29 int z80_enabled = 1;
29 30
30 #ifndef MIN 31 #ifndef MIN
31 #define MIN(a,b) ((a) < (b) ? (a) : (b)) 32 #define MIN(a,b) ((a) < (b) ? (a) : (b))
32 #endif 33 #endif
33 34
137 { 138 {
138 //TODO: Handle sync targets smaller than a single frame 139 //TODO: Handle sync targets smaller than a single frame
139 z80_context * z_context = context->next_cpu; 140 z80_context * z_context = context->next_cpu;
140 vdp_context * v_context = context->video_context; 141 vdp_context * v_context = context->video_context;
141 uint32_t mclks = context->current_cycle * MCLKS_PER_68K; 142 uint32_t mclks = context->current_cycle * MCLKS_PER_68K;
142 if (!reset && !busreq) { 143 if (z80_enabled && !reset && !busreq) {
143 if (need_reset) { 144 if (need_reset) {
144 z80_reset(z_context); 145 z80_reset(z_context);
145 need_reset = 0; 146 need_reset = 0;
146 } 147 }
147 z_context->sync_cycle = mclks / MCLKS_PER_Z80; 148 z_context->sync_cycle = mclks / MCLKS_PER_Z80;
908 address_log = fopen("address.log", "w"); 909 address_log = fopen("address.log", "w");
909 break; 910 break;
910 case 'v': 911 case 'v':
911 headless = 1; 912 headless = 1;
912 break; 913 break;
914 case 'n':
915 z80_enabled = 0;
916 break;
913 default: 917 default:
914 fprintf(stderr, "Unrecognized switch %s\n", argv[i]); 918 fprintf(stderr, "Unrecognized switch %s\n", argv[i]);
915 return 1; 919 return 1;
916 } 920 }
917 } else if (width < 0) { 921 } else if (width < 0) {