From e3a5218e7849d906f95c143ee9d7106e4b377527 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 3 Dec 2017 22:25:18 -0500 Subject: [PATCH] Fixes AY and random port input for the MSX. --- Machines/MSX/MSX.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Machines/MSX/MSX.cpp b/Machines/MSX/MSX.cpp index c12437d59..c47723103 100644 --- a/Machines/MSX/MSX.cpp +++ b/Machines/MSX/MSX.cpp @@ -25,11 +25,11 @@ namespace MSX { struct AYPortHandler: public GI::AY38910::PortHandler { void set_port_output(bool port_b, uint8_t value) { - printf("AY port %c output: %02x\n", port_b ? 'b' : 'a', value); +// printf("AY port %c output: %02x\n", port_b ? 'b' : 'a', value); } uint8_t get_port_input(bool port_b) { - printf("AY port %c input\n", port_b ? 'b' : 'a'); +// printf("AY port %c input\n", port_b ? 'b' : 'a'); return 0xff; } }; @@ -130,14 +130,18 @@ class ConcreteMachine: case 0xa2: ay_->run_for(time_since_ay_update_.divide_cycles(Cycles(2))); - ay_->set_control_lines(static_cast(GI::AY38910::BDIR | GI::AY38910::BC1)); - ay_->set_data_input(*cycle.value); + ay_->set_control_lines(static_cast(GI::AY38910::BC2 | GI::AY38910::BC1)); + *cycle.value = ay_->get_data_output(); break; case 0xa8: case 0xa9: case 0xaa: case 0xab: *cycle.value = i8255_.get_register(address); break; + + default: + *cycle.value = 0xff; + break; } break; @@ -260,7 +264,7 @@ class ConcreteMachine: // b4 cassette motor relay machine_.set_keyboard_line(value & 0xf); break; - default: break; + default: printf("What what what what?\n"); break; } }