How Touhou 4 aims a ring of bullets
A 16-bit PC-98 angle helper matched to readable C++ and compared against historical compiler output.
The full story
An REA showcase on Touhou 4 (Lotus Land Story), a 1990s PC-98 shoot-'em-up running as 16-bit DOS code. It answers how a boss fires a ring of 16 bullets aimed at the player. The game measures a full turn in 256 angle units, so the 16 bullets sit 16 units apart. Adding the direction to the player rotates the whole ring towards you.
REA returns the function's instructions, pseudocode and references. These are matched against readable C++ from an existing community reconstruction of the game and compared with what period compilers would have produced.
How it was done
Tools
Themes
Loading themes…
Sources
From the maker's own write-up or code. We summarise what they report; we haven't tested it ourselves.
- Awesome REA list: How TH04 aims a ring of bullets
The showcase walking through the assembly, REA's output and the recovered C++.