1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-28 07:29:45 +00:00

Added just enough that the 6502 should now be operating correctly.

This commit is contained in:
Thomas Harte 2016-06-05 11:44:29 -04:00
parent 0b221e773f
commit b56482607e
2 changed files with 30 additions and 2 deletions

View File

@ -13,10 +13,38 @@
using namespace Vic20;
Machine::Machine()
{}
{
set_reset_line(true);
}
unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value)
{
set_reset_line(false);
if(isReadOperation(operation))
{
uint8_t returnValue = 0xff;
if(address < sizeof(_ram))
returnValue &= _ram[address];
if(address >= 0x8000 && address < 0x9000)
returnValue &= _characterROM[address&0x0fff];
if(address >= 0xc000 && address < 0xe000)
returnValue &= _basicROM[address&0x1fff];
if(address >= 0xe000)
returnValue &= _kernelROM[address&0x1fff];
*value = returnValue;
}
else
{
if(address < sizeof(_ram))
_ram[address] = *value;
}
return 1;
}

View File

@ -43,7 +43,7 @@ class Machine: public CPU6502::Processor<Machine>, public CRTMachine::Machine {
uint8_t _characterROM[0x1000];
uint8_t _basicROM[0x2000];
uint8_t _kernelROM[0x2000];
uint8_t _ram[0x1000];
uint8_t _ram[0x2000];
std::unique_ptr<MOS::MOS6560> _mos6560;
};