file loading bugs when loading from sdcard image?
- desertfish
- Posts: 1098
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
file loading bugs when loading from sdcard image?
Hi, when putting files on an Sdcard image, I discovered some problems when loading them, that do not occur when loading files in the emulator from a host directory.
Most notably, it seems that when loading a file from an sdcard image, the kernel (?) ignores the reallocation address passed to the LOAD call and always seems to load the file at $0000
I think this also manifests itself in Basic when using the VLOAD command, for instance:
working, loading a file from a host directory, ends up at $2000 or about halfway down the screen ram:
not working, doing the same with the exact same file but this time loading from an sdcard image, it loads at $0000 no matter what you do:
Net result is that any program or game that is loading data files, doesn't work when copied onto an sd card image.... ? (I've tried my own image viewer demo program and three other games, all refuse to work from an sd card image but work fine when loading from a shared host folder in the emulator)
Is this a known issue?
Could it be a KERNAL bug or a bug in the Emulator itself somewhere?
file loading bugs when loading from sdcard image?
Yeah, this is a bug in the kernal right now that ignores the address passed in. I put in a pull request to fix this a while ago, but Michael Steil hasn't been active lately so it hasn't been picked up yet. It doesn't happen when you're not using an SD card image because, in that mode, the emulator bypasses the kernal completely and loads the file into memory itself, and it properly handles the arguments being passed in.
- desertfish
- Posts: 1098
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
file loading bugs when loading from sdcard image?
Thank you for clearing that up! I did look on github a bit for issues that might be similar but didn’t look through the pull requests...
- svenvandevelde
- Posts: 488
- Joined: Wed Dec 23, 2020 6:30 am
- Location: Belgium, Antwerpen
file loading bugs when loading from sdcard image?
On 12/3/2020 at 9:19 PM, Ender said:
Yeah, this is a bug in the kernal right now that ignores the address passed in. I put in a pull request to fix this a while ago, but Michael Steil hasn't been active lately so it hasn't been picked up yet. It doesn't happen when you're not using an SD card image because, in that mode, the emulator bypasses the kernal completely and loads the file into memory itself, and it properly handles the arguments being passed in.
He hasn't been responding to me neither ... I guess he's putting his priorities.
- svenvandevelde
- Posts: 488
- Joined: Wed Dec 23, 2020 6:30 am
- Location: Belgium, Antwerpen
file loading bugs when loading from sdcard image?
On 2/6/2021 at 7:49 PM, svenvandevelde said:
He hasn't been responding to me neither ... I guess he's putting his priorities.
Related to my other post regarding the load API, i've also been testing the .vhd virtual disks and using the -sdcard option in the x16emu.
Unfortunately, the address indeed is ignored, and the files are loaded at another place in the memory than the place that you indicate using the X and Y registers of the FFD5 API, unfortunately. It would be good to get this bug fixed. I think the only option now is to write my own loader ... using open, close API and read byte by byte.