Dirty Tricks For 6502 Programming

We know the 6502 isn’t exactly the CPU of choice for today’s high-performance software, but with the little CPU having appeared in so many classic computers — the Apple, the KIM-1, The Commodores, to name a few — we have a real soft spot for it. [Janne] has a post detailing the eight best entries in the Commodore 64 coding competition. The goal was to draw an X on the screen using the smallest program possible. [Janne] got 56 bytes, but two entrants clocked in at 34 bytes.

In addition to the results, [Janne] also exposes the tricks people used to get these tiny programs done. Just looking at the solution in C and then 6502 assembly is instructive. Naturally, one trick is to use the existing ROM code to do tasks such as clearing the screen. But that’s just the starting point.

Continue reading “Dirty Tricks For 6502 Programming”

The Benefits Of Restoring A C64 With A Modern FPGA Board

The Commodore 64 was the highest selling computer of all time, and will likely forever remain that way due to the fragmentation of models in the market ever since. Due to this, it’s hardly surprising that it still has a strong following many years after its heyday. This means that the avid restorer has a wide range of parts and support available at the click of a button. [DusteD] is just one such person who had a busted-up C64 laying around, and decided to make it a project.

[DusteD] wanted to reuse the original case, and decided it should remain a Commodore 64 after an initial attempt at a mini-ITX swap went awry. Desiring a reliable machine, an Ultimate64 FPGA board was selected to replace the original faulty motherboard. This has the benefit of being hardware compatible with the classic C64, while allowing [DusteD] to tinker and program to his heart’s content, without having to worry about blowing up valuable original parts. It also provides several interesting modern features, like HDMI output, USB, and even Ethernet connectivity. This allows one to experiment with the platform without the hassles of all the inherent limitations of 1980s technology.

As a fan of the classic SID sound chip, [DusteD] was also highly interested in the audio output of the Ultimate64. Recordings were made of the emulated output from the FPGA, as well as the sound output from a real SID installed in the board, both through the mixed output and directly from the chip via a SIDTAP. Those interested can download the 800MB of recordings and compare the output; there’s a summary of the differences noted listed on the site as well.

[DusteD] makes a great argument for the benefits of building up a C64 rig in this way. It’s a great way to get started for those eager to explore the world of Commodore’s 8-bit hardware without the hassles and expenses of buying all the real gear. As it stands, the C64 aftermarket is so advanced now, that you can build an entirely new machine from scratch if you so desire. Go forth and enjoy!

Recovering Data From Floppies With Errors

Those of us of advancing years will remember the era of the floppy disc. Maybe not that of the 8-inch drive, but probably its 5.25-inch and certainly its 3.5-inch cousins. Some will remember the floppy disc fondly, while for others there will be recollections of slow and unreliable media with inadequate capacity, whose ability to hold data for any length of time was severely questionable. Add three decades to the time a disc has spent in storage, and those data errors become frequent. The life of a retrocomputing enthusiast hoping to preserve aged software is made extremely difficult by them, and [] has a few tips to help with recovery.

It’s written with specific reference to Commodore 5.25-inch floppies, but aside from some of the specific software, the techniques could be applied to any discs. Most interesting is his explanation of the mechanisms that lead to bad discs or bad sectors, before he looks at some of the mitigations that might be employed. Cleaning the disc or the drive head with alcohol is explored, then taking a dump of the raw data for detailed inspection and disassembly in search of checksum errors. If in your youth a floppy disc was just something you put in a drive and you never investigated further, perhaps this piece will fill in some of the gaps.

If the thought of a stack of Commodore 64 floppies fills you with dread, how about using an emulator?

Header image: PrixeH [CC BY-SA 3.0].

That Super Mario Bros. C64 Port Was Too Good For This World

It was foolish to think that the adventure of the Mario Bros. would ever exist outside of the castle walls of the Nintendo Entertainment System. Except for that one time it did. The Hudson Soft company was a close collaborator with Nintendo, and parlayed that favor into being tasked with bringing Super Mario Bros. to platforms beyond the NES. The result of that collaboration would be 1986’s Super Mario Special, a port for the NEC PC-88 line of desktop computers. What ended up on that 5.25″ floppy sounded reminiscent of the Famicom original, but with a grand total of four colors (including black) and not a single scrolling screen in sight; Super Mario Special felt decidedly less than spectacular to play. Those eternally flickering sprites mixed with jarring blank screen transitions would never make it outside of Japan, so for a large swath of the world Mario would remain constrained to a gray plastic cartridge for years to come.

