remove MOS8580

..sound nearly the same but need too much resources
master
Frank Bösing 8 years ago
parent a40e411a82
commit ee02b07d33
  1. 13
      reSID.cpp
  2. 10
      reSID.h
  3. 8
      reSID/extfilt.cc
  4. 2
      reSID/extfilt.h
  5. 19
      reSID/filter.cc
  6. 6
      reSID/filter.h
  7. 3
      reSID/sid.cc
  8. 2
      reSID/sid.h
  9. 2
      reSID/siddefs.h
  10. 9
      reSID/voice.cc
  11. 2
      reSID/voice.h
  12. 13
      reSID/wave.cc
  13. 2
      reSID/wave.h
  14. 8
      sid.cpp

@ -11,7 +11,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
The helix decoder itself as a different license, look at the subdirectories for more info.
Diese Bibliothek ist freie Software: Sie können es unter den Bedingungen
der GNU General Public License, wie von der Free Software Foundation,
Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren
@ -22,23 +22,21 @@
Siehe die GNU General Public License für weitere Details.
Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
Der Helixdecoder selbst hat eine eigene Lizenz, bitte für mehr Informationen
in den Unterverzeichnissen nachsehen.
*/
#include "reSID.h"
#include <AudioStream.h>
#define OVERSAMPLE 20
#define OVERSAMPLE 23
static SID sid;
void AudioPlaySID::begin(void)
{
this->reset();
sid.set_sampling_parameters(OVERSAMPLE * 44117, SAMPLE_FAST, 44117);
sid.set_sampling_parameters(OVERSAMPLE * AUDIO_SAMPLE_RATE_EXACT, SAMPLE_FAST, AUDIO_SAMPLE_RATE_EXACT);
//sid.set_chip_model(MOS6581);
sid.set_chip_model(MOS8580);
//sid.set_chip_model(MOS8580);
playing = true;
}
@ -54,6 +52,7 @@ void AudioPlaySID::stop(void)
__enable_irq();
}
//inline
void AudioPlaySID::setreg(int ofs, int val) {
sid.write(ofs, val);
}

@ -11,7 +11,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
The helix decoder itself as a different license, look at the subdirectories for more info.
Diese Bibliothek ist freie Software: Sie können es unter den Bedingungen
der GNU General Public License, wie von der Free Software Foundation,
Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren
@ -22,8 +22,7 @@
Siehe die GNU General Public License für weitere Details.
Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
Der Helixdecoder selbst hat eine eigene Lizenz, bitte für mehr Informationen
in den Unterverzeichnissen nachsehen.
*/
#include "sid.h"
@ -37,13 +36,14 @@ class AudioPlaySID : public AudioStream
public:
AudioPlaySID(void) : AudioStream(0, NULL) { begin(); }
void begin(void);
void setreg(int ofs, int val);
//inline
void setreg(int ofs, int val);// { sid.write(ofs, val);}
void reset(void);
void stop(void);
bool isPlaying(void) { return playing; }
virtual void update(void);
private:
volatile bool playing;
virtual void update(void);
};

@ -30,7 +30,10 @@ ExternalFilter::ExternalFilter()
reset();
enable_filter(true);
set_sampling_parameter(15915.6);
set_chip_model(MOS6581);
//set_chip_model(MOS6581);
{//instead:
mixer_DC = ((((0x800 - 0x380) + 0x800)*0xff*3 - 0xfff*0xff/18) >> 7)*0x0f;
}
}
@ -65,6 +68,7 @@ void ExternalFilter::set_sampling_parameter(float pass_freq)
// ----------------------------------------------------------------------------
// Set chip model.
// ----------------------------------------------------------------------------
/*
void ExternalFilter::set_chip_model(chip_model model)
{
if (model == MOS6581) {
@ -78,7 +82,7 @@ void ExternalFilter::set_chip_model(chip_model model)
mixer_DC = 0;
}
}
*/
// ----------------------------------------------------------------------------
// SID reset.

@ -44,7 +44,7 @@ public:
void enable_filter(bool enable);
void set_sampling_parameter(float pass_freq);
void set_chip_model(chip_model model);
//void set_chip_model(chip_model model);
RESID_INLINE void clock(sound_sample Vi);
RESID_INLINE void clock(cycle_count delta_t, sound_sample Vi);

@ -80,7 +80,7 @@ const fc_point Filter::f0_points_6581[] =
{ 2047, 18000 }, // 0xff 0x07
{ 2047, 18000 } // 0xff 0x07 - repeated end point
};
/*
const fc_point Filter::f0_points_8580[] =
{
// FC f FCHI FCLO
@ -105,7 +105,7 @@ const fc_point Filter::f0_points_8580[] =
{ 2047, 12500 }, // 0xff 0x07
{ 2047, 12500 } // 0xff 0x07 - repeated end point
};
*/
// ----------------------------------------------------------------------------
// Constructor.
@ -136,11 +136,22 @@ Filter::Filter()
interpolate(f0_points_6581, f0_points_6581
+ sizeof(f0_points_6581)/sizeof(*f0_points_6581) - 1,
PointPlotter<sound_sample>(f0_6581), 1.0);
/*
interpolate(f0_points_8580, f0_points_8580
+ sizeof(f0_points_8580)/sizeof(*f0_points_8580) - 1,
PointPlotter<sound_sample>(f0_8580), 1.0);
*/
// set_chip_model(MOS6581);
{//instead:
mixer_DC = -0xfff*0xff/18 >> 7;
set_chip_model(MOS6581);
f0 = f0_6581;
f0_points = f0_points_6581;
f0_count = sizeof(f0_points_6581)/sizeof(*f0_points_6581);
set_w0();
set_Q();
}
}
@ -156,6 +167,7 @@ void Filter::enable_filter(bool enable)
// ----------------------------------------------------------------------------
// Set chip model.
// ----------------------------------------------------------------------------
/*
void Filter::set_chip_model(chip_model model)
{
if (model == MOS6581) {
@ -187,6 +199,7 @@ void Filter::set_chip_model(chip_model model)
set_w0();
set_Q();
}
*/
// ----------------------------------------------------------------------------

@ -126,7 +126,7 @@ public:
Filter();
void enable_filter(bool enable);
void set_chip_model(chip_model model);
// void set_chip_model(chip_model model);
RESID_INLINE
void clock(sound_sample voice1, sound_sample voice2, sound_sample voice3,
@ -191,10 +191,10 @@ protected:
// Cutoff frequency tables.
// FC is an 11 bit register.
sound_sample f0_6581[2048];
sound_sample f0_8580[2048];
//sound_sample f0_8580[2048];
sound_sample* f0;
const static fc_point f0_points_6581[];
const static fc_point f0_points_8580[];
//const static fc_point f0_points_8580[];
const fc_point* f0_points;
int f0_count;

@ -74,6 +74,7 @@ SID::~SID()
// ----------------------------------------------------------------------------
// Set chip model.
// ----------------------------------------------------------------------------
/*
void SID::set_chip_model(chip_model model)
{
voice[0].set_chip_model(model);
@ -83,7 +84,7 @@ void SID::set_chip_model(chip_model model)
filter.set_chip_model(model);
extfilt.set_chip_model(model);
}
*/
// ----------------------------------------------------------------------------
// SID reset.

@ -34,7 +34,7 @@ public:
SID();
~SID();
void set_chip_model(chip_model model);
//void set_chip_model(chip_model model);
void enable_filter(bool enable);
void enable_external_filter(bool enable);
bool set_sampling_parameters(float clock_freq, sampling_method method,

@ -66,7 +66,7 @@ typedef int cycle_count;
typedef int sound_sample;
typedef sound_sample fc_point[2];
enum chip_model { MOS6581, MOS8580 };
//enum chip_model { MOS6581, MOS8580 };
enum sampling_method { SAMPLE_FAST, SAMPLE_INTERPOLATE,
SAMPLE_RESAMPLE_INTERPOLATE, SAMPLE_RESAMPLE_FAST };

@ -28,12 +28,17 @@ RESID_NAMESPACE_START
Voice::Voice()
: muted(false)
{
set_chip_model(MOS6581);
//set_chip_model(MOS6581);
{//instead:
wave_zero = 0x380;
voice_DC = 0x800*0xff;
}
}
// ----------------------------------------------------------------------------
// Set chip model.
// ----------------------------------------------------------------------------
/*
void Voice::set_chip_model(chip_model model)
{
wave.set_chip_model(model);
@ -107,7 +112,7 @@ void Voice::set_chip_model(chip_model model)
voice_DC = 0;
}
}
*/
// ----------------------------------------------------------------------------
// Set sync source.
// ----------------------------------------------------------------------------

@ -31,7 +31,7 @@ class Voice
public:
Voice();
void set_chip_model(chip_model model);
// void set_chip_model(chip_model model);
void set_sync_source(Voice*);
void reset();
void mute(bool enable);

@ -29,8 +29,13 @@ WaveformGenerator::WaveformGenerator()
{
sync_source = this;
set_chip_model(MOS6581);
// set_chip_model(MOS6581);
{//instead:
wave__ST = &wave6581__ST[0];
wave_P_T = &wave6581_P_T[0];
wave_PS_ = &wave6581_PS_[0];
wave_PST = &wave6581_PST[0];
}
reset();
}
@ -48,6 +53,7 @@ void WaveformGenerator::set_sync_source(WaveformGenerator* source)
// ----------------------------------------------------------------------------
// Set chip model.
// ----------------------------------------------------------------------------
/*
void WaveformGenerator::set_chip_model(chip_model model)
{
if (model == MOS6581) {
@ -62,9 +68,8 @@ void WaveformGenerator::set_chip_model(chip_model model)
wave_PS_ = &wave8580_PS_[0];
wave_PST = &wave8580_PST[0];
}
}
*/
// ----------------------------------------------------------------------------
// Register functions.

@ -38,7 +38,7 @@ public:
WaveformGenerator();
void set_sync_source(WaveformGenerator*);
void set_chip_model(chip_model model);
//void set_chip_model(chip_model model);
RESID_INLINE void clock();
RESID_INLINE void clock(cycle_count delta_t);

@ -11,7 +11,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library. If not, see <http://www.gnu.org/licenses/>.
The helix decoder itself as a different license, look at the subdirectories for more info.
Diese Bibliothek ist freie Software: Sie können es unter den Bedingungen
der GNU General Public License, wie von der Free Software Foundation,
Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren
@ -22,8 +22,7 @@
Siehe die GNU General Public License für weitere Details.
Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
Der Helixdecoder selbst hat eine eigene Lizenz, bitte für mehr Informationen
in den Unterverzeichnissen nachsehen.
*/
#include "reSID/envelope.cc"
@ -39,11 +38,12 @@
#include "reSID/wave6581_PS_.cc"
#include "reSID/wave6581_PST.cc"
/*
#include "reSID/wave8580__ST.cc"
#include "reSID/wave8580_P_T.cc"
#include "reSID/wave8580_PS_.cc"
#include "reSID/wave8580_PST.cc"
*/
#include "reSID/wave.cc"
#include "reSID/sid.cc"
Loading…
Cancel
Save