src/mess/video/aim65.c
| r763 | r764 | |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | |
| 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 |
| 5 | 5 | |
| 6 | 6 | ******************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | | #include "video/generic.h" |
| 10 | 9 | |
| 11 | 10 | #include "includes/aim65.h" |
| 11 | #include "machine/6522via.h" |
| 12 | 12 | |
| 13 | 13 | static int printer_x; |
| 14 | 14 | static int printer_y; |
| r763 | r764 | |
| 18 | 18 | |
| 19 | 19 | UINT16 *printerRAM; |
| 20 | 20 | |
| 21 | | typedef struct { |
| 22 | | int digit[4]; // 16 segment digit, decoded from 7 bit data! |
| 23 | | int cursor_on[4]; |
| 24 | | } DL1416A; |
| 21 | static mame_timer *print_timer; |
| 22 | static int printer_level; |
| 25 | 23 | |
| 26 | | static DL1416A dl1416a[5]= { { {0} } }; |
| 27 | 24 | |
| 28 | | void 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 | | } |
| 40 | 25 | |
| 41 | | // aim 65 users guide table 7.6 |
| 42 | | static 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 | ******************************************************************************/ |
| 76 | 29 | |
| 77 | | static 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) |
| 82 | 34 | |
| 83 | | PALETTE_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 |
| 87 | 38 | |
| 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 | |
| 88 | 46 | void aim65_printer_inc(void) |
| 89 | 47 | { |
| 90 | 48 | if (printer_dir) |
| r763 | r764 | |
| 123 | 81 | flag_a=flag_b=0; |
| 124 | 82 | } |
| 125 | 83 | |
| 126 | | void aim65_printer_data_a(UINT8 data) { |
| 127 | | /* if (flag_a == 0) { |
| 128 | | printerRAM[(printer_y * 20) + printer_x] |= data; |
| 129 | | flag_a = 1; |
| 130 | | }*/ |
| 84 | TIMER_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(); |
| 131 | 90 | } |
| 132 | 91 | |
| 133 | | void aim65_printer_data_b(UINT8 data) { |
| 134 | | /* data &= 0x03; |
| 135 | 92 | |
| 136 | | if (flag_b == 0) { |
| 137 | | printerRAM[(printer_y * 20) + printer_x ] |= (data << 8); |
| 138 | | flag_b = 1; |
| 139 | | }*/ |
| 140 | | } |
| 141 | | |
| 142 | | VIDEO_START( aim65 ) |
| 93 | WRITE8_HANDLER( aim65_printer_on ) |
| 143 | 94 | { |
| 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) |
| 154 | 96 | { |
| 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; |
| 159 | 101 | } |
| 160 | | #endif |
| 102 | else |
| 103 | mame_timer_reset(print_timer, time_never); |
| 104 | } |
| 161 | 105 | |
| 162 | | video_start_generic(machine); |
| 106 | |
| 107 | void aim65_printer_data_a(UINT8 data) { |
| 108 | /* if (flag_a == 0) { |
| 109 | printerRAM[(printer_y * 20) + printer_x] |= data; |
| 110 | flag_a = 1; |
| 111 | }*/ |
| 163 | 112 | } |
| 164 | 113 | |
| 165 | | static 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 | | }; |
| 114 | void aim65_printer_data_b(UINT8 data) { |
| 115 | /* data &= 0x03; |
| 189 | 116 | |
| 190 | | static 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 | |
| 123 | VIDEO_START( aim65 ) |
| 191 | 124 | { |
| 192 | | int i, xi, yi, mask, color; |
| 125 | print_timer = mame_timer_alloc(aim65_printer_timer); |
| 193 | 126 | |
| 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; |
| 202 | 136 | |
| 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; |
| 208 | 137 | |
| 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; |
| 216 | 139 | |
| 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 | */ |
| 224 | 142 | } |
| 225 | 143 | |
| 226 | | static 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}, |
| 239 | 144 | |
| 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 | | |
| 253 | 145 | VIDEO_UPDATE( aim65 ) |
| 254 | 146 | { |
| 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 | | |
| 273 | 147 | /* 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 | } |
| 285 | 159 | |
| 286 | 160 | |
| 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 | } |
| 294 | 168 | |
| 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 | } */ |
| 300 | 174 | |
| 301 | 175 | return 0; |
| 302 | 176 | } |
src/mess/video/dl1416.c
| r0 | r764 | |
| 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 */
|
| 54 | typedef struct _dl1416_state dl1416_state;
|
| 55 | |
| 56 | struct _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 */
|
| 88 | static 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 | |
| 124 | static dl1416_state dl1416[MAX_DL1416];
|
| 125 | |
| 126 | |
| 127 | |
| 128 | /*****************************************************************************
|
| 129 | Implementation
|
| 130 | *****************************************************************************/
|
| 131 | |
| 132 | /* Config */
|
| 133 | void 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 */
|
| 143 | void 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 */
|
| 161 | void 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 */
|
| 169 | void 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 */
|
| 177 | void 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 */
|
| 185 | void 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 */
|
| 259 | WRITE8_HANDLER( dl1416_0_w ) { dl1416_write(0, offset, data); }
|
| 260 | WRITE8_HANDLER( dl1416_1_w ) { dl1416_write(1, offset, data); }
|
| 261 | WRITE8_HANDLER( dl1416_2_w ) { dl1416_write(2, offset, data); }
|
| 262 | WRITE8_HANDLER( dl1416_3_w ) { dl1416_write(3, offset, data); }
|
| 263 | WRITE8_HANDLER( dl1416_4_w ) { dl1416_write(4, offset, data); }
|
src/mess/layout/aim65.lay
| r0 | r764 | |
| 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
| r763 | r764 | |
| 13 | 13 | #include "machine/6522via.h" |
| 14 | 14 | #include "machine/6532riot.h" |
| 15 | 15 | |
| 16 | /* DL1416A display chip */ |
| 17 | #include "video/dl1416.h" |
| 18 | |
| 16 | 19 | /* M6502 main CPU */ |
| 17 | 20 | #include "cpu/m6502/m6502.h" |
| 18 | 21 | |
| 19 | 22 | |
| 20 | 23 | |
| 21 | 24 | /****************************************************************************** |
| 25 | Function Prototypes |
| 26 | ******************************************************************************/ |
| 27 | |
| 28 | void aim65_update_ds1(int digit, int data); |
| 29 | void aim65_update_ds2(int digit, int data); |
| 30 | void aim65_update_ds3(int digit, int data); |
| 31 | void aim65_update_ds4(int digit, int data); |
| 32 | void aim65_update_ds5(int digit, int data); |
| 33 | |
| 34 | |
| 35 | |
| 36 | /****************************************************************************** |
| 22 | 37 | Global variables |
| 23 | 38 | ******************************************************************************/ |
| 24 | 39 | |
| r763 | r764 | |
| 26 | 41 | static UINT8 pia_a, pia_b; |
| 27 | 42 | static UINT8 riot_port_a; |
| 28 | 43 | |
| 29 | | static mame_timer *print_timer; |
| 30 | | static int printer_level; |
| 44 | /* Display driver interfaces */ |
| 45 | static const dl1416_interface dl1416_ds1 = { DL1416T, aim65_update_ds1 }; |
| 46 | static const dl1416_interface dl1416_ds2 = { DL1416T, aim65_update_ds2 }; |
| 47 | static const dl1416_interface dl1416_ds3 = { DL1416T, aim65_update_ds3 }; |
| 48 | static const dl1416_interface dl1416_ds4 = { DL1416T, aim65_update_ds4 }; |
| 49 | static const dl1416_interface dl1416_ds5 = { DL1416T, aim65_update_ds5 }; |
| 31 | 50 | |
| 32 | 51 | |
| 33 | 52 | |
| r763 | r764 | |
| 41 | 60 | cpunum_set_input_line(0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); |
| 42 | 61 | } |
| 43 | 62 | |
| 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 | */ |
| 44 | 73 | |
| 45 | 74 | |
| 75 | |
| 46 | 76 | /****************************************************************************** |
| 47 | 77 | 6821 PIA |
| 48 | 78 | ******************************************************************************/ |
| 49 | 79 | |
| 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 | */ |
| 50 | 91 | |
| 51 | 92 | static void aim65_pia(void) |
| 52 | 93 | { |
| 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); |
| 59 | 102 | } |
| 60 | 103 | } |
| 61 | 104 | |
| r763 | r764 | |
| 76 | 119 | |
| 77 | 120 | static const pia6821_interface pia = |
| 78 | 121 | { |
| 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, |
| 85 | 128 | aim65_pia_a_w, |
| 86 | 129 | 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), |
| 91 | 134 | }; |
| 92 | 135 | |
| 93 | 136 | |
| 137 | void aim65_update_ds1(int digit, int data) { output_set_digit_value( 0 + (digit ^ 3), data); } |
| 138 | void aim65_update_ds2(int digit, int data) { output_set_digit_value( 4 + (digit ^ 3), data); } |
| 139 | void aim65_update_ds3(int digit, int data) { output_set_digit_value( 8 + (digit ^ 3), data); } |
| 140 | void aim65_update_ds4(int digit, int data) { output_set_digit_value(12 + (digit ^ 3), data); } |
| 141 | void aim65_update_ds5(int digit, int data) { output_set_digit_value(16 + (digit ^ 3), data); } |
| 94 | 142 | |
| 143 | |
| 144 | |
| 95 | 145 | /****************************************************************************** |
| 96 | 146 | 6532 RIOT |
| 97 | 147 | ******************************************************************************/ |
| r763 | r764 | |
| 208 | 258 | |
| 209 | 259 | |
| 210 | 260 | /****************************************************************************** |
| 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 | | |
| 230 | | static 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 | | |
| 239 | | static 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 | | /****************************************************************************** |
| 255 | 261 | 6522 VIA |
| 256 | 262 | ******************************************************************************/ |
| 257 | 263 | |
| r763 | r764 | |
| 291 | 297 | aim65_via_irq_func // void (*irq_func)(int state); |
| 292 | 298 | }; |
| 293 | 299 | |
| 300 | static const struct via6522_interface user_via = |
| 301 | { |
| 302 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL |
| 303 | }; |
| 294 | 304 | |
| 295 | 305 | |
| 306 | |
| 296 | 307 | /****************************************************************************** |
| 297 | 308 | Driver init |
| 298 | 309 | ******************************************************************************/ |
| r763 | r764 | |
| 300 | 311 | |
| 301 | 312 | DRIVER_INIT( aim65 ) |
| 302 | 313 | { |
| 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 | |
| 303 | 337 | pia_config(0, &pia); |
| 338 | |
| 304 | 339 | r6532_config(0, &r6532_interface); |
| 305 | 340 | r6532_set_clock(0, 1000000); |
| 306 | 341 | r6532_reset(0); |
| 307 | | via_config(0,&via0); |
| 308 | | via_reset(); |
| 342 | |
| 343 | via_config(0, &via0); |
| 309 | 344 | via_0_cb1_w(1, 1); |
| 310 | 345 | via_0_ca1_w(1, 0); |
| 311 | 346 | |
| 312 | | print_timer = mame_timer_alloc(aim65_printer_timer); |
| 347 | via_config(1, &user_via); |
| 348 | via_reset(); |
| 349 | } |
| 313 | 350 | |
| 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/drivers/aim65.c
| r763 | r764 | |
| 21 | 21 | /* for natural keyboard support */ |
| 22 | 22 | #include "inputx.h" |
| 23 | 23 | |
| 24 | | static 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 */ |
| 30 | static 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 */ |
| 35 | 43 | ADDRESS_MAP_END |
| 36 | 44 | |
| 45 | |
| 37 | 46 | INPUT_PORTS_START( aim65 ) |
| 38 | 47 | PORT_START |
| 39 | 48 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| r763 | r764 | |
| 96 | 105 | PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 97 | 106 | PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 98 | 107 | PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 99 | | |
| 108 | |
| 100 | 109 | PORT_START |
| 101 | 110 | PORT_DIPNAME(0x08, 0x08, "Terminal") |
| 102 | 111 | PORT_DIPSETTING( 0x00, "TTY") |
| 103 | 112 | PORT_DIPSETTING( 0x08, "Keyboard") |
| 104 | 113 | INPUT_PORTS_END |
| 105 | 114 | |
| 106 | | static 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 | | }; |
| 127 | 115 | |
| 128 | | static gfx_decode aim65_gfxdecodeinfo[] = { |
| 129 | | { REGION_GFX1, 0x0000, &aim65_charlayout, 0, 2 }, |
| 130 | | { -1 } /* end of array */ |
| 131 | | }; |
| 132 | | |
| 133 | | static unsigned short aim65_colortable[1][2] = { |
| 134 | | { 0, 1 }, |
| 135 | | }; |
| 136 | | |
| 137 | | |
| 138 | 116 | static MACHINE_DRIVER_START( aim65 ) |
| 139 | 117 | /* basic machine hardware */ |
| 140 | 118 | MDRV_CPU_ADD(M6502, 1000000) |
| 141 | 119 | MDRV_CPU_PROGRAM_MAP(aim65_mem, 0) |
| 120 | |
| 121 | MDRV_DEFAULT_LAYOUT(layout_aim65) |
| 122 | |
| 123 | /* dummy values */ |
| 142 | 124 | MDRV_SCREEN_REFRESH_RATE(60) |
| 143 | 125 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION) |
| 144 | | MDRV_INTERLEAVE(1) |
| 145 | 126 | |
| 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 | | |
| 156 | 127 | MDRV_VIDEO_START( aim65 ) |
| 157 | | MDRV_VIDEO_UPDATE( aim65 ) |
| 158 | 128 | MACHINE_DRIVER_END |
| 159 | 129 | |
| 160 | 130 | |
| r763 | r764 | |
| 165 | 135 | ROM_LOAD_OPTIONAL ("aim65ass.z24", 0xd000, 0x1000, CRC(0878b399) SHA1(483e92b57d64be51643a9f6490521a8572aa2f68) ) |
| 166 | 136 | ROM_LOAD ("aim65mon.z23", 0xe000, 0x1000, CRC(90e44afe) SHA1(78e38601edf6bfc787b58750555a636b0cf74c5c)) |
| 167 | 137 | ROM_LOAD ("aim65mon.z22", 0xf000, 0x1000, CRC(d01914b0) SHA1(e5b5ddd4cd43cce073a718ee4ba5221f2bc84eaf)) |
| 168 | | ROM_REGION(0x100,REGION_GFX1, 0) |
| 169 | 138 | ROM_END |
| 170 | 139 | |
| 140 | |
| 171 | 141 | SYSTEM_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 */ |
| 172 | 146 | SYSTEM_CONFIG_END |
| 173 | 147 | |
| 148 | |
| 174 | 149 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 175 | | COMP(197?, aim65, 0, 0, aim65, aim65, aim65, aim65, "Rockwell", "AIM 65",0) |
| 150 | COMP(1977, aim65, 0, 0, aim65, aim65, aim65, aim65, "Rockwell", "AIM 65", 0) |