Friday, 4 December 2026

A 3D printed case for Freebee

I've been working with Freebee out on the desk for such a long time, it's time to put it in a case. I'm doing a case that looks like a Microbee, but is my own, firstly in beeing a little bit smaller (the 3D printer I am targetting has a build plate that's 340 x 320, so won't build a 360mm wide Microbee case in one go), plus making best use of my ability to tilt the keyboard. I've gone with a 7.5 degree keyboard angle, which should be really nice to type on.

Printing the keyboard cover piece necessitates splitting it in half, so that it's not one great big overhang. These are joined together permanently. Rather than using screws to hold the case top on, I've modelled pockets for small neodymium magnets. I've taken great care to ensure the keyboard fits perfectly, making great use of the Onshape section view to get everything aligned perfectly, and I've added some additional supports under the keyboard. You'll note I also have a new 3D printed keyboard frame, rather than the PCB based one that I've used previously.

Thursday, 12 November 2026

Another MUGWA meeting

MUGWA, the Microbee Users Group of Western Australia, is meeting on 22 November at Bolt Coffee in Midland at 11.

There will be coffee, nibblies, discussion about a crazy 44 year old computer that just won't die. I want to demo various iterations of my FreeBee: Bare FreeBee, FreeBee Premium, SuperPAK, Compact Flash, and my latest obsession (pictured below), my PAK Cart coreboard running on FreeBee Premium, running my modified basic with lots of extra goodies.

In order to do that I need to free FreeBee from the desk. I used a USB power delivery trigger board from Jaycar to give my 9V from a USB C power bank, which I power my LCD display and Freebee with, then I use a little DC-DC converter to power the GBS8220 scan doubler. All that circuitry gets hidden in a little Hammond enclosure that has my LCD mounted to the front. A few 3D printed bits later, and I've got a teensy USB C powered CGA monitor.

So then of course I get enthusiastic about 3D modelling and start on a case for Freebee.

I reckon it looks rather spiffy, and lets me do show and tell of my FreeBee hardware and software easily. Come along on the 22nd for a look!

And the whole lot. Original freebee on the left, freebee premium with conpact flash coreboard in the middle, freebee premium with PAKCart core oard on the right, in the beginnings of my new case.

Saturday, 15 August 2026

Pixel Addressable Colour on Freebee

The Microbee Premium had enough Programmable Character RAM to assign a unique PCG character to every spot on the screen, so you could display a picture that filled a 512 x 256 screen. It also had colour, but alas the colour was organised by character, not pixel. So a character had a foreground colour (1 of 16) and a background colour (also 1 of 16). So if you wanted to draw something that had more than 2 coulours in the same 8x16 character cell, you were out of luck.

Other computers of the time had pixel addressable colour, where an individual pixel could be any one of 16 colours. This makes for much more expressive games etc. There was usually a compromise though - full colour displays were usually only 320 x 240 (40 column), while monochrome displays did higher pixel densities.

