- 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.