src/mess/drivers/vk100.c
| r15634 | r15635 | |
| 6 | 6 | 28/07/2009 added Guru-readme(TM) |
| 7 | 7 | |
| 8 | 8 | Todo: |
| 9 | | hook up vram |
| 10 | | - vram space is now present but not hooked to anything |
| 11 | | emulate vector generator hardware |
| 9 | emulate vector generator hardware enough to write stuff to vram |
| 10 | * note that since two proms aren't dumped yet some stuff will have to be HLE'd for now |
| 11 | hook up baud generator to i8251 rx and tx clocks |
| 12 | 12 | |
| 13 | 13 | Tony DiCenzo, now the director of standards and architecture at Oracle, was on the team that developed the VK100 |
| 14 | 14 | see http://startup.nmnaturalhistory.org/visitorstories/view.php?ii=79 |
| r15634 | r15635 | |
| 120 | 120 | required_device<device_t> m_speaker; |
| 121 | 121 | required_device<device_t> m_uart; |
| 122 | 122 | |
| 123 | UINT8* m_vram; |
| 123 | 124 | UINT16 m_vgX; |
| 124 | 125 | UINT16 m_vgY; |
| 125 | 126 | UINT8 m_vgERR; |
| r15634 | r15635 | |
| 190 | 191 | } |
| 191 | 192 | |
| 192 | 193 | /* port 0x45: "SOPS" screen options |
| 193 | | * Blink --Background color-- Serial Port Select? Reverse |
| 194 | * Blink --Background color-- ? Serial Select? Reverse |
| 194 | 195 | * Enable Green Red Blue ? ? ? BG/FG |
| 195 | 196 | * d7 d6 d5 d4 d3 d2 d1 d0 |
| 196 | | * apparently, 00 = rs232/eia, 01 = 20ma, 02 = hardcopy, 03 = test/loopback on whichever 2 bits do port select |
| 197 | * apparently, 00 = rs232/eia, 01 = 20ma, 10 = hardcopy, 11 = test/loopback |
| 197 | 198 | */ |
| 198 | 199 | WRITE8_MEMBER(vk100_state::vgSOPS) |
| 199 | 200 | { |
| 200 | 201 | m_vgSOPS = data; |
| 201 | | #ifdef VG_VERBOSE |
| 202 | //#ifdef VG_VERBOSE |
| 202 | 203 | logerror("VG: 0x45: SOPS Reg loaded with %02X: Blink: %d, Background GRB: %d%d%d, Serial select: %x, Reverse BG/FG: %d\n", m_vgSOPS, (m_vgSOPS>>7)&1, (m_vgSOPS>>6)&1, (m_vgSOPS>>5)&1, (m_vgSOPS>>4)&1, (m_vgSOPS>>1)&7, m_vgSOPS&1); |
| 203 | | #endif |
| 204 | //#endif |
| 204 | 205 | } |
| 205 | 206 | |
| 206 | 207 | /* port 0x46: "PAT" load vg Pattern register */ |
| r15634 | r15635 | |
| 418 | 419 | static INPUT_PORTS_START( vk100 ) |
| 419 | 420 | // the dipswitches are common ground: when open (upward) the lines are pulled to 5v, otherwise they read as 0 |
| 420 | 421 | PORT_START("SWITCHES") |
| 421 | | PORT_DIPNAME( 0x01, 0x00, "Power Frequency" ) PORT_DIPLOCATION("SW:1") |
| 422 | PORT_DIPNAME( 0x01, 0x00, "Power Frequency" ) PORT_DIPLOCATION("SW:!1") |
| 422 | 423 | PORT_DIPSETTING( 0x00, "60Hz" ) |
| 423 | 424 | PORT_DIPSETTING( 0x01, "50Hz" ) |
| 424 | | PORT_DIPNAME( 0x02, 0x00, "Default Serial Port" ) PORT_DIPLOCATION("SW:2") |
| 425 | PORT_DIPNAME( 0x02, 0x00, "Default Serial Port" ) PORT_DIPLOCATION("SW:!2") |
| 425 | 426 | PORT_DIPSETTING( 0x00, "20ma port" ) |
| 426 | 427 | PORT_DIPSETTING( 0x02, "EIA port" ) |
| 427 | | PORT_DIPNAME( 0x04, 0x00, "Default US/UK" ) PORT_DIPLOCATION("SW:3") |
| 428 | PORT_DIPNAME( 0x04, 0x00, "Default US/UK" ) PORT_DIPLOCATION("SW:!3") |
| 428 | 429 | PORT_DIPSETTING( 0x00, "US" ) |
| 429 | 430 | PORT_DIPSETTING( 0x04, "UK" ) |
| 430 | | PORT_DIPNAME( 0x18, 0x00, "Default Parity" ) PORT_DIPLOCATION("SW:4,5") |
| 431 | PORT_DIPNAME( 0x18, 0x00, "Default Parity" ) PORT_DIPLOCATION("SW:!4,!5") |
| 431 | 432 | PORT_DIPSETTING( 0x00, "Off" ) |
| 432 | 433 | PORT_DIPSETTING( 0x10, "Even" ) |
| 433 | 434 | PORT_DIPSETTING( 0x08, "Odd" ) |
| 434 | 435 | PORT_DIPSETTING( 0x18, "Do Not Use This Setting" ) |
| 435 | | PORT_DIPNAME( 0xe0, 0xe0, "Default Baud Rate" ) PORT_DIPLOCATION("SW:6,7,8") |
| 436 | PORT_DIPNAME( 0xe0, 0xe0, "Default Baud Rate" ) PORT_DIPLOCATION("SW:!6,!7,!8") |
| 436 | 437 | PORT_DIPSETTING( 0x00, "110" ) |
| 437 | 438 | PORT_DIPSETTING( 0x80, "300" ) |
| 438 | 439 | PORT_DIPSETTING( 0x40, "600" ) |
| r15634 | r15635 | |
| 456 | 457 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) |
| 457 | 458 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 458 | 459 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Num Enter") PORT_CODE(KEYCODE_ENTER_PAD) |
| 459 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF1") PORT_CODE(KEYCODE_F1) |
| 460 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF1/Hardcopy") PORT_CODE(KEYCODE_F1) |
| 460 | 461 | PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 461 | 462 | PORT_START("COL2") |
| 462 | 463 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| r15634 | r15635 | |
| 464 | 465 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 465 | 466 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("No scroll") PORT_CODE(KEYCODE_LALT) |
| 466 | 467 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Num 1") PORT_CODE(KEYCODE_1_PAD) |
| 467 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF2") PORT_CODE(KEYCODE_F2) |
| 468 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF2/Locator") PORT_CODE(KEYCODE_F2) |
| 468 | 469 | PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 469 | 470 | PORT_START("COL3") |
| 470 | 471 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| r15634 | r15635 | |
| 472 | 473 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) |
| 473 | 474 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) |
| 474 | 475 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Num 2") PORT_CODE(KEYCODE_2_PAD) |
| 475 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF3") PORT_CODE(KEYCODE_F3) |
| 476 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF3/Text") PORT_CODE(KEYCODE_F3) |
| 476 | 477 | PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 477 | 478 | PORT_START("COL4") |
| 478 | 479 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| r15634 | r15635 | |
| 480 | 481 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 481 | 482 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) |
| 482 | 483 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Num 3") PORT_CODE(KEYCODE_3_PAD) |
| 483 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF4") PORT_CODE(KEYCODE_F4) |
| 484 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF4/Reset") PORT_CODE(KEYCODE_F4) |
| 484 | 485 | PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 485 | 486 | PORT_START("COL5") |
| 486 | 487 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| r15634 | r15635 | |
| 597 | 598 | state->m_GO = 0; |
| 598 | 599 | } |
| 599 | 600 | |
| 601 | static DRIVER_INIT( vk100 ) |
| 602 | { |
| 603 | UINT8 *gfx = machine.root_device().memregion("vram")->base(); |
| 604 | int i; |
| 605 | for (i = 0; i < 0x8000; i++) |
| 606 | gfx[i] = (((i&0x1)?0x00:0xFF)^((i&0x100)?0x00:0xff)); |
| 607 | } |
| 608 | |
| 600 | 609 | static PALETTE_INIT( vk100 ) |
| 601 | 610 | { |
| 602 | 611 | int i; |
| 603 | 612 | for (i = 0; i < 8; i++) |
| 604 | | palette_set_color_rgb( machine, i, (i&4)?0xFF:0x00, (i&2)?0xFF:0x00, (i&1)?0xFF:0x00); |
| 613 | palette_set_color_rgb( machine, i, (i&2)?0xFF:0x00, (i&4)?0xFF:0x00, (i&1)?0xFF:0x00); |
| 605 | 614 | } |
| 606 | 615 | |
| 607 | 616 | |
| 608 | 617 | static INTERRUPT_GEN( vk100_vertical_interrupt ) |
| 609 | 618 | { |
| 610 | 619 | vk100_state *state = device->machine().driver_data<vk100_state>(); |
| 611 | | device_set_input_line(device, I8085_RST75_LINE, ASSERT_LINE); |
| 612 | | device_set_input_line(device, I8085_RST75_LINE, CLEAR_LINE); |
| 620 | device_set_input_line(state->m_maincpu, I8085_RST75_LINE, ASSERT_LINE); |
| 621 | device_set_input_line(state->m_maincpu, I8085_RST75_LINE, CLEAR_LINE); |
| 613 | 622 | state->m_GO = 0; // hack for now until the state machine works |
| 614 | 623 | } |
| 615 | 624 | |
| 625 | static WRITE_LINE_DEVICE_HANDLER(i8251_rxrdy_int) |
| 626 | { |
| 627 | vk100_state *m_state = device->machine().driver_data<vk100_state>(); |
| 628 | device_set_input_line(m_state->m_maincpu, I8085_RST65_LINE, state?ASSERT_LINE:CLEAR_LINE); |
| 629 | } |
| 630 | |
| 631 | static WRITE_LINE_DEVICE_HANDLER(i8251_txrdy_int) |
| 632 | { |
| 633 | vk100_state *m_state = device->machine().driver_data<vk100_state>(); |
| 634 | device_set_input_line(m_state->m_maincpu, I8085_RST55_LINE, state?ASSERT_LINE:CLEAR_LINE); |
| 635 | } |
| 636 | |
| 637 | static VIDEO_START( vk100 ) |
| 638 | { |
| 639 | vk100_state *state = machine.driver_data<vk100_state>(); |
| 640 | state->m_vram = state->memregion("vram")->base(); |
| 641 | } |
| 642 | |
| 616 | 643 | static MC6845_UPDATE_ROW( vk100_update_row ) |
| 617 | 644 | { |
| 618 | | //fprintf(stderr,"y=%d, ma=%04x, ra=%02x, x_count=%02x\n", y, ma, ra, x_count); |
| 645 | static const UINT32 colorTable[8] = { 0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF }; |
| 646 | //printf("y=%d, ma=%04x, ra=%02x, x_count=%02x ", y, ma, ra, x_count); |
| 647 | /* figure out ram address based on tech manual page 5-23: |
| 648 | * real address to 16-bit chunk a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 |
| 649 | * crtc input MA11 MA10 MA9 MA8 MA7 MA6 RA1 RA0 MA5 MA4 MA3 MA2 MA1 MA0 |
| 650 | */ |
| 651 | vk100_state *state = device->machine().driver_data<vk100_state>(); |
| 652 | //UINT8 *gfx = device->machine.root_device().memregion("vram")->base(); |
| 653 | UINT16 EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F); |
| 654 | EA <<= 1; // this is needed to address the whole 0000-7fff area since we deal with 16 bit blocks |
| 655 | //printf("EA: %04X\n", EA); |
| 656 | // display the 64 different 12-bit-wide chunks |
| 657 | for (int i = 0; i < 64; i++) |
| 658 | { |
| 659 | UINT16 block = state->m_vram[(EA+(2*i))+1] | (state->m_vram[(EA+(2*i))]<<8); |
| 660 | UINT8 fgColor = block&7; |
| 661 | //UINT8 blink = (block&8)>>3; |
| 662 | UINT8 bgColor = (state->m_vgSOPS&0x70)>>4; |
| 663 | if (state->m_vgSOPS&1) // reverse fg/bg colors |
| 664 | { |
| 665 | UINT8 temp = fgColor; |
| 666 | fgColor = bgColor; |
| 667 | bgColor = temp; |
| 668 | } |
| 669 | // display a 12-bit wide chunk |
| 670 | for (int j = 0; j < 12; j++) |
| 671 | { |
| 672 | bitmap.pix32(y, (12*i)+j) = (block&(0x10<<j))?colorTable[fgColor]:colorTable[bgColor]; |
| 673 | } |
| 674 | } |
| 619 | 675 | } |
| 620 | 676 | |
| 621 | 677 | |
| r15634 | r15635 | |
| 640 | 696 | DEVCB_NULL, // in_dsr_cb |
| 641 | 697 | DEVCB_NULL, // out_dtr_cb |
| 642 | 698 | DEVCB_NULL, // out_rts_cb |
| 643 | | DEVCB_NULL, // out_rxrdy_cb TODO: this goes to an interrupt! |
| 644 | | DEVCB_NULL, // out_txrdy_cb TODO: this goes to an interrupt! |
| 699 | DEVCB_LINE(i8251_rxrdy_int), // out_rxrdy_cb |
| 700 | DEVCB_LINE(i8251_txrdy_int), // out_txrdy_cb |
| 645 | 701 | DEVCB_NULL, // out_txempty_cb |
| 646 | 702 | DEVCB_NULL // out_syndet_cb |
| 647 | 703 | }; |
| r15634 | r15635 | |
| 657 | 713 | |
| 658 | 714 | /* video hardware */ |
| 659 | 715 | MCFG_SCREEN_ADD("screen", RASTER) |
| 660 | | MCFG_SCREEN_RAW_PARAMS(XTAL_45_6192Mhz/3, 882, 0, 720, 370, 0, 350 ) |
| 716 | MCFG_SCREEN_RAW_PARAMS(XTAL_45_6192Mhz/3, 882, 0, 720, 370, 0, 350 ) // fake screen timings for startup until 6845 sets real ones |
| 661 | 717 | MCFG_SCREEN_UPDATE_DEVICE( "crtc", mc6845_device, screen_update ) |
| 662 | 718 | MCFG_MC6845_ADD( "crtc", H46505, XTAL_45_6192Mhz/3/12, mc6845_intf) |
| 663 | 719 | MCFG_PALETTE_LENGTH(8) |
| 664 | 720 | MCFG_PALETTE_INIT(vk100) |
| 721 | MCFG_VIDEO_START(vk100) // to set m_vram pointer properly (is there a less roundabout way to do this?) |
| 665 | 722 | |
| 666 | 723 | /* i8251 uart */ |
| 667 | 724 | MCFG_I8251_ADD("i8251", i8251_intf) |
| r15634 | r15635 | |
| 708 | 765 | ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic17", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board |
| 709 | 766 | |
| 710 | 767 | ROM_REGION( 0x10000, "proms", ROMREGION_ERASEFF ) |
| 711 | | // this is either the "SYNC ROM" or the "VECTOR ROM" which handles timing related stuff. (256*4, 82s129) |
| 768 | // not sure what this prom is, it may relate somehow to addressing or modifying vram. (256*4, 82s129) |
| 712 | 769 | ROM_LOAD( "wb8151_573a2.6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board |
| 713 | | // this is probably the "DIRECTION ROM", but might not be. (256*8, 82s135) |
| 770 | // this is probably the "SYNC ROM" since only addresses 0-6 are used within every 8 byte chunk. (256*8, 82s135) |
| 714 | 771 | ROM_LOAD( "wb8146_058b1.6309.pr1.ic99", 0x0100, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf)) // label verified from nigwil's and andy's board |
| 715 | 772 | // this is definitely the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135) |
| 716 | 773 | // it contains a table of 256 values which skips every fourth value so 00 01 02 04 05 06 08.. etc, wraps at the end |
| 717 | 774 | ROM_LOAD( "wb---0_060b1.6309.pr2.ic77", 0x0200, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board |
| 718 | | // the following == mb6309 (256x8, 82s135) // possibly direction rom |
| 775 | // the following == mb6309 (256x8, 82s135) // probably direction rom |
| 719 | 776 | ROM_LOAD( "wb8141_059b1.tbp18s22n.pr5.ic108", 0x0300, 0x0100, NO_DUMP) // label verified from andy's board |
| 720 | | // the following = mb6331 (32x8, 82s123) // possibly sync rom |
| 777 | // the following = mb6331 (32x8, 82s123) // MAYBE vector rom |
| 721 | 778 | ROM_LOAD( "wb8214_297a1.74s288.pr6.ic89", 0x0400, 0x0100, NO_DUMP) // label verified from nigwil's and andy's board |
| 722 | 779 | ROM_END |
| 723 | 780 | |
| 724 | 781 | /* Driver */ |
| 725 | 782 | |
| 726 | 783 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 727 | | COMP( 1980, vk100, 0, 0, vk100, vk100, 0, "Digital Equipment Corporation", "VK100 'GIGI'", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND) |
| 784 | COMP( 1980, vk100, 0, 0, vk100, vk100, vk100, "Digital Equipment Corporation", "VK100 'GIGI'", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND) |