src/mess/video/ssystem3.c
| r2141 | r2142 | |
| 5 | 5 | #include "driver.h" |
| 6 | 6 | #include "includes/ssystem3.h" |
| 7 | 7 | |
| 8 | | UINT8 ssystem3_led[5]= {0}; |
| 8 | static struct { |
| 9 | UINT8 data[5]; |
| 10 | int clock; |
| 11 | int count; |
| 12 | } ssystem3_lcd; |
| 9 | 13 | |
| 14 | void ssystem3_lcd_reset(void) |
| 15 | { |
| 16 | ssystem3_lcd.count=0; ssystem3_lcd.clock=1; |
| 17 | } |
| 18 | |
| 19 | void ssystem3_lcd_write(int clock, int data) |
| 20 | { |
| 21 | if (clock&&!ssystem3_lcd.clock) { |
| 22 | ssystem3_lcd.data[ssystem3_lcd.count/8]&=~(1<<(ssystem3_lcd.count&7)); |
| 23 | if (data) ssystem3_lcd.data[ssystem3_lcd.count/8]|=1<<(ssystem3_lcd.count&7); |
| 24 | if (ssystem3_lcd.count+1==40) { |
| 25 | logerror("%.4x lcd %02x%02x%02x%02x%02x\n",(int)activecpu_get_pc(), |
| 26 | ssystem3_lcd.data[0], ssystem3_lcd.data[1], ssystem3_lcd.data[2], ssystem3_lcd.data[3], ssystem3_lcd.data[4]); |
| 27 | } |
| 28 | ssystem3_lcd.count=(ssystem3_lcd.count+1)%40; |
| 29 | } |
| 30 | ssystem3_lcd.clock=clock; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | |
| 10 | 35 | static const unsigned char ssystem3_palette[] = |
| 11 | 36 | { |
| 12 | 37 | 0,12,12, |
| r2141 | r2142 | |
| 45 | 70 | " ffff bbbb\r" |
| 46 | 71 | " ffff bbbb\r" |
| 47 | 72 | " fff bbb\r" |
| 48 | | " f gggggggg b\r" |
| 49 | | " gggggggggggg\r" |
| 73 | " f gggggggg b\r" |
| 74 | " gggggggggggg\r" |
| 50 | 75 | " gggggggggggg\r" |
| 51 | 76 | " e gggggggg c\r" |
| 52 | 77 | " eee ccc\r" |
| r2141 | r2142 | |
| 58 | 83 | "eeee cccc\r" |
| 59 | 84 | "eee dddddd ccc\r" |
| 60 | 85 | "ee dddddddd cc\r" |
| 61 | | "e dddddddddd c\r" |
| 62 | | " dddddddddddd" |
| 86 | "e dddddddddd c\r" |
| 87 | " dddddddddddd" |
| 63 | 88 | }; |
| 64 | 89 | |
| 65 | 90 | static void ssystem3_draw_7segment(running_machine *machine, bitmap_t *bitmap,int value, int x, int y) |
| r2141 | r2142 | |
| 69 | 94 | for (i=0, xi=0, yi=0; led[i]; i++) { |
| 70 | 95 | mask=0; |
| 71 | 96 | switch (led[i]) { |
| 72 | | case 'a': mask=1; break; |
| 73 | | case 'b': mask=2; break; |
| 74 | | case 'c': mask=4; break; |
| 75 | | case 'd': mask=8; break; |
| 76 | | case 'e': mask=0x10; break; |
| 77 | | case 'f': mask=0x20; break; |
| 78 | | case 'g': mask=0x40; break; |
| 97 | case 'a': mask=0x80; break; |
| 98 | case 'b': mask=0x40; break; |
| 99 | case 'c': mask=0x20; break; |
| 100 | case 'd': mask=0x10; break; |
| 101 | case 'e': mask=8; break; |
| 102 | case 'f': mask=4; break; |
| 103 | case 'g': mask=2; break; |
| 79 | 104 | case 'h': |
| 80 | 105 | // this is more likely wired to the separate leds |
| 81 | | mask=0x80; |
| 106 | mask=1; |
| 82 | 107 | break; |
| 83 | 108 | } |
| 84 | 109 | |
| r2141 | r2142 | |
| 98 | 123 | {170,123}, |
| 99 | 124 | {200,123}, |
| 100 | 125 | {220,123}, |
| 101 | | {125,123}, |
| 126 | {125,123} |
| 102 | 127 | }; |
| 103 | 128 | |
| 104 | 129 | static const char single_led[]= |
| r2141 | r2142 | |
| 108 | 133 | " bb bb bb bb 1 1\r" |
| 109 | 134 | " bb bbbbbbbbbbb bb 111 111\r" |
| 110 | 135 | " 1 1\r" |
| 111 | | " aa 9999999 dd 1 1\r" |
| 112 | | " aa dd 1 1\r" |
| 113 | | " 88888888888 d 1 1\r" |
| 114 | | " 88 8 dddd\r" |
| 115 | | " 8888 6666666 8 dddd\r" |
| 136 | " 99 9999999 99 1 1\r" |
| 137 | " 99 99 1 1\r" |
| 138 | " 88888888888 9 1 1\r" |
| 139 | " 88 8 9999\r" |
| 140 | " 8888 6666666 8 9999\r" |
| 116 | 141 | " 8888 6 6\r" |
| 117 | 142 | " 6 777 6\r" |
| 118 | 143 | " 6 777 6\r" |
| 119 | 144 | " 6 777 6\r" |
| 120 | 145 | " 6 777 6\r" |
| 121 | 146 | " 6 77777 6\r" |
| 122 | | " 6 77777 6 2 3 4\r" |
| 123 | | " 6 7777777 6 2 3 4\r" |
| 124 | | " 6 7777777 6 2 3 4\r" |
| 125 | | " 6 777777777 6 2 3 44444\r" |
| 126 | | " 6 777777777 6 2 3 4\r" |
| 127 | | " 6 77777777777 6 2 3 44444\r" |
| 128 | | " 6 7 6 2 3 4\r" |
| 129 | | " 6666666 7 6666666 2 3 4\r" |
| 130 | | " 7 2 3 4\r" |
| 147 | " 6 77777 6 2 2 4\r" |
| 148 | " 6 7777777 6 2 2 4\r" |
| 149 | " 6 7777777 6 2 2 4\r" |
| 150 | " 6 777777777 6 2 2 44444\r" |
| 151 | " 6 777777777 6 2 2 4\r" |
| 152 | " 6 77777777777 6 2 2 33433\r" |
| 153 | " 6 7 6 2 2 4\r" |
| 154 | " 6666666 7 6666666 2 2 4\r" |
| 155 | " 7 2 2 4\r" |
| 131 | 156 | " 77777777777777777\r" |
| 132 | 157 | "\r" |
| 133 | 158 | "\r" |
| r2141 | r2142 | |
| 168 | 193 | int i; |
| 169 | 194 | |
| 170 | 195 | for (i=0; i<4; i++) { |
| 171 | | ssystem3_draw_7segment(screen->machine, bitmap, ssystem3_led[i]&0x7f, ssystem3_led_pos[i].x, |
| 172 | | ssystem3_led_pos[i].y); |
| 196 | ssystem3_draw_7segment(screen->machine, bitmap, ssystem3_lcd.data[1+i], ssystem3_led_pos[i].x, ssystem3_led_pos[i].y); |
| 173 | 197 | } |
| 174 | 198 | |
| 175 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 176 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); |
| 177 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 178 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); |
| 179 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 180 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2'); |
| 181 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 182 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3'); |
| 183 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 184 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4'); |
| 185 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 186 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5'); |
| 187 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_led[4]&8?1:0], |
| 188 | | ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6'); |
| 199 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); //? |
| 200 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&2?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5'); |
| 201 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&4?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '7'); |
| 202 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&8?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'b'); |
| 203 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x10?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '9'); |
| 204 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x20?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '8'); |
| 205 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x40?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'c'); |
| 206 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x80?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6'); |
| 207 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[1]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2'); |
| 208 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[2]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); //? |
| 209 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[3]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3'); |
| 210 | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[4]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4'); |
| 211 | |
| 212 | if (readinputportbytag("Configuration")&1) { // playfield(optional device) |
| 213 | const int lcd_signs_on[]={ |
| 214 | 0, // empty |
| 215 | 1, // bauer |
| 216 | 3, // springer |
| 217 | 0x11, // läufer |
| 218 | 7, // turm |
| 219 | 0x1f, // dame |
| 220 | 0x17, // könig |
| 221 | 0 |
| 222 | }; |
| 223 | int y, x; |
| 224 | for (y=0; y<8; y++) { |
| 225 | for (x=0; x<8; x++) { |
| 226 | int figure, black; |
| 227 | int xp=263+x*22; |
| 228 | int yp=55+(y^7)*28; |
| 229 | ssystem3_playfield_getfigure(x, y, &figure, &black); |
| 230 | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&1?1:0], xp, yp, '6'); |
| 231 | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&2?1:0], xp, yp, '8'); |
| 232 | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&4?1:0], xp, yp, '9'); |
| 233 | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&8?1:0], xp, yp, 'b'); |
| 234 | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&0x10?1:0], xp, yp, 'c'); |
| 235 | ssystem3_draw_led(bitmap, screen->machine->pens[figure!=0 && black?1:0], xp, yp, '7'); |
| 236 | |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 189 | 241 | return 0; |
| 190 | 242 | } |
src/mess/drivers/ssystem3.c
| r2141 | r2142 | |
| 4 | 4 | |
| 5 | 5 | Driver file to handle emulation of the Chess Champion Super System III / Chess |
| 6 | 6 | Champion MK III |
| 7 | | by PeT mess@utanet.at November 2000 |
| 7 | by PeT mess@utanet.at November 2000, march 2008 |
| 8 | 8 | |
| 9 | 9 | Hardware descriptions: |
| 10 | 10 | - A 6502 CPU |
| r2141 | r2142 | |
| 19 | 19 | optional board display (special serial connection) |
| 20 | 20 | internal expansion/cartridge port |
| 21 | 21 | (special power saving pack) |
| 22 | |
| 23 | |
| 24 | todo: |
| 25 | not sure about lcd signs and their assignments |
| 26 | not sure about all buttons and switches |
| 27 | playfield displayment currently based on simulation and on screen |
| 28 | not check for audio yet |
| 29 | convert to new artwork system |
| 30 | |
| 31 | needed: |
| 32 | artwork for board display |
| 33 | backup of playfield rom and picture/description of its board |
| 22 | 34 | */ |
| 23 | 35 | |
| 24 | 36 | #include "driver.h" |
| r2141 | r2142 | |
| 26 | 38 | #include "includes/ssystem3.h" |
| 27 | 39 | #include "machine/6522via.h" |
| 28 | 40 | #include "cpu/m6502/m6502.h" |
| 41 | //#include "attotime.h" |
| 29 | 42 | |
| 43 | struct { |
| 44 | UINT8 porta; |
| 45 | } ssystem3; |
| 30 | 46 | |
| 31 | 47 | |
| 48 | // in my opinion own cpu to display lcd field and to handle own buttons |
| 49 | static struct { |
| 50 | int signal; |
| 51 | // int on; |
| 52 | |
| 53 | int count, bit, started; |
| 54 | UINT8 data; |
| 55 | attotime time, high_time, low_time; |
| 56 | union { |
| 57 | struct { |
| 58 | UINT8 header[7]; |
| 59 | UINT8 field[8][8/2]; |
| 60 | UINT8 unknown[5]; |
| 61 | } s; |
| 62 | UINT8 data[7+8*8/2+5]; |
| 63 | } u; |
| 64 | } playfield; |
| 65 | |
| 66 | void ssystem3_playfield_getfigure(int x, int y, int *figure, int *black) |
| 67 | { |
| 68 | int d; |
| 69 | if (x&1) |
| 70 | d=playfield.u.s.field[y][x/2]&0xf; |
| 71 | else |
| 72 | d=playfield.u.s.field[y][x/2]>>4; |
| 73 | |
| 74 | *figure=d&7; |
| 75 | *black=d&8; |
| 76 | } |
| 77 | |
| 78 | static void ssystem3_playfield_reset(void) |
| 79 | { |
| 80 | memset(&playfield, 0, sizeof(playfield)); |
| 81 | playfield.signal=FALSE; |
| 82 | // playfield.on=TRUE; //readinputportbytag("Configuration")&1; |
| 83 | } |
| 84 | |
| 85 | static void ssystem3_playfield_write(int reset, int signal) |
| 86 | { |
| 87 | int d=FALSE; |
| 88 | |
| 89 | if (!reset) { |
| 90 | playfield.count=0; |
| 91 | playfield.bit=0; |
| 92 | playfield.started=FALSE; |
| 93 | playfield.signal=signal; |
| 94 | playfield.time=timer_get_time(); |
| 95 | } |
| 96 | if (!signal && playfield.signal) { |
| 97 | attotime t=timer_get_time(); |
| 98 | playfield.high_time=attotime_sub(t, playfield.time); |
| 99 | playfield.time=t; |
| 100 | |
| 101 | // logerror("%.4x playfield %d lowtime %s hightime %s\n",(int)activecpu_get_pc(), playfield.count, |
| 102 | // attotime_string(playfield.low_time, 7), attotime_string(playfield.high_time,7) ); |
| 103 | |
| 104 | if (playfield.started) { |
| 105 | // 0 twice as long low |
| 106 | // 1 twice as long high |
| 107 | if (attotime_compare(playfield.low_time,playfield.high_time)>0) d=TRUE; |
| 108 | |
| 109 | playfield.data&=~(1<<(playfield.bit^7)); |
| 110 | if (d) playfield.data|=1<<(playfield.bit^7); |
| 111 | playfield.bit++; |
| 112 | if (playfield.bit==8) { |
| 113 | logerror("%.4x playfield wrote %d %02x\n",(int)activecpu_get_pc(), playfield.count, playfield.data); |
| 114 | playfield.u.data[playfield.count]=playfield.data; |
| 115 | playfield.bit=0; |
| 116 | playfield.count=(playfield.count+1)%ARRAY_LENGTH(playfield.u.data); |
| 117 | if (playfield.count==0) playfield.started=FALSE; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | } else if (signal && !playfield.signal) { |
| 122 | attotime t=timer_get_time(); |
| 123 | playfield.low_time=attotime_sub(t, playfield.time); |
| 124 | playfield.time=t; |
| 125 | playfield.started=TRUE; |
| 126 | } |
| 127 | playfield.signal=signal; |
| 128 | } |
| 129 | |
| 130 | static void ssystem3_playfield_read(int *on, int *ready) |
| 131 | { |
| 132 | *on=!(readinputportbytag("Configuration")&1); |
| 133 | // *on=!playfield.on; |
| 134 | *ready=FALSE; |
| 135 | } |
| 136 | |
| 137 | void ssystem3_via_write_a(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) |
| 138 | { |
| 139 | ssystem3.porta=data; |
| 140 | // logerror("%.4x via port a write %02x\n",(int)activecpu_get_pc(), data); |
| 141 | } |
| 142 | |
| 143 | UINT8 ssystem3_via_read_a(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset) |
| 144 | { |
| 145 | UINT8 data=0xff; |
| 146 | #if 1 // time switch |
| 147 | if (!(ssystem3.porta&0x10)) data&=readinputport(1)|0xf1; |
| 148 | if (!(ssystem3.porta&0x20)) data&=readinputport(2)|0xf1; |
| 149 | if (!(ssystem3.porta&0x40)) data&=readinputport(3)|0xf1; |
| 150 | if (!(ssystem3.porta&0x80)) data&=readinputport(4)|0xf1; |
| 151 | #else |
| 152 | if (!(ssystem3.porta&0x10)) data&=readinputport(1)|0xf0; |
| 153 | if (!(ssystem3.porta&0x20)) data&=readinputport(2)|0xf0; |
| 154 | if (!(ssystem3.porta&0x40)) data&=readinputport(3)|0xf0; |
| 155 | if (!(ssystem3.porta&0x80)) data&=readinputport(4)|0xf0; |
| 156 | #endif |
| 157 | if (!(ssystem3.porta&1)) { |
| 158 | if (!(readinputport(1)&1)) data&=~0x10; |
| 159 | if (!(readinputport(2)&1)) data&=~0x20; |
| 160 | if (!(readinputport(3)&1)) data&=~0x40; |
| 161 | if (!(readinputport(4)&1)) data&=~0x80; |
| 162 | } |
| 163 | if (!(ssystem3.porta&2)) { |
| 164 | if (!(readinputport(1)&2)) data&=~0x10; |
| 165 | if (!(readinputport(2)&2)) data&=~0x20; |
| 166 | if (!(readinputport(3)&2)) data&=~0x40; |
| 167 | if (!(readinputport(4)&2)) data&=~0x80; |
| 168 | } |
| 169 | if (!(ssystem3.porta&4)) { |
| 170 | if (!(readinputport(1)&4)) data&=~0x10; |
| 171 | if (!(readinputport(2)&4)) data&=~0x20; |
| 172 | if (!(readinputport(3)&4)) data&=~0x40; |
| 173 | if (!(readinputport(4)&4)) data&=~0x80; |
| 174 | } |
| 175 | if (!(ssystem3.porta&8)) { |
| 176 | if (!(readinputport(1)&8)) data&=~0x10; |
| 177 | if (!(readinputport(2)&8)) data&=~0x20; |
| 178 | if (!(readinputport(3)&8)) data&=~0x40; |
| 179 | if (!(readinputport(4)&8)) data&=~0x80; |
| 180 | } |
| 181 | // logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data); |
| 182 | return data; |
| 183 | } |
| 184 | |
| 185 | |
| 32 | 186 | /* |
| 33 | 187 | port b |
| 34 | | bit 0: ?? |
| 188 | bit 0: output opt device reset? |
| 35 | 189 | |
| 36 | | hi speed serial 1 |
| 190 | hi speed serial 1 (d7d7 transfers 40 bit $2e) |
| 37 | 191 | bit 1: output data |
| 38 | 192 | bit 2: output clock (hi data is taken) |
| 39 | 193 | |
| 194 | bit 3: output opt data read |
| 195 | bit 4: input low opt data available |
| 196 | bit 5: input low opt device available |
| 197 | |
| 198 | |
| 40 | 199 | bit 6: input clocks!? |
| 41 | 200 | |
| 201 | port a: |
| 202 | bit 7: input low x/$37 2 |
| 203 | bit 6: input low x/$37 3 |
| 204 | bit 5: input low x/$37 4 (else 1) |
| 205 | |
| 42 | 206 | */ |
| 207 | UINT8 ssystem3_via_read_b(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset) |
| 208 | { |
| 209 | UINT8 data=0xff; |
| 210 | int on, ready; |
| 211 | ssystem3_playfield_read(&on, &ready); |
| 212 | if (!on) data&=~0x20; |
| 213 | if (!ready) data&=~0x10; |
| 214 | return data; |
| 215 | } |
| 43 | 216 | |
| 217 | void ssystem3_via_write_b(ATTR_UNUSED running_machine *machine, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) |
| 218 | { |
| 219 | UINT8 d; |
| 220 | ssystem3_playfield_write(data&1, data&8); |
| 221 | ssystem3_lcd_write(data&4, data&2); |
| 222 | |
| 223 | d=ssystem3_via_read_b(machine, 0)&~0x40; |
| 224 | if (data&0x80) d|=0x40; |
| 225 | // d&=~0x8f; |
| 226 | via_set_input_b( 0, d ); |
| 227 | |
| 228 | } |
| 229 | |
| 44 | 230 | static const struct via6522_interface config= |
| 45 | 231 | { |
| 46 | | 0,//read8_machine_func in_a_func; |
| 47 | | 0,//read8_machine_func in_b_func; |
| 232 | ssystem3_via_read_a,//read8_machine_func in_a_func; |
| 233 | ssystem3_via_read_b,//read8_machine_func in_b_func; |
| 48 | 234 | 0,//read8_machine_func in_ca1_func; |
| 49 | 235 | 0,//read8_machine_func in_cb1_func; |
| 50 | 236 | 0,//read8_machine_func in_ca2_func; |
| 51 | 237 | 0,//read8_machine_func in_cb2_func; |
| 52 | | 0,//write8_machine_func out_a_func; |
| 53 | | 0,//write8_machine_func out_b_func; |
| 238 | ssystem3_via_write_a,//write8_machine_func out_a_func; |
| 239 | ssystem3_via_write_b,//write8_machine_func out_b_func; |
| 54 | 240 | 0,//write8_machine_func out_ca2_func; |
| 55 | 241 | 0,//write8_machine_func out_cb2_func; |
| 56 | 242 | 0,//void (*irq_func)(int state); |
| r2141 | r2142 | |
| 59 | 245 | static DRIVER_INIT( ssystem3 ) |
| 60 | 246 | { |
| 61 | 247 | via_config(0,&config); |
| 248 | ssystem3_playfield_reset(); |
| 249 | ssystem3_lcd_reset(); |
| 62 | 250 | } |
| 63 | 251 | |
| 64 | | static TIMER_CALLBACK( ssystem3_pb6_toggle ) { |
| 65 | | static int toggle = 0; |
| 66 | | via_set_input_b( 0, toggle ? 0x40 : 0 ); |
| 67 | | toggle ^= 1; |
| 68 | | } |
| 69 | | |
| 70 | 252 | static MACHINE_RESET( ssystem3 ) |
| 71 | 253 | { |
| 72 | | via_reset(); |
| 73 | | timer_pulse( ATTOTIME_IN_HZ(4000000), NULL, 0, ssystem3_pb6_toggle ); |
| 254 | via_reset(); |
| 74 | 255 | } |
| 75 | 256 | |
| 76 | 257 | static ADDRESS_MAP_START( ssystem3_map , ADDRESS_SPACE_PROGRAM, 8) |
| 77 | 258 | AM_RANGE( 0x0000, 0x03ff) AM_RAM |
| 78 | | // AM_RANGE( 0x4000, 0x40ff) AM_NOP /* lcd chip!? */ |
| 259 | /* |
| 260 | 67-de playfield ($40 means white, $80 black) |
| 261 | */ |
| 262 | // AM_RANGE( 0x4000, 0x40ff) AM_NOP |
| 263 | /* |
| 264 | probably zusatzgerät memory (battery powered ram 256x4? at 0x4000) |
| 265 | $40ff low nibble ram if playfield module (else init with normal playfield) |
| 266 | */ |
| 79 | 267 | AM_RANGE( 0x6000, 0x600f) AM_READWRITE( via_0_r, via_0_w ) |
| 268 | #if 1 |
| 269 | AM_RANGE( 0xc000, 0xdfff) AM_ROM |
| 270 | AM_RANGE( 0xf000, 0xffff) AM_ROM |
| 271 | #else |
| 80 | 272 | AM_RANGE( 0xc000, 0xffff) AM_ROM |
| 273 | #endif |
| 81 | 274 | ADDRESS_MAP_END |
| 82 | 275 | |
| 83 | 276 | static INPUT_PORTS_START( ssystem3 ) |
| 84 | | PORT_START |
| 85 | | PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NEW GAME") PORT_CODE(KEYCODE_F3) // seams to be direct wired to reset |
| 86 | | PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_F1) |
| 87 | | PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) |
| 88 | | PORT_START |
| 89 | | PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black A Black") PORT_CODE(KEYCODE_A) |
| 90 | | PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black B Field") PORT_CODE(KEYCODE_B) |
| 91 | | PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black C Time?") PORT_CODE(KEYCODE_C) |
| 92 | | PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black D Time?") PORT_CODE(KEYCODE_D) |
| 93 | | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black E Time off?") PORT_CODE(KEYCODE_E) |
| 94 | | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black F LEVEL") PORT_CODE(KEYCODE_F) |
| 95 | | PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black G Swap") PORT_CODE(KEYCODE_G) |
| 96 | | PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Black H White") PORT_CODE(KEYCODE_H) |
| 97 | | PORT_START |
| 98 | | PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 1") PORT_CODE(KEYCODE_1) |
| 99 | | PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 2") PORT_CODE(KEYCODE_2) |
| 100 | | PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 3") PORT_CODE(KEYCODE_3) |
| 101 | | PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 4") PORT_CODE(KEYCODE_4) |
| 102 | | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 5") PORT_CODE(KEYCODE_5) |
| 103 | | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 6") PORT_CODE(KEYCODE_6) |
| 104 | | PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 7") PORT_CODE(KEYCODE_7) |
| 105 | | PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("White 8") PORT_CODE(KEYCODE_8) |
| 277 | /* |
| 278 | switches: light(hardware?) sound time power(hardware!) |
| 279 | |
| 280 | new game (hardware?) |
| 281 | */ |
| 282 | |
| 283 | |
| 284 | PORT_START_TAG( "Switches" ) |
| 285 | //PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NEW GAME") PORT_CODE(KEYCODE_F3) // seams to be direct wired to reset |
| 286 | // PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("?CLEAR") PORT_CODE(KEYCODE_F1) |
| 287 | // PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("?ENTER") PORT_CODE(KEYCODE_ENTER) |
| 288 | PORT_START_TAG( "matrix1" ) |
| 289 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?1") PORT_CODE(KEYCODE_1_PAD) |
| 290 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 C SQ EP") PORT_CODE(KEYCODE_9) |
| 291 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER?") PORT_CODE(KEYCODE_ENTER) |
| 292 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 C BOARD MD") PORT_CODE(KEYCODE_0) |
| 293 | PORT_START_TAG( "matrix2" ) |
| 294 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?2") PORT_CODE(KEYCODE_2_PAD) |
| 295 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 F springer zeitvorgabe") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_F) |
| 296 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 E laeufer ruecknahme") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_E) |
| 297 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CE interrupt") PORT_CODE(KEYCODE_BACKSPACE) |
| 298 | PORT_START_TAG( "matrix3" ) |
| 299 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?3") PORT_CODE(KEYCODE_3_PAD) |
| 300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 G bauer zugvorschlaege") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_G) |
| 301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 D turm #") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_D) |
| 302 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 A white") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_A) |
| 303 | PORT_START_TAG( "matrix4" ) |
| 304 | PORT_DIPNAME( 0x01, 0, "Time") PORT_CODE(KEYCODE_T) PORT_TOGGLE PORT_DIPSETTING( 0, DEF_STR(Off) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 305 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 H black") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_H) |
| 306 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 C dame #50") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_C) |
| 307 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 B koenig FP") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_B) |
| 308 | PORT_START_TAG( "Configuration" ) |
| 309 | PORT_DIPNAME( 0x0001, 0, "Schachbrett") PORT_TOGGLE |
| 310 | PORT_DIPSETTING( 0, DEF_STR( Off ) ) |
| 311 | PORT_DIPSETTING( 1, "angeschlossen" ) |
| 106 | 312 | #if 0 |
| 107 | | PORT_START |
| 108 | | PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 1") PORT_CODE(KEYCODE_1_PAD) |
| 109 | | PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 2") PORT_CODE(KEYCODE_2_PAD) |
| 110 | | PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 3") PORT_CODE(KEYCODE_3_PAD) |
| 111 | | PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 4") PORT_CODE(KEYCODE_4_PAD) |
| 112 | | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 5") PORT_CODE(KEYCODE_5_PAD) |
| 113 | | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 6") PORT_CODE(KEYCODE_6_PAD) |
| 114 | | PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 7") PORT_CODE(KEYCODE_7_PAD) |
| 115 | | PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test 8") PORT_CODE(KEYCODE_8_PAD) |
| 313 | PORT_DIPNAME( 0x0002, 0, "Memory") PORT_TOGGLE |
| 314 | PORT_DIPSETTING( 0, DEF_STR( Off ) ) |
| 315 | PORT_DIPSETTING( 2, "angeschlossen" ) |
| 316 | PORT_DIPNAME( 0x0004, 0, "Drucker") PORT_TOGGLE |
| 317 | PORT_DIPSETTING( 0, DEF_STR( Off ) ) |
| 318 | PORT_DIPSETTING( 4, "angeschlossen" ) |
| 116 | 319 | #endif |
| 117 | 320 | INPUT_PORTS_END |
| 118 | 321 | |
| r2141 | r2142 | |
| 150 | 353 | ROM_START(ssystem3) |
| 151 | 354 | ROM_REGION(0x10000,REGION_CPU1,0) |
| 152 | 355 | ROM_LOAD("ss3lrom", 0xc000, 0x1000, CRC(9ea46ed3) SHA1(34eef85b356efbea6ddac1d1705b104fc8e2731a) ) |
| 356 | // ROM_RELOAD(0xe000, 0x1000) |
| 153 | 357 | ROM_LOAD("ss3hrom", 0xf000, 0x1000, CRC(52741e0b) SHA1(2a7b950f9810c5a14a1b9d5e6b2bd93da621662e) ) |
| 154 | 358 | ROM_RELOAD(0xd000, 0x1000) |
| 155 | | /* 0xd450 reset,irq,nmi |
| 156 | | |
| 157 | | d7c7 outputs 2e..32 to serial port 1 |
| 158 | | */ |
| 159 | | |
| 160 | 359 | ROM_END |
| 161 | 360 | |
| 162 | 361 | /*************************************************************************** |
| r2141 | r2142 | |
| 166 | 365 | ***************************************************************************/ |
| 167 | 366 | |
| 168 | 367 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 169 | | CONS( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3, NULL, "NOVAG Industries Ltd.", "Chess Champion Super System III", 0) |
| 368 | CONS( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3, NULL, "NOVAG Industries Ltd.", "Chess Champion Super System III", GAME_NO_SOUND) |
| 170 | 369 | //chess champion MK III in germany |