Page 1 of 1

Mirrored memory areas

Posted: Sat Oct 20, 2012 10:07 pm
by Charles MacDonald
Just looking around with a Sega CD attached. On the Genesis side:

$440000-$5FFFFF repeatedly mirrors the $400000-$43FFFF area. (7 copies of Boot ROM / PRG RAM)
$640000-$7FFFFF repeatedly mirrors the $600000-$63FFFF area. (7 copies of Word RAM)
$A12040-$A120FF repeatedly mirrors the $A12000-$A1203F area. (3 copies of SCD registers)

So there are really no open areas to map things to when the Sega CD is plugged in, because of the incomplete address decoding it's completely filled up.

With no Sega CD attached you can still access $A12000-$A120FF but you read an open bus value.

Posted: Sat Oct 20, 2012 10:20 pm
by Chilly Willy
Good to know. Is there any ID bit set for the CD? I noticed the other day that there's an ID bit for the FDD in $A10001. There's also a reserved bit there.

Posted: Sat Oct 20, 2012 10:29 pm
by Charles MacDonald
Chilly Willy wrote:Good to know. Is there any ID bit set for the CD? I noticed the other day that there's an ID bit for the FDD in $A10001. There's also a reserved bit there.
Good question! Bit 5 of $A10001 ("DISK") is '0' when the Sega CD is plugged in and '1' when it isn't.

For example on a Genesis 2, the register is $81 with the Sega CD plugged in and $A1 otherwise.

The manual says this is the floppy disk drive presence detection bit, so it makes sense they re-purposed it for the Sega CD. Still wish there was some prototype floppy HW though. :)

Edit: I guess just to be clear I should state the mirrored areas apply to $000000-$3FFFFF when the CART pin isn't being grounded.

Posted: Sun Oct 21, 2012 2:08 am
by Chilly Willy
I thought there was a floppy for the Genesis... must be thinking of something else. :?

Okay, that is also good to know. There's a way to detect the CD. I need to add that to my mode 1 code. No need to try and initialize a CD that isn't present. :D

Posted: Sun Oct 21, 2012 6:47 am
by TmEE co.(TM)
It is called the floppf bit, and it goes to a signal on the EXP slot that MCD grounds.

Posted: Sun Oct 21, 2012 9:59 pm
by Charles MacDonald
Chilly Willy wrote:I thought there was a floppy for the Genesis... must be thinking of something else. :?
I think there's like one blurry picture of a FDD unit for the MegaDrive at some CES show way back when. I also remember reading an interview that said it was a Sega of America staff member who really pushed for the FDD interface and successfully lobbied SOJ to add it, as bizarre as that sounds. As far as I know it's about as real as the SNES CD. :)

There is a rare but commercially released disk drive peripheral for the Sega Saturn at least.
Okay, that is also good to know. There's a way to detect the CD. I need to add that to my mode 1 code. No need to try and initialize a CD that isn't present. :D
I was just looking at that Mode 1 CD player the other day, I noticed you didn't have to do that reset sequence that's listed in the manual:

Code: Select all

move.w #$FF00, $A12002
move.b #$03, $A12001
move.b #$02, $A12001
move.b #$00, $A12001
I was looking at a BIOS disassembly and it isn't done there either. I guess it isn't necessary?

That demo was really cool btw, I was thoroughly impressed.

Posted: Sun Oct 21, 2012 10:47 pm
by Chilly Willy
Charles MacDonald wrote: I was just looking at that Mode 1 CD player the other day, I noticed you didn't have to do that reset sequence that's listed in the manual:

Code: Select all

move.w #$FF00, $A12002
move.b #$03, $A12001
move.b #$02, $A12001
move.b #$00, $A12001
I was looking at a BIOS disassembly and it isn't done there either. I guess it isn't necessary?

That demo was really cool btw, I was thoroughly impressed.
It was added when we were trying to get the Laser-Active/X-Eye/Wonderthingy working. It may not be needed, but it doesn't hurt. :)

Re: Mirrored memory areas

Posted: Mon Oct 22, 2012 7:19 am
by Eke
Charles MacDonald wrote:Just looking around with a Sega CD attached. On the Genesis side:

$440000-$5FFFFF repeatedly mirrors the $400000-$43FFFF area. (7 copies of Boot ROM / PRG RAM)
$640000-$7FFFFF repeatedly mirrors the $600000-$63FFFF area. (7 copies of Word RAM)
$A12040-$A120FF repeatedly mirrors the $A12000-$A1203F area. (3 copies of SCD registers)

So there are really no open areas to map things to when the Sega CD is plugged in, because of the incomplete address decoding it's completely filled up.

With no Sega CD attached you can still access $A12000-$A120FF but you read an open bus value.
thanks for confirming
I indeed noticed Flux was accessing 128KB BOOTROM at $440000-$45FFFF instead of $400000-$41FFFF

For completeness, what is returned in $A12030-$A1203F (and mirrored) area(s) ?

Re: Mirrored memory areas

Posted: Mon Oct 22, 2012 2:10 pm
by Charles MacDonald
For completeness, what is returned in $A12030-$A1203F (and mirrored) area(s) ?
They are always zero, and I'm sure they are a mirror of the communication registers at offsets 20-2D. I need to get software running on the sub-CPU side so I can write a pattern and check it on the Genesis side, but I've been having some trouble with that. Wish I had a more concrete answer for you.

Posted: Sun Feb 24, 2013 10:23 pm
by Eke
Something i noticed while studying the recently scanned Mega CD tech manuals (for both models): SUB CPU only has VA1-VA19 connected to the Gate Array, which means that only 1MB area can be decoded, i.e internal backup RAM, PCM chip & "registers" should in theory be accessible from $0E0000-$0FFFFF as well (not just $FE0000-$FFFFFF as described in the official doc), and the first MB mapped area actually mirrored 16 times...

Nothing really important but still interesting to know.