On Freebee, only four of the attribute bits actually do anything. The other four are available for our use. Let's use attribute bit 7 to determine if a character cell is normal Microbee character colour or pixel colour. So if this bit is set, for that character rather than doing a screen addressed fetch for colour, then a character addressed fetch for character data, let's instead do a pair of character addressed fetches, yeilding 16 bits of data. Now if we make a character four pixels wide, we have enough data to describe a unique 4 bit colour to each of our four pixels. We are now able to display a glorious 320 x 264 full colour picture. Of course we need more memory for colour (say 32K rather than 2K, but this is easy. Just increase the video RAM size to 128K (a single 628128).

It's not at all Microbee compatible, and we don't care. Keep attribute bit 7 reset and it'll work like a normal Microbee. Indeed as the determinant for pixel colour is stored in the attribute RAM, we can freely mix pixel addressable colour on the same screen as character addressable colour, plus we get all the sorta-kinda advantages of PCG characters, where we can move character sized blocks around with just a couple of writes, rather than having to laboriously write every pixel.

So here are the schematics. Essentially there is a bigger RAM for video - a 628128 128k x 8 SRAM. This has enough space to store screen, attribute, colour, 2 x character sets, 16 banks of PCG, plus another 32 banks of "pixel colour" PCG.

IC13 latches one byte of pixel colour PCG, and IC43 (shared with colour) latches the other one. When we want to output a pixel colour block, the 16 bits are spread across the outputs of IC13 and 43. IC23 and 22 do a simple 4 of 16 select to push out each pixel at the 1/2 dotclock rate. Note I use the tristate ability of the muxes to allow the selection of either normal character based colour or pixel colour.

Now there's no way I'm going to fit this much extra stuff on the board, so I caved and put the address decode in PALs. I chose PAL16P8 chips, which werer available in 1986, so aren't cheating. Actually I'll use ATF16V8 GALs, as these are readily availabvle in 2026 and emulate a 16P8 quite nicely. Two PALs (IC 50 and IC51, do the address decoding for the video RAM - one for CPU access and the other for CRTC access. A third (IC49) eats up a lot of the random logic used for enabling the various latches and buffers in the video circuitry. And given that I was using PALs, I used a fourth for address decode for memory - IC39.

So given that I was committed to a really big change, I swapped the Z80 out for a Z180. This allows clocking at up to 27 MHz rather than 13.5 for existing Freebees. It also has some nice fast serial I/O. I use a synchronous I/O port to connect an RTC, and connect that to the serial connector also - I could add some level shifters and an SD card port to a little daughterboard that plugs into the serial port. It's also got a MMU, so the memory shoots up to 512K of RAM (a single 628512) and 512K of Flash. Given I'm committed now to doing PLCCs on the board I swapped the PIO out for a PLCC one as well.

The result is 52 chips, compared to 60 of the normal FreeBee Fremium. It's pretty dense, due mainly to the big Z180, necessitating a six layer board (2 layers used purely for power and ground) and 8 thou feature sizes. I made the most of KiCads ability to do different size pads for inner and outer layers, giving me an ability to get two traces between pads on inner layers, but nice generous outer layer pads to simplify soldering. Givenm that we're going for a late eighties asthetic now (what with the PALs and everything) I've also gone for 1206 and MELF resistors, capacitors and diodes, but kept everything else through hole. Also no more rounded traces.

Wednesday, 3 June 2026

Tetris for the Freebee (and Microbee)

Back in the early nineties I got my hands on a Gameboy. I didn't have any money for games, so just played the game that came with the Gameboy; Tetris. This was truly addictive and I estimate I played it for many thousands of hours, getting reasonably good with occasional high scores above 200,000 (big rocket), but not up to Woz level.

Recently I watched the (broadly fictionalised) movie of how that came to be, with the original Tetris running on a Soviet PDP-11 clone, with everything done in characters. Hey, I could do that on a Freebee, and it'd be a cool game to learn to write games in assembler with. So over the last month or so I did just that.

My version is reasonably close to the Gameboy one, but with some caveats. Gameboy runs with a 60Hz screen refresh rate, whereas Freebee and Microbee run at 50Hz. This means my drop rates, which are timed in video frames, aren't exactly the same as the Gameboy. In practice you won't notice until around level 8 or 9, where the difference rises above a couple of percent. Worst one is level 18 and 19, where I do 3 20ms frames (60ms) and Gameboy does 4 16ms frames (64ms).

But no need to grumble about the tiny differences. My version is every bit as fun as the Gameboy one, and I've wasted a lot of time now playing it (though I'm still to see a high score above 200,000).

I didn't really plan the game out much before writing it, so my development method is pure eighties spaghetti. I started by drawing some tetrominos in Basic to get an idea of what they looked like. I had to do it in an 80x24 screen, as the Tetris playfield is 22 rows vertically, so it won't fit in 64x16. Then I wrote code to allow me to move a tetromino left and right, and rotate it. I figured the easiest way to rotate was just to index through versions of the tetromino (wasteful in terms of RAM, but fast). Given the largest tetromino, the I, is 4 long, this dictates a 4x4 = 16 cell block, and given there's 7 tetrominos, that's 112 bytes. Not so bad.

An idea for speeding things up came to me in the shower. Rather than printing the tetromino PCG character and colour every time I move it, let's just initialise the whole playing area on the screen with the correct PCG characters, and turn them on and off using colour. So a colour of 0 (black foreground and background) is empty, and other colours have blocks. This also made the test easier, as unoccupied cells are 0.

I played with that for a while and got movement happening, and even automated dropping. But it didn't look perfect, as my method of testing a tetromino can fit in a space requires me to erase the tetromino from it's old space first, perform the check, then paste the tetromino in, either in it's old position if the move didn't work or else in it's new position. That caused tearing on the screen due to the erase.

So then I moved a copy of the playfield to RAM, and did all my tests on that, and simply updated the screen (colour) RAM once every frame. Tearing gone, at the expense of a few hundred bytes to store my playfield copy.

The rest of the code is just doing the arithmetic to update row and scores, detecting and counting erased rows etc. The whole game is like 3K. It's tiny!

So it works. And not just on Freebee. It works on a Premium Microbee too, and under emulation using uBee512.

All my code, and the binary, is on my Google drive

Running it in uBee512 requires getting it into memory. uBee512 likes disk and tape files. This is just raw code. There's debug mode though, which allows you to insert arbitrary code into memory. So from the folder where your Tetris.bin file is loaded, start ubee512 emulating a Premium machine, get it into basic (either emulate a P85 model or run disk basic from the PCF one), and right click to get a console. In the console, type --db-loadm=2304,Tetris.bin. Kill the console, then execute Tetris from Basic with a=usr(2304).

Here's some screen grabs, courtesy of Ubee512:

I've also uploaded a video to Youtube, where you can listen to me blather about it while I'm playing it on my Freebee.

Monday, 18 May 2026

Just playing around with my modified basic

I figure my basic's not much use unless I write some code that uses it. I've started writing a game, which might be fairly obvious. I doubt I'll use basic for the whole thing (I understand the original was coded in Pascal), as it'll be way too slow, but basic is certainly useful for prototyping parts, like for example quickly and easily drawing the core pieces of the game, fitting them together, and working our what colour they should be:

I'm glad I'm doing it, because I've discovered a couple of bugs in my basic code. Firstly there's something weird going on with my input buffer. If I use cursor keys (I think) while entering code they get added to the input buffer, and hence to the code, but not displayed on the screen. I'll have to use the monitor to work out what's going on. Secondly my cursor command is totally broken in 80 column width.

Meanwhile I've built up a couple more machines, as there are people (yes, I'm shocked too) that just want the computer, without experiencing the joy of soldering it together and figuring our why it doesn't work first try. Here's one that has the keyboard split off from the mainboard. It's cool, but uses rather a lot of desk. I think I'll stick to the attached keyboard version for myself.

