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 make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400  (Read 82442 times)

0 Members and 1 Guest are viewing this topic.

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
« Reply #320 on: November 12, 2021, 10:48:41 am »
Hello,

I've been trying to use this image, and I'm very appreciative that you've created it, but I do have a couple questions:

Is the BGFX graphics mode not available in this image? I believe I was using it when running Mame on top of raspbian normally, but with this image, any option other than "accel" causes games to straight-up not load.

Is that intentional behaviour?

Hi, I will try to answer your questions. FYI, I am the author of this image, but people like Samson are creating great value-added work that he then shares with everyone.  :applaud:

BGFX is not available on this image. The reason is that a specific file the source code (drawbgfx.cpp) is making a reference to X11, wich is (volontarily) not available/not installed on this image.

EDIT: FYI, I already filed a bug for this issue: https://mametesters.org/view.php?id=7738

Also, is there a trick to setting the resolution of the display? I have my pi plugged into a 1440p display, but rendering at that resolution makes these games impossible to play, and very slow. In Raspbian, I used the regular display configure settings, but using raspi-config through SSH here doesn't seem to be doing anything... am I missing something?

To modify the resolution, you should modify /boot/config.txt with hdmi_mode=.

Please refer to:
https://www.raspberrypi.com/documentation/computers/config_txt.html
https://www.shellhacks.com/raspberry-pi-force-hdmi-hotplug/
« Last Edit: November 12, 2021, 10:55:12 am by bbegin »
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Samson

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10
  • Last login:March 23, 2022, 04:18:46 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
« Reply #321 on: November 13, 2021, 05:34:39 pm »
I just want to say thanks for this.


Hi, I will try to answer your questions. FYI, I am the author of this image, but people like Samson are creating great value-added work that he then shares with everyone.  :applaud:


Hey thanks, I'm glad you found this useful!



LuckyTiger

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:May 22, 2022, 03:46:39 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
« Reply #322 on: December 01, 2021, 09:39:34 am »
Thank you for this project bbegin! I've always wanted to run recent version of MAME on my Pi4. Bravo!  :applaud:

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
« Reply #323 on: December 02, 2021, 08:29:25 pm »
Thank you for this project bbegin! I've always wanted to run recent version of MAME on my Pi4. Bravo!  :applaud:

Thanks LuckyTiger!  :)
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #324 on: December 02, 2021, 08:29:52 pm »
Just to let you know the availability of the NEW disk image file with MAME 0.238 (please see the original post of this thread for the download link).  :cheers:
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7781
  • Last login:Yesterday at 02:44:22 pm
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #325 on: December 09, 2021, 06:59:58 pm »
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!

10yard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 108
  • Last login:Yesterday at 05:22:25 pm
  • L BREAK into program
    • DKAFE Frontend
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #326 on: December 10, 2021, 07:49:26 am »
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!
I've done this a bunch of times so will chime in to assist.

You can use the "pishrink" utility from https://github.com/Drewsif/PiShrink
You will need a USB storage device of greater capacity than the used space on the SD card you are attempting to shrink.  EDIT: We will copy over the used space to an external USB storage device and then shrink it down as small as possible.

Steps to prepare the USB flash drive.  It will be mounted to pi as a working area for performing the shrink.

* Format your USB flash drive as NTFS (assuming you are on Windows). Give the volume the name "USB".  It will help us to identify the device when we mount it to the pi.

* Connect USB drive to your pi.

* Boot pi with SD card you want to shrink inserted

* Verify USB mounted.  Your USB drive should be automatically mounted at /media/pi/USB.  I don't have the appliance at the moment so can't be 100%.  Give it a try.

Code: [Select]
dir /media/pi/USB

* if not found then you can query mount points using command

Code: [Select]
lsblk


Steps for the shrinking.

* Install pishrink utility

Code: [Select]
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin

* We now make a copy of the used allocation of your SD card.  You should specify a slightly larger size to be safe,  so if you've used 7.5GB of space I would round to 8GB (8000 blocks).  Set the count= argument accordingly.

Code: [Select]
sudo dd if=/dev/mmcblk0 of=/media/pi/USB/shrunk_my_junk.img bs=1M count=8000

