skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 345 forks source link

Add `--version` and `--help` command line options [$49] #1073

Closed hissingshark closed 5 years ago

hissingshark commented 6 years ago

When building from master on both the Rpi3 and the Vero4K (Amlogic S905x) I've discovered a bug in Ikaruga that wasn't present in the binary provided by Retropie. I've asked over at their forums to find out when it was built or from which commit, but had no response. Whilst I waited I've blindly compiled from literally dozens of commits but without striking lucky.

Reicast doesn't seem to have a --version or a --help flag on the command line that might give it away.

Are there any other ways I could find out?

Many thanks,

--- There is a **[$49 open bounty](https://www.bountysource.com/issues/53840115-add-version-and-help-command-line-options?utm_campaign=plugin&utm_content=tracker%2F500311&utm_medium=issues&utm_source=github)** on this issue. Add to the bounty at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F500311&utm_medium=issues&utm_source=github).
skmp commented 6 years ago

I think this functionality exists for the Android builds, but I don't think we have it for linux. What is the Ikaruga bug?

Naveenaidu commented 6 years ago

@skmp I would like to work on this issue. Could you please guide me. A newcomer here :sweat_smile:

baka0815 commented 6 years ago

Well, there is a -help command line switch in Linux (see ParseCommandLine in https://github.com/reicast/reicast-emulator/blob/master/core/cfg/cl.cpp) which currently only shows help abot the -config switch (at least -help should be added here). The -version switch could be implemented the same way and output reicast rN [hash] where N would be the release number (8 f.e. -> r8) and the hash would be the hash of the specific commit (see Android code).

AbandonedCart commented 6 years ago

I wouldn't recommend referencing the Android code for that, since it uses a rather cheap trick of printing the hash to a text file during the build and simply reading the raw file into the view. That may only make it more confusing.

skmp commented 6 years ago

@naveenaidu are you in the reicast chat? It’s probably best to coordinate that way. You can join at http://chat.reicast.com

baka0815 commented 6 years ago

My approach would be creating a header file (version.h) including the hash (and creationdate?) during a prebuild.

hissingshark commented 6 years ago

My apologies, I had no idea there had been any answers to my query. I checked manually for a few months and forgot about it after that. Only today did I start receiving email notifications, yet the first reply was in April!...

Adding the functionality myself was on my todo list (obviously wouldn't help my original bug problem in retrospect), but not gotten around to it yet! Distracted getting PPSSPP to build and then my RetroPie fork. I have more time again now that my PR has been accepted over there.

@baka0815 That was going to be my approach. I encountered the same system on a Mupen64Plus plugin as I recall and didn't find a better solution since that time.

@skmp The bug is: After the very 1st attack wave there is a hands-off cut scene where the camera changes direction. The next wave of ships seem to be missing. After that they start to come again, but I can no longer fire. As I recall I was also indestructible because I left it running and the ship survived all the way to the boss, which I eventually passed, only because it times out if you go for long enough without defeating it. Then it went to the next level and I can't remember if control was restored or not. Will check again tonight.

hissingshark commented 6 years ago

Ah here it is. From the GLideN64 plugin.

SCRIPT_DIRECTORY=`dirname $0`
rev=\"`git rev-parse --short HEAD`\"
echo current revision $rev
echo "#define PLUGIN_REVISION $rev" > $SCRIPT_DIRECTORY/Revision.h
echo "#define PLUGIN_REVISION_W L$rev" >> $SCRIPT_DIRECTORY/Revision.h
dmiller423 commented 6 years ago

I just redirect git describe to a version header, simple, good formatting and added build date as well.

--version

Reicast Version: # r7-rc1-1069-g223cd748 built on Aug 20 2018


--help

Available commands : [-]-config section:key=value [, ..]: add a virtual config value Virtual config values won't be saved to the .cfg file unless a different value is written to em Note : You can specify many settings in the xx:yy=zz , gg:hh=jj , ... format.The spaces between the values and ',' are needed.

[-]-help: show help info

[-]-version: show current version #

dmiller423 commented 5 years ago

This is resolved, and working in master.