Previous Thread
Next Thread
Print Thread
NegaMAME #113518
06/02/18 05:58 PM
06/02/18 05:58 PM
Joined: Dec 2013
Posts: 119
X
xinyingho Offline OP
Senior Member
xinyingho  Offline OP
Senior Member
X
Joined: Dec 2013
Posts: 119
As I already wrote in the minimaws thread, I'm in the process of releasing my own MAME derivative so that I can have a version of MAME that can provide all the necessary information to F/Es to properly generate new media options when a slot option has been changed by users, by adding a new command line option -listmediaxml. This is a temporary solution while I'm waiting for the official solution to be integrated into MAME as I understand it'll take quite a while to be completed.

While I already made all the changes necessary to have -listmediaxml working, there's a thing I don't understand: how the generation of build_version works? Ideally, I want it to display something like "0.197 (negamame0197)" instead of the current "0.198 (mame0197-886-g10429b8d61-dirty)" that I get while compiling with the default settings.

Re: NegaMAME [Re: xinyingho] #113519
06/02/18 09:32 PM
06/02/18 09:32 PM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member
G
Joined: Feb 2014
Posts: 146
If you look in the makefile, it will generate the git_desc file with this:

NEW_GIT_VERSION := $(shell git describe --dirty)

If you execute "git describe" from the command line it will tell you the branch of your git.
If you execute "git describe --dirty" it will tell you if you modified the branch locally by adding dirty to the end.


You could set IGNORE_GIT=1 in the makefile and set NEW_GIT_VERSION := negamame.



Code
ifeq (posix,$(SHELLTYPE))
OLD_GIT_VERSION := $(shell cat $(GENDIR)/git_desc 2> /dev/null)
else
OLD_GIT_VERSION := $(shell cat $(GENDIR)/git_desc 2> NUL)
endif
ifneq ($(IGNORE_GIT),1)
NEW_GIT_VERSION := $(shell git describe --dirty)
else
NEW_GIT_VERSION := unknown
endif
ifeq ($(NEW_GIT_VERSION),)
NEW_GIT_VERSION := unknown
endif



and for the version, there's more code in the makefile that will make the file build/generated/version.cpp


Code
ifeq (posix,$(SHELLTYPE))
$(GENDIR)/version.cpp: $(GENDIR)/git_desc | $(GEN_FOLDERS)
        @echo '#define BARE_BUILD_VERSION "0.198"' > $@
        @echo 'extern const char bare_build_version[];' >> $@
        @echo 'extern const char build_version[];' >> $@
        @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@
        @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@
else
$(GENDIR)/version.cpp: $(GENDIR)/git_desc
        @echo #define BARE_BUILD_VERSION "0.198" > $@
        @echo extern const char bare_build_version[]; >> $@
        @echo extern const char build_version[]; >> $@
        @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@
        @echo const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))"; >> $@
endif

Re: NegaMAME [Re: xinyingho] #113520
06/02/18 09:35 PM
06/02/18 09:35 PM
Joined: Dec 2013
Posts: 119
X
xinyingho Offline OP
Senior Member
xinyingho  Offline OP
Senior Member
X
Joined: Dec 2013
Posts: 119
Ah I just found out that the creation of the file version.cpp is directly scripted within the makefile lol.

Edit: thanks Golden Child for the more complete answer. We've written our posts around the same time. Now, I should be able to quickly do a complete release smile

Last edited by xinyingho; 06/02/18 09:37 PM.
Re: NegaMAME [Re: xinyingho] #113549
06/08/18 07:38 AM
06/08/18 07:38 AM
Joined: Dec 2013
Posts: 119
X
xinyingho Offline OP
Senior Member
xinyingho  Offline OP
Senior Member
X
Joined: Dec 2013
Posts: 119
I have another question : I can see that the official binary for MAME 64 v0.198 is 195 MB in size. By just adding a command line option, my own compiled version of MAME 64 has inflated to 309 MB! I compiled on Windows 10 64-bit with the latest official compilation environment by doing "make -j5". Is there anything else I should do to get my own binary to be around the same size as the official binary?

Re: NegaMAME [Re: xinyingho] #113550
06/08/18 08:14 AM
06/08/18 08:14 AM
Joined: Feb 2004
Posts: 1,986
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 1,986
Sydney, Australia
Are you stripping the binary? We do a strip when staging the binary - dist.mak has the rule to do it.

Re: NegaMAME [Re: xinyingho] #113551
06/08/18 08:59 AM
06/08/18 08:59 AM
Joined: Dec 2013
Posts: 119
X
xinyingho Offline OP
Senior Member
xinyingho  Offline OP
Senior Member
X
Joined: Dec 2013
Posts: 119
Thanks Vas Crabb. That did the trick.

Re: NegaMAME [Re: xinyingho] #113553
06/09/18 10:10 AM
06/09/18 10:10 AM
Joined: Dec 2013
Posts: 119
X
xinyingho Offline OP
Senior Member
xinyingho  Offline OP
Senior Member
X
Joined: Dec 2013
Posts: 119
For those interested, the source code for NegaMAME is available at https://github.com/xinyingho/NegaMAME and then select the branch negamame0198. Nothing complicated or fancy smile
I produced 2 binaries:
- Windows: http://www.babelsoft.net/bin/NegaMAME-Win64%200.198.7z
- Linux (compiled on Fedora 28): http://www.babelsoft.net/bin/NegaMAME-Lnx64%200.198.7z
I can't produce a macOS binary as I can't have access to XCode.

You can test it with the latest beta of Negatron:
- Windows all-in-one pack: http://www.babelsoft.net/bin/Negatron-Win64%200.99beta.7z
- Linux: get the Win pack and delete the subfolders jre1.8.0_171 and vlc-3.0.3, which are obviously useless on Linux smile
- MacOS all-in-one pack: http://www.babelsoft.net/bin/Negatron-Mac64%200.99beta.7z
I found a hacky way to still produce a macOS native application of Negatron as compiling Java code doesn't require XCode!

The only thing missing before releasing the official v0.99 of Negatron is the support of bios selection for slots


Who's Online Now
1 registered members (sof-max), 74 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,575
Posts112,038
Members4,812
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.027s Queries: 15 (0.012s) Memory: 5.6369 MB (Peak: 5.8330 MB) Zlib enabled. Server Time: 2018-09-23 12:00:05 UTC