Skip to content
Permalink
Browse files

Ported to MacOS

  • Loading branch information
Sam Lantinga committed Feb 11, 2000
1 parent c0fcd53 commit 1df71a7911c124b344024169c88777255420f55b
Showing with 533 additions and 33 deletions.
  1. +17 −15 CHANGES
  2. +450 −0 MPWmake.sea.hqx
  3. +1 −0 Makefile.am
  4. +3 −2 mikmod/mdriver.c
  5. +18 −4 mikmod/mikmod_internals.h
  6. +1 −1 mikmod/mloader.c
  7. +2 −1 mikmod/munitrk.c
  8. +11 −3 mikmod/virtch.c
  9. +21 −2 mikmod/virtch2.c
  10. +2 −0 mixer.c
  11. +1 −1 music.c
  12. +2 −2 playmus.c
  13. +2 −2 playwave.c
  14. +2 −0 wavestream.c
32 CHANGES
@@ -1,24 +1,26 @@

1.0.4:
* Markus Oberhumer Wed Feb 2 13:16:17 PST 2000
- Fixed problem with short looping sounds
* Sam Lantinga Tue Feb 1 13:25:44 PST 2000
- Added Visual C++ project file
* Markus Oberhumer Tue Feb 1 13:23:11 PST 2000
- Cleaned up code for compiling with Visual C++
- Don't hang in Mix_HaltMusic() if the music is paused
* Sam Lantinga Fri Jan 28 08:54:56 PST 2000
- Fixed looping WAVE chunks that are not aligned on sample boundaries
Sam Lantinga - Thu Feb 10 19:42:03 PST 2000
* Ported the base mixer and mikmod libraries to MacOS
Markus Oberhumer - Wed Feb 2 13:16:17 PST 2000
* Fixed problem with short looping sounds
Sam Lantinga - Tue Feb 1 13:25:44 PST 2000
* Added Visual C++ project file
Markus Oberhumer - Tue Feb 1 13:23:11 PST 2000
* Cleaned up code for compiling with Visual C++
* Don't hang in Mix_HaltMusic() if the music is paused
Sam Lantinga - Fri Jan 28 08:54:56 PST 2000
* Fixed looping WAVE chunks that are not aligned on sample boundaries

1.0.3:
* Sam Lantinga Mon Jan 17 19:48:09 PST 2000
- Changed the name of the library from "mixer" to "SDL_mixer"
- Instead of including "mixer.h", include "SDL_mixer.h",
- Instead of linking with libmixer.a, link with libSDL_mixer.a
Sam Lantinga - Mon Jan 17 19:48:09 PST 2000
* Changed the name of the library from "mixer" to "SDL_mixer"
* Instead of including "mixer.h", include "SDL_mixer.h",
* Instead of linking with libmixer.a, link with libSDL_mixer.a

1.0.2:
* Sam Lantinga Fri Jan 14 11:06:56 PST 2000
- Made the CHANGELOG entries Y2K compliant. :)
Sam Lantinga - Fri Jan 14 11:06:56 PST 2000
* Made the CHANGELOG entries Y2K compliant. :)
MFX - Updated the mikmod support to MikMod 3.1.8
MFX - Added Mix_HookMusicFinished() API function

Large diffs are not rendered by default.

@@ -32,6 +32,7 @@ endif
EXTRA_DIST = \
CHANGES \
VisualC.zip \
MPWmake.sea.hqx \
autogen.sh

libSDL_mixer_la_LDFLAGS = \
@@ -39,13 +39,14 @@
#include <sys/stat.h>
#endif

#include "mikmod_internals.h"

#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

#include "mikmod_internals.h"


static MDRIVER *firstdriver=NULL;
MDRIVER *md_driver=NULL;
extern MODULE *pf; /* modfile being played */
@@ -29,10 +29,6 @@
#ifndef _MIKMOD_INTERNALS_H
#define _MIKMOD_INTERNALS_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
@@ -43,11 +39,29 @@ extern "C" {

#include <mikmod_build.h>

#ifdef macintosh
#define __STDC__=1
static char *strdup(const char *str)
{
char *newstr;

newstr = (char *)malloc(strlen(str)+1);
if ( newstr != NULL ) {
strcpy(newstr, str);
}
return(newstr);
}
#endif

#ifdef WIN32
#define __STDC__
#pragma warning(disable:4761)
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*========== More type definitions */

/* SLONGLONG: 64bit, signed */
@@ -33,10 +33,10 @@
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#include <string.h>

#include "mikmod_internals.h"

#include <string.h>

MREADER *modreader;
MODULE of;
@@ -30,9 +30,10 @@
#include "config.h"
#endif

#include <string.h>

#include "mikmod_internals.h"

#include <string.h>

/* Unibuffer chunk size */
#define BUFPAGE 128
@@ -38,11 +38,12 @@
#include "config.h"
#endif

#include "mikmod_internals.h"

#include <stddef.h>
#include <string.h>

#include "mikmod_internals.h"


/*
Constant definitions
====================
@@ -524,7 +525,6 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
reached the end of the sample */
while(todo>0) {
SLONGLONG endpos;

if(vnf->flags & SF_REVERSE) {
/* The sample is playing in reverse */
if((vnf->flags&SF_LOOP)&&(vnf->current<idxlpos)) {
@@ -640,12 +640,20 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
vnf->current=MixMonoNormal
(s,ptr,vnf->current,vnf->increment,done);
}

} else
/* update sample position */
vnf->current=endpos;

todo-=done;
#if 1
if ( vc_mode & DMODE_STEREO )
ptr += done*2;
else
ptr += done;
#else
ptr +=(vc_mode & DMODE_STEREO)?(done<<1):done;
#endif
}
}

