Skip to content

Commit

Permalink
MegaZeux 2.81 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelva1984 committed Aug 11, 2008
1 parent 1b766c6 commit c15be73
Show file tree
Hide file tree
Showing 61 changed files with 6,524 additions and 3,332 deletions.
23 changes: 17 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@
include Makefile.platform

subdir:
cd contrib/libmodplug/src && make && cd ../../..
cd contrib/gdm2s3m/src && make && cd ../../..
cd src && make && cd ..
cd contrib/libmodplug/src && ${MAKE} && cd ../../..
cd contrib/gdm2s3m/src && ${MAKE} && cd ../../..
cd src && ${MAKE} && cd ..

subdir-debug:
cd contrib/libmodplug/src && ${MAKE} DEBUG=1 && cd ../../..
cd contrib/gdm2s3m/src && ${MAKE} DEBUG=1 && cd ../../..
cd src && ${MAKE} DEBUG=1 && cd ..

clean:
cd contrib/libmodplug/src && make clean && cd ../../..
cd contrib/gdm2s3m/src && make clean && cd ../../..
cd src && make clean && cd ..
cd contrib/libmodplug/src && ${MAKE} clean && cd ../../..
cd contrib/gdm2s3m/src && ${MAKE} clean && cd ../../..
cd src && ${MAKE} clean && cd ..

dclean:
cd contrib/libmodplug/src && ${MAKE} dclean && cd ../../..
cd contrib/gdm2s3m/src && ${MAKE} dclean && cd ../../..
cd src && ${MAKE} dclean && cd ..

distclean: clean
rm -f src/config.h
cp -f arch/Makefile.dist Makefile.platform

14 changes: 8 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ GDM2S3M = contrib/gdm2s3m/src
MODPLUG = contrib/libmodplug/src

# default target name
TARGET = mzx280h
VERSION = 2.80h
TARGET = mzx281
VERSION = 2.81

ifneq ("${DATE}", "0")
VERSTRING = ${VERSION}\ \(`date +%Y%m%d`\)
Expand All @@ -21,15 +21,17 @@ endif
ifdef DEBUG
CFLAGS = -g -Wall -DDEBUG
CXXFLAGS = -g -Wall -DDEBUG
o = dbg.o
else
CFLAGS += -O2 -Wall
CXXFLAGS += -O2 -Wall
o = o
endif

.SUFFIXES: .cpp .c

%.o: %.cpp
${CXX} ${CXXFLAGS} ${INCLUDES} -c $<
%.o %.dbg.o: %.cpp
${CXX} ${CXXFLAGS} ${INCLUDES} -c $< -o $@

%.o: %.c
${CC} ${CFLAGS} ${INCLUDES} -c $<
%.o %.dbg.o: %.c
${CC} ${CFLAGS} ${INCLUDES} -c $< -o $@
32 changes: 0 additions & 32 deletions Makefile.platform

This file was deleted.

5 changes: 3 additions & 2 deletions arch/Makefile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

all:
@echo "Please run config.sh before make!"
@echo "usage: ./config.sh <linux|win32|macos> <prefix>"
@echo " e.g.: ./config.sh win32 /usr"
@echo "usage: ./config.sh <linux|win32|macos> <prefix> <sysconfdir>"
@echo " e.g.: ./config.sh linux /usr /etc"
@echo " e.g.: ./config.sh win32"
5 changes: 3 additions & 2 deletions arch/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#

all: subdir
debug: subdir-debug

# location of strip (must be defined)
STRIP = strip --strip-unneeded

# standard libraries
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L${PREFIX}/lib -lSDL -lpthread -lX11
-L${PREFIX}/lib -lSDL -lpthread -lvorbisfile -lvorbis -logg -lX11

