Page 1 of 2
Homebrew 6502 on a backplane (playing Invaders on a TMS9918)
Posted: Wed Aug 18, 2021 1:51 am
by visrealm
Hi all,
I'm fairly new to the 6502 (and this group). Got interested in it following the CX16 project. Then got started in 6502 Assembly writing a couple of games for it.
I've previously built a Ben Eater inspired breadboard CPU and got it to the point I could run
Snake on a 16x2 character LCD, but was still very limited. I decided to tackle my first PCB-based hardware project and have always wanted to do a backplane, so I did (both).
Designed and ordered a custom backplane and a bunch of custom proto-cards for it, then got to work building out the cards.
So far, I've built 6 cards:
- 6502 CPU
- Triple-mode clock
- RAM/ROM (32KB of each)
- LCD card (supports standard character LCDs and Graphics LCDs)
- TMS9918A based video card
- Dual AY-3-8910 sound card
I also have a NES controller board (currently on a breadboard). Enough hardware to start a simple game, so started work on an Invaders clone (6502 assembly).
The 6502 is currently running at 4MHz. Seems fine. I haven't tried to go faster yet.
I have all the code and most of the schematics on
github.
Created a project on
Hackaday.
I do plan on creating a few more YT videos on the project (going into more detail) over the coming months.
Cheers
Troy
Here's what the backplane and custom cards look like:

Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Wed Aug 18, 2021 8:22 am
by drogon
Brilliant!
(But when will the invaders start to fire back ...
-Gordon
Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Wed Aug 18, 2021 8:33 am
by visrealm
Brilliant!
(But when will the invaders start to fire back ...
-Gordon
Thanks!
Soon.
There are a few more changes to make. I also plan on supporting pixel-level collisions (currently tile-level). The invaders are just text glyphs since the TMS9918A doesn't support more than 4 sprites on a scanline, so I can't use the hardware sprites or hardware sprite collision detection. The ship and its bullets are sprites. Everything else is "text".
Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Wed Aug 18, 2021 12:32 pm
by BigEd
Welcome, Troy - very impressive!
Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Wed Aug 18, 2021 11:49 pm
by visrealm
Thanks, BigEd.
Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Thu Aug 19, 2021 5:58 am
by barrym95838
You should know that the key to a good score in Invaders is to quickly get them trimmed down to a tight 3 X 3 group then hang around shooting flying saucers for as long as possible before finishing the group off at the last moment.

Re: Homebrew 6502 on a backplane (playing Invaders)
Posted: Thu Aug 19, 2021 6:39 am
by visrealm
You should know that the key to a good score in Invaders is to quickly get them trimmed down to a tight 3 X 3 group then hang around shooting flying saucers for as long as possible before finishing the group off at the last moment.

Thanks for the tips, Mike.
First I need to add flying saucers. And invaders that shoot back.

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Thu Aug 19, 2021 4:43 pm
by rpiguy2
Did you have to do any tricks to get the TMS9918 to keep up with the 6502? Historically folks have had problems going over 2mhz with the TMS9918 as it cannot always keep up.
Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Thu Aug 19, 2021 10:42 pm
by visrealm
Did you have to do any tricks to get the TMS9918 to keep up with the 6502? Historically folks have had problems going over 2mhz with the TMS9918 as it cannot always keep up.
I do have a "tmsWait" subroutine I call after each read/write. It's just a handful of NOPs. I haven't really tested how few NOPs I can get away with or if some operations require more than others.
Other than that, it seems to work fine.
Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Sun Nov 28, 2021 12:22 am
by Martin_H
Neat project!
Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Sun Nov 28, 2021 12:48 pm
by akohlbecker
Excited to see this project grow
Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Mon Nov 29, 2021 12:27 pm
by visrealm
Excited to see this project grow
Thanks! As luck would have it, I've just added a keyboard to it using a PIC MCU. My first time playing with a PIC, using pic-as.
https://www.youtube.com/watch?v=D6upr-1-uuE&t=7s
Expect more changes soon

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Fri Jan 14, 2022 10:01 pm
by Greg816v2
Very cool, nice work! I've noticed that for every person who says "don't run the busses off the board!" there is a working project like this

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Sat Jan 15, 2022 12:27 am
by BigDumbDinosaur
Very cool, nice work! I've noticed that for every person who says "don't run the busses off the board!" there is a working project like this

Running the buses off the board is okay as long as you understand the potential booby-traps that may be encountered. Depending on clock speed and other factors, signal slew and/or transmission line effects can sabotage timing and render the unit DOA. For a first build, it's better to keep the buses on the board. If the buses are to be extended off-board use of transceivers to drive to peripherals may be necessary to maintain stability.
Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9
Posted: Sat Jan 15, 2022 8:23 am
by BigEd
Very cool, nice work! I've noticed that for every person who says "don't run the busses off the board!" there is a working project like this :)
Quite so! Actions speaking louder than words.
There's room, of course, for good advice, when a project is struggling, and in those conversations we can learn about debugging techniques and about specific electrical or timing problems.