Commit 4f9f1abe authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups

parent 81e2edc2
Pipeline #65399 passed with stages
in 8 minutes and 58 seconds
...@@ -38,16 +38,6 @@ int rfputc(int character, RFILE * stream); ...@@ -38,16 +38,6 @@ int rfputc(int character, RFILE * stream);
typedef unsigned char byte; typedef unsigned char byte;
typedef unsigned short word; typedef unsigned short word;
struct SndDriverStruct SndDriver =
{
(void (*)(int,int))0,
(void (*)(int,int))0,
(void (*)(int,int))0,
(void (*)(int,int,int))0,
(void (*)(int,const signed char *,int,int))0,
(const signed char *(*)(int))0
};
static const struct { byte Note;word Wheel; } Freqs[4096] = static const struct { byte Note;word Wheel; } Freqs[4096] =
{ {
#include "MIDIFreq.h" #include "MIDIFreq.h"
...@@ -170,9 +160,6 @@ void Sound(int Channel,int Freq,int Volume) ...@@ -170,9 +160,6 @@ void Sound(int Channel,int Freq,int Volume)
WaveCH[Channel].Volume = Volume; WaveCH[Channel].Volume = Volume;
WaveCH[Channel].Freq = Freq; WaveCH[Channel].Freq = Freq;
/* Call sound driver if present */
if(SndDriver.Sound) (*SndDriver.Sound)(Channel,Freq,Volume);
/* Log sound to MIDI file */ /* Log sound to MIDI file */
MIDISound(Channel,Freq,Volume); MIDISound(Channel,Freq,Volume);
} }
...@@ -187,9 +174,6 @@ void Drum(int Type,int Force) ...@@ -187,9 +174,6 @@ void Drum(int Type,int Force)
/* Drum force has to be valid */ /* Drum force has to be valid */
Force = Force<0? 0:Force>255? 255:Force; Force = Force<0? 0:Force>255? 255:Force;
/* Call sound driver if present */
if(SndDriver.Drum) (*SndDriver.Drum)(Type,Force);
/* Log drum to MIDI file */ /* Log drum to MIDI file */
MIDIDrum(Type,Force); MIDIDrum(Type,Force);
} }
...@@ -206,9 +190,6 @@ void SetSound(int Channel,int Type) ...@@ -206,9 +190,6 @@ void SetSound(int Channel,int Type)
/* Set wave channel type */ /* Set wave channel type */
WaveCH[Channel].Type = Type; WaveCH[Channel].Type = Type;
/* Call sound driver if present */
if(SndDriver.SetSound) (*SndDriver.SetSound)(Channel,Type);
/* Log instrument change to MIDI file */ /* Log instrument change to MIDI file */
MIDISetSound(Channel,Type); MIDISetSound(Channel,Type);
} }
...@@ -223,9 +204,6 @@ void SetChannels(int Volume,int Switch) ...@@ -223,9 +204,6 @@ void SetChannels(int Volume,int Switch)
/* Volume has to be valid */ /* Volume has to be valid */
Volume = Volume<0? 0:Volume>255? 255:Volume; Volume = Volume<0? 0:Volume>255? 255:Volume;
/* Call sound driver if present */
if(SndDriver.SetChannels) (*SndDriver.SetChannels)(Volume,Switch);
/* Modify wave master settings */ /* Modify wave master settings */
MasterVolume = Volume; MasterVolume = Volume;
MasterSwitch = Switch&((1<<SND_CHANNELS)-1); MasterSwitch = Switch&((1<<SND_CHANNELS)-1);
...@@ -250,9 +228,6 @@ void SetWave(int Channel,const signed char *Data,int Length,int Rate) ...@@ -250,9 +228,6 @@ void SetWave(int Channel,const signed char *Data,int Length,int Rate)
WaveCH[Channel].Count = 0; WaveCH[Channel].Count = 0;
WaveCH[Channel].Data = Data; WaveCH[Channel].Data = Data;
/* Call sound driver if present */
if(SndDriver.SetWave) (*SndDriver.SetWave)(Channel,Data,Length,Rate);
/* Log instrument change to MIDI file */ /* Log instrument change to MIDI file */
MIDISetSound(Channel,Rate? -1:SND_MELODIC); MIDISetSound(Channel,Rate? -1:SND_MELODIC);
} }
...@@ -267,9 +242,6 @@ const signed char *GetWave(int Channel) ...@@ -267,9 +242,6 @@ const signed char *GetWave(int Channel)
/* Channel has to be valid */ /* Channel has to be valid */
if((Channel<0)||(Channel>=SND_CHANNELS)) return(0); if((Channel<0)||(Channel>=SND_CHANNELS)) return(0);
/* If driver present, call it */
if(SndDriver.GetWave) return((*SndDriver.GetWave)(Channel));
/* Return current read position */ /* Return current read position */
return( return(
WaveCH[Channel].Rate&&(WaveCH[Channel].Type==SND_WAVE)? WaveCH[Channel].Rate&&(WaveCH[Channel].Type==SND_WAVE)?
...@@ -633,7 +605,6 @@ void TrashSound(void) ...@@ -633,7 +605,6 @@ void TrashSound(void)
SndRate = 0; SndRate = 0;
} }
#if !defined(NO_AUDIO_PLAYBACK)
/** RenderAudio() ********************************************/ /** RenderAudio() ********************************************/
/** Render given number of melodic sound samples into an **/ /** Render given number of melodic sound samples into an **/
/** integer buffer for mixing. **/ /** integer buffer for mixing. **/
...@@ -839,4 +810,3 @@ unsigned int RenderAndPlayAudio(unsigned int Samples) ...@@ -839,4 +810,3 @@ unsigned int RenderAndPlayAudio(unsigned int Samples)
/* Return number of samples rendered */ /* Return number of samples rendered */
return(I); return(I);
} }
#endif /* !NO_AUDIO_PLAYBACK */
...@@ -150,22 +150,6 @@ void MIDITicks(int N); ...@@ -150,22 +150,6 @@ void MIDITicks(int N);
#define SND_CHANNELS MIDI_CHANNELS /* Default number */ #define SND_CHANNELS MIDI_CHANNELS /* Default number */
#endif #endif
/** SndDriver ************************************************/
/** Each sound driver should fill this structure with **/
/** pointers to hardware-dependent handlers. This has to be **/
/** done inside the InitSound() function. **/
/*************************************************************/
struct SndDriverStruct
{
void (*SetSound)(int Channel,int NewType);
void (*Drum)(int Type,int Force);
void (*SetChannels)(int Volume,int Switch);
void (*Sound)(int Channel,int NewFreq,int NewVolume);
void (*SetWave)(int Channel,const signed char *Data,int Length,int Freq);
const signed char *(*GetWave)(int Channel);
};
extern struct SndDriverStruct SndDriver;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -105,9 +105,6 @@ const char *DSKName[MAXDRIVES] = { "DRIVEA.DSK","DRIVEB.DSK" }; ...@@ -105,9 +105,6 @@ const char *DSKName[MAXDRIVES] = { "DRIVEA.DSK","DRIVEB.DSK" };
/** Soundtrack logging ***************************************/ /** Soundtrack logging ***************************************/
const char *SndName = "LOG.MID"; /* Sound log file */ const char *SndName = "LOG.MID"; /* Sound log file */
/** Emulation state saving ***********************************/
const char *STAName = "DEFAULT.STA";/* State file (autogen-d)*/
/** Fixed font used by fMSX **********************************/ /** Fixed font used by fMSX **********************************/
const char *FNTName = "DEFAULT.FNT"; /* Font file for text */ const char *FNTName = "DEFAULT.FNT"; /* Font file for text */
byte *FontBuf; /* Font for text modes */ byte *FontBuf; /* Font for text modes */
......
...@@ -257,7 +257,6 @@ extern const char *SndName; /* Soundtrack log file */ ...@@ -257,7 +257,6 @@ extern const char *SndName; /* Soundtrack log file */
extern const char *PrnName; /* Printer redir. file */ extern const char *PrnName; /* Printer redir. file */
extern const char *CasName; /* Tape image file */ extern const char *CasName; /* Tape image file */
extern const char *ComName; /* Serial redir. file */ extern const char *ComName; /* Serial redir. file */
extern const char *STAName; /* State save name */
extern const char *FNTName; /* Font file for text */ extern const char *FNTName; /* Font file for text */
extern FDIDisk FDD[4]; /* Floppy disk images */ extern FDIDisk FDD[4]; /* Floppy disk images */
...@@ -281,12 +280,6 @@ void TrashMSX(void); ...@@ -281,12 +280,6 @@ void TrashMSX(void);
/*************************************************************/ /*************************************************************/
int ResetMSX(int NewMode,int NewRAMPages,int NewVRAMPages); int ResetMSX(int NewMode,int NewRAMPages,int NewVRAMPages);
/** MenuMSX() ************************************************/
/** Invoke a menu system allowing to configure the emulator **/
/** and perform several common tasks. **/
/*************************************************************/
void MenuMSX(void);
/** LoadFile() ***********************************************/ /** LoadFile() ***********************************************/
/** Simple utility function to load cartridge, state, font **/ /** Simple utility function to load cartridge, state, font **/
/** or a disk image, based on the file extension, etc. **/ /** or a disk image, based on the file extension, etc. **/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment