OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Mame4all, MAME4ALL on the Zaurus!
danboid
post Nov 1 2015, 09:53 AM
Post #1





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



All the effort I put into upgrading my Banana Pi to the latest ALARM kernel and figuring out how to cross-compile for the Zaurus recently has paid off as I'm proud to announce that I have MAME4ALL running like a dream under Arch on my Zaurus so I can now carry a full arcades worth of games as well as a complete Linux box in my pocket!

To run MAME fullscreen under the console you need to install customised builds of both sdl and directfb.

There is a weird bug where sometimes mame4all doesn't find any of the ROMs. I've found that if you simply exit MAME, rename the roms folder to anything then rename it back to roms fixes it.

M4A compiled with only a few small changes to the Linux Makefile - the only addition I had to make was to add -lm onto the end of the LDFLAGS.

INSTALLATION INSTRUCTIONS


* Download mame4all.gz, ungzip it and copy it into /usr/local/bin or /usr/bin on your Z and make sure its executable, which it likely already is.
* Make a directory called /mame4all/roms and copy some MAME4ALL (MAME 0.37b) compat. ROMs into it.
* If you're not using the patched sdl and directfb to enable a fullscreen display then you will need to export:

CODE
export SDL_VIDEO_FBCON_ROTATION=CW


Before you run M4A. If you want this env var exported on boot then you can add that line to /etc/profile

USAGE

Just run `mame4all` to start M4A. Use the arrow keys and ENTER to select and run ROMs whilst pushing TAB moves down one page through the ROM list.

Calendar/Sync key = Insert coin
ENTER = Player 1 start
CTRL = Button 1
ALT = Button 2
LEFT SHIFT = Button 3
CANCEL (ESC) = Return to the main menu
CTRL+C = Quit M4A
Attached File(s)
Attached File  mame4all.gz ( 1.82MB ) Number of downloads: 112
 
Go to the top of the page
 
+Quote Post
ArchiMark
post Nov 1 2015, 06:44 PM
Post #2





Group: Admin
Posts: 1,646
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



This is great, Dan!

Thanks for all the work and sharing it....

Will give it a try when I have some time....

smile.gif
Go to the top of the page
 
+Quote Post
danboid
post Nov 2 2015, 10:36 AM
Post #3





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



I got Quake running on my Z today!

However, its not really playable yet as there seems to be an issue with directfb output under both SDL1 and 2 at both VGA and QVGA resolutions that causes the display to be 'cropped'. The screen is offset a number of pixels down and to the left as if it needs its top-right hand corner to be dragged back into the right position. The good news here is that QVGA directfb output is closer to working properly with SDL than SDL's QVGA output via fbcon.

The build of MAME4ALL I posted in the OP was compiled with directfb support but sadly neither SDL1 nor SDL2 in Arch have directfb support compiled in as standard so I've had to create custom directfb-enabled SDL packages. I have attached my directfb-enabled build of SDL1 (as used by MAME4ALL) to this post.

Note that to install the attached SDL package you will first need to uncompress the tarball to get the Arch .tar.xz package as well as uninstall your existing SDL and everything that depends on SDL like so:

CODE
pacman -Rcn sdl


After installing the attached SDL, you will be required to (re)install both sdl_mixer and directfb before you can run mame4all:

CODE
pacman -S sdl_mixer directfb


To get mame4all to use directfb at QVGA resolution, run the following before you start mame4all:

CODE
export SDL_VIDEODRIVER=directfb
export DFBARGS="force-windowed,layer-rotate=270,mode=240x320,scaled=320x240"


After we have directfb working correctly under MAME4ALL I'll release my SDL2 and Quake packages and update the OP in this thread to instruct users to replace sdl and use the directfb EVs from this post (or something like them) instead.
Attached File(s)
Attached File  sdl_1.2.15_7_directfb.tar.gz ( 316.57K ) Number of downloads: 71
 
