ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/sys.h
Revision: 1.8
Committed: 2008-01-01T09:40:35Z (16 years, 8 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
Log Message:
Happy New Year!

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * sys.h - System dependent routines (mostly I/O)
3     *
4 gbeauche 1.8 * Basilisk II (C) 1997-2008 Christian Bauer
5 cebix 1.1 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21     #ifndef SYS_H
22     #define SYS_H
23    
24 gbeauche 1.7 // Supported media types
25     enum {
26     MEDIA_FLOPPY = 1,
27     MEDIA_CD = 2,
28     MEDIA_HD = 4,
29     MEDIA_REMOVABLE = MEDIA_FLOPPY | MEDIA_CD
30     };
31    
32 cebix 1.1 extern void SysInit(void);
33     extern void SysExit(void);
34    
35     extern void SysAddFloppyPrefs(void);
36     extern void SysAddDiskPrefs(void);
37     extern void SysAddCDROMPrefs(void);
38     extern void SysAddSerialPrefs(void);
39    
40     /*
41     * These routines are used for reading from and writing to disk files
42     * or devices in sony.cpp, disk.cpp and cdrom.cpp. Their purpose is to
43     * hide all OS-specific details of file and device access. The routines
44     * must also hide all restrictions on the location or alignment of the
45     * data buffer or on the transfer length that may be imposed by the
46     * underlying OS.
47     * A file/device is identified by a "filename" (character string) that
48     * may (but need not) map to a valid file path. After Sys_open(), the
49     * file/device is identified by an abstract "file handle" (void *),
50     * that is freed by Sys_close().
51     */
52    
53     extern void *Sys_open(const char *name, bool read_only);
54     extern void Sys_close(void *fh);
55     extern size_t Sys_read(void *fh, void *buffer, loff_t offset, size_t length);
56     extern size_t Sys_write(void *fh, void *buffer, loff_t offset, size_t length);
57     extern loff_t SysGetFileSize(void *fh);
58     extern void SysEject(void *fh);
59     extern bool SysFormat(void *fh);
60     extern bool SysIsReadOnly(void *fh);
61     extern bool SysIsFixedDisk(void *fh);
62     extern bool SysIsDiskInserted(void *fh);
63    
64     extern void SysPreventRemoval(void *fh);
65     extern void SysAllowRemoval(void *fh);
66     extern bool SysCDReadTOC(void *fh, uint8 *toc);
67     extern bool SysCDGetPosition(void *fh, uint8 *pos);
68     extern bool SysCDPlay(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end_m, uint8 end_s, uint8 end_f);
69     extern bool SysCDPause(void *fh);
70     extern bool SysCDResume(void *fh);
71     extern bool SysCDStop(void *fh, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f);
72     extern bool SysCDScan(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, bool reverse);
73     extern void SysCDSetVolume(void *fh, uint8 left, uint8 right);
74     extern void SysCDGetVolume(void *fh, uint8 &left, uint8 &right);
75    
76     #endif