engines/scumm/*: enabled choosing of the colorpalette, by setting RenderMode to EGA the "old" palette will be used
tfmx/tfmxplayer.cpp: removed some unused stuff sound/mods/tfmx.cpp: emulating the way MI initialises new macro-programms. (Difference might not be audible at all) svn-id: r41976
This commit is contained in:
parent
cf351dffe6
commit
e3a5da7b7e
7 changed files with 97 additions and 219 deletions
|
@ -70,140 +70,80 @@ void ScummEngine::resetPalette() {
|
||||||
else
|
else
|
||||||
setEGAPalette();
|
setEGAPalette();
|
||||||
}
|
}
|
||||||
|
} else if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4) {
|
||||||
|
// if rendermode is set to EGA we use the full palette from the resources
|
||||||
|
// else we initialise and then lock down the first 16 colors.
|
||||||
|
if (_renderMode != Common::kRenderEGA)
|
||||||
|
setAmigaMIPalette();
|
||||||
} else
|
} else
|
||||||
setDirtyColors(0, 255);
|
setDirtyColors(0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setC64Palette() {
|
void ScummEngine::setHardcodedPaletteRGB(const byte *ptr, int numcolor, int index) {
|
||||||
setPalColor( 0, 0x00, 0x00, 0x00);
|
for ( ; numcolor > 0; --numcolor, ++index, ptr += 3)
|
||||||
setPalColor( 1, 0xFD, 0xFE, 0xFC);
|
setPalColor( index, ptr[0], ptr[1], ptr[2]);
|
||||||
setPalColor( 2, 0xBE, 0x1A, 0x24);
|
}
|
||||||
setPalColor( 3, 0x30, 0xE6, 0xC6);
|
|
||||||
setPalColor( 4, 0xB4, 0x1A, 0xE2);
|
|
||||||
setPalColor( 5, 0x1F, 0xD2, 0x1E);
|
|
||||||
setPalColor( 6, 0x21, 0x1B, 0xAE);
|
|
||||||
setPalColor( 7, 0xDF, 0xF6, 0x0A);
|
|
||||||
setPalColor( 8, 0xB8, 0x41, 0x04);
|
|
||||||
setPalColor( 9, 0x6A, 0x33, 0x04);
|
|
||||||
setPalColor(10, 0xFE, 0x4A, 0x57);
|
|
||||||
setPalColor(11, 0x42, 0x45, 0x40);
|
|
||||||
setPalColor(12, 0x70, 0x74, 0x6F);
|
|
||||||
setPalColor(13, 0x59, 0xFE, 0x59);
|
|
||||||
setPalColor(14, 0x5F, 0x53, 0xFE);
|
|
||||||
setPalColor(15, 0xA4, 0xA7, 0xA2);
|
|
||||||
|
|
||||||
|
void ScummEngine::setC64Palette() {
|
||||||
// Use 17 color table for v1 games to allow correct color for inventory and
|
// Use 17 color table for v1 games to allow correct color for inventory and
|
||||||
// sentence line. Original games used some kind of dynamic color table
|
// sentence line. Original games used some kind of dynamic color table
|
||||||
// remapping between rooms.
|
// remapping between rooms.
|
||||||
setPalColor(16, 255, 85, 255);
|
static const byte ctable[] = {
|
||||||
|
0x00, 0x00, 0x00, 0xFD, 0xFE, 0xFC, 0xBE, 0x1A, 0x24, 0x30, 0xE6, 0xC6,
|
||||||
|
0xB4, 0x1A, 0xE2, 0x1F, 0xD2, 0x1E, 0x21, 0x1B, 0xAE, 0xDF, 0xF6, 0x0A,
|
||||||
|
0xB8, 0x41, 0x04, 0x6A, 0x33, 0x04, 0xFE, 0x4A, 0x57, 0x42, 0x45, 0x40,
|
||||||
|
0x70, 0x74, 0x6F, 0x59, 0xFE, 0x59, 0x5F, 0x53, 0xFE, 0xA4, 0xA7, 0xA2,
|
||||||
|
|
||||||
|
0xFF, 0x55, 0xFF
|
||||||
|
};
|
||||||
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setNESPalette() {
|
void ScummEngine::setNESPalette() {
|
||||||
setPalColor(0x00,0x00,0x00,0x00); // 0x1D
|
static const byte ctable[] = {
|
||||||
setPalColor(0x01,0x00,0x24,0x92);
|
/* 0x1D */
|
||||||
setPalColor(0x02,0x00,0x00,0xDB);
|
0x00, 0x00, 0x00, 0x00, 0x24, 0x92, 0x00, 0x00, 0xDB, 0x6D, 0x49, 0xDB,
|
||||||
setPalColor(0x03,0x6D,0x49,0xDB);
|
0x92, 0x00, 0x6D, 0xB6, 0x00, 0x6D, 0xB6, 0x24, 0x00, 0x92, 0x49, 0x00,
|
||||||
setPalColor(0x04,0x92,0x00,0x6D);
|
0x6D, 0x49, 0x00, 0x24, 0x49, 0x00, 0x00, 0x6D, 0x24, 0x00, 0x92, 0x00,
|
||||||
setPalColor(0x05,0xB6,0x00,0x6D);
|
0x00, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
setPalColor(0x06,0xB6,0x24,0x00);
|
|
||||||
setPalColor(0x07,0x92,0x49,0x00);
|
|
||||||
setPalColor(0x08,0x6D,0x49,0x00);
|
|
||||||
setPalColor(0x09,0x24,0x49,0x00);
|
|
||||||
setPalColor(0x0A,0x00,0x6D,0x24);
|
|
||||||
setPalColor(0x0B,0x00,0x92,0x00);
|
|
||||||
setPalColor(0x0C,0x00,0x49,0x49);
|
|
||||||
setPalColor(0x0D,0x00,0x00,0x00);
|
|
||||||
setPalColor(0x0E,0x00,0x00,0x00);
|
|
||||||
setPalColor(0x0F,0x00,0x00,0x00);
|
|
||||||
|
|
||||||
setPalColor(0x10,0xB6,0xB6,0xB6);
|
0xB6, 0xB6, 0xB6, 0x00, 0x6D, 0xDB, 0x00, 0x49, 0xFF, 0x92, 0x00, 0xFF,
|
||||||
setPalColor(0x11,0x00,0x6D,0xDB);
|
0xB6, 0x00, 0xFF, 0xFF, 0x00, 0x92, 0xFF, 0x00, 0x00, 0xDB, 0x6D, 0x00,
|
||||||
setPalColor(0x12,0x00,0x49,0xFF);
|
0x92, 0x6D, 0x00, 0x24, 0x92, 0x00, 0x00, 0x92, 0x00, 0x00, 0xB6, 0x6D,
|
||||||
setPalColor(0x13,0x92,0x00,0xFF);
|
/* 0x00 */
|
||||||
setPalColor(0x14,0xB6,0x00,0xFF);
|
0x00, 0x92, 0x92, 0x6D, 0x6D, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
setPalColor(0x15,0xFF,0x00,0x92);
|
|
||||||
setPalColor(0x16,0xFF,0x00,0x00);
|
|
||||||
setPalColor(0x17,0xDB,0x6D,0x00);
|
|
||||||
setPalColor(0x18,0x92,0x6D,0x00);
|
|
||||||
setPalColor(0x19,0x24,0x92,0x00);
|
|
||||||
setPalColor(0x1A,0x00,0x92,0x00);
|
|
||||||
setPalColor(0x1B,0x00,0xB6,0x6D);
|
|
||||||
setPalColor(0x1C,0x00,0x92,0x92);
|
|
||||||
setPalColor(0x1D,0x6D,0x6D,0x6D); // 0x00
|
|
||||||
setPalColor(0x1E,0x00,0x00,0x00);
|
|
||||||
setPalColor(0x1F,0x00,0x00,0x00);
|
|
||||||
|
|
||||||
setPalColor(0x20,0xFF,0xFF,0xFF);
|
0xFF, 0xFF, 0xFF, 0x6D, 0xB6, 0xFF, 0x92, 0x92, 0xFF, 0xDB, 0x6D, 0xFF,
|
||||||
setPalColor(0x21,0x6D,0xB6,0xFF);
|
0xFF, 0x00, 0xFF, 0xFF, 0x6D, 0xFF, 0xFF, 0x92, 0x00, 0xFF, 0xB6, 0x00,
|
||||||
setPalColor(0x22,0x92,0x92,0xFF);
|
0xDB, 0xDB, 0x00, 0x6D, 0xDB, 0x00, 0x00, 0xFF, 0x00, 0x49, 0xFF, 0xDB,
|
||||||
setPalColor(0x23,0xDB,0x6D,0xFF);
|
0x00, 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
setPalColor(0x24,0xFF,0x00,0xFF);
|
|
||||||
setPalColor(0x25,0xFF,0x6D,0xFF);
|
|
||||||
setPalColor(0x26,0xFF,0x92,0x00);
|
|
||||||
setPalColor(0x27,0xFF,0xB6,0x00);
|
|
||||||
setPalColor(0x28,0xDB,0xDB,0x00);
|
|
||||||
setPalColor(0x29,0x6D,0xDB,0x00);
|
|
||||||
setPalColor(0x2A,0x00,0xFF,0x00);
|
|
||||||
setPalColor(0x2B,0x49,0xFF,0xDB);
|
|
||||||
setPalColor(0x2C,0x00,0xFF,0xFF);
|
|
||||||
setPalColor(0x2D,0x49,0x49,0x49);
|
|
||||||
setPalColor(0x2E,0x00,0x00,0x00);
|
|
||||||
setPalColor(0x2F,0x00,0x00,0x00);
|
|
||||||
|
|
||||||
setPalColor(0x30,0xFF,0xFF,0xFF);
|
0xFF, 0xFF, 0xFF, 0xB6, 0xDB, 0xFF, 0xDB, 0xB6, 0xFF, 0xFF, 0xB6, 0xFF,
|
||||||
setPalColor(0x31,0xB6,0xDB,0xFF);
|
0xFF, 0x92, 0xFF, 0xFF, 0xB6, 0xB6, 0xFF, 0xDB, 0x92, 0xFF, 0xFF, 0x49,
|
||||||
setPalColor(0x32,0xDB,0xB6,0xFF);
|
0xFF, 0xFF, 0x6D, 0xB6, 0xFF, 0x49, 0x92, 0xFF, 0x6D, 0x49, 0xFF, 0xDB,
|
||||||
setPalColor(0x33,0xFF,0xB6,0xFF);
|
0x92, 0xDB, 0xFF, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
setPalColor(0x34,0xFF,0x92,0xFF);
|
};
|
||||||
setPalColor(0x35,0xFF,0xB6,0xB6);
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
setPalColor(0x36,0xFF,0xDB,0x92);
|
|
||||||
setPalColor(0x37,0xFF,0xFF,0x49);
|
|
||||||
setPalColor(0x38,0xFF,0xFF,0x6D);
|
|
||||||
setPalColor(0x39,0xB6,0xFF,0x49);
|
|
||||||
setPalColor(0x3A,0x92,0xFF,0x6D);
|
|
||||||
setPalColor(0x3B,0x49,0xFF,0xDB);
|
|
||||||
setPalColor(0x3C,0x92,0xDB,0xFF);
|
|
||||||
setPalColor(0x3D,0x92,0x92,0x92);
|
|
||||||
setPalColor(0x3E,0x00,0x00,0x00);
|
|
||||||
setPalColor(0x3F,0x00,0x00,0x00);
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void ScummEngine::setAmigaPalette() {
|
|
||||||
setPalColor( 0, 0, 0, 0);
|
|
||||||
setPalColor( 1, 0, 0, 187);
|
|
||||||
setPalColor( 2, 0, 187, 0);
|
|
||||||
setPalColor( 3, 0, 187, 187);
|
|
||||||
setPalColor( 4, 187, 0, 0);
|
|
||||||
setPalColor( 5, 187, 0, 187);
|
|
||||||
setPalColor( 6, 187, 119, 0);
|
|
||||||
setPalColor( 7, 187, 187, 187);
|
|
||||||
setPalColor( 8, 119, 119, 119);
|
|
||||||
setPalColor( 9, 119, 119, 255);
|
|
||||||
setPalColor(10, 0, 255, 0);
|
|
||||||
setPalColor(11, 0, 255, 255);
|
|
||||||
setPalColor(12, 255, 136, 136);
|
|
||||||
setPalColor(13, 255, 0, 255);
|
|
||||||
setPalColor(14, 255, 255, 0);
|
|
||||||
setPalColor(15, 255, 255, 255);
|
|
||||||
} */
|
|
||||||
|
|
||||||
void ScummEngine::setAmigaPalette() {
|
void ScummEngine::setAmigaPalette() {
|
||||||
setPalColor( 0, 0, 0, 0);
|
static const byte ctable[] = {
|
||||||
setPalColor( 1, 0, 0, 170);
|
0x00, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x00, 0xBB, 0x00, 0x00, 0xBB, 0xBB,
|
||||||
setPalColor( 2, 0, 136, 34);
|
0xBB, 0x00, 0x00, 0xBB, 0x00, 0xBB, 0xBB, 0x77, 0x00, 0xBB, 0xBB, 0xBB,
|
||||||
setPalColor( 3, 0, 102, 119);
|
0x77, 0x77, 0x77, 0x77, 0x77, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF,
|
||||||
setPalColor( 4, 187, 102, 102);
|
0xFF, 0x88, 0x88, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF
|
||||||
setPalColor( 5, 170, 34, 170);
|
};
|
||||||
setPalColor( 6, 136, 85, 34);
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
setPalColor( 7, 119, 119, 119);
|
}
|
||||||
setPalColor( 8, 51, 51, 51);
|
|
||||||
setPalColor( 9, 34, 85, 221);
|
void ScummEngine::setAmigaMIPalette() {
|
||||||
setPalColor(10, 34, 221, 68);
|
static const byte ctable[] = {
|
||||||
setPalColor(11, 0, 204, 255);
|
0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x88, 0x22, 0x00, 0x66, 0x77,
|
||||||
setPalColor(12, 255, 153, 153);
|
0xBB, 0x66, 0x66, 0xAA, 0x22, 0xAA, 0x88, 0x55, 0x22, 0x77, 0x77, 0x77,
|
||||||
setPalColor(13, 255, 85, 255);
|
0x33, 0x33, 0x33, 0x22, 0x55, 0xDD, 0x22, 0xDD, 0x44, 0x00, 0xCC, 0xFF,
|
||||||
setPalColor(14, 255, 255, 119);
|
0xFF, 0x99, 0x99, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0x77, 0xFF, 0xFF, 0xFF
|
||||||
setPalColor(15, 255, 255, 255);
|
};
|
||||||
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setHercPalette() {
|
void ScummEngine::setHercPalette() {
|
||||||
|
@ -233,50 +173,32 @@ void ScummEngine::setCGAPalette() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setEGAPalette() {
|
void ScummEngine::setEGAPalette() {
|
||||||
setPalColor( 0, 0, 0, 0);
|
static const byte ctable[] = {
|
||||||
setPalColor( 1, 0, 0, 170);
|
0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0x00, 0xAA, 0xAA,
|
||||||
setPalColor( 2, 0, 170, 0);
|
0xAA, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0xAA, 0x55, 0x00, 0xAA, 0xAA, 0xAA,
|
||||||
setPalColor( 3, 0, 170, 170);
|
0x55, 0x55, 0x55, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0x55, 0x55, 0xFF, 0xFF,
|
||||||
setPalColor( 4, 170, 0, 0);
|
0xFF, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF
|
||||||
setPalColor( 5, 170, 0, 170);
|
};
|
||||||
setPalColor( 6, 170, 85, 0);
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
setPalColor( 7, 170, 170, 170);
|
|
||||||
setPalColor( 8, 85, 85, 85);
|
|
||||||
setPalColor( 9, 85, 85, 255);
|
|
||||||
setPalColor(10, 85, 255, 85);
|
|
||||||
setPalColor(11, 85, 255, 255);
|
|
||||||
setPalColor(12, 255, 85, 85);
|
|
||||||
setPalColor(13, 255, 85, 255);
|
|
||||||
setPalColor(14, 255, 255, 85);
|
|
||||||
setPalColor(15, 255, 255, 255);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setV1Palette() {
|
void ScummEngine::setV1Palette() {
|
||||||
setPalColor( 0, 0, 0, 0);
|
static const byte ctable[] = {
|
||||||
setPalColor( 1, 255, 255, 255);
|
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xAA, 0x00, 0x00, 0x00, 0xAA, 0xAA,
|
||||||
setPalColor( 2, 170, 0, 0);
|
0xAA, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0x00, 0x00, 0xAA, 0xFF, 0xFF, 0x55,
|
||||||
setPalColor( 3, 0, 170, 170);
|
0xFF, 0x55, 0x55, 0xAA, 0x55, 0x00, 0xFF, 0x55, 0x55, 0x55, 0x55, 0x55,
|
||||||
setPalColor( 4, 170, 0, 170);
|
0xAA, 0xAA, 0xAA, 0x55, 0xFF, 0x55, 0x55, 0x55, 0xFF, 0x55, 0x55, 0x55,
|
||||||
setPalColor( 5, 0, 170, 0);
|
|
||||||
setPalColor( 6, 0, 0, 170);
|
0xFF, 0x55, 0xFF
|
||||||
setPalColor( 7, 255, 255, 85);
|
};
|
||||||
setPalColor( 8, 255, 85, 85);
|
setHardcodedPaletteRGB(ctable, ARRAYSIZE(ctable) / 3);
|
||||||
setPalColor( 9, 170, 85, 0);
|
|
||||||
setPalColor(10, 255, 85, 85);
|
|
||||||
setPalColor(11, 85, 85, 85);
|
|
||||||
setPalColor(12, 170, 170, 170);
|
|
||||||
setPalColor(13, 85, 255, 85);
|
|
||||||
setPalColor(14, 85, 85, 255);
|
|
||||||
|
|
||||||
if (_game.id == GID_ZAK)
|
if (_game.id == GID_ZAK)
|
||||||
setPalColor(15, 170, 170, 170);
|
setPalColor(15, 170, 170, 170);
|
||||||
else
|
|
||||||
setPalColor(15, 85, 85, 85);
|
|
||||||
|
|
||||||
setPalColor(16, 255, 85, 255);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
|
void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
|
||||||
|
int firstIndex = 0;
|
||||||
int i;
|
int i;
|
||||||
byte *dest, r, g, b;
|
byte *dest, r, g, b;
|
||||||
|
|
||||||
|
@ -296,7 +218,13 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
|
||||||
|
|
||||||
dest = _currentPalette;
|
dest = _currentPalette;
|
||||||
|
|
||||||
for (i = 0; i < numcolor; i++) {
|
if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4 && _renderMode != Common::kRenderEGA) {
|
||||||
|
firstIndex = 16;
|
||||||
|
dest += 3 * 16;
|
||||||
|
ptr += 3 * 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = firstIndex; i < numcolor; i++) {
|
||||||
r = *ptr++;
|
r = *ptr++;
|
||||||
g = *ptr++;
|
g = *ptr++;
|
||||||
b = *ptr++;
|
b = *ptr++;
|
||||||
|
@ -321,9 +249,7 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
|
||||||
memcpy(_darkenPalette, _currentPalette, 768);
|
memcpy(_darkenPalette, _currentPalette, 768);
|
||||||
}
|
}
|
||||||
|
|
||||||
setAmigaPalette();
|
setDirtyColors(firstIndex, numcolor - 1);
|
||||||
|
|
||||||
setDirtyColors(0, numcolor - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScummEngine::setDirtyColors(int min, int max) {
|
void ScummEngine::setDirtyColors(int min, int max) {
|
||||||
|
|
|
@ -495,7 +495,8 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
|
||||||
case Common::kRenderCGA:
|
case Common::kRenderCGA:
|
||||||
case Common::kRenderEGA:
|
case Common::kRenderEGA:
|
||||||
case Common::kRenderAmiga:
|
case Common::kRenderAmiga:
|
||||||
if ((_game.version >= 4 && !(_game.features & GF_16COLOR)) || (_game.features & GF_OLD256))
|
if ((_game.version >= 4 && !(_game.features & GF_16COLOR) && !(_game.platform == Common::kPlatformAmiga && _renderMode == Common::kRenderEGA))
|
||||||
|
|| (_game.features & GF_OLD256))
|
||||||
_renderMode = Common::kRenderDefault;
|
_renderMode = Common::kRenderDefault;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1017,9 +1017,11 @@ protected:
|
||||||
|
|
||||||
const byte *getPalettePtr(int palindex, int room);
|
const byte *getPalettePtr(int palindex, int room);
|
||||||
|
|
||||||
|
void setHardcodedPaletteRGB(const byte *ptr, int numcolor, int firstIndex = 0);
|
||||||
void setC64Palette();
|
void setC64Palette();
|
||||||
void setNESPalette();
|
void setNESPalette();
|
||||||
void setAmigaPalette();
|
void setAmigaPalette();
|
||||||
|
void setAmigaMIPalette();
|
||||||
void setHercPalette();
|
void setHercPalette();
|
||||||
void setCGAPalette();
|
void setCGAPalette();
|
||||||
void setEGAPalette();
|
void setEGAPalette();
|
||||||
|
|
|
@ -440,27 +440,6 @@ void Sound::playSound(int soundID) {
|
||||||
|
|
||||||
if (_vm->_game.id == GID_MONKEY_VGA || _vm->_game.id == GID_MONKEY_EGA
|
if (_vm->_game.id == GID_MONKEY_VGA || _vm->_game.id == GID_MONKEY_EGA
|
||||||
|| (_vm->_game.id == GID_MONKEY && _vm->_game.platform == Common::kPlatformMacintosh)) {
|
|| (_vm->_game.id == GID_MONKEY && _vm->_game.platform == Common::kPlatformMacintosh)) {
|
||||||
// Sound is currently not supported at all in the amiga versions of these games
|
|
||||||
if (_vm->_game.platform == Common::kPlatformAmiga && false) {
|
|
||||||
|
|
||||||
int track = -1;
|
|
||||||
if (soundID == 50)
|
|
||||||
track = 17;
|
|
||||||
else if (ptr[6] == 0x7F && ptr[7] == 0x00 && ptr[8] == 0x80) {
|
|
||||||
static const char tracks[16] = {13,14,10,3,4,9,16,5,1,8,2,15,6,7,11,12};
|
|
||||||
if (ptr[9] == 0x0E)
|
|
||||||
track = 18;
|
|
||||||
else
|
|
||||||
track = tracks[ptr[9] - 0x23];
|
|
||||||
}
|
|
||||||
if (track != -1) {
|
|
||||||
playCDTrack(track,((track < 5) || (track > 16)) ? 1 : -1,0,0);
|
|
||||||
stopCDTimer();
|
|
||||||
_currentCDSound = soundID;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Works around the fact that in some places in MonkeyEGA/VGA,
|
// Works around the fact that in some places in MonkeyEGA/VGA,
|
||||||
// the music is never explicitly stopped.
|
// the music is never explicitly stopped.
|
||||||
// Rather it seems that starting a new music is supposed to
|
// Rather it seems that starting a new music is supposed to
|
||||||
|
|
|
@ -93,8 +93,9 @@ void Tfmx::interrupt() {
|
||||||
channel.sfxLocked = (channel.customMacroPrio != 0);
|
channel.sfxLocked = (channel.customMacroPrio != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply timebased effects on Parameters
|
// apply timebased effects on Parameters
|
||||||
effects(channel);
|
if (channel.macroSfxRun > 0)
|
||||||
|
effects(channel);
|
||||||
|
|
||||||
// see if we have to run the macro-program
|
// see if we have to run the macro-program
|
||||||
if (channel.macroRun) {
|
if (channel.macroRun) {
|
||||||
|
@ -107,6 +108,8 @@ void Tfmx::interrupt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Paula::setChannelPeriod(channel.paulaChannel, channel.period);
|
Paula::setChannelPeriod(channel.paulaChannel, channel.period);
|
||||||
|
if (channel.macroSfxRun >= 0)
|
||||||
|
channel.macroSfxRun = 1;
|
||||||
|
|
||||||
// TODO: handling pending DMAOff?
|
// TODO: handling pending DMAOff?
|
||||||
}
|
}
|
||||||
|
@ -253,6 +256,9 @@ void Tfmx::macroRun(ChannelContext &channel) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 0x01: // DMA On
|
case 0x01: // DMA On
|
||||||
|
// TODO: Parameter macroPtr[1] - en-/disable effects
|
||||||
|
if (macroPtr[1])
|
||||||
|
debug("Tfmx: DMA On %i", (int8)macroPtr[1]);
|
||||||
channel.dmaIntCount = 0;
|
channel.dmaIntCount = 0;
|
||||||
if (deferWait) {
|
if (deferWait) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -146,6 +146,7 @@ public:
|
||||||
uint16 macroReturnStep;
|
uint16 macroReturnStep;
|
||||||
uint8 macroLoopCount;
|
uint8 macroLoopCount;
|
||||||
bool macroRun;
|
bool macroRun;
|
||||||
|
int8 macroSfxRun;
|
||||||
|
|
||||||
uint32 customMacro;
|
uint32 customMacro;
|
||||||
uint8 customMacroIndex;
|
uint8 customMacroIndex;
|
||||||
|
@ -232,6 +233,7 @@ private:
|
||||||
channel.macroStep = 0;
|
channel.macroStep = 0;
|
||||||
channel.macroWait = 0;
|
channel.macroWait = 0;
|
||||||
channel.macroRun = true;
|
channel.macroRun = true;
|
||||||
|
channel.macroSfxRun = 0;
|
||||||
channel.macroLoopCount = 0xFF;
|
channel.macroLoopCount = 0xFF;
|
||||||
channel.dmaIntCount = 0;
|
channel.dmaIntCount = 0;
|
||||||
}
|
}
|
||||||
|
@ -245,6 +247,7 @@ private:
|
||||||
|
|
||||||
static void clearMacroProgramm(ChannelContext &channel) {
|
static void clearMacroProgramm(ChannelContext &channel) {
|
||||||
channel.macroRun = false;
|
channel.macroRun = false;
|
||||||
|
channel.macroSfxRun = 0;
|
||||||
channel.dmaIntCount = 0;
|
channel.dmaIntCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,48 +16,9 @@
|
||||||
|
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
|
|
||||||
void simplePlaybacktest(int argc, const char *const argv[]) {
|
|
||||||
const char *modFilename = "mod.protracker";
|
|
||||||
if (argc == 2)
|
|
||||||
modFilename = argv[1];
|
|
||||||
|
|
||||||
|
|
||||||
// get Mixer, assume this never fails
|
|
||||||
Audio::Mixer *mixer = g_system->getMixer();
|
|
||||||
|
|
||||||
FSNode fileDir(FILEDIR);
|
|
||||||
debug( "searching for Files in Directory: %s", fileDir.getPath().c_str());
|
|
||||||
|
|
||||||
FSNode musicFile = fileDir.getChild(modFilename);
|
|
||||||
|
|
||||||
SeekableReadStream *fileIn = musicFile.createReadStream();
|
|
||||||
if (0 == fileIn) {
|
|
||||||
debug( "cant open File %s", musicFile.getName().c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Audio::AudioStream *stream = Audio::makeProtrackerStream(fileIn);
|
|
||||||
delete fileIn;
|
|
||||||
if (0 == stream) {
|
|
||||||
debug( "cant open File %s as Protacker-Stream", musicFile.getName().c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Audio::SoundHandle soundH;
|
|
||||||
|
|
||||||
mixer->playInputStream(Audio::Mixer::kMusicSoundType, &soundH, stream);
|
|
||||||
while (mixer->isSoundHandleActive(soundH))
|
|
||||||
g_system->delayMillis(1000);
|
|
||||||
|
|
||||||
|
|
||||||
//mixer->stopAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MUSICFILE "mdat.monkey"
|
#define MUSICFILE "mdat.monkey"
|
||||||
#define SAMPLEFILE "smpl.monkey"
|
#define SAMPLEFILE "smpl.monkey"
|
||||||
|
|
||||||
//#define MUSICFILE "mdat.tworld_1"
|
|
||||||
//#define SAMPLEFILE "smpl.tworld_1"
|
|
||||||
Audio::Tfmx *loadTfmxfile(const char *mdatName, const char *sampleName) {
|
Audio::Tfmx *loadTfmxfile(const char *mdatName, const char *sampleName) {
|
||||||
FSNode fileDir(FILEDIR);
|
FSNode fileDir(FILEDIR);
|
||||||
FSNode musicNode = fileDir.getChild(mdatName);
|
FSNode musicNode = fileDir.getChild(mdatName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue