- 05 November 2023
The previous blog post, “Your 8-bit System is a Weird PDP-11”, discussed several challenges faced when developing in C, especially for the Atari 2600/VCS.
We’ve overcome those challenges as best we can, and now we can introduce VCSLib, a support library for programming the Atari 2600/VCS with CC65.
Let’s take a tour.
- 28 October 2023
The C programming language is the de facto portable, low-level language. It was written with the PDP-11 minicomputer in mind.
The PDP-11 informed the x86 instruction set, and so in a way, we’re still using them. Today’s computers are so complex that they have to bend over backwards to emulate the simple architecture for which C was designed. It leads some to ask if C is a good fit for modern systems.
Likewise, the PDP-11 doesn’t have a lot in common with 80s arcade games. Game programmers in the 8-bit era wrote code predominantly in assembly language. The C language was around, but mostly in UNIX systems. If anything, they would have been more likely to use a homespun language like Zgrass or even FORTH.
- 16 May 2023
Today, homebrew developers enjoy the convenience of programming the 6502 in C. However, the 6502 is a very different architecture than modern CPUs, and was never designed for C programming.
The 6502 has a small number of 8-bit registers, and limited addressing modes that cannot access the stack efficiently. This makes it difficult to retarget a modern C compiler to the 6502.
In a previous blog post, we explored the process of retargeting a microcontroller C compiler (SDCC) to the 6502. This required development of a brand new code generation backend, which required looking at over 80,000 lines of code. Gabriele Gorla has since improved it to the point where it has been merged into the main SDCC repository.
- 22 March 2023
An LLM (Large Language Model) is an artificial neural network that statistically models the structure of text. It’s typically trained on a huge corpus of textual data, and tuned for a specific task, like an AI chat assistant (ChatGPT) or a programming helper (Copilot).
I created 8bitworkshop to make it easy for people to explore obsolete technologies. So I wondered: is the latest AI technology going to make the programmers of obsolete technologies obsolete themselves?
tl;dr: Not yet.
- 23 December 2022
Every December, I try to make a little wintery demo to exercise one of 8bitworkshop’s platforms. This year, I chose the Atari 800 to test out the new native TypeScript emulator in 8bitworkshop. You can see the demo emulated here.
I revisted my Bally Astrocade “Happy 2020” Demo, which simulates falling snow. It uses pixel-level collision to simulate each falling particle, which creates neat little piles of snow and particles that ripple off the sides of obstacles.
Atari ANTIC Mode $F uses the GTIA chip to add additional modes beyond what the original CTIA chip provides. I used GTIA Mode 10, which is 80 x 192 pixels with nine different colors.
- 01 December 2022
It’s often hard to interface the world of 8-bit computing with modern digital devices. These machines don’t have USB, Wifi, Ethernet, or anything resembling a modern interface.
It’s interesting to think about ways older machines can communicate with modern devices using only hardware of the era – even if it might be kind of convoluted. One of these methods might be via QR code.
A QR code is a two-dimensional pattern that encodes a short string of bytes or text – often a URL. These patterns can be printed on paper, or displayed on a screen. If you scan the pattern with your phone’s camera, it decodes the pattern, and displays the encoded text or URL.
- 14 November 2022
Mastodon has gained popularity as an alternative to commercial social media, especially within the #retrocomputing community. Even 8bitworkshop is on Mastodon, so feel free to follow!
@email@example.com into your search bar.
One feature of the “other” social media network (affectionally known as “Birdsite” on Mastodon) is the presence of bots.
- 03 October 2022
It’s been awhile since we had a proper IDE release. Here’s what’s new in 3.10.0:
New Atari PCS Emulator – The old Atari 800 emulator relied upon MAME, which was adequate but lacking in performance and debuggability. The new emulator is written in TypeScript, is cycle-accurate 1 and runs most cartridge-based games pretty well. It can even load certain well-behaved XEX files.
- 21 December 2021
There are a couple of new features:
- 31 August 2021
It’s been more than a month since the 8bitworkshop 3.8.0 release, and I’ve been doing lots of prototyping behind the scenes. Some of this work will end up in dead ends, but we might learn a thing or two along the way. So I thought I’d document everything here.
To handle this hodge-podge of module formats, “bundlers” were developed. These tools eat a pile of source code, images, CSS, whatever – and regurgitate it back in whatever format you need. The downside is that they add another level of complexity to your build system. So I’d been avoiding bundlers, and just using the output from the TypeScript compiler directly from the index.html file.
- 16 July 2021
The big change in this release is a new Verilog backend. It translates your modules into WebAssembly!
The new backend is based on Verilator 4. It has a modest performance gain (20-50%), 64-bit support, and increased test compliance.
Other changes in the Verilog platform:
- 21 June 2021
The 8bitworkshop IDE integrates several different kinds of emulators that run in the web browser, each kind with different characteristics. Ideally, our emulators would be:
Performant – They should load quickly, and run at native speeds in modern browsers.
- 18 May 2021
A minor update with some bug fixes and some new features.
Added better support for ca65 assembler, though DASM is probably still the better choice for VCS programming. DASM has better parsing of macros (you can step through them in the debugger) and improved error messages.
Improved cycle analysis tool that counts up to 76*4 scanlines and properly inspects JSR subroutines.
- 31 October 2020
Dartmouth professors John G. Kemeny and Thomas E. Kurtz had the idea that every student should have access to a computer. But in those days, batch processing was the law of the land. Programmers would fill out a coding sheet, then a keypunch operator would create a deck of punch cards. The cards were fed into machines, and hours later you might receive results from your program – or if you were unlucky, an error report.
- 14 October 2020
Playing text adventure games is sort of fun, but takes a lot of brain power. Nowadays we have all this spare CPU capacity going to waste.
What if we let the computer solve the game, and we just sit back and watch? We don’t even need any fancy neural network, we just need good old brute force.
We’re going to throw tons of semi-random input at a text adventure and see what happens. In the security world, this is called fuzzing.
- 19 July 2020
The 8bitworkshop IDE 3.6.0 is out, and we’ve added five more awesome platforms, as well as some nifty new debugging features!
Commodore’s VIC-II graphics and SID sound chip were originally destined for a next-gen game console. Engineering convinced CEO Jack Tramiel that a low-cost 64KB computer would be profitable, and thanks to having their own semiconductor fab (acquired from MOS Technology, along with the 6502) they were able to design the chipset in about five months.
- 05 July 2020
I’ve written before about cc65 and some of its optimization challenges. It’s a stable compiler with a robust toolchain, but its code generator doesn’t full advantage of the 6502 when performing 8-bit operations. It places function parameters and many local variables on a separate stack, which requires many calls to helper functions.
I’ve done a survey of 6502 high-level languages, and while many are intriguing, none have the stability and C compatiblity of cc65.
So what’s so hard about the 6502? What’s keeping us from just retargeting a modern C compiler, bringing its powerful optimization routines to 6502? Well, it’s complicated. Like, really complicated.
- 23 January 2020
To save effort, we also integrate a couple of open source emulators. Atari 2600 support is courtesy of Javatari, and NES support is courtesy of JSNES. Each of them requires significant patching to expose hooks for the extra features the IDE supports, like breakpoints and bus-monitoring.
- 20 December 2019
8bitworkshop now supports five additional 8-bit platforms!
- 02 September 2019
In 1976, the first 6502-based hobbyist computers were just starting to appear. MOS Technology’s own KIM-1 had a numeric pad and seven-segment display. The competing SYM-1 could draw simple characters on an oscilloscope.
But the real breakthrough would come when the computer could receive input from a full keyboard, and output to a television set. Steve Wozniak demonstrated such a device at Homebrew Computer Club, a 6502-based machine that could drive a 40 column by 24 row character display, and could run Woz’s own Integer BASIC. This device would later be sold as the Apple I.
We’re going to create a similar device in the 8bitworkshop IDE using Verilog.
- 09 August 2019
We’ve added yet another platform to the 8bitworkshop IDE, the legendary Nintendo Entertainment System (NES)!
You can program in both C and 6502 assembler, and there are a ton of examples to get you started.
The IDE lets you write C using the cc65 compiler toolchain. While it has lower performance and greater code size than a well-written assembly program, you can still write a pretty good game in C. We use a fork of Shriu’s NESLib library to interface with NES hardware features, and Famitone to play music and sound.
- 17 March 2019
Most of the platforms in the IDE that are powerful enough to support a C compiler are Z80-based. The Z80 isn’t the easiest target for C, but at least it has a lot of registers.
While the 6502 only has three 8-bit registers, the 6502 has strengths the Z80 doesn’t, as we’ll see here.
Let’s compare the two dominant C compilers for these CPUs.
We’ll compile a function with the CC65 C compiler for the 6502, and then with the SDCC
(Small Device C Compiler) for the Z80.
We’ll call the function
- 15 December 2018
For example, here’s a simple clock divider module:
The IDE instantly compiles this and starts simulating, showing the output signals on the scope:
- 25 November 2018
I came across Fred Quimby’s batari BASIC while developing the first version of 8bitworkshop, and was intrigued. This is a BASIC compiler that targets the 6502, and has specific support for Atari 2600 features. For example, you might define the playfield like this:
You could then set the foreground and background colors:
And animate the playfield, scrolling it downward each frame:
- 19 November 2018
Programming directly in 6502 gets a little fiddly, so a higher-level language can make things easier. There have been many attempts to tame the 6502 to make programming more palatable. Interpreted languages like BASIC, FORTH, and Pascal were popular back in the day, and Infocom games had their own custom VM to run on many platforms. But programmers are a stubborn bunch, and want speed as well as usability.
One approach is to just write a really powerful macro assembler that almost looks like a high-level language. In the 1980s, Lucasfilm developed Macross as “an assembler for people who hate assembly language”. More recently, NESHLA is targeted at NES development, but hasn’t seen much new development since 2005.
It’s been more than 40 years since Chuck Peddle sold the first 6502 samples out of a jar at a trade show. Intrepid developers are still making new languages for the CPU. Here’s a quick survey of some that have been active in the last few years:
- 03 October 2018
New features in 8bitworkshop 3.2.0:
Keyboard Shortcuts for debugging:
- 26 August 2018
In 8bitworkshop 3.1.0, we’ve given the VCS platform plenty of love:
Header Files: Header/include files are now viewable and editable via the IDE. But don’t use angle brackets in your includes, because they’ll pull in the old header file versions. Instead, use double quotes, for example:
Bugs Squashed: The emulator was suddenly stopping and displaying a blank screen, requiring a browser refresh. There were also problems when trying to load a ROM of the wrong size. Also, the Program Counter is no longer wonky when single-stepping.
- 06 August 2018
Version 3.0.0 of the 8bitworkshop IDE is out! Under the hood, there are lots of changes:
There’s a new browser storage backend, and your local changes will be migrated over the first time you start the IDE. This means you can save many more projects locally.
The site also now supports HTTPS, but be aware that local changes made on the HTTPS site won’t affect the HTTP site, and vice-versa.