From 693c8b2438b6f831f8670649ab12f3062ec41e03 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 9 Jul 2016 20:03:38 -0400 Subject: [PATCH] After all that, it seems likely that inputs just aren't inverted for the Vic. --- Machines/Commodore/1540/Commodore1540.hpp | 4 ++-- Machines/Commodore/Vic-20/Vic20.cpp | 7 +++++++ Machines/Commodore/Vic-20/Vic20.hpp | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Machines/Commodore/1540/Commodore1540.hpp b/Machines/Commodore/1540/Commodore1540.hpp index a6057ef35..baa350e69 100644 --- a/Machines/Commodore/1540/Commodore1540.hpp +++ b/Machines/Commodore/1540/Commodore1540.hpp @@ -78,8 +78,8 @@ class SerialPortVIA: public MOS::MOS6522, public MOS::MOS6522IRQD std::shared_ptr<::Commodore::Serial::Port> serialPort = _serialPort.lock(); if(serialPort) { serialPort->set_output(::Commodore::Serial::Line::Data, - (::Commodore::Serial::LineLevel)!(_data_level_output - || (_attention_level_input == _attention_acknowledge_level))); + (::Commodore::Serial::LineLevel)(!_data_level_output + && (_attention_level_input != _attention_acknowledge_level))); } } }; diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index ae251f6d1..5a0b6c049 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -78,6 +78,13 @@ Machine::~Machine() unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value) { + static int logCount = 0; + if(operation == CPU6502::BusOperation::ReadOpcode && address == 0xee17) logCount = 500; + if(operation == CPU6502::BusOperation::ReadOpcode && logCount) { + logCount--; + printf("%04x\n", address); + } + // run the phase-1 part of this cycle, in which the VIC accesses memory uint16_t video_address = _mos6560->get_address(); uint8_t video_value = _videoMemoryMap[video_address >> 10] ? _videoMemoryMap[video_address >> 10][video_address & 0x3ff] : 0xff; // TODO diff --git a/Machines/Commodore/Vic-20/Vic20.hpp b/Machines/Commodore/Vic-20/Vic20.hpp index 39ce2b35b..ee7f73800 100644 --- a/Machines/Commodore/Vic-20/Vic20.hpp +++ b/Machines/Commodore/Vic-20/Vic20.hpp @@ -79,8 +79,8 @@ class UserPortVIA: public MOS::MOS6522, public MOS::MOS6522IRQDeleg // printf("VIC Serial port line %d: %s\n", line, value ? "on" : "off"); switch(line) { default: break; - case ::Commodore::Serial::Line::Data: _portA = (_portA & ~0x02) | (value ? 0 : 0x02); break; - case ::Commodore::Serial::Line::Clock: _portA = (_portA & ~0x01) | (value ? 0 : 0x01); break; + case ::Commodore::Serial::Line::Data: _portA = (_portA & ~0x02) | (value ? 0x02 : 0x00); break; + case ::Commodore::Serial::Line::Clock: _portA = (_portA & ~0x01) | (value ? 0x01 : 0x00); break; } }