Ring Buffers

Ring Buffer Tutorial

DCurrent

Site Owner, OpenBOR Project Leader
Staff member
You've seen and used ring buffers in action before. Learn what they are and how to apply them for your own use.

DC
 
Minor update - added a screenshot I took of NES memory to better show Ninja Gaiden 2's ring buffer in action.

For any who care, since there's no such thing as a structure or array on the NES and they needed to store three sets of 8bit values, it's technically three ring buffers of 64 bytes each from address $0100 to $01BF sharing one cursor located at $004B.
  • Buffer A = X position.
  • Buffer B = Y position.
  • Buffer C = Status - Walking, Direction, on wall, hurt, etc.

1785027708305.png

DC
 
Back
Top Bottom