Previous 15994 Revisions Next

r14151 Tuesday 24th January, 2012 at 11:03:17 UTC by Robbbert
AIM65: removed remaining remnants of the printer.
[src/mess]mess.mak
[src/mess/drivers]aim65.c
[src/mess/includes]aim65.h
[src/mess/machine]aim65.c
[src/mess/video]aim65.c

src/mess/machine/aim65.c
r14150r14151
140140
141141MACHINE_START( aim65 )
142142{
143   aim65_state *state = machine.driver_data<aim65_state>();
143144   ram_device *ram = machine.device<ram_device>(RAM_TAG);
144145   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
145146
146147   /* Init RAM */
147148   space->install_ram(0x0000, ram->size() - 1, ram->pointer());
149
150   state->m_pb_save = 0;
148151}
149152
150153
r14150r14151
158161 * connector for off-board RESET functions. The Monitor performs a software
159162 * reset when the RES line goes high.
160163 */
164
165
166/******************************************************************************
167 Cassette
168******************************************************************************/
169
170WRITE8_MEMBER( aim65_state::aim65_pb_w )
171{
172/*
173   d7 = cass out (both decks)
174   d5 = cass2 motor
175   d4 = cass1 motor
176   d2 = tty out (not emulated)
177   d0/1 = printer data (not emulated)
178*/
179
180   UINT8 bits = data ^ m_pb_save;
181   m_pb_save = data;
182
183   if (BIT(bits, 7))
184   {
185      m_cass1->output(BIT(data, 7) ? -1.0 : +1.0);
186      m_cass2->output(BIT(data, 7) ? -1.0 : +1.0);
187   }
188
189   if (BIT(bits, 5))
190   {
191      if (BIT(data, 5))
192         m_cass2->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
193      else
194         m_cass2->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
195   }
196
197   if (BIT(bits, 4))
198   {
199      if (BIT(data, 4))
200         m_cass1->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
201      else
202         m_cass1->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
203   }
204}
205
206
207READ8_MEMBER( aim65_state::aim65_pb_r )
208{
209/*
210   d7 = cassette in (deck 1)
211   d6 = tty in (not emulated)
212   d3 = kb/tty switch
213*/
214
215   UINT8 data = input_port_read(machine(), "switches");
216   data |= (m_cass1->input() > +0.03) ? 0x80 : 0;
217   data |= 0x40; // TTY must be H if not used.
218   data |= m_pb_save & 0x37;
219   return data;
220}
221
222
223/******************************************************************************
224 Printer
225******************************************************************************/
226
227#ifdef UNUSED_FUNCTION
228/*
229
2302012-01-24 Printer code removed [Robbbert]
231
232From here to the end is not compiled. It is the remnants of the old printer
233code. Have a look at version 0.114 or 0.115 for the original working code.
234
235I've left it here for the idly curious.
236
237The system sends out the pattern of dots to the 'dot-matrix' print-head.
238
239This is why we can't simply replace it with a Centronics-like 'Printer'
240device - the output will be gibberish.
241*/
242
243
244
245/*
246  aim65 thermal printer (20 characters)
247  10 heat elements (place on 1 line, space between 2 characters(about 14dots))
248  (pa0..pa7,pb0,pb1 1 heat element on)
249
250  cb2 0 motor, heat elements on
251  cb1 output start!?
252  ca1 input
253
254  normally printer 5x7 characters
255  (horizontal movement limits not known, normally 2 dots between characters)
256
257  3 dots space between lines?
258*/
259
260
261/* Part of aim65_pb_w
262
263   data &= 0x03;
264
265   if (m_flag_b == 0)
266   {
267      printerRAM[(m_printer_y * 20) + m_printer_x ] |= (data << 8);
268      m_flag_b = 1;
269   }
270*/
271
272
273/* Items for driver state
274
275   emu_timer *m_print_timer;
276   int m_printer_x;
277   int m_printer_y;
278   bool m_printer_dir;
279   bool m_flag_a;
280   bool m_flag_b;
281   bool m_printer_level;
282   UINT16 *m_printerRAM;
283*/
284
285
286/* Other items from H file
287VIDEO_START( aim65 );
288VIDEO_UPDATE( aim65 );
289*/
290
291
292/* From 6522 config
293DRIVER_MEMBER(aim65_state, aim65_pa_w), // out port A
294DRIVER_MEMBER(aim65_state, aim65_printer_on), // out CB2
295*/
296
297
298/* From Machine Config
299   MCFG_VIDEO_START(aim65)
300   MCFG_VIDEO_UPDATE(aim65)
301*/
302
303
304static TIMER_CALLBACK(aim65_printer_timer)
305{
306   aim65_state *state = machine.driver_data<aim65_state>();
307   via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
308
309   via_0->write_cb1(state->m_printer_level);
310   via_0->write_cb1(!state->m_printer_level);
311   state->m_printer_level ^= 1;
312
313   if (state->m_printer_dir)
314   {
315      if (state->m_printer_x > 0)
316         state->m_printer_x--;
317      else
318      {
319         state->m_printer_dir = 0;
320         state->m_printer_x++;
321         state->m_printer_y++;
322      }
323   }
324   else
325   {
326      if (state->m_printer_x < 9)
327         state->m_printer_x++;
328      else
329      {
330         state->m_printer_dir = 1;
331         state->m_printer_x--;
332         state->m_printer_y++;
333      }
334   }
335
336   if (state->m_printer_y > 500) state->m_printer_y = 0;
337
338   state->m_flag_a=0;
339   state->m_flag_b=0;
340}
341
342
343WRITE8_MEMBER( aim65_state::aim65_printer_on )
344{
345   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
346   if (!data)
347   {
348      m_printer_x=0;
349      m_printer_y++;
350      if (m_printer_y > 500) m_printer_y = 0;
351      m_flag_a = m_flag_b=0;
352      via_0->write_cb1(0);
353      m_print_timer->adjust(attotime::zero, 0, attotime::from_usec(10));
354      m_printer_level = 1;
355   }
356   else
357      m_print_timer->reset();
358}
359
360
361WRITE8_MEMBER( aim65_state::aim65_pa_w )
362{
363// All bits are for printer data (not emulated)
364   if (m_flag_a == 0)
365   {
366      m_printerRAM[(m_printer_y * 20) + m_printer_x] |= data;
367      m_flag_a = 1;
368   }
369}
370
371VIDEO_START( aim65 )
372{
373   aim65_state *state = machine.driver_data<aim65_state>();
374   state->m_print_timer = machine.scheduler().timer_alloc(FUNC(aim65_printer_timer));
375   state->m_printerRAM = auto_alloc_array(machine, UINT16, (600 * 10 * 2) / 2);
376   memset(state->m_printerRAM, 0, videoram_size);
377   VIDEO_START_CALL(generic);
378   state->m_printer_x = 0;
379   state->m_printer_y = 0;
380   state->m_printer_dir = 0;
381   state->m_flag_a = 0;
382   state->m_flag_b = 0;
383   state->m_printer_level = 0;
384}
385
386SCREEN_UPDATE( aim65 )
387{
388   aim65_state *state = screen.machine().driver_data<aim65_state>();
389   /* Display printer output */
390   bool dir = 1;
391   UINT8 b,x,pen;
392   UINT16 y;
393
394   for (y = 0; y<500; y++)
395   {
396      for(x = 0; x< 10; x++)
397      {
398         if (dir == 1)
399            data = state->m_printerRAM[y * 10  + x];
400         else
401            data = state->m_printerRAM[(y * 10) + (9 - x)];
402
403
404         for (b = 0; b<10; b++)
405         {
406            pen = screen.machine().pens[BIT(data, 0) ? 2 : 0];
407            plot_pixel(bitmap,700 - ((b * 10) + x), y, pen);
408            data >>= 1;
409         }
410      }
411
412      dir ^= 1;
413   }
414   return 0;
415}
416
417
418#endif
419
src/mess/video/aim65.c
r14150r14151
1/******************************************************************************
2
3    PeT mess@utanet.at Nov 2000
4    Updated by Dan Boris, 3/4/2007
5
6******************************************************************************/
7
8#include "includes/aim65.h"
9
10//UINT16 *printerRAM;
11
12
13
14
15/******************************************************************************
16 Printer
17******************************************************************************/
18
19/*
20  aim65 thermal printer (20 characters)
21  10 heat elements (place on 1 line, space between 2 characters(about 14dots))
22  (pa0..pa7,pb0,pb1 1 heat element on)
23
24  cb2 0 motor, heat elements on
25  cb1 output start!?
26  ca1 input
27
28  normally printer 5x7 characters
29  (horizontal movement limits not known, normally 2 dots between characters)
30
31  3 dots space between lines?
32 */
33
34
35static TIMER_CALLBACK(aim65_printer_timer)
36{
37   aim65_state *state = machine.driver_data<aim65_state>();
38   via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
39
40   via_0->write_cb1(state->m_printer_level);
41   via_0->write_cb1(!state->m_printer_level);
42   state->m_printer_level ^= 1;
43
44   if (state->m_printer_dir)
45   {
46      if (state->m_printer_x > 0)
47         state->m_printer_x--;
48      else
49      {
50         state->m_printer_dir = 0;
51         state->m_printer_x++;
52         state->m_printer_y++;
53      }
54   }
55   else
56   {
57      if (state->m_printer_x < 9)
58         state->m_printer_x++;
59      else
60      {
61         state->m_printer_dir = 1;
62         state->m_printer_x--;
63         state->m_printer_y++;
64      }
65   }
66
67   if (state->m_printer_y > 500) state->m_printer_y = 0;
68
69   state->m_flag_a=0;
70   state->m_flag_b=0;
71}
72
73
74WRITE8_MEMBER( aim65_state::aim65_printer_on )
75{
76   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
77   if (!data)
78   {
79      m_printer_x=0;
80      m_printer_y++;
81      if (m_printer_y > 500) m_printer_y = 0;
82      m_flag_a = m_flag_b=0;
83      via_0->write_cb1(0);
84      //m_print_timer->adjust(attotime::zero, 0, attotime::from_usec(10));
85      m_printer_level = 1;
86   }
87   else
88   {
89      m_print_timer->reset();
90   }
91}
92
93
94WRITE8_MEMBER( aim65_state::aim65_pa_w )
95{
96// All bits are for printer data (not emulated)
97#if 0
98   if (m_flag_a == 0)
99   {
100      printerRAM[(m_printer_y * 20) + m_printer_x] |= data;
101      m_flag_a = 1;
102   }
103#endif
104}
105
106WRITE8_MEMBER( aim65_state::aim65_pb_w )
107{
108/*
109   d7 = cass out (both decks)
110   d5 = cass2 motor
111   d4 = cass1 motor
112   d2 = tty out (not emulated)
113   d0/1 = printer data (not emulated)
114*/
115
116   UINT8 bits = data ^ m_pb_save;
117   m_pb_save = data;
118
119   if (BIT(bits, 7))
120   {
121      m_cass1->output(BIT(data, 7) ? -1.0 : +1.0);
122      m_cass2->output(BIT(data, 7) ? -1.0 : +1.0);
123   }
124
125   if (BIT(bits, 5))
126   {
127      if (BIT(data, 5))
128         m_cass2->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
129      else
130         m_cass2->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
131   }
132
133   if (BIT(bits, 4))
134   {
135      if (BIT(data, 4))
136         m_cass1->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
137      else
138         m_cass1->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
139   }
140
141
142#if 0
143   data &= 0x03;
144
145   if (m_flag_b == 0)
146   {
147      printerRAM[(m_printer_y * 20) + m_printer_x ] |= (data << 8);
148      m_flag_b = 1;
149   }
150#endif
151}
152
153VIDEO_START( aim65 )
154{
155   aim65_state *state = machine.driver_data<aim65_state>();
156   state->m_print_timer = machine.scheduler().timer_alloc(FUNC(aim65_printer_timer));
157
158#if 0
159   videoram_size = 600 * 10 * 2;
160   printerRAM = auto_alloc_array(machine, UINT16, videoram_size / 2);
161   memset(printerRAM, 0, videoram_size);
162   VIDEO_START_CALL(generic);
163#endif
164   state->m_printer_x = 0;
165   state->m_printer_y = 0;
166   state->m_printer_dir = 0;
167   state->m_flag_a = 0;
168   state->m_flag_b = 0;
169   state->m_printer_level = 0;
170   state->m_pb_save = 0;
171}
172
173
174#ifdef UNUSED_FUNCTION
175SCREEN_UPDATE( aim65 )
176{
177   /* Display printer output */
178   dir = 1;
179   for(y = 0; y<500;y++)
180   {
181      for(x = 0; x< 10; x++)
182      {
183         if (dir == 1) {
184            data = printerRAM[y * 10  + x];
185         }
186         else {
187            data = printerRAM[(y * 10) + (9 - x)];
188         }
189
190
191         for (b = 0; b<10; b++)
192         {
193            color=machine.pens[(data & 0x1)?2:0];
194            plot_pixel(bitmap,700 - ((b * 10) + x), y,color);
195            data = data >> 1;
196         }
197      }
198
199      if (dir == 0)
200         dir = 1;
201      else
202         dir = 0;
203   }
204   return 0;
205}
206#endif
207
208
209READ8_MEMBER( aim65_state::aim65_pb_r )
210{
211/*
212   d7 = cassette in (deck 1)
213   d6 = tty in (not emulated)
214   d3 = kb/tty switch
215*/
216
217   UINT8 data = input_port_read(machine(), "switches");
218   data |= (m_cass1->input() > +0.03) ? 0x80 : 0;
219   data |= 0x40; // TTY must be H if not used.
220   data |= m_pb_save & 0x37;
221   return data;
222}
223
src/mess/includes/aim65.h
r14150r14151
5252   UINT8 m_pia_b;
5353   UINT8 m_riot_port_a;
5454   UINT8 m_pb_save;
55   emu_timer *m_print_timer;
56   int m_printer_x;
57   int m_printer_y;
58   bool m_printer_dir;
59   bool m_flag_a;
60   bool m_flag_b;
61   bool m_printer_level;
6255
6356   required_device<cpu_device> m_maincpu;
6457   required_device<cassette_image_device> m_cass1;
r14150r14151
7770
7871MACHINE_START( aim65 );
7972
80
81/*----------- defined in video/aim65.c -----------*/
82
83VIDEO_START( aim65 );
84
85/* Printer */
86
87
88
8973#endif /* AIM65_H_ */
src/mess/mess.mak
r14150r14151
13731373   $(MESS_DRIVERS)/z9001.o      \
13741374
13751375$(MESSOBJ)/rockwell.a:         \
1376   $(MESS_VIDEO)/aim65.o      \
13771376   $(MESS_MACHINE)/aim65.o      \
13781377   $(MESS_DRIVERS)/aim65.o      \
13791378   $(MESS_DRIVERS)/aim65_40.o   \
src/mess/drivers/aim65.c
r14150r14151
163163   DEVCB_NULL, // in CB1
164164   DEVCB_NULL, // in CA2
165165   DEVCB_NULL, // in CB2
166   DEVCB_DRIVER_MEMBER(aim65_state, aim65_pa_w), // out port A
166   DEVCB_NULL, // out Port A
167167   DEVCB_DRIVER_MEMBER(aim65_state, aim65_pb_w), // out port B
168168   DEVCB_NULL, // out CA1
169169   DEVCB_NULL, // out CB1 printer start
170170   DEVCB_NULL, // out CA2 cass control (H=in)
171   DEVCB_DRIVER_MEMBER(aim65_state, aim65_printer_on), // out CB2
171   DEVCB_NULL, // out CB2 turn printer on
172172   DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE) //IRQ
173173};
174174
r14150r14151
248248   MCFG_DL1416T_ADD("ds4", aim65_update_ds4)
249249   MCFG_DL1416T_ADD("ds5", aim65_update_ds5)
250250
251   MCFG_VIDEO_START(aim65)
252
253251   /* Sound - wave sound only */
254252   MCFG_SPEAKER_STANDARD_MONO("mono")
255253   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team