|
|
@@ -48,7 +48,9 @@ |
|
|
Bitu DEBUG_EnableDebugger(void); |
|
|
#endif |
|
|
|
|
|
#if !SDL_VERSION_ATLEAST(2,0,0) |
|
|
void MSCDEX_SetCDInterface(int intNr, int forceCD); |
|
|
#endif |
|
|
static Bitu ZDRIVE_NUM = 25; |
|
|
|
|
|
class MOUNT : public Program { |
|
|
@@ -173,11 +175,15 @@ class MOUNT : public Program { |
|
|
} |
|
|
/* Show list of cdroms */ |
|
|
if (cmd->FindExist("-cd",false)) { |
|
|
#if SDL_VERSION_ATLEAST(2,0,0) |
|
|
WriteOut(MSG_Get("PROGRAM_MOUNT_PHYS_CDROMS_NOT_SUPPORTED")); |
|
|
#else |
|
|
int num = SDL_CDNumDrives(); |
|
|
WriteOut(MSG_Get("PROGRAM_MOUNT_CDROMS_FOUND"),num); |
|
|
for (int i=0; i<num; i++) { |
|
|
WriteOut("%2d. %s\n",i,SDL_CDName(i)); |
|
|
}; |
|
|
#endif |
|
|
return; |
|
|
} |
|
|
|
|
|
@@ -308,9 +314,22 @@ class MOUNT : public Program { |
|
|
if (temp_line[temp_line.size()-1]!=CROSS_FILESPLIT) temp_line+=CROSS_FILESPLIT; |
|
|
Bit8u bit8size=(Bit8u) sizes[1]; |
|
|
if (type=="cdrom") { |
|
|
#if SDL_VERSION_ATLEAST(2,0,0) |
|
|
if (cmd->FindExist("-usecd",false) |
|
|
|| cmd->FindExist("-aspi",false) |
|
|
|| cmd->FindExist("-ioctl_dio",false) |
|
|
|| cmd->FindExist("-ioctl_dx",false) |
|
|
#if defined (WIN32) |
|
|
|| cmd->FindExist("-ioctl_mci",false) |
|
|
#endif |
|
|
|| cmd->FindExist("-noioctl",false) |
|
|
) { |
|
|
WriteOut(MSG_Get("PROGRAM_MOUNT_PHYS_CDROMS_NOT_SUPPORTED")); |
|
|
/* Just ignore, mount anyway */ |
|
|
} |
|
|
#else // SDL_VERSION_ATLEAST(2,0,0) |
|
|
int num = -1; |
|
|
cmd->FindInt("-usecd",num,true); |
|
|
int error = 0; |
|
|
if (cmd->FindExist("-aspi",false)) { |
|
|
MSCDEX_SetCDInterface(CDROM_USE_ASPI, num); |
|
|
} else if (cmd->FindExist("-ioctl_dio",false)) { |
|
|
@@ -339,6 +358,8 @@ class MOUNT : public Program { |
|
|
MSCDEX_SetCDInterface(CDROM_USE_IOCTL_DIO, num); |
|
|
#endif |
|
|
} |
|
|
#endif // SDL_VERSION_ATLEAST(2,0,0) |
|
|
int error = 0; |
|
|
newdrive = new cdromDrive(drive,temp_line.c_str(),sizes[0],bit8size,sizes[2],0,mediaid,error); |
|
|
// Check Mscdex, if it worked out... |
|
|
switch (error) { |
|
|
@@ -1317,7 +1338,9 @@ class IMGMOUNT : public Program { |
|
|
WriteOut(MSG_Get("PROGRAM_IMGMOUNT_ALREADY_MOUNTED")); |
|
|
return; |
|
|
} |
|
|
#if !SDL_VERSION_ATLEAST(2,0,0) |
|
|
MSCDEX_SetCDInterface(CDROM_USE_SDL, -1); |
|
|
#endif |
|
|
// create new drives for all images |
|
|
std::vector<DOS_Drive*> isoDisks; |
|
|
std::vector<std::string>::size_type i; |
|
|
@@ -1468,7 +1491,11 @@ static void KEYB_ProgramStart(Program * * make) { |
|
|
void DOS_SetupPrograms(void) { |
|
|
/*Add Messages */ |
|
|
|
|
|
#if SDL_VERSION_ATLEAST(2,0,0) |
|
|
MSG_Add("PROGRAM_MOUNT_PHYS_CDROMS_NOT_SUPPORTED","Physical CDROMs aren't fully supported. IMGMOUNT may be more useful.\n"); |
|
|
#else |
|
|
MSG_Add("PROGRAM_MOUNT_CDROMS_FOUND","CDROMs found: %d\n"); |
|
|
#endif |
|
|
MSG_Add("PROGRAM_MOUNT_STATUS_FORMAT","%-5s %-58s %-12s\n"); |
|
|
MSG_Add("PROGRAM_MOUNT_STATUS_2","Drive %c is mounted as %s\n"); |
|
|
MSG_Add("PROGRAM_MOUNT_STATUS_1","The currently mounted drives are:\n"); |
|
|
@@ -1558,7 +1585,11 @@ void DOS_SetupPrograms(void) { |
|
|
); |
|
|
MSG_Add("PROGRAM_INTRO_CDROM", |
|
|
"\033[2J\033[32;1mHow to mount a Real/Virtual CD-ROM Drive in DOSBox:\033[0m\n" |
|
|
#if SDL_VERSION_ATLEAST(2,0,0) |
|
|
"DOSBox provides CD-ROM emulation on a few levels.\n" |
|
|
#else |
|
|
"DOSBox provides CD-ROM emulation on several levels.\n" |
|
|
#endif |
|
|
"\n" |
|
|
"The \033[33mbasic\033[0m level works on all CD-ROM drives and normal directories.\n" |
|
|
"It installs MSCDEX and marks the files read-only.\n" |
|
|
@@ -1567,6 +1598,14 @@ void DOS_SetupPrograms(void) { |
|
|
"If it doesn't work you might have to tell DOSBox the label of the CD-ROM:\n" |
|
|
"\033[34;1mmount d C:\\example -t cdrom -label CDLABEL\033[0m\n" |
|
|
"\n" |
|
|
#if SDL_VERSION_ATLEAST(2,0,0) |
|
|
"The \033[33mhigher\033[0m level adds CD-ROM image mounting support.\n" |
|
|
"Therefore only works on supported CD-ROM images:\n" |
|
|
"\033[34;1mimgmount d \033[0;31mD:\\example.img\033[34;1m -t cdrom\033[0m\n" |
|
|
"\n" |
|
|
"Replace \033[0;31mD:\\\033[0m with the location of your CD-ROM.\n" |
|
|
"Replace \033[0;31mD:\\example.img\033[0m with the location of your CD-ROM image.\n" |
|
|
#else |
|
|
"The \033[33mnext\033[0m level adds some low-level support.\n" |
|
|
"Therefore only works on CD-ROM drives:\n" |
|
|
"\033[34;1mmount d \033[0;31mD:\\\033[34;1m -t cdrom -usecd \033[33m0\033[0m\n" |
|
|
@@ -1580,6 +1619,7 @@ void DOS_SetupPrograms(void) { |
|
|
"Replace \033[0;31mD:\\\033[0m with the location of your CD-ROM.\n" |
|
|
"Replace the \033[33;1m0\033[0m in \033[34;1m-usecd \033[33m0\033[0m with the number reported for your CD-ROM if you type:\n" |
|
|
"\033[34;1mmount -cd\033[0m\n" |
|
|
#endif |
|
|
); |
|
|
MSG_Add("PROGRAM_INTRO_SPECIAL", |
|
|
"\033[2J\033[32;1mSpecial keys:\033[0m\n" |
|
|
|