mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-07 06:57:15 +00:00
Completed proof of theory for fast loading. It's just an around-the-back direct-to-file hack for now though.
This commit is contained in:
parent
3e67f3caa6
commit
419629ee6e
@ -40,22 +40,36 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
|
|||||||
{
|
{
|
||||||
if(address >= 0xc000)
|
if(address >= 0xc000)
|
||||||
{
|
{
|
||||||
|
if(isReadOperation(operation)) *value = _rom[address&16383];
|
||||||
|
|
||||||
// // 024D = 0 => fast; otherwise slow
|
// // 024D = 0 => fast; otherwise slow
|
||||||
// // E6C9 = read byte: return byte in A
|
// // E6C9 = read byte: return byte in A
|
||||||
// if(address == 0xe6c9 && operation == CPU6502::BusOperation::ReadOpcode)
|
if(address == 0xe6c9 && operation == CPU6502::BusOperation::ReadOpcode)
|
||||||
|
{
|
||||||
|
static FILE *test = NULL;
|
||||||
|
static int lead_counter = 0;
|
||||||
|
if(!test)
|
||||||
|
{
|
||||||
|
test = fopen("/Users/thomasharte/Desktop/Soft/Oric/Tapes/Slalom.tap", "rb");
|
||||||
|
}
|
||||||
|
if(test && !feof(test))
|
||||||
|
{
|
||||||
|
uint8_t next_byte;
|
||||||
|
// if(lead_counter < 64)
|
||||||
// {
|
// {
|
||||||
// printf(".");
|
// next_byte = 0x16;
|
||||||
|
// lead_counter++;
|
||||||
// }
|
// }
|
||||||
|
// else
|
||||||
if(address == 0xe720 && operation == CPU6502::BusOperation::ReadOpcode)
|
next_byte = (uint8_t)fgetc(test);
|
||||||
{
|
set_value_of_register(CPU6502::A, next_byte);
|
||||||
while(!_via.tape->get_input())
|
set_value_of_register(CPU6502::Flags, next_byte ? 0 : CPU6502::Flag::Zero);
|
||||||
{
|
uint8_t stack = get_value_of_register(CPU6502::S) + 1;
|
||||||
_via.run_for_cycles(1);
|
uint16_t return_address = _ram[0x0100 | stack] | (_ram[0x0100 | (stack+1)] << 8);
|
||||||
_via.tape->run_for_cycles(1);
|
printf("%02x -> %04x | ", next_byte, return_address+1);
|
||||||
|
*value = 0x60; // i.e. RTS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isReadOperation(operation)) *value = _rom[address&16383];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user