Go to the top of the page
 
+Quote Post
ArchiMark
post Nov 2 2015, 12:41 PM
Post #4





Group: Admin
Posts: 1,646
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



That's excellent news and great progress!

Keep us posted....

biggrin.gif
Go to the top of the page
 
+Quote Post
danboid
post Nov 3 2015, 05:05 AM
Post #5





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



Here are some screenshots of what the MAME4ALL menu looks like at QVGA using SDL1 + directfb as well as what tyr-quake looks like at VGA using SDL2 and directfb.SDL2 has no support for fbcon output like SDL1 does. You can see they both suffer the same display problem.
Attached thumbnail(s)
Attached Image
Attached Image
Attached Image
 
Go to the top of the page
 
+Quote Post
danboid
post Nov 3 2015, 08:29 AM
Post #6





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



Those pics were took under Linux 4.2.3. I've just tried with 3.11.3 but I get the same results.
Go to the top of the page
 
+Quote Post
ArchiMark
post Nov 3 2015, 09:14 AM
Post #7





Group: Admin
Posts: 1,646
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



Looking good....

Thanks again for sharing...
Go to the top of the page
 
+Quote Post
danboid
post Nov 3 2015, 09:42 AM
Post #8





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



daal has had success with using directfb on the Zaurus before. I suspect he was using an older kernel when he got Descent and Flashback running on the Z but he may have encountered and fixed this issue before, with any luck!

I know directfb is something he wants to use himself so hopefully he'll have an easy fix for us. I've looked at the various directfb options and tried the ones I thought could help but the screenshots demonstrate the best directfb results I've managed so far.
Go to the top of the page
 
+Quote Post
greguu
post Nov 4 2015, 12:24 AM
Post #9





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(danboid @ Nov 3 2015, 06:42 PM) *
daal has had success with using directfb on the Zaurus before. I suspect he was using an older kernel when he got Descent and Flashback running on the Z but he may have encountered and fixed this issue before, with any luck!

I know directfb is something he wants to use himself so hopefully he'll have an easy fix for us. I've looked at the various directfb options and tried the ones I thought could help but the screenshots demonstrate the best directfb results I've managed so far.


Hi Dan,

it is possible to get the window correctly aligned if you patch SDL.

You can also have the mouse orientation corrected by patching DirectFB.

If you are keen, try these patches. Keep in mind this is somewhat experimental and just a dirty hack that is confirmed working only with the versions mentioned below :

fix mouse orientation on DirectFB 1.4.11 : http://pastebin.com/kYr24M07
fix qvga/vga alignment with SDL 1.2.14 and the DirectFB backend : http://pastebin.com/3CRrsGJb

The SDL patch allows you to center the frame by setting :

CODE
SDL_VIDEO_DIRECTFB_POS=qvga

SDL_VIDEO_DIRECTFB_POS=vga



or place the frame at the top left corner by setting :

CODE

SDL_VIDEO_DIRECTFB_POS=topleft

Cheers!
Go to the top of the page
 
+Quote Post
danboid
post Nov 4 2015, 07:56 AM
Post #10





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



Hi daal

It looks to me like you'll have to rewrite your SDL directfb patch. It would not apply to SDL 1.2.14, 1.2.15 or 1.2.13 so I attempted to do the patch manually but it appears to be patching an already patched file in that the diff references (tries to remove) functions and variables that are not present in the original version of the source file in all of those three releases. Also the line numbers for the bits I found that matched for version 1.2.14 are quite different to what the patch is expecting.

I'm glad to hear you have fixed ths problem before, at least with SDL1 as this should fix my problem with the video output under MAME4ALL being too small. I expect we'll need a separate patch for SDL2 to fix the same issue so that we can get Quake running properly.

Did you ever try getting your directfb patch merged upstream? It's prob too late for SDL1 now but if you manage to fix it for SDL2 then maybe that could be upstreamed? On the otherhand maybe this is a Z-specific issue?

