Game Boy CPU isn't a Z80. What is it?

Discussion of programming and development for the original Game Boy and Game Boy Color.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Game Boy CPU isn't a Z80. What is it?

Post by lidnariq »

I mean, it's nice to muse, but Gekkio's evidence above is pretty hard to argue with.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Game Boy CPU isn't a Z80. What is it?

Post by tepples »

Oziphantom wrote:I also wonder which year it was exactly that MOS wisened up to Ricoh deception and was starting to hit Nintendo/Ricoh with "you owe us a lot of royalties you thieves" so moving to Sharp and not a MOS design was to safe guard them.
Yet Nintendo and Ricoh licensed the 65816 from WDC for the S-CPU in the Super NES. If you want a year, it was probably the Semiconductor Chip Protection Act of 1984.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Game Boy CPU isn't a Z80. What is it?

Post by Oziphantom »

Sure, that is WDC not MOS/CSG. Also we don't know when the actual internal discussions about CPU for each machine started.
MOS's claim in on a patent that the NES CPU infringes upon and not the "layout", however I would expect it to have been once the Matel NES came out and MOS people were aware of its existence more.
User avatar
org
Posts: 155
Joined: Tue Aug 07, 2012 12:27 pm

Re: Game Boy CPU isn't a Z80. What is it?

Post by org »

Hi,

I had a decapped DMG CPU-B for a long time, decided to do some digging and made a trace of almost the entire topology (EDIT: of the SM83 core).

All the results are here: https://github.com/emu-russia/dmgcpu

Maybe someone will think of doing VisualSim? :D
Attachments
DMG01B_Core_Fused_Topo_sm.jpg
Last edited by org on Tue Oct 11, 2022 11:39 am, edited 1 time in total.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Game Boy CPU isn't a Z80. What is it?

Post by Pokun »

Oh another great choice for a decap! I guess this should be the SM83 CPU core, the LCD Controller and the lovely APU in one stone.
Thanks for you fantastic work. :)
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Game Boy CPU isn't a Z80. What is it?

Post by Oziphantom »

That just looks like a the CPU core to me. The bottom section being the Register file.
A
F
B
C
D
E
H
L

The top left is the ALU and the top right looks like Instruction Decode.
Where are the pads though?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Game Boy CPU isn't a Z80. What is it?

Post by lidnariq »

Both the filename of the image is "DMG01B Core" and in the upper right corner of the image is "DMG CPU-B SM83 Core" so it appears to only be the CPU itself.
User avatar
org
Posts: 155
Joined: Tue Aug 07, 2012 12:27 pm

Re: Game Boy CPU isn't a Z80. What is it?

Post by org »

Oops hehe, I forgot to mention that this research only concerns the SM83 core, I apologize.
User avatar
ISSOtm
Posts: 58
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: Game Boy CPU isn't a Z80. What is it?

Post by ISSOtm »

All of the DMG-CPU-B's die has been traced and mapped by furrtek except for the CPU core, which this fills the gap for.
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3
User avatar
aa-dav
Posts: 220
Joined: Tue Apr 14, 2020 9:45 pm
Location: Russia

Re: Game Boy CPU isn't a Z80. What is it?

Post by aa-dav »

I think GB CPU was very smart rethinking of i8080 (with Z80 in mind) to minimize power consumption.
It differs not only from Z80, but i8080 also.
It's not compatible with any of them.
And this reduction is power-saving in my opinion. Dropping off two of the four arithmetic/logic flags breaks compatibility with i8080 a way hard.
For example new instruction ld hl, sp+r8 (which replaced old instruction of i8080 'ret m' (which leads to incompatibility at the base level)) is new ergonomic way to address stack variables.
And incompability with Z80 is much more hard than with i8080.
It's interesting CPU, but I think mentioning of Z80 as 'predecessor' in it's context really is mistake.
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Game Boy CPU isn't a Z80. What is it?

Post by Drag »

It's also worth pointing out, the cycle-timing of each opcode is pretty different between the Gameboy/SM83 and an actual z80. Something like that would make me think that there's some pretty big architectural differences between the two, and indeed, I've seen the Gameboy CPU described as a totally different processor that was "inspired" by the z80, instead of being a derivative, and I agree.

The main "theme" of the differences I've seen is, the z80 is more CISC, the SM83 is more RISC, so everything's more simplified on the SM83 side.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Game Boy CPU isn't a Z80. What is it?

Post by Dwedit »

From the GB game developer's perspective, it's so close to a Z80 that people just called it a Z80, or nickname it the "Game Boy Z80". Even though it is missing a lot of Z80 instructions (no IX, IY, etc), and has new instructions that aren't in the Z80 or 8080.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Game Boy CPU isn't a Z80. What is it?

Post by Pokun »

ISSOtm wrote: Tue Oct 11, 2022 2:06 pm All of the DMG-CPU-B's die has been traced and mapped by furrtek except for the CPU core, which this fills the gap for.
Oh I see, that's all good then.

Drag wrote: Thu Oct 13, 2022 9:13 am It's also worth pointing out, the cycle-timing of each opcode is pretty different between the Gameboy/SM83 and an actual z80. Something like that would make me think that there's some pretty big architectural differences between the two, and indeed, I've seen the Gameboy CPU described as a totally different processor that was "inspired" by the z80, instead of being a derivative, and I agree.
Yeah and since it's a unique CPU, turning its black box white is important.
Post Reply