Introduction
Introduction Statistics Contact Development Disclaimer Help
Post AYtbYhPiGeWNdftoQq by [email protected]
More posts by [email protected]
Post #AYpqeLeWoDagZ98nS4 by [email protected]
0 likes, 0 repeats
the best thing about ghidra is that no matter which version you're using, s…
Post #AYptGx7U9hhvgFDlgG by [email protected]
0 likes, 0 repeats
@foone equates is to Ghidra as the ice cream machine is to McDonald's?
Post #AYptGxCRrFg3vdXjPs by [email protected]
0 likes, 0 repeats
@kawa exactly
Post #AYpvudf27eJ4oyxqro by [email protected]
0 likes, 0 repeats
port_out(0x3c4,0xf02);I SO WANT TO EQUATE 0x3C4 TO THE VGA SEQUENCER INDEX REGI…
Post #AYpwLWnrj6sFN6uwZU by [email protected]
0 likes, 0 repeats
the weird thing is the equates table says it's been set, says there's a…
Post #AYpzyaQcTxVBlrMPdg by [email protected]
0 likes, 0 repeats
OH GOODY I found a mistake in OSDEVtheir docs on the PC gameport are incorrect
Post #AYq043UZqp5zMIorNA by [email protected]
0 likes, 0 repeats
and I can't rename some local variables either!?
Post #AYq09rt9uCfF6n5ZfU by [email protected]
0 likes, 0 repeats
what the fuck, ghidra?
Post #AYq4bVqZqhB6flJpKa by [email protected]
0 likes, 0 repeats
@foone Did you know the OSDev wiki is a wiki, and relies on knowledgeable peopl…
Post #AYq4bVvBZYreu3TVVw by [email protected]
0 likes, 0 repeats
@dascandy42 I do know! But I don't have an account yet.
Post #AYq4h8TFfqtDuU5cvY by [email protected]
0 likes, 0 repeats
@foone FWIW, I believe in IDA this kind of thing mostly happens because they wa…
Post #AYq4h8XrOiZm8mFJ6u by [email protected]
0 likes, 0 repeats
@dougall yeah I've had that happen. Not here, though. The variable it can&#…
Post #AYrZ81fkFZq2QVdDzE by [email protected]
0 likes, 0 repeats
okay I've fixed OSDEV:https://wiki.osdev.org/Game_portThey had the introduc…
Post #AYrZKQCwqyjJzt4aMi by [email protected]
0 likes, 0 repeats
and the IBM Game Control Adapter is mentioned in the August 1981 IBM PC Technic…
Post #AYrZKThXrfzGpePYyO by [email protected]
0 likes, 0 repeats
mind you, on the IBM PC, just about everything is an optional add-in. You get a…
Post #AYralJKGeG7mQTskOO by [email protected]
0 likes, 0 repeats
@Infoseepage yup! my own 5150 has the max 640, thanks to a AST SixPakPlus
Post #AYrfHelAtO8LzB99v6 by [email protected]
0 likes, 0 repeats
@foone Wait, the default was cassette and not floppy ?
Post #AYrfHep4etFkBGyGzw by [email protected]
0 likes, 0 repeats
@flobo yup!
Post #AYrmNxTguZjjSHvADg by [email protected]
0 likes, 0 repeats
god. Duke Nukem 1 has so much copy-pasted code.Like, there's a ton of hint …
Post #AYrnEFAIOcYtMxmS5g by [email protected]
0 likes, 0 repeats
LEARN TO WRITE REUSABLE FUNCTIONS
Post #AYrnz4jmz0rgdhiHx2 by [email protected]
0 likes, 0 repeats
@foone You know they teach people to specifically program like this in school, …
Post #AYrnz4o2jCGeqthga8 by [email protected]
0 likes, 0 repeats
@drwho WHAT SCHOOL?
Post #AYro7aVsj3T7VTGdZw by [email protected]
0 likes, 0 repeats
@foone I bet you it's a compiler macro in the original source.
Post #AYro7aa8TEs5ifG2D2 by [email protected]
0 likes, 0 repeats
@darkling I really hope so
Post #AYromAlTMYu3WPucBk by [email protected]
0 likes, 0 repeats
@foone They also have dialog_box_custom. Does that not let you pass a string, s…
Post #AYromAq55Qabki4IN6 by [email protected]
0 likes, 0 repeats
@goofpunk not exactly. it passes some kind of number that's an index to a l…
Post #AYroytsVSSL6uiGsC0 by [email protected]
0 likes, 0 repeats
interesting. there's 12 hint-variables which are used to make sure you don&…
Post #AYroywfV5GibZFD1pw by [email protected]
0 likes, 0 repeats
although I'm looking at DN1, episode 1. Maybe it does do something in DN1E2…
Post #AYrpJVlyHCTeEX2hRA by [email protected]
0 likes, 0 repeats
@foone want Duke em largely built by one kid? Wouldn't be surprised if it w…
Post #AYrpJVqE1NscRj264G by [email protected]
0 likes, 0 repeats
@qkslvrwolf Mainly by Todd Replogle (who was 22) with some hints from John Carm…
Post #AYrpQXYE3yXtm9xsXo by [email protected]
0 likes, 0 repeats
because yeah this was also the era where you'd have 3 separate executables …
Post #AYrpmxhrUyARGZACXo by [email protected]
0 likes, 0 repeats
like, it has a function that loops through all 16 color indices and sets them t…
Post #AYrpn0UV96GLtzw4dU by [email protected]
0 likes, 0 repeats
so instead of fade_screen(COLOR_BLACK) and fade_screen(COLOR_WHITE), it's t…
Post #AYrrUTLNqZKRnIxclU by [email protected]
0 likes, 0 repeats
@foone Extreme inlining?
Post #AYrrUTPzZR101b7Iwq by [email protected]
0 likes, 0 repeats
@sundhaug92 they're not inlined!
Post #AYrsgAG2jasQ1qbNHE by [email protected]
0 likes, 0 repeats
naturally instead of a function like "adjust_duke_health(n)" there&#3…
Post #AYrsgDFRcHBFIrLRGC by [email protected]
0 likes, 0 repeats
todd replogle: look, I know programmers who use function parameters and data-dr…
Post #AYrtgC2YCvJHVjruCm by [email protected]
0 likes, 0 repeats
@foone i wonder if eduke32 (the source port for duke nukem) changed any of thes…
Post #AYrtgC79vmzpk21aO8 by [email protected]
0 likes, 0 repeats
@fries different game! that's duke nukem 3D, this is Duke Nukem 1.
Post #AYru1Y9PCDUUAPG4hs by [email protected]
0 likes, 0 repeats
@foone I love it. Parameter passing is slow and this circumvents it entirely! :D
Post #AYru1YCwz2KILOuuES by [email protected]
0 likes, 0 repeats
@eniko it's not THAT slow! especially when none of these are inner-loop thi…
Post #AYrvFFtPyVnLY7saTg by [email protected]
0 likes, 0 repeats
The game starts with these two screens.There's a function to draw Dr Proton…
Post #AYrvRoyJNVZrot9zl2 by [email protected]
0 likes, 0 repeats
the only difference between the "draw proton"/"draw duke" f…
Post #AYrvtQa3epPwHQyndg by [email protected]
0 likes, 0 repeats
@foone There are languages/formalisms where you can only pass one parameter to …
Post #AYrvtQeJP0ouUcyCGm by [email protected]
0 likes, 0 repeats
@darkling you'd think, but nope! this was compiled with Borland Turbo C.
Post #AYrw0GQToHgmoVl8Zk by [email protected]
0 likes, 0 repeats
@foone refactor the game.
Post #AYrw0GVnUVwV50FNrc by [email protected]
0 likes, 0 repeats
@geordie I don't have the source!
Post #AYrw60MYRi4ujQf1sm by [email protected]
0 likes, 0 repeats
there are 5 of these functions in total.Exactly identical, except they point to…
Post #AYrx6nZxYqxBKLsClE by [email protected]
0 likes, 0 repeats
oh god please don't tell me there's a hidden cheat code that's been…
Post #AYrxZIYHzuXPUrgJyi by [email protected]
0 likes, 0 repeats
Nope! it's known, it's just slightly mis-documented and tricky to pull …
Post #AYryTGKRS1H4oltG9Q by [email protected]
0 likes, 0 repeats
@foone Sounds like they may have made heavy use of macros. Maybe they thought p…
Post #AYryTGOhCCg31xsemW by [email protected]
0 likes, 0 repeats
@bytex64 that's the weird thing: it's being used for all these static s…
Post #AYryyrtFqe7oI2FDtI by [email protected]
0 likes, 0 repeats
@foone At least it's their own artisnal c&p'd code rather than c&am…
Post #AYryyrxVapWmVEEcWO by [email protected]
0 likes, 0 repeats
@dalias yeah, they only stole the graphics, not the code!
Post #AYrz8hB2XBCzxYFWfA by [email protected]
0 likes, 0 repeats
there is some extra code for checking the command line for another code, which …
Post #AYs0EfDYpd6tZfq2ds by [email protected]
0 likes, 0 repeats
@foone @darkling Is it possible this is some segmented memory/near/far pointer …
Post #AYs0EfIWXB51p4A0NU by [email protected]
0 likes, 0 repeats
@poeschel @foone At this point, I'm talking out of my arse (I'm not rea…
Post #AYs0EfMmHMU02G9P0a by [email protected]
0 likes, 0 repeats
@darkling @poeschel yeah, I don't think that's the case. all 5 are in t…
Post #AYs0PeLEQisu2ffHe4 by [email protected]
0 likes, 0 repeats
@foone ah, duke nukem 1.. was it written in C? do 1991 DOS games use C? or they…
Post #AYs0PeP8CE0IElUOiu by [email protected]
0 likes, 0 repeats
@fries Yeah, it was C! Borland Turbo C, to be specific.Probably some of it was …
Post #AYs0yck0N8t9DJvgFk by [email protected]
0 likes, 0 repeats
okay so the unused hint is supposedly for the teleporter, according to the modd…
Post #AYs1Umn8XYC3eSjKyG by [email protected]
0 likes, 0 repeats
@foone Could this be the result of compiler inlining?
Post #AYs1UmrOHjb1reijbM by [email protected]
0 likes, 0 repeats
@noam nope! it's not inlined.
Post #AYs2XSa0FAMLmxQTE8 by [email protected]
0 likes, 0 repeats
getting closer to my goal. I figured out where it sets the variable for duke&#3…
Post #AYtVlpaiZklP2ZvQVk by [email protected]
0 likes, 0 repeats
Wait wait wait. Either I'm completely misremembering a key part of how one …
Post #AYtWoWXXxoUcmGI1w0 by [email protected]
0 likes, 0 repeats
nope, not misremembering. See this message? You can only save games in the betw…
Post #AYtWwVHMXIfRBPWavo by [email protected]
0 likes, 0 repeats
so why in the fuck does the game save your position in the level and the camera…
Post #AYtX40qBaZol64OTGi by [email protected]
0 likes, 0 repeats
and apparently the game ignores the camera position, but not the player positio…
Post #AYtX40uRKlDjJGNrto by [email protected]
0 likes, 0 repeats
so... if you set up a savegame so it puts you in an actual level instead of a h…
Post #AYtXW5Bd1aqagRoAGO by [email protected]
0 likes, 0 repeats
yep. you can have it load you right into a level. you can't save a game the…
Post #AYtXnkn3b2Psdck17w by [email protected]
0 likes, 0 repeats
I was gonna say that it would make sense if they originally had a save system t…
Post #AYtXwTA6VVi6ZTg31M by [email protected]
0 likes, 0 repeats
but yeah: despite it technically being visible for 32 years, I never noticed th…
Post #AYtYPnrubEybBo9hho by [email protected]
0 likes, 0 repeats
guess I'll have to find out where it shows the "you can only save in h…
Post #AYtYXXe0nx47BhLNgG by [email protected]
0 likes, 0 repeats
@foone My guess is that saving outside of the hallway was once planned and then…
Post #AYtYXXiyVV2FR5fLPs by [email protected]
0 likes, 0 repeats
@thewispsoftime maybe!
Post #AYtZOhudMImqNiTCBk by [email protected]
0 likes, 0 repeats
I found the part where it shows that dialogbox, it was tricky because it was in…
Post #AYtZOkgZ34JaywuVAu by [email protected]
0 likes, 0 repeats
it also means there's yet another dialog_box function that's identical …
Post #AYtZjGNOvqmp3rj9u4 by [email protected]
0 likes, 0 repeats
segmented real mode DOS is so silly.I know this function is a far call (not a &…
Post #AYtZjJ6qlqKVXP0U1Q by [email protected]
0 likes, 0 repeats
what if instead they JMP to 208F:1BA0? that's the same linear address!
Post #AYtZjJsLvEKLujEQ40 by [email protected]
0 likes, 0 repeats
or any of the 256 other possible addresses for the same fucking function?
Post #AYtaA9tz70LunenDd2 by [email protected]
0 likes, 0 repeats
> Exception while decompiling 208e:4094: Decompiler process diedthis would b…
Post #AYtaeuctxKnGOuT0G8 by [email protected]
0 likes, 0 repeats
oh god this code better not be jumping into the middle of an instruction
Post #AYtaexpQ3FaaKbLXge by [email protected]
0 likes, 0 repeats
it's always fun to find things like that while looking at disassembly. it&#…
Post #AYtaeych630KnQOtUW by [email protected]
0 likes, 0 repeats
here there be dragons
Post #AYtbYhPiGeWNdftoQq by [email protected]
0 likes, 0 repeats
@foone whats the difference then? Access rights to specific segments?
Post #AYtbYhUJzWCvry3UcC by [email protected]
0 likes, 0 repeats
@f4grx no access rights yet! there are no protections at this point.the differe…
Post #AYtbmqkyKNcmfZafpI by [email protected]
0 likes, 0 repeats
@foone wait what??? I've been wanting to play that level since 1992!
Post #AYtbmqpa3FJKtrkM0e by [email protected]
0 likes, 0 repeats
@foone ahh satisfying. Mildly interesting that beating the level doesn't pu…
Post #AYtbmqtTokQj5xZT5U by [email protected]
0 likes, 0 repeats
@adamrofer oh, does it? interesting. I didn't try beating a level in that s…
Post #AYtbmqynUygRMS3iNM by [email protected]
0 likes, 0 repeats
@foone then the demo becomes a replay of your run too apparently! Ah the"R…
Post #AYtbmtcvejyPZUqnCq by [email protected]
0 likes, 0 repeats
@adamrofer Also you can just play it as map 1 of episode 2.although interesting…
Post #AYtcgB4OVNCrb53cIq by [email protected]
0 likes, 0 repeats
NOPE! it just checks if you're on an even level, and then tells you to fuck…
Post #AYtcgDisdomPpE0yga by [email protected]
0 likes, 0 repeats
idea: what happen if I sabotage this check and make it always let you save?
Post #AYtcgETfpqD6ALuLce by [email protected]
0 likes, 0 repeats
it's time... for hax
Post #AYtcgFEp0XvMWZy06y by [email protected]
0 likes, 0 repeats
75 09 ; JNZ +9turns intoEB 09 ; JMP +9
Post #AYtcgFzyBFdcso1ebI by [email protected]
0 likes, 0 repeats
There we go! I'm saving mid-level.
Post #AYtcgGl7LxLtF25J5c by [email protected]
0 likes, 0 repeats
and it loads properly. Nothing about the level state is saved (other than your …
Post #AYth0OTWm0yImVhzf6 by [email protected]
0 likes, 0 repeats
okay I think I know why they disabled mid-level saving:so, they don't save …
Post #AYth0RWTRW6wEW6tAe by [email protected]
0 likes, 0 repeats
the gun powerup is unique in that it can be collected multiple times. The game …
Post #AYth0SHccDpCakAXey by [email protected]
0 likes, 0 repeats
but that's not the case with the gun powerup because you collect up to thre…
Post #AYth0T2lmvXSwyEC9I by [email protected]
0 likes, 0 repeats
and if you can save mid-level, your gun powerup state is saved. So you enter le…
Post #AYth0TnuxdFjJCHqdc by [email protected]
0 likes, 0 repeats
and making you save only in hallways avoids this. And the game stores the state…
Post #AYth0UZ48KxzfQLV7w by [email protected]
0 likes, 0 repeats
so you can't use this trick.now I think they could have solved this in anot…
Post #AYth0VJrKMOg0YEs40 by [email protected]
0 likes, 0 repeats
but maybe they didn't figure out this exploit into late in development and …
Post #AYth0W4eWNpMLg8F04 by [email protected]
0 likes, 0 repeats
you can also use this trick to get infinite health, but that's a much less …
Post #AYth0Wpnh5XchuBtUO by [email protected]
0 likes, 0 repeats
oh interesting.the game does reuse a dialog box! just one of them: The main-hal…
Post #AYth0XbIqTXT5EPpWy by [email protected]
0 likes, 0 repeats
the game selects what message to play based on your current level. on odd-numbe…
Post #AYth0YMnzrXJSYdlZY by [email protected]
0 likes, 0 repeats
my ghidra is full of a lot of comments like "this actually points to keybo…
Post #AYth0Z8J9FX9psrhc8 by [email protected]
0 likes, 0 repeats
ghidra really doesn't do a great job of handling 32bit pointers in a 16bit …
Post #AYth0ZtoIdX0DD5dei by [email protected]
0 likes, 0 repeats
So sometimes a function fill be like void foobar(int a, int b, char far * strin…
Post #AYth0aexTLFGZR9I92 by [email protected]
0 likes, 0 repeats
nope! far pointers are passed as two 16-bit integers but actually represent one…
Post #AYth0bPkfMfwuZ2f56 by [email protected]
0 likes, 1 repeats
honestly real mode x86 is such an abomination of nonsense that we should preten…
Post #AYtjo7dtpaCwxmOria by [email protected]
0 likes, 0 repeats
@foone that's a perfectly cromulent technique for saving memory!
Post #AYtjo7irX8B5DAipSC by [email protected]
0 likes, 0 repeats
@DrHyde and making reverse engineers (like me) cry!
Post #AYtn7U1BABxdixDEeG by [email protected]
0 likes, 0 repeats
ugh. I don't know what this function even does but I can already tell that …
Post #AYtn7X6bgT5LIem71c by [email protected]
0 likes, 0 repeats
I'm really doubting the function duplications has anything to do with aggre…
Post #AYtn7Xuagd4FngA1w0 by [email protected]
0 likes, 0 repeats
optimization level: this is a consumer-grade compiler for DOS from 1988, you&#3…
Post #AYtn7YhVkkCQFP36Bc by [email protected]
0 likes, 0 repeats
I hope this is just me misunderstanding the purpose of this function and this g…
Post #AYtn7ZUmnXcAiE6RzU by [email protected]
0 likes, 0 repeats
oh fuck me I think it does
Post #AYtn7aI3qL1vB39nnM by [email protected]
0 likes, 0 repeats
instead of having a big array called like GameObjects and a big update function…
Post #AYtn7b5Kt8RfdsD9bE by [email protected]
0 likes, 0 repeats
and a separate copy-pasted function to update each one
Post #AYtn7brXzt0g3OlekK by [email protected]
0 likes, 0 repeats
I'm going to set this game on fire
Post #AYtn7ce75JrGU1URRg by [email protected]
0 likes, 0 repeats
oh god it even does it for static things like doorsapparently every frame it lo…
Post #AYtn7dRk6nYaxwi4no by [email protected]
0 likes, 0 repeats
instead of, you know, waiting until the user pushes the up key, then figuring o…
Post #AYtn7eEfAuglPfb93Q by [email protected]
0 likes, 0 repeats
also apparently beating the game gives you 34,464 points. random-ass number.
Post #AYtn7f1EGLXLqIJvkm by [email protected]
0 likes, 0 repeats
at least it doesn't loop over a shoes array, since there can only be one pe…
Post #AYtn7fo9KSfWI1D00O by [email protected]
0 likes, 0 repeats
I'm now doing some hybrid static/dynamic debugging. I set a breakpoint on t…
Post #AYtn7gbQNG5GkqGLoG by [email protected]
0 likes, 0 repeats
there's a separate function and array that's looped over for EVERY SING…
Post #AYtprmm1xioh7gKjUe by [email protected]
0 likes, 0 repeats
@foone This is the exact thing that the previous developer did in the project I…
Post #AYtprmqzfGmpN4ehEG by [email protected]
0 likes, 0 repeats
@annmygdala are you able to kill them?
Post #AYtqJNgWpq3tQ5uzxo by [email protected]
0 likes, 0 repeats
my current theory:todd replogle didn't really understand C programming but …
Post #AYtqpM6yDkslo3X6Lg by [email protected]
0 likes, 0 repeats
@foone 34,464 = 100,000 - 65,536
Post #AYtqpMBDxwHk1FWUym by [email protected]
0 likes, 0 repeats
@lizakowski huh.
Post #AYtr8Ll3l7IqDELEkC by [email protected]
0 likes, 0 repeats
I think that instead of iterating over all the destructable blocks, it instead …
Post #AYtr8P1TcXDYL12tFY by [email protected]
0 likes, 0 repeats
but I could be wrongI hope I'm wrong
Post #AYtr8PokfKdInq6F3Q by [email protected]
0 likes, 0 repeats
for some reason, unlike every other enemy, the rabbitoids are handled in the &q…
Post #AYtrzlQL44f1A47SGe by [email protected]
0 likes, 0 repeats
@foone I can't help but wonder if any of this helps explain Duke Nukem Fore…
Post #AYtrzlVIlcd9PSRQ0G by [email protected]
0 likes, 0 repeats
@BluJBird nah, he only got "special thanks" credit on that one
Post #AYtt09CEmLg8qRGoIi by [email protected]
0 likes, 0 repeats
@foone sorry, what is Dark Code? Google and DuckDuckGo were not helpful.
Post #AYtt09GqVDMh4jQUU4 by [email protected]
0 likes, 0 repeats
@nebojsac I mean bytes that ghidra didn't know are code yet, they haven&#39…
Post #AYttTTHPBk2JWvfbl2 by [email protected]
0 likes, 0 repeats
okay so beating the game doesn't give you 34464, it gives you 100,000 point…
Post #AYtusmSZ7AH0D3WSAK by [email protected]
0 likes, 0 repeats
anyway I think I've found them all and there's 29 mostly-copy-pasted fu…
Post #AYtvxwrLyYHFrl92uW by [email protected]
0 likes, 0 repeats
okay I'm too fried to keep working on this anymore today.but at least I fou…
Post #AYvTrGw4WffBhgIfA0 by [email protected]
0 likes, 0 repeats
@foone having recently reverse engineered the entire game logic of Duke 1 mysel…
Post #AYvTrH12EDdJx4cctc by [email protected]
0 likes, 0 repeats
@lethal_guitar oh neat! Is that info online anywhere?
Post #AYvTwzh7Xbddy72Eds by [email protected]
0 likes, 0 repeats
@foone nah this is misleading, the rabbitoids are handled like other enemies. B…
Post #AYvTwzl1J6l2ACrLii by [email protected]
0 likes, 0 repeats
@lethal_guitar ahh, good to know. I was following the addscore calls, so I must…
Post #AYvbSYmpooHrSehsW0 by [email protected]
0 likes, 0 repeats
@foone unfortunately not at the moment, as I did this in the context of an upco…
Post #AYvbSYr5YzgpfqhH96 by [email protected]
0 likes, 0 repeats
@lethal_guitar ahh, cool! Carry on, then, and good luck!
Post #AYyO0ac6iTt35atvrU by [email protected]
0 likes, 0 repeats
@foone For diplomatic reasons, I have refrained for now
Post #AYyO0ag0Tz0RHgj2wK by [email protected]
0 likes, 0 repeats
@annmygdala I admire your restraint
You are viewing proxied material from pleroma.anduin.net. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.