Previous 15994 Revisions Next

r3901 Friday 19th December, 2008 at 23:15:05 UTC by Wilbert Pol
Removed deprecat.h from machine/c16.c
[src/mess/includes]c16.h
[src/mess/machine]c16.c

src/mess/includes/c16.h
r3900r3901
1010
1111/*----------- defined in machine/c16.c -----------*/
1212
13UINT8 c16_m7501_port_read(void);
14void c16_m7501_port_write(UINT8 data);
13UINT8 c16_m7501_port_read(const device_config *device, UINT8 direction);
14void c16_m7501_port_write(const device_config *device, UINT8 direction, UINT8 data);
1515
1616extern WRITE8_HANDLER(c16_6551_port_w);
1717extern  READ8_HANDLER(c16_6551_port_r);
src/mess/machine/c16.c
r3900r3901
2424#include "devices/cassette.h"
2525#include "devices/cartslot.h"
2626
27#include "deprecat.h"
2827
29
3028#define VERBOSE_LEVEL 0
3129#define DBG_LOG(N,M,A) \
3230   do { \
r3900r3901
112110  p7 serial data in, serial bus 5
113111*/
114112
115void c16_m7501_port_write(UINT8 data)
113void c16_m7501_port_write(const device_config *device, UINT8 direction, UINT8 data)
116114{
117115   int dat, atn, clk;
118116
119117   /* bit zero then output 0 */
120   cbm_serial_atn_write (Machine, atn = !(data & 0x04));
121   cbm_serial_clock_write (Machine, clk = !(data & 0x02));
122   cbm_serial_data_write (Machine, dat = !(data & 0x01));
118   cbm_serial_atn_write (device->machine, atn = !(data & 0x04));
119   cbm_serial_clock_write (device->machine, clk = !(data & 0x02));
120   cbm_serial_data_write (device->machine, dat = !(data & 0x01));
123121
124122//   vc20_tape_write (!(data & 0x02));      // CASSETTE_RECORD not implemented yet
125123}
126124
127UINT8 c16_m7501_port_read(void)
125UINT8 c16_m7501_port_read(const device_config *device, UINT8 direction)
128126{
129   running_machine *machine = Machine;
130127   UINT8 data = 0xff;
131   UINT8 c16_port7501 = (UINT8) cpu_get_info_int(machine->cpu[0], CPUINFO_INT_M6510_PORT);
128   UINT8 c16_port7501 = (UINT8) cpu_get_info_int(device->machine->cpu[0], CPUINFO_INT_M6510_PORT);
132129
133   if ((c16_port7501 & 0x01) || !cbm_serial_data_read(Machine))
130   if ((c16_port7501 & 0x01) || !cbm_serial_data_read(device->machine))
134131      data &= ~0x80;
135132
136   if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(Machine))
133   if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(device->machine))
137134      data &= ~0x40;
138135
139136//   data &= ~0x20; // port bit not in pinout
140137
141   if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > +0.0)
138   if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > +0.0)
142139      data |=  0x10;
143140   else
144141      data &= ~0x10;
145142
146   cassette_change_state(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), (c16_port7501 & 0x08) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
143   cassette_change_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), (c16_port7501 & 0x08) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
147144
148145   return data;
149146}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team