diff -ruN scummvm/CVS/Entries scumm_cd/CVS/Entries
--- scummvm/CVS/Entries	Mon Jan 21 19:50:41 2002
+++ scumm_cd/CVS/Entries	Mon Jan 21 19:45:32 2002
@@ -34,4 +34,8 @@
 /verbs.cpp/1.12/Thu Dec 27 17:51:58 2001//
 /whatsnew.txt/1.3/Sun Jan 13 19:49:26 2002//
 /windows.cpp/1.24/Fri Dec 28 15:26:28 2001//
-D
+D/PocketSCUMM////
+D/debian////
+D/sound////
+D/wince////
+D/scummvm////
diff -ruN scummvm/CVS/Entries.Log scumm_cd/CVS/Entries.Log
--- scummvm/CVS/Entries.Log	Mon Jan 21 19:51:19 2002
+++ scumm_cd/CVS/Entries.Log	Wed Dec 31 18:00:00 1969
@@ -1,4 +0,0 @@
-A D/PocketSCUMM////
-A D/debian////
-A D/sound////
-A D/wince////
diff -ruN scummvm/Makefile scumm_cd/Makefile
--- scummvm/Makefile	Tue Jan 15 07:23:06 2002
+++ scumm_cd/Makefile	Mon Jan 21 19:12:33 2002
@@ -15,7 +15,7 @@
 	saveload.o script.o scummvm.o sound.o string.o \
 	sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \
 	sound/imuse.o sound/fmopl.o sound/adlib.o sound/gmidi.o debugrl.o \
-	akos.o
+	akos.o sound/cdmusic.o
 
 DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
 	windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \
diff -ruN scummvm/PocketSCUMM/CVS/Entries scumm_cd/PocketSCUMM/CVS/Entries
--- scummvm/PocketSCUMM/CVS/Entries	Mon Jan 21 19:50:41 2002
+++ scumm_cd/PocketSCUMM/CVS/Entries	Mon Jan 21 18:54:10 2002
@@ -1 +1,2 @@
-D
+D/gapi////
+D/missing////
diff -ruN scummvm/PocketSCUMM/CVS/Entries.Log scumm_cd/PocketSCUMM/CVS/Entries.Log
--- scummvm/PocketSCUMM/CVS/Entries.Log	Mon Jan 21 19:50:41 2002
+++ scumm_cd/PocketSCUMM/CVS/Entries.Log	Wed Dec 31 18:00:00 1969
@@ -1,2 +0,0 @@
-A D/gapi////
-A D/missing////
diff -ruN scummvm/PocketSCUMM/missing/CVS/Entries scumm_cd/PocketSCUMM/missing/CVS/Entries
--- scummvm/PocketSCUMM/missing/CVS/Entries	Mon Jan 21 19:50:41 2002
+++ scumm_cd/PocketSCUMM/missing/CVS/Entries	Mon Jan 21 18:54:10 2002
@@ -1 +1 @@
-D
+D/sys////
diff -ruN scummvm/PocketSCUMM/missing/CVS/Entries.Log scumm_cd/PocketSCUMM/missing/CVS/Entries.Log
--- scummvm/PocketSCUMM/missing/CVS/Entries.Log	Mon Jan 21 19:50:41 2002
+++ scumm_cd/PocketSCUMM/missing/CVS/Entries.Log	Wed Dec 31 18:00:00 1969
@@ -1 +0,0 @@
-A D/sys////
diff -ruN scummvm/debug.cpp scumm_cd/debug.cpp
--- scummvm/debug.cpp	Thu Dec 27 11:51:58 2001
+++ scumm_cd/debug.cpp	Mon Jan 21 19:12:04 2002
@@ -26,6 +26,8 @@
 #include "stdafx.h"
 #include "scumm.h"
 
+#include "cdmusic.h"
+
 #ifdef HAVE_READLINE
 #include "debugrl.h"
 #endif
@@ -38,6 +40,7 @@
 	CMD_ACTOR,
 	CMD_SCRIPTS,
 	CMD_LOAD_ROOM,
+	CMD_CD_INFO,
 	CMD_EXIT
 };
 
@@ -68,6 +71,7 @@
 				"(a)ctor [actornum] -> show actor information\n"
 				"(r)oom roomnum -> load room\n"
 				"(s)cripts -> show running scripts\n"
+				"(c)dinfo -> show cd and track info\n"
 				"(e)xit -> exit game\n"
 			   );
 		return true;
@@ -102,6 +106,16 @@
 		}
 		return true;
 
