Hi everyone,
I have a big issue with my Sonic port, i will explain a little.
If it's about memory corruption or access time, I don't really know.
At first i'm using SGL.
The problem is related with sound, when I load two o more sounds (PCM files) to low work ram (0x200000) in the emulators (SFF and Yabause) works great, I debug with a ram watch and I see the data, but............ The console will freezes when try to load the second file.
If I only load one sound, the game works great.
Any advice?
I have a big issue with my Sonic port, i will explain a little.
If it's about memory corruption or access time, I don't really know.
At first i'm using SGL.
The problem is related with sound, when I load two o more sounds (PCM files) to low work ram (0x200000) in the emulators (SFF and Yabause) works great, I debug with a ram watch and I see the data, but............ The console will freezes when try to load the second file.
If I only load one sound, the game works great.
Any advice?
Code:
typedef struct SOUNDS
{
char *p_Sound;
Uint32 size;
PCM type;
}Sounds;
/////////////////////////////
Sounds snd_sfx[6];
PCM chn_0_m8 = {(_Mono | _PCM8Bit) , 3 , 127 , 0 , 0x0 , 0 , 0 , 0 , 0};
PCM chn_1_m8 = {(_Mono | _PCM8Bit) , 3 , 127 , 0 , 0x0 , 0 , 0 , 0 , 0};
void snd_loadSound_PCM()
{
snd_sfx[SFX_RING].p_Sound = (char *)0x210000;
Sint32 load = GFS_Load(GFS_NameToId("SFX_RING.PCM"), 0, (Uint32 *)snd_sfx[SFX_RING].p_Sound , 27089);
if(load <= 0)
slPrint("ERROR loading file SFX_RING.pcm!", slLocate(2, 11));
snd_sfx[SFX_RING].size = load;
snd_sfx[SFX_RING].type = chn_0_m8;
snd_sfx[SFX_JUMP].p_Sound = (char *) snd_sfx[SFX_RING].p_Sound + snd_sfx[SFX_RING].size ;
load = GFS_Load(GFS_NameToId("SFX_JUMP.PCM"), 0, (Uint32 *)snd_sfx[SFX_JUMP].p_Sound , 19075);
if(load <= 0)
slPrint("ERROR loading file SFX_JUMP.PCM!", slLocate(2, 11));
snd_sfx[SFX_JUMP].size= load;
snd_sfx[SFX_JUMP].type = chn_1_m8;
}