Generating roms >32K

Post Reply
eldeljar
Member
Posts: 33
Joined: Sun Feb 12, 2017 6:04 pm

Generating roms >32K

Post by eldeljar »

Hi, does anyone know how to generate roms greater than 32K? For example generate a 48K rom.

What steps should I take to do this?

Thank you very much
Timmy
Well known member
Posts: 393
Joined: Sat Mar 10, 2012 4:18 pm

Post by Timmy »

At the moment, no idea. First I will have to ask a MSX friend (because I'm quite a MSX noob).

I understood that anything larger than 32K is complicated because 16K is used by the BIOS and another 16K is RAM.

Therefore, many configurations are possible and it mean you lose either the RAM, BIOS calls or 16K of ROM. Also Bank Switching will be used to switch between pages/slots, and I will need to know how multiple pages and bank switching is implemented on the z88dk to get this working (if it is working, at all... AA, can you explain that to me?).

When I made this MSX 32K ROM environment to port games to the MSX, z88dk didn't had support for different pages, or even a data segment; so anything larger was not even considered possible then.

To be honest, I'd need much more research on this before I can even tell you if it's even possible now.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

It depends on the cartridge hardware. If you have some information about the destination cartridge, it's fairly easy to accommodate.

z88dk does not automatically bankswitch for you so your program will have to handle the actual banking and keep track of what needs to be mapped into memory and what not. Usually programs are structured so that the main code does not get swapped out but the level data and code does. So you may have main code + level n active at any time. To do that you need to separate the main code from each level.

To get z88dk to create the different level banks, you can define a new section for each bank and then assign the relevant code or data to the appropriate bank.

The biggest examples we currently have are for the sega master system, eg:
https://github.com/z88dk/z88dk/tree/mas ... AstroForce

The sms organizes its code as 0-32k containing the main bank, 32k-48k available as banked pages and 48k-56k containing unbanked ram. The example above is 256k total with all the banked pages swapped into the 32k-48k area.

The banked pages are mapped to sections as defined here:
https://github.com/z88dk/z88dk/blob/mas ... ap.inc#L23

appmake has special code to gather all the output files into a single .sms used by sms emulators.

To do the same, you can defined sections in your code in the same way with a section directive and an org for the section. Then you can assign asm code/data to those sections as well as get the compilers to compile into those sections via command line argument. The output will contain separate binaries for each defined section. Then you have to put it all together in the form needed.

More information is needed about the cartridge before you can do this though.
Timmy
Well known member
Posts: 393
Joined: Sat Mar 10, 2012 4:18 pm

Post by Timmy »

Yes, if you have plan for a specific ROM catridge, then let us know, before we do anything. Because implementation would be cartridge specific. And try not to invent another type of cartridge, as most emulators won't support new ones directly.

If I have to find one out myself it would take a lot of time, as it's not my current priority at the moment. (I am currently working on a 32K ROM game.)

It might be easier to help you with reducing your code size instead. A tape format could probably use more than 32K, too.
eldeljar
Member
Posts: 33
Joined: Sun Feb 12, 2017 6:04 pm

Post by eldeljar »

Hi, thank you very much for the answers.

I wanted to know if it was easy to do so in order to expand the screens and enemies of the game.

As I see it is not easy, for now I will continue programming the game in a 32K rom.
Post Reply