Page 1 of 1

Patches for linux

Posted: Mon 10 Apr, 2017 6:31 pm
by AmatCoder
I will use this thread to upload patches (mainly for linux).

This first one updates makefiles to avoid undefined references.

Re: Patches for linux

Posted: Mon 10 Apr, 2017 6:55 pm
by AmatCoder
This patch add static specifier to inline functions in 808x.c file.
It fixes undefined references if compiled with --enable-debug option.

Re: Patches for linux

Posted: Mon 10 Apr, 2017 7:15 pm
by AmatCoder
This one fixes a segmentation fault produced when user select a machine with internal ide hdd into allegro gui.

Rationale: internal_name is a pointer and is uninitialized when copying with strcpy. I think it is better to use a literal.

Re: Patches for linux

Posted: Mon 10 Apr, 2017 7:39 pm
by bit
I hope it's alright that I'm borrowing your thread to post two patches related to Linux :)

The first one is a small patch that fixes issues I experienced with the 32-bit Voodoo recompiler.

Re: Patches for linux

Posted: Mon 10 Apr, 2017 7:45 pm
by bit
This patch modifies romfopen and rom_present to be case-insensitive on Linux.

Re: Patches for linux

Posted: Tue 11 Apr, 2017 9:37 pm
by tomaszkam
For the case sensitive names, wouldn't it be better to just select a consistent spelling approach for the rom files? For example making all of the lower case. This will not require scanning a dir (which may be a long time if number of roms increase) and will not affect Windows builds in any way.

Attached patch that changes all roms and nvrs references to lowercase only.

Re: Patches for linux

Posted: Tue 11 Apr, 2017 11:51 pm
by A. Naim
Even with a HDD, a thousand items per second is not out of line. I don't think scanning the rom dir is going to be a problem. :)

How to check: If you have a HDD, check the properties. It'll start counting files and stored data (Linux Mint and Windows). Mine peaked at ~1000 files/second in the first few seconds.

Re: Patches for linux

Posted: Wed 12 Apr, 2017 5:12 am
by tomaszkam
Secondly, proposed patch only ignores case sensitivity for the files, not whole dirs (and we have dirs inside roms directory). Using consistent naming also address that situation and it's a lot simpler.

Re: Patches for linux

Posted: Wed 12 Apr, 2017 6:44 am
by bit
You have a point tomaszkam. My first thought was also to just convert the subpath to lowercase inside romfopen, but when I later realized that the end-user have to change every non-lowercase file either manually or by finding/writing a script it did not feel very user-friendly and I thought of this solution instead. And as A. Naim said scanning the directory shouldn't be an issue.
Regarding the subdirectories inside the roms-directory they are both premade and lowercase so that will probably not be a problem either.

But as a long-time Linux-user I would like to go all lowercase, since I like it that way :) However this approach just felt like it would be the most user-friendly.

EDIT:
How about using both solutions?
1. Try the file with its default filename (I actually think this would be true in most cases, but could probably be skipped on Linux).
2. If running Linux and the file does not exist, try it with all lowercase (this would be the preferred way for Linux).
3. If it still does not exist, do a directory scan.

Doing it this way would make it work in most likely all cases, but if anyone do have problems with for example subdirectories being non-lowercase they could just rename everything and it should work without having to do a directory scan.

EDIT 2:
Also, it should be no problem to add so it also searches subdirectories case-insensitive if that really might be an issue.

Re: Patches for linux

Posted: Wed 12 Apr, 2017 7:36 pm
by tomaszkam
I think that the problems we currently encounter is caused by random use of lower/upper case letters for the rom names. Moreover the casing was different between the docs and actual code, so matching readme will not help.
And I think, once it would be clear that all files and dirs need to use lower case, then no workaround would be needed at all, as user will just rename their roms.

I consider any attempt to implement behaviour that mimics case-insesitive filesystem on case-sensitive one as over-engineering. And less platform depended code, the better.

Re: Patches for linux

Posted: Thu 13 Apr, 2017 4:47 pm
by A. Naim
tomaszkam wrote:I think that the problems we currently encounter is caused by random use of lower/upper case letters for the rom names. Moreover the casing was different between the docs and actual code, so matching readme will not help.
And I think, once it would be clear that all files and dirs need to use lower case, then no workaround would be needed at all, as user will just rename their roms.

I consider any attempt to implement behaviour that mimics case-insesitive filesystem on case-sensitive one as over-engineering. And less platform depended code, the better.
I'm of the opinion that case-sensitivity in general is not a great idea. I mean, your reasoning there is probably right, but *puts in Internet Pedant Hat and travels back to 1980-something*. ;)

Although I don't know if this holds true for all languages, for English (and Latin/Greek/Germanic derived languages in general) the idea that there's a difference between "MyTextFile.txt", "myTextFile.txt" or "mytextfile.txt" doesn't seem to make sense, to me, linguistically.

Overall, it adds to the "remembered data load", and a bit to the "vocal communication load", and doesn't really add anything useful enough, IMO. A better option would be to rename the files; ex. "My Accounting File.txt", "My Journal File.txt", or "Random Notes File @ $Name_Of_Tech_Conference.txt".

...And yeah, I'm as prone to "New Document.txt #" for random notes as anyone else. So don't take this too seriously. :) I mean, if you're writing a new OS, it might be useful, but otherwise, it's just the random musings of some random person on the internet on something that's not going to be changed at this point. :) I don't take it too seriously, either.

Although if I ever do make an OS or programming language, it'll probably be case-insensitive. :p ;)

Re: Patches for linux

Posted: Wed 19 Apr, 2017 3:38 pm
by SarahWalker
Committed all these patches as of rev 692. I've changed the ROM file names to lower case rather than try to handle all cases - it just seems neater!

Re: Patches for linux

Posted: Fri 12 May, 2017 6:54 am
by Greatpsycho
This patch solves compile error on linux after Dell System 200 patch. Rewritten against commit 99908fe.