# linux os specific install target
install:
Expand All @@ -23,6 +24,6 @@ install:
install -o root -m 0644 mzx_edit.chr ${PREFIX}/share/megazeux && \
install -o root -m 0644 smzx.pal ${PREFIX}/share/megazeux && \
install -o root -m 0644 mzx_help.fil ${PREFIX}/share/megazeux && \
install -o root -m 0644 config.txt /etc/megazeux-config && \
install -o root -m 0644 config.txt ${SYSCONFDIR}/megazeux-config && \
install -o root -m 0755 ${TARGET} ${PREFIX}/bin && \
ln -sf ${TARGET} ${PREFIX}/bin/megazeux
5 changes: 3 additions & 2 deletions arch/Makefile.macos
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
#

all: subdir
debug: subdir-debug

# location of strip (must be defined)
STRIP = strip

# standard libraries
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L${PREFIX}/lib -lSDLmain -lSDL -lpthread \
-framework Cocoa
-L${PREFIX}/lib -lSDLmain -lSDL -lpthread -lvorbisfile \
-lvorbis -logg -framework Cocoa
3 changes: 2 additions & 1 deletion arch/Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

all: subdir
debug: subdir-debug

# windows requires a binary extension
BINEXT = .exe
Expand All @@ -12,7 +13,7 @@ STRIP = strip --strip-unneeded

# standard libraries
LIBS = ../${GDM2S3M}/libgdm2s3m.a ../${MODPLUG}/libmodplug.a \
-L/usr/lib -lmingw32 -lSDLmain -lSDL
-L/usr/lib -lmingw32 -lSDLmain -lSDL -lvorbisfile -lvorbis -logg

# debug does something different
ifdef DEBUG
Expand Down
36 changes: 20 additions & 16 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,37 @@ else
PREFIX=$2
fi

if [ "$3" = "" ]; then
if [ "$ARCH" = "linux" ]; then
echo "Assuming /etc sysconfdir.."
SYSCONFDIR=/etc
else
echo "Assuming config.txt is in working directory.."
SYSCONFDIR=.
fi
else
SYSCONFDIR=$3
fi

echo >> Makefile.platform
echo "# install prefix" >> Makefile.platform
echo "PREFIX=$PREFIX" >> Makefile.platform

echo "#define CONFDIR \"$SYSCONFDIR/\"" > src/config.h

if [ "$ARCH" = "win32" -o "$ARCH" = "macos" ]; then
echo "#define MZX_DEFAULT_CHR \"mzx_default.chr\"" > src/config.h
echo "#define MZX_BLANK_CHR \"mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"mzx_ascii.chr\"" >> src/config.h
echo "#define MZX_EDIT_CHR \"mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"config.txt\"" >> src/config.h
echo "#define SHAREDIR \"./\"" >> src/config.h
echo "#define CONFFILE \"config.txt\"" >> src/config.h
fi

if [ "$ARCH" = "linux" ]; then
echo "#define MZX_DEFAULT_CHR \"$PREFIX/share/megazeux/mzx_default.chr\"" > src/config.h
echo "#define MZX_BLANK_CHR \"$PREFIX/share/megazeux/mzx_blank.chr\"" >> src/config.h
echo "#define MZX_SMZX_CHR \"$PREFIX/share/megazeux/mzx_smzx.chr\"" >> src/config.h
echo "#define MZX_ASCII_CHR \"$PREFIX/share/megazeux/mzx_ascii.chr\"" >> src/config.h
echo "#define MZX_EDIT_CHR \"$PREFIX/share/megazeux/mzx_edit.chr\"" >> src/config.h
echo "#define SMZX_PAL \"$PREFIX/share/megazeux/smzx.pal\"" >> src/config.h
echo "#define MZX_HELP_FIL \"$PREFIX/share/megazeux/mzx_help.fil\"" >> src/config.h
echo "#define CONFIG_TXT \"/etc/megazeux-config\"" >> src/config.h
echo "#define SHAREDIR \"$PREFIX/share/megazeux/\"" >> src/config.h
echo "#define CONFFILE \"megazeux-config\"" >> src/config.h

echo "TARGET=`grep TARGET Makefile.in | cut -d ' ' -f 6`" \
>> Makefile.platform

echo "SYSCONFDIR=$SYSCONFDIR" >> Makefile.platform
fi

if [ "$ARCH" != "win32" ]; then
Expand Down
29 changes: 23 additions & 6 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# You may also try a resolution like 640x700 that multiplies
# the width, then set the multiplier..

#force_resolution = 640, 350
#force_resolution = 640,350

# Make it so the display is stretched by this amount (must be
# integer). This is useful for getting resolutions like 640x700
Expand All @@ -46,27 +46,44 @@

### Audio options ###

# Sampling rate to output audio at. Higher values will sound
# better but use more resources and may not be supported by
# your audio card/drivers. Typical values include 22050, 44100,
# and 48000. If your card supports it you might get away with
# 96000, or even 192000.

#audio_sample_rate = 44100

# Audio buffer size. Setting this to lower can improve latency,
# so audio will be heard sooner after it is set to be changed.
# It is also possible to change PC speaker effects more rapidly
# with lower values. Lower buffer sizes need more CPU power to
# process. The default is adequete for PC speaker playback every
# process. 2048 is adequete for PC speaker playback every
# command at speed 4.

#audio_buffer = 2048
#audio_buffer = 4096

# Allow music to be sampled at higher precision. Increases CPU
# usage but increases audio quality as well.

#enable_oversampling = 1
#enable_oversampling = 0

# Set master resample mode. This affects how OGGs and
# frequency shifted modules sound. Choices are:
# none (fastest, poor quality)
# linear (fast, good quality)
# cubic (slow, great quality)

resample_mode = linear

# Set resampling mode. Choices are:
# Set resample mode for modplug. This affects how modules
# and WAVs sound. Choices are:
# none (fastest, poor quality)
# linear (fast, good quality)
# cubic (slow, great quality)
# fir (very slow, excellent quality)

#resampling_mode = linear
modplug_resample_mode = cubic

# Whether music/samples should be played or not.
# Does not include PC speaker effects.
Expand Down
10 changes: 7 additions & 3 deletions contrib/gdm2s3m/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ CFLAGS += -std=c99
# objects to build
#

objs = error.o gdm.o s3m.o utility.o gdm2s3m.o
objs = error.${o} gdm.${o} s3m.${o} utility.${o} gdm2s3m.${o}

subdir: libs

libs: ${objs}
ar crus libgdm2s3m.a ${objs}

clean:
rm -f ${objs} libgdm2s3m.a
clean: dclean
rm -f *.o *~ libgdm2s3m.a

dclean:
rm -f *.dbg.o libgdm2s3m.a

74 changes: 74 additions & 0 deletions contrib/libmodplug-0.7-clip-fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
diff -NudrbE -U3 -x CVS libmodplug-0.7/src/fastmix.cpp libmodplug-clipfix/src/fastmix.cpp
--- libmodplug-0.7/src/fastmix.cpp 2005-05-23 20:11:45.000000000 +0100
+++ libmodplug-clipfix/src/fastmix.cpp 2005-07-02 16:12:58.792124928 +0100
@@ -2230,6 +2230,7 @@
#define MIXING_LIMITMAX (0x08100000)
#define MIXING_LIMITMIN (-MIXING_LIMITMAX)

+#ifdef MSC_VER
__declspec(naked) UINT MPPASMCALL X86_AGC(int *pBuffer, UINT nSamples, UINT nAGC)
//-------------------------------------------------------------------------------
{
@@ -2267,6 +2268,28 @@
}

