davidgiven / cpm65

CP/M for the 6502
BSD 2-Clause "Simplified" License
276 stars 25 forks source link

Two drives support for the Apple II #194

Closed ivanizag closed 1 month ago

ivanizag commented 1 month ago

Adds two drives on slot 6 for the Apple II. I just needed to update bios_SELDSK. I also added a second disk to the build.

Tested on the emulators Virtual ][, MAME and my own. I don't have a real machine setup for testing.

A drawback of this second drive support is that the system will be waiting forever on access to B: for a disk to be inserted. That was quite common on the Apple II, but running on an emulator with no disks sounds, the first experience for users testing cpm65 could be bad. That may be reason enough for not merging the change.

The wait happens on read_header searching for a sector prologue. I dare not touch all that time sensitive code for the Disk II.

ivanizag commented 1 month ago

Oh. The Internet Archive is disabled again.

davidgiven commented 1 month ago

Yep, it's still down... when you say that the system will wait forever, this is only when drive B: is accessed, right? If so, then I think this is fine. It would be nice to add timeout support but without an actual system timer the only way to do it would be via counting, which sounds like a miserable experience. It would have to be done on every busy wait for the disk shift registers, of which there are many.

ivanizag commented 1 month ago

Right, only when B: is accessed. Or A:, but only if the disk is removed after boot.

The only way would be indeed counting. I think that only counting on read_header would be enough. The rest of the usages always work for a set number of bytes. On read_header, looking for the prologue could finish after reading the close to 8000 bytes that could be stored in a track.

davidgiven commented 1 month ago

Okay, that's cool. Merging. Thanks very much!