+/*-------------------------------------------------------------------------*/
+/*CD Music related commands added by realmz for use with Monkey Island 1
+and for Loom (When Loom support is added and it SHOULD be sooner!) */
+
+        case CMD_CD_INFO:
+	        cd_print_info();
+        return true;
+
+/*-------------------------------------------------------------------------*/
+
 	case CMD_EXIT:
 		exit(1);
 	}
@@ -144,6 +158,7 @@
 	{ "a", 1, CMD_ACTOR },
 	{ "s", 1, CMD_SCRIPTS },
 	{ "r", 1, CMD_LOAD_ROOM },
+	{ "c", 1, CMD_CD_INFO },
 	{ "e", 1, CMD_EXIT },
 	{ 0, 0, 0 },
 };
diff -ruN scummvm/debugrl.cpp scumm_cd/debugrl.cpp
--- scummvm/debugrl.cpp	Sun Nov 18 18:04:34 2001
+++ scumm_cd/debugrl.cpp	Mon Jan 21 19:13:25 2002
@@ -10,6 +10,7 @@
   "go",
   "actor",
   "scripts",
+  "cdinfo",
   "exit",
   (char *)NULL
 };
diff -ruN scummvm/scummvm.cpp scumm_cd/scummvm.cpp
--- scummvm/scummvm.cpp	Thu Dec 27 11:51:58 2001
+++ scumm_cd/scummvm.cpp	Mon Jan 21 19:18:40 2002
@@ -23,6 +23,8 @@
 #include "scumm.h"
 #include "gui.h"
 
+#include "cdmusic.h"
+
 void Scumm::initRandSeeds() {
 	_randSeed1 = 0xA943DE35;
 	_randSeed2 = 0x37A9ED27;
@@ -202,6 +204,12 @@
 //	if (_gameId==GID_MONKEY2 && _bootParam==0) {
 //		_bootParam = 10001;
 //	}
+
+	//Init CD Music if Monkey Island 1
+	if(_gameId==GID_MONKEY) {
+		cd_init(0); //Init for MI1
+
+	}
 
 	initGraphics(this, _fullScreen);
 
diff -ruN scummvm/sdl.cpp scumm_cd/sdl.cpp
--- scummvm/sdl.cpp	Sat Dec 29 06:45:54 2001
+++ scumm_cd/sdl.cpp	Mon Jan 21 19:15:58 2002
@@ -27,6 +27,8 @@
 #include "sound.h"
 #include "SDL_thread.h"
 
+#include "cdmusic.h"
+
 #define SCALEUP_2x2
 
 Scumm scumm;
@@ -98,6 +100,7 @@
 						s->_saveLoadFlag = 2;
 					s->_saveLoadCompatible = false;
 				} else if (event.key.keysym.sym=='z' && event.key.keysym.mod&KMOD_CTRL) {
+					cd_stop(); //Stop music on exit
 					exit(1);
 				} else if (event.key.keysym.sym=='f' && event.key.keysym.mod&KMOD_CTRL) {
 					s->_fastMode ^= 1;
@@ -149,10 +152,13 @@
 				break;
 
 			case SDL_QUIT:
+				cd_stop(); //Stop music on exit
 				exit(1);
 				break;
 			}
 		}
+
+		cd_music_loop(); //Loop CD Music
 
 		if (SDL_GetTicks() >= start_time + msec_delay)
 			break;
