Bad idea: build a captcha library that embeds DOSBox so it can make you beat levels/puzzles from DOS games to continue.
-
@foone Or for the non-gamers: “Edit these CONFIG.SYS and AUTOEXEC.BAT files so that you have both CD-ROM access and mouse driver working, while also having 600KB of available conventional memory.”
We’d need anti-cheat to prevent the use of MEMMAKER though…
-
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.
-
@gh oh that'd be fun.
-
found 5 places the palette is reprogrammed
and all are in overlays. ugh.
-
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
-
looks like the separate game engines are called puzzler, electric, and simple.
-
I love when games use __FILE__ in their assertions. please tell me all your filenames please
-
can I not set an I/O breakpoint in dosbox-x's debugger? I forget.
-
@foone some of these could probably do double duty as age verification challenges .
-
@enno mean
but yeah, clearly. -
oh sweet laser jesus I found the upload palette function and THEY UNROLLED IT
-
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
-
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 Any idea why? I have extremely little experience with programming in that era, but I remember that code size was always a serious concern ... so unrolling it sounds like a bad idea, unless they really needed it for performance.
-
@saua it runs slightly faster. like a couple cycles per "iteration".
This is aiming at CPUs so slow that that might matter
-
No compiler flags that would do this? ️
-
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.
-
@simonzerafa in 1991? I don't think so. Not a for loop this big.
-
"hey ghidra what calls set_palette?"
"I don't know! you're in 16bit segmented mode! pointers are MEANINGLESS
-
ahh, nope! I misidentified it.
the second parameter on set_palette is how many frames to set it for.
The same palette gets set.it vsyncs every time so this is a set_palette that's also a timing function