2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2021-01-31 18:44:39 +03:00
|
|
|
// Copyright (C) 2002-2021 The Bochs Project
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library 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
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
2009-02-08 12:05:52 +03:00
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
// Header file for low-level OS specific CDROM emulation
|
|
|
|
|
2013-11-05 22:06:39 +04:00
|
|
|
extern unsigned int bx_cdrom_count;
|
|
|
|
|
2013-11-06 15:15:22 +04:00
|
|
|
|
2011-07-17 21:23:12 +04:00
|
|
|
class cdrom_base_c : public logfunctions {
|
2001-04-10 05:04:59 +04:00
|
|
|
public:
|
2013-11-06 15:15:22 +04:00
|
|
|
cdrom_base_c() {}
|
|
|
|
cdrom_base_c(const char *dev);
|
|
|
|
virtual ~cdrom_base_c(void);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2005-12-27 16:21:25 +03:00
|
|
|
// Load CD-ROM. Returns 0 if CD is not ready.
|
2021-01-31 18:44:39 +03:00
|
|
|
virtual bool insert_cdrom(const char *dev = NULL);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Logically eject the CD.
|
2013-11-06 15:15:22 +04:00
|
|
|
virtual void eject_cdrom();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2005-12-27 16:21:25 +03:00
|
|
|
// Read CD TOC. Returns 0 if start track is out of bounds.
|
2021-01-31 18:44:39 +03:00
|
|
|
virtual bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Return CD-ROM capacity (in 2048 byte frames)
|
2013-11-06 15:15:22 +04:00
|
|
|
virtual Bit32u capacity();
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2005-12-27 16:21:25 +03:00
|
|
|
// Read a single block from the CD. Returns 0 on failure.
|
2021-01-31 18:44:39 +03:00
|
|
|
virtual bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3);
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2003-08-19 04:37:03 +04:00
|
|
|
// Start (spin up) the CD.
|
2021-01-31 18:44:39 +03:00
|
|
|
virtual bool start_cdrom();
|
2003-08-19 04:37:03 +04:00
|
|
|
|
2005-12-27 16:21:25 +03:00
|
|
|
// Seek for new block address.
|
2021-01-31 18:44:39 +03:00
|
|
|
virtual bool seek(Bit32u lba);
|
2011-10-03 11:23:44 +04:00
|
|
|
|
2013-11-06 15:15:22 +04:00
|
|
|
protected:
|
2001-04-10 05:04:59 +04:00
|
|
|
int fd;
|
|
|
|
char *path;
|
2021-01-31 18:44:39 +03:00
|
|
|
bool using_file;
|
2011-07-17 21:23:12 +04:00
|
|
|
};
|