* All being well an image file was created on the USB drive.  If the above command returns an error then increase the count and try again.

Code: [Select]
cd /media/pi/USB
dir

* Now we can shrinkify that image

Code: [Select]
sudo pishrink.sh -z shrunk_my_junk.img

That's it.
You should now have a shrunken image on your USB drive which you can copy to your PC and write to a smaller SD card.
Hope if works out for you.
« Last Edit: December 10, 2021, 02:56:50 pm by 10yard »
Check out my Donkey Kong Arcade Frontend at https://github.com/10yard/dkafe#readme

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7781
  • Last login:Yesterday at 02:44:22 pm
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #327 on: December 10, 2021, 12:22:32 pm »
This is great info.  I will give this a shot this afternoon or tomorrow (stupid work calls are going to kill the rest of my day...).

For the USB drive that needs to be larger than the SD card I'm trying to shrink, it sounds like it only has to be larger than the USED space.  So, for example, I have a 128GB microSD card but only using about 12GB of that space if I had to guess.  So you are saying that I could use a 32GB USB drive to make this work, which is larger than the USED space on my 128GB microSD card?  It doesn't need to be 256GB or something larger than my 128GB microSD card)?

Also, I assume I can use an external HDD or memory card for this (doesn't have to be a USB stick)?

Thanks!!

10yard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 108
  • Last login:Yesterday at 05:22:25 pm
  • L BREAK into program
    • DKAFE Frontend
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #328 on: December 10, 2021, 02:36:25 pm »
For the USB drive that needs to be larger than the SD card I'm trying to shrink, it sounds like it only has to be larger than the USED space.  So, for example, I have a 128GB microSD card but only using about 12GB of that space if I had to guess.  So you are saying that I could use a 32GB USB drive to make this work, which is larger than the USED space on my 128GB microSD card?  It doesn't need to be 256GB or something larger than my 128GB microSD card)?

Also, I assume I can use an external HDD or memory card for this (doesn't have to be a USB stick)?

Thanks!!
The USB needs to be larger than the USED space,  not larger than the SD card.   Yes,  in your scenario,  a 16GB or 32GB drive should work.  Basically,  we are copying over the used space to an external device (USB storage) and then shrinking it down.

Any external USB memory should work if NTFS formatted.  I use a 16GB USB stick,  overkill for my 3GB of USED space on the card.  I was able to shrink that down to 1.2GB image.   Note that the image will be automatically packed into a tar.gz file to further reduce size.  That file works directly with Rasp Pi Imager software.
« Last Edit: December 10, 2021, 02:39:28 pm by 10yard »
Check out my Donkey Kong Arcade Frontend at https://github.com/10yard/dkafe#readme

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7781
  • Last login:Yesterday at 02:44:22 pm
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #329 on: December 10, 2021, 02:57:42 pm »
Excellent.  Thanks.  I just ran a check on my card and it looks like I'm using less than 10GB.  Am I reading this right even though Use% for /dev/root/ is 52% and /dev/mmcblk0p1 is 22%.  I assume this is Use% of the different partitions, not the entire card (or the numbers wouldn't add up).

