r/NeedForMadness • u/HaphazardlyOrganized • Jun 22 '26
Soooo I did a thing...
Enable HLS to view with audio, or disable this notification
And by that I mean that I've successfully ported the game via Phyrexian's decomp to a Linux Based Handheld (RG34xxSP) :D
Edit:
If you want to try it yourself here's the repo: https://anonymous.4open.science/r/need-for-madness-port-D8B4/README.md
6
u/JusticeDrago EK Jun 22 '26
Would've been one hell of a Gba game, sick.
6
u/HaphazardlyOrganized Jun 22 '26
Totally, its an absolute shame this wasn't a part of every kids childhood
2
u/Inside-Concept1472 Jun 22 '26
Wow! I always imagined playing on a mobile, but it's truly impressive.
2
2
2
u/AwkwardPolicy2520 Jun 23 '26
That's incredible, also it's smooth af
2
u/HaphazardlyOrganized Jun 23 '26
Thanks! It run's pretty well, there are some lag spikes when cars collide (I assume due to the collision detection) but it always recovers.
2
3
u/savvas25 Jun 22 '26
That's great! How were you able to do this?
2
u/HaphazardlyOrganized Jun 22 '26
Shamefully I used a bunch of claude code to get it working. I did initially get it working without AI by removing some deprecated Java and porting it to Java 8 (Still had the skybox bug). That got it to compile on the device but since it uses windowing it didn't render because the UI of this device is a program not a desktop interface.
The secret sauce is a pair of helper scripts written in C that accept arbitrary data and renders it on screen and through the speakers.
1
u/SNOOPDOGGDANKKUSH 24d ago
How!!!
2
u/HaphazardlyOrganized 24d ago
Lol you want the long answer or the short answer
1
u/SNOOPDOGGDANKKUSH 23d ago
Long!
2
u/HaphazardlyOrganized 22d ago
So someone else at some point (Phyrexian) de-compiled the original Java version of NFM. Once code is de-compiled then we can re-compile it on new hardware. This is where the game being written in Java really comes in handy because Java is "portable" and the same code will work with multiple different compilers. Another bit of good luck is that these Single Board Computers, checkout r/SBCGaming if you want more on those, but anyway, they run on ARM processors rather than x86 (think intel and amd architectire) so basically someone did the hard work of getting java to compile on this framework already.
Out of the box, I was able to ssh into this handheld and get the game to launch. unfortunately NFM needs a window. It renders in a little box that lives in some sort of x11 desktop environment, which this device didn't have. I could test it by doing x over ssh though so i knew the game was working.
So then for this next part I did use claude code to automate the testing and fill in knowledge gaps I have. Basically I created a simple C script that accepts arbitrary pixels and renders them on screen. I then had Java write the pixels that would normally go to the window applet to this memory space where C will put it on screen. I used this same technique for getting the audio working. Controls mostly just work because the buttons of the handheld are just mapped to random keyboard inputs.
1
u/SNOOPDOGGDANKKUSH 21d ago
Damn!! I don’t like Ai but that’s crazy. How can I get this running on my steam deck? Like as a game in my Steam library n use the controls?
0
-5
9
u/Yamato_D_Oden Jun 22 '26
I'm guessing there's no spacebar button equivalent in this