Porting Megadrive code to mega cd

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
Lips2k8
Newbie
Posts: 4
Joined: Fri Aug 29, 2008 2:01 pm
Location: Wolverhampton UK

Porting Megadrive code to mega cd

Post by Lips2k8 » Fri Aug 29, 2008 2:07 pm

Hi there, I have been learnig to develop on the megadrive using ASM for a few months now and have also experiamernted with Basicexzor for mega cd stuff what I was wondering is what needs to be done to poet something that has been coded to run on the megadrive to run on the the mega cd? simualr to what Team Megamix have done with Sonic megamix or what basic does when you tell it to build your code to mega cd?

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

Post by KanedaFr » Wed Sep 03, 2008 3:27 pm

some months/years ago, Fonzie or MoD (sorry I don't remember) made a rom loader. so if your game is small, nothing to do ;)
else, you have a lot of thing to rewrite...but I let Fonzie or MoD answer to this with more details.

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Thu Sep 04, 2008 10:08 am

Plop :D
Its MOD who did the easy to use loader :
http://www.retrodev.com/

I was a user of it :D But now I have my own loader (main & subcpu boot code), however, it is not as automated as MOD's one but I can provide C source code.

Fonz

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Sat Sep 06, 2008 3:13 pm

What would be the biggest ROM one could run from SCD's RAM ? It has 6 Mbit total, so I assume 4-5 Mbit ?
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

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

Post by Chilly Willy » Sat Sep 06, 2008 9:24 pm

Christuserloeser wrote:What would be the biggest ROM one could run from SCD's RAM ? It has 6 Mbit total, so I assume 4-5 Mbit ?
Depends on if you use the sub-cpu or not. Most of the memory is generally used by the sub-cpu (512 KB), while the other 256 KB is used for graphics data processing and is swapped back and forth between the SCD side and the Genny side. If you don't use the SCD side at all (after loading, maybe), you can set the main bulk to the main-cpu, so the total would be all the memory (except for the CD data buffer), or 768 KB.

Remember that this memory appears at 0 on the SCD side. The BIOS ROM appears at 0 on the Genny side. Only 128 KB of the main memory appears on the Genny side (you can bank select it as four banks of 128 KB). So the Genny side sees 256 KB (the swap memory), and four banks of 128 KB (the program memory), both at places that don't help in running carts.

You didn't think SEGA would make it where the CD would help you run pirate roms now, did you? :lol:

Lips2k8
Newbie
Posts: 4
Joined: Fri Aug 29, 2008 2:01 pm
Location: Wolverhampton UK

Post by Lips2k8 » Thu Nov 13, 2008 7:31 pm

I dont mean for the purpose of running roms, I mean to actually take advantage of the extra hardware and feautures of the megacd... what do you have to do in your asm source to tell it to compile for megacd>?

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

Post by Chilly Willy » Fri Nov 14, 2008 1:49 am

Go look at the SEGA CD docs, and then look at the source for Frog Feast.

http://frogfeast.rastersoft.net/SegaCDSrc.html

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Sat Oct 10, 2009 3:43 pm

Chilly Willy wrote:Only 128 KB of the main memory appears on the Genny side (you can bank select it as four banks of 128 KB). So the Genny side sees 256 KB (the swap memory), and four banks of 128 KB (the program memory), both at places that don't help in running carts.
I've checked the number of games that are 256k/128k in size and there are quite a few more than I was aware of:


16 Ton
Alex Kidd in the Enchanted Castle
Art Alive!
Ball Jacks
Block Out
Championship Pro-Am
Columns
Doki Doki Penguin Land MD
Double Clutch
Dragon's Eye
Fatal Labyrinth / Labyrinth of Death
Flicky
Flux for Mega-CD
Funny World
Hard Drivin'
Hyper Marbles
Ishido - The Way of the Stones
Joshua & the Battle of Jericho
Klax
Link Dragon
Mahjong Cop Ryuu
Megapanel
Ms. Pac-Man
Osomatsu-kun
Pac-Attack
Pac-Mania
Paddle Fighter
Phantasy Star II - Anne's Adventure
Phantasy Star II - Huey's Adventure
Phantasy Star II - Kinds's Adventure
Phantasy Star II - Shilka's Adventure
Putter Golf
Pyramid Magic
Pyramid Magic II
Pyramid Magic III
Pyramid Magic Special
Rambo III
Shogi no Hoshi
Sokoban (256k) / Shove It! - The Warehouse Game (128k)
Sonic Eraser
Space Invaders 90 / 91
Super Volleyball
Tecmo World Cup '92
Tecmo World Cup '93
Tetris
Trampoline Terror!
Ultimate Qix / Volfied
World Championship Soccer / World Cup Italia 90
Zoom!


Would there be a way to hack them on the fly ? or prior burning ? - kinda like Mask of Destiny's SLO does: http://www.retrodev.com/slo.html
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

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

Post by Chilly Willy » Sat Oct 10, 2009 8:50 pm

The biggest problem would be that the "ROM" would no longer occupy the lowest 32KB of address space. Remember that the 68000 has a word absolute address mode that allows you to address the bottom 32 KB in ROM, and the top 32KB of Work RAM with a single word. While the Work RAM wouldn't be a problem, the "ROM" for a patched game would no longer have that bottom 32KB available. All references to it would have to be converted somehow. Hand-made conversions would disassemble the game code, change those references, then reassemble the code. Patching on the fly would be much more difficult.

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Sun Oct 11, 2009 10:19 am

So the problem is related to the 68k in a way... ? - What about a Master System loader ? There are tons of games that are smaller than 256k, here's a list with just the most interesting ones:

Aerial Assault
Aleste
Alex Kidd - The Lost Stars
Alex Kidd in Miracle World
Alex Kidd in Shinobi World
Alien Syndrome
Ashura
Astro Warrior
Aztec Adventure
Baku Baku Animal
Bank Panic
Basket Ball Nightmare
Battlemaniacs
Berlin Wall (GG2SMS)
Bomber Raid
Castle of Illusion
Choplifter
Cloud Master
Columns
Cyborg Hunter
Double Dragon
Double Target
Enduro Racer
Fantasy Zone
Fantasy Zone 2
Final Bubble Bobble
Fire & Forget 2
Flash
Frogger (GG2SMS)
Gain Ground
Galactic Protector
Gauntlet
Ghost House
Golden Axe Warrior
Golvellius - Valley of Doom
Highschool! Kimengumi
Impossible Mission
Kenseiden
Klax
Kung Fu Kid
Lord of the Sword
Lucky Dime Caper
Makai Retsuden
Marble Madness
Master of Darkness
Masters of Combat
Mean Bean Machine
Megumi Rescue
Micro Machines
Miracle Warriors
Montezuma's Revenge
Ms. Pac-Man
New Zealand Story
Ninja Gaiden
Opa Opa
Pac-Man (GG2SMS)
Pac-Mania
Penguin Land
Pit Pot
Pop Breaker (GG2SMS)
Power Strike 2 (GG2SMS)
Prince of Persia
Psychic World
Psycho Fox
Putt & Putter
Rainbow Islands
Rampage
Rampart
Renegade
Rescue Mission
Running Battle
Rygar
Sagaia
Salomon's Key
Satellite 7
Scramble Spirits
Shinobi
Sonic the Hedgehog
Spy vs Spy
Submarine Attack
Teddy Boy Blues
Tensai Bakabon
Time Soldiers
Toto World 3
Transbot
Vampire
Vigilante
Wonder Boy - Dragon's Trap
Wonder Boy in Monster Land
Wonder Boy
Ys - Vanished Omen
Zillion
Zillion 2 - Tri Formation
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

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

Post by Chilly Willy » Sun Oct 11, 2009 4:04 pm

No way of activating SMS mode from the CD, and even if you did, the CD RAM can't handle SMS mode like a cart through the adapter (PowerBase). You have to do even more work to make the SMS game work than you would on small MD carts.

Post Reply