mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-28 22:30:30 +00:00
Added just enough that the 6502 should now be operating correctly.
This commit is contained in:
parent
0b221e773f
commit
b56482607e
@ -13,10 +13,38 @@
|
|||||||
using namespace Vic20;
|
using namespace Vic20;
|
||||||
|
|
||||||
Machine::Machine()
|
Machine::Machine()
|
||||||
{}
|
{
|
||||||
|
set_reset_line(true);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value)
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class Machine: public CPU6502::Processor<Machine>, public CRTMachine::Machine {
|
|||||||
uint8_t _characterROM[0x1000];
|
uint8_t _characterROM[0x1000];
|
||||||
uint8_t _basicROM[0x2000];
|
uint8_t _basicROM[0x2000];
|
||||||
uint8_t _kernelROM[0x2000];
|
uint8_t _kernelROM[0x2000];
|
||||||
uint8_t _ram[0x1000];
|
uint8_t _ram[0x2000];
|
||||||
|
|
||||||
std::unique_ptr<MOS::MOS6560> _mos6560;
|
std::unique_ptr<MOS::MOS6560> _mos6560;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user