spjewkes / jrnz

A work-in-progress ZX Spectrum emulator
MIT License
1 stars 0 forks source link

Loading a z80 game with a space in the title caused the game not to run #57

Open spjewkes opened 2 months ago

spjewkes commented 2 months ago

It looks like the game has crashed but what I think is going on is that the code isn't handling the filename correctly and just booting the rom on its own. Renaming the file allows it to work properly

spjewkes commented 2 months ago

So filenames are loaded via getopt(). So I'll have to look into why this cannot handle spaces in filenames. It might be the API or the shell.

spjewkes commented 2 months ago

This might be an issue that cannot be fixed in the code. But what we should probably do is raise and error/warning if we fail to load the file. That may at least make it clear to the user what is going on.

spjewkes commented 2 months ago

The SNA loading had an error output but not the Z80 loading. So I've fixed that.

Weirdly, using quotes doesn't seem to fix the problem. I didn't expect that at all. I'd have thought that was acceptable.

Googling seems to suggest quoting the argument will fix it. Some I'm either doing something wrong or something else is up.

I'll leave this issue open for now because although the error message is helpful it's not useful as a solution to rename files.