ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/sys.h
Revision: 1.5
Committed: 2004-01-12T15:29:27Z (20 years, 9 months ago) by cebix
Content type: text/plain
Branch: MAIN
CVS Tags: nigel-build-16, nigel-build-15
Changes since 1.4: +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 cebix 1.5 * Basilisk II (C) 1997-2004 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     extern void SysInit(void);
25     extern void SysExit(void);
26    
27     extern void SysAddFloppyPrefs(void);
28     extern void SysAddDiskPrefs(void);
29     extern void SysAddCDROMPrefs(void);
30     extern void SysAddSerialPrefs(void);
31    
32     /*
33     * These routines are used for reading from and writing to disk files
34     * or devices in sony.cpp, disk.cpp and cdrom.cpp. Their purpose is to
35     * hide all OS-specific details of file and device access. The routines
36     * must also hide all restrictions on the location or alignment of the
37     * data buffer or on the transfer length that may be imposed by the
38     * underlying OS.
39     * A file/device is identified by a "filename" (character string) that
40     * may (but need not) map to a valid file path. After Sys_open(), the
41     * file/device is identified by an abstract "file handle" (void *),
42     * that is freed by Sys_close().
43     */
44    
45     extern void *Sys_open(const char *name, bool read_only);
46     extern void Sys_close(void *fh);
47     extern size_t Sys_read(void *fh, void *buffer, loff_t offset, size_t length);
48     extern size_t Sys_write(void *fh, void *buffer, loff_t offset, size_t length);
49     extern loff_t SysGetFileSize(void *fh);
50     extern void SysEject(void *fh);
51     extern bool SysFormat(void *fh);
52     extern bool SysIsReadOnly(void *fh);
53     extern bool SysIsFixedDisk(void *fh);
54     extern bool SysIsDiskInserted(void *fh);
55    
56     extern void SysPreventRemoval(void *fh);
57     extern void SysAllowRemoval(void *fh);
58     extern bool SysCDReadTOC(void *fh, uint8 *toc);
59     extern bool SysCDGetPosition(void *fh, uint8 *pos);
60     extern bool SysCDPlay(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end_m, uint8 end_s, uint8 end_f);
61     extern bool SysCDPause(void *fh);
62     extern bool SysCDResume(void *fh);
63     extern bool SysCDStop(void *fh, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f);
64     extern bool SysCDScan(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, bool reverse);
65     extern void SysCDSetVolume(void *fh, uint8 left, uint8 right);
66     extern void SysCDGetVolume(void *fh, uint8 &left, uint8 &right);
67    
68     #endif