Fix CD Audio in JonesCD and add some comments.

svn-id: r45669
This commit is contained in:
Matthew Hoops 2009-11-04 15:41:40 +00:00
parent 5daca46946
commit d2b76368e1
2 changed files with 7 additions and 3 deletions

View File

@ -1029,7 +1029,7 @@ reg_t kDoCdAudio(EngineState *s, int argc, reg_t *argv) {
if (argc < 2)
return NULL_REG;
uint16 track = argv[1].toUint16() - 1;
uint16 track = argv[1].toUint16();
uint32 startFrame = (argc > 2) ? argv[2].toUint16() * 75 : 0;
uint32 totalFrames = (argc > 3) ? argv[3].toUint16() * 75 : 0;

View File

@ -285,7 +285,10 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
if (getSciVersion() == SCI_VERSION_1_1) {
// King's Quest VI CD Audio format
_audioCdStart = g_system->getMillis();
AudioCD.play(track, 1, start, duration);
// Subtract one from track. KQ6 starts at track 1, while ScummVM
// ignores the data track and considers track 2 to be track 1.
AudioCD.play(track - 1, 1, start, duration);
return 1;
} else {
// Jones in the Fast Lane CD Audio format
@ -305,7 +308,8 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
length = audioMap.readUint16LE();
length += audioMap.readByte() << 16;
audioMap.readByte(); // Unknown, always 0x00
// Jones uses the track as the resource value in the map
if (res == track) {
AudioCD.play(1, 1, startFrame, length);
_audioCdStart = g_system->getMillis();