1 /* 2 * machine-bus.c - Generic interface to IO bus functions. 3 * 4 * Written by 5 * Andreas Boose <viceteam@t-online.de> 6 * 7 * This file is part of VICE, the Versatile Commodore Emulator. 8 * See README for copyright notice. 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation; either version 2 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License 21 * along with this program; if not, write to the Free Software 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 23 * 02111-1307 USA. 24 * 25 */ 26 27 #ifndef VICE_MACHINE_BUS_H 28 #define VICE_MACHINE_BUS_H 29 30 #include "types.h" 31 32 struct cbmdos_cmd_parse_s; 33 struct vdrive_s; 34 35 extern void machine_bus_init(void); 36 extern void machine_bus_init_machine(void); 37 38 extern int machine_bus_lib_directory(unsigned int unit, const char *pattern, 39 uint8_t **buf); 40 extern int machine_bus_lib_read_sector(unsigned int unit, unsigned int track, 41 unsigned int sector, uint8_t *buf); 42 extern int machine_bus_lib_write_sector(unsigned int unit, unsigned int track, 43 unsigned int sector, uint8_t *buf); 44 45 extern unsigned int machine_bus_device_type_get(unsigned int unit); 46 47 extern void machine_bus_status_truedrive_set(unsigned int enable); 48 extern void machine_bus_status_drivetype_set(unsigned int unit, 49 unsigned int enable); 50 extern void machine_bus_status_virtualdevices_set(unsigned int enable); 51 52 extern void machine_bus_eof_callback_set(void (*func)(void)); 53 extern void machine_bus_attention_callback_set(void (*func)(void)); 54 55 extern int machine_bus_device_attach(unsigned int unit, const char *name, 56 int (*getf)(struct vdrive_s *, 57 uint8_t *, unsigned int), 58 int (*putf)(struct vdrive_s *, uint8_t, 59 unsigned int), 60 int (*openf)(struct vdrive_s *, 61 const uint8_t *, unsigned int, unsigned int, 62 struct cbmdos_cmd_parse_s *), 63 int (*closef)(struct vdrive_s *, 64 unsigned int), 65 void (*flushf)(struct vdrive_s *, 66 unsigned int), 67 void (*listenf)(struct vdrive_s *, 68 unsigned int)); 69 extern int machine_bus_device_detach(unsigned int unit); 70 71 #endif 72