Previous 15994 Revisions Next

r15641 Sunday 22nd July, 2012 at 07:37:42 UTC by Jonathan Gevaryahu
VK100: preliminary direction support for basic vectors. doesn't quite work right yet. [Lord Nightmare]
[src/mess/drivers]vk100.c

src/mess/drivers/vk100.c
r15640r15641
210210      UINT16 blockRemain = 0;
211211      switch(nybbleNum)
212212      {
213         case 2: // modify the left nybble only (from the first byte)
213         case 2: // modify the right nybble only (from the first byte)
214214            thisNyb = (block&0x0F00)>>8;
215215            blockRemain = (block&0xF0FF); // save the rest of the block
216216            thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb];
217217            state->m_LASTVRAM = thisNyb;
218218            block = blockRemain | (thisNyb<<8);
219219            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)
221221            thisNyb = (block&0x00F0)>>4;
222222            blockRemain = (block&0xFF0F); // save the rest of the block
223223            thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb];
224224            state->m_LASTVRAM = thisNyb;
225225            block = blockRemain | (thisNyb<<4);
226226            break;
227         case 0: // modify the left nybble of the second byte
227         case 0: // modify the right nybble only (from the second byte)
228228            thisNyb = (block&0x000F);
229229            blockRemain = (block&0xFFF0); // save the rest of the block
230230            thisNyb = state->m_pattern[((state->m_vgPAT&PATMask)?0x200:0)|((state->m_vgWOPS&7)<<6)|((state->m_vgX&3)<<4)|thisNyb];
r15640r15641
240240      // finally write the block back to ram
241241      state->m_vram[(EA<<1)+1] = block&0xFF;
242242      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      }
245275      //printf("VG state: EA: %d, lastvram: %d, curvram: %d, pmulcount: %d
246276      if (((++state->m_vgPMUL_Count)&0xF)==0) { // if pattern multiplier counter overflowed
247277         state->m_vgPMUL_Count = state->m_vgPMUL; // reload counter
r15640r15641
725755
726756static DRIVER_INIT( vk100 )
727757{
728   UINT8 *gfx = machine.root_device().memregion("vram")->base();
758   /*UINT8 *gfx = machine.root_device().memregion("vram")->base();
729759   // for debug purposes, set the entire screen to a hash pattern
730760   for (int i = 0; i < 0x8000; i+=2)
731761   {
732762      gfx[i] = 0xFA;
733763      gfx[i+1] = 0xAA;
734764      //gfx[i] = (((i&0x1)?0x00:0xFF)^((i&0x100)?0x00:0xff));
735   }
765   }*/
736766}
737767
738768static PALETTE_INIT( vk100 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team