@@ -39,11 +39,14 @@
#include "config.h"
#endif

#include "mikmod_internals.h"

#include <stddef.h>
#include <string.h>

#include "mikmod_internals.h"

#ifdef macintosh
#define NO_64BIT_MIXER
#endif
/*
Constant Definitions
====================
@@ -266,6 +269,8 @@ static SLONG Mix32StereoSurround(SWORD* srce,SLONG* dest,SLONG index,SLONG incre

/*========== 64 bit mixers */

#ifndef NO_64BIT_MIXER

static SLONGLONG MixMonoNormal(SWORD* srce,SLONG* dest,SLONGLONG index,SLONGLONG increment,SLONG todo)
{
SWORD sample=0;
@@ -381,6 +386,8 @@ static SLONGLONG MixStereoSurround(SWORD* srce,SLONG* dest,SLONGLONG index,SLONG
return index;
}

#endif /* NO_64BIT_MIXER */

static void(*Mix32to16)(SWORD* dste,SLONG* srce,NATIVE count);
static void(*Mix32to8)(SBYTE* dste,SLONG* srce,NATIVE count);
static void(*MixReverb)(SLONG* srce,NATIVE count);
@@ -645,6 +652,9 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
(s,ptr,vnf->current,vnf->increment,done);
} else
#endif
#ifdef NO_64BIT_MIXER
/* Uh oh, the 64-bit mixers don't compile... */;
#else
{
if(vc_mode & DMODE_STEREO) {
if((vnf->pan==PAN_SURROUND)&&(vc_mode&DMODE_SURROUND))
@@ -657,14 +667,23 @@ static void AddChannel(SLONG* ptr,NATIVE todo)
vnf->current=MixMonoNormal
(s,ptr,vnf->current,vnf->increment,done);
}
#endif
} else {
vnf->lastvalL = vnf->lastvalR = 0;
/* update sample position */
vnf->current=endpos;
}

todo -= done;
#if 1
if ( vc_mode & DMODE_STEREO ) {
ptr += done*2;
} else {
ptr += done;
}
#else
ptr +=(vc_mode & DMODE_STEREO)?(done<<1):done;
#endif
}
}

@@ -185,11 +185,13 @@ int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize)

/* Create the channel lock mutex */
mixer_lock = SDL_CreateMutex();
#ifndef macintosh /* Hmm.. what implications does this have? */
if ( mixer_lock == NULL ) {
SDL_CloseAudio();
SDL_SetError("Unable to create mixer lock");
return(-1);
}
#endif

/* Initialize the music players */
if ( open_music(&mixer) < 0 ) {
@@ -328,7 +328,7 @@ int open_music(SDL_AudioSpec *mixer)
Mix_Music *Mix_LoadMUS(const char *file)
{
FILE *fp;
unsigned char magic[5];
char magic[5];
Mix_Music *music;

/* Figure out what kind of file this is */
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <signal.h>
#ifndef WIN32
#ifdef unix
#include <unistd.h>
#endif

@@ -83,7 +83,7 @@ void Menu(void)

main(int argc, char *argv[])
{
Uint32 audio_rate;
int audio_rate;
Uint16 audio_format;
int audio_channels;
int audio_buffers;
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <signal.h>
#ifndef WIN32
#ifdef unix
#include <unistd.h>
#endif

@@ -57,7 +57,7 @@ void Usage(char *argv0)

main(int argc, char *argv[])
{
Uint32 audio_rate;
int audio_rate;
Uint16 audio_format;
int audio_channels;
int loops = 0;
@@ -57,9 +57,11 @@ int WAVStream_Init(SDL_AudioSpec *mixerfmt)
{
/* FIXME: clean up the mutex, or move it into music.c */
music_lock = SDL_CreateMutex();
#ifndef macintosh /* Hmm.. */
if ( music_lock == NULL ) {
return(-1);
}
#endif
mixer = *mixerfmt;
return(0);
}

0 comments on commit 1df71a7

Please sign in to comment.