Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to improve types between audio_cb and Sound_Callback #99

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions libretro/core-mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unsigned long Ktime=0 , LastFPSTime=0;
#endif

//SOUND
unsigned char SNDBUF[1024*2*2];
UBYTE SNDBUF[1024*2*2];
int snd_sampler_pal = 44100 / 50;
int snd_sampler_ntsc = 44100 / 60;

Expand Down Expand Up @@ -155,9 +155,11 @@ void retro_sound_update(void)

if (! UI_is_active)
{
Sound_Callback(SNDBUF, 1024*2*2);
for(x=0;x<stop*2;x+=2)
retro_audio_cb(SNDBUF[x],SNDBUF[x+2]);
int16_t *p = (int16_t *)SNDBUF;

Sound_Callback(SNDBUF, sizeof SNDBUF);
for (x = 0; x < stop; p += 2, x++)
retro_audio_cb(*p, *p + 1);

}
}
Expand Down
4 changes: 2 additions & 2 deletions libretro/libretro-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ extern int ToggleTV;
extern int CURRENT_TV;

extern int SHIFTON, pauseg, SND;
extern unsigned char SNDBUF[];
extern UBYTE SNDBUF[];

char RPATH[512];
char RETRO_DIR[512];
Expand Down Expand Up @@ -1164,7 +1164,7 @@ void retro_set_video_refresh(retro_video_refresh_t cb)
video_cb = cb;
}

void retro_audio_cb(short l, short r)
void retro_audio_cb(int16_t l, int16_t r)
{
audio_cb(l, r);
}
Expand Down
2 changes: 1 addition & 1 deletion libretro/libretro-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ extern int pauseg;
#define JOY_5200_CENTER 114

void retro_message(const char* text, unsigned int frames, int alt);
void retro_audio_cb(short l, short r);
void retro_audio_cb(int16_t l, int16_t r);
#endif