Generating MegaROMs of arbitrary size with SDCC or other compilers?

Por asiga

Rookie (21)

imagem de asiga

21-03-2014, 15:26

It's easy to find on the web info on how to create a 32Kb ROM with SDCC. I've also found a forum post (in Spanish) telling how to create a 128Kb MegaROM here. But... is it easy to extrapolate from that point? I mean, there're some MegaROMs with 1MB or even more... is there any arbitrary approach for generating a MegaROM of any size with SDCC or other compilers?

Entrar ou registrar-se para comentar

Por syn

Prophet (2096)

imagem de syn

21-03-2014, 16:00

I thought the biggest megarom was 512kilobyte? what games are bigger than that?

Por asiga

Rookie (21)

imagem de asiga

21-03-2014, 16:06

Don't know if there's a game larger than 512KB, but there're 1MB or even 2MB MegaROM cartridges with compilation of games. Anyway, for my purposes, I'm just thinking in small code which needs to access a lot of data. So, page mapping will be mainly for data rather than code. I prefer to design my software in rom format rather than disks. That's why I'm asking if there's any arbitrary method for generating a MegaROM of any size with SDCC or other compiler.

Por ARTRAG

Enlighted (6844)

imagem de ARTRAG

21-03-2014, 16:27

Well, there are roms larger than 512K and some mappers allow access to 2 Mb or 4 Mb (IIRC Ascii 16 mappers can support 4Mb)
Have a look here:
http://bifi.msxnet.org/msxnet/tech/megaroms

Por Grauw

Ascended (10581)

imagem de Grauw

21-03-2014, 16:33

@asiga those are megabit roms, not megabyte. A 1 megabit rom is 128 kilobyte. A 4 megabit rom is 512k.

Por Manuel

Ascended (18785)

imagem de Manuel

21-03-2014, 17:25

There are a few 1MB ROMs, but those are the largest ROMs I know of that were released commercially during the MSX heydays.

What mapper type is used in the method to generate that 128kB ROM? Ah wait, it seems to be ASCII8. The max is then 256 blocks of 8kB, so 2MB. I have not tested this at all, but I would have no idea why you wouldn't be able to extrapolate it. Just try?

Por ARTRAG

Enlighted (6844)

imagem de ARTRAG

21-03-2014, 18:53

I typed 4Mb meaning 4MB: ascii 16 mapper should allow 256*16KB = 4MB rom

Por asiga

Rookie (21)

imagem de asiga

21-03-2014, 19:47

Well, yes, I'll try that. I thought that given that MegaROMs are so famous in MSX history, the method for generating them would be well documented, but it seems it's still a matter of trial and error...

Por Manuel

Ascended (18785)

imagem de Manuel

21-03-2014, 19:58

I guess most MegaROMs were written in assembly, not in C...

Por ARTRAG

Enlighted (6844)

imagem de ARTRAG

21-03-2014, 20:29

Nevertheless Hitech C v7.8 can produce megaroms directly (I used it for MOAM and other projects).
The trick is that the compiler supports z80 systems with generic MMU where the user has to provide standard functions for long jumps and memory management. The "large" memory model anyway is very close to the one used for the z180 (that also relies on a MMU and is also supported by the compiler) so there are some restrictions on the way memory mapper can be used natively by C functions.

The most remarkable limitation is that "far" data and its corresponding "far" code have to fit in the same rom page (or set of pages swapped at the same time). There is no way for the compiler to manage in C "far data" without calling a far function allocated in that page. But, naturally, you can use an out() to swap a rom page and change data set.

Por giangiacomo.zaffini

Champion (267)

imagem de giangiacomo.zaffini

30-03-2014, 12:55

I'm trying to squeeze all software (and a cuople of games) I use most of the time in a single megaRom (4MBit).
But I can't flash this megaRom until now.
I can't create a menu for starting different programs at different PAGEs (it is ASCII 8kByte paged megaRom).
I would like to use SDCC and it's assembly ASxxxx if possible.
Any kind of suggestions from You veterans and expert users will be very appreciated.
Thank You.