Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How to compile MAME with only specific roms?  (Read 775 times)

0 Members and 1 Guest are viewing this topic.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
How to compile MAME with only specific roms?
« on: May 12, 2020, 01:44:25 am »
I have a list of roms but lets say that it is only 60.
How can I compile just those 60 into MAME, so that all that binary knows is those 60 roms?
So if I type mame.exe -listroms, out pops the 60.

I have tried modifying tiny.lst, I've tried painstakingly creating a list of *.cpp drivers and putting that in arcade.lst.

The arcade.lst and compiling with SUBTARGET=arcade builds just fine, even spits out a binary, unfortunately it's a normal full 11,000 rom binary and not the cut down one you would expect from my very specific list of drivers I put in the arcade.lst file. Now if I get that list wrong, or leave out a needed dependency *.cpp it won't compile, so it is using that list, it just doesn't spit out the binary you would expect, one that only know about the drivers I put in the list.

Any ideas?
Has anyone else done this?

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1160
  • Last login:June 14, 2020, 09:25:30 pm
Re: How to compile MAME with only specific roms?
« Reply #1 on: May 12, 2020, 11:50:46 am »
long time ago i asked the same question with no luck, im just gonna keep my eye on this one to see how it develops.

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:Today at 09:44:19 am
Re: How to compile MAME with only specific roms?
« Reply #2 on: May 12, 2020, 01:13:33 pm »
I think you must remove drivers of all games other than those of your interest

nipsmg

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:Yesterday at 02:39:35 pm
  • ROONEY!! ERRGH!!
    • Arcadia
Re: How to compile MAME with only specific roms?
« Reply #3 on: May 13, 2020, 08:01:17 am »
This is actually spelled out in the mame documentation:

https://docs.mamedev.org/initialsetup/compilingmame.html

Quote
You can do driver specific builds by using SOURCES=<driver> in your make statement. For instance, building Pac-Man by itself would be make SOURCES=src/mame/drivers/pacman.cpp REGENIE=1 including the necessary REGENIE for rebuilding the settings

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
Re: How to compile MAME with only specific roms?
« Reply #4 on: May 13, 2020, 09:02:24 am »
This is actually spelled out in the mame documentation:

https://docs.mamedev.org/initialsetup/compilingmame.html

Quote
You can do driver specific builds by using SOURCES=<driver> in your make statement. For instance, building Pac-Man by itself would be make SOURCES=src/mame/drivers/pacman.cpp REGENIE=1 including the necessary REGENIE for rebuilding the settings

I know, I actually did one for just williams games (which builds a 52 game version of mame), but it you try that with 3900+ drivers/machines is throws a "command line too long".

I think it might actually be working with the flt files as subtargets after all, it's just that it is still 10,000 roms too long. It is at 13,000 down from 42,000, I just can't tell if it's all the clones keeping it high, or the fact that it's building just generic non-mess and not my thinner one  that doesn't include non-working roms.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: How to compile MAME with only specific roms?
« Reply #5 on: May 14, 2020, 03:19:53 pm »
Other than a smaller exe size, there's no real benefit to removing drivers from mame.  It's a fairly pointless exercise. 

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
Re: How to compile MAME with only specific roms?
« Reply #6 on: May 16, 2020, 02:00:58 am »
Other than a smaller exe size, there's no real benefit to removing drivers from mame.  It's a fairly pointless exercise.

I want to be able to manage the insanity that is the 44,000 games and the crazy amount of roms that each of those want.

Once I built the arcade.flt file to my liking (with only the drivers I want, and the remarks for the specific roms that the drivers build that I don't want, I was done.

I can build a 0.220 with just the lightgun games for my Linux box, and when .339 comes out that fixes something in that list, I can just build the .flt file on that source and out pops my custom binary that will tell me exactly what roms my list is missing for the new build.

For me it makes it more manageable, and when I use a rom manager or a list generator against a custom binary, it only spits out the list I want. No broken, no clones unless they are US and then no parent if I want to use the clone. I can build my non-merged rom set without it becoming insane in size.

My XML file is 900k not 250,000k like a full mame build would be.

When I run -verifyroms, my list is manageable and easy to resolve.

I didn't need a full new version of MAME and all the issues that come with it, I just need something I can throw lightgun games at now that I can use both my Aimtraks in Linux.

I attached the custom build list (remove the .txt off the name) so that anyone else that wants to make custom builds can see a working example. Or they can use it to build a lightgun only mame 0.220 build.  Whatever. :)
It goes in the source folder under "mame0220s\src\mame" and has the build command for a quad core at the top.

