Email or username:

Password:

Forgot your password?
Top-level
Foone🏳️‍⚧️

You know, I was just thinking yesterday I should reverse engineer that game, but I don't really have a reason to.

Now I do.

15 comments
Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

"have a population of at least 20,000 within 5 years in this game of SimCity 2000"

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

Just throwing surfers randomly in point and click adventures and then telling them to find an item would also be funny.

Do you know where to get the Cloaking Belt in Space Quest 3? How about the box of electronic bunnies in Full Throttle?
Where's the Old Book on Hugo 3: Jungle of Doom?

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

Seems Gizmos and Gadgets is a 16-bit EXE compiled with Borland Turbo C++ (no floating point support)

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

oh goody my favorite, OVERLAYS!

as if segmented code wasn't enough of a pain, where you don't know where a pointer points to unless you see how it's used, now you don't know what code is CURRENTLY loaded at that position, because it changes!

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

step up: find the fade out.

see the game fades out when you go into a door. find where that code is, then see what gets called next.

finding a fade out should be easy: look for when they reprogram the VGA palette registers to dim every color to black.

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

found 5 places the palette is reprogrammed

and all are in overlays. ugh.

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

OKAY realistically this is a game that features several different games you can play, and games between games. they're just gonna make each one a separate overlay.

so I need to figure out how it shifts overlays and how to track which overlay is active

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

looks like the separate game engines are called puzzler, electric, and simple.

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

I love when games use __FILE__ in their assertions. please tell me all your filenames please

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

can I not set an I/O breakpoint in dosbox-x's debugger? I forget.

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

oh sweet laser jesus I found the upload palette function and THEY UNROLLED IT

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

why do:

for(int i=0;i<256;i++){
upload_color(i,palette[i]);
}

when you can do

upload_color(0,palette[0]);
upload_color(1,palette[1]);
upload_color(2,palette[2]);
upload_color(3,palette[3]);
upload_color(4,palette[4]);
upload_color(5,palette[5]);

and just repeat 251 more times

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

the worst part is that this was done with a compiler from 1991 so there's no way it unrolled the loop itself. they did this manually

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

oh that's cute. their set_palette function takes two arguments: a pointer to the palette, and a number of extra palettes to apply.

so they could set up an array of palettes in decreasing brightness, and just do set_palette(&fade_pallets[0], 64) to go through them.

but the same function is a regular one-time set_palette if you just pass 1 for the second argument.

Foone🏳️‍⚧️ replied to Foone🏳️‍⚧️

"hey ghidra what calls set_palette?"

"I don't know! you're in 16bit segmented mode! pointers are MEANINGLESS

Go Up