Homebrew 6502 on a backplane (playing Invaders on a TMS9918)

Let's talk about anything related to the 6502 microprocessor.
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Homebrew 6502 on a backplane (playing Invaders on a TMS9918)

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

Image

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:

Image

Image
Last edited by visrealm on Thu Aug 19, 2021 8:20 am, edited 2 times in total.
Cheers
Troy

[My introduction]
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders)

Post by drogon »

Brilliant! :-)

(But when will the invaders start to fire back ... ;-)

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders)

Post by visrealm »

drogon wrote:
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".
Cheers
Troy

[My introduction]
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders)

Post by BigEd »

Welcome, Troy - very impressive!
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders)

Post by visrealm »

Thanks, BigEd.
Cheers
Troy

[My introduction]
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: Homebrew 6502 on a backplane (playing Invaders)

Post 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. :D
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders)

Post by visrealm »

barrym95838 wrote:
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. :D
Thanks for the tips, Mike.

First I need to add flying saucers. And invaders that shoot back. :)
Cheers
Troy

[My introduction]
rpiguy2
Posts: 94
Joined: 06 Apr 2018

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post 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.
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post by visrealm »

rpiguy2 wrote:
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.
Cheers
Troy

[My introduction]
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post by Martin_H »

Neat project!
User avatar
visrealm
Posts: 72
Joined: 18 Aug 2021
Location: South Australia
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post by visrealm »

akohlbecker wrote:
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 :)
Cheers
Troy

[My introduction]
Greg816v2
Posts: 17
Joined: 11 Jan 2022

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post 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 :)
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post by BigDumbDinosaur »

Greg816v2 wrote:
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.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Homebrew 6502 on a backplane (playing Invaders on a TMS9

Post by BigEd »

Greg816v2 wrote:
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.
Post Reply