mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 15:29:41 +00:00
Auto-eject disk if present in drive
This commit is contained in:
parent
2a944d77b9
commit
cd9a9ad3cf
|
@ -453,7 +453,6 @@ static bool save_track_data(void) {
|
|||
denibblize_track(disk6.drive, buf);
|
||||
int track_pos = DSK_TRACK_SIZE * (disk6.disk[disk6.drive].phase >> 1);
|
||||
fseek(disk6.disk[disk6.drive].fp, track_pos, SEEK_SET);
|
||||
LOG("writing data ...");
|
||||
if (fwrite(buf, 1, DSK_TRACK_SIZE, disk6.disk[disk6.drive].fp) != DSK_TRACK_SIZE) {
|
||||
ERRLOG("could not write dsk data ...");
|
||||
return false;
|
||||
|
@ -755,6 +754,10 @@ const char *c_eject_6(int drive) {
|
|||
const char *c_new_diskette_6(int drive, const char * const raw_file_name, int force) {
|
||||
struct stat buf;
|
||||
|
||||
if (disk6.disk[drive].fp) {
|
||||
c_eject_6(drive);
|
||||
}
|
||||
|
||||
/* uncompress the gziped disk */
|
||||
char *file_name = strdup(raw_file_name);
|
||||
if (is_gz(file_name)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user