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.239 Appliance on a Raspberry Pi 4/Pi 400  (Read 70190 times)

0 Members and 1 Guest are viewing this topic.

bbegin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 162
  • Last login:January 08, 2022, 06:08:11 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:November 16, 2021, 05:55:18 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:Yesterday at 12:53:58 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 7689
  • Last login:Today at 11:45:27 am
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: 64
  • Last login:Today at 05:54:53 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: 7689
  • Last login:Today at 11:45:27 am
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: 64
  • Last login:Today at 05:54:53 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: 7689
  • Last login:Today at 11:45:27 am
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: 970
  • Last login:Today at 01:57:17 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 5
  • Last login:January 08, 2022, 01:42:08 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 5
  • Last login:January 08, 2022, 01:42:08 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 5
  • Last login:January 08, 2022, 01:42:08 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 5
  • Last login:January 08, 2022, 01:42:08 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: 162
  • Last login:January 08, 2022, 06:08:11 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: 5
  • Last login:January 08, 2022, 01:42:08 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: 162
  • Last login:January 08, 2022, 06:08:11 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