Is it possible to Hardware trace/read signals this way?

Discussion of programming and development for the original Game Boy and Game Boy Color.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

Okay just me thinking out loud about stuff i have no clue about.
It's not really about GameBoy Hardware per see, but still.

Was thinking, is it possible to, let's say you have a GameBoy.
And you somehow connect the, let's say DSP (if it even has any, can't remember) to a USB,
meaning so that the direct electronic signal is connected.

So then on your PC you would just get that signal directly so you could in theory write a driver/software to decode the signal to something that make sense.

Is such a thing possible, or is that not at all how things work?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to Hardware trace/read signals this way?

Post by lidnariq »

By DSP ... do you mean the LCD?

Sure, you could just directly connect the DMG's LCD bus to something like Cypress's EZ-USB2 and use sigrok or similar to display it on the screen. - https://hackaday.com/2017/08/01/using-a ... -game-boy/

By DSP ... do you mean the audio hardware inside the DMG?

That's an analog output from the DMG's die. You could hook it up to an oscillscope ... or a sound card ... but it wouldn't be particularly different from just using the headphone jack.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

Actually meant the Audio, but was gonna ask the same about the LCD for that matter.

what's Cypress's EZ-USB2, something specific for that or any kind of hardware trace?

Didn't know decoding the LCD directly was a thing even, just thought about it yesterday randomly, that's really neat.

Ah so the Sound isn't digital at one place before it turns analogue?
Though that's how things normally worked.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to Hardware trace/read signals this way?

Post by lidnariq »

It's digital inside the DMG's die until it hits the DACs. But that's not a place that you can physically get to without comparatively nice equipment.

If you're planning on decapping the DMG to get eensy logic probes in, it would make more sense to go all the way to something like Visual2A03.


Cypress's EZ-USB is a product line. It's a $12 IC that you can buy from various places on a board.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

but wait, isn't the DAC separate from the die (CPU?).
Meaning the digital data is sent between those.
Couldn't one just hook that, just like hooking the LCD bus?

EDIT:

So something like:

http://www.ebay.com/itm/CY7C68013A-56-E ... Sw-zxWndkO

And one is good to go?

I would assume one needs a USB cable to connect the board itself to the PC.
And also some copper wires that's somehow set up to whatever you wana analyze?

Probably missing something obvious so excuse my idiocy haha;p
nitro2k01
Posts: 252
Joined: Sat Aug 28, 2010 9:01 am

Re: Is it possible to Hardware trace/read signals this way?

Post by nitro2k01 »

zerowalker wrote:but wait, isn't the DAC separate from the die (CPU?).
Meaning the digital data is sent between those.
Eh, no. It's integrated on the CPU die, and the "DAC" most likely consists of a bunch of resistors (something like an R2R ladder) driven by digital lines from each channel. Then the channels (as far as I understand from their behavior) are mixed analog, and finally attenuated anlog by the master volume register, all on the same die. Your only interface to the sound circuit is the two analog outputs, unless you decap the chip and probe the die with needles or something.

This sounds like an X/Y problem. What is the actual thing you are looking to achieve? Lossless audio and videorecording? Fast communication with the program running on the CPU?
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

Ah okay that explains it.


Well analyzing stuff i guess.
Like intercepting signals from X to Y and see what's going on to play around and learn more of it.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to Hardware trace/read signals this way?

Post by lidnariq »

Unfortunately, the DMG's die is sufficiently integrated that you're not really going to be doing any "intercepting".

A schematic basically shows the CPU and PPU(??)'s separate address/data buses; the link port; the LCD; the button I/O; and basically nothing else externally accessible.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

ah, hmm.

But let's say the buss intercepting like the link above.
Can such things be done with the thing and some wires?
And of course decoding it manually etc.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to Hardware trace/read signals this way?

Post by lidnariq »

The relevant board I shared a link to can only monitor 16 signals at once; there's many more on the DMG.

But, yes, you can monitor any of the external signals without too much difficulty.

If you want to monitor more signals, you may be better served by picking up an older (used) HP logic analyzer.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

Ah, well have to start play around and test somewhere, didn't even know these things existed, don't have any real experience with direct hardware stuff like this.
So will get one of those, and a Raspberry Pi 3 as it seems to also be able to do something similar (and can be useful for random stuff anyhow).

Thanks:)
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

Okay noticed that i can't even open the Gameboy cause i lack the screwdriver for it.
It's probably been opened before cause it's not triwing screws, but normal Phillips (+).

I am horrible with screw sizes and types, but at least i can confirm it's a phillips,
but i have no idea which size.
So i am guessing it should be the same size as the triwing equivalent, so anyone know which size that is?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to Hardware trace/read signals this way?

Post by lidnariq »

Do you not already have a variety of phillips' head screwdrivers?

#2, #1, and #0 are by far the most common. (I personally own #00 and #3 ones also). Unlike other drivers, phillips' head is ... uh, mechanically possible to drive with one that off in size number by 1, but that risks damage to the screw or screwdriver.

The screws inside the device are apparently #00 - https://www.ifixit.com/Guide/Game+Boy+S ... ement/3371 (edit: fix broken url) - but there's no reason to think that the new screws holding the case shut are the same size.
Last edited by lidnariq on Thu Sep 14, 2017 2:11 pm, edited 1 time in total.
zerowalker
Posts: 68
Joined: Tue May 17, 2016 10:15 pm

Re: Is it possible to Hardware trace/read signals this way?

Post by zerowalker »

i have, but not tiny ones.

i would guess it's one of those 3 then, i mean it can't be bigger, cause the head is super tiny.
nitro2k01
Posts: 252
Joined: Sat Aug 28, 2010 9:01 am

Re: Is it possible to Hardware trace/read signals this way?

Post by nitro2k01 »

Early DMGs used philips head screw instead of triwings for the exterior screws. If you look through the hole in the case for the battery lid latch, you'll see the motherboard revision. DMG-CPU-04 and lower will always use philips head screws, and some DMG-CPU-05 units will as well. DMG-CPU-05 and later will usually use triwings, though. The case screws are the same diameter as the internal ones, so the head should be identical as well, if they are philips.
Post Reply