src/mess/drivers/vk100.c
| r15640 | r15641 | |
| 210 | 210 | UINT16 blockRemain = 0; |
| 211 | 211 | switch(nybbleNum) |
| 212 | 212 | { |
| 213 | | case 2: // modify the left nybble only (from the first byte) |
| 213 | case 2: // modify the right nybble only (from the first byte) |
| 214 | 214 | thisNyb = (block&0x0F00)>>8; |
| 215 | 215 | blockRemain = (block&0xF0FF); // save the rest of the block |
| 216 | 216 | thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb]; |
| 217 | 217 | state->m_LASTVRAM = thisNyb; |
| 218 | 218 | block = blockRemain | (thisNyb<<8); |
| 219 | 219 | break; |
| 220 | | case 1: // modify the right nybble only (from the first byte) |
| 220 | case 1: // modify the left nybble only (from the second byte) |
| 221 | 221 | thisNyb = (block&0x00F0)>>4; |
| 222 | 222 | blockRemain = (block&0xFF0F); // save the rest of the block |
| 223 | 223 | thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb]; |
| 224 | 224 | state->m_LASTVRAM = thisNyb; |
| 225 | 225 | block = blockRemain | (thisNyb<<4); |
| 226 | 226 | break; |
| 227 | | case 0: // modify the left nybble of the second byte |
| 227 | case 0: // modify the right nybble only (from the second byte) |
| 228 | 228 | thisNyb = (block&0x000F); |
| 229 | 229 | blockRemain = (block&0xFFF0); // save the rest of the block |
| 230 | 230 | thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb]; |
| r15640 | r15641 | |
| 240 | 240 | // finally write the block back to ram |
| 241 | 241 | state->m_vram[(EA<<1)+1] = block&0xFF; |
| 242 | 242 | state->m_vram[(EA<<1)] = (block&0xFF00)>>8; |
| 243 | | state->m_vgX++;// TODO: since the direction rom is missing; the vector generator direction is FIXED rightward! |
| 244 | | //state->m_vgY++;// hack to mix stuff up a little |
| 243 | // HACK: we need the proper direction rom dump for this! |
| 244 | switch(state->m_vgDIR&0x7) |
| 245 | { |
| 246 | case 0: |
| 247 | state->m_vgX++; |
| 248 | break; |
| 249 | case 7: |
| 250 | state->m_vgX++; |
| 251 | state->m_vgY++; |
| 252 | break; |
| 253 | case 6: |
| 254 | state->m_vgY++; |
| 255 | break; |
| 256 | case 5: |
| 257 | state->m_vgX--; |
| 258 | state->m_vgY++; |
| 259 | break; |
| 260 | case 4: |
| 261 | state->m_vgX--; |
| 262 | break; |
| 263 | case 3: |
| 264 | state->m_vgX--; |
| 265 | state->m_vgY--; |
| 266 | break; |
| 267 | case 2: |
| 268 | state->m_vgY--; |
| 269 | break; |
| 270 | case 1: |
| 271 | state->m_vgX++; |
| 272 | state->m_vgY--; |
| 273 | break; |
| 274 | } |
| 245 | 275 | //printf("VG state: EA: %d, lastvram: %d, curvram: %d, pmulcount: %d |
| 246 | 276 | if (((++state->m_vgPMUL_Count)&0xF)==0) { // if pattern multiplier counter overflowed |
| 247 | 277 | state->m_vgPMUL_Count = state->m_vgPMUL; // reload counter |
| r15640 | r15641 | |
| 725 | 755 | |
| 726 | 756 | static DRIVER_INIT( vk100 ) |
| 727 | 757 | { |
| 728 | | UINT8 *gfx = machine.root_device().memregion("vram")->base(); |
| 758 | /*UINT8 *gfx = machine.root_device().memregion("vram")->base(); |
| 729 | 759 | // for debug purposes, set the entire screen to a hash pattern |
| 730 | 760 | for (int i = 0; i < 0x8000; i+=2) |
| 731 | 761 | { |
| 732 | 762 | gfx[i] = 0xFA; |
| 733 | 763 | gfx[i+1] = 0xAA; |
| 734 | 764 | //gfx[i] = (((i&0x1)?0x00:0xFF)^((i&0x100)?0x00:0xff)); |
| 735 | | } |
| 765 | }*/ |
| 736 | 766 | } |
| 737 | 767 | |
| 738 | 768 | static PALETTE_INIT( vk100 ) |