SegaCD main routine
Moderator: Mask of Destiny
SegaCD main routine
Hi you all.
Finally, I've decided to ask this one big question ? How does the SegaCD actually runs ?
I mean, from a cartridge point of view, it's damn so simple. Offset $4 is the PC initial value, the 68k reads from it and goes on. After each instruction, you just increment PC, there you are.
What about the CD ?
I mean, I can't make something like :
BSR loop2
if loop2 isn't alreday in memory.
So, how ?
I've thought about a lot of things, the most possible one would be : the subCPU loads (but how ?!?) data from CD, put it into its huge RAM, and passes it to the mainCPU thanks to the Comm Port.
But then, how does the subCPU where to load data from ? Do I have to tell it "go to sector 54126" ? Or do I have to ask it "copy data from $78EF 4520 to Comm Port" ?
It's even so intersting since I guess the same routine must bu used for Saturn, and everything else.
Please, teach me.
Finally, I've decided to ask this one big question ? How does the SegaCD actually runs ?
I mean, from a cartridge point of view, it's damn so simple. Offset $4 is the PC initial value, the 68k reads from it and goes on. After each instruction, you just increment PC, there you are.
What about the CD ?
I mean, I can't make something like :
BSR loop2
if loop2 isn't alreday in memory.
So, how ?
I've thought about a lot of things, the most possible one would be : the subCPU loads (but how ?!?) data from CD, put it into its huge RAM, and passes it to the mainCPU thanks to the Comm Port.
But then, how does the subCPU where to load data from ? Do I have to tell it "go to sector 54126" ? Or do I have to ask it "copy data from $78EF 4520 to Comm Port" ?
It's even so intersting since I guess the same routine must bu used for Saturn, and everything else.
Please, teach me.
-
- Very interested
- Posts: 616
- Joined: Thu Nov 30, 2006 6:30 am
Heh, I have just the document with you. See this page: http://www.retrodev.com/segacd.html
Start reading where it says "General"
You can use the program BuildSCD from the same page to take care of putting together all the headers for you, or you can write some macros for your assembler. In either case, you need an appropriate org statement at the beginning of your code so the assembler knows how to resolve absolute addresses.
Start reading where it says "General"
You can use the program BuildSCD from the same page to take care of putting together all the headers for you, or you can write some macros for your assembler. In either case, you need an appropriate org statement at the beginning of your code so the assembler knows how to resolve absolute addresses.
Amazing ressource.
Shame on me I didn't look your site before. Actually I did when I was working with the 32X.
What clearly appears to me is that the Initial Program (base.img) is a masterpiece I'm going to look at.
It isn't yet clear how to read further after, but from the star, here I am !!!
Thank you Mask'.
Shame on me I didn't look your site before. Actually I did when I was working with the 32X.
What clearly appears to me is that the Initial Program (base.img) is a masterpiece I'm going to look at.
It isn't yet clear how to read further after, but from the star, here I am !!!
Thank you Mask'.
Also check out Devsters BasiE... (whatever the hell it is) source code:
http://devster.monkeeh.com/sega/basiegaxorz/src.html
It's BasiEgaXorz... Ewww it taste worse coming back up!
http://devster.monkeeh.com/sega/basiegaxorz/src.html
It's BasiEgaXorz... Ewww it taste worse coming back up!
-
- Very interested
- Posts: 81
- Joined: Tue Jul 10, 2007 7:45 pm
- Location: Brazil / USA
- Contact:
I have to thank Devster anyway, even though programming in BEX I don't get the fastest code of the full functionality of MD/MCD, it is thanks to it that I could understand how to program to the system.cdoty wrote:It's BasiEgaXorz... Ewww it taste worse coming back up!
Comming from PC architecture to MD architecture can be quite challenging if you don't have a language you're familiar with. BEX brought that to all VB programmers around the world.
I was making a joke about the name, not the product.TulioAdriano wrote:I have to thank Devster anyway, even though programming in BEX I don't get the fastest code of the full functionality of MD/MCD, it is thanks to it that I could understand how to program to the system.
Devster's code is pretty well written.
-
- Very interested
- Posts: 81
- Joined: Tue Jul 10, 2007 7:45 pm
- Location: Brazil / USA
- Contact: