A 6502 is not a bad little machine, but it does require efficient coding to get decent real-time results. NESHacker dives into basic Mario-style platformer movement in a 10-minute video The main portion of the video goes into subpixel movement, a term you may have heard speedrunners use. Many NES platformer heroes don’t jump immediately to movement when a control is pressed, but instead increase acceleration, and that acceleration is measured, in the case of Mario, in 16ths of a pixel. The process of conversion is pretty slick though. It doesn’t use floating point math but fixed point. Mario’s position isn’t stored just in hardware screen coordinates but in a number with four extra bits off the right side. This larger number is what acceleration math is performed on, and when it comes time to position Mario’s sprite matrix (he’s not properly a sprite because he’s made of several), the code divides by 16 by just rolling the bits to the right, which is a very time performant operation…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.