On a related note, I was excited that I got PCSX-ReARMed (a ARM-optimized PlayStation emulator) to compile for the Z yesterday but unfortunately its currently unusable because the Z lacks any kind of hardware video scaling:

https://boards.openpandora.org/topic/560022...rus-arch-linux/
Go to the top of the page
 
+Quote Post
danboid
post Nov 5 2015, 08:10 AM
Post #11





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



Here's the PKGBUILD I used to create the SDL package above:

https://gist.github.com/danboid/4c0a28f286a33af0bd7f

I don't think --enable-video-directfb is really needed so long as directfb is installed at build time and nor do I think --build=armv5tel-unknown-linux-gnueabi is required unless you're compiling with distcc, maybe, but I didn't think it could cause any harm to have it in there.

If you're creating a new separate SDL package then you'll want to change the name of this package to sdl-dfb or whatever and add:

CODE
conflicts=('sdl')


I believe, daal, but I expect that's nothing you didn't already know.

Mr daal hopes to fix our SDL directfb and pointer-related woes in the next couple of weeks when he finds the time.
Go to the top of the page
 
+Quote Post
greguu
post Nov 7 2015, 05:35 PM
Post #12





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(danboid @ Nov 5 2015, 05:10 PM) *
Here's the PKGBUILD I used to create the SDL package above:

https://gist.github.com/danboid/4c0a28f286a33af0bd7f

I don't think --enable-video-directfb is really needed so long as directfb is installed at build time and nor do I think --build=armv5tel-unknown-linux-gnueabi is required unless you're compiling with distcc, maybe, but I didn't think it could cause any harm to have it in there.

If you're creating a new separate SDL package then you'll want to change the name of this package to sdl-dfb or whatever and add:

CODE
conflicts=('sdl')


I believe, daal, but I expect that's nothing you didn't already know.

Mr daal hopes to fix our SDL directfb and pointer-related woes in the next couple of weeks when he finds the time.


I had a look at the SDL 1.2.14 and SDL 1.2.15 code at libsdl.org.

It seems the code for directfb has changed significantly since my 1.2.14 svn checkout few years back.

The patches will need to be rewritten and tested with SDL 1.2.15 and I do not have time for this currently.

I will look into this further once I find some time, maybe in later this month or in December.

So, I have attached my patched DirectFB 1.4.11 and SDL 1.2.14 source, this should help to get you going in the meantime.

These sources should still compile fine, fingers crossed.
Attached File(s)
Attached File  DirectFB_1.4.11_patched.tar.gz ( 1.79MB ) Number of downloads: 70
Attached File  SDL_1.2.14_patched.tar.gz ( 3.04MB ) Number of downloads: 77
 
Go to the top of the page
 
+Quote Post
danboid
post Nov 8 2015, 04:45 PM
Post #13





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



I thought SDL deserved its own thread now we have packages:

https://www.oesf.org/forum/index.php?showtopic=34405

The display is aligned correctly using the patched SDL package but I've not been able to get the keyboard to work under MAME4ALL / directfb. If it does work it inputs to a terminal displayed behind the MAME 'window' but all the options I've tried (using the no-vt options, disabling spawning a new VT, disabling transparency, grabbing the input devices, setting the input devices manually in directfbrc...) failed to get the keyboard to work with MAME.
Go to the top of the page
 
+Quote Post
danboid
post Nov 10 2015, 09:12 AM
Post #14





Group: Members
Posts: 881
Joined: 26-December 05
From: England
Member No.: 8,789



You can now play MAME4ALL fullscreen if you installl the customised ALARMZ packages for SDL and directfb!

The OP has been updated with the details.

laugh.gif
Go to the top of the page
 
+Quote Post
ArchiMark
post Nov 10 2015, 12:16 PM
Post #15





Group: Admin
Posts: 1,646
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



Well done, Dan!!

smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2019 - 03:46 PM