There are no shortage of ways to play Super Mario Bros. these days. Emulation in all of its various official and unofficial forms has taken care of that. Virtually everything with a processor more capable than the NES’s 6502 can play host to the Mushroom Kingdom, however, machines more contemporary with the NES still lacked access to the iconic title.

Enter the 2019 port of Super Mario Bros. for the Commodore 64 by [ZeroPaige]. A culmination of seven years work to port the game onto one of the most prolific computers of the eighties was a clear feat of brilliance and an amazing bit of programming that would have taken 1986 by storm. No pale imitation, this was Mario on the C64. Despite all of the nuance in recreating the jump-and-run model of the original paired with enveloping all eight sound channels of a dual SID chip setup, Nintendo saw fit to stifle the proliferation of this incredible 170 kB of software because they claim it infringes on their copyright.

Continue reading “That Super Mario Bros. C64 Port Was Too Good For This World”

Custom Monitor For Pi-Powered Commodore 64

Classic games never seem to have gone out of style and with the emulation powers of the Raspberry Pi, there seems to be no end of projects folks have been coming up with. [Chris Mills] project is a great looking monitor to get his Commodore 64 fix by combining the retro looks of a home-made 64-style monitor with the Raspberry Pi.

[Chris] is only interested in Commodore 64 emulation, at least with this project, and wanted something that would fit on a desk without taking up too much room. An eight inch LCD security monitor fit the bill perfectly. [Chris] ended up building a wooden enclosure for the monitor to give it that Commodore look. The monitor, power supply and cable connections fit inside along with speakers; each of these having their inputs on the back. A fan vents in the back as well and the Pi sits outside running the Combian 64 emulation software.

[Chris] has put up some galleries of build pics. The logo from the old Commodore logo is a nice touch. Read over the Hackaday site and you could build your own Commodore 64, or use the Commodore 64 itself to house the Raspberry Pi if you wanted.

 

Interface Your C64 With Arduinos Through Firmata

Microcontrollers are cool, but sometimes the user interface options they can deliver are disappointing. The platform in question may not have the horsepower required to drive a decent screen, and often a web interface is undesirable for security or complexity reasons. Sometimes you just need a good software interface between chip and computer. Firmata is a protocol that’s designed to do just that, and [nanoflite] has brought it to the Commodore 64.

It’s a fun project, which allows one to use the C64’s charming retro graphics to interface with an Arduino-based project. Connection is achieved at 2400bps over the user port, which is plenty fast for most UI applications. [nanoflite] demonstrates the interface with an Arduino Uno and a Grove shield. The C64 is able to display the state of the LED, relay and servo outputs, as well as read the Arduino’s button and potentiometer inputs.

It’s an excellent way to integrate a Commodore 64 into a microcontroller setup without reinventing the wheel. We think it would make an awesome vintage interface to a home automation system or similar build. If you’re interested, but you don’t have a C64 of your own to play with, never fear – you can just build a new one.

Wireless Controllers For Retro Gaming

There’s no limit to the amount of nostalgia that can be minted through various classic platforms such as the NES classic. The old titles are still extremely popular, and putting them in a modern package makes them even more accessible. On the other hand, if you still have the original hardware things can start getting fussy. With modern technology it’s possible to make some changes, though, as [PJ Allen] did by adding wireless capabilities to his Commodore 64.

Back when the system was still considered “modern”, [PJ] tried to build a wireless controller using DTMF over FM radio. He couldn’t get it to work exactly right and ended up shelving the project until the present day. Now, we have a lot more tools at our disposal than analog radio, so he pulled out an Arduino and a few Bluetooth modules. There’s a bit of finesse to getting the old hardware to behave with the modern equipment, though, but once [PJ] worked through the kinks he was able to play his classic games like Defender without the limitations of wired controllers.

The Commodore 64 was incredibly popular in the ’80s and early ’90s, and its legacy is still seen today. People are building brand new machines, building emulators for them, or upgrading their hardware.

Continue reading “Wireless Controllers For Retro Gaming”