Jump to content
IGNORED

SDCC and MegaCart


youki

Recommended Posts

Hi,

 

Related to my post here :

 

http://atariage.com/forums/topic/216354-colecovision-megacart-faq/?p=2951137

 

Does somebody could give me a working example / tutorial , how i can produce a ROM for colecovision that use Bank Switching using Daniel librairies?

 

As i said in the post, i managed to compile the Rom now , but it is not usable on a C.V.

 

I guess it is due to some addressing configuration , or may be something to modify in the Daniel's libraries.

 

Even a example using other libraries would be good.

 

I plan may be exceptionaly to use a megacart for Ghost'n Zombie 2 , but as i have really not lot free time to make it, i would prefer invest the few time i have in Making the game, instead of figure out how to set up the development environment. :(

 

thanks in advance! :)

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

One thing I may experiment with is making 16KB chuck of compiled codes and then combine it together using hexedit to make 128KB of ROM. Only thing I may have to built in assembly is pointer to the area of the memory that holds the label information that refer to the data I need to get. So I can use that in C to refer memory or run program on the other bank. I may experiment with that once I finish off some of the projects. Once I figure it out, I'll share it with the forums.

Link to comment
Share on other sites

One thing I may experiment with is making 16KB chuck of compiled codes and then combine it together using hexedit to make 128KB of ROM. Only thing I may have to built in assembly is pointer to the area of the memory that holds the label information that refer to the data I need to get. So I can use that in C to refer memory or run program on the other bank. I may experiment with that once I finish off some of the projects. Once I figure it out, I'll share it with the forums.

 

Yes, that's a good idea. I didn't not have time on my side to go further with my experiment. Real Life takes too much time...:(

 

Another idea i had , but just a rough idea , Is to take the .ASM file generated by SDCC and analyse it and modify it by hand to put things at the right place. Then assemble it.

 

Anyway if i find a solution , i will share also it on the forums.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

yes please. I would love to know how to break the 32Kb barrier as well using c language... of course we'll still need a supply of megacart or similar tech.

 

I'd just like to get it working even if just to run it through the sd colecovision cart for my own personal amusement.

 

 

UP! :)

 

Does somebody managed to use MegaCart with Daniel's Dev Kit?

Link to comment
Share on other sites

Metoo. I keep finding ways to cut down on space. I need to work on getting Megacart working. I know the concept but don't know how to origin the data in C. Also, pointing the data in the new bank. I do need to experiment with the information provided by PpK.

If I get Megacart stuff solve, then I'm good.

Link to comment
Share on other sites

I tried with information provided by PKK . (see the referenced thread) , i can compile , all seems ok, but the ROM header is not at the right place in the rom binary, so it does not start :(

 

I don't have used SDCC, but there is a chance to insert assembly code in C?

 

This way you could select each bank. In tniASM there is a feature where there are two directives ORG and FORG, ORG selects the location in 64K address space and FORG selects the location in file space.

 

For a 128K megacart, the offsets from file are mapped this way:

 

0x0000-0x3fff - Bank 0. FORG $0000, ORG $C000

0x4000-0x7fff - Bank 1. FORG $4000, ORG $C000

0x8000-0xbfff - Bank 2, FORG $8000, ORG $C000

0xc000-0xffff - Bank 3, FORG $C000, ORG $C000

0x10000-0x13fff - Bank 4, FORG $10000, ORG $C000

0x14000-0x17fff - Bank 5, FORG $14000, ORG $C000

0x18000-0x1bfff - Bank 6, FORG $18000, ORG $C000

0x1c000-0x1cfff - Bank 7, FORG $1C000, ORG $8000

 

The bank 7 is always mapped at $8000-$BFFF and the switchable bank is always located at $c000-$ffff

 

So your ROM header must be located at 0x1c000-0x1ffff in order to BlueMSX to map it correctly when you select Megacart mapper. Check the Pac-Man collection ROM for a sample.

 

After ending my code section, I usually finish it with DS $10000-$,$FF (for segments starting in $c000) or DS $C000-$,$FF (for the segment starting in $8000) to fill the 16K block

  • Like 1
Link to comment
Share on other sites

Thanks nanochess. That makes it much clearer.

 

I do have a future project where this would be useful, so that gives me some motivation.

 

I will definitely work with Daniel on a sample, and make sure I test it on the SD cart. The basic part is to get the code and objects all in the right places in the address space, and then in the right order in the image.

 

So to make all of that work well, I'd have to change CCI3 to provide all of the link information for the type of megacart that you are making. I will reread what PKK posted in his original thread but I think I understand what needs to be done now.

 

I don't currently have a megacart to try it on the real hardware. But if it works on the SD cart and in BlueMSX, it shouldn't be that hard to try it on the real cart. I do have a GAL programmer at least.

 

There is more than one way to do everything, so perhaps someone else will come up with a sample before me.

Edited by hardhat
  • Like 2
Link to comment
Share on other sites

I don't currently have a megacart to try it on the real hardware. But if it works on the SD cart, it shouldn't be that bad. But there is more than one way to do everything, so perhaps someone else will come up with a sample before me.

Yep, the SD cart can handle the Megacart mapper :) upto 512 KB, but 128 KB should be enough to start.

Link to comment
Share on other sites

you can always send me a test rom and I can run it on the Ultimate colecovision SD cart that I have.

Thanks nanochess. That makes it much clearer.

I do have a future project where this would be useful, so that gives me some motivation.

I will definitely work with Daniel on a sample, and make sure I test it on the SD cart. The basic part is to get the code and objects all in the right places in the address space, and then in the right order in the image.

So to make all of that work well, I'd have to change CCI3 to provide all of the link information for the type of megacart that you are making. I will reread what PKK posted in his original thread but I think I understand what needs to be done now.

I don't currently have a megacart to try it on the real hardware. But if it works on the SD cart and in BlueMSX, it shouldn't be that hard to try it on the real cart. I do have a GAL programmer at least.

There is more than one way to do everything, so perhaps someone else will come up with a sample before me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...