Page 1 of 3

Why no "gameboys"?

Posted: Sun Nov 24, 2019 9:45 am
by MalphasWats
Hi,

So I have a proper newbie question. I'm at the early research stage for designing a 6502-based computer of my own. I want to make a "gameboy-esque" handheld gaming device.

I've made a couple of similar things using an AVR MCU core previously but have grown frustrated with the Harvard architecture not being well suited to swapping games.

I want to try building something simple based around the 6502 with a bit of RAM, bit of ROM to handle loading games from an SD card, a VIA for buttons and a little OLED display. The ubiquitous SSD-powered OLEDs all have a 'secret' 8-bit parallel mode which I'm pretty sure can map to the address and data bus.

So, my question is: why hasn't anyone else done this? There are loads of 'Arduino' based gaming devices out there but barely any based on this otherwise very popular platform.

I guess I'm just worried I'm missing something that has doomed me to failure before I even start!

Thanks
-Mike

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 11:49 am
by BitWise
There are millions of 6502s out there in Tamogochis, electronic dictionaries and other handheld game devices. Sunplus created an extended 6502 with a builtin LCD driver that is used in lots of them.

No one has ever used a MOS or WDC chip directly because its too big, too power hungry and needs lots of other support chips. You could probably make something with one of the microcontroller versions like the 65C134 or 65C265 but a custom ASIC would be the best option.

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 4:43 pm
by drogon
MalphasWats wrote:
Hi,

So I have a proper newbie question. I'm at the early research stage for designing a 6502-based computer of my own. I want to make a "gameboy-esque" handheld gaming device.

I've made a couple of similar things using an AVR MCU core previously but have grown frustrated with the Harvard architecture not being well suited to swapping games.
An interesting way round that is to have the "cartridge" contain the actual ATmega... So rather than a traditional "ROM" cartridge, you get the actual CPU with on-board FLASH. Then the motherboard can contain the base graphics/sound, etc. widgetry...

MalphasWats wrote:

I want to try building something simple based around the 6502 with a bit of RAM, bit of ROM to handle loading games from an SD card, a VIA for buttons and a little OLED display. The ubiquitous SSD-powered OLEDs all have a 'secret' 8-bit parallel mode which I'm pretty sure can map to the address and data bus.

So, my question is: why hasn't anyone else done this? There are loads of 'Arduino' based gaming devices out there but barely any based on this otherwise very popular platform.

I guess I'm just worried I'm missing something that has doomed me to failure before I even start!
It's "hard" in that it's not easy like Arduino, STM (ARM) with PC base development environments, etc. so the lazy don't bother.

-Gordon

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 5:17 pm
by MalphasWats
Thanks chaps - it seems the answer is somewhere in the realm of "because it's a stupid thing to do" which kinda sits right in my wheelhouse for projects.

I did the 'cartridge' idea with a previous iteration of the project I linked above. The mechanical design is harder for that one though and that's in the bottom of my skills ranking!

I've been looking at doing something using the QFP versions of the various chips to keep the size down a bit.

I found a source of 128x128 pixel 16-grayscale OLEDs which I thought would make a real improvement to the 1-colour ones I've been using. thought it could be cool to try a new architecture too but was suspicious that I was the only person to have thought of it!

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 5:38 pm
by BigEd
Welcome! Not stupid, but staying within a battery power budget and a small form factor could be tricky. But then batteries are now much better than they used to be. And you can these days get a 6502 in a small square package too (44 pin QFP) which might help. Even better if a microcontroller option gives you some help in reducing chip count.

Edit: there are a few projects listed on hackaday's project portal:
https://hackaday.io/search?term=6502+game
(They may be finished and working, or barely started!)

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 8:39 pm
by MalphasWats
Huh, I've just been browsing the W65C134 microcontroller datasheet. Why did I not know about this thing!? It's basically everything I've ever wanted from an AVR MCU!!

Re: Why no "gameboys"?

Posted: Sun Nov 24, 2019 8:53 pm
by BitWise
MalphasWats wrote:
Huh, I've just been browsing the W65C134 microcontroller datasheet. Why did I not know about this thing!? It's basically everything I've ever wanted from an AVR MCU!!
The WDC W65C134SXB board is quite reasonably priced but I think the W65C265SXB is better, it does everything the 134 can do but also gives you 16-bit register modes and a larger addressable memory.
https://www.tindie.com/products/wdc/w65c134sxb/
https://www.tindie.com/products/wdc/w65c265sxb/

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 11:11 am
by EvilSandwich
The handheld Atari Lynx ran on a 65SC02, if I recall correctly. Which was a CMOS 6502 without bit instructions.

