Add Patch 1001897 by Martin. Disabled modem and ipx networking by default as they depend on libraries not everybody may have. Reduces alarmed firewall people and is nicer on unix hosts as port 23 is a bit tricky
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1904
This commit is contained in:
parent
18f13c2b60
commit
02ff2737d7
11 changed files with 1390 additions and 19 deletions
107
src/dos/cdrom.h
107
src/dos/cdrom.h
|
@ -5,10 +5,17 @@
|
|||
#define MAX_ASPI_CDROM 5
|
||||
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "dosbox.h"
|
||||
#include "mem.h"
|
||||
#include "mixer.h"
|
||||
#include "SDL.h"
|
||||
#include "SDL_thread.h"
|
||||
|
||||
#if defined(C_SDL_SOUND)
|
||||
#include "SDL_sound.h"
|
||||
#endif
|
||||
|
||||
#define RAW_SECTOR_SIZE 2352
|
||||
#define COOKED_SECTOR_SIZE 2048
|
||||
|
@ -95,6 +102,106 @@ public:
|
|||
bool LoadUnloadMedia (bool unload) { return true; };
|
||||
};
|
||||
|
||||
class CDROM_Interface_Image : public CDROM_Interface
|
||||
{
|
||||
private:
|
||||
class TrackFile {
|
||||
public:
|
||||
virtual bool read(Bit8u *buffer, int seek, int count) = 0;
|
||||
virtual int getLength() = 0;
|
||||
};
|
||||
|
||||
class BinaryFile : public TrackFile {
|
||||
public:
|
||||
BinaryFile(const char *filename, bool &error);
|
||||
~BinaryFile();
|
||||
bool read(Bit8u *buffer, int seek, int count);
|
||||
int getLength();
|
||||
private:
|
||||
BinaryFile();
|
||||
std::ifstream *file;
|
||||
};
|
||||
|
||||
#if defined(C_SDL_SOUND)
|
||||
class AudioFile : public TrackFile {
|
||||
public:
|
||||
AudioFile(const char *filename, bool &error);
|
||||
~AudioFile();
|
||||
bool read(Bit8u *buffer, int seek, int count);
|
||||
int getLength();
|
||||
private:
|
||||
AudioFile();
|
||||
Sound_Sample *sample;
|
||||
int lastCount;
|
||||
int lastSeek;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct Track {
|
||||
int number;
|
||||
int attr;
|
||||
int start;
|
||||
int length;
|
||||
int skip;
|
||||
int sectorSize;
|
||||
bool mode2;
|
||||
TrackFile *file;
|
||||
};
|
||||
|
||||
public:
|
||||
CDROM_Interface_Image (Bit8u subUnit);
|
||||
virtual ~CDROM_Interface_Image (void);
|
||||
void InitNewMedia (void);
|
||||
bool SetDevice (char* path, int forceCD);
|
||||
bool GetUPC (unsigned char& attr, char* upc);
|
||||
bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut);
|
||||
bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr);
|
||||
bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos);
|
||||
bool GetAudioStatus (bool& playing, bool& pause);
|
||||
bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen);
|
||||
bool PlayAudioSector (unsigned long start,unsigned long len);
|
||||
bool PauseAudio (bool resume);
|
||||
bool StopAudio (void);
|
||||
bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num);
|
||||
bool LoadUnloadMedia (bool unload);
|
||||
bool ReadSector (Bit8u *buffer, bool raw, unsigned long sector);
|
||||
|
||||
static CDROM_Interface_Image* images[26];
|
||||
|
||||
private:
|
||||
// player
|
||||
static void CDAudioCallBack(Bit8u *stream, Bit32u len);
|
||||
int GetTrack(int sector);
|
||||
|
||||
static struct imagePlayer {
|
||||
CDROM_Interface_Image *cd;
|
||||
MIXER_Channel *channel;
|
||||
SDL_mutex *mutex;
|
||||
Bit8u buffer[8192];
|
||||
int bufLen;
|
||||
int currFrame;
|
||||
int targetFrame;
|
||||
bool isPlaying;
|
||||
bool isPaused;
|
||||
} player;
|
||||
|
||||
void ClearTracks();
|
||||
bool LoadIsoFile(char *filename);
|
||||
bool CanReadPVD(TrackFile *file, int sectorSize, bool mode2);
|
||||
// cue sheet processing
|
||||
bool LoadCueSheet(char *cuefile);
|
||||
bool GetRealFileName(std::string& filename, std::string& pathname);
|
||||
bool GetCueKeyword(std::string &keyword, std::istream &in);
|
||||
bool GetCueFrame(int &frames, std::istream &in);
|
||||
bool GetCueString(std::string &str, std::istream &in);
|
||||
bool AddTrack(Track &curr, int &shift, int prestart, int &totalPregap, int currPregap);
|
||||
|
||||
static int refCount;
|
||||
std::vector<Track> tracks;
|
||||
std::string mcn;
|
||||
Bit8u subUnit;
|
||||
};
|
||||
|
||||
#if defined (WIN32) /* Win 32 */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue