src/mess/drivers/vk100.c
| r15658 | r15659 | |
| 6 | 6 | 28/07/2009 added Guru-readme(TM) |
| 7 | 7 | |
| 8 | 8 | 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 |
| 12 | 9 | * 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 |
| 13 | 11 | * note that since two proms aren't dumped yet some stuff will have to be HLE'd for now |
| 14 | 12 | 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? |
| 17 | 13 | * figure out the correct meaning of systat b register |
| 18 | 14 | * figure out how the dipswitches get read, they're hooked up wrong |
| 19 | 15 | * hook up baud generator to i8251 rx and tx clocks |
| r15658 | r15659 | |
| 345 | 341 | } |
| 346 | 342 | |
| 347 | 343 | /* 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 |
| 350 | 346 | * d7 d6 d5 d4 d3 d2 d1 d0 |
| 351 | 347 | * apparently, 00 = rs232/eia, 01 = 20ma, 10 = hardcopy, 11 = test/loopback |
| 352 | 348 | */ |
| 353 | 349 | WRITE8_MEMBER(vk100_state::vgSOPS) |
| 354 | 350 | { |
| 351 | static const char *const serialDest[4] = { "EIA232", "20ma", "Hardcopy", "Loopback/test" }; |
| 355 | 352 | 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 |
| 359 | 356 | } |
| 360 | 357 | |
| 361 | 358 | /* port 0x46: "PAT" load vg Pattern register */ |
| r15658 | r15659 | |
| 828 | 825 | { |
| 829 | 826 | static const UINT32 colorTable[16] = { |
| 830 | 827 | 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 }; |
| 832 | 832 | //printf("y=%d, ma=%04x, ra=%02x, x_count=%02x ", y, ma, ra, x_count); |
| 833 | 833 | /* figure out ram address based on tech manual page 5-23: |
| 834 | 834 | * real address to 16-bit chunk a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 |
| 835 | 835 | * crtc input MA11 MA10 MA9 MA8 MA7 MA6 RA1 RA0 MA5 MA4 MA3 MA2 MA1 MA0 |
| 836 | 836 | */ |
| 837 | 837 | vk100_state *state = device->machine().driver_data<vk100_state>(); |
| 838 | | //UINT8 *gfx = device->machine.root_device().memregion("vram")->base(); |
| 839 | 838 | UINT16 EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F); |
| 840 | 839 | // display the 64 different 12-bit-wide chunks |
| 841 | 840 | for (int i = 0; i < 64; i++) |
| 842 | 841 | { |
| 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]; |
| 847 | 845 | // display a 12-bit wide chunk |
| 848 | 846 | for (int j = 0; j < 12; j++) |
| 849 | 847 | { |
| 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; |
| 851 | 849 | } |
| 852 | 850 | } |
| 853 | 851 | } |