Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Amended source code for Mac and Windows (fixing MacOS X deadlock)

  • Loading branch information...
commit b6a4cdde99eddcf53e9b9e77a032c2665b762354 1 parent fba052b
realtech authored
Showing with 387 additions and 3,682 deletions.
  1. +1 −1  configure.in
  2. +1 −1  dlapi/dl_hpux.c
  3. +0 −3,508 docs/mikmod.info
  4. +1 −1  docs/mikmod.texi
  5. +1 −1  dos/include/dosgus.h
  6. +1 −1  dos/include/dossb.h
  7. +1 −1  dos/include/doswss.h
  8. +1 −1  dos/include/libgus.h
  9. +1 −1  dos/src/dosgus.c
  10. +1 −1  dos/src/dossb.c
  11. +1 −1  dos/src/doswss.c
  12. +1 −1  drivers/drv_AF.c
  13. +1 −1  drivers/drv_aiff.c
  14. +1 −1  drivers/drv_aix.c
  15. +1 −1  drivers/drv_alsa.c
  16. +1 −1  drivers/drv_dart.c
  17. +1 −1  drivers/drv_ds.c
  18. +1 −1  drivers/drv_esd.c
  19. +1 −1  drivers/drv_gp32.c
  20. +1 −1  drivers/drv_hp.c
  21. +1 −1  drivers/drv_mac.c
  22. +1 −1  drivers/drv_nas.c
  23. +1 −1  drivers/drv_nos.c
  24. +1 −1  drivers/drv_os2.c
  25. +1 −1  drivers/drv_oss.c
  26. +1 −1  drivers/drv_osx.c
  27. +1 −1  drivers/drv_pipe.c
  28. +1 −1  drivers/drv_raw.c
  29. +1 −1  drivers/drv_sam9407.c
  30. +1 −1  drivers/drv_sb.c
  31. +1 −1  drivers/drv_sgi.c
  32. +1 −1  drivers/drv_stdout.c
  33. +1 −1  drivers/drv_sun.c
  34. +1 −1  drivers/drv_ultra.c
  35. +1 −1  drivers/drv_wav.c
  36. +1 −1  drivers/drv_win.c
  37. +1 −1  drivers/drv_wss.c
  38. +3 −2 examples/simpleplay/splay.c
  39. +1 −2  examples/simpleplayMEM/splayMEM.c
  40. +3 −3 include/mikmod.h.in
  41. +1 −1  include/mikmod_internals.h
  42. +1 −1  loaders/load_669.c
  43. +1 −1  loaders/load_amf.c
  44. +1 −1  loaders/load_asy.c
  45. +1 −1  loaders/load_dsm.c
  46. +1 −1  loaders/load_far.c
  47. +1 −1  loaders/load_gdm.c
  48. +1 −1  loaders/load_gt2.c
  49. +1 −1  loaders/load_imf.c
  50. +1 −1  loaders/load_it.c
  51. +1 −1  loaders/load_m15.c
  52. +1 −1  loaders/load_med.c
  53. +1 −1  loaders/load_mod.c
  54. +1 −1  loaders/load_mtm.c
  55. +1 −1  loaders/load_okt.c
  56. +1 −1  loaders/load_s3m.c
  57. +1 −1  loaders/load_stm.c
  58. +1 −1  loaders/load_stx.c
  59. +1 −1  loaders/load_ult.c
  60. +1 −1  loaders/load_uni.c
  61. +1 −1  loaders/load_xm.c
  62. +0 −1  macosx/libmikmod.xcode/project.pbxproj
  63. +2 −2 macosx/mikmod.h
  64. +4 −1 macosx/mikmod.h.in
  65. +1 −1  mkinstalldirs
  66. +64 −12 mmio/mmalloc.c
  67. +1 −1  mmio/mmerror.c
  68. +5 −5 mmio/mmio.c
  69. +1 −1  os2/configure.cmd
  70. +1 −1  playercode/mdreg.c
  71. +1 −1  playercode/mdriver.c
  72. +1 −1  playercode/mdulaw.c
  73. +1 −1  playercode/mloader.c
  74. +1 −1  playercode/mlreg.c
  75. +1 −1  playercode/mlutil.c
  76. +21 −22 playercode/mplayer.c
  77. +1 −1  playercode/munitrk.c
  78. +1 −1  playercode/mwav.c
  79. +1 −1  playercode/npertab.c
  80. +1 −1  playercode/sloader.c
  81. +203 −42 playercode/virtch.c
  82. +3 −2 playercode/virtch2.c
  83. +1 −1  playercode/virtch_common.c
  84. +3 −5 win32/mikmod.def
  85. +3 −3 win32/mikmod.h
  86. +1 −1  win32/mikmod_build.h
