the cutting room mirror

Source Code

This is a sub-page of Shenmue.

Two large C code files were left in the game. SEQCONV.C comes with a 25.4KB SEQCONV.O file, which is its compiled counterpart.

Disc 4#

'...But what does it mean?'
This game has text or audio that needs to be translated. If you are fluent with this language, please read our translation guidelines and then submit a translation!

\SCENE\99\MS08\0154_1.C#


FCVKEYt camX[] = {
    { 0.000000, 0.000000, 0.000000, -17.920521 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -17.920521 },   /*  1   */
    { 0.500000, 0.000000, 0.000000, -17.920521 },   /*  14  */
    { 0.533333, 0.000000, 0.000000, -18.790796 },   /*  16  */
    { 1.166667, 0.000000, 0.000000, -18.790796 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -17.713282 },   /*  35  */
    { 2.833333, 0.000000, 0.000000, -17.713282 },   /*  84  */
    { 2.866666, -0.213518, -0.213518, -17.481289 }, /*  85  */
    { 6.333332, -0.243924, -0.243924, -18.412258 }, /*  189 */
    { 6.366668, 0.000636, 0.000636, -19.728035 },   /*  191 */
    { 6.400001, 0.000000, 0.000000, -19.728035 },   /*  192 */
    { 7.466667, 0.186229, 0.000000, -19.512451 },   /*  224 */
    { 9.499997, 0.000000, 0.000000, -19.512451 },   /*  284 */
    { 9.533330, 0.000000, 0.000000, -19.003939 },   /*  285 */
    { 11.833333, 0.000000, 0.000000, -19.003939 },  /*  354 */
    { 11.866666, 0.000000, 0.000000, -21.080954 },  /*  355 */
    { 14.499993, 0.000000, 0.000000, -21.080954 },  /*  434 */
    { 14.533326, 0.000000, 0.000000, -18.912323 },  /*  435 */
    { 15.999993, 0.000000, 0.000000, -18.912323 },  /*  479 */
    { 16.033325, 0.019806, 0.019806, -19.758411 },  /*  480 */
    { 20.333328, 0.021188, 0.021188, -19.633121 },  /*  609 */
    { 20.366661, 0.000000, 0.000000, -19.879799 },  /*  610 */
    { 26.666666, 0.000000, 0.000000, -19.879799 },  /*  799 */
    { 26.700001, 0.000000, 0.000000, -18.618357 },  /*  801 */
    { 28.833334, 0.000000, 0.000000, -18.580397 },  /*  865 */
    { 28.866665, 0.045700, 0.045700, -24.547550 },  /*  865 */
    { 38.666672, 0.033551, 0.033551, -24.118729 },  /*  1160    */
    { 38.700001, 0.000000, 0.000000, -20.247274 },  /*  1161    */
    { 43.000000, 0.000000, 0.000000, -20.295513 },  /*  1290    */
    { 43.033340, -0.011102, -0.011102, -20.088829 },    /*  1291    */
    { 45.666668, 0.000000, 0.000000, -20.111118 },  /*  1370    */
    { 45.700001, 0.000000, 0.000000, -20.185917 },  /*  1371    */
    { 50.000000, 0.000000, 0.000000, -20.173235 },  /*  1500    */
    { 51.333332, 0.000000, 0.000000, -20.173235 },  /*  1539    */
    { 51.366665, 0.000000, 0.000000, -20.172125 },  /*  1540    */
    { 55.666668, 0.000000, 0.000000, -20.082100 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -20.123055 },  /*  1671    */
    { 64.333336, 0.000000, 0.000000, -20.123055 },  /*  1930    */
    { 64.366669, 0.000000, 0.000000, -20.413557 },  /*  1931    */
    { 71.333336, 0.000000, 0.000000, -20.413557 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -20.413557 },  /*  2140    */
};

FCVKEYt camY[] = {
    { 0.000000, 0.000000, 0.000000, 1.554671 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 1.554671 }, /*  1   */
    { 0.500000, 0.000000, 0.000000, 1.554671 }, /*  14  */
    { 0.533333, 0.000000, 0.000000, 0.107291 }, /*  16  */
    { 1.166667, 0.000000, 0.000000, 0.107290 }, /*  34  */
    { 1.200000, 0.000000, 0.000000, 2.308871 }, /*  35  */
    { 2.833333, 0.000000, 0.000000, 2.308871 }, /*  84  */
    { 2.866666, 0.000000, 0.000000, 1.046567 }, /*  85  */
    { 6.333333, 0.000000, 0.000000, 1.040772 }, /*  189 */
    { 6.366668, 0.015645, 0.015645, 1.388480 }, /*  191 */
    { 6.400001, 0.000000, 0.000000, 1.388480 }, /*  192 */
    { 7.466667, -0.245911, 0.000000, 1.181751 },    /*  224 */
    { 9.499997, 0.000000, 0.000000, 1.181751 }, /*  284 */
    { 9.533330, 0.000000, 0.000000, 0.651900 }, /*  285 */
    { 11.833333, 0.000000, 0.000000, 0.651900 },    /*  354 */
    { 11.866666, 0.000000, 0.000000, 0.154808 },    /*  355 */
    { 14.499993, 0.000000, 0.000000, 0.154808 },    /*  434 */
    { 14.533326, 0.000000, 0.000000, 1.502953 },    /*  435 */
    { 15.999993, 0.000000, 0.000000, 1.502953 },    /*  479 */
    { 16.033325, 0.000000, 0.000000, 0.637179 },    /*  480 */
    { 20.333328, 0.000000, 0.000000, 0.777887 },    /*  609 */
    { 20.366661, 0.000000, 0.000000, 4.173497 },    /*  610 */
    { 26.666666, 0.000000, 0.000000, 3.982877 },    /*  799 */
    { 26.700001, 0.000000, 0.000000, 1.360884 },    /*  801 */
    { 28.833334, 0.000000, 0.000000, 1.445840 },    /*  865 */
    { 28.866665, -0.090050, -0.090050, 10.662257 }, /*  865 */
    { 38.666672, -0.079441, -0.079441, 9.797918 },  /*  1160    */
    { 38.700001, 0.000000, 0.000000, 1.617617 },    /*  1161    */
    { 43.000000, 0.000000, 0.000000, 1.617617 },    /*  1290    */
    { 43.033340, 0.000000, 0.000000, 1.596333 },    /*  1291    */
    { 45.666668, 0.000000, 0.000000, 1.595925 },    /*  1370    */
    { 45.700001, 0.000000, 0.000000, 1.474199 },    /*  1371    */
    { 50.000000, 0.000000, 0.000000, 1.497543 },    /*  1500    */
    { 51.333332, 0.000000, 0.000000, 1.497543 },    /*  1539    */
    { 51.366665, 0.000000, 0.000000, 1.536094 },    /*  1540    */
    { 55.666668, 0.000000, 0.000000, 1.542578 },    /*  1670    */
    { 55.700001, 0.000000, 0.000000, 1.805117 },    /*  1671    */
    { 64.333336, 0.000000, 0.000000, 1.773207 },    /*  1930    */
    { 64.366669, 0.000000, 0.000000, 1.150182 },    /*  1931    */
    { 71.333336, 0.000000, 0.000000, 1.150182 },    /*  2140    */
    { 71.349998, 0.000000, 0.000000, 1.150182 },    /*  2140    */
};

FCVKEYt camZ[] = {
    { 0.000000, 0.000000, 0.000000, -11.944542 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -11.944542 },   /*  1   */
    { 0.500000, 0.000000, 0.000000, -11.944542 },   /*  14  */
    { 0.533333, 0.000000, 0.000000, -11.620082 },   /*  16  */
    { 1.166667, 0.000000, 0.000000, -11.620082 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -11.286220 },   /*  35  */
    { 2.833333, 0.000000, 0.000000, -11.286220 },   /*  84  */
    { 2.866666, 0.000000, 0.000000, -10.031123 },   /*  85  */
    { 6.333332, 0.000000, 0.000000, -10.211745 },   /*  189 */
    { 6.366668, -0.020819, -0.020819, -14.161451 }, /*  191 */
    { 6.400001, 0.000000, 0.000000, -14.161451 },   /*  192 */
    { 7.466667, 0.676449, 0.000000, -13.651398 },   /*  224 */
    { 9.499997, 0.000000, 0.000000, -13.651398 },   /*  284 */
    { 9.533330, 0.000000, 0.000000, -13.293118 },   /*  285 */
    { 11.833333, 0.000000, 0.000000, -13.293118 },  /*  354 */
    { 11.866666, 0.000000, 0.000000, -15.098112 },  /*  355 */
    { 14.499993, 0.000000, 0.000000, -15.098112 },  /*  434 */
    { 14.533326, 0.000000, 0.000000, -12.934105 },  /*  435 */
    { 15.999993, 0.000000, 0.000000, -12.934105 },  /*  479 */
    { 16.033325, 0.000000, 0.000000, -11.127069 },  /*  480 */
    { 20.333328, 0.000000, 0.000000, -11.488962 },  /*  609 */
    { 20.366661, 0.000000, 0.000000, -18.693596 },  /*  610 */
    { 26.666666, 0.000000, 0.000000, -18.693596 },  /*  799 */
    { 26.700001, 0.000000, 0.000000, -13.254105 },  /*  801 */
    { 28.833334, 0.000000, 0.000000, -13.090749 },  /*  865 */
    { 28.866665, -0.070434, -0.070434, -7.815206 }, /*  865 */
    { 38.666672, -0.057214, -0.057214, -8.482251 }, /*  1160    */
    { 38.700001, 0.000000, 0.000000, -12.344294 },  /*  1161    */
    { 43.000000, 0.000000, 0.000000, -12.344294 },  /*  1290    */
    { 43.033340, 0.028862, 0.028862, -14.476007 },  /*  1291    */
    { 45.666668, 0.000000, 0.000000, -14.417938 },  /*  1370    */
    { 45.700001, 0.000000, 0.000000, -13.514585 },  /*  1371    */
    { 50.000000, 0.000000, 0.000000, -13.697420 },  /*  1500    */
    { 51.333332, 0.000000, 0.000000, -13.697420 },  /*  1539    */
    { 51.366665, 0.000000, 0.000000, -13.503355 },  /*  1540    */
    { 55.666668, 0.000000, 0.000000, -13.649759 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -12.797223 },  /*  1671    */
    { 64.333336, 0.000000, 0.000000, -12.797223 },  /*  1930    */
    { 64.366669, 0.000000, 0.000000, -13.449550 },  /*  1931    */
    { 71.333336, 0.000000, 0.000000, -13.449550 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -13.449550 },  /*  2140    */
};

FCVKEYt intX[] = {
    { 0.000000, 0.000000, 0.000000, -17.523552 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -17.523552 },   /*  1   */
    { 0.500000, 0.000000, 0.000000, -17.523552 },   /*  14  */
    { 0.533333, 0.000000, 0.000000, -17.523552 },   /*  16  */
    { 1.166667, 0.000000, 0.000000, -17.523552 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -17.570131 },   /*  35  */
    { 2.833333, 0.000000, 0.000000, -17.570131 },   /*  84  */
    { 2.866666, 0.000000, 0.000000, -17.354692 },   /*  85  */
    { 6.333332, -0.051345, -0.051345, -17.651344 }, /*  189 */
    { 6.366668, 0.000000, 0.000000, -19.682545 },   /*  191 */
    { 6.400001, 0.000000, 0.000000, -19.682545 },   /*  192 */
    { 7.466667, 0.482158, 0.000000, -19.138041 },   /*  224 */
    { 9.499997, 0.000000, 0.000000, -19.138041 },   /*  284 */
    { 9.533330, 0.000000, 0.000000, -18.435619 },   /*  285 */
    { 11.833333, 0.000000, 0.000000, -18.435619 },  /*  354 */
    { 11.866666, 0.000000, 0.000000, -18.375265 },  /*  355 */
    { 14.499993, 0.000000, 0.000000, -18.375265 },  /*  434 */
    { 14.533326, 0.000000, 0.000000, -18.173725 },  /*  435 */
    { 15.999993, 0.000000, 0.000000, -18.173725 },  /*  479 */
    { 16.033325, 0.000000, 0.000000, -16.984381 },  /*  480 */
    { 20.333328, 0.000000, 0.000000, -16.984381 },  /*  609 */
    { 20.366661, 0.000000, 0.000000, -18.308365 },  /*  610 */
    { 26.666666, 0.000000, 0.000000, -18.308365 },  /*  799 */
    { 26.700001, 0.000000, 0.000000, -18.370424 },  /*  801 */
    { 28.833334, 0.000000, 0.000000, -18.370424 },  /*  865 */
    { 28.866665, 0.000000, 0.000000, -19.848255 },  /*  865 */
    { 38.666672, 0.000000, 0.000000, -19.848255 },  /*  1160    */
    { 38.700005, 0.112252, 0.112252, -20.104225 },  /*  1161    */
    { 43.000000, 0.000000, 0.000000, -19.165730 },  /*  1290    */
    { 43.033340, 0.000000, 0.000000, -19.588610 },  /*  1291    */
    { 45.666668, 0.000000, 0.000000, -19.588610 },  /*  1370    */
    { 45.700001, 0.000000, 0.000000, -19.936789 },  /*  1371    */
    { 50.000000, 0.000000, 0.000000, -19.858381 },  /*  1500    */
    { 51.333332, 0.000000, 0.000000, -19.858381 },  /*  1539    */
    { 51.366665, 0.000000, 0.000000, -19.859219 },  /*  1540    */
    { 55.666668, 0.000000, 0.000000, -19.859219 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -19.599649 },  /*  1671    */
    { 64.333336, 0.000000, 0.000000, -19.599649 },  /*  1930    */
    { 64.366669, 0.000000, 0.000000, -19.734402 },  /*  1931    */
    { 71.333336, 0.000000, 0.000000, -19.717907 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -19.717907 },  /*  2140    */
};

FCVKEYt intY[] = {
    { 0.000000, 0.000000, 0.000000, 1.529601 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 1.529601 }, /*  1   */
    { 0.500000, 0.000000, 0.000000, 1.529601 }, /*  14  */
    { 0.533333, 0.000000, 0.000000, 1.529601 }, /*  16  */
    { 1.166667, 0.000000, 0.000000, 1.547666 }, /*  34  */
    { 1.200000, 0.000000, 0.000000, 0.383686 }, /*  35  */
    { 2.833333, 0.000000, 0.000000, 0.383686 }, /*  84  */
    { 2.866666, 0.000000, 0.000000, 1.196056 }, /*  85  */
    { 6.333332, 0.000000, 0.000000, 1.190261 }, /*  189 */
    { 6.366667, 0.000000, 0.000000, 1.818852 }, /*  191 */
    { 6.400001, 0.000000, 0.000000, 1.818852 }, /*  192 */
    { 7.466667, -0.458403, 0.000000, 1.323532 },    /*  224 */
    { 9.499997, 0.000000, 0.000000, 1.323532 }, /*  284 */
    { 9.533330, 0.000000, 0.000000, 1.400898 }, /*  285 */
    { 11.833333, 0.000000, 0.000000, 1.400898 },    /*  354 */
    { 11.866666, 0.000000, 0.000000, 1.507450 },    /*  355 */
    { 14.499993, 0.000000, 0.000000, 1.507450 },    /*  434 */
    { 14.533326, 0.000000, 0.000000, 1.645223 },    /*  435 */
    { 15.999993, 0.000000, 0.000000, 1.645223 },    /*  479 */
    { 16.033325, 0.000000, 0.000000, 3.752608 },    /*  480 */
    { 20.333328, 0.000000, 0.000000, 3.752608 },    /*  609 */
    { 20.366661, 0.000000, 0.000000, 4.677533 },    /*  610 */
    { 26.666666, 0.000000, 0.000000, 4.486913 },    /*  799 */
    { 26.700001, 0.000000, 0.000000, 1.915810 },    /*  801 */
    { 28.833334, 0.000000, 0.000000, 1.915810 },    /*  865 */
    { 28.866665, 0.000000, 0.000000, 1.190371 },    /*  865 */
    { 38.666672, 0.000000, 0.000000, 1.190371 },    /*  1160    */
    { 38.700005, 0.000000, 0.000000, 1.401365 },    /*  1161    */
    { 43.000000, 0.000000, 0.000000, 1.401365 },    /*  1290    */
    { 43.033340, 0.000000, 0.000000, 1.457290 },    /*  1291    */
    { 45.666668, 0.000000, 0.000000, 1.457290 },    /*  1370    */
    { 45.700001, 0.000000, 0.000000, 1.496310 },    /*  1371    */
    { 50.000000, 0.000000, 0.000000, 1.301381 },    /*  1500    */
    { 51.333332, 0.000000, 0.000000, 1.301381 },    /*  1539    */
    { 51.366665, 0.000000, 0.000000, 1.558205 },    /*  1540    */
    { 55.666668, 0.000000, 0.000000, 1.558205 },    /*  1670    */
    { 55.700001, 0.000000, 0.000000, 1.336141 },    /*  1671    */
    { 64.333336, 0.000000, 0.000000, 1.362603 },    /*  1930    */
    { 64.366669, 0.000000, 0.000000, 1.524192 },    /*  1931    */
    { 71.333336, 0.000000, 0.000000, 1.585494 },    /*  2140    */
    { 71.349998, 0.000000, 0.000000, 1.585494 },    /*  2140    */
};

FCVKEYt intZ[] = {
    { 0.000000, 0.000000, 0.000000, -11.661756 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -11.661756 },   /*  1   */
    { 0.500000, 0.000000, 0.000000, -11.661756 },   /*  14  */
    { 0.533333, 0.000000, 0.000000, -11.661756 },   /*  16  */
    { 1.166667, 0.000000, 0.000000, -11.661756 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -11.586548 },   /*  35  */
    { 2.833333, 0.000000, 0.000000, -11.586548 },   /*  84  */
    { 2.866666, 0.000000, 0.000000, -13.270169 },   /*  85  */
    { 6.333332, 0.000000, 0.000000, -13.352284 },   /*  189 */
    { 6.366668, 0.000000, 0.000000, -14.947390 },   /*  191 */
    { 6.400001, 0.000000, 0.000000, -14.947390 },   /*  192 */
    { 7.466667, 0.000000, 0.000000, -14.938190 },   /*  224 */
    { 9.499997, 0.000000, 0.000000, -14.938190 },   /*  284 */
    { 9.533330, 0.000000, 0.000000, -12.123504 },   /*  285 */
    { 11.833333, 0.000000, 0.000000, -12.123504 },  /*  354 */
    { 11.866666, 0.000000, 0.000000, -13.497293 },  /*  355 */
    { 14.499993, 0.000000, 0.000000, -13.497293 },  /*  434 */
    { 14.533326, 0.000000, 0.000000, -11.995175 },  /*  435 */
    { 15.999993, 0.000000, 0.000000, -11.995175 },  /*  479 */
    { 16.033325, 0.000000, 0.000000, -19.139805 },  /*  480 */
    { 20.333328, 0.000000, 0.000000, -19.139805 },  /*  609 */
    { 20.366661, 0.000000, 0.000000, -19.245077 },  /*  610 */
    { 26.666666, 0.000000, 0.000000, -19.245077 },  /*  799 */
    { 26.700001, 0.000000, 0.000000, -12.187070 },  /*  801 */
    { 28.833334, 0.000000, 0.000000, -12.187070 },  /*  865 */
    { 28.866665, 0.000000, 0.000000, -15.125110 },  /*  865 */
    { 38.666672, 0.000000, 0.000000, -15.125110 },  /*  1160    */
    { 38.700005, 0.000000, 0.000000, -15.912962 },  /*  1161    */
    { 43.000000, 0.000000, 0.000000, -15.912962 },  /*  1290    */
    { 43.033340, 0.000000, 0.000000, -12.812093 },  /*  1291    */
    { 45.666668, 0.000000, 0.000000, -12.812093 },  /*  1370    */
    { 45.700001, 0.000000, 0.000000, -12.662916 },  /*  1371    */
    { 50.000000, 0.000000, 0.000000, -13.462975 },  /*  1500    */
    { 51.333332, 0.000000, 0.000000, -13.462975 },  /*  1539    */
    { 51.366665, 0.000000, 0.000000, -14.002617 },  /*  1540    */
    { 55.666668, 0.000000, 0.000000, -14.002617 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -13.992125 },  /*  1671    */
    { 64.333336, 0.000000, 0.000000, -13.992125 },  /*  1930    */
    { 64.366669, 0.000000, 0.000000, -14.054812 },  /*  1931    */
    { 71.333336, 0.000000, 0.000000, -14.259069 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -14.259069 },  /*  2140    */
};

