A Programming Language For Building NES Games

Generally speaking, writing your own games for retro consoles starts with C code. You’ll need to feed that through a console-specific tool-chain, and there’s certainly going to be some hoops to jump through, but if everything goes as expected, you should end up with a ROM file that can be run in an emulator or played on real hardware if you’ve got the necessary gadgetry to load it.

But NESFab takes things in a slightly different direction. While the code might look like C, it’s actually a language specifically tailored for developing games on the Nintendo Entertainment System (NES). The documentation claims that this targeted language not only compiles into considerably faster 6502 assembly than plain C on GCC or LLVM, but is designed to work around the strengths (and weaknesses) of the NES hardware.

Looking deeper into the example programs and documentation, NESFab offers quite a few quality of life features that should make developing NES games easier. For one thing, there’s integrated asset loading which automatically converts your image files into something the console can understand. One just needs to drop the image file into the source directory, open it in the code with the file function, and the build system will take care of converting it on the fly as the ROM is built. The nuances of bank switching — the organization of code and assets so they fit onto the physical ROM chips on the NES cartridge — are similarly abstracted away.

The obvious downside of NESFab is that, as with something like GB Studio, you’re going to end up putting effort into learning a programming environment that works for just one system. So before you get started, you really need to decide what your goals are. If you’re a diehard NES fan that has no interest in working on other systems, learning a language and build environment specifically geared to that console might make a certain degree of sense. But if you’d like to see your masterpiece running on more than just one system, working in straight C is still going to be your best bet.

Perfect Dark: Recompiled

There’s an interesting renaissance of Nintendo 64 gaming, powered by the ability to decompile N64 ROMs back into C code using Ghidra. There are projects around multiple classic games, taking the Ghidra output and renaming the generic function and variable names. There are two approaches to these projects, sometimes happening in parallel. The first is to perfectly recreate the original work, and get a bit-perfect binary that matches the original ROM. The other approach is to fix bugs, optimize the code, and add new features, often porting to new platforms in the process. Right now, we’re seeing the latter happen with 2000’s Perfect Dark.

There is a project by [Ryan Dwyer] to produce a matching C codebase, and that project is functionally complete with an over 99% bit-perfect output. But as impressive as that is, we’re interested in making code even better, and that’s what [fgsfdsfgs] has accomplished with the Perfect Dark port.

The game now runs on Windows or Linux, has mouse support, and runs at a solid 60 frames per second (FPS) at multiple screen resolutions. Want an ultra-widescreen Perfect Dark experience? The upgraded rendering engine handles it wonderfully. Mods? No problem. In the future, the developer is also looking to support high-definition textures.

To play, you do have to provide your own legally sourced copy of the original Perfect Dark game. That is the only way this project is remotely legal, and we suspect that even then it’s in a somewhat grey zone, as a derivative work of a copyrighted game. Big N hasn’t shut the project down, but the Mario 64 port was killed for attempting the same thing. We’ll hope for the best, and enjoy the nostalgia trip in the meanwhile!

Hackaday Links Column Banner

Hackaday Links: July 9, 2023

Good news this week from Mars, where Ingenuity finally managed to check in with its controllers after a long silence. The plucky helicopter went silent just after nailing the landing on its 52nd flight back on April 26, and hasn’t been heard from since. Mission planners speculated that Ingenuity, which needs to link to the Perseverance rover to transmit its data, landed in a place where terrain features were blocking line-of-sight between the two. So they weren’t overly concerned about the blackout, but still, one likes to keep in touch with such an irreplaceable asset. The silence was broken last week when Perseverance finally made it to higher ground, allowing the helicopter to link up and dump the data from the last flight. The goal going forward is to keep Ingenuity moving ahead of the rover, acting as a scout for interesting places to explore, which makes it possible that we’ll see more comms blackouts. Ingenuity may be more than ten-fold over the number of flights that were planned, but that doesn’t mean it’s ready for retirement quite yet.

Continue reading “Hackaday Links: July 9, 2023”

A 4-Player Arcade Hidden Inside A Coffee Table

[Ed] from 50% Awesome on YouTube wanted to build a retro gaming system with a decent screen size, but doesn’t have a great deal of space to site it in, so a good compromise was to make a piece of useful furniture and hide all the fun parts inside.

Building an arcade machine usually involves a lot of wiring

