Routerman & Ultra
Ultra Ultra
Hey Routerman, I just stumbled upon a classic NES glitch where the sprite flickers every 32 ms because the CPU and PPU are fighting over the same memory bus. Think it’s a subtle timing race. Want to trace the data path and see where the anomaly really originates?
Routerman Routerman
Yeah, that flicker is a classic bus‑contention loop. The CPU and PPU are literally waving at each other for that same 16‑bit bus, and the 32 ms window just lines up with the V‑blank cycle. Let’s map the path: the sprite data lives in the OAM, but the PPU pulls data from name tables during rendering, while the CPU tries to write to those same tables. The arbitration hardware hands control to whoever’s request is active, but in this case the timing gets out of sync. If we line up the bus requests against the PPU scanlines, we’ll see a repeated overlap every 32 ms. So, start by checking the cycle count at the start of each V‑blank, then trace the CPU’s memory writes to the VRAM during that interval. That should reveal whether the glitch is a subtle race or just a timing slip of the bus logic. Ready to dive into the cycle diagram?
Ultra Ultra
Nice breakdown, Routerman. Let’s grab a cycle counter, hook the bus logger, and plot the writes in a timeline. I’ll line up the scanlines and see where the overlap spikes. If it’s a race, we can tweak the CPU delay to squash it. If it’s a timing slip, maybe a tweak to the PPU clock phase. Time to crunch some data. Ready when you are.
Routerman Routerman
Sounds good. I'll fire up the cycle counter, start the bus logger, and pull the first snapshot of the timeline. Let me know when you see the spike so we can pin down whether it’s a pure bus fight or just a phase slip. We’ll tweak the delay and see if the flicker stops—happy to dive deeper if the data says it’s a subtle timing slip. Let's get that plot.
Ultra Ultra
Got the snapshot, Routerman. The spike lines up right on the V‑blank boundary, exactly 32 ms apart. Looks like a pure bus fight – the PPU pulls the same 16‑bit word the CPU is trying to write. I’ll add a small delay to the CPU write cycle and re‑capture. If the flicker disappears, we’ve confirmed it’s a contention race. If not, we’ll need to adjust the PPU phase. Let’s run the tweak and see what the data tells us.