port_out(0x3c4,0xf02);
I SO WANT TO EQUATE 0x3C4 TO THE VGA SEQUENCER INDEX REGISTER BUT I CAN'T
okay I've fixed OSDEV:
https://wiki.osdev.org/Game_port
They had the introduction of the gameport listed as "the PCjr" (it's from 1981, the PCjr came out in 1984... and didn't even have this gameport connector!) but more importantly, they had the order of the joystick axises wrong.
god. Duke Nukem 1 has so much copy-pasted code.
Like, there's a ton of hint dialog boxes like "You need the key to open this door!" or "you get more points if you catch the balloon"
you'd think they'd just have ShowMessage() and pass it a different string, but nope. it's a different function.
interesting. there's 12 hint-variables which are used to make sure you don't get hinted for something you've used before.
One of them is still maintained, but not used. So there must have been another hintable thing that got dropped
like, it has a function that loops through all 16 color indices and sets them to black. it takes one parameters, which tells it how long to wait between each color is set, so it'll fade slowly to black, instead of being instant.
there's also an identical function that does the same, but sets it to white, instead.
the only difference between the "draw proton"/"draw duke" functions is what base address they draw from.
YOU CAN PASS ADDRESSES TO FUNCTIONS, TODD
@foone There are languages/formalisms where you can only pass one parameter to a function.
Maybe they were working in a language where you can't pass *any* parameters to a function?
I'm sure there's some mathematician that's managed it. Somewhere.

@poeschel @foone At this point, I'm talking out of my arse (I'm not really an x86 person), but it's duplicating a significant amount of code to avoid passing a single (possibly-)far pointer where it could avoid the duplication at the cost of passing one far pointer? Seems like a significant mis-optimisation on the part of the compiler.
Maybe a segment change is massively more expensive than I think it is, but I hope it isn't that bad.