fix sound

This commit is contained in:
Tomohiro Yoshidomi 2017-07-03 21:04:49 +09:00
parent e5ee0bb4e4
commit 7d42608ef5
2 changed files with 7 additions and 3 deletions

View File

@ -36,8 +36,8 @@
#include "np2.h"
#define SOUNDRATE 44100.0
#define SNDSZ 735
signed short soundbuf[1024*2];
#define SNDSZ 735 //44100Hz/60fps=735 (sample/flame)
signed short soundbuf[1024*2]; //16bit*2ch
char RPATH[512];
char tmppath[4096];
@ -978,7 +978,7 @@ void retro_run (void)
updateInput();
if (menuvram != NULL){
memcpy(FrameBuffer,GuiBuffer,LR_SCREENWIDTH*scrnsurf.height*2);
memcpy(FrameBuffer,GuiBuffer,scrnsurf.width*scrnsurf.height*2);
draw_cross(lastx,lasty);
}
else {

View File

@ -242,6 +242,10 @@ BRESULT sound_create(UINT rate, UINT ms) {
reserve = rate * SOUNDRESERVE / 1000;
#else
reserve = 0;
#endif
#ifdef __LIBRETRO__
reserve=0;
samples=735;
#endif
sndstream.buffer = (SINT32 *)_MALLOC((samples + reserve) * 2
* sizeof(SINT32), "stream");