Mirrored memory areas

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Mirrored memory areas

Post by Charles MacDonald » Sat Oct 20, 2012 10:07 pm

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.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Oct 20, 2012 10:20 pm

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.

Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Post by Charles MacDonald » Sat Oct 20, 2012 10:29 pm

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.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Oct 21, 2012 2:08 am

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

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Oct 21, 2012 6:47 am

It is called the floppf bit, and it goes to a signal on the EXP slot that MCD grounds.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Post by Charles MacDonald » Sun Oct 21, 2012 9:59 pm

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.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Oct 21, 2012 10:47 pm

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. :)

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Re: Mirrored memory areas

Post by Eke » Mon Oct 22, 2012 7:19 am

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) ?

Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Re: Mirrored memory areas

Post by Charles MacDonald » Mon Oct 22, 2012 2:10 pm

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.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sun Feb 24, 2013 10:23 pm

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.

Post Reply