« Last Edit: May 19, 2020, 06:53:44 pm by MacGyver »

Robbbert

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 112
  • Last login:Today at 11:51:05 am
Re: How to compile MAME with only specific roms?
« Reply #7 on: May 18, 2020, 11:18:48 am »
The way it was done in the old days was to remove or comment out all the unwanted stuff from mame.lst

But since there's about 36,000 games, you might be there awhile.

Or, just remove everything from mame.lst then add in the games you need. You don't need the spacing, the "source" lines or special formatting. Just one line per game.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
Re: How to compile MAME with only specific roms?
« Reply #8 on: May 19, 2020, 10:16:35 pm »
The way it was done in the old days was to remove or comment out all the unwanted stuff from mame.lst

But since there's about 36,000 games, you might be there awhile.

Or, just remove everything from mame.lst then add in the games you need. You don't need the spacing, the "source" lines or special formatting. Just one line per game.

Can confirm that will work in Windows, Linux, not so much, it doesn't build an executable and spits out about 60 errors on the same mame.lst that works in Windows.  It did this with the arcade.flt and its weird driver method but it could be resolved by finding the dependencies that it thinks it wants and removing the extra roms that creates, but the mame.lst either has a name or doesn't, not a lot of things you can manipulate there.

Here is the linux output from the same simple mame.lst hat works in Windows.
Code: [Select]
Building driver list...
107 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `taito_fx1b_state::base_config(machine_config&)':
zn.cpp:(.text+0x3b51): undefined reference to `taito_zoom_device::taito_zoom_device(machine_config const&, char const*, device_t*, unsigned int)'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `taito_fx1b_state::main_map(address_map&)':
zn.cpp:(.text+0x63e5): undefined reference to `taito_zoom_device::reg_data_w(address_space&, unsigned int, unsigned short, unsigned short)'
zn.cpp:(.text+0x640f): undefined reference to `taito_zoom_device::reg_address_w(address_space&, unsigned int, unsigned short, unsigned short)'
zn.cpp:(.text+0x6439): undefined reference to `taito_zoom_device::sound_irq_w(address_space&, unsigned int, unsigned short, unsigned short)'
zn.cpp:(.text+0x64cc): undefined reference to `taito_zoom_device::sound_irq_r(address_space&, unsigned int, unsigned short)'
zn.cpp:(.text+0x65b3): undefined reference to `taito_zoom_device::shared_ram_r(address_space&, unsigned int, unsigned char)'
zn.cpp:(.text+0x6625): undefined reference to `taito_zoom_device::shared_ram_w(address_space&, unsigned int, unsigned char, unsigned char)'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `delegate_generic_class* delegate_base<void, address_space&, unsigned int, unsigned short, unsigned short>::late_bind_helper<taito_zoom_device>(delegate_late_bind&) [clone .part.392]':
zn.cpp:(.text.unlikely+0x13aa): undefined reference to `typeinfo for taito_zoom_device'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `delegate_generic_class* delegate_base<void, address_space&, unsigned int, unsigned short, unsigned short>::late_bind_helper<taito_zoom_device>(delegate_late_bind&)':
zn.cpp:(.text._ZN13delegate_baseIvJR13address_spacejttEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseIvJR13address_spacejttEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x4): undefined reference to `typeinfo for taito_zoom_device'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `delegate_generic_class* delegate_base<unsigned short, address_space&, unsigned int, unsigned short>::late_bind_helper<taito_zoom_device>(delegate_late_bind&)':
zn.cpp:(.text._ZN13delegate_baseItJR13address_spacejtEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseItJR13address_spacejtEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x4): undefined reference to `typeinfo for taito_zoom_device'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `delegate_generic_class* delegate_base<unsigned char, address_space&, unsigned int, unsigned char>::late_bind_helper<taito_zoom_device>(delegate_late_bind&)':
zn.cpp:(.text._ZN13delegate_baseIhJR13address_spacejhEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseIhJR13address_spacejhEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x4): undefined reference to `typeinfo for taito_zoom_device'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `delegate_generic_class* delegate_base<void, address_space&, unsigned int, unsigned char, unsigned char>::late_bind_helper<taito_zoom_device>(delegate_late_bind&)':
zn.cpp:(.text._ZN13delegate_baseIvJR13address_spacejhhEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind[_ZN13delegate_baseIvJR13address_spacejhhEE16late_bind_helperI17taito_zoom_deviceEEP22delegate_generic_classR18delegate_late_bind]+0x4): undefined reference to `typeinfo for taito_zoom_device'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `std::unique_ptr<device_t, std::default_delete<device_t> > emu::detail::device_type_impl_base::create_driver<taito_fx1b_state>(emu::detail::device_type_impl_base const&, machine_config const&, char const*, device_t*, unsigned int)':
zn.cpp:(.text._ZN3emu6detail21device_type_impl_base13create_driverI16taito_fx1b_stateEESt10unique_ptrI8device_tSt14default_deleteIS5_EERKS1_RK14machine_configPKcPS5_j[_ZN3emu6detail21device_type_impl_base13create_driverI16taito_fx1b_stateEESt10unique_ptrI8device_tSt14default_deleteIS5_EERKS1_RK14machine_configPKcPS5_j]+0x12a): undefined reference to `vtable for device_finder<taito_zoom_device, true>'
../../../../linux_gcc/bin/x64/Release/mame_mame/libsony.a(zn.o): In function `std::unique_ptr<device_t, std::default_delete<device_t> > emu::detail::device_type_impl_base::create_driver<gdarius_state>(emu::detail::device_type_impl_base const&, machine_config const&, char const*, device_t*, unsigned int)':
zn.cpp:(.text._ZN3emu6detail21device_type_impl_base13create_driverI13gdarius_stateEESt10unique_ptrI8device_tSt14default_deleteIS5_EERKS1_RK14machine_configPKcPS5_j[_ZN3emu6detail21device_type_impl_base13create_driverI13gdarius_stateEESt10unique_ptrI8device_tSt14default_deleteIS5_EERKS1_RK14machine_configPKcPS5_j]+0x12a): undefined reference to `vtable for device_finder<taito_zoom_device, true>'
collect2: error: ld returned 1 exit status
mame.make:268: recipe for target '../../../../../mame64' failed
make[2]: *** [../../../../../mame64] Error 1
Makefile:1132: recipe for target 'mame' failed
make[1]: *** [mame] Error 2
makefile:1349: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2

Here is Windows build on the same list
Code: [Select]
Building driver list...
Emitting mamevers.rc...
107 driver(s) found
Compiling resources scripts/resources/windows/mame/mame.rc...
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64.exe...
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: missing --end-group; added as last command line option
« Last Edit: May 19, 2020, 10:19:04 pm by MacGyver »

Robbbert

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 112
  • Last login:Today at 11:51:05 am
Re: How to compile MAME with only specific roms?
« Reply #9 on: May 19, 2020, 11:14:09 pm »
Seems that your linux build might be a little out of date, or you tried adjusting it incorrectly.

Make sure that the line MAME_DIR .. "src/mame/audio/taito_zm.cpp" exists (it's at about line 4087 in the current arcade.lua file).


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: How to compile MAME with only specific roms?
« Reply #10 on: May 20, 2020, 01:18:16 am »
It's a lot easier to just generate an admittedly huge and cumbersome list.xml and then filter that rather than altering mame itself.  Like I said, there isn't much point to it. 

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
Re: How to compile MAME with only specific roms?
« Reply #11 on: May 20, 2020, 01:23:13 am »
Seems that your linux build might be a little out of date, or you tried adjusting it incorrectly.

Make sure that the line MAME_DIR .. "src/mame/audio/taito_zm.cpp" exists (it's at about line 4087 in the current arcade.lua file).

The mame source  is new from the official page and the build environment is up to date, Linux mame just really seems to hate building custom versions.
And as you can see the file is there. It will build a complete version and an arcade  and tiny version with no problems. The Linux system just doesn't seem to do dependencies correctly, at least not like the Windows versoin.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 313
  • Last login:August 13, 2020, 02:03:47 am
    • Project Build
Re: How to compile MAME with only specific roms?
« Reply #12 on: May 20, 2020, 01:27:59 am »
It's a lot easier to just generate an admittedly huge and cumbersome list.xml and then filter that rather than altering mame itself.  Like I said, there isn't much point to it.

It was a pain, but it is more like a crossword puzzle than anything, the challenge is the game, even if you need help with a word every now and again. And in the end I was able to get it to work the way I wanted, and my xml is manageable and my roms are perfect. :)