comparison blastem.c @ 471:f065769836e8

Implement FIFO as a ring buffer so the behavior of reads from invalid CRAM and VSRAM bits can be implemented properly
author Mike Pavone <pavone@retrodev.com>
date Sun, 15 Sep 2013 22:20:43 -0700
parents 541c1ae8abf3
children 4b24260125f3
comparison
equal deleted inserted replaced
470:541c1ae8abf3 471:f065769836e8
360 } else { 360 } else {
361 printf("Illegal write to HV Counter port %X\n", vdp_port); 361 printf("Illegal write to HV Counter port %X\n", vdp_port);
362 exit(1); 362 exit(1);
363 } 363 }
364 if (v_context->cycles != before_cycle) { 364 if (v_context->cycles != before_cycle) {
365 printf("68K paused for %d (%d) cycles at cycle %d (%d) for write\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle); 365 //printf("68K paused for %d (%d) cycles at cycle %d (%d) for write\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle);
366 context->current_cycle = v_context->cycles / MCLKS_PER_68K; 366 context->current_cycle = v_context->cycles / MCLKS_PER_68K;
367 } 367 }
368 } else if (vdp_port < 0x18) { 368 } else if (vdp_port < 0x18) {
369 genesis_context * gen = context->system; 369 genesis_context * gen = context->system;
370 sync_sound(gen, context->current_cycle * MCLKS_PER_68K); 370 sync_sound(gen, context->current_cycle * MCLKS_PER_68K);
432 exit(1); 432 exit(1);
433 } else { 433 } else {
434 value = vdp_test_port_read(v_context); 434 value = vdp_test_port_read(v_context);
435 } 435 }
436 if (v_context->cycles != before_cycle) { 436 if (v_context->cycles != before_cycle) {
437 printf("68K paused for %d (%d) cycles at cycle %d (%d) for read\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle); 437 //printf("68K paused for %d (%d) cycles at cycle %d (%d) for read\n", v_context->cycles / MCLKS_PER_68K - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle);
438 context->current_cycle = v_context->cycles / MCLKS_PER_68K; 438 context->current_cycle = v_context->cycles / MCLKS_PER_68K;
439 } 439 }
440 return value; 440 return value;
441 } 441 }
442 442