FCVKEYt pers[] = {
    { 0.000000, 0.000000, 0.000000, 55.385674 },    /*  0   */
    { 0.033333, 0.000000, 0.000000, 55.385674 },    /*  1   */
    { 1.166667, 0.000000, 0.000000, 55.385674 },    /*  34  */
    { 1.200000, 0.000000, 0.000000, 39.320164 },    /*  35  */
    { 2.833333, 0.000000, 0.000000, 39.320164 },    /*  84  */
    { 2.866666, 0.000000, 0.000000, 55.385674 },    /*  85  */
    { 71.333336, 0.000000, 0.000000, 55.385674 },   /*  2140    */
    { 71.349998, 0.000000, 0.000000, 55.385674 },   /*  2140    */
};

FCVKEYt roll[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 1.166667, 0.000000, 0.000000, 0.000000 }, /*  34  */
    { 1.199999, 0.000000, 0.000000, 0.538027 }, /*  35  */
    { 2.833333, 0.000000, 0.000000, 0.538027 }, /*  84  */
    { 2.866666, 0.000000, 0.000000, 0.000000 }, /*  85  */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};


Camera CamAll[] = {
    { 1, 2140, camX, 41, camY, 41, camZ, 41, intX, 41, intY, 41, intZ, 41, pers, 8, roll, 6 },
};


FCVKEYt MV_SARA_trsX[] = {
    { 0.000000, 0.000000, 0.000000, -17.634001 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -17.634001 },   /*  1   */
    { 0.366667, 0.015472, 0.015472, -17.625385 },   /*  11  */
    { 0.633333, 0.093887, 0.093887, -17.615255 },   /*  18  */
    { 0.666667, 0.000000, 0.000000, -17.611744 },   /*  19  */
    { 1.166667, 0.000000, 0.000000, -17.611744 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -17.611744 },   /*  35  */
    { 71.333336, 0.000000, 0.000000, -17.611744 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -17.611744 },  /*  2140    */
};

FCVKEYt MV_SARA_trsY[] = {
    { 0.000000, 0.000000, 0.000000, 1.400476 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 1.400476 }, /*  1   */
    { 0.333333, 0.008032, 0.008032, 1.410520 }, /*  9   */
    { 0.633333, -0.180304, -0.180304, 1.393197 },   /*  18  */
    { 0.666667, 0.000000, 0.000000, 1.386427 }, /*  19  */
    { 1.166667, -2.037064, -2.037064, 1.014027 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -0.462373 },    /*  35  */
    { 71.333336, 0.000000, 0.000000, -0.462373 },   /*  2140    */
    { 71.349998, 0.000000, 0.000000, -0.462373 },   /*  2140    */
};

FCVKEYt MV_SARA_trsZ[] = {
    { 0.000000, 0.000000, 0.000000, -11.732664 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -11.732664 },   /*  1   */
    { 0.233333, 0.083130, 0.083130, -11.720198 },   /*  7   */
    { 0.666667, 0.000000, 0.000000, -11.681818 },   /*  19  */
    { 1.166667, 0.000000, 0.000000, -11.681818 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, -11.681818 },   /*  35  */
    { 71.333336, 0.000000, 0.000000, -11.681818 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -11.681818 },  /*  2140    */
};

FCVKEYt MV_SARA_rotX[] = {
    { 0.000000, 0.000000, 0.000000, 290.105835 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, 290.105835 },   /*  1   */
    { 0.233333, 20.229933, 20.229933, 292.937866 }, /*  7   */
    { 0.666667, 0.000000, 0.000000, 300.772583 },   /*  19  */
    { 1.166667, 0.000000, 0.000000, 300.772583 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, 300.772583 },   /*  35  */
    { 71.333336, 0.000000, 0.000000, 300.772583 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, 300.772583 },  /*  2140    */
};

FCVKEYt MV_SARA_rotY[] = {
    { 0.000000, 0.000000, 0.000000, 214.165848 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, 214.165848 },   /*  1   */
    { 0.133333, 22.990704, 22.990704, 217.055679 }, /*  3   */
    { 0.366667, 22.226696, 22.226696, 221.120392 }, /*  11  */
    { 0.533333, -2.510378, -2.510378, 223.285309 }, /*  15  */
    { 0.666667, 0.000000, 0.000000, 222.508209 },   /*  19  */
    { 1.166667, 0.000000, 0.000000, 222.508209 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, 222.508209 },   /*  35  */
    { 71.333336, 0.000000, 0.000000, 222.508209 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, 222.508209 },  /*  2140    */
};

FCVKEYt MV_SARA_rotZ[] = {
    { 0.000000, 0.000000, 0.000000, 310.778503 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, 310.778503 },   /*  1   */
    { 0.133333, -13.323200, -13.323200, 309.788300 },   /*  3   */
    { 0.400000, 1.052400, 1.052400, 305.758209 },   /*  11  */
    { 0.633333, 26.515480, 26.515480, 307.721985 }, /*  18  */
    { 0.666667, 0.000000, 0.000000, 308.697662 },   /*  19  */
    { 1.166667, 0.000000, 0.000000, 308.697662 },   /*  34  */
    { 1.200000, 0.000000, 0.000000, 308.697662 },   /*  35  */
    { 71.333336, 0.000000, 0.000000, 308.697662 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, 308.697662 },  /*  2140    */
};

FCVKEYt MV_AKI_trsX[] = {
    { 0.000000, 0.000000, 0.000000, -19.327665 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -19.327665 },   /*  1   */
    { 6.333333, 0.000000, 0.000000, -19.327665 },   /*  189 */
    { 6.366667, 0.000000, 0.000000, -19.804729 },   /*  191 */
    { 14.500001, 0.000000, 0.000000, -19.804729 },  /*  435 */
    { 14.533334, 0.000000, 0.000000, -18.692085 },  /*  436 */
    { 26.200001, 0.000000, 0.000000, -18.692085 },  /*  786 */
    { 28.833334, 0.000000, 0.000000, -18.695272 },  /*  865 */
    { 38.666664, 0.000000, 0.000000, -18.719801 },  /*  1159    */
    { 38.699997, 0.000000, 0.000000, -20.134617 },  /*  1160    */
    { 55.666668, 0.000000, 0.000000, -20.134617 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -20.134617 },  /*  1671    */
    { 61.666668, 0.000000, 0.000000, -20.134617 },  /*  1850    */
    { 63.700001, 0.000000, 0.000000, -20.134617 },  /*  1911    */
    { 71.333336, 0.000000, 0.000000, -20.134617 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -20.134617 },  /*  2140    */
};

FCVKEYt MV_AKI_trsY[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 0.000000 }, /*  1   */
    { 6.333333, 0.000000, 0.000000, 0.000000 }, /*  189 */
    { 6.366667, 0.000000, 0.000000, 0.000000 }, /*  191 */
    { 14.500001, 0.000000, 0.000000, 0.000000 },    /*  435 */
    { 14.533334, 0.000000, 0.000000, 0.000000 },    /*  436 */
    { 26.166664, 0.000000, 0.000000, 0.000000 },    /*  784 */
    { 26.200001, 0.000000, 0.000000, 0.000000 },    /*  786 */
    { 28.833334, 0.000000, 0.000000, 0.000000 },    /*  865 */
    { 38.666664, 0.000000, 0.000000, 0.000000 },    /*  1159    */
    { 38.699997, 0.000000, 0.000000, 0.000000 },    /*  1160    */
    { 55.666668, 0.000000, 0.000000, 0.000000 },    /*  1670    */
    { 55.700001, 0.000000, 0.000000, 0.000000 },    /*  1671    */
    { 61.666668, 0.000000, 0.000000, 0.000000 },    /*  1850    */
    { 61.700001, 0.000000, 0.000000, 0.000000 },    /*  1851    */
    { 63.666668, 0.000000, 0.000000, 0.000000 },    /*  1910    */
    { 63.700001, 0.000000, 0.000000, 0.000000 },    /*  1911    */
    { 71.333336, 0.000000, 0.000000, 0.000000 },    /*  2140    */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_AKI_trsZ[] = {
    { 0.000000, 0.000000, 0.000000, -11.409147 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -11.409147 },   /*  1   */
    { 6.333333, 0.000000, 0.000000, -11.409147 },   /*  189 */
    { 6.366667, 0.000000, 0.000000, -11.409147 },   /*  191 */
    { 14.500001, 0.000000, 0.000000, -11.409147 },  /*  435 */
    { 14.533334, 0.000000, 0.000000, -12.452253 },  /*  436 */
    { 26.200001, 0.000000, 0.000000, -12.452253 },  /*  786 */
    { 28.833334, 0.000000, 0.000000, -12.454630 },  /*  865 */
    { 38.666664, 0.000000, 0.000000, -12.472921 },  /*  1159    */
    { 38.699997, 0.000000, 0.000000, -12.472921 },  /*  1160    */
    { 55.666668, 0.000000, 0.000000, -12.472921 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -12.472921 },  /*  1671    */
    { 61.666668, 0.000000, 0.000000, -12.472921 },  /*  1850    */
    { 63.700001, 0.000000, 0.000000, -12.472921 },  /*  1911    */
    { 71.333336, 0.000000, 0.000000, -12.472921 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -12.472921 },  /*  2140    */
};

