Super Magic Drive research thread

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Jan 31, 2011 9:40 pm

I checked what is done when "run ic card", thanks to tcdev great disasm
it's the same thing in my bios (3.1g) :
- check if cart is present => it doesn't write an error so cart detect is right
- vdp display disable => screen is green so no problem on this one
- memoryModeReg (0x2001) = 2
- loop forever
it loops on green for ever I thing so the (0x2001) = 2 doesn't do what it should...

correct me if I'm wrong but, it should
- reset M3 on SMD port (to switch to genny mode) => pin B30
- soft reset => pin B27

so I must check if something is wrong around these 2 pins I assume
else...the EPLD is dead ;)
especially B27 since I doesn't reset (not even in M3 mode)....but it doesn't seem to be connected, according Charles' schem... :(

EDIT : just got an idea...
do you think a input of the EPLD (anyone) could be wrong and so the EPLD doesn't receive input like it should ?
for example, let say, because a trace is wrong, a pin is to low (or more true, unknow status) while it should be high when the EPLD received (0x2001)=2 and so it doesn't active the good output (and so reset and M3) ?
something like (pseudo code)
if ( Adr =0x2001 AND Data = 2 AND PinX = 1) then M3 = 1

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Tue Feb 01, 2011 3:24 pm

Based on tcdev disasm, I did almost the same with v3.1G

3 things I found
1/ check_sig_trk80 is no longer here
2/ it supports 6 disk formats (no 4 like in v3) with different param and what tcdev call BPB
3/ if you start SMD with a cart and a joypad button pressed, it loads cart on dram then launch it (=> to test & confirm)

I could release the .idc or .pdf like tcdev if someone interested in

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Tue Feb 01, 2011 5:13 pm

I did the same thing on 3.3

- handle multifile (status = bit 6 of smdheader)
- more friendly message ( xxx OK)
- ask for floppy if not found
- on startup load cart in RAM if button pressed (no longer launch it)
- no more load file/save file

see you tomorrow for 4.0 ;)
Last edited by KanedaFr on Wed Feb 02, 2011 11:34 am, edited 1 time in total.

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

Post by tcdev » Wed Feb 02, 2011 10:20 am

Would be interested in PDF listings of other versions - yes! :)

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Wed Feb 02, 2011 11:33 am

New in 4.0

- like said in Charles's doc, support for larger game and new size of pages (128k vs 16k) so a lot of func are updated to handle this
- change of pal used for font (?)
- new item on main screen : backup test => run cart game in DRAM
- a lot of more friendly msgs added in 3.3 are no longer there
- they, at last, use 'SRAM' and not 'Data' in some menu
- on startup, if button pressed ... nothing (!) because handled by the new 'backup test' feature (?)
- it's not clear (sorry) if they removed multi file support or if the code is (a lot) better
- SMD command 2 & 3 were removed (get/set VDP)
- add a new SMD command 6 => launch data in DRAM

so, from my point of view, a mix between 3.3 and 4.0 will be the best ;)


again, thanks a lot to Charles & Mark who did the hardest part !!


I'll post the 3 pdf later or tomorrow

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

Post by tcdev » Wed Feb 02, 2011 11:52 am

I think you should write up a summary of the changes in each version (perhaps just formalise what you have already posted) and have Charles add it to his SMD documentation. It would be nice to have this collated in one coherent location for future readers.

[OT: had a crazy idea, but I think I have convinced myself that it isn't possible or at least too difficult; port the original Space Invaders arcade game to the SMD... well I did warn you it was crazy...]

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Wed Feb 02, 2011 12:25 pm

I plan to add everything on my dedicated page :
http://gendev.spritesmind.net/page-bsys_smd.html

but I doubt I'll write more than these posts ;)

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Feb 03, 2011 9:23 pm

Sorry for the delay
for each bios, the .lst (text file) and the .idc (if you want to update/continue the analysis)
http://gendev.spritesmind.net/files/bsy ... alysis.zip
http://gendev.spritesmind.net/files/bsy ... alysis.zip
http://gendev.spritesmind.net/files/bsy ... alysis.zip

tcdev, I make a mirror of your file. Tell me if you're ok, else I'll delete it
http://gendev.spritesmind.net/files/bsy ... v3.lst.pdf

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

Post by tcdev » Sat Feb 05, 2011 6:02 am

KanedaFr wrote:tcdev, I make a mirror of your file. Tell me if you're ok, else I'll delete it
http://gendev.spritesmind.net/files/bsy ... v3.lst.pdf
No objections from me!

And thanks for those other analyses!

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Mar 24, 2011 4:29 pm

I'm back on my SMD (really really need to fix it! lot of stuff waiting because of this!)....

I used IDA to disasm the bios...
the output is for "Zilog Macro Assembler"
do you know which is the best one for Windows (must work Vista/seven) ?
I looked at WLA DX but, at first sight, it seems I'll need to adapt the syntax from IDA output :

Code: Select all

ROM:0000 ; Segment type: Pure code
ROM:0000		 segment ROM
ROM:0000
ROM:0000 loc_0:					 ; CODE	XREF: ROM:1996j
ROM:0000					 ; ROM:199Ej
ROM:0000		 jp	 RESET
....
I think WLA DX is the best one, since it's SMS Power's assembler of choice!

do you think of another one ?

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Sat Mar 26, 2011 2:20 pm

Binutils actually supports Z80 since version 2.19 or so. That includes the linker, disassembler and everything. If you're using GNU based tools for 68K + SH2, it's really convenient to have the exact same toolchain for Z80 too.

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

Post by Chilly Willy » Sat Mar 26, 2011 7:15 pm

Hey! It does! I'll have to make a Z80 binutils for 2.21 and try it out.
:D

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Sun Mar 27, 2011 2:39 pm

why not...
but it seems the syntax is different...

BUT, if it allows me to code in C (for rapid prototype), I'll go for it.

Good news : I know why my floppy doesn't work anymore => the 10v to 5v fried, need to make a new one
Why is it a good news ? because I NEVER used the IO port before, only the COM port...so the IO perhaps never worked (leaked battery) while the COM did... If I successfully repair the floppy downstepper, I'll be able to load rom while I'm looking for a fix for the IO port...



Bad news : the PSU of my PC with a floppy drive burned => times to buy a chinese floppy USB drive.

Some stuff to buy next month (new soldering iron, floppy drive & 5V downstepper) :)

User avatar
KanedaFr
Administrateur
Posts: 1110
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Tue Apr 12, 2011 9:54 am

Do you think it is possible to load the bios on an emulator ?
I'm starting to make a custom bios and I would like to test it (at least the visual part)...
I tried to load it like a Genesis game : fails
I tried to load it like a SMS game : fails

Does one of the existing emus accept Z80 code like main code ? What about Phantasy Star ?!

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

Post by Eke » Tue Apr 12, 2011 10:49 am

Does one of the existing emus accept Z80 code like main code ?
Well, all emulator supporting SMS games do, by definition.
All 3 dumped BIOS worked in Kega last time I tried so if your modified BIOS does not load it means you are probably missing something
Off course you need the extension to be .sms.

What about Phantasy Star ?!
Phantasy Star is nothing else than the SMS game put inside a Genesis cartridge and works exactly like Power base Converter did, by putting the console in MS compatibility mode, using the !M3 pin on cartridge port.

I've added MS mode in genesis plus recently. Interest of this mode is that you can still use Mode 5 of the VDP with the Z80 as main CPU if you wanted to, which could be useful if you want to make a nicer interface with more colors, etc

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests