Page 1 of 2

Game >4Mo?

Posted: Wed Sep 12, 2012 8:08 am
by oofwill
I want to compile a game >4Mo.

I've this error when i do it:

Code: Select all

Using makefile: C:\SGDK\makefile.gen
ld: address 0x504330 of out/rom.out section .text is not within region rom
make: *** [out/rom.out] Error 1
What can i do? is it possible with SGDK?
Just modifying rom_head.c won't work?

EDIT: now i tried to remove a file to be under 4Mo, and it dosen't compile anymore :'(

Code: Select all

gcc: out/screwtitles.o: No such file or directory

Posted: Wed Sep 12, 2012 9:33 am
by Stef
Right now SGDK does not support > 4 MB rom.
I have to think about how add that support in a smart way...
Did you try to clean your project ?

Posted: Wed Sep 12, 2012 10:04 am
by oofwill
ooh. :|

Yes i tried to clean but i've this message:

Code: Select all

Error cleaning "Dance_impact - default"
Anyway the song are eating too many Ko... i can't save space just by cleaning... (i wanted to build a 8Mo cartridge for dance impact)

Posted: Wed Sep 12, 2012 3:40 pm
by Stef
oofwill wrote:ooh. :|

Yes i tried to clean but i've this message:

Code: Select all

Error cleaning "Dance_impact - default"
Anyway the song are eating too many Ko... i can't save space just by cleaning... (i wanted to build a 8Mo cartridge for dance impact)
Cleaning was just to resolve your missing obj file ;)

Yeah you are limited to 4 MB but what you can do to reduce your sample rom usage is to use the 2 channels DPCM Z80 driver.
It need an 22 Khz 8 bits signed PCM sample as input but then SGDK convert it to 4 bits DPCM so it takes as much space than a 11 Khz 8 bits sample but with 22 Khz quality :)
If you want to use the DPCM driver, rename your .wav file to .pcm then use these methods to play your sample :

Code: Select all

SND_startPlay_2ADPCM(sample, sizeof(sample), SOUND_PCM_CH1, 0);
SND_stopPlay_2ADPCM(SOUND_PCM_CH1);
SND_isPlaying_2ADPCM(SOUND_PCM_CH1_MSK);

Posted: Wed Sep 12, 2012 5:10 pm
by oofwill
Ah, ok for cleaning, good info.

It doesn't work but i've created a file with this name. This is working and the file is 0Ko so it don't matter.

Thanks for the sound method, i'll try it now :)

Do You know if the next relaese of SGDK will support games >4Mo or this is not planned?

Posted: Wed Sep 12, 2012 5:20 pm
by Stef
oofwill wrote:Ah, ok for cleaning, good info.

It doesn't work but i've created a file with this name. This is working and the file is 0Ko so it don't matter.

Thanks for the sound method, i'll try it now :)

Do You know if the next relaese of SGDK will support games >4Mo or this is not planned?
Not for the next version, right now i do not even know how to implement it... the problem is that there is not real native support for ROM > 4 MB. I believe the everdrive use the more or less standard SSF2 bank switch method to handle rom > 4MB, but then you need to use that type of hardware.

Posted: Wed Sep 12, 2012 5:23 pm
by oofwill
I've tested for the sound.

The song is plyed, it's ok. But when i push a button, i'm playing a Sound effect (with SND_startPlay_4PCM(Bassdrum, sizeof(Bassdrum), SOUND_PCM_CH2, 0);) and this is stopping the playing song...

For the 8Mo rom, i'm using this scheme :

Image

I don't really know how it works... but it works, with Mortal kombat hack for exemple :)

Boah, don't worry about that, i'll modify my project and we'll see later for 8Mo rom...

Posted: Wed Sep 12, 2012 5:53 pm
by Stef
oofwill wrote:I've tested for the sound.

The song is plyed, it's ok. But when i push a button, i'm playing a Sound effect (with SND_startPlay_4PCM(Bassdrum, sizeof(Bassdrum), SOUND_PCM_CH2, 0);) and this is stopping the playing song...
You cannot mix different driver at same time.
If you don't use more than 2 channels at same time (one for musique, one for SFX) then you can use the second DPCM channel to play your SFX (and so convert all you SFX to .pcm).
For the 8Mo rom, i'm using this scheme :

...

I don't really know how it works... but it works, with Mortal kombat hack for exemple :)

Boah, don't worry about that, i'll modify my project and we'll see later for 8Mo rom...
This is a specific mapper, anyway that is more a deal with hardware than software, the only thing i could do is to allow rom map over 0x03FFFFF but then you will have to handle manually the bank switch with memory address calculation.

Posted: Wed Sep 12, 2012 6:18 pm
by oofwill
Ok, i've understood for sound driver. It's logical...

For the rest, i you can allow rom map over 0x03FFFFF, i will do my tests ^^

Posted: Wed Sep 12, 2012 6:20 pm
by TmEE co.(TM)
that 8MB setup you showed will not work on Genny3 or clones.

Posted: Wed Sep 12, 2012 6:56 pm
by oofwill
Really? it's a good info.
What is the difference?

Anyway i don't want to use it on clones ^^

Posted: Wed Sep 12, 2012 7:12 pm
by TmEE co.(TM)
it needs A22, it is no present on all machines. You want a method that bank switches stuff, not just does a linear fat block.
linear 8MB also interferes with MegaCD, you'll get a bus fight between MCD boot ROM and your ROM at upper 4MB.

Posted: Wed Sep 12, 2012 7:35 pm
by oofwill
:o i've many other things to learn about md/mcd dev...

Posted: Wed Sep 12, 2012 9:44 pm
by bioloid
maybe two ROMS is acceptable, like "please insert Disk 2", i'm sure it won't hurt.

Posted: Thu Sep 13, 2012 5:18 pm
by Chilly Willy
bioloid wrote:maybe two ROMS is acceptable, like "please insert Disk 2", i'm sure it won't hurt.
That's my plan for a new Doom for the 32X. :lol:

When the player finishes the last level in the rom, the game automatically makes a save that the next rom looks for on starting to continue right where they left off.