ppu.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * PPU emulation - The TI-NESulator Project
  3. * ppu.h
  4. *
  5. * Define and emulate the PPU (Picture Processing Unit) of the real NES
  6. *
  7. * Created by Manoel TRAPIER.
  8. * Copyright (c) 2003-2007 986Corp. All rights reserved.
  9. *
  10. * $LastChangedDate: 2007-04-26 18:47:34 +0200 (jeu, 26 avr 2007) $
  11. * $Author: mtrapier $
  12. * $HeadURL: file:///media/HD6G/SVNROOT/trunk/TI-NESulator/src/ppu.h $
  13. * $Revision: 46 $
  14. *
  15. */
  16. #ifndef PPU_H
  17. #define PPU_H
  18. #include <types.h>
  19. typedef struct PPU_Sprite_
  20. {
  21. byte y;
  22. byte tileid;
  23. byte flags;
  24. byte x;
  25. } PPU_Sprite;
  26. /*
  27. PPU must be initialized after memory initialisation..
  28. */
  29. int ppu_init();
  30. int ppu_hblank(int scanline);
  31. byte ppu_readReg(byte id);
  32. void ppu_writeReg(byte id, byte val);
  33. void ppu_fillSprRamDMA(byte value);
  34. #define PPU_MIRROR_HORIZTAL 0
  35. #define PPU_MIRROR_VERTICAL 1
  36. #define PPU_SCREEN_000 0
  37. #define PPU_SCREEN_400 1
  38. #define PPU_SCREEN_800 2
  39. #define PPU_SCREEN_C00 3
  40. #define PPU_SCMODE_SINGLE 0
  41. #define PPU_SCMODE_NORMAL 1
  42. #define PPU_SCMODE_FOURSC 2
  43. void ppu_setMirroring(byte direction);
  44. void ppu_setSingleScreen(byte screen);
  45. void ppu_setScreenMode(byte mode);
  46. PPU_Sprite ppu_getSprite(unsigned short i);
  47. unsigned char ppu_memoryRead(byte page, byte addr);
  48. void ppu_memoryWrite(byte page, byte addr, byte value);
  49. void ppu_debugSprites();
  50. void ppu_debugColor();
  51. #endif