Advertisement
Guest User

Untitled

a guest
Jun 25th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. void UpdateScreen(void)
  2. {
  3. if (mode == CHIP8_SCREEN)
  4. {
  5. int screen_x = LCD_WIDTH_PX/2 - CHIP8scaleFactor*(64/2);
  6. int screen_y = LCD_HEIGHT_PX/2 - CHIP8scaleFactor*(32/2);
  7. for (int x = 0; x < 64; x++)
  8. {
  9. for(int y = 0; y < 32; y++)
  10. {
  11. if (CHIP8screen[64*y+x])
  12. CopySprite(CHIP8PixelOn,screen_x+(x*CHIP8scaleFactor),screen_y+(y*CHIP8scaleFactor),CHIP8scaleFactor,CHIP8scaleFactor);
  13. }
  14. }
  15. }
  16. else
  17. {
  18. int screen_x = LCD_WIDTH_PX/2 - SCHIP8scaleFactor*(128/2);
  19. int screen_y = LCD_HEIGHT_PX/2 - SCHIP8scaleFactor*(64/2);
  20. for (int x = 0; x < 128; x++)
  21. {
  22. for(int y = 0; y < 64; y++)
  23. {
  24. if (SCHIP8screen[128*y+x])
  25. CopySprite(SCHIP8PixelOn,screen_x+(x*SCHIP8scaleFactor),screen_y+(y*SCHIP8scaleFactor),SCHIP8scaleFactor,SCHIP8scaleFactor);
  26. }
  27. }
  28. }
  29. Bdisp_PutDisp_DD();
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement