mirror of
https://github.com/Candygoblen123/SwiftNES.git
synced 2025-09-10 12:42:02 -05:00
Render: Impl sprite rendering
This commit is contained in:
@@ -28,7 +28,6 @@ class NesPPU {
|
||||
func tick(_ cycles: UInt8) -> Bool {
|
||||
self.cycles += Int(cycles)
|
||||
if self.cycles >= 341 {
|
||||
//print(self.cycles)
|
||||
self.cycles = self.cycles - 341
|
||||
self.scanline += 1
|
||||
|
||||
@@ -37,7 +36,6 @@ class NesPPU {
|
||||
status.setSpriteZeroHit(false)
|
||||
if ctrl.generateVblankNMI() {
|
||||
nmiInterrupt = 1
|
||||
print("interrupt")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +114,6 @@ class NesPPU {
|
||||
|
||||
func writeToData(_ data: UInt8) {
|
||||
let addr = addr.get()
|
||||
print("\(addr): \(data)")
|
||||
switch addr {
|
||||
case 0...0x1fff:
|
||||
print("Attempt to write to chr rom space \(addr)!")
|
||||
|
@@ -46,4 +46,28 @@ struct ControlRegister: OptionSet {
|
||||
0x1000
|
||||
}
|
||||
}
|
||||
|
||||
func spritePatternAddr() -> Int {
|
||||
if !self.contains(.SPRITE_PATTERN_ADDR) {
|
||||
0
|
||||
} else {
|
||||
0x1000
|
||||
}
|
||||
}
|
||||
|
||||
func spriteSize() -> Int {
|
||||
if !self.contains(.SPRITE_SIZE) {
|
||||
8
|
||||
} else {
|
||||
16
|
||||
}
|
||||
}
|
||||
|
||||
func masterSlaveSelect() -> Int {
|
||||
if !self.contains(.SPRITE_SIZE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user