trunk/src/mess/drivers/pc2000.c
| r21408 | r21409 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | VTech PreComputer 2000 |
| 3 | VTech PreComputer 1000 / 2000 |
| 4 | 4 | |
| 5 | 5 | 04/12/2009 Skeleton driver. |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | | - fix the keys label |
| 8 | - fix MisterX LCD |
| 9 | - MisterX bankswitch |
| 9 | 10 | - dump the chargen |
| 10 | | - verify the cartridge interface (I don't have dump for test it) |
| 11 | | - the HD44780 busy line is never checked, it's this correct?? |
| 11 | - verify pc2000 cartridge interface (I don't have dump for test it) |
| 12 | 12 | |
| 13 | 13 | ****************************************************************************/ |
| 14 | 14 | |
| r21408 | r21409 | |
| 26 | 26 | public: |
| 27 | 27 | pc2000_state(const machine_config &mconfig, device_type type, const char *tag) |
| 28 | 28 | : driver_device(mconfig, type, tag), |
| 29 | m_maincpu(*this, "maincpu"), |
| 29 | 30 | m_lcdc(*this, "hd44780"), |
| 30 | | m_beep(*this, BEEPER_TAG) |
| 31 | m_beep(*this, BEEPER_TAG), |
| 32 | m_bank1(*this, "bank1"), |
| 33 | m_bank2(*this, "bank2") |
| 31 | 34 | { } |
| 32 | 35 | |
| 36 | required_device<cpu_device> m_maincpu; |
| 33 | 37 | required_device<hd44780_device> m_lcdc; |
| 34 | 38 | required_device<beep_device> m_beep; |
| 39 | required_memory_bank m_bank1; |
| 40 | optional_memory_bank m_bank2; |
| 35 | 41 | |
| 36 | 42 | UINT8 m_mux_data; |
| 37 | 43 | UINT8 m_beep_state; |
| r21408 | r21409 | |
| 49 | 55 | virtual void palette_init(); |
| 50 | 56 | }; |
| 51 | 57 | |
| 58 | class pc1000_state : public pc2000_state |
| 59 | { |
| 60 | public: |
| 61 | pc1000_state(const machine_config &mconfig, device_type type, const char *tag) |
| 62 | : pc2000_state(mconfig, type, tag) |
| 63 | { } |
| 52 | 64 | |
| 65 | |
| 66 | virtual void machine_start(); |
| 67 | virtual void machine_reset(); |
| 68 | |
| 69 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( cart_load ); |
| 70 | DECLARE_READ8_MEMBER( kb_r ); |
| 71 | DECLARE_READ8_MEMBER( lcdc_data_r ); |
| 72 | DECLARE_WRITE8_MEMBER( lcdc_data_w ); |
| 73 | DECLARE_READ8_MEMBER( lcdc_control_r ); |
| 74 | DECLARE_WRITE8_MEMBER( lcdc_control_w ); |
| 75 | }; |
| 76 | |
| 77 | |
| 53 | 78 | /* TODO: put a breakpoint at 1625 and test the inputs, writes at dce4 are the scancode values */ |
| 54 | 79 | READ8_MEMBER( pc2000_state::key_matrix_r ) |
| 55 | 80 | { |
| r21408 | r21409 | |
| 75 | 100 | |
| 76 | 101 | WRITE8_MEMBER( pc2000_state::rombank1_w ) |
| 77 | 102 | { |
| 78 | | membank("bank1")->set_entry(data & 0x0f); |
| 103 | m_bank1->set_entry(data & 0x0f); |
| 79 | 104 | } |
| 80 | 105 | |
| 81 | 106 | WRITE8_MEMBER( pc2000_state::rombank2_w ) |
| 82 | 107 | { |
| 83 | 108 | if (data == 0x80) |
| 84 | 109 | { |
| 85 | | membank("bank2")->set_entry(data & 0x10); //cartridge |
| 110 | m_bank2->set_entry(data & 0x10); //cartridge |
| 86 | 111 | } |
| 87 | 112 | else |
| 88 | 113 | { |
| 89 | | membank("bank2")->set_entry(data & 0x0f); |
| 114 | m_bank2->set_entry(data & 0x0f); |
| 90 | 115 | } |
| 91 | 116 | } |
| 92 | 117 | |
| r21408 | r21409 | |
| 119 | 144 | AM_RANGE(0x12, 0x12) AM_READWRITE(beep_r, beep_w) |
| 120 | 145 | ADDRESS_MAP_END |
| 121 | 146 | |
| 147 | READ8_MEMBER( pc1000_state::kb_r ) |
| 148 | { |
| 149 | static const char *const bitnames[9] = |
| 150 | { |
| 151 | "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" |
| 152 | }; |
| 153 | |
| 154 | UINT8 data = 0xff; |
| 155 | |
| 156 | for (int line=0; line<9; line++) |
| 157 | if (!(offset & (1<<line))) |
| 158 | data &= ioport(bitnames[line])->read(); |
| 159 | |
| 160 | return data; |
| 161 | } |
| 162 | |
| 163 | READ8_MEMBER( pc1000_state::lcdc_data_r ) |
| 164 | { |
| 165 | //logerror("lcdc data r\n"); |
| 166 | return m_lcdc->data_read(space, 0)>>4; |
| 167 | } |
| 168 | |
| 169 | WRITE8_MEMBER( pc1000_state::lcdc_data_w ) |
| 170 | { |
| 171 | //popmessage("%s", (char*)m_maincpu->space(AS_PROGRAM).get_read_ptr(0x4290)); |
| 172 | |
| 173 | //logerror("lcdc data w %x\n", data); |
| 174 | m_lcdc->data_write(space, 0, data<<4); |
| 175 | } |
| 176 | |
| 177 | READ8_MEMBER( pc1000_state::lcdc_control_r ) |
| 178 | { |
| 179 | //logerror("lcdc control r\n"); |
| 180 | return m_lcdc->control_read(space, 0)>>4; |
| 181 | } |
| 182 | |
| 183 | WRITE8_MEMBER( pc1000_state::lcdc_control_w ) |
| 184 | { |
| 185 | //logerror("lcdc control w %x\n", data); |
| 186 | m_lcdc->control_write(space, 0, data<<4); |
| 187 | } |
| 188 | |
| 189 | static HD44780_PIXEL_UPDATE(pc1000_pixel_update) |
| 190 | { |
| 191 | UINT8 layout[] = { 0x00, 0x4f, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49, 0x48, 0x47, 0x40, 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37 }; |
| 192 | //UINT8 layout[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49 }; |
| 193 | |
| 194 | for(int i=0; i<20; i++) |
| 195 | if (pos == layout[i]) |
| 196 | { |
| 197 | bitmap.pix16(line*9 + y, i*6 + x) = state; |
| 198 | break; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | static ADDRESS_MAP_START(pc1000_mem, AS_PROGRAM, 8, pc1000_state) |
| 203 | ADDRESS_MAP_UNMAP_HIGH |
| 204 | AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("bios", 0x00000) |
| 205 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 206 | AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("cart", 0x00000) //0x8000 - 0xbfff tests a cartridge, header is 0x55 0xaa 0x33, if it succeeds a jump at 0x8010 occurs |
| 207 | AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1") |
| 208 | ADDRESS_MAP_END |
| 209 | |
| 210 | static ADDRESS_MAP_START( pc1000_io , AS_IO, 8, pc1000_state) |
| 211 | AM_RANGE(0x0000, 0x01ff) AM_READ(kb_r) |
| 212 | AM_RANGE(0x4000, 0x4000) AM_MIRROR(0xfe) AM_READWRITE(lcdc_control_r, lcdc_control_w) |
| 213 | AM_RANGE(0x4100, 0x4100) AM_MIRROR(0xfe) AM_READWRITE(lcdc_data_r, lcdc_data_w) |
| 214 | ADDRESS_MAP_END |
| 215 | |
| 122 | 216 | /* Input ports */ |
| 123 | 217 | static INPUT_PORTS_START( pc2000 ) |
| 124 | 218 | PORT_START("IN0") |
| r21408 | r21409 | |
| 277 | 371 | PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED) |
| 278 | 372 | INPUT_PORTS_END |
| 279 | 373 | |
| 374 | static INPUT_PORTS_START( pc1000 ) |
| 375 | PORT_START("IN0") |
| 376 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SCHREIBMASCHINENKURS") PORT_CODE(KEYCODE_F1) |
| 377 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("COMPUTER-UBUNGEN") PORT_CODE(KEYCODE_F2) |
| 378 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ALLGEMEINWISSEN") PORT_CODE(KEYCODE_F3) |
| 379 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MATHE") PORT_CODE(KEYCODE_F7) |
| 380 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GESCHICHTE") PORT_CODE(KEYCODE_F4) |
| 381 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GEOGRAPHIE") PORT_CODE(KEYCODE_F5) |
| 382 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("NATURWISSENSCHAFTEN") PORT_CODE(KEYCODE_F6) |
| 383 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPIELE") PORT_CODE(KEYCODE_F8) |
| 280 | 384 | |
| 385 | PORT_START("IN1") |
| 386 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KASSETTE") PORT_CODE(KEYCODE_F9) |
| 387 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("AUS") PORT_CODE(KEYCODE_F12) |
| 388 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| 389 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) |
| 390 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?") PORT_CODE(KEYCODE_1_PAD) |
| 391 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?") PORT_CODE(KEYCODE_2_PAD) |
| 392 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?") PORT_CODE(KEYCODE_3_PAD) |
| 393 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ELEKRONIK-RECHNER") PORT_CODE(KEYCODE_F10) |
| 394 | |
| 395 | PORT_START("IN2") |
| 396 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 397 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?") PORT_CODE(KEYCODE_4_PAD) |
| 398 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xb6") PORT_CODE(KEYCODE_OPENBRACE) |
| 399 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xa4") PORT_CODE(KEYCODE_CLOSEBRACE) |
| 400 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xbc") PORT_CODE(KEYCODE_QUOTE) |
| 401 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 402 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) |
| 403 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 404 | |
| 405 | PORT_START("IN3") |
| 406 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 407 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 408 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 409 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 410 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 411 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 412 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 413 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 414 | |
| 415 | PORT_START("IN4") |
| 416 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 417 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 418 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 419 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 420 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 421 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 422 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 423 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 424 | |
| 425 | PORT_START("IN5") |
| 426 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 427 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 428 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 429 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 430 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 431 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 432 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 433 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 434 | |
| 435 | PORT_START("IN6") |
| 436 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 437 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 438 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 439 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 440 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 441 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 442 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 443 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 444 | |
| 445 | PORT_START("IN7") |
| 446 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) |
| 447 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 448 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 449 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 450 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 451 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) |
| 452 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 453 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) |
| 454 | |
| 455 | PORT_START("IN8") |
| 456 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) |
| 457 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) |
| 458 | PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED) |
| 459 | INPUT_PORTS_END |
| 460 | |
| 461 | |
| 462 | DEVICE_IMAGE_LOAD_MEMBER(pc1000_state, cart_load) |
| 463 | { |
| 464 | UINT8 *cart = memregion("cart")->base(); |
| 465 | |
| 466 | if (image.software_entry() == NULL) |
| 467 | { |
| 468 | UINT32 size = MIN(image.length(), memregion("cart")->bytes()); |
| 469 | |
| 470 | if (image.fread(cart, size) != size) |
| 471 | return IMAGE_INIT_FAIL; |
| 472 | } |
| 473 | else |
| 474 | { |
| 475 | UINT32 size = MIN(image.get_software_region_length("rom"), memregion("cart")->bytes()); |
| 476 | const char *pcb_type = image.get_feature("pcb_type"); |
| 477 | |
| 478 | if (pcb_type && !strcmp(pcb_type, "allgeme2")) |
| 479 | memcpy(cart, image.get_software_region("rom"), size >> 1); |
| 480 | else if (pcb_type && !strcmp(pcb_type, "ftrivia")) |
| 481 | memcpy(cart, image.get_software_region("rom") + (1<<16), size >> 1); |
| 482 | else |
| 483 | memcpy(cart, image.get_software_region("rom"), size); |
| 484 | } |
| 485 | |
| 486 | return IMAGE_INIT_PASS; |
| 487 | } |
| 488 | |
| 489 | |
| 281 | 490 | void pc2000_state::machine_start() |
| 282 | 491 | { |
| 283 | 492 | UINT8 *bios = memregion("bios")->base(); |
| 284 | 493 | UINT8 *cart = memregion("cart")->base(); |
| 285 | 494 | |
| 286 | | membank("bank1")->configure_entries(0, 0x10, bios, 0x4000); |
| 287 | | membank("bank2")->configure_entries(0, 0x10, bios, 0x4000); |
| 288 | | membank("bank2")->configure_entry(0x10, cart); |
| 495 | m_bank1->configure_entries(0, 0x10, bios, 0x4000); |
| 496 | m_bank2->configure_entries(0, 0x10, bios, 0x4000); |
| 497 | m_bank2->configure_entry(0x10, cart); |
| 289 | 498 | } |
| 290 | 499 | |
| 291 | 500 | void pc2000_state::machine_reset() |
| 292 | 501 | { |
| 293 | 502 | //set the initial bank |
| 294 | | membank("bank1")->set_entry(0); |
| 295 | | membank("bank2")->set_entry(0); |
| 503 | m_bank1->set_entry(0); |
| 504 | m_bank2->set_entry(0); |
| 296 | 505 | } |
| 297 | 506 | |
| 507 | void pc1000_state::machine_start() |
| 508 | { |
| 509 | UINT8 *bios = memregion("bios")->base(); |
| 510 | m_bank1->configure_entries(0, 0x08, bios, 0x4000); |
| 511 | } |
| 512 | |
| 513 | void pc1000_state::machine_reset() |
| 514 | { |
| 515 | m_bank1->set_entry(0); |
| 516 | } |
| 517 | |
| 298 | 518 | void pc2000_state::palette_init() |
| 299 | 519 | { |
| 300 | 520 | palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148)); |
| r21408 | r21409 | |
| 321 | 541 | MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) /* probably not accurate */ |
| 322 | 542 | MCFG_CPU_PROGRAM_MAP(pc2000_mem) |
| 323 | 543 | MCFG_CPU_IO_MAP(pc2000_io) |
| 324 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", pc2000_state, irq0_line_hold) |
| 544 | MCFG_CPU_PERIODIC_INT_DRIVER(pc2000_state, irq0_line_hold, 50) |
| 325 | 545 | |
| 326 | 546 | /* video hardware */ |
| 327 | 547 | MCFG_SCREEN_ADD("screen", LCD) |
| r21408 | r21409 | |
| 345 | 565 | |
| 346 | 566 | MCFG_CARTSLOT_ADD("cart") |
| 347 | 567 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 568 | MCFG_CARTSLOT_INTERFACE("pc2000_cart") |
| 348 | 569 | MCFG_CARTSLOT_NOT_MANDATORY |
| 349 | 570 | MACHINE_CONFIG_END |
| 350 | 571 | |
| 572 | static MACHINE_CONFIG_DERIVED_CLASS( misterx, pc2000, pc1000_state ) |
| 573 | /* basic machine hardware */ |
| 574 | MCFG_CPU_MODIFY("maincpu") |
| 575 | MCFG_CPU_PROGRAM_MAP(pc1000_mem) |
| 576 | MCFG_CPU_IO_MAP(pc1000_io) |
| 577 | MCFG_CPU_PERIODIC_INT_DRIVER(pc1000_state, irq0_line_hold, 10) |
| 578 | |
| 579 | /* video hardware */ |
| 580 | MCFG_SCREEN_MODIFY("screen") |
| 581 | MCFG_SCREEN_SIZE(120, 9) //1x20 chars |
| 582 | MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 9-1) |
| 583 | |
| 584 | MCFG_DEVICE_MODIFY("hd44780") |
| 585 | MCFG_HD44780_LCD_SIZE(1, 20) |
| 586 | MCFG_HD44780_PIXEL_UPDATE_CB(pc1000_pixel_update) |
| 587 | |
| 588 | MCFG_CARTSLOT_MODIFY("cart") |
| 589 | MCFG_CARTSLOT_INTERFACE("pc1000_cart") |
| 590 | MCFG_CARTSLOT_LOAD(pc1000_state, cart_load) |
| 591 | |
| 592 | /* Software lists */ |
| 593 | MCFG_SOFTWARE_LIST_ADD("cart_list", "misterx") |
| 594 | MACHINE_CONFIG_END |
| 595 | |
| 351 | 596 | /* ROM definition */ |
| 352 | 597 | ROM_START( pc2000 ) |
| 353 | | ROM_REGION( 0x40000, "bios", ROMREGION_ERASEFF ) |
| 598 | ROM_REGION( 0x40000, "bios", 0 ) |
| 354 | 599 | ROM_LOAD( "lh532hee_9344_d.u4", 0x000000, 0x040000, CRC(0b03bf33) SHA1(cb344b94b14975c685041d3e669f386e8a21909f)) |
| 355 | 600 | |
| 356 | | ROM_REGION( 0x4000, "cart", ROMREGION_ERASEFF ) |
| 357 | | ROM_CART_LOAD( "cart", 0, 0x4000, 0 ) |
| 601 | ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF ) |
| 602 | ROM_CART_LOAD( "cart", 0, 0x40000, 0 ) |
| 358 | 603 | ROM_END |
| 359 | 604 | |
| 605 | ROM_START( misterx ) |
| 606 | ROM_REGION( 0x20000, "bios", 0 ) |
| 607 | ROM_LOAD( "27-00882-001.bin", 0x000000, 0x020000, CRC(30e0dc94) SHA1(2f4675746a41399b3d9e3e8001a9b4a0dcc5b620)) |
| 608 | |
| 609 | ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF ) |
| 610 | ROM_END |
| 611 | |
| 360 | 612 | /* Driver */ |
| 361 | 613 | |
| 362 | 614 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 615 | COMP( 1988, misterx, 0, 0, misterx, pc1000, driver_device, 0, "Video Technology / Yeno", "MisterX", GAME_NOT_WORKING) |
| 363 | 616 | COMP( 1993, pc2000, 0, 0, pc2000, pc2000, driver_device, 0, "Video Technology", "PreComputer 2000", GAME_NOT_WORKING) |