Coincidentally, I recall it having a battery life, so short, that you could bake muffins to it. I wonder why. lol

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 11:24 am
by BitWise
EvilSandwich wrote:
The handheld Atari Lynx ran on a 65SC02, if I recall correctly. Which was a CMOS 6502 without bit instructions.

Coincidentally, I recall it having a battery life, so short, that you could bake muffins to it. I wonder why. lol
A 65SC02 core in a custom CMOS package along with sound, video and other bits of hardware. Not good battery life:
Quote:
Battery holder (six AA) 4–5 hours (Lynx I) 5–6 hours (Lynx II)

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 11:31 am
by MalphasWats
When I was a kid my best friend's uncle had a Lynx. I didn't realise it was 6502-based!

I do remember most handhelds had pretty poor battery life back then, although it was also before LED backlights were a thing. OLED displays are pretty low drain these days so hopefully I could squeeze a bit more out of a set of AAAs :)

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 11:53 am
by EvilSandwich
The Atari Lynx was an interesting piece of hardware under the hood with a few decent games.

You're better off using an emulator if you wanna test programs on it though. The actual physical hardware on it was notoriously bad. Particularly the screen, which was extremely prone to ghost images and blurring.

But yeah, most old school handheld devices ran on some kind of custom Z80 like the Sega Game Gear. Or a custom 8088 like the criminally underrated Bandai Wonder Swan. Or, in the case of the old gameboy, a weird and cleverly designed 8088/Z80 hybrid. The Atari Lynx was pretty unique in running on a 6502.

Edit:
It just occurred to me. No need to chain yourself to the fleeting battery life of disposal batteries, if you're making a handheld device. Its not like this is the early 90's anymore. Why not just install a rechargeable battery setup, so you just need to plug it in for a couple hours when the 6502's power draw ultimately kills it?

Not all old tech is worth reviving. The giant pile of dead AA batteries my Game Gear killed is proof of that. lol

https://www.jameco.com/webapp/wcs/store ... egory=4715

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 12:40 pm
by MalphasWats
Yeah, all my previous projects have built-in 3.7v LiPo cells, they're pretty easy to work with most of the time. The AAAs thing was just something I was considering.

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 12:43 pm
by EvilSandwich
MalphasWats wrote:
Yeah, all my previous projects have built-in 3.7v LiPo cells, they're pretty easy to work with most of the time. The AAAs thing was just something I was considering.
Oh, you're wayyyyy ahead of me then. What kind of screen are you thinking of using?

I admit, I've never installed anything more complex than a 16x4 Text LCD display on my bread board projects.

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 1:36 pm
by MalphasWats
EvilSandwich wrote:
Oh, you're wayyyyy ahead of me then. What kind of screen are you thinking of using?

I admit, I've never installed anything more complex than a 16x4 Text LCD display on my bread board projects.
I want to try and use this grayscale 128x128 OLED display. I'm currently working on a breakout board to get access to the 8-bit 6800 interface, rather than the SPI that they always seem to have! It's not a perfect solution because it doesn't have any direct addressing to the graphics RAM, but once it's configured, it's really just about writing bytes to it as fast as possible. I think it would be fairly trivial to map the Command/Data pin to the address bus, and then using it in 8-bit mode means no faffing around with serial devices to get the data in. It does also have a read mode, but probably much too slow to actually use because it can't be mapped directly, so would take ~8k of RAM for a buffer.

I've never built anything with a 6502-based brain though, only AVR and ARM microcontrollers so far, so it should be quite fun to try!

Re: Why no "gameboys"?

Posted: Mon Nov 25, 2019 6:05 pm
by GARTHWILSON
EvilSandwich wrote:
The handheld Atari Lynx ran on a 65SC02, if I recall correctly. Which was a CMOS 6502 without bit instructions.

Coincidentally, I recall it having a battery life, so short, that you could bake muffins to it. I wonder why. lol
That wouldn't be because of the 65SC02 though. Not counting bus loading, its maximum current draw was 4mA/MHz, and 10µA in standby. WDC's max is 500µA/MHz @ 5V (less at lower voltages), and 1µA in standby. I designed a computer for a product in the late 1980's for work, using a Rockwell R65C02, 8KB CMOS SRAM and 32KB CMOS EPROM, a 1x16 intelligent character LCD module, a Saronix real-time clock IC with integrated crystal, and some logic gates for glue and I/O, and ran it most of the time at 170kHz to save battery power, and stepped it up to 1MHz when we had to do a lot of floating-point arithmetic. The entire computer took 2mA when turned on. When turned off, it took just a few µA to keep the RAM alive and keep the RTC running.

About batteries: I've bought 100 AA alkaline batteries for as little as $16.