FCVKEYt MV_AKI_rotX[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_AKI_rotY[] = {
    { 0.000000, 0.000000, 0.000000, -45.000000 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -45.000000 },   /*  1   */
    { 6.333333, 0.000000, 0.000000, -45.000000 },   /*  189 */
    { 6.366667, 0.000000, 0.000000, -45.000000 },   /*  191 */
    { 14.500001, 0.000000, 0.000000, -45.000000 },  /*  435 */
    { 14.533334, 0.000000, 0.000000, -45.000000 },  /*  436 */
    { 26.166664, 0.000000, 0.000000, -45.000000 },  /*  784 */
    { 26.200001, 0.000000, 0.000000, -45.000000 },  /*  786 */
    { 28.833334, 0.000000, 0.000000, -45.000000 },  /*  865 */
    { 28.866667, 0.000000, 0.000000, -15.000000 },  /*  866 */
    { 38.666668, 0.000000, 0.000000, -15.000000 },  /*  1160    */
    { 38.699997, 0.000000, 0.000000, -45.000000 },  /*  1160    */
    { 55.666668, 0.000000, 0.000000, -45.000000 },  /*  1670    */
    { 55.700001, 0.000000, 0.000000, -45.000000 },  /*  1671    */
    { 61.666668, 0.000000, 0.000000, -45.000000 },  /*  1850    */
    { 63.700001, 0.000000, 0.000000, -45.000000 },  /*  1911    */
    { 71.333336, 0.000000, 0.000000, -45.000000 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -45.000000 },  /*  2140    */
};

FCVKEYt MV_AKI_rotZ[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_CHI_trsX[] = {
    { 0.000000, 0.000000, 0.000000, -17.552250 },   /*  0   */
    { 0.033334, 0.000000, 0.000000, -17.552250 },   /*  1   */
    { 16.000000, 0.000000, 0.000000, -17.552250 },  /*  480 */
    { 16.033333, 0.000002, 0.000002, -17.552250 },  /*  480 */
    { 20.333330, 0.000000, 0.000000, -17.552240 },  /*  609 */
    { 20.366663, 0.000000, 0.000000, -17.517612 },  /*  610 */
    { 24.199997, 0.000000, 0.000000, -17.517612 },  /*  725 */
    { 24.399998, 0.000000, 0.000000, -17.517612 },  /*  731 */
    { 24.433331, 0.000000, 0.000000, -18.713762 },  /*  732 */
    { 26.833332, 0.000000, 0.000000, -18.713854 },  /*  804 */
    { 26.866665, 0.000000, 0.000000, -21.726151 },  /*  805 */
    { 38.666668, 0.000000, 0.000000, -21.726151 },  /*  1160    */
    { 38.700001, 0.000000, 0.000000, -20.165380 },  /*  1161    */
    { 71.333336, 0.000000, 0.000000, -20.165380 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -20.165380 },  /*  2140    */
};

FCVKEYt MV_CHI_trsY[] = {
    { 0.000000, 0.000000, 0.000000, 3.969946 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 3.969946 }, /*  1   */
    { 16.000000, 0.000000, 0.000000, 3.969946 },    /*  480 */
    { 16.033333, 0.000000, 0.000000, 3.969946 },    /*  480 */
    { 20.333330, 0.000000, 0.000000, 3.969946 },    /*  609 */
    { 20.366663, 0.000000, 0.000000, 4.750000 },    /*  610 */
    { 24.199997, 0.000000, 0.000000, 4.750000 },    /*  725 */
    { 24.399998, 0.000000, 0.000000, 4.750000 },    /*  731 */
    { 24.433331, 0.000000, 0.000000, 3.866957 },    /*  732 */
    { 26.833332, 0.000000, 0.000000, 3.866889 },    /*  804 */
    { 26.866665, 0.000000, 0.000000, 2.500000 },    /*  805 */
    { 38.666668, 0.000000, 0.000000, 2.500000 },    /*  1160    */
    { 38.700001, 0.000000, 0.000000, 0.000000 },    /*  1161    */
    { 71.333336, 0.000000, 0.000000, 0.000000 },    /*  2140    */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_CHI_trsZ[] = {
    { 0.000000, 0.000000, 0.000000, -20.493742 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -20.493742 },   /*  1   */
    { 16.000000, 0.000000, 0.000000, -20.493742 },  /*  480 */
    { 16.033333, 0.000000, 0.000000, -18.420145 },  /*  480 */
    { 20.333330, 0.000000, 0.000000, -18.420145 },  /*  609 */
    { 20.366663, 0.000000, 0.000000, -18.899611 },  /*  610 */
    { 24.199997, 0.000000, 0.000000, -18.899611 },  /*  725 */
    { 24.399998, 0.000000, 0.000000, -18.899611 },  /*  731 */
    { 24.433331, 0.000000, 0.000000, -18.899611 },  /*  732 */
    { 26.833332, 0.000000, 0.000000, -18.899611 },  /*  804 */
    { 26.866665, 0.000000, 0.000000, -18.739725 },  /*  805 */
    { 38.666668, 0.000000, 0.000000, -18.739725 },  /*  1160    */
    { 38.700001, 0.000000, 0.000000, -15.819489 },  /*  1161    */
    { 71.333336, 0.000000, 0.000000, -15.819489 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -15.819489 },  /*  2140    */
};

FCVKEYt MV_CHI_rotX[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_CHI_rotY[] = {
    { 0.000000, 0.000000, 0.000000, 90.000000 },    /*  0   */
    { 0.033333, 0.000000, 0.000000, 90.000000 },    /*  1   */
    { 16.000000, 0.000000, 0.000000, 90.000000 },   /*  480 */
    { 16.033333, 0.000000, 0.000000, 90.000000 },   /*  480 */
    { 20.333330, 0.000000, 0.000000, 90.000000 },   /*  609 */
    { 20.366663, 0.000000, 0.000000, 90.000000 },   /*  610 */
    { 24.199997, 0.000000, 0.000000, 90.000000 },   /*  725 */
    { 24.399998, 0.000000, 0.000000, 90.000000 },   /*  731 */
    { 24.433331, 0.000000, 0.000000, 90.000000 },   /*  732 */
    { 26.833332, 0.000000, 0.000000, 90.000000 },   /*  804 */
    { 26.866665, 0.000000, 0.000000, 90.000000 },   /*  805 */
    { 38.666668, 0.000000, 0.000000, 90.000000 },   /*  1160    */
    { 38.700001, 0.000000, 0.000000, 195.000000 },  /*  1161    */
    { 71.333336, 0.000000, 0.000000, 195.000000 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, 195.000000 },  /*  2140    */
};

FCVKEYt MV_CHI_rotZ[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_OTH_trsX[] = {
    { 0.000000, 0.000000, 0.000000, -17.111021 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -17.111021 },   /*  1   */
    { 6.333333, 0.000000, -14.778397, -17.111021 }, /*  189 */
    { 6.366667, -14.778397, 0.000000, -18.096249 }, /*  191 */
    { 12.500000, 0.000000, 0.000000, -18.096249 },  /*  375 */
    { 28.833334, 0.000000, -16.996536, -18.096249 },    /*  865 */
    { 28.866667, -16.996536, 0.000000, -18.662800 },    /*  866 */
    { 38.666668, 0.000000, -27.584106, -18.662800 },    /*  1160    */
    { 38.700001, -27.584106, 0.000000, -19.582270 },    /*  1161    */
    { 71.333336, 0.000000, 0.000000, -19.582270 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -19.582270 },  /*  2140    */
};

FCVKEYt MV_OTH_trsY[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 0.033333, 0.000000, 0.000000, 0.000000 }, /*  1   */
    { 6.333333, 0.000000, 0.000000, 0.000000 }, /*  189 */
    { 6.366667, 0.000000, 0.000000, 0.000000 }, /*  191 */
    { 12.500000, 0.000000, 0.000000, 0.000000 },    /*  375 */
    { 28.833334, 0.000000, 0.000000, 0.000000 },    /*  865 */
    { 28.866663, 0.000000, 0.000000, 0.000000 },    /*  865 */
    { 38.666668, 0.000000, 0.000000, 0.000000 },    /*  1160    */
    { 38.700001, 0.000000, 0.000000, 0.000000 },    /*  1161    */
    { 71.333336, 0.000000, 0.000000, 0.000000 },    /*  2140    */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_OTH_trsZ[] = {
    { 0.000000, 0.000000, 0.000000, -15.623861 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, -15.623861 },   /*  1   */
    { 6.333333, 0.000000, -13.981293, -15.623861 }, /*  189 */
    { 6.366667, -13.981293, 0.000000, -16.555948 }, /*  191 */
    { 12.500000, 0.000000, 0.000000, -16.555948 },  /*  375 */
    { 28.833334, 0.000000, 0.000000, -16.555948 },  /*  865 */
    { 38.666668, 0.000000, -13.895325, -16.555948 },    /*  1160    */
    { 38.700001, -13.895325, 0.000000, -17.019125 },    /*  1161    */
    { 71.333336, 0.000000, 0.000000, -17.019125 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, -17.019125 },  /*  2140    */
};

FCVKEYt MV_OTH_rotX[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};

FCVKEYt MV_OTH_rotY[] = {
    { 0.000000, 0.000000, 0.000000, 132.467484 },   /*  0   */
    { 0.033333, 0.000000, 0.000000, 132.467484 },   /*  1   */
    { 6.333333, 0.000000, 0.000000, 132.467484 },   /*  189 */
    { 12.500000, 0.000000, 0.000000, 132.467484 },  /*  375 */
    { 28.833334, 0.000000, 0.000000, 132.467484 },  /*  865 */
    { 38.666668, 0.000000, 0.000000, 132.467484 },  /*  1160    */
    { 38.700001, 0.000000, 0.000000, 132.467484 },  /*  1161    */
    { 71.333336, 0.000000, 0.000000, 132.467484 },  /*  2140    */
    { 71.349998, 0.000000, 0.000000, 132.467484 },  /*  2140    */
};

FCVKEYt MV_OTH_rotZ[] = {
    { 0.000000, 0.000000, 0.000000, 0.000000 }, /*  0   */
    { 71.349998, 0.000000, 0.000000, 0.000000 },    /*  2140    */
};


ObjMove MoveAll[] = {
    { 1, 2140, MV_SARA_trsX, 9, MV_SARA_trsY, 9, MV_SARA_trsZ, 8, MV_SARA_rotX, 8, MV_SARA_rotY, 10, MV_SARA_rotZ, 10, NULL, 0, NULL, 0, NULL, 0 },
    { 1, 2140, MV_AKI_trsX, 16, MV_AKI_trsY, 19, MV_AKI_trsZ, 16, MV_AKI_rotX, 2, MV_AKI_rotY, 18, MV_AKI_rotZ, 2, NULL, 0, NULL, 0, NULL, 0 },
    { 1, 2140, MV_CHI_trsX, 15, MV_CHI_trsY, 15, MV_CHI_trsZ, 15, MV_CHI_rotX, 2, MV_CHI_rotY, 15, MV_CHI_rotZ, 2, NULL, 0, NULL, 0, NULL, 0 },
    { 1, 2140, MV_OTH_trsX, 11, MV_OTH_trsY, 11, MV_OTH_trsZ, 10, MV_OTH_rotX, 2, MV_OTH_rotY, 9, MV_OTH_rotZ, 2, NULL, 0, NULL, 0, NULL, 0 },
};


Uint32 Scene[] = {
    1, 1, 4, 1, 0, 0, 0,
    50, 0, 0, 0, 0, 0, 1,
    75, 0, 0, 1, 0, 0, 0,
    92, 0, 0, 0, 0, 1, 0,
    191, 0, 0, 1, 0, 0, 0,
    286, 0, 0, 1, 0, 0, 0,
    390, 0, 0, 0, 0, 1, 0,
    407, 0, 0, 0, 0, 0, 1,
    436, 0, 0, 1, 0, 0, 0,
    481, 0, 0, 1, 0, 0, 0,
    611, 0, 0, 1, 0, 0, 0,
    733, 0, 0, 1, 0, 0, 0,
    740, 0, 0, 0, 0, 1, 0,
    821, 0, 0, 0, 0, 1, 0,
    856, 0, 0, 1, 0, 0, 0,
    866, 0, 0, 1, 0, 0, 0,
    1161, 0, 0, 2, 0, 0, 0,
    1162, 0, 0, 0, 0, 1, 0,
    1290, 0, 0, 0, 0, 1, 0,
    1415, 0, 0, 0, 0, 1, 0,
    1560, 0, 0, 0, 0, 1, 0,
    1648, 0, 0, 0, 0, 1, 0,
    1671, 0, 0, 2, 0, 0, 0,
    1770, 0, 0, 0, 0, 1, 0,
    1930, 0, 0, 0, 0, 1, 0,
    2110, 0, 0, 0, 0, 1, 0,
    2110, 2140,
};

Uint32 MoveID[] = {
    ID_SARA, MV_SARA,       /* 1 */
    ID_AKI, MV_AKI,     /* 1 */
    ID_CHI, MV_CHI,     /* 1 */
    ID_OTH, MV_OTH,     /* 1 */
};

Uint32 EffectID[] = {
    NULL, NULL,
};

Uint32 MotionID[] = {
    ID_AKI, MN_AKI_YABAI_SYOUBAI_0134, 375, 659, 0,     /* 1 */ /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/AKI_YABAI_SYOUBAI_0134.dsc */
    ID_OTH, MN_KIS_IKITE_KAERENAI_SOUKO_0134, 1220, 1345, 0,        /* 75 */    /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/KIS_IKITE_KAERENAI_SOUKO_0134.dsc */
    ID_OTH, MN_KIS_IKITE_KAERENAI_SOUKO_0134, 1460, 3335, 0,        /* 191 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/KIS_IKITE_KAERENAI_SOUKO_0134.dsc */
    ID_AKI, MN_AKI_YABAI_SYOUBAI_0134, 990, 1139, 0,        /* 286 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/AKI_YABAI_SYOUBAI_0134.dsc */
    ID_AKI, MN_AKI_HOUOUKYOU_MOTTENAI_0134, 410, 839, 0,        /* 436 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/AKI_HOUOUKYOU_MOTTENAI_0134.dsc */
    ID_CHI, MN_YKI_CIN_ORIRU_KAIDAN_ST_0134, 180, 309, 0,       /* 481 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_ORIRU_KAIDAN_ST_0134.dsc */
    ID_CHI, MN_YKI_CIN_ORIRU_KAIDAN_LP_0134, 1, 122, 0,     /* 611 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_ORIRU_KAIDAN_LP_0134.dsc */
    ID_CHI, MN_YKI_CIN_ORIRU_KAIDAN_LP_0134, 1, 123, 0,     /* 733 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_ORIRU_KAIDAN_LP_0134.dsc */
    ID_CHI, MN_YKI_CIN_ORIRU_KAIDAN_LP_0134, 1, 123, 0,     /* 856 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_ORIRU_KAIDAN_LP_0134.dsc */
    ID_CHI, MN_YKI_CIN_ORIRU_KAIDAN_EN_0134, 1, 295, 0,     /* 866 */   /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_ORIRU_KAIDAN_EN_0134.dsc */
    ID_AKI, MN_AKI_HOUOUKYOU_MOTTENAI_0134, 750, 1259, 0,       /* 1161 */  /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/AKI_HOUOUKYOU_MOTTENAI_0134.dsc */
    ID_CHI, MN_YKI_CIN_HOUOUKYOU_MOTTENAI_0134, 850, 1359, 0,       /* 1161 */  /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_HOUOUKYOU_MOTTENAI_0134.dsc */
    ID_AKI, MN_AKI_HOUOUKYOU_MOTTENAI_0134, 1160, 1590, 0,      /* 1671 */  /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/AKI_HOUOUKYOU_MOTTENAI_0134.dsc */
    ID_CHI, MN_YKI_CIN_HOUOUKYOU_MOTTENAI_0134, 1160, 1679, 0,      /* 1671 */  /* /p16/prj16m5/AUTH01/0154/MOTION/dsc/SCENES/YKI_CIN_HOUOUKYOU_MOTTENAI_0134.dsc */
};

Uint32 VoiceID[] = {
    ID_OTH, VA0154B001, 0,      /* 92 */    /* /p16/prj16m5/AUTH01/0154/SOUND/A0154B001.aiff */
    ID_CHI, VA0154C001, 0,      /* 390 */   /* /p16/prj16m5/AUTH01/0154/SOUND/A0154C001.aiff */
    ID_OTH, VA0154B002, 0,      /* 740 */   /* /p16/prj16m5/AUTH01/0154/SOUND/A0154B002.aiff */
    ID_AKI, VA0154A002, 0,      /* 821 */   /* /p16/prj16m5/AUTH01/0154/SOUND/A0154A002.aiff */
    ID_CHI, VA0154C002, 0,      /* 1162 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154C002.aiff */
    ID_AKI, VA0154A003, 0,      /* 1290 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154A003.aiff */
    ID_AKI, VA0154A004, 0,      /* 1415 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154A004.aiff */
    ID_CHI, VA0154C003, 0,      /* 1560 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154C003.aiff */
    ID_AKI, VA0154A005, 0,      /* 1648 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154A005.aiff */
    ID_CHI, VA0154C004, 0,      /* 1770 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154C004.aiff */
    ID_CHI, VA0154C005, 0,      /* 1930 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154C005.aiff */
    ID_AKI, VA0154A005, 0,      /* 2110 */  /* /p16/prj16m5/AUTH01/0154/SOUND/A0154A005.aiff */
};

char *VoiceName[] = {
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154B001.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154C001.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154B002.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154A002.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154C002.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154A003.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154A004.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154C003.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154A005.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154C004.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154C005.aiff",
    "/p16/prj16m5/AUTH01/0154/SOUND/A0154A005.aiff",
};

Uint32 SoundEffectID[] = {
    ID_AKI, Vdishcrash1,        /* 50 */    /* /p16/prj16m5/AUTH01/0154/SE/smallobject/dishcrash1.aiff */
    ID_OTH, VRYOASHIKONKURI_1,      /* 407 */   /* /p16/prj16m5/AUTH01/0154/SE/foot2/RYOASHIKONKURI_1.aiff */
};

char *SoundEffectName[] = {
    "/p16/prj16m5/AUTH01/0154/SE/smallobject/dishcrash1.aiff",
    "/p16/prj16m5/AUTH01/0154/SE/foot2/RYOASHIKONKURI_1.aiff",
};

\SCENE\99\MS08\SEQCONV.C#

/* $Id: seqconv.c,v 1.34 1998/09/30 09:47:24 hyamada Exp hyamada $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "seqdata.h"

/*#define TIME_CHECK*/

#ifdef USER_takanao
#undef USER_takanao
#endif
/*#define USER_takanao /* デバッグシンボル */

/* 
 *  構造体
 */
typedef struct  {
    int     id; /* 'TRCK' */
    int     size;
    char    endian; /* 0:little, 1:big */
    char    version;
    char    xxx1;
    char    xxx2;
    int     nframes;
} SEQHEADER;

typedef struct  {
    char    type;
    char    argc;
    short   xxxx;
    int     args[1];
} SEQ;

enum    {
    /* シーケンスコマンド */
    stEND = 0,
    stCAMERA,
    stMOVE,
    stMOTION,
    stEFFECT,
    stVOICE,
    stSE,

    /* バッファサイズ */
    SEQBSIZE = 128*1024,
    CAMBSIZE = 256*1024,
    MOVBSIZE = 512*1024,
    MAXTBL  = 128,
    MAXSTR  = 1024,
    MAXCLIP = 1024,

    /* ダミーのID */
    ID_CAMERA = MAKE_ID('(','^','^',';'),
};

typedef struct  {       /* 作業領域の割り当て */
    char    track[8];
    char    seq[SEQBSIZE];
    char    cam[CAMBSIZE];
    char    mov[MOVBSIZE];
    char    *camtbl[MAXTBL];
    char    *movtbl[MAXTBL];
    char    *strtbl[MAXSTR];
    short   *cliptbl[MAXCLIP];
} WORK;

/* 
 *  プロトタイプ
 */
static  int MakeCamOnly();
static  int MakeData();
static  void    TransSplData();
static  int *ReqCamera(int *, int);
static  int *ReqMove(int *, int);
static  int *ReqMotion(int *, int);
static  int *ReqEffect(int *, int);
static  int *ReqVoice(int *, int);
static  int *ReqSE(int *, int);
static  int WriteFile();

static  void    CreateCamData(void );
static  void    CreateMovData(void );
static  void    *CreateSplData(int *, void *, int );
static  int     fwrites(char *fname, void *buff, int size);

extern  void    SetEndian(int big);
extern  int endian(void );
extern  int     GetInt16(void *);
extern  int     GetInt32(void *);
extern  void    SetInt16(void *, int);
extern  void    SetInt32(void *, int);

extern  float   GetAiffTime(char *fname);

/*
 *  グローバル変数
 */
extern  Uint32  Scene[];
extern  Uint32  MoveID[];
extern  Uint32  EffectID[];
extern  Uint32  MotionID[];
extern  Uint32  VoiceID[];
extern  Uint32  SoundEffectID[];
extern  ObjMove MoveAll[];
extern  Camera  CamAll[];
extern  char    *VoiceName[];
extern  char    *SoundEffectName[];
extern  float   PlayOffs[3];
extern  float   PlayRot[3];
float   *xxx = PlayRot;     /* 使ってないけどエラーを起こさせるため */
extern  char    _fdata[];
extern  char    _fbss[];

static  char    usage[] = {
    "seqconv 1.34\n"
    "\n"
    "usage : seqconv [-o outfile]\n"
    "        seqconv -c camno [-o outfile]\n"
};
static  char    *outfn = "seqdata.bin";
static  int camno;          /* camera number */
static  char    camout;         /* -c option */
static  char    aifftime;       /* -a option */
static  char    verbose;        /* -v option */
static  char    viderr;         /* voice ID error */

static  WORK    *work;
static  char    *workbuff, *workdatap;
static  char    *camdata, *movdata;
static  int ncam, nmov, nstr, nclip, nv, nse;

static  int *scMove   = (int *)MoveID;
static  int *scMotion = (int *)MotionID;
static  int *scEffect = (int *)EffectID;
static  int *scVoice  = (int *)VoiceID;
static  int *scSE     = (int *)SoundEffectID;

/*
 *  main
 */

int main(int argc, char *argv[])
{
    /* オプションチェック */
    argv++;
    for ( ; argv[0] && argv[0][0] == '-'; argv++ ){ /* options */
    switch ( argv[0][1] ){
    case 'l':
        break;
    case 'o':
        argv++;
        outfn = argv[0];
        break;
    case 'a':
        aifftime = 1;
        break;
    case 'c':
        argv++;
        camout = 1;
        camno = atoi(argv[0]);
        break;
    case 'v':
        verbose = 1;
        break;
    default :
        printf(usage);
        return 2;   /* NG */
    }
    }

    /* カメラ番号チェック */
    if ( camno > 9999 ){
    printf("seqconv: camera number %d too large\n", camno);
    return 1;   /* NG */
    }

    /* little-endianに設定 */
    SetEndian(0);

    /* メモリ確保 */
    if ( !AllocMem() ){
    return 1;   /* NG */
    }

    /* データの作成 */
    if ( camout ){
    if ( !MakeCamOnly() ){
        return 1;   /* NG */
    }
    }
    else {
    if ( !MakeData() ){
        return 1;   /* NG */
    }
    }

    /* ファイルの書き込み */
    if ( !WriteFile() ){
    return 1;   /* NG */
    }

    /* おしまい */
    free(workbuff);

    if ( viderr ){
    printf("VoiceID[] にファイル名が入ってるようですので、ついでの時に直して下さい。\n");
    }
    return 0;   /* OK */
}

/*
 *  ファイルの書き込み
 */

int WriteFile()
{
    FILE *fp;
    int   size;

    fp = fopen(outfn, "w");
    if ( !fp ){
    printf("%s : cannot open\n", outfn);
    return 0;   /* NG */
    }
    size = GetInt32(&workbuff[4]);
    if ( fwrite(workbuff, 1, size, fp) != size ){
    printf("%s : write error\n", outfn);
    return 0;   /* NG */
    }
    close(fp);
    return 1;   /* OK */
}

/*
 *  メモリ確保
 */

int AllocMem()
{
    workbuff = malloc(sizeof(WORK)+1024);   /* 多いめに */
    if ( !workbuff ){
    printf("seqconv: not enough memory\n");
    return 0;   /* NG */
    }
    memset(workbuff, 0, sizeof(WORK));
    work = (WORK *)workbuff;
    camdata = work->cam;
    movdata = work->mov;
}

/*
 *  カメラデータのみの作成
 */

int MakeCamOnly()
{
    int  datasize;

    /* カメラデータの作成 */
    CreateCamData();

    /* データをバッファ先頭へ転送 */
    datasize = camdata - work->cam;
    memcpy(workbuff, work->cam, datasize);
}

/*
 *  データの作成
 */

int MakeData()
{ 
#define seqhdr ((SEQHEADER *)work->seq)
    int  *seq, *ip;
    int   nframes;

    /* シーケンスデータの作成 */

    seq = (int *)(work->seq + sizeof(SEQHEADER));
    ip  = Scene;
    for (;;){
    SetInt32(seq++, ip[0]);     /* frame */
    if ( ip[1] ){           /* CAMERA */
        seq = ReqCamera(seq, ip[1]);
    }
    if ( ip[2] ){           /* MOVE */
        seq = ReqMove(seq, ip[2]);
    }
    if ( ip[3] ){           /* MOTION */
        seq = ReqMotion(seq, ip[3]);
    }
    if ( ip[4] ){           /* EFFECT */
        seq = ReqEffect(seq, ip[4]);
    }
    if ( ip[5] ){           /* VOICE */
        seq = ReqVoice(seq, ip[5]);
    }
    if ( ip[6] ){           /* SE */
        seq = ReqSE(seq, ip[6]);
    }
    SetInt32(seq++, stEND);
    ip += 7;
    if ( ip[1] > 1 ){
        nframes = ip[1];
        break;
    }
    }
    SetInt32(seq++, -1);        /* end mark */
    workdatap = (char *)seq;

    /* リミットチェック */

    if ( (char *)seq >= &work->seq[SEQBSIZE] ){
    printf("seqconv: conversion error (seq,internal)\n");
    return 0;   /* NG */
    }
    if ( camdata >= &work->cam[CAMBSIZE] ){
    printf("seqconv: conversion error (cam,internal)\n");
    return 0;   /* NG */
    }
    if ( movdata >= &work->mov[MOVBSIZE] ){
    printf("seqconv: conversion error (mov,internal)\n");
    return 0;   /* NG */
    }

    /* ヘッダの設定 */

    memcpy(&seqhdr->id, "ASEQ", 4);
    SetInt32(&seqhdr->size, (char *)seq - work->seq);
    SetInt32(&seqhdr->nframes, nframes);
    seqhdr->endian  = endian();
    seqhdr->version = 5;

    /* スプラインデータの転送 */

    TransSplData();

    /* 全体ヘッダの設定 */

    memcpy(workbuff, "TRCK", 4);
    SetInt32(workbuff+4, workdatap - workbuff);
}

/*
 *  スプラインデータの転送
 */

static void TransSplData()
{
    int   i, headsize, datasize;
    char  *datap = workdatap;
    short *clipp;

    /* カメラデータの転送 */

    headsize = 16 + (ncam + 1) * sizeof(char **);
    datasize = camdata - work->cam;
    memcpy(datap, "ACAM", 4);           /* chunk ID */
    SetInt32(datap + 4, headsize + datasize);   /* chunk size */
    SetInt32(datap + 12, ncam);         /* 数 */
    datap += 16;
    for (i = 0; i < ncam; i++){     /* オフセットテーブルの作成 */
    SetInt32(datap, work->camtbl[i] - work->cam + headsize);
    datap += 4;
    }
    SetInt32(datap, headsize + datasize);   /* end mark */
    datap += 4;
    memcpy(datap, work->cam, datasize);
    datap += datasize;

    /* 移動データの転送 */

    headsize = 16 + (nmov + 1) * sizeof(char **);
    datasize = movdata - work->mov;
    memcpy(datap, "AMOV", 4);           /* chunk ID */
    SetInt32(datap + 4, headsize + datasize);   /* chunk size */
    SetInt32(datap + 12, nmov);         /* 数 */
    datap += 16;
    for (i = 0; i < nmov; i++){     /* オフセットテーブルの作成 */
    SetInt32(datap, work->movtbl[i] - work->mov + headsize);
    datap += 4;
    }
    SetInt32(datap, headsize + datasize);   /* end mark */
    datap += 4;
    memcpy(datap, work->mov, datasize);
    datap += datasize;

    /* 文字列データの転送 */

    if ( nstr ){
    workdatap = datap;          /* 'ASTR' の先頭をメモ */
    headsize = 16 + (nstr + 1) * sizeof(char *);
    datap += headsize;
    for (i = 0; i < nstr; i++){ 
        SetInt32(workdatap + 16 + i * sizeof(char *), datap - workdatap);
        strcpy(datap, work->strtbl[i]);
        datap += strlen(work->strtbl[i]) + 1;
    }
    SetInt32(workdatap + 16 + i * sizeof(char *), datap - workdatap);
    datap = (char *)(((int)datap + 3) & ~3);    /* 切り上げ */
    memcpy(workdatap, "ASTR", 4);           /* chunk ID */
    SetInt32(workdatap + 4, datap - workdatap);     /* chunk size */
    SetInt32(workdatap + 12, nstr);
    }

    /* 口パクデータの転送 */

#ifdef USER_takanao
      printf("  nclip = %x\n", nclip );
#endif
    if ( nclip ){
    workdatap = datap;          /* 'ALIP' の先頭をメモ */
    headsize = 16 + (nclip + 1) * sizeof(short *);
    datap += headsize;
    for (i = 0; i < nclip; i++){    
        SetInt32(workdatap + 16 + i * sizeof(short *), datap - workdatap);
        clipp = work->cliptbl[i];
        if ( clipp ){
        do {
            SetInt16(datap, *clipp);
            datap += 2;
        } while ( *clipp++ != -1 );
        }
        else {
        SetInt16(datap, -1);
        datap += 2;
        }
    }
    SetInt32(workdatap + 16 + i * sizeof(short *), datap - workdatap);
    datap = (char *)(((int)datap + 3) & ~3);    /* 切り上げ */
    memcpy(workdatap, "ALIP", 4);           /* chunk ID */
    SetInt32(workdatap + 4, datap - workdatap);     /* chunk size */
    SetInt32(workdatap + 12, nclip);
    }

    /* ポインタをメモして戻る */

    workdatap = datap;
}

/*
 *  カメラのリクエスト
 */

static int *ReqCamera(int *a, int n)
{
    SEQ *seq = (SEQ *)a;
    (void)n;                /* 1つだけなので無視 */

    seq->type = stCAMERA;
    seq->argc = 2;
    SetInt32(&seq->args[0], ID_CAMERA);
    SetInt32(&seq->args[1], ncam);
    CreateCamData();
    seq = (SEQ *)&seq->args[2];

    return (int *)seq; 
}

/*
 *  移動のリクエスト
 */

static int *ReqMove(int *a, int n)
{
    SEQ *seq = (SEQ *)a;

    while ( n-- ){
    seq->type = stMOVE;
    seq->argc = 2;
    SetInt32(&seq->args[0], scMove[0]);
    SetInt32(&seq->args[1], nmov);
    CreateMovData();
    seq = (SEQ *)&seq->args[2];
    scMove += 2;
    }
    return (int *)seq; 
}

/*
 *  モーションのリクエスト
 */

static int *ReqMotion(int *a, int n)
{
    SEQ *seq = (SEQ *)a;

    while ( n-- ){
    seq->type = stMOTION;
    seq->argc = 5;
    SetInt32(&seq->args[0], scMotion[0]);
    SetInt32(&seq->args[1], scMotion[1]);
    SetInt32(&seq->args[2], scMotion[2]);
    SetInt32(&seq->args[3], scMotion[3]);
    SetInt32(&seq->args[4], scMotion[4]);
    seq = (SEQ *)&seq->args[5];
    scMotion += 5;
    if ( (char *)scMotion > (char *)VoiceID ){
        printf("older version MotionID[] data\n");
        exit(1);
    }
    }
    return (int *)seq; 
}

/*
 *  特殊効果のリクエスト
 */
static int *ReqEffect(int *a, int n)
{
    int id, type, ptn, spd;
    SEQ *seq = (SEQ *)a;

    type = TYPE_DEFAULT;
    ptn = PTN_DEFAULT;
    spd = SPD_DEFAULT;

    seq->type = stEFFECT;
    seq->argc = 4;
        id = scEffect[0];
    
    while ( n-- ){

      if ( scEffect[1] & TYPE_ID ) {
    type = scEffect[1] & ID_MASK;
      } else
    if ( scEffect[1] & PTN_ID ) {
      ptn = scEffect[1] & ID_MASK;
    } else
      if ( scEffect[1] & SPD_ID ) {
        spd = scEffect[1] & ID_MASK;
      }
      scEffect += 2;
    }

#ifdef USER_takanao
    printf("ReqEffect : %x %d %d %d\n",id, type, ptn, spd );
#endif

    SetInt32(&seq->args[0], id);
    SetInt32(&seq->args[1], type);
    SetInt32(&seq->args[2], ptn);
    SetInt32(&seq->args[3], spd);
    seq = (SEQ *)&seq->args[4];

    return (int *)seq; 
}

/*
 *  声のリクエスト
 */

static int *ReqVoice(int *a, int n)
{
    SEQ *seq = (SEQ *)a;
    float   sec;

    while ( n-- ){
    seq->type = stVOICE;
    seq->argc = 5;
    SetInt32(&seq->args[0], scVoice[0]);
    SetInt32(&seq->args[1], nstr);
    SetInt32(&seq->args[2], -1);
    SetInt32(&seq->args[3], scVoice[1]);
    if ( _fdata <= (char *)scVoice[1] && (char *)scVoice[1] <= _fbss ){
        if ( memcmp((char *)scVoice[1], "/p16", 4) == 0 ){
        printf("VoiceID[%d][1] = -1  (%s)\n", (scVoice - (int *)VoiceID) / 3, scVoice[1]);
        seq->args[3] = -1;
        viderr = 1;
        }
    }
    seq->args[4] = 0;
    if ( aifftime ){
        sec = GetAiffTime(VoiceName[nv]);
        SetInt32(&seq->args[4], *(int *)&sec);

#ifdef USER_takanao
printf("scVoice(length) : %f, %x\n",sec, seq->args[4]);
#endif
    }
    work->strtbl[nstr] = VoiceName[nv];
    nstr++;
    nv++;
/*#ifdef USER_takanao
      printf(" ADR-work = %x %x %x\n",  &work, &work->strtbl, &work->cliptbl );
#endif*/
    if ( scVoice[2] ){
      /* 口パク */
/*#ifdef USER_takanao
      printf(" VoiceID[2] = %d,  nclip = %x,  ADR-cliptbl = %x\n", scVoice[2], nclip, &work->cliptbl[nclip] );
#endif*/
        SetInt32(&seq->args[2], nclip);
        work->cliptbl[nclip++] = (short *)scVoice[2];
    }
    seq = (SEQ *)&seq->args[5];
    scVoice += 3;
    }
    return (int *)seq; 
}

enum {
  SEQCONV_VER2 = -1,
  SE_VOL_DEFAULT = 127,
  SE_PACK_DEFAULT = 4,
  SE_MIDI_DEFAULT = 16,
  SE_FLAG_DEFAULT = 0x00
};
    
#define SE_ADDITION (0.5)

/*
 *  効果音のリクエスト
 */

static int *ReqSE(int *a, int n)
{
    SEQ *seq = (SEQ *)a;
    float   sec;

      while ( n-- ){
    seq->type = stSE;
    seq->argc = 9;
    SetInt32(&seq->args[0], scSE[0]);
    SetInt32(&seq->args[1], scSE[1]);
    SetInt32(&seq->args[2], nstr);
    SetInt32(&seq->args[3], scSE[2]);
    if ( scSE[2] == SEQCONV_VER2 ) {
      /* 新バージョンデータ */
/*#ifdef USER_takanao
printf("scSE(Ver3) : %x, %x, %d, %d, %d, %d, %d\n",scSE[0],scSE[1],scSE[2],scSE[3],scSE[4],scSE[5],scSE[6]);
#endif
*/    SetInt32(&seq->args[4], scSE[3]);    /* vol */
      SetInt32(&seq->args[5], scSE[4]);    /* pack */
      SetInt32(&seq->args[6], scSE[5]);    /* MIDI */
      SetInt32(&seq->args[7], scSE[6]);    /* flag */
      scSE += 7;
    } else {
      /* 旧バージョンデータ */
/*#ifdef USER_takanao
printf("scSE(Ver1) : %x, %x\n",scSE[0], scSE[1]);
#endif
*/    SetInt32(&seq->args[4], SE_VOL_DEFAULT);    /* vol */
      SetInt32(&seq->args[5], SE_PACK_DEFAULT);    /* pack */
      SetInt32(&seq->args[6], SE_MIDI_DEFAULT);    /* MIDI */
      SetInt32(&seq->args[7], SE_FLAG_DEFAULT);    /* flag */
      scSE += 2;
    }

    /* SE長さ */
    seq->args[8] = 0;
    if ( aifftime ){
        sec = GetAiffTime(SoundEffectName[nse]);
        sec += (float)SE_ADDITION;
        SetInt32(&seq->args[8], *(int *)&sec);

/*#ifdef USER_takanao
printf("scSE(length) : %f, %d\n",sec, (int)(sec * 30.0f));
#endif
*/
    }

    seq = (SEQ *)&seq->args[9];
    work->strtbl[nstr] = SoundEffectName[nse];
    nstr++;
    nse++;
      }
    return (int *)seq; 
}

/*-------  多湖スプラインモジュール用データ変換 --------*/
/*
 *  カメラデータの作成
 */

static void CreateCamData()
{
#ifdef TIME_CHECK
    {
    const CAMDATA *cam;
    int num;
    int i;

    cam = CamAll[ncam].cam;
    num = sizeof (CamAll[0].cam) / sizeof (CamAll[0].cam[0]);
    for (i = 0; i < num; i++) {
        if (cam->n >= 2) {
        const FCVKEYt *ptr;
        int n;

        ptr = cam->p;
        for (n = 1; n < cam->n; n++) {
            if (ptr[0].time >= ptr[1].time) {
            static const char *str[]=
            {
                "camX",
                "camY",
                "camZ",
                "intX",
                "intY",
                "intZ",
                "pers",
                "roll",
            };

            printf ("%s[%d].timeの値が正しくありません。N番目のtimeは、N-1番目のtimeより大きくなければなりません。\n", str[i], n);
            exit (1);
            }
            ptr++;
        }
        }
        cam++;
    }
    }
#endif
    work->camtbl[ncam] = camdata;
    camdata = CreateSplData((int *)camdata, &CamAll[ncam].cam, 1);
    ncam++;
}

/*
 *  移動データの作成
 */

static void CreateMovData()
{
#ifdef TIME_CHECK
    {
    const MOVDATA *mov;
    int num;
    int i;

    mov = MoveAll[nmov].mov;
    num = sizeof (MoveAll[0].mov) / sizeof (MoveAll[0].mov[0]);
    for (i = 0; i < num; i++) {
        if (mov->n >= 2) {
        const FCVKEYt *ptr;
        int n;

        ptr = mov->p;
        for (n = 1; n < mov->n; n++) {
            if (ptr[0].time >= ptr[1].time) {
            static const char *str[]=
            {
                "trsX",
                "trsY",
                "trsZ",
                "rotX",
                "rotY",
                "rotZ",
                "kaoX",
                "kaoY",
                "kaoZ",
            };

            printf ("MoveAll[%d]の%s[%d].timeの値が正しくありません。N番目のtimeは、N-1番目のtimeより大きくなければなりません。\n", nmov, str[i], n);
            exit (1);
            }
            ptr++;
        }
        }
        mov++;
    }
    }
#endif
    work->movtbl[nmov] = movdata;
    movdata = CreateSplData((int *)movdata, &MoveAll[nmov].mov, 0);
    nmov++;
}

/*
    MOTION CAMERAのデータ構造      TRANS/ROTのデータ構造       
    +-------------------------------+    +-------------------------------+
    |int32×1       アトリビュート  |    | TRN-X                         |
    +-------------------------------+    |int32×1       key frameの個数 |
    | POS-X                         |    |float×個数    time            |
    |int32×1       key frameの個数 |    |float×個数    value           |
    |float×個数    time            |    |float×個数    slope           |
    |float×個数    value           |    +-------------------------------+
    |float×個数    slope           |    | TRN-Y                         |
    +-------------------------------+    +-------------------------------+
    | POS-Y                         |    | TRN-Z                         |
    +-------------------------------+    +-------------------------------+
    | POS-Z                         |    | ROT-X                         |
    +-------------------------------+    +-------------------------------+
    | INT-X                         |    | ROT-Y                         |
    +-------------------------------+    +-------------------------------+
    | INT-Y                         |    | ROT-Z                         |
    +-------------------------------+    +-------------------------------+
    | INT-Z                         |
    +-------------------------------+
    | PERS                          |
    +-------------------------------+
    (最初と最後を除き、slopeはleftとrightの2つのデータに分割する)
*/
static void *CreateSplData(int *ip, void *dp, int cam)
{
#define EVENTCAM_SPLINE     0x00000001  /* 現在未使用 */
#define EVENTCAM_ROLL       0x00000020  /* ロールデータがついている */
#define EVENTCAM_PERS       0x00000040  /* パースデータがついている */
    static  int  splorder[2][9] =
    {
    { 0,1,2,3,4,5,7,6 },    /* cam用 persよりrollを先にする */
    { 0,1,2,3,4,5,6,7,8 },
    };
    int *so = cam ? splorder[0] : splorder[1];
    int     i, j, n, camsize;
    int     (*datap)[2], numfp, *camdata;
    float   value, offs[9];
    FCVKEYt *fp;

    if ( camout && cam ){
    camdata = ip;
    sprintf((char *)ip, "%04d", camno);
    ip++;                   /* cam No. */
    ip++;                   /* data size(あとで)*/
    }

    /* フラグ設定 */
    datap = (int (*)[2])dp;
    if ( cam ){
    n = EVENTCAM_SPLINE;
    if ( datap[6][1] ){
        n |= EVENTCAM_PERS;
    }
    if ( datap[7][1] ){
        n |= EVENTCAM_ROLL;
    }
    SetInt32(ip++, n);
    }

    /* オフセットの設定 */
    if (cam) {
    for (i = 0; i < 8; i++){
        if ( i < 3 ){                       /* 0,1,2 は X,Y,Z なのでそのまま入れる */
        offs[i] = PlayOffs[i];
        }
        else if ( i < 6 ){                  /* camの 3,4,5 は int-X,Y,Z なので入れる */
        offs[i] = PlayOffs[i - 3];
        }
        else {              /* その他は 0.0 */
        offs[i] = 0.0;
        }
    }
    } else {
    for (i = 0; i < 9; i++){
        if (i < 3) {
        offs[i] = PlayOffs[i];
        } else {
        offs[i] = 0.0;
        }
    }
    }

    /* 並べ替え */

    for (i = 0; i < (cam ? 8 : 9); i++){    /* x y z x y z (p) */
    fp = (FCVKEYt *)datap[so[i]][0];    /* function curve のデータ位置 */
    numfp = datap[so[i]][1];        /* function curve のデータ個数 */

    if ( numfp ){
        /* データ個数を調べる */
        n = numfp * 2 - 2;
        SetInt32(ip++, n);  /* key frameの個数 */

        /* データを並べる */
        for (j = 0; j < numfp; j++){
        value = fp[j].value + offs[i];
        SetInt32(&ip[0],   *(int *)&fp[j].time);
        SetInt32(&ip[n],   *(int *)&value);
        SetInt32(&ip[n*2], *(int *)&fp[j].left_slope);
        if ( j == 0 ){  /* 最初のtimeを zero にしておく */
            SetInt32(ip, 0);
        }
        ip++;
        if ( j != 0 && j != numfp - 1 ){ /* 最初と最後以外は2つのデータ */
            SetInt32(&ip[0],   *(int *)&fp[j].time);
            SetInt32(&ip[n],   *(int *)&value);
            SetInt32(&ip[n*2], *(int *)&fp[j].right_slope);
            ip++;
        }
        }

        /* 次へ */
        ip += n * (3 - 1);      /* time分は進んでいるので、valueとslope分を進める */
    } else {
        SetInt32(ip++, 0);  /* データがない */
    }
    }

    /* デバッグモードならデータ出力 */
    if ( camout && cam ){
    camsize = (char *)ip - (char *)camdata;
    SetInt32(camdata + 1, camsize);
    }

    /* おしまい */
    return ip;
}

/*
 *  ファイル出力
 */

static int fwrites(char *fname, void *buff, int size)
{
    FILE *fp;
    int   wsize;

    fp = fopen(fname, "w");
    if ( !fp ){
    return 0;
    }
    wsize = fwrite(buff, 1, size, fp);
    fclose(fp);
    return wsize;
}

/*-------------  エンディアン変更モジュール ------------*/

/*
 *  グローバル変数
 */

static  char    endian16[2];    /* 16-bitのendian    */
static  char    endian32[4];    /* 32-bitのendian    */
static  char    str_little[] = "\0\1\2\3\0\1";
static  char    str_big[]    = "\3\2\1\0\1\0";
static  void    SetEndianByStr(char *str);

/*
 *  endian データの設定
 */

void SetEndian(int big)
{
    if ( big ){
    SetEndianByStr(str_big);
    }
    else {
    SetEndianByStr(str_little);
    }
}

static void SetEndianByStr(char *str)
{
    endian32[0] = str[0];
    endian32[1] = str[1];
    endian32[2] = str[2];
    endian32[3] = str[3];
    endian16[0] = str[4];
    endian16[1] = str[5];
}

/*
 *  endian の取得
 */

int endian()
{
    return endian16[0] != 0;
}

/*
 *  現在の endian による16/32-bitデータの読み書き
 */

int GetInt16(void *p)
{
    return ((uchar *)p)[endian16[0]] + (((uchar *)p)[endian16[1]] << 8);
}

int GetInt32(void *p)
{
    return ((uchar *)p)[endian32[0]]         + (((uchar *)p)[endian32[1]] << 8) +
       (((uchar *)p)[endian32[2]] << 16) + (((uchar *)p)[endian32[3]] << 24);
}

void SetInt16(void *p, int n)
{
    ((uchar *)p)[endian16[0]] = n;
    ((uchar *)p)[endian16[1]] = n >> 8;
}

void SetInt32(void *p, int n)
{
    ((uchar *)p)[endian32[0]] = n;
    ((uchar *)p)[endian32[1]] = n >> 8;
    ((uchar *)p)[endian32[2]] = n >> 16;
    ((uchar *)p)[endian32[3]] = n >> 24;
}

/*-------------  AIFFファイルモジュール ------------*/

#define ushort  unsigned short

typedef struct  {
    int     FileID;         /* 'FORM'   */
    int     FileSize;
    int     FileType;       /* 'AIFF'   */
    int     CommID;         /* 'COMM'   */
    int     CommSize;
    short   SampleChannel;      /* 1 or 2   */
    short   xxx1;
    short   xxx2;
    short   SampleSize;     /* 8 or 16  */
    ushort  SampleRate[5];      /* 80-bit float */
} AIFFHEADER;

typedef struct  {
    int     chunkID;
    int     chunkSize;
} AIFFCHUNK;

/*
 *  AIFFファイルのプレイ時間を取得
 */

float GetAiffTime(char *fname)
{
    AIFFHEADER  head;
    AIFFCHUNK   chunk;
    FILE    *fp;
    float   sec, rate;
    
    fp = fopen(fname, "r");
    if ( !fp ){
    return 0;   /* NG */
    }
    if ( fread(&head, 1, 38, fp) != 38 ){
    fclose(fp);
    return 0;   /* NG */
    }
    if ( head.FileID != 'FORM' || head.FileType != 'AIFF' ){
    fclose(fp);
    return 0;   /* NG */
    }
    for (;;){
    if ( feof(fp) ){
        fclose(fp);
        return 0;   /* NG */
    }
    fread(&chunk, 1, sizeof(chunk), fp);    /* チャンクヘッダを読む */
    if ( chunk.chunkID == 'SSND' ){     /* サンプリングデータ */
        break;
    }
    fseek(fp, chunk.chunkSize, SEEK_CUR);   /* 次のチャンクへ */
    }
    fclose(fp);
    rate = head.SampleRate[1] >> (0x400e - head.SampleRate[0]); /* 80-bit floatを変換(手抜き)*/
    sec = (chunk.chunkSize - 8) / head.SampleChannel / (head.SampleSize / 8) / rate;
    if ( verbose ){
    printf("%s %d-ch %d-bit %g Hz %f sec\n", fname, head.SampleChannel, head.SampleSize, rate, sec);
    }
    return sec;
}

(Source: Original TCRF research)