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

Fixed 6560 addressing error, added an autotyper for Vic disks (more work potentially needed), fixed semantics for testing whether a 6502 is about to reset.

This commit is contained in:
Thomas Harte 2016-08-01 10:32:32 -04:00
parent d74c3760fb
commit 5d40d70c92
4 changed files with 9 additions and 9 deletions

View File

@ -255,7 +255,7 @@ uint16_t MOS6560::get_address()
}
}
}
return fetch_address;
return fetch_address & 0x3fff;
}
void MOS6560::set_graphics_value(uint8_t value, uint8_t colour_value)

View File

@ -165,12 +165,10 @@ void Machine::set_rom(ROMSlot slot, size_t length, const uint8_t *data)
case BASIC: target = _basicROM; break;
case Drive:
if(_c1540)
{
_c1540->set_rom(data);
_c1540->run_for_cycles(2000000); // pretend it booted a couple of seconds ago
}
else
{
// if there's no 1540 now, hold onto the ROM in case one is added later
_driveROM.reset(new uint8_t[length]);
memcpy(_driveROM.get(), data, length);
}
@ -233,13 +231,15 @@ void Machine::set_disk(std::shared_ptr<Storage::Disk> disk)
_c1540->set_rom(_driveROM.get());
_driveROM.reset();
}
set_typer_for_string("LOAD\"*\",8,1\n");
}
#pragma mark - Typer
int Machine::get_typer_delay()
{
return get_reset_line() ? 1*263*60*65 : 0; // wait two seconds if resetting
return get_is_resetting() ? 1*263*60*65 : 0; // wait a second if resetting
}
int Machine::get_typer_frequency()

View File

@ -1027,7 +1027,7 @@ inline void Tape::run_for_cycles(unsigned int number_of_cycles)
int Machine::get_typer_delay()
{
return get_reset_line() ? 625*25*128 : 0; // wait one second if resetting
return get_is_resetting() ? 625*25*128 : 0; // wait one second if resetting
}
int Machine::get_typer_frequency()

View File

@ -1213,13 +1213,13 @@ template <class T> class Processor {
}
/*!
Gets the current level of the RST line.
Gets whether the 6502 would reset at the next opportunity.
@returns @c true if the line is logically active; @c false otherwise.
*/
inline bool get_reset_line()
inline bool get_is_resetting()
{
return !!(_interrupt_requests & InterruptRequestFlags::Reset);
return !!(_interrupt_requests & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn));
}
/*!