theelf wrote on 2026-11-08, 17:53:
Hi, any ideas this can be solved? https://github.com/polpo/picogus/issues/149
it happen all time, and it is becoming a real problem to using my system properly
Hi guys, answer to myself
Like i said before I have this problem with the PicoGUS CD emulation and was very annoying me. I do pgusinit /cdload 51, dir d: ok, then pgusinit /cdload 52, dir d:... and it shows me the files of 51!! pgusinit says the 52 is loaded, no error nothing. If I wait some seconds and try again, then it works.
So first I think is the PicoGUS firmware, but no. I installed the toolkit in a modern PC, compile, but realize firmware loads the new image fine and says the disc changed.
The problem was same with MSCDEX and SHSUCDX, i tested mscdex from dos 6.22 and pcdos 7. But lucky SHSUCDX have source code, so looking there I find the reason and the fix. It only ask the CD driver "hey, the disc changed?" if it pass around 7 seconds (128 ticks) since the last time you touch the drive. If you change the image and go to the drive before that, it gives you the old directory from the cache.
What I modified in shsucdx.nsm:
when you do directory stuff (FindFirst, Open, ChDir, GetAttr, GetSpace) now it always ask the driver for media change. It only drops the cache if the driver says "changed". File reads, FindNext and the MSCDEX calls (games reading raw sectors etc) still use the 7 seconds, so nothing goes slower.
New option /T:n for the timeout in seconds (0-99). Default still around 7 seconds. /T:0 = check every time. You can change it also when SHSUCDX is already loaded, butt at least for now, work fine with default in my 286 now
In the zip you have full source and two builds: SHCDX86.COM (8086/286) and SHSUCDX.COM (386). Compiled with NASM. All credit to Jason Hood for SHSUCDX (https://github.com/adoxa/shsucd), I only touch a little thing.
Also one idea for pgusinit, after a good /cdload or /cdloadname, pgusinit can send an IOCTL "media changed" (INT 2Fh AX=1510h) to the CD drives. SHSUCDX drops the cache immediately when it receive this, so people with normal SHSUCDX no need any patch. With MSCDEX I dont know if it works the same, need to test.
PicoGUS issue: https://github.com/polpo/picogus/issues/149
greetings!
The attachment shsucd-master.zip is no longer available