Game >4Mo?

SGDK only sub forum

Moderator: Stef

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Game >4Mo?

Post by oofwill » Wed Sep 12, 2012 8:08 am

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 12, 2012 9:33 am

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 ?

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 10:04 am

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)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 12, 2012 3:40 pm

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);

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 5:10 pm

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?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 12, 2012 5:20 pm

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.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 5:23 pm

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...

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 12, 2012 5:53 pm

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.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 6:18 pm

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 ^^

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Sep 12, 2012 6:20 pm

that 8MB setup you showed will not work on Genny3 or clones.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 6:56 pm

Really? it's a good info.
What is the difference?

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

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Sep 12, 2012 7:12 pm

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Wed Sep 12, 2012 7:35 pm

:o i've many other things to learn about md/mcd dev...

bioloid
Very interested
Posts: 172
Joined: Fri May 18, 2012 8:22 pm

Post by bioloid » Wed Sep 12, 2012 9:44 pm

maybe two ROMS is acceptable, like "please insert Disk 2", i'm sure it won't hurt.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Sep 13, 2012 5:18 pm

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.

Post Reply