Previous 15994 Revisions Next

r15659 Tuesday 24th July, 2012 at 08:28:47 UTC by Jonathan Gevaryahu
VK100: figured out bits 3,2,1 of SOPS register and implemented blinking and documented serial multiplexer based on these findings. Also fixed a stupid bug in the display code which broke the reverse video bit. [Lord Nightmare]
[src/mess/drivers]vk100.c

src/mess/drivers/vk100.c
r15658r15659
66        28/07/2009 added Guru-readme(TM)
77
88        Todo:
9              handle blink attribute in the vram display renderer
10              * figure out the timing for this, framewise
11                guessing its some power of 2 vblanks clocking a j/k flipflop
129              * fix vector generator hardware enough to pass the startup self test
10                the tests are described on page 6-5 thru 6-8 of the tech reference
1311              * note that since two proms aren't dumped yet some stuff will have to be HLE'd for now
1412                btw, dump those two proms from andy's board
15              * figure out the remaining 3 bits in the SOPS register.
16                two control the 8251 serial hookup, but what does the third do?
1713              * figure out the correct meaning of systat b register
1814              * figure out how the dipswitches get read, they're hooked up wrong
1915              * hook up baud generator to i8251 rx and tx clocks
r15658r15659
345341}
346342
347343/* port 0x45: "SOPS" screen options
348 * Blink --Background color--  ?     Serial Select?  Reverse
349 * Enable Green  Red    Blue   ?      ?      ?      BG/FG
344 * Blink --Background color--  Blink Serial Select  Reverse
345 * Enable Green  Red    Blue   Control              BG/FG
350346 * d7     d6     d5     d4     d3     d2     d1     d0
351347 * apparently, 00 = rs232/eia, 01 = 20ma, 10 = hardcopy, 11 = test/loopback
352348 */
353349WRITE8_MEMBER(vk100_state::vgSOPS)
354350{
351   static const char *const serialDest[4] = { "EIA232", "20ma", "Hardcopy", "Loopback/test" };
355352   m_vgSOPS = data;
356#ifdef VG40_VERBOSE
357   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);
358#endif
353//#ifdef VG40_VERBOSE
354   logerror("VG: 0x45: SOPS Reg loaded with %02X: Background KGRB: %d%d%d%d, Blink: %d, Serial select: %s, 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>>3)&1, serialDest[(m_vgSOPS>>1)&3], m_vgSOPS&1);
355//#endif
359356}
360357
361358/* port 0x46: "PAT" load vg Pattern register */
r15658r15659
828825{
829826   static const UINT32 colorTable[16] = {
830827   0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF,
831   0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF };
828   0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF };
829   static const UINT32 colorTable2[16] = {
830   0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF,
831   0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 };
832832   //printf("y=%d, ma=%04x, ra=%02x, x_count=%02x ", y, ma, ra, x_count);
833833   /* figure out ram address based on tech manual page 5-23:
834834    * real address to 16-bit chunk a13  a12  a11 a10 a9  a8  a7  a6  a5  a4  a3  a2  a1  a0
835835    * crtc input                  MA11 MA10 MA9 MA8 MA7 MA6 RA1 RA0 MA5 MA4 MA3 MA2 MA1 MA0
836836    */
837837   vk100_state *state = device->machine().driver_data<vk100_state>();
838   //UINT8 *gfx = device->machine.root_device().memregion("vram")->base();
839838   UINT16 EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F);
840839   // display the 64 different 12-bit-wide chunks
841840   for (int i = 0; i < 64; i++)
842841   {
843      UINT16 block = state->m_vram[(EA<<1)+(2*i)+1] | (state->m_vram[(EA<<1)+(2*i)]<<8); // store big endian
844      UINT8 fgColor = (block&0xF000)>>12;
845      // TODO: blink is NOT HANDLED YET!
846      UINT8 bgColor = (state->m_vgSOPS&0xF0)>>4;
842      UINT16 block = state->m_vram[(EA<<1)+(2*i)+1] | (state->m_vram[(EA<<1)+(2*i)]<<8);
843      UINT32 fgColor = (state->m_vgSOPS&0x08)?colorTable[(block&0xF000)>>12]:colorTable2[(block&0xF000)>>12];
844      UINT32 bgColor = (state->m_vgSOPS&0x08)?colorTable[(state->m_vgSOPS&0xF0)>>4]:colorTable2[(state->m_vgSOPS&0xF0)>>4];
847845      // display a 12-bit wide chunk
848846      for (int j = 0; j < 12; j++)
849847      {
850         bitmap.pix32(y, (12*i)+j) = ((block&(0x0001<<j))^(state->m_vgSOPS&1))?colorTable[fgColor]:colorTable[bgColor];
848         bitmap.pix32(y, (12*i)+j) = (((block&(0x0001<<j))?1:0)^(state->m_vgSOPS&1))?fgColor:bgColor;
851849      }
852850   }
853851}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team