Previous 15994 Revisions Next

r15635 Friday 20th July, 2012 at 11:07:20 UTC by Jonathan Gevaryahu
VK100: WIP: preliminary gfx rendering; hooked up the i8251 interrupts. Corrected dipswitch locations. [Lord Nightmare]
[src/mess/drivers]vk100.c

src/mess/drivers/vk100.c
r15634r15635
66        28/07/2009 added Guru-readme(TM)
77
88        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
1212
1313 Tony DiCenzo, now the director of standards and architecture at Oracle, was on the team that developed the VK100
1414 see http://startup.nmnaturalhistory.org/visitorstories/view.php?ii=79
r15634r15635
120120   required_device<device_t> m_speaker;
121121   required_device<device_t> m_uart;
122122
123   UINT8* m_vram;
123124   UINT16 m_vgX;
124125   UINT16 m_vgY;
125126   UINT8 m_vgERR;
r15634r15635
190191}
191192
192193/* port 0x45: "SOPS" screen options
193 * Blink --Background color--  Serial Port Select?  Reverse
194 * Blink --Background color--  ?     Serial Select?  Reverse
194195 * Enable Green  Red    Blue   ?      ?      ?      BG/FG
195196 * 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
197198 */
198199WRITE8_MEMBER(vk100_state::vgSOPS)
199200{
200201   m_vgSOPS = data;
201#ifdef VG_VERBOSE
202//#ifdef VG_VERBOSE
202203   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
204205}
205206
206207/* port 0x46: "PAT" load vg Pattern register */
r15634r15635
418419static INPUT_PORTS_START( vk100 )
419420   // the dipswitches are common ground: when open (upward) the lines are pulled to 5v, otherwise they read as 0
420421   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")
422423      PORT_DIPSETTING( 0x00, "60Hz" )
423424      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")
425426      PORT_DIPSETTING( 0x00, "20ma port" )
426427      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")
428429      PORT_DIPSETTING( 0x00, "US" )
429430      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")
431432      PORT_DIPSETTING( 0x00, "Off" )
432433      PORT_DIPSETTING( 0x10, "Even" )
433434      PORT_DIPSETTING( 0x08, "Odd" )
434435      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")
436437      PORT_DIPSETTING( 0x00, "110" )
437438      PORT_DIPSETTING( 0x80, "300" )
438439      PORT_DIPSETTING( 0x40, "600" )
r15634r15635
456457      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB)
457458      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED)
458459      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)
460461      PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
461462   PORT_START("COL2")
462463      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
r15634r15635
464465      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
465466      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("No scroll") PORT_CODE(KEYCODE_LALT)
466467      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)
468469      PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
469470   PORT_START("COL3")
470471      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
r15634r15635
472473      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
473474      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
474475      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)
476477      PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
477478   PORT_START("COL4")
478479      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
r15634r15635
480481      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
481482      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
482483      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)
484485      PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
485486   PORT_START("COL5")
486487      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
r15634r15635
597598   state->m_GO = 0;
598599}
599600
601static 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
600609static PALETTE_INIT( vk100 )
601610{
602611   int i;
603612   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);
605614}
606615
607616
608617static INTERRUPT_GEN( vk100_vertical_interrupt )
609618{
610619   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);
613622   state->m_GO = 0; // hack for now until the state machine works
614623}
615624
625static 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
631static 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
637static VIDEO_START( vk100 )
638{
639   vk100_state *state = machine.driver_data<vk100_state>();
640   state->m_vram = state->memregion("vram")->base();
641}
642
616643static MC6845_UPDATE_ROW( vk100_update_row )
617644{
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   }
619675}
620676
621677
r15634r15635
640696   DEVCB_NULL, // in_dsr_cb
641697   DEVCB_NULL, // out_dtr_cb
642698   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
645701   DEVCB_NULL, // out_txempty_cb
646702   DEVCB_NULL // out_syndet_cb
647703};
r15634r15635
657713
658714   /* video hardware */
659715   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
661717   MCFG_SCREEN_UPDATE_DEVICE( "crtc", mc6845_device, screen_update )
662718   MCFG_MC6845_ADD( "crtc", H46505, XTAL_45_6192Mhz/3/12, mc6845_intf)
663719   MCFG_PALETTE_LENGTH(8)
664720   MCFG_PALETTE_INIT(vk100)
721   MCFG_VIDEO_START(vk100) // to set m_vram pointer properly (is there a less roundabout way to do this?)
665722
666723   /* i8251 uart */
667724   MCFG_I8251_ADD("i8251", i8251_intf)
r15634r15635
708765   ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic17", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board
709766   
710767   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)
712769   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)
714771   ROM_LOAD( "wb8146_058b1.6309.pr1.ic99", 0x0100, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf))  // label verified from nigwil's and andy's board
715772   // this is definitely the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135)
716773   // 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
717774   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
719776   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
721778   ROM_LOAD( "wb8214_297a1.74s288.pr6.ic89", 0x0400, 0x0100, NO_DUMP) // label verified from nigwil's and andy's board
722779ROM_END
723780
724781/* Driver */
725782
726783/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY                       FULLNAME       FLAGS */
727COMP( 1980, vk100,  0,      0,       vk100,     vk100,   0,  "Digital Equipment Corporation", "VK100 'GIGI'", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND)
784COMP( 1980, vk100,  0,      0,       vk100,     vk100,   vk100,  "Digital Equipment Corporation", "VK100 'GIGI'", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team