12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * PPU emulation - The peTI-NESulator Project
- * ppu.h
- *
- * Define and emulate the PPU (Picture Processing Unit) of the real NES
- *
- * Created by Manoël Trapier.
- * Copyright (c) 2002-2019 986-Studio.
- *
- */
- #ifndef PPU_H
- #define PPU_H
- #include <types.h>
- typedef struct PPU_Sprite_
- {
- uint8_t y;
- uint8_t tileid;
- uint8_t flags;
- uint8_t x;
- } PPU_Sprite;
- /*
- PPU must be initialized after memory initialisation..
- */
- int ppu_init();
- int ppu_hblank(uint16_t scanline);
- uint8_t ppu_readReg(uint8_t id);
- void ppu_writeReg(uint8_t id, uint8_t val);
- void ppu_fillSprRamDMA(uint8_t value);
- #define PPU_MIRROR_HORIZTAL 0
- #define PPU_MIRROR_VERTICAL 1
- #define PPU_SCREEN_000 0
- #define PPU_SCREEN_400 1
- #define PPU_SCREEN_800 2
- #define PPU_SCREEN_C00 3
- #define PPU_SCMODE_SINGLE 0
- #define PPU_SCMODE_NORMAL 1
- #define PPU_SCMODE_FOURSC 2
- void ppu_setMirroring(uint8_t direction);
- void ppu_setSingleScreen(uint8_t screen);
- void ppu_setScreenMode(uint8_t mode);
- PPU_Sprite ppu_getSprite(uint16_t i);
- uint8_t ppu_memoryRead(uint8_t page, uint8_t addr);
- void ppu_memoryWrite(uint8_t page, uint8_t addr, uint8_t value);
- void ppu_debugSprites();
- void ppu_debugColor();
- #endif
|