Fixed compilation error
[bochs-mirror.git] / iodev / cdrom.h
blobd02656a337eeae14d287631551a6d13be75d1826
1 /////////////////////////////////////////////////////////////////////////
2 // $Id: cdrom.h,v 1.20 2006/03/07 21:11:16 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2002 MandrakeSoft S.A.
6 //
7 // MandrakeSoft S.A.
8 // 43, rue d'Aboukir
9 // 75002 Paris - France
10 // http://www.linux-mandrake.com/
11 // http://www.mandrakesoft.com/
13 // This library is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU Lesser General Public
15 // License as published by the Free Software Foundation; either
16 // version 2 of the License, or (at your option) any later version.
18 // This library is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 // Lesser General Public License for more details.
23 // You should have received a copy of the GNU Lesser General Public
24 // License along with this library; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 // Header file for low-level OS specific CDROM emulation
31 class cdrom_interface : public logfunctions {
32 public:
33 cdrom_interface(char *dev);
34 virtual ~cdrom_interface(void);
35 void init(void);
37 // Load CD-ROM. Returns 0 if CD is not ready.
38 bx_bool insert_cdrom(char *dev = NULL);
40 // Logically eject the CD.
41 void eject_cdrom();
43 // Read CD TOC. Returns 0 if start track is out of bounds.
44 bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format);
46 // Return CD-ROM capacity (in 2048 byte frames)
47 Bit32u capacity();
49 // Read a single block from the CD. Returns 0 on failure.
50 bx_bool read_block(Bit8u* buf, int lba, int blocksize) BX_CPP_AttrRegparmN(3);
52 // Start (spin up) the CD.
53 bx_bool start_cdrom();
55 // Seek for new block address.
56 void seek(int lba);
58 private:
59 int fd;
60 char *path;
62 int using_file;
63 #ifdef WIN32
64 BOOL bUseASPI;
65 HANDLE hFile;
66 int hid;
67 int tid;
68 int lun;
69 #endif