aboutsummaryrefslogtreecommitdiff
path: root/backends/midi/mt32
diff options
context:
space:
mode:
authorMax Horn2004-10-22 15:56:39 +0000
committerMax Horn2004-10-22 15:56:39 +0000
commit5c53a3e260e8208cf9917b74f934b01629c47328 (patch)
treec17d9460f0f36924f88aa2543e7f957bfb439c60 /backends/midi/mt32
parentbf588c163f36c64822cdaf010f61ec7d62d95a81 (diff)
downloadscummvm-rg350-5c53a3e260e8208cf9917b74f934b01629c47328.tar.gz
scummvm-rg350-5c53a3e260e8208cf9917b74f934b01629c47328.tar.bz2
scummvm-rg350-5c53a3e260e8208cf9917b74f934b01629c47328.zip
cleanup
svn-id: r15652
Diffstat (limited to 'backends/midi/mt32')
-rw-r--r--backends/midi/mt32/partial.h4
-rw-r--r--backends/midi/mt32/structures.h21
-rw-r--r--backends/midi/mt32/synth.cpp26
-rw-r--r--backends/midi/mt32/synth.h30
4 files changed, 33 insertions, 48 deletions
diff --git a/backends/midi/mt32/partial.h b/backends/midi/mt32/partial.h
index 8f9014713f..e3af4ad5a9 100644
--- a/backends/midi/mt32/partial.h
+++ b/backends/midi/mt32/partial.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef __CPARTIALMT32_H__
-#define __CPARTIALMT32_H__
+#ifndef CPARTIALMT32_H
+#define CPARTIALMT32_H
#include "backends/midi/mt32/structures.h"
diff --git a/backends/midi/mt32/structures.h b/backends/midi/mt32/structures.h
index 712143ecf7..9fbc8bd627 100644
--- a/backends/midi/mt32/structures.h
+++ b/backends/midi/mt32/structures.h
@@ -20,8 +20,8 @@
*
*/
-#if !defined __MT32STRUCTURES_H__
-#define __MT32STRUCTURES_H__
+#ifndef MT32STRUCTURES_H
+#define MT32STRUCTURES_H
#include "stdafx.h"
#include "common/scummsys.h"
@@ -48,15 +48,12 @@ static inline void LOG_MSG(char *fmt, ...)
fflush(stdout);
}
-#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
+#define ALIGN_PACKED GCC_PACK
-#define ALIGN_PACKED
+#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#else
-//#define ALIGN_PACKED __attribute__ ((__packed__))
-#define ALIGN_PACKED __attribute__ ((aligned (1)))
-
#ifdef HAVE_X86
#define eflag(value) __asm__ __volatile__("pushfl \n popfl \n" : : "a"(value))
#define cpuid_flag (1 << 21)
@@ -441,10 +438,10 @@ static inline void atti386_PartProductOutput(int quadlen, int16 leftvol, int16 r
#endif
-extern bool enabled3DNow;
-extern bool enabledSSE;
+#if !defined(__GNUC__)
+ #pragma START_PACK_STRUCTS
+#endif
-#pragma pack(1)
struct timbreParam {
struct commonParam {
char name[10];
@@ -571,7 +568,9 @@ struct memAbsolute {
char mt32memory[sizeof(memBanks)];
} ALIGN_PACKED;
-#pragma pack()
+#if !defined(__GNUC__)
+ #pragma END_PACK_STRUCTS
+#endif
struct partialFormat {
uint32 addr;
diff --git a/backends/midi/mt32/synth.cpp b/backends/midi/mt32/synth.cpp
index dca5c68b07..824e04aad9 100644
--- a/backends/midi/mt32/synth.cpp
+++ b/backends/midi/mt32/synth.cpp
@@ -56,22 +56,24 @@
#define NEW_REVERB_TIME 14
#define NEW_REVERB_LEVEL 15
-#pragma pack(1)
+#if !defined(__GNUC__)
+ #pragma START_PACK_STRUCTS
+#endif
+
static union mt32ramFormat {
memParams params;
memBanks patchabs;
memAbsolute memabs;
-
-
// System memory 10
-
// Display 20
-
// Reset 7F
+} ALIGN_PACKED mt32ram, mt32default;
+
+#if !defined(__GNUC__)
+ #pragma END_PACK_STRUCTS
+#endif
-} ALIGN_PACKED mt32ram, mt32default;
-#pragma pack()
// Borrowed from Borland's site
int axtoi(char *hexStg) {
unsigned int n = 0; // position in string
@@ -3410,14 +3412,14 @@ bool CSynthMT32::InitTables(const char *baseDir ) {
return true;
}
-BOOL RecalcWaveforms(char * baseDir, int sampRate, recalcStatusCallback callBack) {
+bool RecalcWaveforms(char * baseDir, int sampRate, recalcStatusCallback callBack) {
#ifdef NOMANSLAND
File fp;
fp.open("waveforms.raw", File::kFileWriteMode);
- if(!fp.isOpen()) return FALSE;
+ if(!fp.isOpen()) return false;
double ampsize = WGAMP;
int f;
@@ -3512,11 +3514,7 @@ BOOL RecalcWaveforms(char * baseDir, int sampRate, recalcStatusCallback callBack
fp.close();
#endif
- return TRUE;
-
-
-
-
+ return true;
}
bool CSynthMT32::ClassicOpen(const char *baseDir, SynthProperties useProp) {
diff --git a/backends/midi/mt32/synth.h b/backends/midi/mt32/synth.h
index b16308a795..106fc7f020 100644
--- a/backends/midi/mt32/synth.h
+++ b/backends/midi/mt32/synth.h
@@ -20,8 +20,8 @@
*
*/
-#if !defined __CSYNTHMT32_H__
-#define __CSYNTHMT32_H__
+#ifndef CSYNTHMT32_H
+#define CSYNTHMT32_H
#ifdef HAVE_X86
#if defined(_MSC_VER)
@@ -35,8 +35,6 @@
#define USE_MMX 0
#endif
-extern const char *rom_path;
-
#define AMPENV 0
#define FILTENV 1
#define PITCHENV 2
@@ -79,16 +77,6 @@ struct SynthProperties {
int RevLevel;
};
-#ifndef BOOL
- #define BOOL bool
-#endif
-#ifndef TRUE
- #define TRUE true
-#endif
-#ifndef FALSE
- #define FALSE false
-#endif
-
// This is the specification of the Callback routine used when calling the RecalcWaveforms
// function
typedef void (*recalcStatusCallback)(int percDone);
@@ -97,7 +85,7 @@ typedef void (*recalcStatusCallback)(int percDone);
// sampling rate. The callback routine provides interactivity to let the user know what
// percentage is complete in regenerating the waveforms. When a NULL pointer is used as the
// callback routine, no status is reported.
-BOOL RecalcWaveforms(char * baseDir, int sampRate, recalcStatusCallback callBack);
+bool RecalcWaveforms(char * baseDir, int sampRate, recalcStatusCallback callBack);
typedef float (*iir_filter_type)(float input,float *hist1_ptr, float *coef_ptr, int revLevel);
extern iir_filter_type usefilter;
@@ -130,7 +118,7 @@ extern int32 getPitchEnvelope(dpoly::partialStatus *pStat, dpoly *poly);
extern int32 getAmpEnvelope(dpoly::partialStatus *pStat, dpoly *poly);
extern int32 getFiltEnvelope(int16 wg, dpoly::partialStatus *pStat, dpoly *poly);
-class CSynthMT32 {
+class CSynthMT32 {
private:
unsigned char initmode;
@@ -155,11 +143,11 @@ public:
void PlayMsg(uint32 msg);
// Sends a string of Sysex commands to the MT-32 for immediate interpretation
- void PlaySysex(uint8 * sysex, uint32 len);
-
- // Save the system state to a sysex file specified by filename
- int DumpSysex(char *filename);
-
+ void PlaySysex(uint8 * sysex, uint32 len);
+
+ // Save the system state to a sysex file specified by filename
+ int DumpSysex(char *filename);
+
// This callback routine is used to have the MT-32 generate samples to the specified
// output stream. The length is in whole samples, not bytes. (I.E. in 16-bit stereo,
// one sample is 4 bytes)