but in the emulator Kega Fusion all right.
Code: Select all
SND_startPlay_PCM(sample, sizeof(sample), SOUND_RATE_16000,SOUND_PAN_CENTER,FALSE);
Also tried turn off interrupts. It did not help.
Moderator: Stef
Code: Select all
SND_startPlay_PCM(sample, sizeof(sample), SOUND_RATE_16000,SOUND_PAN_CENTER,FALSE);
VGM|XGM-music played correctly.Do you hear anything on real hardware ?
did you try to comment all your code except the WAV play command ?
Code: Select all
#include <genesis.h>
#include "gfx.h"
#include "music.h"
#include "fonanimate.h"
#include "lyapanimate.h"
#include "globalvar.h"
#include "menu.h"
#include "worm.h"
#include "tride.h"
.....
static void joyEvent(u16 joy, u16 changed, u16 state);
....
int main()
{
level=lvl_worm_boss;
SYS_disableInts();
VDP_setScreenWidth320();
VDP_setScreenHeight240();
JOY_setEventHandler(joyEvent);
zastavka();
SYS_enableInts();
.....
}
.....
static void zastavka()
{
ind = TILE_USERINDEX;
VDP_drawImageEx(BPLAN, &alko, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, ind),4, 0, FALSE, TRUE);
memcpy(&palette[0], alko.palette->data, 16 * 2);
VDP_fadeIn(0, (3 * 16) - 1, palette, 150, FALSE);
SND_startPlay_PCM(hristu, sizeof(hristu),
SOUND_RATE_16000,
SOUND_PAN_CENTER,
FALSE); //THERE PROGRAM CRUSHED
waitTick(900);
VDP_fadeOut(0, (1 * 16) - 1, 150, FALSE);
}
.............
static void joyEvent(u16 joy, u16 changed, u16 state)
{
// START button state changed
/*
if (changed & BUTTON_START)
{
}
if (changed & state & (BUTTON_A | BUTTON_B | BUTTON_C))
{
}*/
}
I just wanted to play a sample without music, but in this case it hangs [SND_startPlayPCM]Stef wrote:When you want to play sample and at same time play music