Karoshi MSX Community

Desarrollo MSX => Development (English/Ingles) => Mensaje iniciado por: nitrofurano en 16 de Septiembre de 2013, 04:53:23 pm



Título: about adding msx megarom support from Boriel's ZX-Basic Compiler, help needed
Publicado por: nitrofurano en 16 de Septiembre de 2013, 04:53:23 pm
i'm interested on adding megarom support (like from konami or ascii, as seen at http://bifi.msxnet.org/msxnet/tech/megaroms.html ), but i'm struggling on this

should we have some initializing code in the rom start somehow, like we need to do on the 32kb .rom versions (which we could add as library), presetting some pages, filling the empty bytes with 0xFF, or anything like?

and which are the limit on the .rom sizes? 2mbyte for konami/ascii 8k, and 4mbyte for ascii 16k?

(i think examples in assembly, like from asmsx or tniasm, can help - i'm really curious to know how to do this! thanks! :) )



Título: Re: about adding msx megarom support from Boriel's ZX-Basic Compiler, help needed
Publicado por: pitpan en 18 de Septiembre de 2013, 10:35:16 am
Theoretically there are no limits to megaROMs, but of course, there ARE limits for the currently known megaROMs. At the moment, 'cause they use a 1 byte (8 bit) selector, they could manage up to 256 pages. As you said, 256 x 8 KB = 2 Mbit and 256 x 16 KB = 4 Mbit, but it is not as easy as it seems, 'cause Konami mappers, for example, do have a limit and only use the lower bits of the selector and reserve the others for different purposes (SCC, etc.).

asMSX has its own MegaROM support and therefore all the examples use the dedicated macros. But if you just disassemble them, you will see how it words. Basically, you just use a memory write to a given address (or range of addresses) and then the bank is switched. As easy as that. But you need to know how to order your code in different pages and make sure that you always load the right one.


Título: Re: about adding msx megarom support from Boriel's ZX-Basic Compiler, help needed
Publicado por: nitrofurano en 18 de Septiembre de 2013, 05:29:39 pm
thanks! for now, the idea would be restricting the code on (the first?) 24kb or 16kb of the rom, and leaving everything else (data, graphics, sound, chiptunes, etc.) after that and accessible as memory paging, just like i use to do on zx-spectrum http://csscgc2013.blogspot.pt/2013/06/walking-around-porto.html