[Scummvm-cvs-logs] SF.net SVN: scummvm:[51671] scummvm/trunk/sound/softsynth
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Aug 3 02:02:46 CEST 2010
Revision: 51671
http://scummvm.svn.sourceforge.net/scummvm/?rev=51671&view=rev
Author: fingolfin
Date: 2010-08-03 00:02:46 +0000 (Tue, 03 Aug 2010)
Log Message:
-----------
SOUND: Constify waveform table; slightly simplify code
Modified Paths:
--------------
scummvm/trunk/sound/softsynth/sid.cpp
scummvm/trunk/sound/softsynth/sid.h
scummvm/trunk/sound/softsynth/wave6581.cpp
Modified: scummvm/trunk/sound/softsynth/sid.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/sid.cpp 2010-08-02 23:03:04 UTC (rev 51670)
+++ scummvm/trunk/sound/softsynth/sid.cpp 2010-08-03 00:02:46 UTC (rev 51671)
@@ -46,11 +46,6 @@
WaveformGenerator::WaveformGenerator() {
sync_source = this;
- wave__ST = wave6581__ST;
- wave_P_T = wave6581_P_T;
- wave_PS_ = wave6581_PS_;
- wave_PST = wave6581_PST;
-
reset();
}
@@ -226,19 +221,19 @@
// Combined waveforms:
RESID_INLINE reg12 WaveformGenerator::output__ST() {
- return wave__ST[output__S_()] << 4;
+ return wave6581__ST[output__S_()] << 4;
}
RESID_INLINE reg12 WaveformGenerator::output_P_T() {
- return (wave_P_T[output___T() >> 1] << 4) & output_P__();
+ return (wave6581_P_T[output___T() >> 1] << 4) & output_P__();
}
RESID_INLINE reg12 WaveformGenerator::output_PS_() {
- return (wave_PS_[output__S_()] << 4) & output_P__();
+ return (wave6581_PS_[output__S_()] << 4) & output_P__();
}
RESID_INLINE reg12 WaveformGenerator::output_PST() {
- return (wave_PST[output__S_()] << 4) & output_P__();
+ return (wave6581_PST[output__S_()] << 4) & output_P__();
}
// Combined waveforms including noise:
Modified: scummvm/trunk/sound/softsynth/sid.h
===================================================================
--- scummvm/trunk/sound/softsynth/sid.h 2010-08-02 23:03:04 UTC (rev 51670)
+++ scummvm/trunk/sound/softsynth/sid.h 2010-08-03 00:02:46 UTC (rev 51671)
@@ -118,16 +118,11 @@
reg12 outputNPST();
// Sample data for combinations of waveforms.
- static reg8 wave6581__ST[];
- static reg8 wave6581_P_T[];
- static reg8 wave6581_PS_[];
- static reg8 wave6581_PST[];
+ static const reg8 wave6581__ST[];
+ static const reg8 wave6581_P_T[];
+ static const reg8 wave6581_PS_[];
+ static const reg8 wave6581_PST[];
- reg8* wave__ST;
- reg8* wave_P_T;
- reg8* wave_PS_;
- reg8* wave_PST;
-
friend class Voice;
friend class SID;
};
Modified: scummvm/trunk/sound/softsynth/wave6581.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/wave6581.cpp 2010-08-02 23:03:04 UTC (rev 51670)
+++ scummvm/trunk/sound/softsynth/wave6581.cpp 2010-08-03 00:02:46 UTC (rev 51671)
@@ -32,11 +32,9 @@
#include "sid.h"
-namespace Resid
-{
+namespace Resid {
-reg8 WaveformGenerator::wave6581__ST[] =
-{
+const reg8 WaveformGenerator::wave6581__ST[] = {
/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -551,8 +549,7 @@
/* 0xff8: */ 0x3e, 0x3e, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f,
};
-reg8 WaveformGenerator::wave6581_P_T[] =
-{
+const reg8 WaveformGenerator::wave6581_P_T[] = {
/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1067,8 +1064,7 @@
/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-reg8 WaveformGenerator::wave6581_PS_[] =
-{
+const reg8 WaveformGenerator::wave6581_PS_[] = {
/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1583,8 +1579,7 @@
/* 0xff8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
};
-reg8 WaveformGenerator::wave6581_PST[] =
-{
+const reg8 WaveformGenerator::wave6581_PST[] = {
/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list