Ask HN: Weirdest hack that you ever saw in production?
Sony PSX (original playstation) port of a PC title that I worked on, we needed to have a physics thread run at a predictable and consistent rate regardless of what the rest of the game was doing. Sony Japan said pre-emptive multi-tasking wasn&#x27;t possible.<p>Found a way to hook the vertical blank interrupt (shades of old Atari 8-bit programming), push all the registers onto the stack to create a setjmp&#x2F;longjmp-ish way to call our physics thread at a consistent 30Hz. (OK, 29.97, but close enough)