Tuesday, 28 April 2026

Getting my modified Basic to work on the ubee512 Microbee emulator

I spent some time adapting my basic so that it'll work on the Compact Flash Coreboard. I realised that ubee512 has the ability to emulate that, so worked out how to run it under ubee512.

The source code (plus the final PCF.ROM for those who don't want to asemble their own is on my Google Drive.

I use the same source now to assemble either the PAK Cart Basic or CF Basic. There's a pair of variables right at the top of Freebee Fremium Basic 1.0.asm that define what we're doing:


;#############################################################################################
; Define what we're assembling
;#############################################################################################

PAKBASIC: 	equ 0		; = 1 if we're targetting the PAK Cart Coreboard
CFBASIC:	equ 1		; = 1 if we're targetting the Compact Flash Coreboard

Set CFBASIC to 1 and PAKBASIC to 0 to assemble the CF Basic.

Assemble the ROM using:


z80asm -i Freebee\ Fremium\ Basic\ 1.0.asm -o output.bin -llisting.txt
split -b 8k output.bin
cat xae xaf xag xah > PCF.ROM
dd if=/dev/zero bs=1 count=229376 >> PCF.ROM

This places the ROMA at 00000h, ROMB at 02000h, ROMC at 04000h, and the CF boot code from 05800h in PCF.ROM, and pads the ROM out to 256K so ubee512 doesn't complain about size.

Copy the resultant PCF.ROM file to your ubee512k ROM directory.

Execute ubee512 with:


ubee512 --model=pcf --rom256k=PCF.ROM

Saturday, 18 April 2026

A USB PAK Cart for Freebee

Greybeard on MSPP has developed code to use a CH376 USB host interface on a Microbee, allowing reading and writing of FAT partitioned USB sticks. The chip is only available as a SOIC, which really doesn't suit the through-hole-only construction of Freebee. But I can always sneak one onto a PAK cart...

So here goes, along with a little 32kx8 EEPROM for storing the code:

Thursday, 16 April 2026

This time, the bodge is not my fault

I spent some time earlier in the week diagnosing an issue with the latest Freebee premium board, where monitors were dropping out of sync when a key was pressed when running CP/M.

Like a good hardware designer, I blamed the software. I used the standard "doesn't happen for me under Basic" line. And I was right. The CP/M boot rom and CBIOS on Microbee does bad things when it scans the keyboard, chiefly in not masking out unused bits of the scancode when it scans the keyboard. The long and the short of it is that a line that I use to do a VSYNC inversion, to maybe support EGA sync rates in the future, gets flipped by the key scanning routine, causing, well, random VSYNCs on the monitor.

Much debate on the MSPP forum ensued. I even provided a patch for the boot rom to stop it happening in the boot monitor (but haven't yet gone so far in the CBIOS).

But really, I should relent. I can't expect people to become experts at patching software just to use Freebee. It's going to have to be more compatible. So the bodge, thanks to a random software person in the probably late seventies, who didn't mask unused bits after the rotate. In essence we disconnect MA12 between the CRT controller and IC29 pin 4, then ground IC29 pin 4. It's slightly advanced because the whole trace is on middle layers, so you either cut a pin on one of the two chips (yuck), remove the IC socket pin for the CRTC (IC8 pin 16) or, as I have, drill out a via to do the disconnect.

The safest spot for our surgery is the via between pins 8 and 9 of IC7. It's isolated so we're unlikely to clobber anything else. Here's a photo of the bodge, complete with the little drill bit I used for removing the via (teeny hole just to the right)

Saturday, 11 April 2026

Extending Microbee Basic for the PAK Cart Coreboard

Now that I've got Basic properly figured out, I can do absolutely whatever I like with it. On the Premium bee, there's a third 8K ROM, which is bank switched in to 8000-9FFF, which contains the premium patches. The patches only occupy about 2K, so there is heaps of space.

I started by moving code out of the ROM A and ROM B sections to ROM C, cleaning up many of the patches, and rewriting the colour command so it uses an actual keyword rather than just hacking the compressline and expandline routines to create POKEs.

Then I added commands to work with PAK Carts. PAK DELETE nn can delete a PAK. PAK COPY xx TO yy copies from one PAK to another. PAK LIST lists the contents of PAKs.

I added support for high-speed 2400 baud tape load and save (LOADF, SAVEF) and further worked on the LOAD routine to allow loading of tape software directly to PAK. So LOADF TO PAK loads a program from tape at 2400 baud, and stores it in the next available non-blank PAK with headers that allow PAK LISTing, plus execution simply USING PAK nn.

Next I added Freebee Monitor to ROM C. Normally Freebee Monitor resides in PAK, but I wanted to be able to examine what was in my PAKs from monitor, and it's hard to do that when you blow your monitor code away when you change PAKs. So in it goes!

That got me thinking about 80 column mode, as my monitor runs in 80 column mode. Wouldn't it be nice to extend basic to support 80 columns? So I did, including LORES that now works in 80 x 24 mode with a stunning 160 x 72 pixels.

I used (thanks to the suggestions of the crew at MSPP) the keyword WIDTH to allow 80 column mode, so WIDTH 64 does 64x16, and WIDTH 80 does 80x24. Microsoft basic back in the day allowed things like WIDTH 40... So, let's do that also. Freebee doesn't support halving the dot clock like Premium Microbees did (for Viatel), but it does have heaps of PCG RAM, so we can copy the character set to PCG and 'smear' the 8 bit wide characters across two PCG banks, then edit the screen output routines to write the two characters.

The result is what you see at the top of the page.

Having made double width characters, I next added a WIDE keyword that can display the wide characters alongside normal ones. Then I moved underline to it's own PCG bank (bank 7), and reworked inverse so that it swaps foreground and background colours for the selected character, rather than using PCG. This results in being able to display normal text, underlined text, inverse text, wide text, and low resolution graphics simultaneously, as shown below for both WIDTH 64 (512x256) and WIDTH 80 (640 264).