src/mess/drivers/polgar.c
| r9634 | r9635 | |
| 1 | | /****************************************************************************** |
| 2 | | Mephisto 4 + 5 Chess Computer |
| 3 | | 2007 Dirk V. |
| 4 | | |
| 5 | | ******************************************************************************/ |
| 6 | | |
| 7 | | /* |
| 8 | | |
| 9 | | |
| 10 | | CPU 65C02 P4 |
| 11 | | Clock 4.9152 MHz |
| 12 | | NMI CLK 600 Hz |
| 13 | | IRQ Line is set to VSS |
| 14 | | 8 KByte SRAM Sony CXK5864-15l |
| 15 | | |
| 16 | | 1-CD74HC4060E 14 Bit Counter |
| 17 | | 1-CD74HC166E |
| 18 | | 1-CD74HC251E |
| 19 | | 1-SN74HC138N TI |
| 20 | | 1-SN74HC139N TI |
| 21 | | 1-74HC14AP Toshiba |
| 22 | | 1-74HC02AP Toshiba |
| 23 | | 1-74HC00AP Toshiba |
| 24 | | 1-CD74HC259E |
| 25 | | |
| 26 | | |
| 27 | | $0000-$1fff S-RAM |
| 28 | | $2000 LCD 4 Byte Shift Register writeonly right to left |
| 29 | | every 2nd char xor'd by $FF |
| 30 | | |
| 31 | | 2c00-2c07 Keyboard (8to1 Multiplexer) 74HCT251 |
| 32 | | 2*8 Matrix |
| 33 | | Adr. 0x3407 |
| 34 | | ==0 !=0 |
| 35 | | 2c00 CL E5 |
| 36 | | 2c01 POS F6 |
| 37 | | 2c02 MEMO G7 |
| 38 | | 2c03 INFO A1 |
| 39 | | 2c04 LEV H8 |
| 40 | | 2c05 ENT B2 |
| 41 | | 2c06 >0 C3 |
| 42 | | 2c07 <9 D4 |
| 43 | | |
| 44 | | $3400-$3407 LED 1-6, Buzzer, Keyboard select |
| 45 | | |
| 46 | | $2400 // Chess Board |
| 47 | | $2800 // Chess Board |
| 48 | | $3000 // Chess Board |
| 49 | | |
| 50 | | $4000-7FFF Opening Modul HG550 |
| 51 | | $8000-$FFF ROM |
| 52 | | |
| 53 | | // lese Tastatur von 2c00 - 2c07, |
| 54 | | 2c00 Trn |
| 55 | | 2c01 Info |
| 56 | | 2c02 Mem |
| 57 | | 2c03 Pos |
| 58 | | 2c04 Lev |
| 59 | | 2c05 Fct |
| 60 | | 2c06 Ent |
| 61 | | 2c07 CL |
| 62 | | |
| 63 | | |
| 64 | | |
| 65 | | |
| 66 | | */ |
| 67 | | |
| 68 | | #include "emu.h" |
| 69 | | #include "cpu/m6502/m6502.h" |
| 70 | | // #include"cpu/mcs51/mcs51.h" |
| 71 | | // #include "sound/dac.h" |
| 72 | | #include "sound/beep.h" |
| 73 | | |
| 74 | | // #include "milano.lh" |
| 75 | | #include "video/hd44780.h" |
| 76 | | // #include "render.h" |
| 77 | | // #include "rendlay.h" |
| 78 | | // #include "uiinput.h" |
| 79 | | #include "machine/mboard.h" |
| 80 | | |
| 81 | | static UINT8 lcd_shift_counter; |
| 82 | | static UINT8 led_status; |
| 83 | | static UINT8 lcd_char=0; |
| 84 | | // static UINT8 *milano_ram; |
| 85 | | // static UINT8 led7; |
| 86 | | |
| 87 | | |
| 88 | | |
| 89 | | static const hd44780_interface polgar_display = |
| 90 | | { |
| 91 | | 2, // number of lines |
| 92 | | 16, // chars for line |
| 93 | | NULL // custom display layout |
| 94 | | }; |
| 95 | | |
| 96 | | |
| 97 | | |
| 98 | | |
| 99 | | |
| 100 | | static WRITE8_HANDLER ( write_lcd_i ) |
| 101 | | { |
| 102 | | |
| 103 | | hd44780_device * hd44780 = space->machine->device<hd44780_device>("hd44780"); |
| 104 | | running_device *speaker = space->machine->device("beep"); |
| 105 | | // state->hd44780->data_write(offset, data); |
| 106 | | //state->hd44780->control_write(0, data); |
| 107 | | |
| 108 | | if ((data&1)==1) |
| 109 | | hd44780->data_write(128, lcd_char); |
| 110 | | else |
| 111 | | hd44780->control_write(128, lcd_char); |
| 112 | | |
| 113 | | |
| 114 | | if ((data&4)==4) beep_set_state(speaker,1); |
| 115 | | else beep_set_state(speaker,0); |
| 116 | | |
| 117 | | |
| 118 | | logerror("LCD Register = %d Data = %d\n",offset,data); |
| 119 | | } |
| 120 | | |
| 121 | | static WRITE8_HANDLER ( write_lcd ) |
| 122 | | { |
| 123 | | |
| 124 | | //hd44780_device * hd44780 = space->machine->device<hd44780_device>("hd44780"); |
| 125 | | // state->hd44780->data_write(offset, data); |
| 126 | | //state->hd44780->control_write(0, data); |
| 127 | | lcd_char=data; |
| 128 | | //hd44780->data_write(128, data); |
| 129 | | //hd44780->data_write(128, data_8); |
| 130 | | } |
| 131 | | |
| 132 | | static WRITE8_HANDLER ( write_led ) |
| 133 | | { |
| 134 | | UINT8 LED_offset=100; |
| 135 | | //data &= 0xff; |
| 136 | | if (data==0xff) output_set_led_value(LED_offset+offset,1); |
| 137 | | else |
| 138 | | output_set_led_value(LED_offset+offset,0); |
| 139 | | //if (data==0)led_status &= 255-(1<<offset) ; else led_status|=1<<offset; |
| 140 | | // if (offset<6)output_set_led_value(LED_offset+offset, led_status&1<<offset?1:0); |
| 141 | | // if (offset==7) led7=data& 0x80 ? 0x00 :0xff; |
| 142 | | |
| 143 | | |
| 144 | | // logerror("LEDs Offset = %d Data = %d\n",offset,data); |
| 145 | | } |
| 146 | | |
| 147 | | static READ8_HANDLER(read_keys) |
| 148 | | { |
| 149 | | UINT8 data; |
| 150 | | static const char *const keynames[2][8] = |
| 151 | | { |
| 152 | | { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" }, |
| 153 | | { "KEY2_0", "KEY2_1", "KEY2_2", "KEY2_3", "KEY2_4", "KEY2_5", "KEY2_6", "KEY2_7" } |
| 154 | | }; |
| 155 | | |
| 156 | | data = 0xff; |
| 157 | | /* |
| 158 | | if (((led_status & 0x80) == 0x00)) |
| 159 | | data=input_port_read(space->machine, keynames[0][offset]); |
| 160 | | else |
| 161 | | data=input_port_read(space->machine, keynames[1][offset]); |
| 162 | | */ |
| 163 | | data=input_port_read(space->machine, keynames[0][offset]); |
| 164 | | logerror("Keyboard Port = %s Data = %d\n ", ((led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data); |
| 165 | | return data | 0x7f; |
| 166 | | } |
| 167 | | |
| 168 | | |
| 169 | | |
| 170 | | static VIDEO_START( polgar ) |
| 171 | | { |
| 172 | | |
| 173 | | } |
| 174 | | |
| 175 | | static VIDEO_UPDATE( polgar ) |
| 176 | | { |
| 177 | | hd44780_device * hd44780 = screen->machine->device<hd44780_device>("hd44780"); |
| 178 | | |
| 179 | | return hd44780->video_update( bitmap, cliprect ); |
| 180 | | } |
| 181 | | |
| 182 | | static PALETTE_INIT( polgar ) |
| 183 | | { |
| 184 | | // palette_set_color(machine, 0, MAKE_RGB(138, 146, 148)); |
| 185 | | palette_set_color(machine, 0, MAKE_RGB(195, 201, 200)); |
| 186 | | palette_set_color(machine, 1, MAKE_RGB(40, 30, 30)); |
| 187 | | } |
| 188 | | |
| 189 | | |
| 190 | | static const gfx_layout polgar_charlayout = |
| 191 | | { |
| 192 | | 5, 8, /* 5 x 8 characters */ |
| 193 | | 256, /* 256 characters */ |
| 194 | | 1, /* 1 bits per pixel */ |
| 195 | | { 0 }, /* no bitplanes */ |
| 196 | | { 3, 4, 5, 6, 7}, |
| 197 | | { 0, 8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8}, |
| 198 | | 8*8 /* 8 bytes */ |
| 199 | | }; |
| 200 | | |
| 201 | | static GFXDECODE_START( polgar ) |
| 202 | | GFXDECODE_ENTRY( "hd44780", 0x0000, polgar_charlayout, 0, 1 ) |
| 203 | | GFXDECODE_END |
| 204 | | |
| 205 | | |
| 206 | | |
| 207 | | |
| 208 | | static ADDRESS_MAP_START(polgar_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 209 | | AM_RANGE( 0x0000, 0x1fff) AM_RAM // AM_BASE(&milano_ram)// |
| 210 | | AM_RANGE( 0x2400, 0x2407) AM_WRITE ( mboard_write_LED_8 ) // Chessboard |
| 211 | | AM_RANGE( 0x2800, 0x2800) AM_WRITE ( mboard_write_board_8) // Chessboard |
| 212 | | AM_RANGE( 0x3000, 0x3000) AM_READ( mboard_read_board_8 ) // Chessboard |
| 213 | | AM_RANGE( 0x3400, 0x3405) AM_WRITE( write_led) // Function LEDs 3400 TRN 3401 |
| 214 | | AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys) // CL Key |
| 215 | | AM_RANGE( 0x2004, 0x2004) AM_WRITE( write_lcd_i) // LCD Instr. Reg + Beeper |
| 216 | | AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd) // LCD Char Reg. |
| 217 | | //AM_RANGE( 0x6000, 0x6000) AM_RAM |
| 218 | | //AM_RANGE( 0x7000, 0x7000) AM_RAM |
| 219 | | AM_RANGE( 0x4000, 0xffff) AM_ROM |
| 220 | | ADDRESS_MAP_END |
| 221 | | |
| 222 | | |
| 223 | | /* |
| 224 | | static ADDRESS_MAP_START(milano_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 225 | | AM_RANGE( 0x0000, 0x1fff) AM_RAM // AM_BASE(&milano_ram)// |
| 226 | | // AM_RANGE( 0x2400, 0x2407) AM_WRITE ( write_LED_8 ) // Chessboard |
| 227 | | // AM_RANGE( 0x2800, 0x2800) AM_WRITE ( write_board_8) // Chessboard |
| 228 | | // AM_RANGE( 0x3000, 0x3000) AM_READ( read_board_8 ) // Chessboard |
| 229 | | // AM_RANGE( 0x3400, 0x3405) AM_WRITE( write_leds) // Function LEDs 3400 TRN 3401 |
| 230 | | // AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys) // CL Key |
| 231 | | // AM_RANGE( 0x2004, 0x2004) AM_WRITE( write_lcd_i) // LCD Instr. Reg |
| 232 | | // AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd) // LCD Char Reg. |
| 233 | | //AM_RANGE( 0x6000, 0x6000) AM_RAM |
| 234 | | //AM_RANGE( 0x7000, 0x7000) AM_RAM |
| 235 | | AM_RANGE( 0x3000, 0xffff) AM_ROM |
| 236 | | // AM_RANGE( 0x4000, 0xffff) AM_ROM |
| 237 | | ADDRESS_MAP_END |
| 238 | | */ |
| 239 | | |
| 240 | | static INPUT_PORTS_START( board ) |
| 241 | | PORT_START("LINE2") |
| 242 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 243 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 244 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 245 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 246 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 247 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 248 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 249 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 250 | | PORT_START("LINE3") |
| 251 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 252 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 253 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 254 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 255 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 256 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 257 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 258 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 259 | | PORT_START("LINE4") |
| 260 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 261 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 262 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 263 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 264 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 265 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 266 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 267 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 268 | | PORT_START("LINE5") |
| 269 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 270 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 271 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 272 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 273 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 274 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 275 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 276 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 277 | | PORT_START("LINE6") |
| 278 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 279 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 280 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 281 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 282 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 283 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 284 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 285 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 286 | | PORT_START("LINE7") |
| 287 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 288 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 289 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 290 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 291 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 292 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 293 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 294 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 295 | | PORT_START("LINE8") |
| 296 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 297 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 298 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 299 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 300 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 301 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 302 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 303 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 304 | | PORT_START("LINE9") |
| 305 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 306 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 307 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 308 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 309 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 310 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 311 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 312 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) |
| 313 | | |
| 314 | | PORT_START("LINE10") |
| 315 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 316 | | |
| 317 | | PORT_START("B_WHITE") |
| 318 | | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 319 | | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 320 | | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 321 | | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 322 | | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 323 | | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 324 | | |
| 325 | | PORT_START("B_BLACK") |
| 326 | | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 327 | | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 328 | | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 329 | | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 330 | | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 331 | | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 332 | | |
| 333 | | PORT_START("B_BUTTONS") |
| 334 | | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 335 | | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) |
| 336 | | |
| 337 | | INPUT_PORTS_END |
| 338 | | |
| 339 | | static INPUT_PORTS_START( polgar ) |
| 340 | | PORT_INCLUDE( board ) |
| 341 | | PORT_START("KEY1_0") //Port $2c00 |
| 342 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Trn") PORT_CODE(KEYCODE_F1) |
| 343 | | PORT_START("KEY1_1") //Port $2c01 |
| 344 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Info") PORT_CODE(KEYCODE_F2) |
| 345 | | PORT_START("KEY1_2") //Port $2c02 |
| 346 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Mem") PORT_CODE(KEYCODE_F3) |
| 347 | | PORT_START("KEY1_3") //Port $2c03 |
| 348 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Pos") PORT_CODE(KEYCODE_F4) |
| 349 | | PORT_START("KEY1_4") //Port $2c04 |
| 350 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_F5) |
| 351 | | PORT_START("KEY1_5") //Port $2c05 |
| 352 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCT") PORT_CODE(KEYCODE_F6) |
| 353 | | PORT_START("KEY1_6") //Port $2c06 |
| 354 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_F7) |
| 355 | | PORT_START("KEY1_7") //Port $2c07 |
| 356 | | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_F8) |
| 357 | | INPUT_PORTS_END |
| 358 | | |
| 359 | | static TIMER_CALLBACK( update_nmi ) |
| 360 | | { |
| 361 | | // running_device *speaker = machine->device("beep"); |
| 362 | | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE); |
| 363 | | // cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE); |
| 364 | | // dac_data_w(0,led_status&64?128:0); |
| 365 | | // beep_set_state(speaker,led_status&64?1:0); |
| 366 | | } |
| 367 | | |
| 368 | | |
| 369 | | static MACHINE_START( polgar ) |
| 370 | | { |
| 371 | | lcd_shift_counter=3; |
| 372 | | // timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, update_leds); |
| 373 | | timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, update_nmi); |
| 374 | | timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, mboard_update_artwork); |
| 375 | | mboard_savestate_register(machine); |
| 376 | | } |
| 377 | | |
| 378 | | |
| 379 | | static MACHINE_RESET( polgar ) |
| 380 | | { |
| 381 | | // lcd_shift_counter = 3; |
| 382 | | hd44780_device * hd44780 = machine->device<hd44780_device>("hd44780"); |
| 383 | | hd44780->control_write(128, 15); /* Initialize LCD */ |
| 384 | | mboard_set_boarder_pieces(); |
| 385 | | mboard_set_board(); |
| 386 | | } |
| 387 | | |
| 388 | | |
| 389 | | static MACHINE_CONFIG_START( polgar, driver_device ) |
| 390 | | /* basic machine hardware */ |
| 391 | | MDRV_CPU_ADD("maincpu",M65C02,4915200) /* 65C02 */ |
| 392 | | //MDRV_CPU_ADD("maincpu",M65C02,10000000) /* 65C02 */ |
| 393 | | // MDRV_CPU_ADD("maincpu",I8032,120000000) /* 65C02 */ |
| 394 | | MDRV_CPU_PROGRAM_MAP(polgar_mem) |
| 395 | | MDRV_QUANTUM_TIME(HZ(60)) |
| 396 | | MDRV_MACHINE_START( polgar ) |
| 397 | | MDRV_MACHINE_RESET( polgar ) |
| 398 | | |
| 399 | | /* video hardware */ |
| 400 | | // MDRV_DEFAULT_LAYOUT(layout_milano) |
| 401 | | MDRV_SCREEN_ADD("screen", LCD) |
| 402 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 403 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 404 | | MDRV_SCREEN_SIZE(100, 19) |
| 405 | | MDRV_SCREEN_VISIBLE_AREA(0, 100-1, 0, 19-1) |
| 406 | | MDRV_PALETTE_LENGTH(2) |
| 407 | | MDRV_PALETTE_INIT(polgar) |
| 408 | | |
| 409 | | MDRV_GFXDECODE(polgar) |
| 410 | | |
| 411 | | MDRV_HD44780_ADD("hd44780", polgar_display) |
| 412 | | |
| 413 | | MDRV_VIDEO_START(polgar) |
| 414 | | MDRV_VIDEO_UPDATE(polgar) |
| 415 | | |
| 416 | | |
| 417 | | |
| 418 | | // MDRV_DEFAULT_LAYOUT(layout_van16) |
| 419 | | MDRV_DEFAULT_LAYOUT(layout_lcd) |
| 420 | | |
| 421 | | |
| 422 | | |
| 423 | | |
| 424 | | /* sound hardware */ |
| 425 | | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 426 | | MDRV_SOUND_ADD("beep", BEEP, 0) |
| 427 | | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 428 | | MACHINE_CONFIG_END |
| 429 | | |
| 430 | | /* |
| 431 | | |
| 432 | | ROM_START(milano) |
| 433 | | ROM_REGION(0x10000,"maincpu",0) |
| 434 | | ROM_LOAD("milano.bin", 0x0000, 0x10000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083)) |
| 435 | | ROM_REGION( 0x00800, "hd44780", ROMREGION_ERASE ) |
| 436 | | ROM_LOAD( "m_chargen.bin", 0x0100, 0x0700, BAD_DUMP CRC(4c64fc7d) SHA1(123a87b2dc7efd7afcd8e27eb9bc74f54a8f1bc9)) |
| 437 | | ROM_END |
| 438 | | |
| 439 | | */ |
| 440 | | |
| 441 | | ROM_START(polgar) //polgar |
| 442 | | ROM_REGION(0x10000,"maincpu",0) |
| 443 | | ROM_LOAD("polgar.bin", 0x0000, 0x10000, CRC(88d55c0f) SHA1(e86d088ec3ac68deaf90f6b3b97e3e31b1515913)) |
| 444 | | ROM_REGION( 0x00800, "hd44780", ROMREGION_ERASE ) |
| 445 | | ROM_LOAD( "m_chargen.bin", 0x0100, 0x0700, BAD_DUMP CRC(b497af5c) SHA1(0bddebf91dac868ffbdd7f514253943635d7fe9a)) |
| 446 | | ROM_END |
| 447 | | |
| 448 | | |
| 449 | | static DRIVER_INIT( polgar ) |
| 450 | | { |
| 451 | | lcd_shift_counter = 3; |
| 452 | | } |
| 453 | | |
| 454 | | /*************************************************************************** |
| 455 | | |
| 456 | | Game driver(s) |
| 457 | | |
| 458 | | ***************************************************************************/ |
| 459 | | |
| 460 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 461 | | //CONS( 1983, mephisto, 0, 0, mephisto, mephisto, mephisto, "Hegener & Glaser", "Mephisto Polgar Computer", GAME_NOT_WORKING ) |
| 462 | | CONS( 1986, polgar, 0, 0, polgar, polgar, polgar, "Hegener & Glaser", "Mephisto Milano Schach Computer", 0 ) |
| 463 | | // second design sold (same computer/program?) |
| 1 | /******************************************************************************
|
| 2 | Mephisto Polgar
|
| 3 | 2010 Dirk V., Cowering
|
| 4 | |
| 5 | ******************************************************************************/
|
| 6 | |
| 7 | /*
|
| 8 | |
| 9 | CPU 65C02 P4
|
| 10 | Clock 4.9152 MHz
|
| 11 | |
| 12 | |
| 13 | // lese Tastatur von 2c00 - 2c07,
|
| 14 | 2c00 Trn
|
| 15 | 2c01 Info
|
| 16 | 2c02 Mem
|
| 17 | 2c03 Pos
|
| 18 | 2c04 Lev
|
| 19 | 2c05 Fct
|
| 20 | 2c06 Ent
|
| 21 | 2c07 CL
|
| 22 | |
| 23 | $1ff0
|
| 24 | Bit 0 LCD Command/Data 0/1
|
| 25 | Bit 1 LCD Enable (signals Data is valid)
|
| 26 | Bit 2 Beeper
|
| 27 | Bit 3 Beeper
|
| 28 | Bit 4 LED A-H
|
| 29 | Bit 5 LED 1-8
|
| 30 | Bit 6 LED 1-8
|
| 31 | Bit 7 LED A-H
|
| 32 | |
| 33 | |
| 34 | */
|
| 35 | |
| 36 | #include "emu.h"
|
| 37 | #include "cpu/m6502/m6502.h"
|
| 38 | #include "sound/beep.h"
|
| 39 | // #include "milano.lh"
|
| 40 | #include "video/hd44780.h"
|
| 41 | // #include "render.h"
|
| 42 | // #include "rendlay.h"
|
| 43 | // #include "uiinput.h"
|
| 44 | #include "machine/mboard.h"
|
| 45 | |
| 46 | //static UINT8 lcd_shift_counter;
|
| 47 | static UINT8 led_status;
|
| 48 | static UINT8 lcd_char=0;
|
| 49 | // static UINT8 *milano_ram;
|
| 50 | static UINT8 led7;
|
| 51 | |
| 52 | static const int value[4] = {0x80,0x81,0x00,0x01};
|
| 53 | |
| 54 | static UINT8 latch_data;
|
| 55 | |
| 56 | static const hd44780_interface polgar_display =
|
| 57 | {
|
| 58 | 2, // number of lines
|
| 59 | 16, // chars for line
|
| 60 | NULL // custom display layout
|
| 61 | };
|
| 62 | |
| 63 | |
| 64 | static WRITE8_HANDLER ( write_io )
|
| 65 | {
|
| 66 | int i;
|
| 67 | hd44780_device * hd44780 = space->machine->device<hd44780_device>("hd44780");
|
| 68 | running_device *speaker = space->machine->device("beep");
|
| 69 | |
| 70 | if (BIT(data,1)) {
|
| 71 | if (BIT(data,0)) {
|
| 72 | hd44780->data_write(128, lcd_char);
|
| 73 | } else {
|
| 74 | hd44780->control_write(128, lcd_char);
|
| 75 | }
|
| 76 | }
|
| 77 | |
| 78 | if (BIT(data,2) || BIT(data,3)) beep_set_state(speaker,1); else beep_set_state(speaker,0);
|
| 79 | |
| 80 | if (BIT(data,7) && BIT(data, 4))
|
| 81 | {
|
| 82 | for (i=0;i<8;i++)
|
| 83 | output_set_led_value(i,!BIT(latch_data,i));
|
| 84 | }
|
| 85 | if (BIT(data,6) && BIT(data,5))
|
| 86 | {
|
| 87 | for (i=0;i<8;i++)
|
| 88 | output_set_led_value(10+i,!BIT(latch_data,7-i));
|
| 89 | }
|
| 90 | |
| 91 | //logerror("LCD Status Data = %d\n",data);
|
| 92 | |
| 93 | |
| 94 | }
|
| 95 | |
| 96 | static WRITE8_HANDLER ( write_lcd )
|
| 97 | {
|
| 98 | |
| 99 | lcd_char=data;
|
| 100 | |
| 101 | //logerror("LCD Data = %d [%c]\n",data,(data&0xff));
|
| 102 | |
| 103 | }
|
| 104 | |
| 105 | |
| 106 | static WRITE8_HANDLER ( write_board )
|
| 107 | {
|
| 108 | latch_data=data;
|
| 109 | }
|
| 110 | |
| 111 | |
| 112 | static WRITE8_HANDLER ( milano_write_led )
|
| 113 | {
|
| 114 | UINT8 LED_offset=100;
|
| 115 | if (data==0xff) output_set_led_value(LED_offset+offset,1);
|
| 116 | else
|
| 117 | output_set_led_value(LED_offset+offset,0);
|
| 118 | |
| 119 | //logerror("LEDs Offset = %d Data = %d\n",offset,data);
|
| 120 | }
|
| 121 | |
| 122 | static WRITE8_HANDLER ( write_led )
|
| 123 | {
|
| 124 | UINT8 LED_offset=100;
|
| 125 | data &= 0x80;
|
| 126 | |
| 127 | if (data==0)led_status &= 255-(1<<offset) ; else led_status|=1<<offset;
|
| 128 | if (offset<6)output_set_led_value(LED_offset+offset, led_status&1<<offset?1:0);
|
| 129 | if (offset==7) led7=data& 0x80 ? 0x00 :0xff;
|
| 130 | logerror("LEDs Offset = %d Data = %d\n",offset,data);
|
| 131 | }
|
| 132 | |
| 133 | /*static WRITE8_HANDLER ( write_led )
|
| 134 | {
|
| 135 | UINT8 LED_offset=100;
|
| 136 | if (data==0xff) output_set_led_value(LED_offset+offset,1);
|
| 137 | else
|
| 138 | output_set_led_value(LED_offset+offset,0);
|
| 139 | if (data==0)led_status &= 255-(1<<offset) ; else led_status|=1<<offset;
|
| 140 | if (offset<6)output_set_led_value(LED_offset+offset, led_status&1<<offset?1:0);
|
| 141 | if (offset==7) led7=data& 0x80 ? 0x00 :0xff;
|
| 142 | |
| 143 | |
| 144 | logerror("LEDs Offset = %d Data = %d\n",offset,data);
|
| 145 | }
|
| 146 | */
|
| 147 | static READ8_HANDLER(read_board)
|
| 148 | {
|
| 149 | UINT8 data;
|
| 150 | data=input_port_read(space->machine, "KEY1_8");
|
| 151 | logerror("Keydata Data = %d\n ",data);
|
| 152 | return data;
|
| 153 | }
|
| 154 | |
| 155 | static READ8_HANDLER(read_keys)
|
| 156 | {
|
| 157 | UINT8 data;
|
| 158 | static const char *const keynames[2][8] =
|
| 159 | {
|
| 160 | { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" },
|
| 161 | { "KEY2_0", "KEY2_1", "KEY2_2", "KEY2_3", "KEY2_4", "KEY2_5", "KEY2_6", "KEY2_7" }
|
| 162 | };
|
| 163 | |
| 164 | data = 0xff;
|
| 165 | /*
|
| 166 | if (((led_status & 0x80) == 0x00))
|
| 167 | data=input_port_read(space->machine, keynames[0][offset]);
|
| 168 | else
|
| 169 | data=input_port_read(space->machine, keynames[1][offset]);
|
| 170 | */
|
| 171 | data=input_port_read(space->machine, keynames[0][offset]);
|
| 172 | // logerror("Keyboard Port = %s Data = %d\n ", ((led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
|
| 173 | return data | 0x7f;
|
| 174 | }
|
| 175 | |
| 176 | |
| 177 | |
| 178 | static VIDEO_START( polgar )
|
| 179 | {
|
| 180 | |
| 181 | }
|
| 182 | |
| 183 | static VIDEO_UPDATE( polgar )
|
| 184 | {
|
| 185 | hd44780_device * hd44780 = screen->machine->device<hd44780_device>("hd44780");
|
| 186 | return hd44780->video_update( bitmap, cliprect );
|
| 187 | }
|
| 188 | |
| 189 | static PALETTE_INIT( polgar )
|
| 190 | {
|
| 191 | // palette_set_color(machine, 0, MAKE_RGB(138, 146, 148));
|
| 192 | palette_set_color(machine, 0, MAKE_RGB(195, 201, 200));
|
| 193 | palette_set_color(machine, 1, MAKE_RGB(40, 30, 30));
|
| 194 | }
|
| 195 | |
| 196 | |
| 197 | static const gfx_layout polgar_charlayout =
|
| 198 | {
|
| 199 | 5, 8, /* 5 x 8 characters */
|
| 200 | 256, /* 256 characters */
|
| 201 | 1, /* 1 bits per pixel */
|
| 202 | { 0 }, /* no bitplanes */
|
| 203 | { 3, 4, 5, 6, 7},
|
| 204 | { 0, 8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
|
| 205 | 8*8 /* 8 bytes */
|
| 206 | };
|
| 207 | |
| 208 | static GFXDECODE_START( polgar )
|
| 209 | GFXDECODE_ENTRY( "hd44780", 0x0000, polgar_charlayout, 0, 1 )
|
| 210 | GFXDECODE_END
|
| 211 | |
| 212 | |
| 213 | static ADDRESS_MAP_START(polgar_mem , ADDRESS_SPACE_PROGRAM, 8)
|
| 214 | AM_RANGE( 0x0000, 0x1fff) AM_RAM
|
| 215 | AM_RANGE( 0x2400, 0x2407) AM_WRITE ( mboard_write_LED_8 ) // Chessboard
|
| 216 | AM_RANGE( 0x2800, 0x2800) AM_WRITE ( mboard_write_board_8) // Chessboard
|
| 217 | AM_RANGE( 0x3000, 0x3000) AM_READ( mboard_read_board_8 ) // Chessboard
|
| 218 | AM_RANGE( 0x3400, 0x3405) AM_WRITE( write_led) // Function LEDs 3400 TRN 3401
|
| 219 | AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys) // CL Key
|
| 220 | AM_RANGE( 0x2004, 0x2004) AM_WRITE( write_io) // LCD Instr. Reg + Beeper
|
| 221 | AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd) // LCD Char Reg.
|
| 222 | AM_RANGE( 0x4000, 0xffff) AM_ROM
|
| 223 | ADDRESS_MAP_END
|
| 224 | |
| 225 | |
| 226 | |
| 227 | static ADDRESS_MAP_START(milano_mem , ADDRESS_SPACE_PROGRAM, 8)
|
| 228 | AM_RANGE( 0x0000, 0x1f9f) AM_RAM
|
| 229 | AM_RANGE( 0x1fd0, 0x1fd0) AM_WRITE ( write_board) // Chessboard
|
| 230 | AM_RANGE( 0x1fe0, 0x1fe0) AM_READ( read_board ) // Chessboard
|
| 231 | AM_RANGE( 0x1fe8, 0x1fed) AM_WRITE( milano_write_led ) // Function LEDs 3400 TRN 3401
|
| 232 | AM_RANGE( 0x1fd8, 0x1fdf) AM_READ( read_keys) // CL Key
|
| 233 | AM_RANGE( 0x1ff0, 0x1ff0) AM_WRITE( write_io) // IO control
|
| 234 | AM_RANGE( 0x1fc0, 0x1fc0) AM_WRITE( write_lcd) // LCD Char Reg. (latched)
|
| 235 | AM_RANGE( 0x2000, 0xffff) AM_ROM
|
| 236 | ADDRESS_MAP_END
|
| 237 | |
| 238 | |
| 239 | static INPUT_PORTS_START( board )
|
| 240 | PORT_START("LINE2")
|
| 241 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 242 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 243 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 244 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 245 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 246 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 247 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 248 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 249 | PORT_START("LINE3")
|
| 250 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 251 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 252 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 253 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 254 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 255 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 256 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 257 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 258 | PORT_START("LINE4")
|
| 259 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 260 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 261 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 262 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 263 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 264 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 265 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 266 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 267 | PORT_START("LINE5")
|
| 268 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 269 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 270 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 271 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 272 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 273 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 274 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 275 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 276 | PORT_START("LINE6")
|
| 277 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 278 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 279 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 280 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 281 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 282 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 283 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 284 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 285 | PORT_START("LINE7")
|
| 286 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 287 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 288 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 289 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 290 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 291 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 292 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 293 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 294 | PORT_START("LINE8")
|
| 295 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 296 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 297 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 298 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 299 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 300 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 301 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 302 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 303 | PORT_START("LINE9")
|
| 304 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 305 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 306 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 307 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 308 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 309 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 310 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 311 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
|
| 312 | |
| 313 | PORT_START("LINE10")
|
| 314 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 315 | |
| 316 | PORT_START("B_WHITE")
|
| 317 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 318 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 319 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 320 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 321 | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 322 | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 323 | |
| 324 | PORT_START("B_BLACK")
|
| 325 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 326 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 327 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 328 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 329 | PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 330 | PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 331 | |
| 332 | PORT_START("B_BUTTONS")
|
| 333 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 334 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)
|
| 335 | |
| 336 | INPUT_PORTS_END
|
| 337 | |
| 338 | static INPUT_PORTS_START( polgar )
|
| 339 | PORT_INCLUDE( board )
|
| 340 | PORT_START("KEY1_0") //Port $2c00
|
| 341 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Trn") PORT_CODE(KEYCODE_F1)
|
| 342 | PORT_START("KEY1_1") //Port $2c01
|
| 343 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Info") PORT_CODE(KEYCODE_F2)
|
| 344 | PORT_START("KEY1_2") //Port $2c02
|
| 345 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Mem") PORT_CODE(KEYCODE_F3)
|
| 346 | PORT_START("KEY1_3") //Port $2c03
|
| 347 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Pos") PORT_CODE(KEYCODE_F4)
|
| 348 | PORT_START("KEY1_4") //Port $2c04
|
| 349 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_F5)
|
| 350 | PORT_START("KEY1_5") //Port $2c05
|
| 351 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCT") PORT_CODE(KEYCODE_F6)
|
| 352 | PORT_START("KEY1_6") //Port $2c06
|
| 353 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_F7)
|
| 354 | PORT_START("KEY1_7") //Port $2c07
|
| 355 | PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_F8)
|
| 356 | PORT_START("KEY1_8")
|
| 357 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_1)
|
| 358 | INPUT_PORTS_END
|
| 359 | |
| 360 | static TIMER_CALLBACK( update_nmi )
|
| 361 | {
|
| 362 | // running_device *speaker = machine->device("beep");
|
| 363 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI,PULSE_LINE);
|
| 364 | // cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
|
| 365 | // dac_data_w(0,led_status&64?128:0);
|
| 366 | // beep_set_state(speaker,led_status&64?1:0);
|
| 367 | }
|
| 368 | |
| 369 | |
| 370 | static MACHINE_START( polgar )
|
| 371 | {
|
| 372 | // timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, update_leds);
|
| 373 | timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, update_nmi);
|
| 374 | timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, mboard_update_artwork);
|
| 375 | mboard_savestate_register(machine);
|
| 376 | }
|
| 377 | |
| 378 | |
| 379 | static MACHINE_RESET( polgar )
|
| 380 | {
|
| 381 | |
| 382 | mboard_set_border_pieces();
|
| 383 | mboard_set_board();
|
| 384 | }
|
| 385 | |
| 386 | |
| 387 | static MACHINE_CONFIG_START( polgar, driver_device )
|
| 388 | /* basic machine hardware */
|
| 389 | MDRV_CPU_ADD("maincpu",M65C02,4915200) /* 65C02 */
|
| 390 | MDRV_CPU_PROGRAM_MAP(polgar_mem)
|
| 391 | MDRV_QUANTUM_TIME(HZ(60))
|
| 392 | MDRV_MACHINE_START( polgar )
|
| 393 | MDRV_MACHINE_RESET( polgar )
|
| 394 | |
| 395 | /* video hardware */
|
| 396 | // MDRV_DEFAULT_LAYOUT(layout_milano)
|
| 397 | MDRV_SCREEN_ADD("screen", LCD)
|
| 398 | MDRV_SCREEN_REFRESH_RATE(50)
|
| 399 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
| 400 | MDRV_SCREEN_SIZE(100, 20) |
| 401 | MDRV_SCREEN_VISIBLE_AREA(0, 100-1, 0, 20-1)
|
| 402 | MDRV_PALETTE_LENGTH(2)
|
| 403 | MDRV_PALETTE_INIT(polgar)
|
| 404 | |
| 405 | MDRV_GFXDECODE(polgar)
|
| 406 | |
| 407 | MDRV_HD44780_ADD("hd44780", polgar_display)
|
| 408 | |
| 409 | MDRV_VIDEO_START(polgar)
|
| 410 | MDRV_VIDEO_UPDATE(polgar)
|
| 411 | |
| 412 | |
| 413 | // MDRV_DEFAULT_LAYOUT(layout_van16)
|
| 414 | MDRV_DEFAULT_LAYOUT(layout_lcd)
|
| 415 | |
| 416 | |
| 417 | /* sound hardware */
|
| 418 | MDRV_SPEAKER_STANDARD_MONO("mono")
|
| 419 | MDRV_SOUND_ADD("beep", BEEP, 0)
|
| 420 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
| 421 | MACHINE_CONFIG_END
|
| 422 | |
| 423 | static MACHINE_CONFIG_DERIVED( milano, polgar )
|
| 424 | /* basic machine hardware */
|
| 425 | // MDRV_IMPORT_FROM( polgar )
|
| 426 | MDRV_CPU_MODIFY("maincpu")
|
| 427 | MDRV_CPU_PROGRAM_MAP(milano_mem)
|
| 428 | //beep_set_frequency(0, 4000);
|
| 429 | MACHINE_CONFIG_END
|
| 430 | |
| 431 | ROM_START(milano)
|
| 432 | ROM_REGION(0x10000,"maincpu",0)
|
| 433 | ROM_LOAD("milano.bin", 0x0000, 0x10000, CRC(0e9c8fe1) SHA1(e9176f42d86fe57e382185c703c7eff7e63ca711))
|
| 434 | ROM_REGION( 0x0860, "hd44780", ROMREGION_ERASE )
|
| 435 | ROM_LOAD( "44780a00.bin", 0x0000, 0x0860, BAD_DUMP CRC(3a89024c) SHA1(5a87b68422a916d1b37b5be1f7ad0b3fb3af5a8d))
|
| 436 | ROM_END
|
| 437 | |
| 438 | |
| 439 | |
| 440 | ROM_START(polgar) //polgar
|
| 441 | ROM_REGION(0x10000,"maincpu",0)
|
| 442 | ROM_LOAD("polgar.bin", 0x0000, 0x10000, CRC(88d55c0f) SHA1(e86d088ec3ac68deaf90f6b3b97e3e31b1515913))
|
| 443 | ROM_REGION( 0x0860, "hd44780", ROMREGION_ERASE )
|
| 444 | ROM_LOAD( "44780a00.bin", 0x0000, 0x0860, BAD_DUMP CRC(3a89024c) SHA1(5a87b68422a916d1b37b5be1f7ad0b3fb3af5a8d))
|
| 445 | ROM_END
|
| 446 | |
| 447 | |
| 448 | static DRIVER_INIT( polgar )
|
| 449 | {
|
| 450 | led_status=0;
|
| 451 | }
|
| 452 | |
| 453 | /***************************************************************************
|
| 454 | |
| 455 | Game driver(s)
|
| 456 | |
| 457 | ***************************************************************************/
|
| 458 | |
| 459 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
|
| 460 | //CONS( 1983, mephisto, 0, 0, mephisto, mephisto, mephisto, "Hegener & Glaser", "Mephisto Polgar Computer", GAME_NOT_WORKING )
|
| 461 | CONS( 1986, polgar, 0, 0, polgar, polgar, polgar, "Hegener & Glaser", "Mephisto Polgar Schach Computer", 0 )
|
| 462 | CONS( 1986, milano, polgar, 0, milano, polgar, polgar, "Hegener & Glaser", "Mephisto Milano Schach Computer", 0 )
|
| 463 | // second design sold (same computer/program?)
|