SwiftNES/Sources/PPU/Registers/ScrollRegister.swift

19 lines
314 B
Swift
Raw Normal View History

2024-08-19 10:21:24 -05:00
class ScrollRegister {
public var x: UInt8 = 0
public var y: UInt8 = 0
public var latch = false
func write(_ data: UInt8) {
if !latch {
x = data
} else {
y = data
}
latch.toggle()
}
func resetLatch() {
latch = false
}
}