som changes to make Palm OS happy
svn-id: r7216
This commit is contained in:
parent
4ce574f579
commit
1be2d3076f
11 changed files with 46 additions and 14 deletions
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "chunk.h"
|
#include "chunk.h"
|
||||||
|
|
||||||
#include "common/engine.h"
|
#include "common/engine.h"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
void smush_decode_codec1(byte *dst, byte *src, int height) {
|
void smush_decode_codec1(byte *dst, byte *src, int height) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "codec37.h"
|
#include "codec37.h"
|
||||||
|
|
||||||
#include "common/engine.h"
|
#include "common/engine.h"
|
||||||
|
@ -30,8 +30,7 @@ void Codec37Decoder::init(int width, int height) {
|
||||||
_height = height;
|
_height = height;
|
||||||
_frameSize = _width * _height;
|
_frameSize = _width * _height;
|
||||||
_deltaSize = _frameSize * 3 + 0x13600;
|
_deltaSize = _frameSize * 3 + 0x13600;
|
||||||
_deltaBuf = new byte[_deltaSize];
|
_deltaBuf = (byte *)calloc(_deltaSize, sizeof(byte));
|
||||||
memset(_deltaBuf, 0, _deltaSize);
|
|
||||||
if(_deltaBuf == 0)
|
if(_deltaBuf == 0)
|
||||||
error("unable to allocate decoder buffer");
|
error("unable to allocate decoder buffer");
|
||||||
_deltaBufs[0] = _deltaBuf + 0x4D80;
|
_deltaBufs[0] = _deltaBuf + 0x4D80;
|
||||||
|
@ -64,7 +63,7 @@ void Codec37Decoder::deinit() {
|
||||||
_tableLastIndex = -1;
|
_tableLastIndex = -1;
|
||||||
}
|
}
|
||||||
if(_deltaBuf) {
|
if(_deltaBuf) {
|
||||||
delete []_deltaBuf;
|
free(_deltaBuf);
|
||||||
_deltaSize = 0;
|
_deltaSize = 0;
|
||||||
_deltaBuf = 0;
|
_deltaBuf = 0;
|
||||||
_deltaBufs[0] = 0;
|
_deltaBufs[0] = 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "codec47.h"
|
#include "codec47.h"
|
||||||
|
|
||||||
#include "common/engine.h"
|
#include "common/engine.h"
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
(dst)[1] = (src)[1]; \
|
(dst)[1] = (src)[1]; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
#else /* SCUMM_NEED_ALIGNMENT */
|
#else /* SCUMM_NEED_ALIGNMENT */
|
||||||
|
|
||||||
#define COPY_4X1_LINE(dst, src) \
|
#define COPY_4X1_LINE(dst, src) \
|
||||||
|
@ -64,6 +65,10 @@
|
||||||
(dst)[1] = val; \
|
(dst)[1] = val; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
#ifdef __PALM_OS__
|
||||||
|
static int32 *codec37_table;
|
||||||
|
static int16 *codec47_table;
|
||||||
|
#else
|
||||||
static int32 codec37_table[] = {
|
static int32 codec37_table[] = {
|
||||||
0, 1, 2, 3, 3, 3,
|
0, 1, 2, 3, 3, 3,
|
||||||
3, 2, 1, 0, 0, 0,
|
3, 2, 1, 0, 0, 0,
|
||||||
|
@ -260,6 +265,7 @@ static int16 codec47_table[] = {
|
||||||
23, 36, -19, 39, 16, 40, -13, 41, 9, 42,
|
23, 36, -19, 39, 16, 40, -13, 41, 9, 42,
|
||||||
-6, 43, 1, 43, 0, 0, 0, 0, 0, 0
|
-6, 43, 1, 43, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
void Codec47Decoder::makeTables37(int32 param) {
|
void Codec47Decoder::makeTables37(int32 param) {
|
||||||
int32 variable1, variable2;
|
int32 variable1, variable2;
|
||||||
|
@ -669,6 +675,10 @@ void Codec47Decoder::init(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Codec47Decoder::Codec47Decoder() {
|
Codec47Decoder::Codec47Decoder() {
|
||||||
|
#ifdef __PALM_OS__
|
||||||
|
_tableBig = (byte *)calloc(99328, sizeof(byte));
|
||||||
|
_tableSmall = (byte *)calloc(32768, sizeof(byte));
|
||||||
|
#endif
|
||||||
_deltaBuf = 0;
|
_deltaBuf = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,6 +695,10 @@ void Codec47Decoder::deinit() {
|
||||||
|
|
||||||
Codec47Decoder::~Codec47Decoder() {
|
Codec47Decoder::~Codec47Decoder() {
|
||||||
deinit();
|
deinit();
|
||||||
|
#ifdef __PALM_OS__
|
||||||
|
free(_tableBig);
|
||||||
|
free(_tableSmall);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Codec47Decoder::decode(byte *dst, const byte *src) {
|
bool Codec47Decoder::decode(byte *dst, const byte *src) {
|
||||||
|
@ -748,3 +762,15 @@ bool Codec47Decoder::decode(byte *dst, const byte *src) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __PALM_OS__
|
||||||
|
#include "scumm_globals.h" // init globals
|
||||||
|
void Codec47_initGlobals() {
|
||||||
|
GSETPTR(codec37_table, GBVARS_CODEC37TABLE_INDEX, int32 , GBVARS_SCUMM)
|
||||||
|
GSETPTR(codec47_table, GBVARS_CODEC47TABLE_INDEX, int16 , GBVARS_SCUMM)
|
||||||
|
}
|
||||||
|
void Codec47_releaseGlobals() {
|
||||||
|
GRELEASEPTR(GBVARS_CODEC37TABLE_INDEX , GBVARS_SCUMM)
|
||||||
|
GRELEASEPTR(GBVARS_CODEC47TABLE_INDEX , GBVARS_SCUMM)
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -36,8 +36,13 @@ private:
|
||||||
const byte *_d_src, *_paramPtr;
|
const byte *_d_src, *_paramPtr;
|
||||||
int _d_pitch;
|
int _d_pitch;
|
||||||
int32 _offset1, _offset2;
|
int32 _offset1, _offset2;
|
||||||
|
#ifdef __PALM_OS__
|
||||||
|
byte *_tableBig;
|
||||||
|
byte *_tableSmall;
|
||||||
|
#else
|
||||||
byte _tableBig[99328];
|
byte _tableBig[99328];
|
||||||
byte _tableSmall[32768];
|
byte _tableSmall[32768];
|
||||||
|
#endif
|
||||||
int16 _table[256];
|
int16 _table[256];
|
||||||
int32 _frameSize;
|
int32 _frameSize;
|
||||||
int _width, _height;
|
int _width, _height;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
#include "chunk.h"
|
#include "chunk.h"
|
||||||
#include "chunk_type.h"
|
#include "chunk_type.h"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
#include "chunk.h"
|
#include "chunk.h"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/engine.h"
|
#include "common/engine.h"
|
||||||
#include "common/file.h"
|
#include "common/file.h"
|
||||||
|
@ -34,6 +34,8 @@ SmushFont::SmushFont(bool use_original_colors, bool new_colors) :
|
||||||
_original(use_original_colors) {
|
_original(use_original_colors) {
|
||||||
for(int i = 0; i < 256; i++)
|
for(int i = 0; i < 256; i++)
|
||||||
_chars[i].chr = NULL;
|
_chars[i].chr = NULL;
|
||||||
|
|
||||||
|
_dataSrc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SmushFont::~SmushFont() {
|
SmushFont::~SmushFont() {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "smush_mixer.h"
|
#include "smush_mixer.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "sound/mixer.h"
|
#include "sound/mixer.h"
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdafx.h>
|
#include "stdafx.h"
|
||||||
#include "common/file.h"
|
#include "common/file.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/engine.h"
|
#include "common/engine.h"
|
||||||
|
@ -384,7 +384,7 @@ void SmushPlayer::handleImuseAction(Chunk &b) {
|
||||||
int flags = b.getWord();
|
int flags = b.getWord();
|
||||||
int unknown = b.getShort();
|
int unknown = b.getShort();
|
||||||
int track_flags = b.getWord();
|
int track_flags = b.getWord();
|
||||||
|
|
||||||
if (flags != 46)
|
if (flags != 46)
|
||||||
return;
|
return;
|
||||||
assert(flags == 46 && unknown == 0);
|
assert(flags == 46 && unknown == 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue