Super Magic Drive research thread

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Fri Jan 07, 2011 2:20 am

OK, I've done at least 50% of the disassembly now.

Noticed something weird that I need to confirm. In one of the routines, it appears to check for a 32-byte signature on track 80. If it is missing, it prints "UNKNOW DISK" (sic).

If this is indeed the case, it might explain why I haven't been able to read files off disk... hmm... sound familiar to anyone?

BTW I/O ports:
$7F: ???
$BE : VDP data port
$BF: VDP control port

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Fri Jan 07, 2011 7:57 am

Charles, I believe you have the DRAM/cartridge size memory variables swapped in your document?!? Should be:

$DFF0 - DRAM size
$DFF1 - cartridge size

Also, the controller is read via port $DC

Working my way through the menu processing atm...

Probably done 65-70% of the code now.

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Sun Jan 09, 2011 12:47 pm

The law of diminishing returns... :(

Probably more than 80% complete. The remaining routines are, I believe, mostly concerned with FAT file system implementation.

I'll be damned if I can work out HTF the cartridge-detect routine is supposed to work?!?

Also, one or two funnies in the disk routines...

Suppose I should finish it off...

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Sun Jan 09, 2011 7:05 pm

It's a nightmare....
the thing which MUSTN'T happen...happends : my SMD is dying...

the battery was removed years ago so it's not it...unless the acid it released years ago had slowly killed my smd...
http://gendev.spritesmind.net/img/smd/kaneda_no_smd.jpg (near 3M jpg)

so, the bad things of today:
- my old PC fdd died
- my smd fdd died (can't be sure if it's my ffd or smd is bugging)
- my smd not always see the ram (looking near the ram connector, it should be the result of acid...)
- my smd halt then transfering data throught LPT (can't work on my usb project!)
- my smd is unable to play cart (the strangest one! because it's a redirect to cart, no RAM loading I think)

I got a 3.1g, perhaps the bios was partly erased...but the GUI is fully working

so...I will try to get help at Tototek's forum, until this I can't test anymore...

sad day for my genny dream :(

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

Post by Charles MacDonald » Sun Jan 09, 2011 7:25 pm

Here are schematics for the Super Magic Drive

http://cgfm2.emuviews.com/img/smd-main-v1.png

I haven't added the disk connector and controller chip, and finished the parallel port connector.
About DRAM refresh, I don't know how it works. Notice the EPLD can input DTACK but not drive it. Maybe it snoops 68K cycles to see when it can insert a refresh cycle or something?

Notice how many signals are missing from the cartridge connector. It may be possible to increase compatibility by soldering wires from the card edge to the cartridge slot.

EDIT: Added some pull-up resistors, series resistors on DRAM address, finished mapping DRAM control signals to the EPLD, added the RC reset circuit.
Last edited by Charles MacDonald on Sun Jan 09, 2011 11:29 pm, edited 3 times in total.

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

Post by Charles MacDonald » Sun Jan 09, 2011 7:28 pm

tcdev wrote:Charles, I believe you have the DRAM/cartridge size memory variables swapped in your document?!? Should be:
The documentation is terribly out of date, so I'm inclined to agree. :D

The memory mapping and ports are the same as SMS mode on the Genesis, so you'll see:

00-3F : I/O and memory control outputs
40-7F : PSG and H/V counter
80-BF : VDP
C0-FF : Inputs

0000-BFFF : Memory as defined by the SMD
C000-DFFF : RAM
E000-FFFF RAM (mirror)

And the SMD when running Z80 programs latches data written to E000-FFFF and uses it as 5-bit bank number for $8000-$BFFF. It's a very crude memory mapper implementation, but enough for most SMS games.

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

Post by Charles MacDonald » Sun Jan 09, 2011 7:43 pm

KanedaFr wrote:It's a nightmare....
the battery was removed years ago so it's not it...unless the acid it released years ago had slowly killed my smd...
http://gendev.spritesmind.net/img/smd/kaneda_no_smd.jpg (near 3M jpg)
You could use a multimeter and do some continuity tests to see if the traces are damaged. If they are, you could solder wires between the two points to re-establish the connections yourself.

Those bad traces are part of the DRAM data bus, so I assume running and dumping cartridges works, but running programs from DRAM does not? I'm sure we can find a solution to fix your SMD.

sad day for my genny dream :(
I finally ordered the PCBs for the Genesis devcart I described in the "Blabla" forum, so assuming it works I could sell you one, or you could build one yourself. The parts are still in the mail so I don't know if the design is successful or not. :D

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Sun Jan 09, 2011 9:19 pm

KanedaFr wrote:the battery was removed years ago so it's not it...unless the acid it released years ago had slowly killed my smd...
Unfortunately, the erosion of tracks damaged by battery acid will continue after the battery is removed, even more-so when the circuit is powered. There are articles on the net which describe how to treat the damage - you need to remove/neutralise the remaining acid in the tracks - and then seal them from the air.

My SMD was exactly the same when I received it, and I treated it immediately. It was working a few years ago after I fixed it, but now it seems it - too - has trouble with the DRAM.

Thanks to Charles for the schematic. I was actually considering drawing one up myself, so I'm relieved to see much of it done by someone else! :)

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Sun Jan 09, 2011 9:29 pm

Charles MacDonald wrote:The 10-bit disk drive address inputs are hardwired to 3F0-3F7, where address bits 2,1,0 come from Z80 A2, Z80 A1, but SA0 is from the EPLD. It could let SA0 follow Z80 A0, but it gets A4-A1 as inputs along with higher address lines.

So in other words, expect bit 0 of the register address to be weird. ;D
$3F0-$3F7 map to $2009-$200E. A2,A1 unchanged. A3,A0 inverted.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Jan 10, 2011 12:06 am

tcdev :
so I was right...I saw articles about that, I need to retrieve them...or simple add wires ;)

Charles, I don' t know how to thank you enough!
I was starting my own schema but you saved me a lot of times !
My concern is that it doesn't play cart...
I even removed the DRAM:
it launches, I see on screen
RAM : 0M
CART : 8M
but if I select 'Run IC Cart', I have a green screen then nothing...
the SMD is able to read the cart and get its size but no to run it

2 choices:
1/ even when running an IC Cart, the SMD loads the game in DRAM then launch it
=> it will explain why I doesn't work (w/ DRAM but faulty lines or w/o DRAM)
2/ when running IC Cart, it only acts like a pass-throught
=> DRAM isn't the problem so I have something else....

so could some one confirm me the SMD is not able to play a cart if you remove the DRAM ?
tcdev, something about this in the bios ? ;)

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

Post by Charles MacDonald » Mon Jan 10, 2011 1:34 am

but if I select 'Run IC Cart', I have a green screen then nothing...
Does it always stay at a green screen after 'Run IC Cart', or does it turn black?

I know you have no LPT anymore, but if you can somehow, does running SMS ROMs using my smdutil program work? (you'd need the DRAM board installed)

Does the DRAM test it has also at least load, even if it fails the test?

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Mon Jan 10, 2011 1:58 am

KanedaFr wrote:2 choices:
1/ even when running an IC Cart, the SMD loads the game in DRAM then launch it
=> it will explain why I doesn't work (w/ DRAM but faulty lines or w/o DRAM)
2/ when running IC Cart, it only acts like a pass-throught
=> DRAM isn't the problem so I have something else....
tcdev, something about this in the bios ? ;)
The BIOS calculates the cartridge size at startup (only) and stores it at $DFF1. When you select "RUN IC CARD" it then checks this location is non-zero, then simply disables Mark III mode ($2001<-$02) and spins in a tight loop waiting for the 68k software to take over. It does not run out of DRAM.

I'll set up my Genesis here without the DRAM and see what happens...

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Mon Jan 10, 2011 2:06 am

tcdev wrote:
KanedaFr wrote:I'll set up my Genesis here without the DRAM and see what happens...
Yes, I can run a cart without the DRAM installed.

tcdev
Interested
Posts: 35
Joined: Sun Oct 26, 2008 9:25 pm
Location: Sydney, Australia
Contact:

Post by tcdev » Mon Jan 10, 2011 2:26 am

A few interesting observations...

My board is designated SMD 94V-0 yet it differs from both the schematic and the photo in this thread.

I don't have the RC reset circuit (D2,R13,C23) next to the xtal. Not even the traces/pads on the PCB. (And FWIW there's two R13's on the circuit).

When I 'fixed' my SMD I neglected to replace R3 on the SRAM CS# gating circuit. Doh!

EDIT: I don't have U5,U7 (7408) or U6 (74HCT157) on my DRAM board. It only contains 8x DRAM chips (KM44C256BP-7) and caps.
Last edited by tcdev on Mon Jan 10, 2011 2:43 am, edited 1 time in total.

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

Post by Charles MacDonald » Mon Jan 10, 2011 2:37 am

tcdev wrote:A few interesting observations...
I don't have the RC reset circuit (D2,R13,C23) next to the xtal. Not even the traces/pads on the PCB. (And FWIW there's two R13's on the circuit).
Thanks for the bug report, I'll fix it. Cut and paste error. :D

Is the reset input instead connected to the MRES# or VRES# signals from the Genesis cartridge port? (well probably MRES# would make sense)

Is there any kind of limitation on cartridge size dumping in the BIOS? Unless I traced something incorrectly, it looks like CRT.VA21 is fixed during BIOS operation so the upper bit of the DRAM/ROM page register does nothing. This would limit DRAM selection to 2MB which is fine, but also limits addressable cartridge ROM to 2MB.

I feel certain I've dumped 3MB and 4MB games on the SMD in the past, even though I couldn't load and play them of course.

I wonder now that we know the DRAM interface fairly well, if there's some way would could make a SRAM board or something to replace those old faulty chips. Or make our own modifications to support larger DRAMs, assuming the refresh logic doesn't limit how many rows are refreshed. :)

Post Reply