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

added support for reading/writing hiscore files from cart images #6130

Merged
merged 7 commits into from Feb 13, 2020

Conversation

eadmaster
Copy link
Contributor

example hiscore.dat entry:

nes,smb:
Super Mario Bros. (World).nes:
Super Mario Bros. (W) [!].nes:
@:maincpu,program,7df,4,0,0,ff

example hiscore.dat entry:
````
nes,smb:
Super Mario Bros. (World).nes:
Super Mario Bros. (W) [!].nes:
@:maincpu,program,7df,4,0,0,ff
````
@cracyc
Copy link
Member

cracyc commented Jan 4, 2020

I don't think that this is something we want as part of the official distribution. We try to encourage people to use softlist images.

@eadmaster
Copy link
Contributor Author

As alternative i could use the cart CRC hash (from manager:machine().images["cart"]:crc()), but i think long filenames are less cryptic for the regular user.

Softlist images are good for developers who prefer shorter names to type in the terminal and source code, but for console rom dumps long filenames are more common.

Btw, if you prefer to reject this i will host it in a separate repository and rename the plugin as console_hiscore so it can be side-installed with the other shipped plugins without conflicts.

@ghost
Copy link

ghost commented Jan 5, 2020

Softlist stuff isn't just about shortnames tho, it's the way MAME ties together ROMs and other cartridge components without having to fall back to detection hacks. Nobody should be using loose ROMs for console stuff.

@rb6502
Copy link
Contributor

rb6502 commented Jan 5, 2020

Softlists are preferred because they're much easier for users (although users seem to have a mental block about console roms being treated identically to arcade roms, and frontend authors continue to be awful at supporting softlists properly), but we do and will continue to support loose dumps.

If this patch works for both kinds of roms and passes coding standards I don't see a problem with it.

@eadmaster
Copy link
Contributor Author

eadmaster commented Jan 6, 2020

If this patch works for both kinds of roms and passes coding standards I don't see a problem with it.

yes, softlists are still supported, in fact i've been using both while testing the plugin.
But if a loose dump is passed, then the generated hiscore file will get its name. e.g.:
mame nes -cart "Super Mario Bros. (W) [!].nes"
will generate an hiscore file named Super Mario Bros. (W) [!].nes.hi.

The double extension is intentional to prevent name conflicts between roms with the same filename and different systems (e.g. "Tennis (USA).nes" and "Tennis (USA).sms").

I've verified this also works fine with compressed rom dumps, since mame returns this nice string as filename "/home/andy/Documents/NEW/console_hiscore/Super Mario Bros. (W) [!].zip/Super Mario Bros. (W) [!].nes".

Another solution would be storing the hiscore file in a subfolder with the system name (e.g. nes/Super Mario Bros. (W) [!].hi), but i've ditched this atm.

Btw i have other enhancements in mind for the hiscore plugin (support for crc hashes and cdrom media), if this this pull request gets accepted i will send another one soon.

EDIT: the external repo with the latest changes is now public .

@eadmaster
Copy link
Contributor Author

I've updated the branch with my latest changes (now hiscores are stored in subdirs).

@rb6502 rb6502 merged commit a77313a into mamedev:master Feb 13, 2020
cuavas added a commit that referenced this pull request Feb 27, 2020
…ges (#6130)"

This reverts commit a77313a.

This seems to break high score support on things without cartridges.  I think it needs re-thinking.
@cuavas
Copy link
Member

cuavas commented Feb 27, 2020

This seems to break high scores for systems without cartridge slots. It gives errors like:

[LUA ERROR] in execute_function: plugins/hiscore/init.lua:108: attempt to index a nil value (field 'cart')

It has been reverted in c39f46d

@eadmaster
Copy link
Contributor Author

i see, i'll fix this asap..

MooglyGuy pushed a commit that referenced this pull request Mar 1, 2020
…ges (#6130)"

This reverts commit a77313a.

This seems to break high score support on things without cartridges.  I think it needs re-thinking.
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

Successfully merging this pull request may close these issues.

None yet

4 participants