Previous 15994 Revisions Next

r4420 Sunday 15th March, 2009 at 11:24:04 UTC by Robbbert
[SUPER80] Fixed 0.128u7 regression.
[src/mess/drivers]super80.c

src/mess/drivers/super80.c
r4419r4420
1515#include "super80.h"
1616
1717
18static UINT8 irq_counter;
19
2018static const device_config *super80_z80pio;
2119static const device_config *super80_speaker;
2220static const device_config *super80_cassette;
r4419r4420
4543
4644static UINT8 keylatch;
4745
48/* Due to pio bug since 128u7, need to eat first interrupt after boot.
49   Only works for super80m and super80v. The irq doesn't work at all for the others at this time. */
46/* This activates when Control + C + 4 pressed */
5047static void super80_pio_interrupt(const device_config *device, int state)
5148{
52   if ((state) && (!irq_counter))
53      irq_counter++;
54   else
55   {
56      cputag_set_input_line(device->machine, "maincpu", 0, state );
57      if (state) irq_counter=0;
58   }
49   cputag_set_input_line(device->machine, "maincpu", 0, state );
5950}
6051
6152static WRITE8_DEVICE_HANDLER( pio_port_a_w )
r4419r4420
116107
117108static UINT8 cass_data[]={ 0, 0, 0, 0 };
118109
119/*   This timer runs at 200kHz and emulates the 2 chips in the cassette input circuit
120   They are U79 CD4046BCN PLL chip and U1 LM311P op-amp. U79 converts a frequency to a voltage,
110   /* this timer runs at 200khz and does 2 jobs: 
111   1. Scan the keyboard and present the results to the pio 
112   2. Emulate the 2 chips in the cassette input circuit 
113
114   Reasons why it is necessary: 
115   1. The real z80pio is driven by the cpu clock and is capable of independent actions. 
116   MAME does not support this at all. If the interrupt key sequence is entered, the 
117   computer can be reset out of a hung state by the operator. 
118   2. This "emulates" U79 CD4046BCN PLL chip and U1 LM311P op-amp. U79 converts a frequency to a voltage, 
121119   and U1 amplifies that voltage to digital levels. U1 has a trimpot connected, to set the midpoint.
122120
123121   The MDS homebrew input circuit consists of 2 op-amps followed by a D-flipflop.
r4419r4420
141139      cass_data[2] = ((cass_data[1] < 0x40) ? 1 : 0) | cass_ws | cass_data[3];
142140      cass_data[1] = 0;
143141   }
142
143   z80pio_p_w(super80_z80pio,1,pio_port_b_r(super80_z80pio,0));
144144}
145145
146146/*************************************** PRINTER ********************************************************/

Previous 15994 Revisions Next


© 1998-2018 The MESS Team