freebsd-ports/audio/xmms-nsf/files/patch-src__nes__audiosys.c
Emanuel Haupt 6de5b2ae5e - Fix build with gcc 4.x
- Added a patch to control window to display when an nsf song is played and
  change 'Fadeout' option to 'Silence Until Next Song' [1]
- Cleanup
- Bump PORTREVISION

Obtained from:	gentoo
2007-01-11 14:25:53 +00:00

34 lines
660 B
C

--- ./src/nes/audiosys.c.orig Sun Jan 7 05:17:57 2001
+++ ./src/nes/audiosys.c Wed Jan 10 20:10:34 2007
@@ -8,8 +8,11 @@
static NES_AUDIO_HANDLER *nah = 0;
static NES_VOLUME_HANDLER *nvh = 0;
-void NESAudioRender(Int16 *bufp, Uint buflen)
+Uint32 NESAudioRender(Int16 *bufp, Uint buflen)
{
+ Int16 x;
+ Uint32 count = 0;
+
while (buflen--)
{
NES_AUDIO_HANDLER *ph;
@@ -31,9 +34,17 @@
else
output = accum;
output >>= 8;
- *bufp++ = ((Int32)output) - 0x8000;
+ x = ((Int32)output) - 0x8000;
+ if (abs(x) < 96)
+ count++;
+ else
+ count = 0;
+
+ *bufp++ = x;
}
}
+
+ return count;
}
void NESVolume(Uint volume)