Half-Byte Tiny Basic Type In Game: Invader

WP_20140719_003Yep, I use ‘Invader’ a lot. Here’s a version, just for Half-Byte Tiny Basic. It features Wii Nunchuck support, sound and AWESOME graphics! Just awesome!

100 CLS
110 X=0:Y=0:D=1:Z=75
120 LINE 0,38,79,38,1
130 B=9:C=5:U=4:V=0
140 CURSOR 0,7:?"Score:";
150 GOSUB 800
160 GOSUB 900
170 P=PAD(3)
180 IF P=1 S=1
185 IF P=1 TONE 1024,100
190 IF S=1 GOSUB 700
290 GOTO 150
700 CURSOR B,U:?CHR(142);
710 DELAY Z:CURSOR B,U:?"  ";
720 U=U-1
730 IF U<1 IF B<>X U=4:S=0
740 IF U<1 IF B=X GOSUB 1000
800 CURSOR B,C:?CHR(151);
910 X=X+D:IF X>17 D=-1:X=17
920 CURSOR X,Y:?"  ";
930 IF X<2 D=1:X=2
1000 CURSOR B,U:?"*";:DELAY 3*X:CURSOR B,U:?" ";:DELAY 3*Z:?"*";:DELAY 3*Z:CURSOR B,U:?" ";
1010 S=0:V=V+100
1020 CURSOR 0,7:?"Score:",V;
1030 U=4
1040 TONE 2,400

There’s room let to add code to move your ‘tank’ and, perhaps, have the moon guy shoot back.

It is a simple little, but I found it a bit difficult to shoot the moon guy.  The rules are simple: use the ‘Z’ button on the Wii Nunchuck to fire a missile at the moon guy. You get 100 points for each hit. Play continues until you get bored.  Tinker with the code, add more gameplay and share it with us.

Have fun!


Half-Byte Console, now available

We have kits and an assembled and tested unit for sale on our eBay store.

For information on the Programmer’s Kit, click here.

For information on Half-Byte Tiny Basic, click here.

For sample HB Tiny Basic code, click here.


Half-Byte Console, now available

We have kits and an assembled and tested unit for sale on our eBay store.

For information on the Programmer’s Kit, click here.

For information on Half-Byte Tiny Basic, click here.

For sample HB Tiny Basic code, click here.


A Timex-Sinclair 1000 is reborn (using the Half-Byte Console)

zx81adThe Sinclair ZX-81 is one of my favorite computers. I bought the kit version, back in 1981, with some money I got from a tax return. I was in heaven. I bought a COMPUTER, one I can put together. I did it and, with my Dad’s help, it worked. (The resistor on the reset pin of the Z80 chip was missing, luckily, he had tons of them.)  Sure, I already had messed around with computers, for years at that point, and had one of my own that my Dad had built me a few years before (a SC/MP based computer, very cool, even today.) But, this one had GRAPHICS! Glorious black and white graphics. I could make a video game. WOW!

Eventually, I had a couple of ZX-81’s, six or seven Timex Sinclair 1000’s, a TS-1500 and one or two WP_20140708_006of the color versions, TS2068, maybe, not sure.  I loved that whole line of computers. Sadly, though, I don’t have any of them left. I did, however, bid on and win an auction for a TS-1000 (twenty bucks, with shipping.) I don’t know if it works or not, I never even bothered to power it up.

Why didn’t I power it up?

Good question.

Well, I had a different idea for it in mind. I wanted to put my newly minted Half-Byte Console in the case. So, that is what I’ve done.

WP_20140708_018I built up the console, leaving off most of the connectors and headers. This way, I can wire connectors that will be mounted on the case and not the board. I had to improvise with the PS/2 keyboard connector and, in hindsight, I should have used a wired extender cable instead of the board mounted connector, but, I made it work.

The RCA Video and Audio connectors were panel mount and fit nicely. The power adapter connector somewhat fits. I had to do a little trimming, but, it more or less fits.

For the Nunchuck connector, I had to do a little trim work on the back of the TS-1000 case, but it fits nicely. Same with the three pin serial header (so I can communicate with a PC or other device.)photo 1

I used some sticky back pads to secure the board, I didn’t want to cut up the case or drill a lot of holes so I could return it to its original function if I wanted to do so in the future. I may sell this at some point, I don’t know yet.

The one thing I’d really like to do is make the TS-1000 membrane keyboard work with the console. Right now, the information I’ve found requires the use of pins on the 328 that I am using for the video and audio and the Nunchuck. Maybe I’ll use an UNO Pro mini just for the keyboard.  I’ll have to give that some thought. But, that would be cool.  A new retro computer.

While I am no Ben Heckendorn, I am pleased with the way this turned out. I’m not a modder, but I could grow to like it.

photo 2I am going to add the ZX/TS1000 graphics characters to the 4x6 font for TVOut and recompile Half-Byte Tiny Basic to more look like the TS-1000. The Half-Byte Console even has the same RAM-2K. Ah, I love the ‘80s.

For more information on the Half-Byte Console and Half-Byte Tiny Basic, go here and here.  You can also search the blog for posts on both the console and Tiny Basic.

For more information on the Timex Sinclair line, go here.  You can also build your own ZX80/81. Go here to read more.


Burning the bootloader on a ATMega 328p with two Arduino UNO’s

IMG_4386 (3)In my zeal to keep my costs down on the Half-Byte Console project, I mistakenly ordered a bunch of ATMega328p controller chips without any bootloader. Oh well, I thought, they are easy to program. So, armed with Bing and the Goog, I set out find a simple, quick solution that would not require a tremendous amount of work. After all, I did order quite a few of them.

There are a lot of how-to’s out there, some of them really well done.  But, they did require either things I do not have, like a breadboard (I know, I know!) or just took too long.  Eventually, however, I stumbled across this post that pointed the way.

A sketch, called OptiLoader, is the key. Written by Bill Westfield, the loader can work with or without a computer. It requires two Arduino boards (I am using two UNO boards) with one UNO containing a programmed 328 with the OptiLoader sketch uploaded and a second, slave UNO with the unprogrammed (or programmed, if you want to change the bootloader) 328. You need to connect WP_20140708_001the two UNO’s like this:

  1. Pin 10 on master UNO to RESET on the slave UNO
  2. Pin 11 to Pin 11
  3. Pin 12 to Pin 12
  4. Pin 13 to Pin 13

Once the ‘master’ UNO has the sketch uploaded, and you have inserted the unprogrammed 328 into the slave, connect +5 and GND on the master to the slave to give it power (I am assuming the master already has power, if not, give it some.)

Once both are powered up, the master will check the slave to see what it is and then burn the correct bootloader. Once complete, the slave is shut down. Remove power and then remove the chip. At this point, you can program another by placing the new chip in the slave, apply power and then press reset on the master. 

You can watch the progress on your computer if the master is connected. If it is, open a terminal window from the Arduino IDE, select 19200 for the baud rate and press reset on the master. The OpitLoader gives you all kinds of info and even tells you when it is ready to repeat the process.

OptiLoader is very well done and contains the images for the bootloaders. 

This method takes less than a minute to do and works well. 


OptiLoader from GitHub
Forum Post