diff options
| author | crecher <crecher@crecher.net> | 2026-10-13 01:13:13 +0200 |
|---|---|---|
| committer | crecher <crecher@crecher.net> | 2026-10-13 01:13:13 +0200 |
| commit | 99cae5a5a37f41f878a84857361eda47910303ba (patch) | |
| tree | 31c8665ca991f95e09e93bb2e6ec91d81d2427ff /ppu/ppu.go | |
| parent | 96ff6d8eda2ba434682909f4ff4ce350d78b2273 (diff) | |
| download | gones-99cae5a5a37f41f878a84857361eda47910303ba.tar.gz gones-99cae5a5a37f41f878a84857361eda47910303ba.zip | |
sprites!!!!!!
Diffstat (limited to 'ppu/ppu.go')
| -rw-r--r-- | ppu/ppu.go | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -3,13 +3,16 @@ package ppu import "crecher.net/gones/v2/cart" const ( - ctrlNametableMask = 0x03 - ctrlIncrement32 = 0x04 - ctrlBGPatternHigh = 0x10 - ctrlNMIEnable = 0x80 + ctrlNametableMask = 0x03 + ctrlIncrement32 = 0x04 + ctrlSpritePatternHigh = 0x08 + ctrlBGPatternHigh = 0x10 + ctrlSpriteSize16 = 0x20 + ctrlNMIEnable = 0x80 maskGreyscale = 0x01 maskShowBackgroundLeft = 0x02 + maskShowSpritesLeft = 0x04 maskShowBackground = 0x08 maskShowSprites = 0x10 @@ -59,6 +62,10 @@ type PPU struct { patternLo, patternHi uint16 attrLo, attrHi uint16 + // sprites for the line being drawn, picked at the end of the previous line + spriteLine [8]sprite + spriteCount int + nmiOutput bool // PPUCTRL bit 7 nmiLine bool // vblank && nmiOutput, latched each tick for edge detection nmiPending bool // set on nmiLine's rising edge, consumed by PollNMI |