mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
No more needed
svn-id: r12245
This commit is contained in:
parent
1fab23ad20
commit
a6f378aee2
@ -132,10 +132,8 @@ void Player_V1::parseSpeakerChunk() {
|
||||
|
||||
parse_again:
|
||||
_chunk_type = READ_LE_UINT16(_next_chunk);
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "parseSpeakerChunk: sound %d, offset %4x, chunk %x",
|
||||
_current_nr, _next_chunk - _current_data, _chunk_type);
|
||||
#endif
|
||||
|
||||
_next_chunk += 2;
|
||||
switch (_chunk_type) {
|
||||
@ -171,10 +169,8 @@ void Player_V1::parseSpeakerChunk() {
|
||||
_repeat_ctr = READ_LE_UINT16(_next_chunk + 8);
|
||||
_channels[0].freq = _start;
|
||||
_next_chunk += 10;
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "chunk 1: mplex %d, freq %d -> %d step %d x %d",
|
||||
_mplex, _start, _end, _delta, _repeat_ctr);
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
_start = READ_LE_UINT16(_next_chunk);
|
||||
@ -183,10 +179,8 @@ void Player_V1::parseSpeakerChunk() {
|
||||
_channels[0].freq = 0;
|
||||
_next_chunk += 6;
|
||||
_forced_level = -1;
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "chunk 2: %d -> %d step %d",
|
||||
_start, _end, _delta);
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
_start = READ_LE_UINT16(_next_chunk);
|
||||
@ -195,10 +189,8 @@ void Player_V1::parseSpeakerChunk() {
|
||||
_channels[0].freq = 0;
|
||||
_next_chunk += 6;
|
||||
_forced_level = -1;
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "chunk 3: %d -> %d step %d",
|
||||
_start, _end, _delta);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -216,18 +208,14 @@ void Player_V1::nextSpeakerCmd() {
|
||||
_time_left = READ_LE_UINT16(_next_chunk);
|
||||
_next_chunk += 2;
|
||||
}
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "nextSpeakerCmd: chunk %d, offset %4x: notelen %d",
|
||||
_chunk_type, _next_chunk - 2 - _current_data, _time_left);
|
||||
#endif
|
||||
if (_time_left == 0) {
|
||||
parseSpeakerChunk();
|
||||
} else {
|
||||
_channels[0].freq = READ_LE_UINT16(_next_chunk);
|
||||
_next_chunk += 2;
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "freq_current: %d", _channels[0].freq);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@ -276,10 +264,8 @@ void Player_V1::parsePCjrChunk() {
|
||||
parse_again:
|
||||
|
||||
_chunk_type = READ_LE_UINT16(_next_chunk);
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x",
|
||||
_current_nr, _next_chunk - _current_data, _chunk_type);
|
||||
#endif
|
||||
|
||||
_next_chunk += 2;
|
||||
switch (_chunk_type) {
|
||||
@ -364,11 +350,9 @@ parse_again:
|
||||
}
|
||||
*_value_ptr_2 = _start_2;
|
||||
}
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "chunk 1: %d: %d step %d for %d, %d: %d step %d for %d",
|
||||
_value_ptr - (uint*)_channels, _start, _delta, _time_left,
|
||||
_value_ptr_2 - (uint*)_channels, _start_2, _delta_2, _time_left_2);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -378,10 +362,8 @@ parse_again:
|
||||
_channels[0].freq = 0;
|
||||
_next_chunk += 6;
|
||||
_forced_level = -1;
|
||||
#ifndef __PALM_OS__
|
||||
debug(6, "chunk 2: %d -> %d step %d",
|
||||
_start, _end, _delta);
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
set_mplex(READ_LE_UINT16(_next_chunk));
|
||||
@ -425,10 +407,8 @@ void Player_V1::nextPCjrCmd() {
|
||||
_channels[i].hull_counter = 1;
|
||||
_channels[i].freq = dummy;
|
||||
}
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "chunk 0: channel %d play %d for %d",
|
||||
i, dummy, _channels[i].notelen);
|
||||
#endif
|
||||
_channels[i].cmd_ptr += 4;
|
||||
}
|
||||
|
||||
@ -502,9 +482,7 @@ void Player_V1::nextPCjrCmd() {
|
||||
return;
|
||||
}
|
||||
set_mplex(_start);
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "chunk 2: mplex %d curve %d", _start, _forced_level);
|
||||
#endif
|
||||
_forced_level = -_forced_level;
|
||||
break;
|
||||
case 3:
|
||||
@ -553,18 +531,14 @@ void Player_V1::generateSpkSamples(int16 *data, uint len) {
|
||||
int sample = _forced_level * _volumetable[0];
|
||||
for (i = 0; i < len; i++)
|
||||
data[2*i] = data[2*i+1] = sample;
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "speaker: %8x: forced one", _tick_len);
|
||||
#endif
|
||||
} else if (!_level) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
squareGenerator(0, _channels[0].freq, 0, 0, data, len);
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "speaker: %8x: freq %d %.1f", _tick_len,
|
||||
_channels[0].freq, 1193000.0 / _channels[0].freq);
|
||||
#endif
|
||||
}
|
||||
lowPassFilter(data, len);
|
||||
}
|
||||
@ -581,9 +555,7 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
||||
for (i = 0; i < len; i++)
|
||||
data[2*i] = data[2*i+1] = sample;
|
||||
hasdata = true;
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "channel[4]: %8x: forced one", _tick_len);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 1; i < 3; i++) {
|
||||
@ -614,10 +586,8 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
||||
} else if (i < 3) {
|
||||
hasdata = true;
|
||||
squareGenerator(i, freq, vol, 0, data, len);
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "channel[%d]: %8x: freq %d %.1f ; volume %d",
|
||||
i, _tick_len, freq, 111860.0 / freq, vol);
|
||||
#endif
|
||||
} else {
|
||||
int noiseFB = (freq & 4) ? FB_WNOISE : FB_PNOISE;
|
||||
int n = (freq & 3);
|
||||
@ -625,10 +595,8 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
||||
freq = (n == 3) ? 2 * (_channels[2].freq) : 1 << (5 + n);
|
||||
hasdata = true;
|
||||
squareGenerator(i, freq, vol, noiseFB, data, len);
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "channel[%d]: %x: noise freq %d %.1f ; volume %d",
|
||||
i, _tick_len, freq, 111860.0 / freq, vol);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -636,4 +604,4 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
||||
lowPassFilter(data, len);
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
||||
} // End of namespace Scumm
|
@ -42,14 +42,14 @@ namespace Scumm {
|
||||
#define FB_PNOISE 0x08000 /* feedback for periodic noise */
|
||||
|
||||
#ifdef __PALM_OS__
|
||||
const uint8 *g_note_lengths;
|
||||
static const uint16 *g_hull_offsets;
|
||||
static const int16 *g_hulls;
|
||||
static const uint16 *g_freqmod_lengths;
|
||||
static const uint16 *g_freqmod_offsets;
|
||||
static const int8 *g_freqmod_table;
|
||||
static const uint16 *g_spk_freq_table;
|
||||
static const uint16 *g_pcjr_freq_table;
|
||||
const uint8 *note_lengths;
|
||||
static const uint16 *hull_offsets;
|
||||
static const int16 *hulls;
|
||||
static const uint16 *freqmod_lengths;
|
||||
static const uint16 *freqmod_offsets;
|
||||
static const int8 *freqmod_table;
|
||||
static const uint16 *spk_freq_table;
|
||||
static const uint16 *pcjr_freq_table;
|
||||
#else
|
||||
const uint8 note_lengths[] = {
|
||||
0,
|
||||
@ -344,17 +344,6 @@ static const uint16 pcjr_freq_table[12] = {
|
||||
Player_V2::Player_V2(ScummEngine *scumm, bool pcjr) {
|
||||
int i;
|
||||
|
||||
#ifdef __PALM_OS__
|
||||
note_lengths = g_note_lengths;
|
||||
hull_offsets = g_hull_offsets;
|
||||
hulls = g_hulls;
|
||||
freqmod_lengths = g_freqmod_lengths;
|
||||
freqmod_offsets = g_freqmod_offsets;
|
||||
freqmod_table = g_freqmod_table;
|
||||
spk_freq_table = g_spk_freq_table;
|
||||
pcjr_freq_table = g_pcjr_freq_table;
|
||||
#endif
|
||||
|
||||
_isV3Game = (scumm->_version >= 3);
|
||||
_scumm = scumm;
|
||||
_system = scumm->_system;
|
||||
@ -599,19 +588,15 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
if (opcode >= 0xf8) {
|
||||
switch (opcode) {
|
||||
case 0xf8: // set hull curve
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "channels[%d]: hull curve %2d",
|
||||
channel - _channels, *script_ptr);
|
||||
#endif
|
||||
channel->d.hull_curve = hull_offsets[*script_ptr / 2];
|
||||
script_ptr++;
|
||||
break;
|
||||
|
||||
case 0xf9: // set freqmod curve
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "channels[%d]: freqmod curve %2d",
|
||||
channel - _channels, *script_ptr);
|
||||
#endif
|
||||
channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4];
|
||||
channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4];
|
||||
script_ptr++;
|
||||
@ -619,9 +604,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
|
||||
case 0xfd: // clear other channel
|
||||
value = READ_LE_UINT16 (script_ptr) / sizeof (ChannelInfo);
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "clear channel %d", value);
|
||||
#endif
|
||||
script_ptr += 2;
|
||||
// In Indy3, when traveling to Venice a command is
|
||||
// issued to clear channel 4. So we introduce a 4th
|
||||
@ -637,10 +620,8 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
// fall through
|
||||
|
||||
case 0xfa: // clear current channel
|
||||
#ifndef __PALM_OS__
|
||||
if (opcode == 0xfa)
|
||||
debug(9, "clear channel");
|
||||
#endif
|
||||
channel->d.next_cmd = 0;
|
||||
channel->d.base_freq = 0;
|
||||
channel->d.freq_delta = 0;
|
||||
@ -666,9 +647,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
|
||||
case 0xfc: // call subroutine
|
||||
offset = READ_LE_UINT16 (script_ptr);
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "subroutine %d", offset);
|
||||
#endif
|
||||
script_ptr += 2;
|
||||
_retaddr = script_ptr;
|
||||
script_ptr = _current_data + offset;
|
||||
@ -678,9 +657,7 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
opcode = *script_ptr++;
|
||||
offset = READ_LE_UINT16 (script_ptr);
|
||||
script_ptr += 2;
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "loop if %d to %d", opcode, offset);
|
||||
#endif
|
||||
if (!channel->array[opcode / 2] || --channel->array[opcode/2])
|
||||
script_ptr += offset;
|
||||
break;
|
||||
@ -689,10 +666,8 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
opcode = *script_ptr++;
|
||||
value = READ_LE_UINT16 (script_ptr);
|
||||
channel->array[opcode / 2] = value;
|
||||
#ifndef __PALM_OS__
|
||||
debug(7, "channels[%d]: set param %2d = %5d",
|
||||
channel - &_channels[0], opcode, value);
|
||||
#endif
|
||||
script_ptr += 2;
|
||||
if (opcode == 14) {
|
||||
/* tempo var */
|
||||
@ -731,14 +706,12 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
||||
note = (*script_ptr++) & 0x7f;
|
||||
}
|
||||
|
||||
#ifndef __PALM_OS__
|
||||
debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s",
|
||||
dest_channel - channel, script_ptr ? script_ptr - _current_data - 2 : 0,
|
||||
note, (signed short) dest_channel->d.transpose, channel->d.time_left,
|
||||
dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
|
||||
dest_channel->d.freqmod_incr,dest_channel->d.freqmod_multiplier,
|
||||
is_last_note ? "last":"");
|
||||
#endif
|
||||
|
||||
uint16 myfreq;
|
||||
dest_channel->d.time_left = channel->d.time_left;
|
||||
@ -799,13 +772,11 @@ void Player_V2::next_freqs(ChannelInfo *channel) {
|
||||
* (int) channel->d.freqmod_multiplier / 256
|
||||
+ channel->d.base_freq;
|
||||
|
||||
#ifndef __PALM_OS__
|
||||
debug(9, "Freq: %d/%d, %d/%d/%d*%d %d",
|
||||
channel->d.base_freq, (int16)channel->d.freq_delta,
|
||||
channel->d.freqmod_table, channel->d.freqmod_offset,
|
||||
channel->d.freqmod_incr, channel->d.freqmod_multiplier,
|
||||
channel->d.freq);
|
||||
#endif
|
||||
|
||||
if (channel->d.note_length && !--channel->d.note_length) {
|
||||
channel->d.hull_offset = 16;
|
||||
@ -1019,14 +990,14 @@ void Player_V2::generatePCjrSamples(int16 *data, uint len) {
|
||||
#include "scumm_globals.h"
|
||||
|
||||
_GINIT(PlayerV2)
|
||||
_GSETPTR(Scumm::g_note_lengths, GBVARS_NOTELENGTHS_INDEX, uint8, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_hull_offsets, GBVARS_HULLOFFSETS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_hulls, GBVARS_HULLS_INDEX, int16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_freqmod_lengths, GBVARS_FREQMODLENGTHS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_freqmod_offsets, GBVARS_FREQMODOFFSETS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_freqmod_table, GBVARS_FREQMODTABLE_INDEX, int8, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_spk_freq_table, GBVARS_SPKFREQTABLE_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::g_pcjr_freq_table, GBVARS_PCJRFREQTABLE_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::note_lengths, GBVARS_NOTELENGTHS_INDEX, uint8, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::hull_offsets, GBVARS_HULLOFFSETS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::hulls, GBVARS_HULLS_INDEX, int16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::freqmod_lengths, GBVARS_FREQMODLENGTHS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::freqmod_offsets, GBVARS_FREQMODOFFSETS_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::freqmod_table, GBVARS_FREQMODTABLE_INDEX, int8, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::spk_freq_table, GBVARS_SPKFREQTABLE_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GSETPTR(Scumm::pcjr_freq_table, GBVARS_PCJRFREQTABLE_INDEX, uint16, GBVARS_SCUMM)
|
||||
_GEND
|
||||
|
||||
_GRELEASE(PlayerV2)
|
||||
@ -1040,4 +1011,4 @@ _GRELEASEPTR(GBVARS_SPKFREQTABLE_INDEX, GBVARS_SCUMM)
|
||||
_GRELEASEPTR(GBVARS_PCJRFREQTABLE_INDEX, GBVARS_SCUMM)
|
||||
_GEND
|
||||
|
||||
#endif
|
||||
#endif
|
@ -84,18 +84,6 @@ public:
|
||||
virtual int getMusicTimer() const;
|
||||
virtual int getSoundStatus(int sound) const;
|
||||
|
||||
#ifdef __PALM_OS__
|
||||
private:
|
||||
const uint8 *note_lengths;
|
||||
const uint16 *hull_offsets;
|
||||
const int16 *hulls;
|
||||
const uint16 *freqmod_lengths;
|
||||
const uint16 *freqmod_offsets;
|
||||
const int8 *freqmod_table;
|
||||
const uint16 *spk_freq_table;
|
||||
const uint16 *pcjr_freq_table;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
bool _isV3Game;
|
||||
SoundMixer *_mixer;
|
||||
@ -165,4 +153,4 @@ private:
|
||||
|
||||
} // End of namespace Scumm
|
||||
|
||||
#endif
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user