This is based on disassembly of the Ultimate DOOM exec, the function starts at 0x54224. Before DMXOPTION was introduced the last section used this instead:
AMAZING! I've been trying everything I could think of the last few days. I think the missing key is the last port read on address +2 is expected to return 255. This is not something my code currently does. Thank you!