diff --git a/Components/6560/6560.cpp b/Components/6560/6560.cpp index c20391932..29054d0d6 100644 --- a/Components/6560/6560.cpp +++ b/Components/6560/6560.cpp @@ -88,7 +88,7 @@ void MOS6560::set_register(int address, uint8_t value) case 0x5: _character_cell_start_address = (uint16_t)((value & 0x0f) << 10); - _video_matrix_start_address = (uint16_t)((_video_matrix_start_address & 0x0400) | ((value & 0xf0) << 5)); + _video_matrix_start_address = (uint16_t)((_video_matrix_start_address & 0x0200) | ((value & 0xf0) << 6)); break; case 0xe: diff --git a/Machines/Vic-20/Vic20.cpp b/Machines/Vic-20/Vic20.cpp index 3bf55f007..ec3ab80c6 100644 --- a/Machines/Vic-20/Vic20.cpp +++ b/Machines/Vic-20/Vic20.cpp @@ -27,8 +27,18 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin // run the phase-1 part of this cycle, in which the VIC accesses memory uint16_t video_address = _mos6560->get_address(); - if(!(video_address&0x1000)) video_address += 0x8000; - _mos6560->set_graphics_value(read_memory(video_address), _colorMemory[video_address & 0x03ff]); + uint8_t video_value = 0xff; // TODO + if(!(video_address&0x2000)) + { + video_value = _characterROM[video_address & 0x0fff]; + } + else + { + video_address &= 0x1fff; + if(video_address < sizeof(_userBASICMemory)) video_value = _userBASICMemory[video_address]; + else if(video_address >= 0x1000 && video_address < 0x2000) video_value = _screenMemory[video_address&0x0fff]; + } + _mos6560->set_graphics_value(video_value, _colorMemory[video_address & 0x03ff]); // run the phase-2 part of the cycle, which is whatever the 6502 said it should be if(isReadOperation(operation))