#pragma warning (default:4100)
+#else
+// Version for GCC
+UINT MPPASMCALL X86_AGC(int *pBuffer, UINT nSamples, UINT nAGC)
+{
+ int x;
+
+ while(nSamples)
+ {
+ x = ((long long int)(*pBuffer) * nAGC) >> AGC_PRECISION;
+
+ if((x < MIXING_LIMITMIN) || (x > MIXING_LIMITMAX))
+ nAGC--;
+
+ *pBuffer = x;
+
+ pBuffer++;
+ nSamples--;
+ }
+
+ return nAGC;
+}
+#endif

void CSoundFile::ProcessAGC(int count)
//------------------------------------
diff -NudrbE -U3 -x CVS libmodplug-0.7/src/sndfile.cpp libmodplug-clipfix/src/sndfile.cpp
--- libmodplug-0.7/src/sndfile.cpp 2005-05-23 20:11:47.000000000 +0100
+++ libmodplug-clipfix/src/sndfile.cpp 2005-07-02 16:11:29.679672080 +0100
@@ -1541,11 +1541,11 @@
// Adjust end of sample
if (pIns->uFlags & CHN_STEREO)
{
- pSample[len*2+6] = pSample[len*2+4] = pSample[len*2+2] = pSample[len*2] = pSample[len*2-2];
- pSample[len*2+7] = pSample[len*2+5] = pSample[len*2+3] = pSample[len*2+1] = pSample[len*2-1];
+ pSample[len*2+6] = pSample[len*2+4] = pSample[len*2+2] = pSample[len*2] = 0;
+ pSample[len*2+7] = pSample[len*2+5] = pSample[len*2+3] = pSample[len*2+1] = 0;
} else
{
- pSample[len+4] = pSample[len+3] = pSample[len+2] = pSample[len+1] = pSample[len] = pSample[len-1];
+ pSample[len+4] = pSample[len+3] = pSample[len+2] = pSample[len+1] = pSample[len] = 0;
}
if ((pIns->uFlags & (CHN_LOOP|CHN_PINGPONGLOOP|CHN_STEREO)) == CHN_LOOP)
{
@@ -1593,11 +1593,12 @@
// Adjust end of sample
if (pIns->uFlags & CHN_STEREO)
{
- pSample[len*2+6] = pSample[len*2+4] = pSample[len*2+2] = pSample[len*2] = pSample[len*2-2];
- pSample[len*2+7] = pSample[len*2+5] = pSample[len*2+3] = pSample[len*2+1] = pSample[len*2-1];
+ pSample[len*2+6] = pSample[len*2+4] = pSample[len*2+2] = pSample[len*2] = 0;
+ pSample[len*2+7] = pSample[len*2+5] = pSample[len*2+3] = pSample[len*2+1] = 0;
+
} else
{
- pSample[len+4] = pSample[len+3] = pSample[len+2] = pSample[len+1] = pSample[len] = pSample[len-1];
+ pSample[len+4] = pSample[len+3] = pSample[len+2] = pSample[len+1] = pSample[len] = 0;
}
if ((pIns->uFlags & (CHN_LOOP|CHN_PINGPONGLOOP|CHN_STEREO)) == CHN_LOOP)
{
12 changes: 12 additions & 0 deletions contrib/libmodplug-0.7-increase-frequency-upper-limit.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Nudr -U3 libmodplug-0.7/src/libmodplug/sndfile.h libmodplug/src/libmodplug/sndfile.h
--- libmodplug-0.7/src/libmodplug/sndfile.h 2005-07-06 18:59:32.842085856 +0100
+++ libmodplug/src/libmodplug/sndfile.h 2005-07-06 18:48:45.026568784 +0100
@@ -22,7 +22,7 @@

#define MOD_AMIGAC2 0x1AB
#define MAX_SAMPLE_LENGTH 16000000
-#define MAX_SAMPLE_RATE 50000
+#define MAX_SAMPLE_RATE 192000
#define MAX_ORDERS 256
#define MAX_PATTERNS 240
#define MAX_SAMPLES 240
Loading

0 comments on commit c15be73

Please sign in to comment.