gsplus icon indicating copy to clipboard operation
gsplus copied to clipboard

GSOS doesn't detect disk swaps.

Open wschaub opened this issue 2 years ago • 1 comments

I've been using gsplus for the past week and have been running into an issue where you need to empty the drive slot and click ok and let GSOS search for a disk in an empty drive first before you can respond to "insert disk named XXXX" prompts.

It makes installing software on the emulator a very slow process, other than that I've been enjoying the emulator quite a bit.

I've come up with the following experimental patch that seems to signal that the drive has just been ejected when we insert a disk, this seems to trickle down into whatever GSOS is looking for and I can just simply hit F4 when it prompts for a disk, mount the disk and press ok once I return to the emulator and it seems to have no issues.

I have no idea if this might affect something else negatively.

diff --git a/src/config.c b/src/config.c
index 2a3e07e..ecfa006 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1389,7 +1389,7 @@ void insert_disk(int slot, int drive, const char *name, int ejected, int force_s
          partition_name, part_num, slot, drive);
 #endif
 
-  dsk->just_ejected = 0;
+  dsk->just_ejected = 1;
   dsk->force_size = force_size;
 
   if(!dsk->file) {

wschaub avatar Jan 03 '23 01:01 wschaub

This might be safer? if I change this we call eject_disk which I assume will flush out the buffers on the old disk before the new one is inserted.

diff --git a/src/config.c b/src/config.c
index 2a3e07e..b03a4dd 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1392,7 +1392,7 @@ void insert_disk(int slot, int drive, const char *name, int ejected, int force_s
   dsk->just_ejected = 0;
   dsk->force_size = force_size;
 
-  if(!dsk->file) {
+  if(dsk->file) {
     eject_disk(dsk);
   }
 

wschaub avatar Jan 03 '23 02:01 wschaub