Previous 15994 Revisions Next

r764 Monday 30th July, 2007 at 18:58:47 UTC by Dirk Best
Initial commit of the Rockwell AIM 65 driver rewrite. Major change is the rewritten display emulation including new artwork. Also, support for configurable RAM sizes has been added and the system was converted to a screenless system.
[artwork]aim65.zip*
[docs]messnew.txt
[src/mess]mess.mak
[src/mess/drivers]aim65.c
[src/mess/includes]aim65.h
[src/mess/layout]aim65.lay*
[src/mess/machine]aim65.c
[src/mess/video]aim65.c dl1416.c* dl1416.h*

src/mess/includes/aim65.h
r763r764
11#include "driver.h"
22
3/* R6502 Clock
4 *
5 * The R6502 on AIM65 operatores at 1 MHz. The frequency reference is a 4 Mhz
6 * crystal controllred oscillator. Dual D-type flip-flop Z10 devides the 4 MHz
7 * signal by four to drive the R6502 phase 0 (O0) input with a 1 MHz clock.
8 */
9#define OSC_Y1 4000000
10
311extern DRIVER_INIT( aim65 );
412
5// 4 16segment displays in 1 chip
6void dl1416a_write(int chip, int digit, int value, int cursor);
13VIDEO_START( aim65 );
714
8extern PALETTE_INIT( aim65 );
9extern VIDEO_START( aim65 );
10extern VIDEO_UPDATE( aim65 );
15/* Printer */
16void aim65_printer_data_a(UINT8 data);
17void aim65_printer_data_b(UINT8 data);
1118
12extern void aim65_printer_inc(void);
13extern void aim65_printer_data_a(UINT8 data);
14extern void aim65_printer_data_b(UINT8 data);
15extern void aim65_printer_cr(void);
19TIMER_CALLBACK(aim65_printer_timer);
20WRITE8_HANDLER( aim65_printer_on );
1621
22
1723#define KEY_1 (readinputport(0)&1)
1824#define KEY_2 (readinputport(0)&2)
1925#define KEY_3 (readinputport(0)&4)
src/mess/video/aim65.c
r763r764
11/******************************************************************************
22
3   PeT mess@utanet.at Nov 2000
4   Updated by Dan Boris, 3/4/2007
3    PeT mess@utanet.at Nov 2000
4    Updated by Dan Boris, 3/4/2007
55
66******************************************************************************/
77
88#include "driver.h"
9#include "video/generic.h"
109
1110#include "includes/aim65.h"
11#include "machine/6522via.h"
1212
1313static int printer_x;
1414static int printer_y;
r763r764
1818
1919UINT16 *printerRAM;
2020
21typedef struct {
22   int digit[4]; // 16 segment digit, decoded from 7 bit data!
23   int cursor_on[4];
24} DL1416A;
21static mame_timer *print_timer;
22static int printer_level;
2523
26static DL1416A dl1416a[5]= { { {0} } };
2724
28void dl1416a_write(int chip, int digit, int value, int cursor)
29{
30   digit^=3;
31   if (cursor) {
32      dl1416a[chip].cursor_on[0]=value&1;
33      dl1416a[chip].cursor_on[1]=value&2;
34      dl1416a[chip].cursor_on[2]=value&4;
35      dl1416a[chip].cursor_on[3]=value&8;
36   } else {
37      dl1416a[chip].digit[digit]=value;
38   }
39}
4025
41// aim 65 users guide table 7.6
42static const int dl1416a_segments[0x80]={ // witch segments must be turned on for this value!?
43   0x0000, 0x0000, 0x0000, 0x0000, // 0x00 // not known
44   0x0000, 0x0000, 0x0000, 0x0000,
45   0x0000, 0x0000, 0x0000, 0x0000,
46   0x0000, 0x0000, 0x0000, 0x0000,
47   0x0000, 0x0000, 0x0000, 0x0000, // 0x10
48   0x0000, 0x0000, 0x0000, 0x0000,
49   0x0000, 0x0000, 0x0000, 0x0000,
50   0x0000, 0x0000, 0x0000, 0x0000,
51   0x0000, 0x1121, 0x0180, 0x0f3c, // 0x20   ! " #
52   0x0fbb, 0xaf99, 0x5979, 0x2000, //      $ % & '
53   0x6000, 0x9000, 0xff00, 0x0f00, //      ( ) * +
54   0x8000, 0x0a00, 0x0020, 0xa000, //      , - . /
55   0x05e1, 0x0500, 0x0961, 0x0d21, // 0x30 0 1 2 3
56   0x0d80, 0x0ca1, 0x0ce1, 0x0501, //      4 5 6 7
57   0x0de1, 0x0da1, 0x0021, 0x8001, //      8 9 : ;
58   0xa030, 0x0a30, 0x5030, 0x0607, //      < = > ?
59   0x0c7f, 0x0acf, 0x073f, 0x00f3, // 0x40 @ A B C
60   0x053f, 0x08f3, 0x08c3, 0x02fb, //      D E F G
61   0x0acc, 0x0533, 0x0563, 0x68c0, //      H I J K
62   0x00f0, 0x30cc, 0x50cc, 0x00ff, //      L M N O
63   0x0ac7, 0x40ff, 0x4ac7, 0x0abb, // 0x50 P Q R S
64   0x0503, 0x00fc, 0xa0c0, 0xc0cc, //      T U V W
65   0xf000, 0x3400, 0xa033, 0x00e1, //      X Y Z [
66   0x5000, 0x001e, 0xc000, 0x0030, //      \ ] ^ _
67   0x0000, 0x0000, 0x0000, 0x0000, // 0x60
68   0x0000, 0x0000, 0x0000, 0x0000,
69   0x0000, 0x0000, 0x0000, 0x0000,
70   0x0000, 0x0000, 0x0000, 0x0000,
71   0x0000, 0x0000, 0x0000, 0x0000, // 0x70
72   0x0000, 0x0000, 0x0000, 0x0000,
73   0x0000, 0x0000, 0x0000, 0x0000,
74   0x0000, 0x0000, 0x0000, 0x0000
75};
26/******************************************************************************
27 Printer
28******************************************************************************/
7629
77static const rgb_t aim65_palette[] =
78{
79     MAKE_RGB(0x20,0x02,0x05),
80   MAKE_RGB(0xc0, 0, 0),
81};
30/*
31  aim65 thermal printer (20 characters)
32  10 heat elements (place on 1 line, space between 2 characters(about 14dots))
33  (pa0..pa7,pb0,pb1 1 heat element on)
8234
83PALETTE_INIT( aim65 )
84{
85   palette_set_colors(machine, 0, aim65_palette, ARRAY_LENGTH(aim65_palette));
86}
35  cb2 0 motor, heat elements on
36  cb1 output start!?
37  ca1 input
8738
39  normally printer 5x7 characters
40  (horizontal movement limits not known, normally 2 dots between characters)
41
42  3 dots space between lines?
43 */
44
45
8846void aim65_printer_inc(void)
8947{
9048   if (printer_dir)
r763r764
12381   flag_a=flag_b=0;
12482}
12583
126void aim65_printer_data_a(UINT8 data) {
127/*   if (flag_a == 0) {
128      printerRAM[(printer_y * 20) + printer_x] |= data;
129      flag_a = 1;
130   }*/
84TIMER_CALLBACK(aim65_printer_timer)
85{
86   via_0_cb1_w(0, printer_level);
87   via_0_ca1_w(0, !printer_level);
88   printer_level = !printer_level;
89   aim65_printer_inc();
13190}
13291
133void aim65_printer_data_b(UINT8 data) {
134/*   data &= 0x03;
13592
136   if (flag_b == 0) {
137      printerRAM[(printer_y * 20) + printer_x ] |= (data << 8);
138      flag_b = 1;
139   }*/
140}
141
142VIDEO_START( aim65 )
93WRITE8_HANDLER( aim65_printer_on )
14394{
144   videoram_size = 600 * 10 * 2;
145   printerRAM = (UINT16*)auto_malloc (videoram_size );
146   memset(printerRAM, 0, videoram_size);
147   printer_x = 0;
148   printer_y = 0;
149   printer_dir = 0;
150   flag_a=0;
151   flag_b=0;
152
153#if 0
95   if (!data)
15496   {
155      char backdrop_name[200];
156       /* try to load a backdrop for the machine */
157      sprintf(backdrop_name, "%s.png", Machine->gamedrv->name);
158      backdrop_load(backdrop_name, 2);
97      aim65_printer_cr();
98      mame_timer_adjust(print_timer, time_zero, 0, MAME_TIME_IN_USEC(10));
99      via_0_cb1_w(0, 0);
100      printer_level = 1;
159101   }
160#endif
102   else
103      mame_timer_reset(print_timer, time_never);
104}
161105
162   video_start_generic(machine);
106
107void aim65_printer_data_a(UINT8 data) {
108/*  if (flag_a == 0) {
109        printerRAM[(printer_y * 20) + printer_x] |= data;
110        flag_a = 1;
111    }*/
163112}
164113
165static const char led[] = {
166   "   aaaaaaa    bbbbbb\r"
167   "   aaaaaaa    bbbbbb\r"
168   "hh         ii        cc\r"
169   "hh mm      ii     nn cc\r"
170   "hh  mm     ii    nn  cc\r"
171   "hh   mm    ii   nn   cc\r"
172   "hh    mm   ii   nn   cc\r"
173   "hh     mm  ii  nn    cc\r"
174   "hh      mm ii nn     cc\r"
175   "hh         ii        cc\r"
176   "  lllllll    jjjjjj\r"
177   "  lllllll    jjjjjj\r"
178   "gg         kk        dd\r"
179   "gg      pp kk oo     dd\r"
180   "gg     pp  kk  oo    dd\r"
181   "gg    pp   kk  oo    dd\r"
182   "gg   pp    kk    oo  dd\r"
183   "gg  pp     kk    oo  dd\r"
184   "gg pp      kk     oo dd\r"
185   "gg         kk        dd\r"
186   "   fffffff    eeeeee\r"
187   "   fffffff    eeeeee"
188};
114void aim65_printer_data_b(UINT8 data) {
115/*  data &= 0x03;
189116
190static void aim65_draw_7segment(mame_bitmap *bitmap,int value, int x, int y)
117    if (flag_b == 0) {
118        printerRAM[(printer_y * 20) + printer_x ] |= (data << 8);
119        flag_b = 1;
120    }*/
121}
122
123VIDEO_START( aim65 )
191124{
192   int i, xi, yi, mask, color;
125   print_timer = mame_timer_alloc(aim65_printer_timer);
193126
194   for (i=0, xi=0, yi=0; led[i]; i++) {
195      mask=0;
196      switch (led[i]) {
197      case 'a': mask=1; break;
198      case 'b': mask=2; break;
199      case 'c': mask=4; break;
200      case 'd': mask=8; break;
201      case 'e': mask=0x10; break;
127   /*
128    videoram_size = 600 * 10 * 2;
129    printerRAM = (UINT16*)auto_malloc (videoram_size );
130    memset(printerRAM, 0, videoram_size);
131    printer_x = 0;
132    printer_y = 0;
133    printer_dir = 0;
134    flag_a=0;
135    flag_b=0;
202136
203      case 'f': mask=0x20; break;
204      case 'g': mask=0x40; break;
205      case 'h': mask=0x80; break;
206      case 'i': mask=0x100; break;
207      case 'j': mask=0x200; break;
208137
209      case 'k': mask=0x400; break;
210      case 'l': mask=0x800; break;
211      case 'm': mask=0x1000; break;
212      case 'n': mask=0x2000; break;
213      case 'o': mask=0x4000; break;
214      case 'p': mask=0x8000; break;
215      }
138    printer_level = 0;
216139
217      if (mask!=0) {
218         color=Machine->pens[(value&mask)?1:0];
219         *BITMAP_ADDR16(bitmap, y+yi, x+xi) = color;
220      }
221      if (led[i]!='\r') xi++;
222      else { yi++, xi=0; }
223   }
140    video_start_generic(machine);
141    */
224142}
225143
226static const struct {
227   int x,y;
228} aim65_led_pos[20]={
229   {0,0},
230   {30,0},
231   {60,0},
232   {90,0},
233   {120,0},
234   {150,0},
235   {180,0},
236   {210,0},
237   {240,0},
238   {270,0},
239144
240   {300,0},
241   {330,0},
242   {360,0},
243   {390,0},
244   {420,0},
245   {450,0},
246   {480,0},
247   {510,0},
248   {540,0},
249   {570,0}
250};
251
252
253145VIDEO_UPDATE( aim65 )
254146{
255   int i, j;
256
257/*   int x,y,b,color;
258   int data;
259   int dir;*/
260
261   for (j=0; j<5; j++) {
262      for (i=0; i<4; i++) {
263         if (dl1416a[j].cursor_on[i]) {
264            aim65_draw_7segment(bitmap, 0xffff,
265                           aim65_led_pos[j*4+i].x, aim65_led_pos[j*4+i].y);
266         } else {
267            aim65_draw_7segment(bitmap, dl1416a_segments[dl1416a[j].digit[i]],
268                           aim65_led_pos[j*4+i].x, aim65_led_pos[j*4+i].y);
269         }
270      }
271   }
272
273147   /* Display printer output */
274/*   dir = 1;
275   for(y = 0; y<500;y++)
276   {
277      for(x = 0; x< 10; x++)
278      {
279         if (dir == 1) {
280            data = printerRAM[y * 10  + x];
281         }
282         else {
283            data = printerRAM[(y * 10) + (9 - x)];
284         }
148/*  dir = 1;
149    for(y = 0; y<500;y++)
150    {
151        for(x = 0; x< 10; x++)
152        {
153            if (dir == 1) {
154                data = printerRAM[y * 10  + x];
155            }
156            else {
157                data = printerRAM[(y * 10) + (9 - x)];
158            }
285159
286160
287         for (b = 0; b<10; b++)
288         {
289            color=Machine->pens[(data & 0x1)?2:0];
290            plot_pixel(bitmap,700 - ((b * 10) + x), y,color);
291            data = data >> 1;
292         }
293      }
161            for (b = 0; b<10; b++)
162            {
163                color=Machine->pens[(data & 0x1)?2:0];
164                plot_pixel(bitmap,700 - ((b * 10) + x), y,color);
165                data = data >> 1;
166            }
167        }
294168
295      if (dir == 0)
296         dir = 1;
297      else
298         dir = 0;
299   } */
169        if (dir == 0)
170            dir = 1;
171        else
172            dir = 0;
173    } */
300174
301175   return 0;
302176}
src/mess/video/dl1416.c
r0r764
1/*****************************************************************************
2 *
3 * video/dl1416.c
4 *
5 * DL1416
6 *
7 * 4-Digit 16-Segment Alphanumeric Intelligent Display
8 * with Memory/Decoder/Driver
9 *
10 * Notes:
11 *   - Currently supports the DL1416T.
12 *   - Partial support for DL1416B is available, it just needs the right
13 *     character set and MAME core support for its display.
14 *   - Cursor support is implemented but not tested, as the AIM65 does not
15 *     seem to use it.
16 *
17 * Todo:
18 *   - Is the DL1416A identical to the DL1416T? If not, we need to add
19 *     support for it.
20 *
21 * Changes:
22 *   - 2007-07-30: Initial version.  [Dirk Best]
23 *
24 * **************************************************************************/
25 
26 
27/*****************************************************************************
28 Includes
29*****************************************************************************/
30 
31 
32#include "dl1416.h"
33 
34 
35 
36/*****************************************************************************
37 Macros
38*****************************************************************************/
39 
40 
41#define MAX_DL1416 (5)
42 
43#define SEG_UNDEF  (-1)
44#define SEG_BLANK  (0)
45#define SEG_CURSOR (0xffff)
46 
47 
48 
49/*****************************************************************************
50 Type definitions
51*****************************************************************************/
52 
53/* DL1416 chip state */
54typedef struct _dl1416_state dl1416_state;
55 
56struct _dl1416_state
57{
58   const dl1416_interface *intf;
59 
60   int write_enable;
61   int chip_enable;
62   int cursor_enable;
63 
64   UINT16 cursor_ram[4];
65};
66 
67 
68 
69/*****************************************************************************
70 Global variables
71*****************************************************************************/
72 
73 
74/* We use the following order for the segments:
75 *
76 *   000 111
77 *  7D  A  E2
78 *  7 D A E 2
79 *  7  DAE  2
80 *   888 999
81 *  6  CBF  3
82 *  6 C B F 3
83 *  6C  B  F3
84 *   555 444
85 */
86 
87/* Character set DL1416T */
88static const int dl1416t_segments[128] = {
89   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
90   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
91   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
92   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
93   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
94   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
95   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
96   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
97   0x0000,    0x2421,    0x0480,    0x0f3c,    /*   ! " # */
98   0x0fbb,    0x5f99,    0xa579,    0x4000,    /* $ % & ' */
99   0xc000,    0x3000,    0xff00,    0x0f00,    /* ( ) * + */
100   0x1000,    0x0300,    0x0020,    0x5000,    /* , - . / */
101   0x0ce1,    0x0c00,    0x0561,    0x0d21,    /* 0 1 2 3 */
102   0x0d80,    0x09a1,    0x09e1,    0x0c01,    /* 4 5 6 7 */
103   0x0de1,    0x0da1,    0x0021,    0x1001,    /* 8 9 : ; */
104   0x5030,    0x0330,    0xa030,    0x0a07,    /* < = > ? */
105   0x097f,    0x03cf,    0x0e3f,    0x00f3,    /* @ A B C */
106   0x0c3f,    0x01f3,    0x01c3,    0x02fb,    /* D E F G */
107   0x03cc,    0x0c33,    0x0c63,    0xc1c0,    /* H I J K */
108   0x00f0,    0x60cc,    0xa0cc,    0x00ff,    /* L M N O */
109   0x03c7,    0x80ff,    0x83c7,    0x03bb,    /* P Q R S */
110   0x0c03,    0x00fc,    0x50c0,    0x90cc,    /* T U V W */
111   0xf000,    0x6800,    0x5033,    0x00e1,    /* X Y Z [ */
112   0xa000,    0x001e,    0x9000,    0x0030,    /* \ ] ^ _ */
113   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
114   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
115   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
116   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
117   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
118   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
119   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */
120   SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF  /* undefined */
121};
122 
123 
124static dl1416_state dl1416[MAX_DL1416];
125 
126 
127 
128/*****************************************************************************
129 Implementation
130*****************************************************************************/
131 
132/* Config */
133void dl1416_config(int which, const dl1416_interface *intf)
134{
135   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call dl1416_config at init time!");
136   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
137 
138   dl1416[which].intf = intf;
139}
140 
141 
142/* Reset */
143void dl1416_reset(int which)
144{
145   int i;
146 
147   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
148 
149   /* Disable all lines */
150   dl1416[which].chip_enable = FALSE;
151   dl1416[which].write_enable = FALSE;
152   dl1416[which].cursor_enable = FALSE;
153 
154   /* Randomize cursor memory */
155   for (i = 0; i < 4; i++)
156      dl1416[which].cursor_ram[i] = mame_rand(Machine);
157}
158 
159 
160/* Write enable, active low */
161void dl1416_set_input_w(int which, int data)
162{
163   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
164   dl1416[which].write_enable = !data;
165}
166 
167 
168/* Chip enable, active low */
169void dl1416_set_input_ce(int which, int data)
170{
171   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
172   dl1416[which].chip_enable = !data;
173}
174 
175 
176/* Cursor enable, active low */
177void dl1416_set_input_cu(int which, int data)
178{
179   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
180   dl1416[which].cursor_enable = !data;
181}
182 
183 
184/* Data */
185void dl1416_write(int which, offs_t offset, UINT8 data)
186{
187   int i, digit;
188 
189   assert_always(which < MAX_DL1416, "'which' exceeds maximum number of configured DL1416s!");
190 
191   offset &= 0x03; /* A0-A1 */
192   data &= 0x7f;   /* D0-D6 */
193 
194   /* Only try to update the data if we are enabled and write is enabled */
195   if (dl1416[which].chip_enable && dl1416[which].write_enable)
196   {
197      if (dl1416[which].cursor_enable)
198      {
199         switch (dl1416[which].intf->type)
200         {
201 
202         case DL1416B:
203 
204            /* The cursor will be set if D0 is high and the original
205                 * character restored otherwise */
206            digit = data & 1 ? SEG_CURSOR : dl1416[which].cursor_ram[offset];
207 
208            /* Call update function */
209            dl1416[which].intf->digit_changed(offset, digit);
210 
211            break;
212 
213         case DL1416T:
214 
215            for (i = 0; i < 4; i++)
216            {
217               /* Save old digit */
218               int previous_digit = dl1416[which].cursor_ram[i];
219 
220               /* Either set the cursor or restore the original character */
221               digit = data & i ? SEG_CURSOR : dl1416[which].cursor_ram[i];
222 
223               /* Call update function if we changed something */
224               if (previous_digit != digit)
225                  dl1416[which].intf->digit_changed(i, digit);
226            }
227            break;
228 
229         }
230      }
231      else
232      {
233         /* On the DL1416T, a digit can only be changed if there is no
234             * previously stored cursor, or overriden by an undefined
235             * character (blank) */
236         if ((dl1416[which].intf->type != DL1416T) || (
237            (dl1416[which].cursor_ram[offset] != SEG_CURSOR) ||
238            (dl1416t_segments[data] == SEG_UNDEF)))
239         {
240            /* Load data */
241            digit = dl1416t_segments[data];
242 
243            /* Undefined characters are replaced by blanks */
244            if (digit == SEG_UNDEF)
245               digit = SEG_BLANK;
246 
247            /* Save value */
248            dl1416[which].cursor_ram[offset] = digit;
249 
250            /* Call update function */
251            dl1416[which].intf->digit_changed(offset, digit);
252         }
253      }
254   }
255}
256 
257 
258/* Standard handlers */
259WRITE8_HANDLER( dl1416_0_w ) { dl1416_write(0, offset, data); }
260WRITE8_HANDLER( dl1416_1_w ) { dl1416_write(1, offset, data); }
261WRITE8_HANDLER( dl1416_2_w ) { dl1416_write(2, offset, data); }
262WRITE8_HANDLER( dl1416_3_w ) { dl1416_write(3, offset, data); }
263WRITE8_HANDLER( dl1416_4_w ) { dl1416_write(4, offset, data); }
src/mess/video/dl1416.h
r0r764
1/*****************************************************************************
2 *
3 * video/dl1416.h
4 *
5 * DL1416
6 *
7 * 4-Digit 16-Segment Alphanumeric Intelligent Display
8 * with Memory/Decoder/Driver
9 *
10 * See video/dl1416.c for more info
11 *
12 * **************************************************************************/
13 
14#ifndef DL1416_H_
15#define DL1416_H_
16 
17#include "driver.h"
18 
19typedef enum
20{
21   DL1416B,
22   DL1416T
23} dl1416_type_t;
24 
25 
26/* Interface */
27typedef struct _dl1416_interface dl1416_interface;
28struct _dl1416_interface
29{
30   dl1416_type_t type;
31   void (*digit_changed)(int digit, int data);
32};
33 
34/* Configuration */
35void dl1416_config(int which, const dl1416_interface *intf);
36void dl1416_reset(int which);
37 
38/* Inputs */
39void dl1416_set_input_w(int which, int data); /* Write enable */
40void dl1416_set_input_ce(int which, int data); /* Chip enable */
41void dl1416_set_input_cu(int which, int data); /* Cursor enable */
42void dl1416_write(int which, offs_t offset, UINT8 data); /* Data */
43 
44/* Standard handlers */
45WRITE8_HANDLER( dl1416_0_w );
46WRITE8_HANDLER( dl1416_1_w );
47WRITE8_HANDLER( dl1416_2_w );
48WRITE8_HANDLER( dl1416_3_w );
49WRITE8_HANDLER( dl1416_4_w );
50 
51#endif /*DL1416_H_*/
src/mess/layout/aim65.lay
r0r764
1<!-- aim65.lay -->
2 
3<!-- 2007-07-30: Initial version.  [Dirk Best] -->
4 
5<mamelayout version="2">
6 
7   <element name="digit" defstate="0">
8      <led16seg>
9         <!-- Note: Peak wavelength of the DL1416 chips = 660 nm -->
10         <color red="1.0" green="0.0" blue="0.0" />
11      </led16seg>
12   </element>
13 
14   <element name="background">
15      <rect>
16         <bounds left="0" top="0" right="1" bottom="1" />
17         <color red="0.0" green="0.0" blue="0.0" />
18      </rect>
19   </element>
20 
21   <view name="Default">
22 
23      <!-- Black background -->
24      <bezel element="background">
25         <bounds left="0" top="0" right="803" bottom="328" />
26      </bezel>
27 
28      <!-- DL1416A DS1 -->
29      <bezel name="digit0" element="digit">
30         <bounds left="65" top="70" right="90" bottom="120" />
31      </bezel>
32      <bezel name="digit1" element="digit">
33         <bounds left="99" top="70" right="124" bottom="120" />
34      </bezel>
35      <bezel name="digit2" element="digit">
36         <bounds left="133" top="70" right="158" bottom="120" />
37      </bezel>
38      <bezel name="digit3" element="digit">
39         <bounds left="167" top="70" right="192" bottom="120" />
40      </bezel>
41 
42      <!-- DL1416A DS2 -->
43      <bezel name="digit4" element="digit">
44         <bounds left="204" top="70" right="229" bottom="120" />
45      </bezel>
46      <bezel name="digit5" element="digit">
47         <bounds left="238" top="70" right="263" bottom="120" />
48      </bezel>
49      <bezel name="digit6" element="digit">
50         <bounds left="272" top="70" right="297" bottom="120" />
51      </bezel>
52      <bezel name="digit7" element="digit">
53         <bounds left="306" top="70" right="331" bottom="120" />
54      </bezel>
55 
56      <!-- DL1416A DS3 -->
57      <bezel name="digit8" element="digit">
58         <bounds left="343" top="70" right="368" bottom="120" />
59      </bezel>
60      <bezel name="digit9" element="digit">
61         <bounds left="377" top="70" right="402" bottom="120" />
62      </bezel>
63      <bezel name="digit10" element="digit">
64         <bounds left="411" top="70" right="436" bottom="120" />
65      </bezel>
66      <bezel name="digit11" element="digit">
67         <bounds left="445" top="70" right="470" bottom="120" />
68      </bezel>
69 
70      <!-- DL1416A DS4 -->
71      <bezel name="digit12" element="digit">
72         <bounds left="482" top="70" right="507" bottom="120" />
73      </bezel>
74      <bezel name="digit13" element="digit">
75         <bounds left="516" top="70" right="541" bottom="120" />
76      </bezel>
77      <bezel name="digit14" element="digit">
78         <bounds left="550" top="70" right="575" bottom="120" />
79      </bezel>
80      <bezel name="digit15" element="digit">
81         <bounds left="584" top="70" right="609" bottom="120" />
82      </bezel>
83 
84      <!-- DL1416A DS5 -->
85      <bezel name="digit16" element="digit">
86         <bounds left="621" top="70" right="646" bottom="120" />
87      </bezel>
88      <bezel name="digit17" element="digit">
89         <bounds left="655" top="70" right="680" bottom="120" />
90      </bezel>
91      <bezel name="digit18" element="digit">
92         <bounds left="689" top="70" right="714" bottom="120" />
93      </bezel>
94      <bezel name="digit19" element="digit">
95         <bounds left="723" top="70" right="748" bottom="120" />
96      </bezel>
97 
98   </view>
99 
100</mamelayout>
src/mess/machine/aim65.c
r763r764
1313#include "machine/6522via.h"
1414#include "machine/6532riot.h"
1515
16/* DL1416A display chip */
17#include "video/dl1416.h"
18
1619/* M6502 main CPU */
1720#include "cpu/m6502/m6502.h"
1821
1922
2023
2124/******************************************************************************
25 Function Prototypes
26******************************************************************************/
27
28void aim65_update_ds1(int digit, int data);
29void aim65_update_ds2(int digit, int data);
30void aim65_update_ds3(int digit, int data);
31void aim65_update_ds4(int digit, int data);
32void aim65_update_ds5(int digit, int data);
33
34
35
36/******************************************************************************
2237 Global variables
2338******************************************************************************/
2439
r763r764
2641static UINT8 pia_a, pia_b;
2742static UINT8 riot_port_a;
2843
29static mame_timer *print_timer;
30static int printer_level;
44/* Display driver interfaces */
45static const dl1416_interface dl1416_ds1 = { DL1416T, aim65_update_ds1 };
46static const dl1416_interface dl1416_ds2 = { DL1416T, aim65_update_ds2 };
47static const dl1416_interface dl1416_ds3 = { DL1416T, aim65_update_ds3 };
48static const dl1416_interface dl1416_ds4 = { DL1416T, aim65_update_ds4 };
49static const dl1416_interface dl1416_ds5 = { DL1416T, aim65_update_ds5 };
3150
3251
3352
r763r764
4160   cpunum_set_input_line(0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE);
4261}
4362
63/* STEP/RUN
64 *
65 * Switch S2 (STEP/RUN) causes AIM 65 to operate either in the RUN mode or the
66 * single STEP mode. In the STEP mode, the NMI interrupt line is driven low
67 * when SYNC and O2 go high during instruction execution if the address lines
68 * are outside the A000-FFFF range. The NMI interrupt occurs on the high to
69 * low transition of the NMI line. The Monitor software will trace instructions
70 * and register, outside the Monitor instruction address range if the trace
71 * modes are selected and the NMI Interrupt Routine is not bypassed.
72 */
4473
4574
75
4676/******************************************************************************
4777 6821 PIA
4878******************************************************************************/
4979
80/* PA0: A0 (Address)
81 * PA1: A1 (Address)
82 * PA2: CE1 (Chip enable)
83 * PA3: CE2 (Chip enable)
84 * PA4: CE3 (Chip enable)
85 * PA5: CE4 (Chip enable)
86 * PA6: CE5 (Chip enable)
87 * PA7: W (Write enable)
88 * PB0-6: D0-D6 (Data)
89 * PB7: CU (Cursor)
90 */
5091
5192static void aim65_pia(void)
5293{
53   if ( !(pia_a&0x80) ) {
54      if (!(pia_a&4)) dl1416a_write(0, pia_a&3, pia_b&0x7f, !(pia_b&0x80) );
55      if (!(pia_a&8)) dl1416a_write(1, pia_a&3, pia_b&0x7f, !(pia_b&0x80) );
56      if (!(pia_a&0x10)) dl1416a_write(2, pia_a&3, pia_b&0x7f, !(pia_b&0x80) );
57      if (!(pia_a&0x20)) dl1416a_write(3, pia_a&3, pia_b&0x7f, !(pia_b&0x80) );
58      if (!(pia_a&0x40)) dl1416a_write(4, pia_a&3, pia_b&0x7f, !(pia_b&0x80) );
94   int which;
95
96   for (which = 0; which < 5; which++)
97   {
98      dl1416_set_input_ce(which, pia_a & (0x04 << which));
99      dl1416_set_input_w(which, pia_a & 0x80);
100      dl1416_set_input_cu(which, pia_b & 0x80);
101      dl1416_write(which, pia_a & 0x03, pia_b & 0x7f);
59102   }
60103}
61104
r763r764
76119
77120static const pia6821_interface pia =
78121{
79   0, // read8_handler in_a_func,
80   0, // read8_handler in_b_func,
81   0, // read8_handler in_ca1_func,
82   0, // read8_handler in_cb1_func,
83   0, // read8_handler in_ca2_func,
84   0, // read8_handler in_cb2_func,
122   NULL, // read8_handler in_a_func,
123   NULL, // read8_handler in_b_func,
124   NULL, // read8_handler in_ca1_func,
125   NULL, // read8_handler in_cb1_func,
126   NULL, // read8_handler in_ca2_func,
127   NULL, // read8_handler in_cb2_func,
85128   aim65_pia_a_w,
86129   aim65_pia_b_w,
87   0, // write8_handler out_ca2_func,
88   0, // write8_handler out_cb2_func,
89   0, // void (*irq_a_func)(int state),
90   0, // void (*irq_b_func)(int state),
130   NULL, // write8_handler out_ca2_func,
131   NULL, // write8_handler out_cb2_func,
132   NULL, // void (*irq_a_func)(int state),
133   NULL, // void (*irq_b_func)(int state),
91134};
92135
93136
137void aim65_update_ds1(int digit, int data) { output_set_digit_value( 0 + (digit ^ 3), data); }
138void aim65_update_ds2(int digit, int data) { output_set_digit_value( 4 + (digit ^ 3), data); }
139void aim65_update_ds3(int digit, int data) { output_set_digit_value( 8 + (digit ^ 3), data); }
140void aim65_update_ds4(int digit, int data) { output_set_digit_value(12 + (digit ^ 3), data); }
141void aim65_update_ds5(int digit, int data) { output_set_digit_value(16 + (digit ^ 3), data); }
94142
143
144
95145/******************************************************************************
96146 6532 RIOT
97147******************************************************************************/
r763r764
208258
209259
210260/******************************************************************************
211 Printer
212******************************************************************************/
213
214/*
215  aim65 thermal printer (20 characters)
216  10 heat elements (place on 1 line, space between 2 characters(about 14dots))
217  (pa0..pa7,pb0,pb1 1 heat element on)
218
219  cb2 0 motor, heat elements on
220  cb1 output start!?
221  ca1 input
222
223  normally printer 5x7 characters
224  (horizontal movement limits not known, normally 2 dots between characters)
225
226  3 dots space between lines?
227 */
228
229
230static TIMER_CALLBACK(aim65_printer_timer)
231{
232   via_0_cb1_w(0, printer_level);
233   via_0_ca1_w(0, !printer_level);
234   printer_level = !printer_level;
235   aim65_printer_inc();
236}
237
238
239static WRITE8_HANDLER( aim65_printer_on )
240{
241   if (!data)
242   {
243      aim65_printer_cr();
244      mame_timer_adjust(print_timer, time_zero, 0, MAME_TIME_IN_USEC(10));
245      via_0_cb1_w(0, 0);
246      printer_level = 1;
247   }
248   else
249      mame_timer_reset(print_timer, time_never);
250}
251
252
253
254/******************************************************************************
255261 6522 VIA
256262******************************************************************************/
257263
r763r764
291297   aim65_via_irq_func // void (*irq_func)(int state);
292298};
293299
300static const struct via6522_interface user_via =
301{
302   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
303};
294304
295305
306
296307/******************************************************************************
297308 Driver init
298309******************************************************************************/
r763r764
300311
301312DRIVER_INIT( aim65 )
302313{
314   /* Init RAM */
315   memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0, MRA8_RAM);
316   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0, mess_ram_size - 1, 0, 0, MWA8_RAM);
317
318   if (mess_ram_size < 4 * 1024)
319   {
320      memory_install_read8_handler (0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x0fff, 0, 0, MRA8_NOP);
321      memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, mess_ram_size, 0x0fff, 0, 0, MWA8_NOP);
322   }
323
324   /* Init display driver */
325   dl1416_config(0, &dl1416_ds1);
326   dl1416_config(1, &dl1416_ds2);
327   dl1416_config(2, &dl1416_ds3);
328   dl1416_config(3, &dl1416_ds4);
329   dl1416_config(4, &dl1416_ds5);
330
331   dl1416_reset(0);
332   dl1416_reset(1);
333   dl1416_reset(2);
334   dl1416_reset(3);
335   dl1416_reset(4);
336
303337   pia_config(0, &pia);
338
304339   r6532_config(0, &r6532_interface);
305340   r6532_set_clock(0, 1000000);
306341   r6532_reset(0);
307   via_config(0,&via0);
308   via_reset();
342
343   via_config(0, &via0);
309344   via_0_cb1_w(1, 1);
310345   via_0_ca1_w(1, 0);
311346
312   print_timer = mame_timer_alloc(aim65_printer_timer);
347   via_config(1, &user_via);
348   via_reset();
349}
313350
314   printer_level = 0;
315}
351
352/* RESET
353 *
354 * Pushbutton switch S1 initiates RESET of the AIM65 hardware and software.
355 * Timer Z4 holds the RES low for at least 15 ms from the time the pushbutton
356 * is released. RES is routed to the R6502 CPU, the Monitor R6522 (Z32), the
357 * Monitor R6532 RIOT (Z33), the user R6522 VIA (Z1), and the display R6520 PIA
358 * (U1). To initiate the device RESET function is also routed to the expansion
359 * connector for off-board RESET functions. The Monitor performs a software
360 * reset when the RES line goes high.
361 */
src/mess/mess.mak
r763r764
321321   $(MESSOBJ)/messdriv.o \
322322   $(MESSOBJ)/acorn.a \
323323   $(MESSOBJ)/advision.a \
324   $(MESSOBJ)/aim65.a \
325324   $(MESSOBJ)/amiga.a \
326325   $(MESSOBJ)/amstrad.a \
327326   $(MESSOBJ)/apexc.a \
r763r764
378377   $(MESSOBJ)/pmd85.a \
379378   $(MESSOBJ)/primo.a \
380379   $(MESSOBJ)/rca.a \
380   $(MESSOBJ)/rockwell.a \
381381   $(MESSOBJ)/samcoupe.a \
382382   $(MESSOBJ)/sega.a \
383383   $(MESSOBJ)/sgi.a \
r763r764
840840   $(MESS_MACHINE)/sym1.o    \
841841   $(MESS_DRIVERS)/sym1.o
842842
843$(MESSOBJ)/aim65.a :    \
844   $(MESS_VIDEO)/aim65.o    \
843$(MESSOBJ)/rockwell.a :    \
844   $(MESS_VIDEO)/dl1416.o \
845   $(MESS_VIDEO)/aim65.o \
845846   $(MESS_MACHINE)/aim65.o    \
846847   $(MESS_DRIVERS)/aim65.o
847848
r763r764
11511152
11521153$(MESS_DRIVERS)/mk2.o:   $(MESS_LAYOUT)/mk2.lh
11531154
1155$(MESS_DRIVERS)/aim65.o:   $(MESS_LAYOUT)/aim65.lh
11541156
11551157
11561158include src/mess/tools/imgtool/imgtool.mak
src/mess/drivers/aim65.c
r763r764
2121/* for natural keyboard support */
2222#include "inputx.h"
2323
24static ADDRESS_MAP_START( aim65_mem , ADDRESS_SPACE_PROGRAM, 8)
25   //     -03ff 1k version
26   //     -0fff 4k version
27   AM_RANGE( 0x0000, 0x0fff) AM_RAM
28//  { 0xa000, 0xa00f, via_1_r }, // user via
29   AM_RANGE( 0xa400, 0xa47f) AM_RAM // riot6532 ram
30   AM_RANGE( 0xa480, 0xa49f) AM_READWRITE( r6532_0_r, r6532_0_w )
31   AM_RANGE( 0xa800, 0xa80f) AM_READWRITE( via_0_r, via_0_w )
32   AM_RANGE( 0xac00, 0xac03) AM_READWRITE( pia_0_r, pia_0_w )
33   AM_RANGE( 0xac04, 0xac43) AM_RAM
34   AM_RANGE( 0xb000, 0xffff) AM_ROM
24/* for the layout */
25#include "rendlay.h"
26#include "aim65.lh"
27
28
29/* Note: RAM is mapped dynamically in machine/aim65.c */
30static ADDRESS_MAP_START( aim65_mem , ADDRESS_SPACE_PROGRAM, 8 )
31   AM_RANGE( 0x1000, 0x9fff ) AM_NOP /* User available expansions */
32   AM_RANGE( 0xa000, 0xa00f ) AM_READWRITE( via_1_r, via_1_w ) /* User VIA */
33   AM_RANGE( 0xa010, 0xa3ff ) AM_NOP /* Not available */
34   AM_RANGE( 0xa400, 0xa47f ) AM_RAM /* RIOT RAM */
35   AM_RANGE( 0xa480, 0xa497 ) AM_READWRITE( r6532_0_r, r6532_0_w )
36   AM_RANGE( 0xa498, 0xa7ff ) AM_NOP /* Not available */
37   AM_RANGE( 0xa800, 0xa80f ) AM_READWRITE( via_0_r, via_0_w )
38   AM_RANGE( 0xa810, 0xabff ) AM_NOP /* Not available */
39   AM_RANGE( 0xac00, 0xac03 ) AM_READWRITE( pia_0_r, pia_0_w )
40   AM_RANGE( 0xac04, 0xac43 ) AM_RAM /* PIA RAM */
41   AM_RANGE( 0xac44, 0xafff ) /* Not available */
42   AM_RANGE( 0xb000, 0xffff ) AM_ROM /* 5 ROM sockets */
3543ADDRESS_MAP_END
3644
45
3746INPUT_PORTS_START( aim65 )
3847   PORT_START
3948   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1  !")   PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
r763r764
96105   PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/  ?")   PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
97106   PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
98107   PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPACE")  PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')
99   
108
100109   PORT_START
101110    PORT_DIPNAME(0x08, 0x08, "Terminal")
102111   PORT_DIPSETTING( 0x00, "TTY")
103112   PORT_DIPSETTING( 0x08, "Keyboard")
104113INPUT_PORTS_END
105114
106static gfx_layout aim65_charlayout =
107{
108        32,2,
109        256,                                    /* 256 characters */
110        1,                      /* 1 bits per pixel */
111        { 0,0 },                  /* no bitplanes; 1 bit per pixel */
112        /* x offsets */
113        {
114         7, 7, 7, 7,
115         6, 6, 6, 6,
116         5, 5, 5, 5,
117         4, 4, 4, 4,
118         3, 3, 3, 3,
119         2, 2, 2, 2,
120         1, 1, 1, 1,
121         0, 0, 0, 0
122        },
123        /* y offsets */
124        { 0, 0 },
125        1*8
126};
127115
128static gfx_decode aim65_gfxdecodeinfo[] = {
129   { REGION_GFX1, 0x0000, &aim65_charlayout,                     0, 2 },
130    { -1 } /* end of array */
131};
132
133static unsigned short aim65_colortable[1][2] = {
134   { 0, 1 },
135};
136
137
138116static MACHINE_DRIVER_START( aim65 )
139117   /* basic machine hardware */
140118   MDRV_CPU_ADD(M6502, 1000000)
141119   MDRV_CPU_PROGRAM_MAP(aim65_mem, 0)
120
121   MDRV_DEFAULT_LAYOUT(layout_aim65)
122
123   /* dummy values */
142124   MDRV_SCREEN_REFRESH_RATE(60)
143125   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
144   MDRV_INTERLEAVE(1)
145126
146    /* video hardware */
147   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
148   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
149   MDRV_SCREEN_SIZE(800, 600)
150   MDRV_SCREEN_VISIBLE_AREA(0, 800-1, 0, 600-1)
151   MDRV_GFXDECODE( aim65_gfxdecodeinfo )
152   MDRV_PALETTE_LENGTH(242 + 32768)
153   MDRV_COLORTABLE_LENGTH(sizeof (aim65_colortable) / sizeof(aim65_colortable[0][0]))
154   MDRV_PALETTE_INIT( aim65 )
155
156127   MDRV_VIDEO_START( aim65 )
157   MDRV_VIDEO_UPDATE( aim65 )
158128MACHINE_DRIVER_END
159129
160130
r763r764
165135   ROM_LOAD_OPTIONAL ("aim65ass.z24", 0xd000, 0x1000, CRC(0878b399) SHA1(483e92b57d64be51643a9f6490521a8572aa2f68) )
166136   ROM_LOAD ("aim65mon.z23", 0xe000, 0x1000, CRC(90e44afe) SHA1(78e38601edf6bfc787b58750555a636b0cf74c5c))
167137   ROM_LOAD ("aim65mon.z22", 0xf000, 0x1000, CRC(d01914b0) SHA1(e5b5ddd4cd43cce073a718ee4ba5221f2bc84eaf))
168   ROM_REGION(0x100,REGION_GFX1, 0)
169138ROM_END
170139
140
171141SYSTEM_CONFIG_START(aim65)
142   CONFIG_RAM_DEFAULT (4 * 1024) /* 4KB RAM */
143   CONFIG_RAM         (3 * 1024) /* 3KB RAM */
144   CONFIG_RAM         (2 * 1024) /* 2KB RAM */
145   CONFIG_RAM         (1 * 1024) /* 1KB RAM */
172146SYSTEM_CONFIG_END
173147
148
174149/*    YEAR  NAME    PARENT  COMPAT  MACHINE INPUT   INIT    CONFIG  COMPANY     FULLNAME */
175COMP(197?,   aim65,   0,      0,      aim65,   aim65,   aim65,   aim65,   "Rockwell",   "AIM 65",0)
150COMP(1977,   aim65,   0,      0,      aim65,   aim65,   aim65,   aim65,   "Rockwell",   "AIM 65", 0)
docs/messnew.txt
r763r764
2323
2424- [AIM65] Added natural keyboard support.  [Dirk Best]
2525
26- [AIM65] Started to rewrite the driver. For now, the display emulation has
27  been completely rewritten and artwork has been added. Also, configurable
28  RAM sizes have been added and the system was converted to a screenless
29  system.  [Dirk Best]
30
2631- [COCO] Fixed PIA regression that prevented OS-9 level 1 from working.  (bug
2732  #1314) [Nate Woods]
2833
r763r764
7681
7782- Removed use of helper macros to declare input ports.  [Nate Woods]
7883
84- Generic emulation of the DL1416 "4-Digit 16-Segment Alphanumeric Intelligent
85  Display" device has been added. Currently supported is the DL1416T and
86  partially the DL1416B. This kind of display is used by the Rockwell AIM 65.
87    [Dirk Best]
7988
8089
90
81910.117
8292
8393New System Drivers Supported (in no particular order):
artwork/aim65.zip

Previous 15994 Revisions Next


© 1998-2018 The MESS Team