Closed bluecursor closed 1 year ago
The disk did not get inserted. The bug came in when I started to utilize the new event scheduler for executing the disk change procedure. Up to now, I had this code in windowDidLoad
:
// Add media file (if provided on startup)
mydocument.mm.addMedia()
do {
// Let the C64 throw an exception if it is not ready to power on
try c64.isReady()
// Start emulation
try c64.run()
} catch {
// Open the Rom dialog
openConfigurator(tab: "Roms")
}
Function addMedia
eventually calls insertDisk
which is fine:
void
Drive::insertDisk(std::unique_ptr<Disk> disk)
{
{ SUSPENDED
if (!diskToInsert) {
diskToInsert = std::move(disk);
// Initiate the disk change procedure
scheduleFirstDiskChangeEvent(DCH_INSERT);
}
}
}
The first DCH_INSERT
is scheduled as expected. However, because try c64.run()
is executed later, the scheduled event is erased, because the event scheduler is reset when the emulator is powered on. To make a long story short: The disk needs to be inserted after the emulator has been launched. Hence, moving the addMedia()
call below the try-catch block fixed the issue.
This error seems to halter the ability to change Control Emulation Keys. Only by closing and reopening V64 resolves it.
When double clicking a .d64 image into VirtualC64 4.6b1, performing a directory or load command causes a disk error as if a disk was not inserted. Right after when trying to insert a disk into a drop zone still causes the same error. Powering off/on or restarting the emulation still doest clear the error. Only by closing and reopening V64 then dropping in a drop zone does a disk image loads.