diff -ruN scummvm/sound/cdmusic.cpp scumm_cd/sound/cdmusic.cpp
--- scummvm/sound/cdmusic.cpp	Wed Dec 31 18:00:00 1969
+++ scumm_cd/sound/cdmusic.cpp	Mon Jan 21 19:08:19 2002
@@ -0,0 +1,246 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001  Ludvig Strigeus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * -------------------------------------------------------------------------
+ *
+ * The Secret of Monkey Island uses audio tracks from a CD-ROM for music.
+ * This file adds FULL support for CD music for Monkey Island through
+ * custom mapping of sounds to tracks. There is NO purpose and mabye
+ * no way to know how SCUMM originally mapped the sounds.
+ * This will also be used to support music and voice for Loom WHEN
+ * Loom is supported.
+ *
+ * By: realmz <realmi2@yahoo.com>
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#include <SDL.h>
+
+#include "cdmusic.h"
+
+
+#define MAX_MI1_TRACKS 26 //Maximum number of tracks for MI1
+
+//Stores a sound number for each track
+int mi1_sound[MAX_MI1_TRACKS*2] =
+{
+	1,115,  //Voodoo
+	2,114,  //Jail
+	2,107,  //Saving Elaine (Unsure if correct track)
+	3,109,  //Forest
+	3,107,  //Saving Elaine (Unsure if correct track)
+	4,103,  //Chapel
+	5,112,  //Melee Island Map
+	6,104,  //Part x (room changed too fast to hear all)
+	7,117,  //Guybrush & Elaine
+	8,101,  //SCUMM Bar
+	10,119,  //Meanwhile... (Returned to MI)
+	9,111,  //On LeCheck's Ship
+	10,100, //Meanwhile... (A Problem...)
+	11,113, //Circus
+	14,116, //Monkey Island Map
+	14,128, //Monkey Island Map
+	15,105, //Voyage
+//	15,102, //Voyage (Commented out to prevent restarting track)
+	17,110, //Intro
+	17,108, //Intro - Lookout
+	18,121, //Stan's Used Ships
+	19,129, //LeChuck Leaving Melee (Kidnapping)
+	21,127, //Village
+	22,122, //Dock Sounds
+	23,126, //Night Sounds
+	24,123  //Jungle Sounds
+
+	//00,106, // ???
+};
+
+int cd_current_track, current_sound;
+
+SDL_CD *cdrom;
+
+int start_frame,length; //For Loom Support
+
+int game_type;
+
+int cd_init(int game)
+{
+
+        if (SDL_Init (SDL_INIT_CDROM) < 0)
+	{
+	      printf ("Failed to open CD-ROM: %s\n", SDL_GetError ());
+		return -1;
+	}
+
+        if(!SDL_CDNumDrives()){
+          printf("No CDROM devices available\n");
+	return -1;
+        }
+
+        cdrom=SDL_CDOpen(0);
+
+        if(cdrom == NULL)
+	{
+          printf("Couldn't open drive: %s\n", SDL_GetError());
+          exit(-1);
+        }
+
+cd_current_track = -1;
+
+current_sound = -1;
+
+start_frame = 0;
+length = 0;
+
+game_type = game; // 0 is MI1 and 1 is Loom
+
+return 0;
+}
+
+int cd_print_info()
+{
+int min,sec,frame;
+
+if(!cdrom)
+{
+printf("No CD Music support for this game.\n");
+return -1;
+}
+
+FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
+
+
+printf("| Track # | M:S:F  |\n");
+printf("|   %d    | %d:%d:%d |\n",cd_current_track,min,sec,frame);
+
+printf(
+	"Sound Map:\n"
+	"|---------------|\n"
+	"| Sound | Track |\n"
+	"|---------------|\n");
+
+for(int i = 0;i<MAX_MI1_TRACKS*2;i+=2)
+{
+if(mi1_sound[i] < 10)
+printf("|  %d    |   %d |\n",mi1_sound[i+1],mi1_sound[i]);
+else
+printf("|  %d    |  %d |\n",mi1_sound[i+1],mi1_sound[i]);
+}
+
+printf(	"|---------------|\n");
+
+return 0;
+}
+
+int cd_stop()
+{
+if(!cdrom)
+return -1;
+
+SDL_CDStop(cdrom);
+
+cd_current_track = -1;
+current_sound = -1;
+
+return 0;
+}
+
+int cd_stop(int sound)
+{
+
+if(sound == current_sound)
+return cd_stop();
+
+return -1;
+}
+
+int cd_play()
+{
+if(!cdrom)
+return -1;
+
+//cd_stop();
+
+SDL_CDStatus (cdrom); //Update SDL_CD
+
+if(current_sound == 108 && game_type == 0) //Play specific section of track 17
+{ 
+SDL_CDPlayTracks(cdrom,cd_current_track,96*CD_FPS,0,0);
+return 0;
+}
+
+SDL_CDPlayTracks(cdrom,cd_current_track,start_frame,0,length);
+
+return 0;
+}
+
+int cd_track_set(int track)
+{
+
+cd_current_track = track;
+
+return 0;
+}
+
+int cd_set_sound(int sound)
+{
+
+if(!cdrom)
+	return -1;
+
+if(game_type == 0) //MI1
+{
+
+if(sound == current_sound) //Don't restart the same sound
+return 0;
+
+	for(int i = 0;i<MAX_MI1_TRACKS*2;i+=2)
+	{
+
+		if(mi1_sound[i+1] == sound)
+		{
+			current_sound = sound;
+			cd_track_set(mi1_sound[i]);
+			cd_play();
+			return 0;
+		}
+	}
+
+return -1;
+}
+
+else //game_type == 1 which is Loom
+{
+	//No loom support yet :(
+}
+
+}
+
+int cd_music_loop()
+{
+if(!cdrom)
+return 0;
+
+SDL_CDStatus (cdrom); //Update SDL_CD
+
+if(cdrom->cur_track != cd_current_track)
+{
+cd_play();
+}
+
+return 0;
+}
diff -ruN scummvm/sound/cdmusic.h scumm_cd/sound/cdmusic.h
--- scummvm/sound/cdmusic.h	Wed Dec 31 18:00:00 1969
+++ scumm_cd/sound/cdmusic.h	Mon Jan 21 19:08:19 2002
@@ -0,0 +1,45 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001  Ludvig Strigeus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * -------------------------------------------------------------------------
+ *
+ * The Secret of Monkey Island uses audio tracks from a CD-ROM for music.
+ * This file adds FULL support for CD music for Monkey Island through
+ * custom mapping of sounds to tracks. There is NO purpose and mabye
+ * no way to know how SCUMM originally mapped the sounds.
+ * This will also be used to support music and voice for Loom WHEN
+ * Loom is supported.
+ *
+ * By: realmz <realmi2@yahoo.com>
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef CD_MUSIC_H
+#define CD_MUSIC_H
+
+int cd_init(int game);
+int cd_print_info();
+int cd_stop();
+int cd_stop(int sound);
+int cd_play();
+int cd_track_set(int track);
+int cd_set_sound(int sound);
+int cd_music_loop();
+
+#endif
+
diff -ruN scummvm/sound.cpp scumm_cd/sound.cpp
--- scummvm/sound.cpp	Wed Jan  2 05:50:28 2002
+++ scumm_cd/sound.cpp	Mon Jan 21 19:20:36 2002
@@ -23,6 +23,8 @@
 #include "scumm.h"
 #include "sound.h"
 
