Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2024-05-11 12:48:46

ctcaer
New member
Registered: 2024-05-11
Posts: 2

Obscure IO registers info

Hi, I'm upgrading a cgb emulator and I would like to emulate any obscure io register.
Did anyone try to dump the whole IO registers range in CGB mode on a CGB hw and have that info?
I can't find that info on any git/forum/etc I searched. Only some JOY and x7X regs and not much about their default values.

I compiled the mts suite (https://github.com/Gekkio/mooneye-test-suite) with the CART_CGB set,
for dump_boot_hwio and unused_hwio-C, but unfortunately I don't have a flash cart to test on my game boy color.

Said compiled roms/symbols/source are here:
https://mega.nz/file/xI83zKYA#5D9q57j8J … tTTjR82J90

Any help is appreciated.
(Ofc I understand that the unused_hwio would be annoying to test, since it will require editing for CGB mode.)

Offline

 

#2 2024-05-13 12:42:44

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 247

Re: Obscure IO registers info

The newer version of Pan Docs has initial values for all the regular IO registers.

https://gbdev.io/pandocs/Power_Up_Seque … -registers

Note that some of them are changing over time, like LY, STAT and DIV. I made a test ROM to test (particularly) DIV with high precision. Note that this test relies on reading DIV at the correct time in the instruction. A real CPU would spend 1-3 M cycles reading the instruction before the actual read of DIV takes place.

https://github.com/nitro2k01/whichboot.gb

There are also the undocumented FF7x registers. Those should all be static over time, except PCM12/PCM34 (FF76/FF77) which indicate the current amplitude level of each audio channel.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2024-05-14 03:42:55

ctcaer
New member
Registered: 2024-05-11
Posts: 2

Re: Obscure IO registers info

I'm searching for values for everything that is not mentioned clearly in pan docs (not the regular registers).
And just to make it clear, I'm interested on their behavior after the bios runs and launches a game.

In pan docs the table was taken from the mts roms which all run in DMG mode.
So, should I assume that all FF6x and FF7x have the same values and writable bits in CGB mode like how it is in DMG mode?

Also it seems to me that pan docs incorrectly states that FF72/3/5 are CGB only mode, since the boot_hwio-C is run in DMG mode and the table has the initial values.

(3 obscure regs (except FF74) in pan docs: https://gbdev.io/pandocs/CGB_Registers. … -mode-only)
(they have values in dmg mode: https://github.com/Gekkio/mooneye-test- … o-C.s#L107)

So basically that's what I get from mixing pan docs and mts roms (In: initial, W: writable):

Code:

      DMGm   CGBm
      In W   In W
FF60+ FF 00  FF 00  FF60 to FF67
FF6D+ FF 00  FF 00  FF6D to FF6F
FF71  FF 00  FF 00  
FF72  00 FF  00 FF
FF73  00 FF  00 FF
FF74  FF 00  00 FF
FF75  8F 70  8F 70
FF78+ FF 00  FF 00  FF68 to FF7F

Last edited by ctcaer (2024-05-14 03:45:24)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson