src/mess/drivers/vk100.c
| r15790 | r15791 | |
| 27 | 27 | http://web.archive.org/web/20091015205827/http://www.computer.museum.uq.edu.au/pdf/EK-VK100-TM-001%20VK100%20Technical%20Manual.pdf |
| 28 | 28 | Installation and owner's manual is at: |
| 29 | 29 | http://www.bitsavers.org/pdf/dec/terminal/gigi/EK-VK100-IN-002_GIGI_Terminal_Installation_and_Owners_Manual_Apr81.pdf |
| 30 | An enormous amount of useful info can be derived from the VT125 technical manual: |
| 31 | http://www.bitsavers.org/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf starting on page 6-70, pdf page 316 |
| 32 | And its schematics: |
| 33 | http://bitsavers.org/pdf/dec/terminal/vt125/MP01053_VT125_Mar82.pdf |
| 30 | 34 | |
| 31 | 35 | PCB Layout |
| 32 | 36 | ---------- |
| r15790 | r15791 | |
| 164 | 168 | UINT8 m_vgWOPS; |
| 165 | 169 | UINT8 m_BAUD; |
| 166 | 170 | UINT8 m_VG_MODE; |
| 167 | | UINT8 m_LASTVRAM; |
| 168 | 171 | UINT8 m_vgGO; |
| 169 | 172 | |
| 170 | 173 | DECLARE_WRITE8_MEMBER(vgLD_X); |
| r15790 | r15791 | |
| 195 | 198 | * so: |
| 196 | 199 | * vram: a14 a13 a12 | a11 a10 a9 a8 | a7 a6 a5 a4 | a3 a2 a1 a0 |
| 197 | 200 | * 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' |
| 199 | 202 | * X1 and X0 are handled by the pattern rom directly: |
| 200 | 203 | * x0 -> a0, x1 -> a1 |
| 201 | 204 | * this handles bits like: |
| r15790 | r15791 | |
| 204 | 207 | * 0 1 -> bit 1 |
| 205 | 208 | * 1 0 -> bit 2 |
| 206 | 209 | * 1 1 -> bit 3 |
| 207 | | * |
| 208 | 210 | */ |
| 209 | 211 | |
| 210 | 212 | // returns one nybble from vram array based on X and Y regs |
| 211 | 213 | static UINT8 vram_read(running_machine &machine) |
| 212 | 214 | { |
| 213 | 215 | vk100_state *state = machine.driver_data<vk100_state>(); |
| 214 | | // XFinal is (X'&0x3FC)|(X&0x3) |
| 216 | // XFinal is (X'&0x3FC)|(X&0x3) |
| 215 | 217 | 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 |
| 217 | 219 | 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) |
| 219 | 221 | 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; |
| 222 | 224 | return (block>>(4*nybbleNum))&0xF; |
| 223 | 225 | } |
| 224 | 226 | |
| 225 | 227 | static void vram_write(running_machine &machine, UINT8 data) |
| 226 | 228 | { |
| 227 | 229 | vk100_state *state = machine.driver_data<vk100_state>(); |
| 228 | | // XFinal is (X'&0x3FC)|(X&0x3) |
| 230 | // XFinal is (X'&0x3FC)|(X&0x3) |
| 229 | 231 | 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 |
| 231 | 233 | 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) |
| 233 | 235 | 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; |
| 236 | 238 | block &= ~((UINT16)0xF<<(nybbleNum*4)); // mask out the part we want to replace |
| 237 | 239 | block |= data<<(nybbleNum*4); // write the new part |
| 238 | 240 | // NOTE: this next part may have to be made conditional on VG_MODE |
| r15790 | r15791 | |
| 246 | 248 | { |
| 247 | 249 | vk100_state *state = machine.driver_data<vk100_state>(); |
| 248 | 250 | 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. |
| 250 | 252 | 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 |
| 251 | 253 | // 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) |
| 252 | 254 | switch (state->m_VG_MODE) |
| r15790 | r15791 | |
| 273 | 275 | state->m_vgGO = 0; // done |
| 274 | 276 | break; |
| 275 | 277 | } |
| 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[]; |
| 278 | 302 | // HACK: we need the proper direction rom dump for this! |
| 279 | 303 | switch(state->m_vgDIR&0x7) |
| 280 | 304 | { |
| r15790 | r15791 | |
| 507 | 531 | #ifdef SYSTAT_A_VERBOSE |
| 508 | 532 | if (cpu_get_pc(m_maincpu) != 0x31D) logerror("0x%04X: SYSTAT_A Read!\n", cpu_get_pc(m_maincpu)); |
| 509 | 533 | #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; |
| 512 | 535 | } |
| 513 | 536 | |
| 514 | 537 | /* port 0x48: "SYSTAT B"; NOT documented in the tech manual at all. |
| r15790 | r15791 | |
| 766 | 789 | state->m_vgWOPS = 0; |
| 767 | 790 | state->m_BAUD = 0; |
| 768 | 791 | state->m_VG_MODE = 0; |
| 769 | | state->m_LASTVRAM = 0xF; |
| 770 | 792 | state->m_vgGO = 0; |
| 771 | 793 | } |
| 772 | 794 | |
| r15790 | r15791 | |
| 931 | 953 | ROM_REGION(0x100, "trans", ROMREGION_ERASEFF ) |
| 932 | 954 | // this is the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135) |
| 933 | 955 | // 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 |
| 935 | 958 | |
| 936 | 959 | ROM_REGION(0x100, "dir", ROMREGION_ERASEFF ) |
| 937 | 960 | /* this is the "DIRECTION ROM" == mb6309 (256x8, 82s135) |
| r15790 | r15791 | |
| 956 | 979 | * ||\------- feedback bit to a6 |
| 957 | 980 | * |\-------- UNUSED, always 0 |
| 958 | 981 | * \--------- UNUSED, always 0 |
| 982 | * The VT125 prom @ E41 is literally identical to this, the same exact part: 23-059B1 |
| 959 | 983 | */ |
| 960 | 984 | ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic108", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465)) // label verified from andy's board |
| 961 | 985 | |
| 962 | 986 | 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) |
| 964 | 988 | * control bits: |
| 965 | 989 | * /CE1 ----- ? |
| 966 | 990 | * /CE2 ----- ? |
| r15790 | r15791 | |
| 974 | 998 | * |\-------- ? |
| 975 | 999 | * \--------- comes from the gated ERASE L/d5 on the vector rom [verified from tracing] |
| 976 | 1000 | * 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 |
| 981 | 1023 | */ |
| 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 |
| 983 | 1025 | /* this is the "VECTOR ROM" (256*8, 82s135) which runs the vector generator state machine |
| 984 | 1026 | * the vector rom bits are complex and are unfortunately poorly documented |
| 985 | 1027 | * in the tech manual. see figure 5-23. |
| r15790 | r15791 | |
| 999 | 1041 | * |||||\---- ? vector clk |
| 1000 | 1042 | * ||||\----- /LD ERROR aka STROBE ERROR L (strobes the adder result value into the vgERR register) |
| 1001 | 1043 | * |||\------ ? 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] |
| 1003 | 1045 | * |\-------- 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) |
| 1004 | 1046 | * \--------- ?D LOAD? (goes to the clock of a d-latch near the register file) |
| 1005 | 1047 | * |
| r15790 | r15791 | |
| 1014 | 1056 | * STROBE ERROR L - d3 |
| 1015 | 1057 | * |
| 1016 | 1058 | * 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 |
| 1018 | 1060 | */ |
| 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 |
| 1020 | 1062 | /* this is the "SYNC ROM" == mb6331 (32x8, 82s123) |
| 1021 | 1063 | * It generates the ram RAS/CAS and a few other signals, see figure 5-20 on page 5-32 |
| 1022 | 1064 | * The exact pins for each signal are not documented. |
| r15790 | r15791 | |
| 1038 | 1080 | * |||\------ /CAS (for vram) |
| 1039 | 1081 | * ||\------- RA\__selects which slot of the 8x4 register file (du, dvm, dir, or wops) is selected |
| 1040 | 1082 | * |\-------- 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 |
| 1045 | 1085 | */ |
| 1046 | 1086 | ROM_LOAD( "wb8014_297a1.74s288.pr6.ic89", 0x0200, 0x0020, CRC(e2f7c566) SHA1(a4c3dc5d07667141ad799168a862cb3c489b4934)) // label verified from nigwil's and andy's board |
| 1047 | 1087 | ROM_END |