Previous 15994 Revisions Next

r15791 Tuesday 7th August, 2012 at 08:33:06 UTC by Jonathan Gevaryahu
VK100: further comment updates, got rid of LASTVRAM in favor of doing a single read at the current nybble pointed to by the X and Y registers. [Lord Nightmare]
[src/mess/drivers]vk100.c

src/mess/drivers/vk100.c
r15790r15791
2727http://web.archive.org/web/20091015205827/http://www.computer.museum.uq.edu.au/pdf/EK-VK100-TM-001%20VK100%20Technical%20Manual.pdf
2828Installation and owner's manual is at:
2929http://www.bitsavers.org/pdf/dec/terminal/gigi/EK-VK100-IN-002_GIGI_Terminal_Installation_and_Owners_Manual_Apr81.pdf
30An enormous amount of useful info can be derived from the VT125 technical manual:
31http://www.bitsavers.org/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf starting on page 6-70, pdf page 316
32And its schematics:
33http://bitsavers.org/pdf/dec/terminal/vt125/MP01053_VT125_Mar82.pdf
3034
3135PCB Layout
3236----------
r15790r15791
164168   UINT8 m_vgWOPS;
165169   UINT8 m_BAUD;
166170   UINT8 m_VG_MODE;
167   UINT8 m_LASTVRAM;
168171   UINT8 m_vgGO;
169172
170173   DECLARE_WRITE8_MEMBER(vgLD_X);
r15790r15791
195198     * so:
196199     * vram: a14 a13 a12 | a11 a10 a9  a8 | a7  a6  a5  a4 | a3  a2  a1  a0
197200     * vg:   Y8  Y7  Y6  | Y5  Y4  Y3  Y2 | Y1  X9' X8' X7'| X6' X5' X4'(x3') x2' x1 x0
198     *     X3' is handled by the nybblenum statement, as is X2'
201     *     X3' is handled by the nybbleNum statement, as is X2'
199202     *     X1 and X0 are handled by the pattern rom directly:
200203     *     x0 -> a0, x1 -> a1
201204     *     this handles bits like:
r15790r15791
204207     *      0  1 -> bit 1
205208     *      1  0 -> bit 2
206209     *      1  1 -> bit 3
207     *
208210     */
209211
210212// returns one nybble from vram array based on X and Y regs
211213static UINT8 vram_read(running_machine &machine)
212214{
213215   vk100_state *state = machine.driver_data<vk100_state>();
214    // XFinal is (X'&0x3FC)|(X&0x3)
216   // XFinal is (X'&0x3FC)|(X&0x3)
215217   UINT16 XFinal = state->m_trans[(state->m_vgX&0x3FC)>>2]<<2|(state->m_vgX&0x3); // appears correct
216    // EA is the effective ram address for a 16-bit block
218   // EA is the effective ram address for a 16-bit block
217219   UINT16 EA = ((state->m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct
218    // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte)
220   // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte)
219221   UINT16 block = state->m_vram[(EA<<1)+1] | (state->m_vram[(EA<<1)]<<8);
220    // pattern rom addressing is a complex mess. see the pattern rom def later in this file.
221   UINT8 nybbleNum = (XFinal&0xC)>>2; // which of the four nybbles within the block to address. should NEVER be 3!
222   // nybbleNum is which of the four nybbles within the block to address. should NEVER be 3!
223   UINT8 nybbleNum = (XFinal&0xC)>>2;
222224   return (block>>(4*nybbleNum))&0xF;
223225}
224226
225227static void vram_write(running_machine &machine, UINT8 data)
226228{
227229   vk100_state *state = machine.driver_data<vk100_state>();
228    // XFinal is (X'&0x3FC)|(X&0x3)
230   // XFinal is (X'&0x3FC)|(X&0x3)
229231   UINT16 XFinal = state->m_trans[(state->m_vgX&0x3FC)>>2]<<2|(state->m_vgX&0x3); // appears correct
230    // EA is the effective ram address for a 16-bit block
232   // EA is the effective ram address for a 16-bit block
231233   UINT16 EA = ((state->m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct
232    // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte)
234   // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte)
233235   UINT16 block = state->m_vram[(EA<<1)+1] | (state->m_vram[(EA<<1)]<<8);
234    // pattern rom addressing is a complex mess. see the pattern rom def later in this file.
235   UINT8 nybbleNum = (XFinal&0xC)>>2; // which of the four nybbles within the block to address. should NEVER be 3!
236   // nybbleNum is which of the four nybbles within the block to address. should NEVER be 3!
237   UINT8 nybbleNum = (XFinal&0xC)>>2;
236238   block &= ~((UINT16)0xF<<(nybbleNum*4)); // mask out the part we want to replace
237239   block |= data<<(nybbleNum*4); // write the new part
238240   // NOTE: this next part may have to be made conditional on VG_MODE
r15790r15791
246248{
247249   vk100_state *state = machine.driver_data<vk100_state>();
248250   UINT8 thisNyb = vram_read(machine); // read in the nybble
249   state->m_LASTVRAM = thisNyb;
251   // pattern rom addressing is a complex mess. see the pattern rom def later in this file.   
250252   UINT8 newNyb = state->m_pattern[((state->m_vgPAT&state->m_vgPAT_Mask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb]; // calculate new nybble based on pattern rom
251253   // finally write the block back to ram depending on the VG_MODE (sort of a hack until we get the vector and synd and dir roms all hooked up)
252254   switch (state->m_VG_MODE)
r15790r15791
273275         state->m_vgGO = 0; // done
274276         break;
275277   }
276   // direction rom:
277   
278   /* this is the "DIRECTION ROM"  == mb6309 (256x8, 82s135)
279     * see figure 5-24 on page 5-39
280     * It tells the direction and enable for counting on the X and Y counters
281     * and also handles the non-math related parts of the bresenham line algorithm
282     * control bits:
283     *            /CE1 ----- ? ENA ERROR L?
284     *            /CE2 ----- ? D COUNT 0?
285     * addr bits: 76543210
286     *            ||||\\\\-- DIR (vgDIR register low 4 bits)
287     *            |||\------ ERROR CARRY (strobed in by STROBE L from the error counter's adder)
288     *            ||\------- Y0 (the otherwise unused lsb of the Y register, used for bresenham)
289     *            |\-------- feedback bit from d5 gated by V CLK
290     *            \--------- GND; the second half of the prom is blank (0x00)
291     * data bits: 76543210
292     *            |||||||\-- ENA X (enables change on X counter)
293     *            ||||||\--- ENA Y (enables change on Y counter)
294     *            |||||\---- Y DIRECTION (high is count down, low is count up)
295     *            ||||\----- X DIRECTION (high is count down, low is count up)
296     *            |||\------ PIXEL WRT
297     *            ||\------- feedback bit to a6
298     *            |\-------- UNUSED, always 0
299     *            \--------- UNUSED, always 0
300     */
301   //UINT8 direction_rom = state->m_dir[];
278302   // HACK: we need the proper direction rom dump for this!
279303   switch(state->m_vgDIR&0x7)
280304   {
r15790r15791
507531#ifdef SYSTAT_A_VERBOSE
508532   if (cpu_get_pc(m_maincpu) != 0x31D) logerror("0x%04X: SYSTAT_A Read!\n", cpu_get_pc(m_maincpu));
509533#endif
510   if (m_vgGO == 0) m_LASTVRAM = vram_read(machine());
511   return ((m_vgGO?0:1)<<7)|(m_LASTVRAM<<3)|(((ioport("SWITCHES")->read()>>dipswitchLUT[offset])&1)?0x4:0)|0x3;
534   return ((m_vgGO?0:1)<<7)|(vram_read(machine())<<3)|(((ioport("SWITCHES")->read()>>dipswitchLUT[offset])&1)?0x4:0)|0x3;
512535}
513536
514537/* port 0x48: "SYSTAT B"; NOT documented in the tech manual at all.
r15790r15791
766789   state->m_vgWOPS = 0;
767790   state->m_BAUD = 0;
768791   state->m_VG_MODE = 0;
769   state->m_LASTVRAM = 0xF;
770792   state->m_vgGO = 0;
771793}
772794
r15790r15791
931953   ROM_REGION(0x100, "trans", ROMREGION_ERASEFF )
932954   // this is the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135)
933955   // 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
934   ROM_LOAD( "wb---0_060b1.6309.pr2.ic77", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
956   // The VT125 prom @ E60 is literally identical to this, the same exact part: 23-060B1
957   ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic77", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
935958
936959   ROM_REGION(0x100, "dir", ROMREGION_ERASEFF )
937960     /* this is the "DIRECTION ROM"  == mb6309 (256x8, 82s135)
r15790r15791
956979     *            ||\------- feedback bit to a6
957980     *            |\-------- UNUSED, always 0
958981     *            \--------- UNUSED, always 0
982     * The VT125 prom @ E41 is literally identical to this, the same exact part: 23-059B1
959983     */
960984   ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic108", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465))  // label verified from andy's board
961985
962986   ROM_REGION( 0x400, "proms", ROMREGION_ERASEFF )
963   /* some sort of "COUNTER ROM" involved with erasing VRAM dram to the background color? (256*4, 82s129)
987   /* this is the "RAS/ERASE ROM" involved with erasing VRAM dram to the background color and driving the RAS lines (256*4, 82s129)
964988     * control bits:
965989     *            /CE1 ----- ?
966990     *            /CE2 ----- ?
r15790r15791
974998     *            |\-------- ?
975999     *            \--------- comes from the gated ERASE L/d5 on the vector rom [verified from tracing]
9761000     * data bits: 3210
977     *            |||\-- ?
978     *            ||\--- ?
979     *            |\---- ?
980     *            \----- ?
1001     *            |||\-- ? wr_1?
1002     *            ||\--- ? wr_2?
1003     *            |\---- ? wr_3?
1004     *            \----- ? wr_4?
1005     * According to the VT125 Schematics, the inputs are:
1006     *  (X'10 NOR X'11)
1007     *  (Y9 NOR Y10)
1008     *  Y11
1009     *  X8 (aka PX8)
1010     *  X9 (aka PX9)
1011     *  ERASE L - a7
1012     *  X'3
1013     *  X'2
1014     * and the outputs are:
1015     *  MWR 2
1016     *  MWR 1
1017     *  MWR 0
1018     * since the vt125 has ram laid out differently than the vk100 and
1019       only has 3 banks (but 2 planes of 3 banks), I (LN) assume there
1020       are four wr banks on the v100, one per nybble, and the X'3 and
1021       X'2 inputs lend credence to this.
1022     * The VT125 prom E93 is mostly equivalent to the ras/erase prom
9811023     */
982   ROM_LOAD( "wb8151_573a2.6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
1024   ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
9831025   /* this is the "VECTOR ROM" (256*8, 82s135) which runs the vector generator state machine
9841026     * the vector rom bits are complex and are unfortunately poorly documented
9851027     * in the tech manual. see figure 5-23.
r15790r15791
9991041     *            |||||\---- ? vector clk
10001042     *            ||||\----- /LD ERROR aka STROBE ERROR L (strobes the adder result value into the vgERR register)
10011043     *            |||\------ ? done l?
1002     *            ||\------- ERASE L (latched, forces a4 on the sync rom low and also forces a7 on the counter rom; the counter rom may be involved in blanking all of vram) [verified from tracing]
1044     *            ||\------- ERASE L (latched, forces a4 on the sync rom low and also forces a7 on the ras/erase rom; the counter rom may be involved in blanking all of vram) [verified from tracing]
10031045     *            |\-------- C0 aka C IN (high during DVM read, low otherwise, likely a carry in to the adder so DVM is converted from 1s to 2s complement)
10041046     *            \--------- ?D LOAD? (goes to the clock of a d-latch near the register file)
10051047     *
r15790r15791
10141056     * STROBE ERROR L - d3
10151057     *
10161058     * it is possible d2 or d1 is the SYNC bit instead of one of the above
1017     * The VT125 prom E71 and its latch E70 is exactly equivalent to the vector prom
1059     * The VT125 prom E71 and its latch E70 is mostly equivalent to the vector prom, but the address order is different
10181060     */
1019   ROM_LOAD( "wb8146_058b1.6309.pr1.ic99", 0x0100, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf))  // label verified from nigwil's and andy's board
1061   ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0100, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf))  // label verified from nigwil's and andy's board
10201062   /* this is the "SYNC ROM" == mb6331 (32x8, 82s123)
10211063     * It generates the ram RAS/CAS and a few other signals, see figure 5-20 on page 5-32
10221064     * The exact pins for each signal are not documented.
r15790r15791
10381080     *            |||\------ /CAS (for vram)
10391081     *            ||\------- RA\__selects which slot of the 8x4 register file (du, dvm, dir, or wops) is selected
10401082     *            |\-------- RB/
1041     *            \--------- VG vector rom "enable"? (mentioned on page 5-31 last paragraph?) (this is off by one cycle though...) [active low, sync addr 011]
1042     *                       This may actually have to do with gating the DCNT DONE L signal to make the FINISH signal which unsets the /GO register
1043     * The VT125 proms E64/E66 and their respective latches E65 and E83 are roughly
1044     * but not completely equivalent to the sync rom
1083     *            \--------- SYNC (latches the EXECUTE signal from an EXEC * write to activate the GO signal and enable the Vector rom)
1084     * The VT125 proms E64/E66 and their respective latches E65 and E83 are mostly equivalent to the sync rom
10451085     */
10461086   ROM_LOAD( "wb8014_297a1.74s288.pr6.ic89", 0x0200, 0x0020, CRC(e2f7c566) SHA1(a4c3dc5d07667141ad799168a862cb3c489b4934)) // label verified from nigwil's and andy's board
10471087ROM_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team