J_K_M_A_N

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 975
  • Last login:Yesterday at 10:10:52 pm
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #330 on: December 10, 2021, 03:10:32 pm »
You may want to use disk Win32 Disk imager (or whatever you have to make an image of the card) to make a backup JUST IN CASE. :) I am not saying it will not work (VERY likely it will work) but if there is some kind of malfunction, you could at least load it back on the 128 and try again. Unfortunately, I am speaking from experience. :( I have rebuilt a few pi builds.

J_K_M_A_N

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
« Reply #331 on: December 11, 2021, 04:26:41 pm »
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!

This can be done, but we have to take some steps, as the data partition cannot be shrinked (current limitation of the F2FS filesystem). Please note that I did not tested these steps, they are given to the best of my knowledge, but should normally work.

From your Raspberry Pi, with original SD card:
Code: [Select]
# Log in SSH (or from the console, if a keyboard is attached) to the Pi
# Put the system in Service Mode
servicemode
# Shutdown the system
sudo poweroff
# Remove the original SD card from your Raspberry Pi

From a Linux host/PC:
Code: [Select]
# Insert your original SD card
# Dump content to an image-file (assuming your SD card is allocated to /dev/sdd)
sudo dd if=/dev/sdd of=raspios.mame.img status=progress bs=4M
sync
# Switch the SD card, insert your 32GB card
# Write the first 32GB of the image-file to the 32GB SD card (assuming your SD card is allocated to /dev/sdd)
sudo dd if=raspios.mame.img of=/dev/sdd status=progress bs=1M count=32000
sync
rm raspios.mame.img
# Unplug the SD card from your host/PC and insert it in your Raspberry Pi

From the Raspberry Pi in Service Mode:
Code: [Select]
# Log in SSH (or from the console, if a keyboard is attached) to the Pi
# You should be in Service Mode
sudo umount /data
sudo fdisk /dev/mmcblk0p3
# Print the current partition table
p
# Delete the 3rd partition
d, 3
# Set the new size of the partition
First sector: specify previous Start value for the 3rd partition (see the partition table, above)
Last sector: accept the default (to use all remaining free space)
Do you want to remove the signature?   # Answer with Y
# Write the modified partition table
w

# Recreate the F2FS filesystem on the 3rd partition
sudo mkfs.f2fs -l data /dev/mmcblk0p3
# Mount the partition to /data mountpoint
sudo mount -t f2fs -o rw /dev/mmcblk0p3 /data

From your Linux host/PC:
Code: [Select]
# Insert the original SD card
# Identify the device allocated to your SD card
lsblk
# We will use /dev/sdd as an example of your SD card
# Find the mountpoint of the 3rd partition of your SD card
findmnt -S /dev/sdd3
# We use /mnt/data as an example mountpoint
# Copy the content of data partition recursively to your Raspberry Pi
scp -r /mnt/data/* pi@IP.ADDRESS.OF.YOUR.PI/data

From the Raspberry Pi (still in Service Mode):
Code: [Select]
# Make sure everything is there
ls -la /data
# Switch to Arcade Mode
arcademode
# Reboot
sudo reboot

Enjoy! :)
« Last Edit: December 14, 2021, 02:07:29 pm by bbegin »
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #332 on: December 31, 2021, 05:39:01 pm »
Just to let you know the availability of the NEW disk image file with MAME 0.239 (please see the original post of this thread for the download link).  :cheers:

Also included in this release:
 - The Hypseus-Singe binary (for LaserDisc games emulation) has been updated to v2.6.21-RPi
« Last Edit: December 31, 2021, 08:12:03 pm by bbegin »
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #333 on: January 03, 2022, 09:44:29 am »
I've tried to install the latest version with MAME 0.239.

First thing I wanted to do was to activate the WIFI with raspi-config. Got the famous "could not communicate with wpa_suppliant" message. I thought this was an old bug that already has been fixed? When I wanted do install wpasupplicant with atp-get, the answer was that this module is already installed.

There also is a bug in mame-versionscheck.sh in line 10: [: -qt: unary operator expected
This error is shown after login.
« Last Edit: January 03, 2022, 09:54:08 am by wimpie3 »

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #334 on: January 04, 2022, 09:14:43 pm »
I've tried to install the latest version with MAME 0.239.

There also is a bug in mame-versionscheck.sh in line 10: [: -qt: unary operator expected
This error is shown after login.

I fixed the script in the new version of the image. Upload to Google Drive in progress. Stay tuned. I will post once the upload is completed. Sorry about that.

First thing I wanted to do was to activate the WIFI with raspi-config. Got the famous "could not communicate with wpa_suppliant" message. I thought this was an old bug that already has been fixed? When I wanted do install wpasupplicant with atp-get, the answer was that this module is already installed.

Do you switch to read/write (just type: rw) mode before invvoking raspi-config?

Can you post me the result of those commands?

Code: [Select]
sudo iwlist wlan0 scan
sudo ifconfig
sudo rfkill

Thanks in advance!
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #335 on: January 05, 2022, 10:58:39 am »
Hi there, thanks for responding.

I managed to get the wifi up and running by putting the special config file in the root.

I got to the point until I fully configured Attract and MAME. Worked like a charm. Today I wanted to play some games and... as soon as I launch them with Attract, I see the MAME screen and everything hangs. So I've checked out the mame.ini file in the /data directory. 8000 bytes full of garbage. I deleted the file. Sudo reboot. File is there again!

OK, I open up a putty session. Asks me for my password, all seems okay. And that's it. The system hangs afterwards:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
Last login: Tue Jan  4 09:16:18 2022

I can press CTRL+C to abort, and I get a prompt, but typing things like "rw" or "servicemode" result in a "command not found". So I'm a bit stuck now. Obviously the system decided to do some mean things to the MAME file, but now I can't get into servicemode anymore since nothing happens after the prompt...

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #336 on: January 05, 2022, 05:41:06 pm »
Hi there, thanks for responding.

I managed to get the wifi up and running by putting the special config file in the root.

I got to the point until I fully configured Attract and MAME. Worked like a charm. Today I wanted to play some games and... as soon as I launch them with Attract, I see the MAME screen and everything hangs. So I've checked out the mame.ini file in the /data directory. 8000 bytes full of garbage. I deleted the file. Sudo reboot. File is there again!

OK, I open up a putty session. Asks me for my password, all seems okay. And that's it. The system hangs afterwards:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
Last login: Tue Jan  4 09:16:18 2022

I can press CTRL+C to abort, and I get a prompt, but typing things like "rw" or "servicemode" result in a "command not found". So I'm a bit stuck now. Obviously the system decided to do some mean things to the MAME file, but now I can't get into servicemode anymore since nothing happens after the prompt...

Just to let you know, I completed the upload of the new image file with updated scripts. Can you download again, please?

On the first run, you have to expand the data partition with:

Code: [Select]
expand-data-partition.sh
Thanks in advance!
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
« Reply #337 on: January 07, 2022, 11:47:30 am »
Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.

I agree, MAME-PSGS looks stunning! But how can we add this? I've tried modifying mame.ini. I've reset "effect" to "none" and I've pasted this at the bottom:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         ".$HOME/.mame/roms/mame-psgs"

I've put mame-psgs.vsh and mame-psgs_rgb32_dir.fsh in the mame rom directory. But it doesn't seem to work. Am I overlooking something?

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
« Reply #338 on: January 07, 2022, 03:24:55 pm »
Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.

I agree, MAME-PSGS looks stunning! But how can we add this? I've tried modifying mame.ini. I've reset "effect" to "none" and I've pasted this at the bottom:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         ".$HOME/.mame/roms/mame-psgs"

I've put mame-psgs.vsh and mame-psgs_rgb32_dir.fsh in the mame rom directory. But it doesn't seem to work. Am I overlooking something?

I see 3 elements in your path:
1. You have an extra leading dot (.) just before $HOME
2. No need to use double quotes
3. You should use a dedicated folder for the GLSL shaders (for example: $HOME/.mame/glsl)

For example, you may use:

Code: [Select]
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs
Just create the glsl folder under /data/mame.
« Last Edit: January 07, 2022, 03:27:01 pm by bbegin »
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #339 on: January 08, 2022, 09:45:20 am »
@bbegin Thanks for your help, unfortunately it's not working. What I have right now:

In mame.ini I've set effect to none
and added this at the end of mame.ini:
#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs

I've created a directory /data/mame/glsl with these files:
custom_crt.vsh (contents: palette_emulation = 0.0;)
mame-psgs.vsh
mame-psgs_rgb32_dir.fsh

When I launch mame there is no filter effect present.

Could it be that glsl shaders only work when video=opengl?

Edit: google says that "GLSL requires OpenGL support", can I just change video to opengl and not use the current accel option? Or would that break my installation?
« Last Edit: January 08, 2022, 09:50:42 am by wimpie3 »

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #340 on: January 08, 2022, 01:13:01 pm »
@bbegin Thanks for your help, unfortunately it's not working. What I have right now:

In mame.ini I've set effect to none
and added this at the end of mame.ini:
#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs

I've created a directory /data/mame/glsl with these files:
custom_crt.vsh (contents: palette_emulation = 0.0;)
mame-psgs.vsh
mame-psgs_rgb32_dir.fsh

When I launch mame there is no filter effect present.

Could it be that glsl shaders only work when video=opengl?

Edit: google says that "GLSL requires OpenGL support", can I just change video to opengl and not use the current accel option? Or would that break my installation?

Just to make sure, your files have to be located under /data/mame/glsl/mame-psgs, not directly under /data/mame/glsl
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #341 on: January 08, 2022, 01:42:08 pm »

Just to make sure, your files have to be located under /data/mame/glsl/mame-psgs, not directly under /data/mame/glsl

That wasn't the case. Created the directory, moved the files, still not working. I know this is a bit out-of-scope for your project, but I really wanted to get this working since GLSL can offer that unique CRT look.  :banghead:

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #342 on: January 08, 2022, 05:53:14 pm »
I will take a look at this tonight and I will give you feedback.  :cheers:
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

wimpie3

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:January 28, 2022, 12:25:41 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #343 on: January 28, 2022, 12:25:41 pm »
How can I edit boot.txt in servicemode?

This is what I get now:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
The system is currently in SERVICE mode (MAME 0.239), current Frontend is: Attract Mode.
Hypseus Singe v2.6.21-RPi.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@arcade(ro):~$ sudo nano /boot/config.txt

And when the file shows up, I see the message "[ File '/boot/config.txt' is unwritable ]"

How is this possible? I'm clearly in service mode so the filesystem should be writeable...

J_K_M_A_N

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 975
  • Last login:Yesterday at 10:10:52 pm
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #344 on: January 28, 2022, 01:38:31 pm »
How can I edit boot.txt in servicemode?

This is what I get now:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
The system is currently in SERVICE mode (MAME 0.239), current Frontend is: Attract Mode.
Hypseus Singe v2.6.21-RPi.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@arcade(ro):~$ sudo nano /boot/config.txt

And when the file shows up, I see the message "[ File '/boot/config.txt' is unwritable ]"

How is this possible? I'm clearly in service mode so the filesystem should be writeable...

You have to put it in read-write mode first.

Code: [Select]
rw
Then you can edit the file and put it back into read-only mode.

Code: [Select]
ro
J_K_M_A_N

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7781
  • Last login:Yesterday at 02:44:22 pm
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #345 on: February 01, 2022, 04:20:11 pm »
Are you guys trying to get CRT shaders working with MAME?  Is there any way to do this without taking a massive hit in performance?  I finally have everything set up the way I want (it's awesome) and this would be the finishing touch.   :cheers:

EDIT: I can confirm changing "video" to "bgfx" does not work.  MAME won't even launch.
« Last Edit: February 01, 2022, 04:29:53 pm by javeryh »

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
« Reply #346 on: February 04, 2022, 04:52:30 pm »
Yes, as javeryh said it, bgfx is unfortunately not working with the current MAME custom build.

The reason is because we do not use X11 (no window manager) and there is 2 references to X11 in src/osd/modules/render/drawbgfx.cpp, even if we tell the build that we are NOT using X11 (with NO_X11=1 on the "make" command-line).

At the current state, the code is not taking care completely of this directive (NO_X11=1) for our use case. I filed a bug to the MAME developers team (bug id is 07738) and can be viewed at: https://mametesters.org/view.php?id=7738
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #347 on: February 25, 2022, 02:42:56 pm »
Just to let you know the availability of the NEW disk image file with MAME 0.241 (please see the original post of this thread for the download link).  :cheers:
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7781
  • Last login:Yesterday at 02:44:22 pm
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #348 on: March 03, 2022, 01:31:09 pm »
Just to let you know the availability of the NEW disk image file with MAME 0.241 (please see the original post of this thread for the download link).  :cheers:

Thanks bbegin.  Anyone on the fence about this should definitely give it a try!

My cabinets are almost finished... I am having a hard time powering on and off with one button press because I think the pi still draws 70mA of power when "off" when you use the safe shutdown script.  Your image works brilliantly but when I shut down the pi, my smartstrip is still sensing a power draw so it does not turn off the marquee light or the amp.  I ordered a Mausberry Circuit that is supposed to completely cut power so hopefully that takes care of things.   :cheers:

Jaseguges

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:May 22, 2022, 05:19:06 pm
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #349 on: March 08, 2022, 08:49:43 pm »
Hello, arcade and forum noob here.  I really love the idea of eliminating RetroPie and having just Mame with AttractMode on my Rpie 3 B+.  I've tried my best to get the image working on my pi but I cant manage to get to the AttractMode Menu.  Is there a guide with step by step instructions that I could refer to?  Really love what you're doing here, hope to get it running soon.  Thanks!

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #350 on: March 09, 2022, 08:34:34 am »
Hello, arcade and forum noob here.  I really love the idea of eliminating RetroPie and having just Mame with AttractMode on my Rpie 3 B+.  I've tried my best to get the image working on my pi but I cant manage to get to the AttractMode Menu.  Is there a guide with step by step instructions that I could refer to?  Really love what you're doing here, hope to get it running soon.  Thanks!

Hello, yes I built a step-by-step guide to build the image. The only steps I need to add is how to build Attract Mode and Hypseus Singe (wich are incluses un the pre-built image).

The steps are un french, but you can translate Them (see 2nd link):

https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Google Translation to English:

https://translate.google.ca/translate?hl=fr&tab=wT&sl=fr&tl=en&u=https%3A%2F%2Fgist.github.com%2Fsonicprod%2Ff5a7bb10fb9ed1cc5124766831e120c4
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Jaseguges

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:May 22, 2022, 05:19:06 pm
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #351 on: March 09, 2022, 09:04:09 am »
Thanks for getting back to me!  I downloaded the image from the link on the original post and flashed it to my SD card.  Do I still follow the instructions on GitHub?

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #352 on: March 09, 2022, 09:39:44 am »
Thanks for getting back to me!  I downloaded the image from the link on the original post and flashed it to my SD card.  Do I still follow the instructions on GitHub?

No, you don't need to follow the instructions on Github for the pre-built images. Everything is in there.

The instructions on Github are there if you want to built the image for yourself, from scratch. This way, you may be able to adapt it for Raspberry Pi 3B+.

Enjoy!   :cheers:
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Jaseguges

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:May 22, 2022, 05:19:06 pm
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #353 on: March 09, 2022, 10:58:08 am »
Oh I see, the problem is I only have a Pi 3 B+.  Looking forward to getting a pi4 so I can use this awesome image, thanks!
 :cheers:

nts31180

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 21, 2022, 06:10:57 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #354 on: March 10, 2022, 10:54:10 am »
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....
« Last Edit: March 10, 2022, 12:57:00 pm by nts31180 »

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #355 on: March 10, 2022, 10:08:04 pm »
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....

Hi nts31180,

No, it's not a dumb question at all. The cause is that the firmware/boot loader is too old for the newer hardware revisions of Raspberry Pi 4. Sorry about that.

I will update the image file and re-publish it. Stay tuned.
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #356 on: March 12, 2022, 05:34:52 pm »
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....

The image has been updated. See the original post of this thread for the new download link.

Let me know if this solves the issue you're experiencing. Thanks!
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

nts31180

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 21, 2022, 06:10:57 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #357 on: March 14, 2022, 01:47:24 pm »
Thanks so much, this did fix the issue.
Now just to work on uploading ROMs. Is there any write up I missed in the comments of how to do that? Has to be done through Sambra i'm seeing?
I'll have to research Sambra.

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 178
  • Last login:May 24, 2022, 10:31:23 pm
  • Arcade games enthusiast, bartop arcade project WIP
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #358 on: March 14, 2022, 02:39:31 pm »
Thanks so much, this did fix the issue.
Now just to work on uploading ROMs. Is there any write up I missed in the comments of how to do that? Has to be done through Sambra i'm seeing?
I'll have to research Sambra.

Hi nts31180,

You first need to expand the /data partition. To do so, execute this, once in a SSH session to the Raspberry Pi:

Code: [Select]
./expand-data-partition.sh
Please, refer to the README.txt file in the home folder (to viszualise the file, type: less README.txt). Refer to the "ROMS MANAGEMENT" section to know how to transfer ROM files to the system (and manage them).
Personal project:
How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400
https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

nts31180

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:March 21, 2022, 06:10:57 pm
  • I want to build my own arcade controls!
Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
« Reply #359 on: March 14, 2022, 05:43:28 pm »
Thanks, Used the expand data partition. And then using ethernet I was finally able to map the Sambra drive to be able to transfer roms!
Thanks for all the help.  Hopefully smooth sailing from here.