diff options
author | Paweł Kołodziejski | 2002-10-08 19:35:39 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2002-10-08 19:35:39 +0000 |
commit | 63762d48de7d86803595d9fa90532565fee8ed68 (patch) | |
tree | 9ac79fda6b56707183aadda937924dae9a28c583 /scumm/imuse.cpp | |
parent | 15675e5652f9204beb60b51a1696c907c4c046c8 (diff) | |
download | scummvm-rg350-63762d48de7d86803595d9fa90532565fee8ed68.tar.gz scummvm-rg350-63762d48de7d86803595d9fa90532565fee8ed68.tar.bz2 scummvm-rg350-63762d48de7d86803595d9fa90532565fee8ed68.zip |
synced with local sources (imuse)
svn-id: r5110
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r-- | scumm/imuse.cpp | 289 |
1 files changed, 287 insertions, 2 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 9b5da8800c..ce488af7fa 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -4853,6 +4853,278 @@ IMuseDigital::~IMuseDigital() { _scumm->_timer->releaseProcedure(imus_digital_handler); } +struct imuse_music_table { + int16 index; + char name[30]; + char title[30]; + char filename[15]; +}; + +struct imuse_music_map { + int16 index; + int16 map_index; + int16 table_index; + int16 param1; + int16 param2; +}; + +static const imuse_music_map _digStateMusicMap[] = { + {0, 0, 0, 0, 0 }, + {1, 1, 0, 0, 0 }, + {2, 2, 2, 0, 0 }, + {3, 4, 3, 0, 0 }, + {4, 5, 3, 0, 0 }, + {5, 6, 3, 0, 0 }, + {6, 7, 3, 0, 0 }, + {7, 8, 4, 0, 0 }, + {8, 9, 5, 0, 0 }, + {9, 10, 4, 0, 0 }, + {10, 12, 5, 0, 0 }, + {11, 14, 5, 0, 0 }, + {12, 15, 6, 29, 7 }, + {13, 16, 8, 0, 0 }, + {14, 17, 1, 0, 0 }, + {15, 18, 9, 0, 0 }, + {16, 19, 9, 0, 0 }, + {17, 20, 6, 0, 0 }, + {18, 21, 6, 0, 0 }, + {19, 22, 44, 0, 0 }, + {20, 23, 10, 7, 0 }, + {21, 24, 26, 0, 0 }, + {22, 25, 17, 0, 0 }, + {23, 26, 17, 0, 0 }, + {24, 27, 18, 0, 0 }, + {25, 28, 1, 0, 0 }, + {26, 29, 20, 0, 0 }, + {27, 30, 22, 0, 0 }, + {28, 31, 23, 0, 0 }, + {29, 32, 22, 0, 0 }, + {30, 33, 26, 0, 0 }, + {31, 34, 24, 0, 0 }, + {32, 35, 1, 0, 0 }, + {33, 36, 1, 0, 0 }, + {34, 37, 42, 0, 0 }, + {35, 38, 43, 0, 0 }, + {36, 39, 44, 0, 0 }, + {37, 41, 43, 0, 0 }, + {38, 42, 44, 0, 0 }, + {39, 43, 43, 0, 0 }, + {40, 44, 45, 0, 0 }, + {41, 47, 1, 117,45}, + {42, 48, 43, 0, 0 }, + {43, 49, 44, 0, 0 }, + {44, 51, 1, 0, 0 }, + {45, 53, 28, 0, 0 }, + {46, 54, 28, 0, 0 }, + {47, 55, 29, 0, 0 }, + {48, 56, 29, 0, 0 }, + {49, 57, 29, 0, 0 }, + {50, 58, 31, 0, 0 }, + {51, 59, 1, 0, 0 }, + {52, 60, 37, 0, 0 }, + {53, 61, 39, 0, 0 }, + {54, 62, 38, 0, 0 }, + {55, 63, 39, 0, 0 }, + {56, 64, 39, 0, 0 }, + {57, 65, 40, 0, 0 }, + {58, 66, 40, 0, 0 }, + {59, 67, 39, 0, 0 }, + {60, 68, 1, 0, 0 }, + {61, 69, 49, 0, 0 }, + {62, 70, 50, 0, 0 }, + {63, 73, 51, 0, 0 }, + {64, 75, 1, 0, 0 }, + {65, 76, 52, 9, 0 }, + {66, 77, 63, 0, 0 }, + {67, 78, 1, 0, 0 }, + {68, 79, 21, 0, 0 }, + {69, 82, 1, 0, 0 }, + {70, 85, 0, 0, 0 }, + {71, 86, 33, 6, 35}, + {72, 89, 16, 0, 0 }, + {73, 90, 57, 10, 0 }, + {74, 91, 32, 0, 0 }, + {75, 88, 25, 0, 0 }, + {76, 92, 0, 0, 0 }, + {77, 93, 19, 0, 0 }, + {78, 95, 41, 0, 0 }, + {79, 80, 48, 0, 0 }, + {80, 81, 27, 0, 0 }, + {81, 83, 36, 0, 0 }, + {82, 94, 1, 0, 0 }, + {83, 40, 13, 0, 0 }, + {84, 96, 14, 0, 0 }, + {85, 97, 11, 0, 0 }, + {86, 98, 15, 0, 0 }, + {87, 99, 17, 0, 0 }, + {88, 100,38, 0, 0 }, + {89, 101,0, 0, 0 }, + {90, 103,0, 0, 0 }, + {91, 104,44, 0, 0 }, + {92, 11, 47, 0, 0 }, + {93, 3, 30, 128,29}, + {94, 105,0, 0, 0 }, + {95, 106,1, 0, 0 }, + {96, 107,1, 0, 0 }, + {97, 108,1, 0, 0 }, + {98, 47, 1, 0, 0 }, + {99, 50, 1, 0, 0 }, + {100, 52, 0, 0, 0 }, + {101, 71, 1, 0, 0 }, + {102, 13, 1, 0, 0 }, + {103, 72, 1, 0, 0 }, + {104, 46, 33, 6, 35}, + {105, 74, 1, 0, 0 }, + {106, 84, 1, 0, 0 }, + {107, 66, 1, 0, 0 }, + {108, 102,1, 0, 0 }, + {109, 109,1, 0, 0 }, + {110, 110,2, 0, 0 }, + {111, 45, 1, 0, 0 }, + {112, 87, 1, 0, 0 }, + {113, 111,1, 0, 0 }, + {-1, -1, 1, 0, 0 }, +}; + +static const imuse_music_table _digStateMusicTable[] = { + {0, "STATE_NULL", "", "" }, + {1, "stateNoChange", "", "" }, + {2, "stateAstShip", "Asteroid (amb-ship)", "ASTERO~1.IMU"}, + {3, "stateAstClose", "Asteroid (amb-close)", "ASTERO~2.IMU"}, + {4, "stateAstInside", "Asteroid (inside)", "ASTERO~3.IMU"}, + {5, "stateAstCore", "Asteroid (core)", "ASTERO~4.IMU"}, + {6, "stateCanyonClose", "Canyon (close)", "CANYON~1.IMU"}, + {7, "stateCanyonClose_m", "Canyon (close-m)", "CANYON~2.IMU"}, + {8, "stateCanyonOver", "Canyon (over)", "CANYON~3.IMU"}, + {9, "stateCanyonWreck", "Canyon (wreck)", "CANYON~4.IMU"}, + {10, "stateNexusCanyon", "Nexus (plan)", "NEXUS(~1.IMU"}, + {11, "stateNexusPlan", "Nexus (plan)", "NEXUS(~1.IMU"}, + {12, "stateNexusRamp", "Nexus (ramp)", "NEXUS(~2.IMU"}, + {13, "stateNexusMuseum", "Nexus (museum)", "NEXUS(~3.IMU"}, + {14, "stateNexusMap", "Nexus (map)", "NEXUS(~4.IMU"}, + {15, "stateNexusTomb", "Nexus (tomb)", "NE3706~5.IMU"}, + {16, "stateNexusCath", "Nexus (cath)", "NE3305~5.IMU"}, + {17, "stateNexusAirlock", "Nexus (airlock)", "NE2D3A~5.IMU"}, + {18, "stateNexusPowerOff", "Nexus (power)", "NE8522~5.IMU"}, + {19, "stateMuseumTramNear", "Tram (mu-near)", "TRAM(M~1.IMU"}, + {20, "stateMuseumTramFar", "Tram (mu-far)", "TRAM(M~2.IMU"}, + {21, "stateMuseumLockup", "Museum (lockup)", "MUSEUM~1.IMU"}, + {22, "stateMuseumPool", "Museum (amb-pool)", "MUSEUM~2.IMU"}, + {23, "stateMuseumSpire", "Museum (amb-spire)", "MUSEUM~3.IMU"}, + {24, "stateMuseumMuseum", "Museum (amb-mu)", "MUSEUM~4.IMU"}, + {25, "stateMuseumLibrary", "Museum (library)", "MUB575~5.IMU"}, + {26, "stateMuseumCavern", "Museum (cavern)", "MUF9BE~5.IMU"}, + {27, "stateTombTramNear", "Tram (tomb-near)", "TRAM(T~1.IMU"}, + {28, "stateTombBase", "Tomb (amb-base)", "TOMB(A~1.IMU"}, + {29, "stateTombSpire", "Tomb (amb-spire)", "TOMB(A~2.IMU"}, + {30, "stateTombCave", "Tomb (amb-cave)", "TOMB(A~3.IMU"}, + {31, "stateTombCrypt", "Tomb (crypt)", "TOMB(C~1.IMU"}, + {32, "stateTombGuards", "Tomb (crypt-guards)", "TOMB(C~2.IMU"}, + {33, "stateTombInner", "Tomb (inner)", "TOMB(I~1.IMU"}, + {34, "stateTombCreator1", "Tomb (creator 1)", "TOMB(C~3.IMU"}, + {35, "stateTombCreator2", "Tomb (creator 2)", "TOMB(C~4.IMU"}, + {36, "statePlanTramNear", "Tram (plan-near)", "TRAM(P~1.IMU"}, + {37, "statePlanTramFar", "Tram (plan-far)", "TRAM(P~2.IMU"}, + {38, "statePlanBase", "Plan (amb-base)", "PLAN(A~1.IMU"}, + {39, "statePlanSpire", "Plan (amb-spire)", "PLAN(A~2.IMU"}, + {40, "statePlanDome", "Plan (dome)", "PLAN(D~1.IMU"}, + {41, "stateMapTramNear", "Tram (map-near)", "TRAM(M~3.IMU"}, + {42, "stateMapTramFar", "Tram (map-far)", "TRAM(M~4.IMU"}, + {43, "stateMapCanyon", "Map (amb-canyon)", "MAP(AM~1.IMU"}, + {44, "stateMapExposed", "Map (amb-exposed)", "MAP(AM~2.IMU"}, + {45, "stateMapNestEmpty", "Map (amb-nest)", "MAP(AM~4.IMU"}, + {46, "stateMapNestMonster", "Map (monster)", "MAP(MO~1.IMU"}, + {47, "stateMapKlein", "Map (klein)", "MAP(KL~1.IMU"}, + {48, "stateCathTramNear", "Tram (cath-near)", "TRAM(C~1.IMU"}, + {49, "stateCathTramFar", "Tram (cath-far)", "TRAM(C~2.IMU"}, + {50, "stateCathLab", "Cath (amb-inside)", "CATH(A~1.IMU"}, + {51, "stateCathOutside", "Cath (amb-outside)", "CATH(A~2.IMU"}, + {52, "stateWorldMuseum", "World (museum)", "WORLD(~1.IMU"}, + {53, "stateWorldPlan", "World (plan)", "WORLD(~2.IMU"}, + {54, "stateWorldTomb", "World (tomb)", "WORLD(~3.IMU"}, + {55, "stateWorldMap", "World (map)", "WORLD(~4.IMU"}, + {56, "stateWorldCath", "World (cath)", "WO3227~5.IMU"}, + {57, "stateEye1", "Eye 1", "EYE1~1.IMU" }, + {58, "stateEye2", "Eye 2", "EYE2~1.IMU" }, + {59, "stateEye3", "Eye 3", "EYE3~1.IMU" }, + {60, "stateEye4", "Eye 4", "EYE4~1.IMU" }, + {61, "stateEye5", "Eye 5", "EYE5~1.IMU" }, + {62, "stateEye6", "Eye 6", "EYE6~1.IMU" }, + {63, "stateEye7", "Eye 7", "EYE7~1.IMU" }, + {-1, "", "", "" }, +}; + +static const imuse_music_table _digSeqMusicTable[] = { + {0, "SEQ_NULL", "", "" }, + {1, "seqLogo", "", "" }, + {2, "seqIntro", "", "" }, + {3, "seqExplosion1b", "", "" }, + {4, "seqAstTunnel1a", "Seq (ast tunnel 1a)", "SEQ(AS~1.IMU"}, + {5, "seqAstTunnel2b", "", "" }, + {6, "seqAstTunnel3a", "Seq (ast tunnel 3a)", "SEQ(AS~2.IMU"}, + {7, "seqToPlanet1b", "", "" }, + {8, "seqArgBegin", "Seq (arg begin)", "SEQ(AR~1.IMU"}, + {9, "seqArgEnd", "Seq (arg end)", "SEQ(AR~2.IMU"}, + {10, "seqWreckGhost", "Seq (ghost-wreck)", "SEQ(GH~1.IMU"}, + {11, "seqCanyonGhost", "Seq (ghost-canyon)", "SEQ(GH~2.IMU"}, + {12, "seqBrinkFall", "", "" }, + {13, "seqPanUpCanyon", "Seq (pan up canyon)", "SEQ(PA~1.IMU"}, + {14, "seqAirlockTunnel1b", "", "" }, + {15, "seqTramToMu", "", "" }, + {16, "seqTramFromMu", "", "" }, + {17, "seqTramToTomb", "", "" }, + {18, "seqTramFromTomb", "", "" }, + {19, "seqTramToPlan", "", "" }, + {20, "seqTramFromPlan", "", "" }, + {21, "seqTramToMap", "", "" }, + {22, "seqTramFromMap", "", "" }, + {23, "seqTramToCath", "", "" }, + {24, "seqTramFromCath", "", "" }, + {25, "seqMuseumGhost", "", "" }, + {26, "seqSerpentAppears", "", "" }, + {27, "seqSerpentEats", "", "" }, + {28, "seqBrinkRes1b", "", "" }, + {29, "seqBrinkRes2a", "Seq (brink's madness)", "SEQ(BR~1.IMU"}, + {30, "seqLockupEntry", "Seq (brink's madness)", "SEQ(BR~1.IMU"}, + {31, "seqSerpentExplodes", "", "" }, + {32, "seqSwimUnderwater", "Seq (descent)", "SEQ(DE~1.IMU"}, + {33, "seqWavesPlunge", "Seq (plunge)", "SEQ(PL~1.IMU"}, + {34, "seqCryptOpens", "", "" }, + {35, "seqGuardsFight", "", "" }, + {36, "seqCreatorRes1.1a", "Seq (creator res 1.1a)", "SEQ(CR~1.IMU"}, + {37, "seqCreatorRes1.2b", "", "" }, + {38, "seqMaggieCapture1b", "", "" }, + {39, "seqStealCrystals", "Seq (brink's madness)", "SEQ(BR~1.IMU"}, + {40, "seqGetByMonster", "", "" }, + {41, "seqKillMonster1b", "", "" }, + {42, "seqCreatorRes2.1a", "Seq (creator res 2.1a)", "SEQ(CR~2.IMU"}, + {43, "seqCreatorRes2.2b", "", "" }, + {44, "seqCreatorRes2.3a", "Seq (creator res 2.3a)", "SEQ(CR~3.IMU"}, + {45, "seqMaggieInsists", "", "" }, + {46, "seqBrinkHelpCall", "", "" }, + {47, "seqBrinkCrevice1a", "Seq (brink crevice 1a)", "SEQ(BR~2.IMU"}, + {48, "seqBrinkCrevice2a", "Seq (brink crevice 2a)", "SEQ(BR~3.IMU"}, + {49, "seqCathAccess1b", "", "" }, + {50, "seqCathAccess2a", "Seq (cath access 2a)", "SEQ(CA~1.IMU"}, + {51, "seqBrinkAtGenerator", "Seq (brink's madness)", "SEQ(BR~1.IMU"}, + {52, "seqFightBrink1b", "", "" }, + {53, "seqMaggieDies1b", "", "" }, + {54, "seqMaggieRes1b", "", "" }, + {55, "seqMaggieRes2a", "Seq (maggie res 2a)", "SEQ(MA~1.IMU"}, + {56, "seqCreatureFalls", "", "" }, + {57, "seqFinale1b", "", "" }, + {58, "seqFinale2a", "Seq (finale 2a)", "SEQ(FI~1.IMU"}, + {59, "seqFinale3b1", "", "" }, + {60, "seqFinale3b2", "", "" }, + {61, "seqFinale4a", "Seq (finale 4a)", "SEQ(FI~2.IMU"}, + {62, "seqFinale5a", "Seq (finale 5a)", "SEQ(FI~3.IMU"}, + {63, "seqFinale6a", "Seq (finale 6a)", "SEQ(FI~4.IMU"}, + {64, "seqFinale7a", "Seq (finale 7a)", "SE3D2B~5.IMU"}, + {65, "seqFinale8b", "", "" }, + {66, "seqFinale9a", "Seq (finale 9a)", "SE313B~5.IMU"}, + {-1, "", "", "" }, +}; + void IMuseDigital::handler() { bool new_mixer; uint32 l = 0, i = 0; @@ -5250,10 +5522,23 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } else if (param == 16) { switch (cmd) { case 0: // play music (state) - debug(2, "IMuseDigital::doCommand 0x1000 (%d)", b); + debug(1, "IMuseDigital::doCommand 0x1000 (%d)", b); + for(l = 0;; l++) { + if (_digStateMusicMap[l].index == -1) { + return 1; + } + if ((_digStateMusicMap[l].map_index == b)) { + int16 music = _digStateMusicMap[l].table_index; + debug(1, "Play imuse music: %s, %s, %s", _digStateMusicTable[music].name, _digStateMusicTable[music].title, _digStateMusicTable[music].filename); + if (_digStateMusicTable[l].filename[0] != 0) { + _scumm->_sound->playBundleMusic((char*)&_digStateMusicTable[music].filename); + } + return 0; + } + } return 0; case 1: // play music (seq) - debug(2, "IMuseDigital::doCommand 0x1001 (%d)", b); + debug(1, "IMuseDigital::doCommand 0x1001 (%d)", b); return 0; case 2: // dummy in DIG and CMI debug(2, "IMuseDigital::doCommand 0x1002 (%d)", b); |