+#include "cdmusic.h"
+
 void Scumm::addSoundToQueue(int sound) {
 #if !defined(FULL_THROTTLE)
 	_vars[VAR_LAST_SOUND] = sound;
@@ -90,6 +92,11 @@
 
 void Scumm::playSound(int sound) {
 	SoundEngine *se = (SoundEngine*)_soundEngine;
+
+	//Set the sound for CD Music, if it's not for music then uses resources.
+	if(cd_set_sound(sound) == 0)
+		return;
+
 	if (se) {
 		getResourceAddress(rtSound, sound);
 		se->start_sound(sound);
@@ -239,6 +246,9 @@
 	for (i=0; i<10; i++)
 		if (_soundQue2[i] == (byte)a)
 			_soundQue2[i] = 0;
+
+	cd_stop(a);
+
 }
 
 void Scumm::stopAllSounds() {
diff -ruN scummvm/wince/CVS/Entries scumm_cd/wince/CVS/Entries
--- scummvm/wince/CVS/Entries	Mon Jan 21 19:51:40 2002
+++ scumm_cd/wince/CVS/Entries	Mon Jan 21 19:45:39 2002
@@ -7,4 +7,4 @@
 /screen.cpp/1.1.1.1/Sun Nov 18 10:24:47 2001//
 /screen.h/1.1.1.1/Sun Nov 18 10:24:47 2001//
 /sdl.h/1.1.1.1/Sun Nov 18 10:24:47 2001//
-D
+D/missing////
diff -ruN scummvm/wince/CVS/Entries.Log scumm_cd/wince/CVS/Entries.Log
--- scummvm/wince/CVS/Entries.Log	Mon Jan 21 19:51:40 2002
+++ scumm_cd/wince/CVS/Entries.Log	Wed Dec 31 18:00:00 1969
@@ -1 +0,0 @@
-A D/missing////
diff -ruN scummvm/wince/missing/CVS/Entries scumm_cd/wince/missing/CVS/Entries
--- scummvm/wince/missing/CVS/Entries	Mon Jan 21 19:51:43 2002
+++ scumm_cd/wince/missing/CVS/Entries	Mon Jan 21 19:45:39 2002
@@ -10,4 +10,4 @@
 /signal.h/1.1.1.1/Sun Nov 18 10:24:48 2001//
 /time.h/1.1.1.1/Sun Nov 18 10:24:48 2001//
 /unistd.h/1.1.1.1/Sun Nov 18 10:24:48 2001//
-D
+D/sys////
diff -ruN scummvm/wince/missing/CVS/Entries.Log scumm_cd/wince/missing/CVS/Entries.Log
--- scummvm/wince/missing/CVS/Entries.Log	Mon Jan 21 19:51:43 2002
+++ scumm_cd/wince/missing/CVS/Entries.Log	Wed Dec 31 18:00:00 1969
@@ -1 +0,0 @@
-A D/sys////