This video two-part build log shows a lot of woodwork, with a lot of mistakes (happy accidents, that are totally fine) made along the way, so you do need to repeat them. Essentially it’s a simple maple-veneered plywood box, with a thick lid section hosting the display and some repositioned speakers. This display is taken from a standard LG TV with the control PCB ripped out. The power button/IR PCB was prised out of the bezel, to be relocated, as were the two downwards-facing speakers. The whole collection of parts was attached to a front panel, with copious hot glue, we just hope the heavy TV panel was firmly held in there by other means!

Continue reading “A 4-Player Arcade Hidden Inside A Coffee Table”

Wolfenstein 3D, As You Never Imagined It.

When tracing the history of first-person shooting (FPS) games, where do you credit with the genesis of the genre? Anyone who played 3D Monster Maze on the Sinclair ZX81 might dare to raise a hand, but we’re guessing that most of you will return to the early 1990s, and id Software. Their 1992 title Wolfenstein 3D might not have been the first to combine all the elements, but it’s arguably the first modern FPS and the first to gain huge popularity. Back in 1992 it needed at least a VGA card and a 286 to run, but here in 2023 [jhhoward] has taken it back a step further. You can now slay virtual Nazis in 3D on an 8088 PC equipped with a lowly CGA card.

Whether the gameplay survives in the sometimes-bizarre CGA color schemes and whether it becomes too pedestrian on an 8088 remains as an exercise for the reader to discover, but it’s a feat nevertheless. The textures all need converting to CGA mode before they can be used and there are even versions for the shareware and paid-for versions of the game.  It’s possible that an 8088 may never be able to say yes to “Will it run DOOM?”, but at least now it can run the predecessor.

Old Firewall Reborn As Retro PC

We like projects where old gear is given a new life. [Splashdust] has a twenty-year old business firewall that’s build like a tank. He cracks it open and finds a complete x86 embedded motherboard inside, and sets off to restore it and turn it into a retro gaming computer (see the video from his Odd & Obsolete YouTube channel below the break).

This business firewall and router box is from a small Swedish firm Clavister, part of their S-Series from the early 2000s. The motherboard appears to be a generic one used in other equipment, and is powered by a VIA Eden ESP 4000 running at 400 MHz. The Eden line of x86 processors were low-power chips targeting embedded applications. The graphics chip is a Twister T by S3 Graphics which was purchased by VIA in 2000. After replacing the electrolytic capacitors, and making a few cables, [Splashdust] pops in a PCI sound card and boots up into Windows 98 from a CF card (we like the compact PCB vise he uses).

In two follow-up videos (here and here), he builds an enclosure (instructions on Thingiverse) and tries out several other operating systems. He was able to get the Tiny Core Linux distribution running with the NetSurf browser, but failed to get Windows 2000 or XP to work. Returning to Windows 98, he tweaks drivers and settings and eventually has a respectable retro-gaming computer for his efforts. The next time you’re cleaning out your junk bins, have a peek inside those pizza-box gadgets first — you may find a similar gem.

Continue reading “Old Firewall Reborn As Retro PC”

Refining The Greatest Joystick Of The 1980s

The Competition Pro joystick is often considered to be the pinnacle of input devices, at least as far as the 1980s gaming goes. But the design isn’t perfect, and time hasn’t been kind to certain aspects of its mechanism. For example, the large rubber disc used to keep the stick centered on early generations of the hardware will invariably be hardened up on any surviving specimens. Looking to return these classic controllers to their former glory, and then some, [mageb] has released a number of 3D printed modifications for the Competition Pro that should be of great interest to the vintage gamer.

The new microswitches

First and foremost is the deletion of the original rubber disc for a new spring mechanism. Even if this is the only modification you do, [mageb] says you’ll already have a better and longer-lasting joystick to show for it. But if you want to continue with the full rebuild, be aware that there’s no going back to stock. Once you start cutting the original parts, you’re committed to taking it all the way.

Assuming you’re not afraid to get your hands dirty, the next step is cutting the metal contacts from the bottom of the face buttons so they’ll work with the new microswitch array he’s designed. Each button gets its switch, and four handle movement of the joystick. You can try out different switches to adjust the feel of the joystick, but [mageb] assures us that he’s already done the research and put the best quality switches in the bill of materials.

The end result is a Competition Pro joystick that looks more or less the same from the outside, but is considerably improved internally. That’s always a win in our books, though we’re sure somebody out there is going to get mad that the brittle old rubber disc wasn’t sent to the Smithsonian.