View
2  configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.1 2005/03/30 01:30:22 raphassenat Exp $
+dnl $Id: configure.in,v 1.2 2005/03/30 19:09:08 realtech Exp $
AC_INIT(include/mikmod.h.in)
View
2  dlapi/dl_hpux.c
@@ -1,6 +1,6 @@
/*==============================================================================
- $Id: dl_hpux.c,v 1.1 2005/03/30 01:30:25 raphassenat Exp $
+ $Id: dl_hpux.c,v 1.2 2005/03/30 19:09:09 realtech Exp $
simple dlopen()-like implementation above HP-UX shl_xxx() API
View
3,508 docs/mikmod.info
0 additions, 3,508 deletions not shown
View
2  docs/mikmod.texi
@@ -7,7 +7,7 @@
MikMod Sound Library Documentation
- $Id: mikmod.texi,v 1.1 2005/03/30 01:30:31 raphassenat Exp $
+ $Id: mikmod.texi,v 1.2 2005/03/30 19:09:10 realtech Exp $
@end ignore
@c comment this during modifications
View
2  dos/include/dosgus.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: dosgus.h,v 1.1 2005/03/30 01:30:34 raphassenat Exp $
+ $Id: dosgus.h,v 1.2 2005/03/30 19:09:10 realtech Exp $
libGUS-alike definitions for DOS
View
2  dos/include/dossb.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: dossb.h,v 1.1 2005/03/30 01:30:35 raphassenat Exp $
+ $Id: dossb.h,v 1.2 2005/03/30 19:09:10 realtech Exp $
SoundBlaster and compatible soundcards definitions
View
2  dos/include/doswss.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: doswss.h,v 1.1 2005/03/30 01:30:35 raphassenat Exp $
+ $Id: doswss.h,v 1.2 2005/03/30 19:09:10 realtech Exp $
Windows Sound System and compatible soundcards definitions
View
2  dos/include/libgus.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: libgus.h,v 1.1 2005/03/30 01:30:35 raphassenat Exp $
+ $Id: libgus.h,v 1.2 2005/03/30 19:09:10 realtech Exp $
Linux libGUS-alike library for DOS, used by drv_ultra.c under DOS.
View
2  dos/src/dosgus.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: dosgus.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: dosgus.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for GUS cards under DOS
View
2  dos/src/dossb.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: dossb.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: dossb.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Sound Blaster I/O routines, common for SB8, SBPro and SB16
View
2  dos/src/doswss.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: doswss.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: doswss.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Windows Sound System I/O routines (CS42XX, ESS18XX, GUS+DaughterBoard etc)
View
2  drivers/drv_AF.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_AF.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_AF.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on AF audio server.
View
2  drivers/drv_aiff.c
@@ -21,7 +21,7 @@
/*==============================================================================
- $Id: drv_aiff.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_aiff.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to a file called MUSIC.AIFF [or .AIF on Windows].
View
2  drivers/drv_aix.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_aix.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_aix.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to AIX series audio device
View
2  drivers/drv_alsa.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_alsa.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_alsa.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for Advanced Linux Sound Architecture (ALSA)
View
2  drivers/drv_dart.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_dart.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_dart.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on OS/2 MMPM/2 using direct audio (DART)
View
2  drivers/drv_ds.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_ds.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_ds.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on win32 platforms using DirectSound
View
2  drivers/drv_esd.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_esd.c,v 1.1 2005/03/30 01:30:37 raphassenat Exp $
+ $Id: drv_esd.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for the Enlightened sound daemon (EsounD)
View
2  drivers/drv_gp32.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_gp32.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_gp32.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on gp32 platform
View
2  drivers/drv_hp.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_hp.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_hp.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to HP 9000 series /dev/audio
View
2  drivers/drv_mac.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_mac.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_mac.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to the Macintosh Sound Manager
View
2  drivers/drv_nas.c
@@ -1,5 +1,5 @@
/*** drv_nas.c --- MikMod sound library NAS output driver -*- C -*- */
-/** $Id: drv_nas.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $ */
+/** $Id: drv_nas.c,v 1.2 2005/03/30 19:09:11 realtech Exp $ */
/*** Copyright (C) 2004 Ivan Shmakov */
View
2  drivers/drv_nos.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_nos.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_nos.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for no output
View
2  drivers/drv_os2.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_os2.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_os2.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on OS/2 using MMPM/2 MCI interface
View
2  drivers/drv_oss.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_oss.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_oss.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on Linux and FreeBSD Open Sound System (OSS) (/dev/dsp)
View
2  drivers/drv_osx.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_osx.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_osx.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output via CoreAudio [MacOS X and Darwin].
View
2  drivers/drv_pipe.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_pipe.c,v 1.1 2005/03/30 01:30:38 raphassenat Exp $
+ $Id: drv_pipe.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output via a pipe to another command
View
2  drivers/drv_raw.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_raw.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_raw.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to a file called MUSIC.RAW
View
2  drivers/drv_sam9407.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_sam9407.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_sam9407.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for the Linux sam9407 driver
View
2  drivers/drv_sb.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_sb.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_sb.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for SoundBlaster/Pro/16/AWE32 under DOS
View
2  drivers/drv_sgi.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_sgi.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_sgi.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on SGI audio system (needs libaudio from the dmedia
package).
View
2  drivers/drv_stdout.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_stdout.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_stdout.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Output data to stdout
View
2  drivers/drv_sun.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_sun.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_sun.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on the Sun audio device (/dev/audio).
Also works under NetBSD and OpenBSD
View
2  drivers/drv_ultra.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_ultra.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_ultra.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for Gravis Ultrasound cards using libGUS.
A subset of libGUS is provided for DOS/DJGPP and OS/2
View
2  drivers/drv_wav.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_wav.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_wav.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output to a file called MUSIC.WAV
View
2  drivers/drv_win.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_win.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_win.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for output on win32 platforms using the multimedia API
View
2  drivers/drv_wss.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: drv_wss.c,v 1.1 2005/03/30 01:30:39 raphassenat Exp $
+ $Id: drv_wss.c,v 1.2 2005/03/30 19:09:11 realtech Exp $
Driver for Windows Sound System under DOS
View
5 examples/simpleplay/splay.c
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
MikMod_RegisterAllLoaders();
/* init the library */
- md_mode |= DMODE_SOFT_MUSIC;
+ md_mode |= DMODE_SOFT_MUSIC | DMODE_NOISEREDUCTION;
if (MikMod_Init("")) {
fprintf(stderr, "Could not initialize sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
@@ -44,7 +44,8 @@ int main(int argc, char **argv)
module = Player_Load(argv[1], 64, 0);
if (module) {
/* */
- printf("Playing %s\n", module->songname);
+ printf("Playing %s (%d chn) - SIMD: %s\n", module->songname, module->numchn,
+ md_mode & DMODE_SIMDMIXER ? "yes" : "no");
/* start module */
Player_Start(module);
View
3  examples/simpleplayMEM/splayMEM.c
@@ -40,8 +40,7 @@ int main(int argc, char **argv)
MikMod_RegisterAllLoaders();
/* init the library */
- //md_mode |= DMODE_SOFT_MUSIC | DMODE_NOISEREDUCTION | DMODE_HQMIXER | DMODE_SIMDMIXER;
- md_mode |= DMODE_SOFT_MUSIC | DMODE_NOISEREDUCTION;
+ md_mode |= DMODE_SOFT_MUSIC | DMODE_NOISEREDUCTION | DMODE_HQMIXER | DMODE_SIMDMIXER;
if (MikMod_Init("")) {
fprintf(stderr, "Could not initialize sound, reason: %s\n",
View
6 include/mikmod.h.in
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod.h.in,v 1.2 2005/03/30 17:57:38 realtech Exp $
+ $Id: mikmod.h.in,v 1.3 2005/03/30 19:09:21 realtech Exp $
MikMod sound library include file
@@ -603,9 +603,9 @@ MIKMODAPI extern void Player_Mute(SLONG,...);
MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
-MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
MIKMODAPI extern int Player_GetRow(void);
-MIKMODAPI extern int Player_GetOrder(void);
+MIKMODAPI extern int Player_GetOrder(void);
typedef void (*MikMod_player_t)(void);
typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
View
2  include/mikmod_internals.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod_internals.h,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: mikmod_internals.h,v 1.2 2005/03/30 19:09:29 realtech Exp $
MikMod sound library internal definitions
View
2  loaders/load_669.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_669.c,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: load_669.c,v 1.2 2005/03/30 19:09:29 realtech Exp $
Composer 669 module loader
View
2  loaders/load_amf.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_amf.c,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: load_amf.c,v 1.2 2005/03/30 19:09:32 realtech Exp $
DMP Advanced Module Format loader
View
2  loaders/load_asy.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_asy.c,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: load_asy.c,v 1.2 2005/03/30 19:09:33 realtech Exp $
ASYLUM Music Format v1.0 (.amf) loader
adapted from load_mod.c by Raphael Assenat <raph@raphnet.net>,
View
2  loaders/load_dsm.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_dsm.c,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: load_dsm.c,v 1.2 2005/03/30 19:09:35 realtech Exp $
DSIK internal format (DSM) module loader
View
2  loaders/load_far.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_far.c,v 1.1 2005/03/30 01:30:41 raphassenat Exp $
+ $Id: load_far.c,v 1.2 2005/03/30 19:09:35 realtech Exp $
Farandole (FAR) module loader
View
2  loaders/load_gdm.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_gdm.c,v 1.1 2005/03/30 01:30:42 raphassenat Exp $
+ $Id: load_gdm.c,v 1.2 2005/03/30 19:09:35 realtech Exp $
General DigiMusic (GDM) module loader
View
2  loaders/load_gt2.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_gt2.c,v 1.1 2005/03/30 01:30:42 raphassenat Exp $
+ $Id: load_gt2.c,v 1.2 2005/03/30 19:09:35 realtech Exp $
Graoumf tracker format (.GT2)
View
2  loaders/load_imf.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_imf.c,v 1.1 2005/03/30 01:30:42 raphassenat Exp $
+ $Id: load_imf.c,v 1.2 2005/03/30 19:09:54 realtech Exp $
Imago Orpheus (IMF) module loader
View
2  loaders/load_it.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_it.c,v 1.1 2005/03/30 01:30:42 raphassenat Exp $
+ $Id: load_it.c,v 1.2 2005/03/30 19:09:58 realtech Exp $
Impulse tracker (IT) module loader
View
2  loaders/load_m15.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_m15.c,v 1.1 2005/03/30 01:30:42 raphassenat Exp $
+ $Id: load_m15.c,v 1.2 2005/03/30 19:09:59 realtech Exp $
15 instrument MOD loader
Also supports Ultimate Sound Tracker (old M15 format)
View
2  loaders/load_med.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_med.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_med.c,v 1.2 2005/03/30 19:10:00 realtech Exp $
Amiga MED module loader
View
2  loaders/load_mod.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_mod.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_mod.c,v 1.2 2005/03/30 19:10:02 realtech Exp $
Generic MOD loader (Protracker, StarTracker, FastTracker, etc)
View
2  loaders/load_mtm.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_mtm.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_mtm.c,v 1.2 2005/03/30 19:10:02 realtech Exp $
MTM module loader
View
2  loaders/load_okt.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_okt.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_okt.c,v 1.2 2005/03/30 19:10:02 realtech Exp $
Oktalyzer (OKT) module loader
View
2  loaders/load_s3m.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_s3m.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_s3m.c,v 1.2 2005/03/30 19:10:02 realtech Exp $
Screamtracker (S3M) module loader
View
2  loaders/load_stm.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_stm.c,v 1.1 2005/03/30 01:30:43 raphassenat Exp $
+ $Id: load_stm.c,v 1.2 2005/03/30 19:10:04 realtech Exp $
Screamtracker 2 (STM) module loader
View
2  loaders/load_stx.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_stx.c,v 1.1 2005/03/30 01:30:44 raphassenat Exp $
+ $Id: load_stx.c,v 1.2 2005/03/30 19:10:06 realtech Exp $
STMIK 0.2 (STX) module loader
View
2  loaders/load_ult.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_ult.c,v 1.1 2005/03/30 01:30:44 raphassenat Exp $
+ $Id: load_ult.c,v 1.2 2005/03/30 19:10:06 realtech Exp $
Ultratracker (ULT) module loader
View
2  loaders/load_uni.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_uni.c,v 1.1 2005/03/30 01:30:44 raphassenat Exp $
+ $Id: load_uni.c,v 1.2 2005/03/30 19:10:07 realtech Exp $
UNIMOD (libmikmod's and APlayer's internal module format) loader
View
2  loaders/load_xm.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: load_xm.c,v 1.1 2005/03/30 01:30:44 raphassenat Exp $
+ $Id: load_xm.c,v 1.2 2005/03/30 19:10:07 realtech Exp $
Fasttracker (XM) module loader
View
1  macosx/libmikmod.xcode/project.pbxproj
@@ -8,7 +8,6 @@
014CEA440018CDF011CA2923 = {
buildSettings = {
COPY_PHASE_STRIP = NO;
- GCC_ALTIVEC_EXTENSIONS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
View
4 macosx/mikmod.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod.h,v 1.2 2005/03/30 17:57:41 realtech Exp $
+ $Id: mikmod.h,v 1.3 2005/03/30 19:10:10 realtech Exp $
MikMod sound library include file
@@ -605,7 +605,7 @@ MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
MIKMODAPI extern int Player_GetRow(void);
-MIKMODAPI extern int Player_GetOrder(void);
+MIKMODAPI extern int Player_GetOrder(void);
typedef void (*MikMod_player_t)(void);
typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
View
5 macosx/mikmod.h.in
@@ -575,7 +575,10 @@ MIKMODAPI extern void Player_Mute(SLONG,...);
MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
-MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_GetRow(void);
+MIKMODAPI extern int Player_GetOrder(void);
+
typedef void (MikMod_player)(void);
typedef MikMod_player *MikMod_player_t;
View
2  mkinstalldirs
@@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.1 2005/03/30 01:30:25 raphassenat Exp $
+# $Id: mkinstalldirs,v 1.2 2005/03/30 19:09:08 realtech Exp $
errstatus=0
View
76 mmio/mmalloc.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mmalloc.c,v 1.1 2005/03/30 01:31:01 raphassenat Exp $
+ $Id: mmalloc.c,v 1.2 2005/03/30 19:10:37 realtech Exp $
Dynamic memory routines
@@ -47,17 +47,31 @@ static void * align_pointer(char *ptr, size_t stride)
return fptr;
}
+static void *get_pointer(void *data)
+{
+ unsigned char *_pptr = (unsigned char*)data - sizeof(void*);
+ size_t _ptr = *(size_t*)_pptr;
+ return (void*)_ptr;
+}
+
void* MikMod_realloc(void *data, size_t size)
{
if (data)
{
- size_t stride = ALIGN_STRIDE;
- unsigned char *_pptr = (unsigned char*)data - sizeof(void*);
- size_t _ptr = *(size_t*)_pptr;
-
- unsigned char *newPtr = (unsigned char *)realloc((void*)_ptr, size + stride + sizeof(void*));
- return align_pointer(newPtr, stride);
+#if defined __MACH__
+ void *d = realloc(data, size);
+ if (d)
+ {
+ return d;
+ }
+ return 0;
+#elif defined _WIN32 || defined _WIN64
+ return _aligned_realloc(data, size, ALIGN_STRIDE);
+#else
+ unsigned char *newPtr = (unsigned char *)realloc(get_pointer(data), size + ALIGN_STRIDE + sizeof(void*));
+ return align_pointer(newPtr, ALIGN_STRIDE);
+#endif
}
return MikMod_malloc(size);
}
@@ -66,6 +80,22 @@ void* MikMod_realloc(void *data, size_t size)
/* Same as malloc, but sets error variable _mm_error when fails. Returns a 16-byte aligned pointer */
void* MikMod_malloc(size_t size)
{
+#if defined __MACH__
+ void *d = calloc(1, size);
+ if (d)
+ {
+ return d;
+ }
+ return 0;
+#elif defined _WIN32 || defined _WIN64
+ void * d = _aligned_malloc(size, ALIGN_STRIDE);
+ if (d)
+ {
+ ZeroMemory(d, size);
+ return d;
+ }
+ return 0;
+#else
void *d = calloc(1, size + ALIGN_STRIDE + sizeof(void*));
if(!d) {
@@ -73,11 +103,28 @@ void* MikMod_malloc(size_t size)
if(_mm_errorhandler) _mm_errorhandler();
}
return align_pointer(d, ALIGN_STRIDE);
+#endif
}
/* Same as calloc, but sets error variable _mm_error when fails */
void* MikMod_calloc(size_t nitems,size_t size)
{
+#if defined __MACH__
+ void *d = calloc(nitems, size);
+ if (d)
+ {
+ return d;
+ }
+ return 0;
+#elif defined _WIN32 || defined _WIN64
+ void * d = _aligned_malloc(size * nitems, ALIGN_STRIDE);
+ if (d)
+ {
+ ZeroMemory(d, size * nitems);
+ return d;
+ }
+ return 0;
+#else
void *d = calloc(nitems, size + ALIGN_STRIDE + sizeof(void*));
if(!d) {
@@ -85,15 +132,20 @@ void* MikMod_calloc(size_t nitems,size_t size)
if(_mm_errorhandler) _mm_errorhandler();
}
return align_pointer(d, ALIGN_STRIDE);
+#endif
}
-void MikMod_free(void *ptr)
+void MikMod_free(void *data)
{
- if (ptr)
+ if (data)
{
- unsigned char *_pptr = (unsigned char*)ptr - sizeof(void*);
- size_t _ptr = *(size_t*)_pptr;
- free((void*)_ptr);
+#if defined __MACH__
+ free(data);
+#elif defined _WIN32 || defined _WIN64
+ _aligned_free(data);
+#else
+ free(get_pointer(data));
+#endif
}
}
View
2  mmio/mmerror.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mmerror.c,v 1.1 2005/03/30 01:31:01 raphassenat Exp $
+ $Id: mmerror.c,v 1.2 2005/03/30 19:10:41 realtech Exp $
Error handling functions.
Register an error handler with _mm_RegisterErrorHandler() and you're all set.
View
10 mmio/mmio.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mmio.c,v 1.2 2005/03/30 17:42:34 realtech Exp $
+ $Id: mmio.c,v 1.3 2005/03/30 19:10:58 realtech Exp $
Portable file I/O routines
@@ -245,7 +245,6 @@ MREADER *_mm_new_mem_reader(const void *buffer, int len)
return (MREADER*)reader;
}
-
static BOOL _mm_MemReader_Eof(MREADER* reader)
{
if (!reader) { return 1; }
@@ -257,8 +256,9 @@ static BOOL _mm_MemReader_Eof(MREADER* reader)
static BOOL _mm_MemReader_Read(MREADER* reader,void* ptr,size_t size)
{
- unsigned char *d=ptr, *s;
-
+ unsigned char *d=ptr;
+ const unsigned char *s;
+
if (!reader) { return 0; }
if (reader->Eof(reader)) { return 0; }
@@ -272,7 +272,7 @@ static BOOL _mm_MemReader_Read(MREADER* reader,void* ptr,size_t size)
return 0; /* not enough remaining bytes */
}
- ((MMEMREADER*)reader)->pos += size;
+ ((MMEMREADER*)reader)->pos += (long)size;
while (size--)
{
View
2  os2/configure.cmd
@@ -22,7 +22,7 @@
/*==============================================================================
- $Id: configure.cmd,v 1.1 2005/03/30 01:31:01 raphassenat Exp $
+ $Id: configure.cmd,v 1.2 2005/03/30 19:11:09 realtech Exp $
Configuration script for libmikmod under OS/2
View
2  playercode/mdreg.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mdreg.c,v 1.1 2005/03/30 01:31:02 raphassenat Exp $
+ $Id: mdreg.c,v 1.2 2005/03/30 19:11:13 realtech Exp $
Routine for registering all drivers in libmikmod for the current platform.
View
2  playercode/mdriver.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mdriver.c,v 1.1 2005/03/30 01:31:02 raphassenat Exp $
+ $Id: mdriver.c,v 1.2 2005/03/30 19:11:17 realtech Exp $
These routines are used to access the available soundcard drivers.
View
2  playercode/mdulaw.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mdulaw.c,v 1.1 2005/03/30 01:31:03 raphassenat Exp $
+ $Id: mdulaw.c,v 1.2 2005/03/30 19:11:19 realtech Exp $
Mu-law routines
View
2  playercode/mloader.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mloader.c,v 1.1 2005/03/30 01:31:03 raphassenat Exp $
+ $Id: mloader.c,v 1.2 2005/03/30 19:11:19 realtech Exp $
These routines are used to access the available module loaders
View
2  playercode/mlreg.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mlreg.c,v 1.1 2005/03/30 01:31:03 raphassenat Exp $
+ $Id: mlreg.c,v 1.2 2005/03/30 19:11:34 realtech Exp $
Routine for registering all loaders in libmikmod for the current platform.
View
2  playercode/mlutil.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mlutil.c,v 1.1 2005/03/30 01:31:03 raphassenat Exp $
+ $Id: mlutil.c,v 1.2 2005/03/30 19:11:35 realtech Exp $
Utility functions for the module loader
View
43 playercode/mplayer.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mplayer.c,v 1.2 2005/03/30 17:57:43 realtech Exp $
+ $Id: mplayer.c,v 1.3 2005/03/30 19:11:46 realtech Exp $
The Protracker Player Driver
@@ -3334,27 +3334,6 @@ MIKMODAPI BOOL Player_Paused(void)
return result;
}
-
-// Get current module order
-MIKMODAPI int Player_GetOrder(void)
-{
- int ret;
- MUTEX_LOCK(vars);
- ret = pf ? pf->positions[pf->sngpos ? pf->sngpos-1 : 0]: 0;
- MUTEX_UNLOCK(vars);
- return ret;
-}
-
-// Get current module row
-MIKMODAPI int Player_GetRow(void)
-{
- int ret;
- MUTEX_LOCK(vars);
- ret = pf ? pf->patpos : 0;
- MUTEX_UNLOCK(vars);
- return ret;
-}
-
MIKMODAPI void Player_TogglePause(void)
{
MUTEX_LOCK(vars);
@@ -3406,5 +3385,25 @@ MIKMODAPI int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo)
}
+// Get current module order
+MIKMODAPI int Player_GetOrder(void)
+{
+ int ret;
+ MUTEX_LOCK(vars);
+ ret = pf ? pf->positions[pf->sngpos ? pf->sngpos-1 : 0]: 0;
+ MUTEX_UNLOCK(vars);
+ return ret;
+}
+
+// Get current module row
+MIKMODAPI int Player_GetRow(void)
+{
+ int ret;
+ MUTEX_LOCK(vars);
+ ret = pf ? pf->patpos : 0;
+ MUTEX_UNLOCK(vars);
+ return ret;
+}
+
/* ex:set ts=4: */
View
2  playercode/munitrk.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: munitrk.c,v 1.1 2005/03/30 01:31:04 raphassenat Exp $
+ $Id: munitrk.c,v 1.2 2005/03/30 19:11:46 realtech Exp $
All routines dealing with the manipulation of UNITRK streams
View
2  playercode/mwav.c
@@ -21,7 +21,7 @@
/*==============================================================================
- $Id: mwav.c,v 1.1 2005/03/30 01:31:04 raphassenat Exp $
+ $Id: mwav.c,v 1.2 2005/03/30 19:11:47 realtech Exp $
WAV sample loader
View
2  playercode/npertab.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: npertab.c,v 1.1 2005/03/30 01:31:04 raphassenat Exp $
+ $Id: npertab.c,v 1.2 2005/03/30 19:11:47 realtech Exp $
MOD format period table. Used by both the MOD and M15 (15-inst mod) Loaders.
View
2  playercode/sloader.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: sloader.c,v 1.1 2005/03/30 01:31:04 raphassenat Exp $
+ $Id: sloader.c,v 1.2 2005/03/30 19:11:49 realtech Exp $
Routines for loading samples. The sample loader utilizes the routines
provided by the "registered" sample loader.
View
245 playercode/virtch.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: virtch.c,v 1.1 2005/03/30 01:31:05 raphassenat Exp $
+ $Id: virtch.c,v 1.2 2005/03/30 19:11:50 realtech Exp $
Sample mixing routines, using a 32 bits mixing buffer.
@@ -129,12 +129,11 @@ static SLONG *RVbufR1=NULL,*RVbufR2=NULL,*RVbufR3=NULL,*RVbufR4=NULL,
#else
#define NATIVE SLONG
#endif
+#if defined HAVE_SSE2 || defined HAVE_ALTIVEC
-/*========== 32 bit sample mixers - only for 32 bit platforms */
-#ifndef NATIVE_64BIT_INT
-
-static SLONG Mix32MonoNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG increment,SLONG todo)
+static size_t MixSIMDMonoNormal(const SWORD* srce,SLONG* dest,size_t index, size_t increment,size_t todo)
{
+ // TODO:
SWORD sample;
SLONG lvolsel = vnf->lvolsel;
@@ -147,22 +146,156 @@ static SLONG Mix32MonoNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG inc
return index;
}
-static SLONG Mix32StereoNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG increment,SLONG todo)
+static size_t MixSIMDStereoNormal(const SWORD* srce, SLONG* dest, size_t index, size_t increment,size_t todo)
+{
+ SWORD vol[8] = {vnf->lvolsel, vnf->rvolsel};
+ SWORD sample;
+ SLONG remain = todo;
+
+ // Dest can be misaligned ...
+ while(!IS_ALIGNED_16(dest)) {
+ sample=srce[(index += increment) >> FRACBITS];
+ *dest++ += vol[0] * sample;
+ *dest++ += vol[1] * sample;
+ todo--;
+ }
+
+ // Srce is always aligned ...
+
+#if defined HAVE_SSE2
+ remain = todo&3;
+ {
+ __m128i v0 = _mm_set_epi16(0, vol[1],
+ 0, vol[0],
+ 0, vol[1],
+ 0, vol[0]);
+ for(todo>>=2;todo; todo--)
+ {
+ SWORD s0 = srce[(index += increment) >> FRACBITS];
+ SWORD s1 = srce[(index += increment) >> FRACBITS];
+ SWORD s2 = srce[(index += increment) >> FRACBITS];
+ SWORD s3 = srce[(index += increment) >> FRACBITS];
+ __m128i v1 = _mm_set_epi16(0, s1, 0, s1, 0, s0, 0, s0);
+ __m128i v2 = _mm_set_epi16(0, s3, 0, s3, 0, s2, 0, s2);
+ __m128i v3 = _mm_load_si128((__m128i*)(dest+0));
+ __m128i v4 = _mm_load_si128((__m128i*)(dest+4));
+ _mm_store_si128((__m128i*)(dest+0), _mm_add_epi32(v3, _mm_madd_epi16(v0, v1)));
+ _mm_store_si128((__m128i*)(dest+4), _mm_add_epi32(v4, _mm_madd_epi16(v0, v2)));
+ dest+=8;
+ }
+ }
+
+#elif defined HAVE_ALTIVEC
+ remain = todo&3;
+ {
+ vector signed short r0 = vec_ld(0, vol);
+ vector signed short v0 = vec_perm(r0, r0, (vector unsigned char)(0, 1, // l
+ 0, 1, // l
+ 2, 3, // r
+ 2, 1, // r
+ 0, 1, // l
+ 0, 1, // l
+ 2, 3, // r
+ 2, 3 // r
+ ));
+ SWORD s[8];
+
+ for(todo>>=2;todo; todo--)
+ {
+ // Load constants
+ s[0] = srce[(index += increment) >> FRACBITS];
+ s[1] = srce[(index += increment) >> FRACBITS];
+ s[2] = srce[(index += increment) >> FRACBITS];
+ s[3] = srce[(index += increment) >> FRACBITS];
+ s[4] = 0;
+
+ vector short int r1 = vec_ld(0, s);
+ vector signed short v1 = vec_perm(r1, r1, (vector unsigned char)(0*2, 0*2+1, // s0
+ 4*2, 4*2+1, // 0
+ 0*2, 0*2+1, // s0
+ 4*2, 4*2+1, // 0
+ 1*2, 1*2+1, // s1
+ 4*2, 4*2+1, // 0
+ 1*2, 1*2+1, // s1
+ 4*2, 4*2+1 // 0
+ ));
+
+ vector signed short v2 = vec_perm(r1, r1, (vector unsigned char)(2*2, 2*2+1, // s2
+ 4*2, 4*2+1, // 0
+ 2*2, 2*2+1, // s2
+ 4*2, 4*2+1, // 0
+ 3*2, 3*2+1, // s3
+ 4*2, 4*2+1, // 0
+ 3*2, 3*2+1, // s3
+ 4*2, 4*2+1 // 0
+ ));
+ vector signed int v3 = vec_ld(0, dest);
+ vector signed int v4 = vec_ld(0, dest + 4);
+ vector signed int v5 = vec_mule(v0, v1);
+ vector signed int v6 = vec_mule(v0, v2);
+
+ vec_st(vec_add(v3, v5), 0, dest);
+ vec_st(vec_add(v4, v6), 0, dest + 4);
+
+ dest+=8;
+ }
+ }
+#endif // HAVE_ALTIVEC
+
+ // Remaining bits ...
+ while(remain--) {
+ sample=srce[(index += increment) >> FRACBITS];
+
+ *dest++ += vol[0] * sample;
+ *dest++ += vol[1] * sample;
+ }
+ return index;
+}
+#endif
+
+/*========== 32 bit sample mixers - only for 32 bit platforms */
+#ifndef NATIVE_64BIT_INT
+
+static SLONG Mix32MonoNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG increment,SLONG todo)
{
SWORD sample;
SLONG lvolsel = vnf->lvolsel;
- SLONG rvolsel = vnf->rvolsel;
while(todo--) {
- sample=srce[index >> FRACBITS];
+ sample = srce[index >> FRACBITS];
index += increment;
*dest++ += lvolsel * sample;
- *dest++ += rvolsel * sample;
}
return index;
}
+// FIXME: This mixer should works also on 64-bit platform
+// Hint : changes SLONG / SLONGLONG mess with size_t
+static SLONG Mix32StereoNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG increment,SLONG todo)
+{
+#if defined HAVE_ALTIVEC || defined HAVE_SSE2
+ if (md_mode & DMODE_SIMDMIXER)
+ {
+ return MixSIMDStereoNormal(srce, dest, index, increment, todo);
+ }
+ else
+#endif
+ {
+ SWORD sample;
+ SLONG lvolsel = vnf->lvolsel;
+ SLONG rvolsel = vnf->rvolsel;
+ while(todo--) {
+ sample=srce[(index += increment) >> FRACBITS];
+
+ *dest++ += lvolsel * sample;
+ *dest++ += rvolsel * sample;
+ }
+ }
+ return index;
+}
+
+
static SLONG Mix32SurroundNormal(const SWORD* srce,SLONG* dest,SLONG index,SLONG increment,SLONG todo)
{
SWORD sample;
@@ -578,37 +711,37 @@ static void (*MixLowPass)(SLONG* srce,NATIVE count);
static int nLeftNR, nRightNR;
static void MixLowPass_Stereo(SLONG* srce,NATIVE count)
-{
- int n1 = nLeftNR, n2 = nRightNR;
- SLONG *pnr = srce;
- int nr=count;
- for (; nr; nr--)
- {
- int vnr = pnr[0] >> 1;
- pnr[0] = vnr + n1;
- n1 = vnr;
- vnr = pnr[1] >> 1;
- pnr[1] = vnr + n2;
- n2 = vnr;
- pnr += 2;
- }
- nLeftNR = n1;
- nRightNR = n2;
+{
+ int n1 = nLeftNR, n2 = nRightNR;
+ SLONG *pnr = srce;
+ int nr=count;
+ for (; nr; nr--)
+ {
+ int vnr = pnr[0] >> 1;
+ pnr[0] = vnr + n1;
+ n1 = vnr;
+ vnr = pnr[1] >> 1;
+ pnr[1] = vnr + n2;
+ n2 = vnr;
+ pnr += 2;
+ }
+ nLeftNR = n1;
+ nRightNR = n2;
}
static void MixLowPass_Normal(SLONG* srce,NATIVE count)
-{
- int n1 = nLeftNR;
- SLONG *pnr = srce;
- int nr=count;
- for (; nr; nr--)
- {
- int vnr = pnr[0] >> 1;
- pnr[0] = vnr + n1;
- n1 = vnr;
- pnr ++;
- }
- nLeftNR = n1;
+{
+ int n1 = nLeftNR;
+ SLONG *pnr = srce;
+ int nr=count;
+ for (; nr; nr--)
+ {
+ int vnr = pnr[0] >> 1;
+ pnr[0] = vnr + n1;
+ n1 = vnr;
+ pnr ++;
+ }
+ nLeftNR = n1;
}
/* Mixing macros */
@@ -700,7 +833,7 @@ static void Mix32ToFP_SIMD(float* dste,SLONG* srce,NATIVE count)
{
int remain=count&3;
- const float k = (1.0f / 32768.0f) / (float)(1 << (FP_SHIFT)); // Scale factor
+ const float k = (1.0f / (float)(1<<24));
simd_m128i x1;
simd_m128 x2 = LOAD_PS1_SIMD(&k); // Scale factor
remain = count&3;
@@ -717,14 +850,19 @@ static void Mix32ToFP_SIMD(float* dste,SLONG* srce,NATIVE count)
// PC: Ok, Mac Ok
static void Mix32To16_SIMD(SWORD* dste,SLONG* srce,NATIVE count)
{
- int remain;
- while(!IS_ALIGNED_16(dste))
+ int remain = count;
+
+ while(!IS_ALIGNED_16(dste) || !IS_ALIGNED_16(srce))
{
SLONG x1;
EXTRACT_SAMPLE(x1,16);
CHECK_SAMPLE(x1,32768);
PUT_SAMPLE(x1);
count--;
+ if (!count)
+ {
+ return;
+ }
}
remain = count&7;
@@ -749,12 +887,17 @@ static void Mix32To8_SIMD(SBYTE* dste,SLONG* srce,NATIVE count)
{
int remain=count;
- while(!IS_ALIGNED_16(dste))
+ while(!IS_ALIGNED_16(dste) || !IS_ALIGNED_16(srce))
{
SWORD x1;
EXTRACT_SAMPLE(x1,8);
CHECK_SAMPLE(x1,128);
PUT_SAMPLE(x1+128);
+ count--;
+ if (!count)
+ {
+ return;
+ }
}
remain = count&15;
@@ -878,8 +1021,17 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
vnf->current=Mix32SurroundNormal
(s,ptr,vnf->current,vnf->increment,done);
else
+ {
+#if defined HAVE_ALTIVEC || defined HAVE_SSE2
+ if (md_mode & DMODE_SIMDMIXER)
+ vnf->current=MixSIMDStereoNormal
+ (s,ptr,vnf->current,vnf->increment,done);
+
+ else
+#endif
vnf->current=Mix32StereoNormal
(s,ptr,vnf->current,vnf->increment,done);
+ }
} else
vnf->current=Mix32MonoNormal
(s,ptr,vnf->current,vnf->increment,done);
@@ -902,8 +1054,17 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
vnf->current=MixSurroundNormal
(s,ptr,vnf->current,vnf->increment,done);
else
+ {
+#if defined HAVE_ALTIVEC || defined HAVE_SSE2
+ if (md_mode & DMODE_SIMDMIXER)
+ vnf->current=MixSIMDStereoNormal
+ (s,ptr,vnf->current,vnf->increment,done);
+
+ else
+#endif
vnf->current=MixStereoNormal
(s,ptr,vnf->current,vnf->increment,done);
+ }
} else
vnf->current=MixMonoNormal
(s,ptr,vnf->current,vnf->increment,done);
@@ -985,7 +1146,7 @@ void VC1_WriteSamples(SBYTE* buf,ULONG todo)
}
if (vc_callback) {
- vc_callback(vc_tickbuf, portion);
+ vc_callback((unsigned char*)vc_tickbuf, portion);
}
View
5 playercode/virtch2.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: virtch2.c,v 1.2 2005/03/30 17:42:36 realtech Exp $
+ $Id: virtch2.c,v 1.3 2005/03/30 19:11:50 realtech Exp $
High-quality sample mixing routines, using a 32 bits mixing buffer,
interpolation, and sample smoothing to improve sound quality and remove
@@ -361,6 +361,7 @@ static SLONGLONG MixSIMDStereoNormal(const SWORD* const srce,SLONG* dest,SLONGLO
#elif defined HAVE_ALTIVEC
remain = todo&3;
+ remain = todo&3;
{
vector signed short r0 = vec_ld(0, vol);
vector signed short v0 = vec_perm(r0, r0, (vector unsigned char)(0, 1, // l
@@ -1319,4 +1320,4 @@ BOOL VC2_SetNumVoices(void)
return 0;
}
-/* ex:set ts=4: */
+/* ex:set ts=4: */
View
2  playercode/virtch_common.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: virtch_common.c,v 1.1 2005/03/30 01:31:05 raphassenat Exp $
+ $Id: virtch_common.c,v 1.2 2005/03/30 19:11:50 realtech Exp $
Common source parts between the two software mixers.
This file is probably the ugliest part of libmikmod...
View
8 win32/mikmod.def
@@ -1,4 +1,4 @@
-DESCRIPTION "libmikmod (win32) 3.2.2"
+DESCRIPTION "libmikmod (win32) 3.1.10"
EXPORTS
MikMod_GetVersion @1
@@ -111,7 +111,7 @@ EXPORTS
load_uni @125
load_xm @126
load_gdm @127
- load_okt @128
+ load_okt @128
VC_Init @141
VC_Exit @142
@@ -136,8 +136,6 @@ EXPORTS
VC_VoiceGetFrequency @161
VC_VoiceGetPanning @162
VC_SetCallback @163
-
Player_GetRow @164
- Player_GetOrder @165
-
+ Player_GetOrder @165
View
6 win32/mikmod.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod.h,v 1.2 2005/03/30 17:57:45 realtech Exp $
+ $Id: mikmod.h,v 1.3 2005/03/30 19:12:10 realtech Exp $
MikMod sound library include file
@@ -604,9 +604,9 @@ MIKMODAPI extern void Player_Mute(SLONG,...);
MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
-MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
MIKMODAPI extern int Player_GetRow(void);
-MIKMODAPI extern int Player_GetOrder(void);
+MIKMODAPI extern int Player_GetOrder(void);
typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
typedef void (*MikMod_player_t)(void);
View
2  win32/mikmod_build.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod_build.h,v 1.1 2005/03/30 01:31:06 raphassenat Exp $
+ $Id: mikmod_build.h,v 1.2 2005/03/30 19:12:10 realtech Exp $
MikMod sound library include file
Please sign in to comment.
Something went wrong with that request. Please try again.