1 /*
2  * iecdrive.c - IEC bus handling for true drive emulaton.
3  *
4  * Written by
5  *  Andreas Boose <viceteam@t-online.de>
6  *  Daniel Sladic <sladic@eecg.toronto.edu>
7  *  Ettore Perazzoli <ettore@comm2000.it>
8  *  Andre Fachat <fachat@physik.tu-chemnitz.de>
9  *  Teemu Rantanen <tvr@cs.hut.fi>
10  *
11  * This file is part of VICE, the Versatile Commodore Emulator.
12  * See README for copyright notice.
13  *
14  *  This program is free software; you can redistribute it and/or modify
15  *  it under the terms of the GNU General Public License as published by
16  *  the Free Software Foundation; either version 2 of the License, or
17  *  (at your option) any later version.
18  *
19  *  This program is distributed in the hope that it will be useful,
20  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *  GNU General Public License for more details.
23  *
24  *  You should have received a copy of the GNU General Public License
25  *  along with this program; if not, write to the Free Software
26  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27  *  02111-1307  USA.
28  *
29  */
30 
31 
32 #ifndef VICE_IECDRIVE_H
33 #define VICE_IECDRIVE_H
34 
35 #include "types.h"
36 
37 /* return value for iec_available_busses() (can be ored) */
38 #define IEC_BUS_IEC     0x01    /* serial IEC bus */
39 #define IEC_BUS_IEEE    0x02    /* parallel IEEE bus */
40 #define IEC_BUS_TCBM    0x04    /* parallel TCBM bus */
41 
42 extern int iec_available_busses(void);
43 
44 extern void iec_update_ports_embedded(void);
45 extern void iec_drive_write(uint8_t data, unsigned int dnr);
46 extern uint8_t iec_drive_read(unsigned int dnr);
47 
48 #define PARALLEL_WRITE    0 /* write data */
49 #define PARALLEL_WRITE_HS 1 /* write data, set flag (cia2) */
50 #define PARALLEL_HS       2 /* set flag (cia2) */
51 extern void parallel_cable_drive_write(int port, uint8_t data, int handshake, unsigned int dnr);
52 extern uint8_t parallel_cable_drive_read(int port, int handshake);
53 
54 extern void iec_fast_drive_write(uint8_t data, unsigned int dnr);
55 extern void iec_fast_drive_direction(int direction, unsigned int dnr);
56 
57 extern void iec_update_cpu_bus(uint8_t data);
58 extern void iec_update_ports(void);
59 
60 extern void plus4tcbm_update_pa(uint8_t byte, unsigned int dnr);
61 extern void plus4tcbm_update_pb(uint8_t byte, unsigned int dnr);
62 extern void plus4tcbm_update_pc(uint8_t byte, unsigned int dnr);
63 extern uint8_t plus4tcbm_outputa[2], plus4tcbm_outputb[2], plus4tcbm_outputc[2];
64 
65 #endif
66