Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. UINT16 addr = tms.nametbl + ( ( y & 0xF8 ) << 2 );
  2.  
  3. // for ( INT32 x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr+=2 )
  4. for ( UINT32 x = 0; x < 32; x++, addr++, p+=4 )
  5. {
  6. UINT8 charcode = readvmem( addr );
  7. UINT8 pattern = readvmem( tms.pattern + ( charcode << 3 ) + ( y & 7 ) );
  8. UINT8 colour = readvmem( tms.colour + ( charcode >> 3 ) );
  9. UINT32 bg = colour & 0x0f;
  10. UINT32 tab[4];
  11.  
  12. tab[0]=bg|bg<<4;
  13.  
  14. if(pattern!=0)
  15. {
  16. UINT32 fg = colour >> 4;
  17. tab[1] = fg|(*tab&0xf0);
  18. tab[2] = colour;
  19. tab[3] = fg|(colour&0xf0);
  20.  
  21. p[0] = tab[(pattern>>6)&3];
  22. p[1] = tab[(pattern>>4)&3];
  23. p[2] = tab[(pattern>>2)&3];
  24. p[3] = tab[(pattern>>0)&3];
  25. }
  26. else
  27. p[0] = p[1] = p[2] = p[3] = *tab;
  28. }
  29. }
  30. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement