Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSOS doesn't detect disk swaps. #133

Open
wschaub opened this issue Jan 3, 2023 · 1 comment
Open

GSOS doesn't detect disk swaps. #133

wschaub opened this issue Jan 3, 2023 · 1 comment

Comments

@wschaub
Copy link

wschaub commented Jan 3, 2023

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
Copy link
Author

wschaub commented Jan 3, 2023

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);
   }
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant