comparison blastem.c @ 677:687c1dd3bcb9

Fake busack when Z80 is disabled
author Michael Pavone <pavone@retrodev.com>
date Sat, 03 Jan 2015 21:54:41 -0800
parents 18ef3b61e70b
children 7dd83295193a
comparison
equal deleted inserted replaced
676:41a399c11ef1 677:687c1dd3bcb9
512 if (location == 0x1100) { 512 if (location == 0x1100) {
513 if (value & 1) { 513 if (value & 1) {
514 dputs("bus requesting Z80"); 514 dputs("bus requesting Z80");
515 if (z80_enabled) { 515 if (z80_enabled) {
516 z80_assert_busreq(gen->z80, context->current_cycle); 516 z80_assert_busreq(gen->z80, context->current_cycle);
517 } else {
518 gen->z80->busack = 1;
517 } 519 }
518 } else { 520 } else {
519 if (gen->z80->busreq) { 521 if (gen->z80->busreq) {
520 dputs("releasing z80 bus"); 522 dputs("releasing z80 bus");
521 #ifdef DO_DEBUG_PRINT 523 #ifdef DO_DEBUG_PRINT
526 fclose(f); 528 fclose(f);
527 #endif 529 #endif
528 } 530 }
529 if (z80_enabled) { 531 if (z80_enabled) {
530 z80_clear_busreq(gen->z80, context->current_cycle); 532 z80_clear_busreq(gen->z80, context->current_cycle);
533 } else {
534 gen->z80->busack = 0;
531 } 535 }
532 } 536 }
533 } else if (location == 0x1200) { 537 } else if (location == 0x1200) {
534 sync_z80(gen->z80, context->current_cycle); 538 sync_z80(gen->z80, context->current_cycle);
535 if (value & 1) { 539 if (value & 1) {
614 default: 618 default:
615 value = 0xFF; 619 value = 0xFF;
616 } 620 }
617 } else { 621 } else {
618 if (location == 0x1100) { 622 if (location == 0x1100) {
619 value = z80_enabled ? !z80_get_busack(gen->z80, context->current_cycle) : 0; 623 value = z80_enabled ? !z80_get_busack(gen->z80, context->current_cycle) : !gen->z80->busack;
620 dprintf("Byte read of BUSREQ returned %d @ %d (reset: %d)\n", value, context->current_cycle, gen->z80->reset); 624 dprintf("Byte read of BUSREQ returned %d @ %d (reset: %d)\n", value, context->current_cycle, gen->z80->reset);
621 } else if (location == 0x1200) { 625 } else if (location == 0x1200) {
622 value = !gen->z80->reset; 626 value = !gen->z80->reset;
623 } else { 627 } else {
624 value = 0xFF; 628 value = 0xFF;