Previous 15994 Revisions Next

r2397 Monday 14th April, 2008 at 20:06:54 UTC by Curt Coder
[CDP1802] Added machine parameter to the callback functions, and macros for the callbacks.
[src/mess/drivers]tmc1800.c tmc2000e.c

src/mess/drivers/tmc2000e.c
r2396r2397
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/cdp1802/cdp1802.h"
43#include "devices/printer.h"
54#include "devices/basicdsk.h"
r2396r2397
9493
9594/* CDP1802 Interface */
9695
97static UINT8 tmc2000e_mode_r(void)
96static CDP1802_MODE_READ( tmc2000e_mode_r )
9897{
99   if (input_port_read(Machine, "RUN") & 0x01)
98   if (input_port_read(machine, "RUN") & 0x01)
10099   {
101100      return CDP1802_MODE_RUN;
102101   }
r2396r2397
106105   }
107106}
108107
109static UINT8 tmc2000e_ef_r(void)
108static CDP1802_EF_READ( tmc2000e_ef_r )
110109{
111110   UINT8 flags = 0x0f;
112111   char port[4];
r2396r2397
120119
121120   // keyboard
122121   sprintf(port, "IN%d", keylatch / 8);
123   if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF3;
122   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF3;
124123
125124   return flags;
126125}
127126
128static void tmc2000e_q_w(int level)
127static CDP1802_Q_WRITE( tmc2000e_q_w )
129128{
130129   // CDP1864 sound generator on/off
131130   cdp1864_audio_output_enable(level);
r2396r2397
139138   // floppy control (FDC-6)
140139}
141140
142static const CDP1802_CONFIG tmc2000e_config =
141static const cdp1802_interface tmc2000e_config =
143142{
144143   tmc2000e_mode_r,
145144   tmc2000e_ef_r,
src/mess/drivers/tmc1800.c
r2396r2397
8686*/
8787
8888#include "driver.h"
89#include "deprecat.h"
9089#include "cpu/cdp1802/cdp1802.h"
9190#include "video/cdp1864.h"
9291#include "devices/cassette.h"
r2396r2397
169168
170169// Telmac 1800
171170
172static UINT8 tmc1800_mode_r(void)
171static CDP1802_MODE_READ( tmc1800_mode_r )
173172{
174   if (input_port_read(Machine, "RUN") & 0x01)
173   if (input_port_read(machine, "RUN") & 0x01)
175174   {
176175      return CDP1802_MODE_RUN;
177176   }
r2396r2397
181180   }
182181}
183182
184static UINT8 tmc1800_ef_r(void)
183static CDP1802_EF_READ( tmc1800_ef_r )
185184{
186185   UINT8 flags = 0x0f;
187186   char port[4];
r2396r2397
195194
196195   // keyboard
197196   sprintf(port, "IN%d", keylatch / 8);
198   if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF2;
197   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2;
199198
200199   return flags;
201200}
202201
203static void tmc1800_q_w(int level)
202static CDP1802_Q_WRITE( tmc1800_q_w )
204203{
205204}
206205
207static const CDP1802_CONFIG tmc1800_config =
206static const cdp1802_interface tmc1800_config =
208207{
209208   tmc1800_mode_r,
210209   tmc1800_ef_r,
r2396r2397
216215
217216// Telmac 2000
218217
219static UINT8 tmc2000_ef_r(void)
218static CDP1802_EF_READ( tmc2000_ef_r )
220219{
221220   int flags = 0x0f;
222221   char port[4];
r2396r2397
230229
231230   // keyboard
232231   sprintf(port, "IN%d", keylatch / 8);
233   if (~input_port_read(Machine, port) & (1 << (keylatch % 8))) flags -= EF2;
232   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2;
234233
235234   return flags;
236235}
237236
238static void tmc2000_q_w(int level)
237static CDP1802_Q_WRITE( tmc2000_q_w )
239238{
240239   // turn CDP1864 sound generator on/off
241240   cdp1864_audio_output_enable(level);
r2396r2397
244243   set_led_status(1, level);
245244}
246245
247static const CDP1802_CONFIG tmc2000_config =
246static const cdp1802_interface tmc2000_config =
248247{
249248   tmc1800_mode_r,
250249   tmc2000_ef_r,

Previous 15994 Revisions Next


© 1998-2018 The MESS Team