Post AwDqLC6Uc6Sp33tyDI by foone@digipres.club
(DIR) More posts by foone@digipres.club
(DIR) Post #AwDjEHcB1fdoQzTllw by foone@digipres.club
2025-07-17T09:42:05Z
0 likes, 0 repeats
I started hacking on another game (Super Star Wars for DOS (which Mobygames doesn't think exists)) and whoa, what's going on with that EXE? a 1996 DOS game and the main EXE is 8 kilobytes?These fuckers are dynamically loading code out of their datafiles, must be.
(DIR) Post #AwDjidSgMeIWsXVlGC by Krazov@mstdn.social
2025-07-17T09:47:39Z
0 likes, 0 repeats
@foone Some good memories there.
(DIR) Post #AwDjvhhZuVV7nIi5w0 by millenniummacs@bitbang.social
2025-07-17T09:50:01Z
0 likes, 0 repeats
@foone Looks like the EXE is just a loader, yeah, all the chonk is in the Resources file. I guess it just loads it using binary blobs at given offsets?
(DIR) Post #AwDkWapoPByzD79Sme by foone@digipres.club
2025-07-17T09:56:45Z
0 likes, 0 repeats
the game switches between cutscenes, platforming stages, and 3d speedracer segments. I bet they just have separate exes in there for each
(DIR) Post #AwDl0GFxTmbC4kWoM4 by static@aus.social
2025-07-17T10:02:00Z
0 likes, 0 repeats
@foone I bet they had some assembly programmer very proud of his loader.
(DIR) Post #AwDlfVgd10FznvfiQS by foone@digipres.club
2025-07-17T10:09:29Z
0 likes, 0 repeats
hah, it's got files named like T_MODE7.PAL in the resource file. mode7 is a super nintendo thing! DOS didn't support it, but presumably that was "the mode7 level" on the SNES original
(DIR) Post #AwDnQGwNl2QndRu0e0 by foone@digipres.club
2025-07-17T10:29:13Z
0 likes, 0 repeats
oh they're doing some fun shit here. one of the first things the EXE does is set up interrupt F1 (unused, user-reserved) and then it starts calling it. that's weird behavior. software only does that if it's malware or copy protection. or if the developers are demosceners
(DIR) Post #AwDnd67tHD0nrMOvSK by millenniummacs@bitbang.social
2025-07-17T10:31:30Z
0 likes, 0 repeats
@foone The developers were Danish, maybe the demoscene is where they got their DOS programmers from 🤣
(DIR) Post #AwDoIEMFZnfDGKjOro by saua@troet.cafe
2025-07-17T10:38:56Z
0 likes, 0 repeats
@foone My DOS days and my programming days are far enough apart, that I don't know anything for sure, but did they perhaps use it to build a simple API that their various loadable modules use to provide shared functionality? I.e. their SSW.EXE is just ld.so?
(DIR) Post #AwDpG9qrSYXOf4cnqq by foone@digipres.club
2025-07-17T10:49:47Z
0 likes, 0 repeats
okay so the new intf1 looks at AX. if it's FFFF it quits to DOS. otherwise it calculates a new function based on AX and a global function table (I think?) and calls it? inside the interrupt handler?!
(DIR) Post #AwDq3MYb0fmIFwXnSy by foone@digipres.club
2025-07-17T10:58:39Z
0 likes, 0 repeats
ooh, all the strings are $-terminated.this isn't C! this is some manual assembly shit, since they're using BIOS-strings!
(DIR) Post #AwDqLC6Uc6Sp33tyDI by foone@digipres.club
2025-07-17T11:01:50Z
0 likes, 0 repeats
"This program requires at least a 386 SX (So go out and buy one and become human)"interesting phrasing
(DIR) Post #AwDrPfMFtAhMtJyFQ8 by DrewNaylor@mastodon.online
2025-07-17T11:13:48Z
0 likes, 0 repeats
@foone "Detroit: Buy a 386 SX"
(DIR) Post #AwDvy1TeYWNJ9i4LOS by Computeum@mastodon.bayern
2025-07-17T12:04:50Z
0 likes, 0 repeats
@foone Not really Fx interrupts are reserved for user programs. A convention existing since the original PC. (GW)BASIC(A) for example uses F0. It was quite common to use one (or more) of them for internal function calls, shortening code and supporting modularisation. Also helpful when functions had to be exchanged depending on program state. That way no runtime checks for program states were needed. Just exchange the interrupt vector when the program state changes.
(DIR) Post #AwE4Yg0o7pB6vjZ7x2 by pointingdevice@social.restless.systems
2025-07-17T13:41:09Z
0 likes, 0 repeats
@foone that's a memory mapper overlay manager alright
(DIR) Post #AwE78nXfo0uwcMI2tM by StumpyTheMutt@social.linux.pizza
2025-07-17T14:09:51Z
0 likes, 0 repeats
@foone I stuck with my 4.7 MHz 8088 PC until the 386 SX clones came around.
(DIR) Post #AwEz6CgTGdJnFYcJWa by baljemmett@mastodon.online
2025-07-18T00:14:37Z
0 likes, 0 repeats
@foone The $ termination suggests DOS strings (inherited from CP/M and used with INT21h/AH=09h), rather than BIOS - originally the PC BIOS only had 'write single character' calls, although it later sprouted 'write string of specified length'.No I haven't been disassembling a 1983-era BIOS lately why do you ask.
(DIR) Post #AwFLsWtXcolmpABApM by foone@digipres.club
2025-07-18T04:29:36Z
0 likes, 0 repeats
@baljemmett oh, right, DOS, not bios. I misremembered.
(DIR) Post #AwFera1cOpt3N8DZfE by foone@digipres.club
2025-07-18T08:02:33Z
0 likes, 0 repeats
So I wrote some code to list the contents of resource.001. Resource.dir is a pretty simple format: it's just an index of all the raw data in resource.001. next problem: figure out how to decompress these chunks.
(DIR) Post #AwFeuOXXYcoEcWUWZs by foone@digipres.club
2025-07-18T08:02:51Z
0 likes, 0 repeats
first idea: breakpoint the game in DOSBox, find it reading a chunk, and see what it calls next
(DIR) Post #AwFexoDgXMtT8Kpf3w by foone@digipres.club
2025-07-18T08:03:50Z
0 likes, 0 repeats
Int 21/AH=3Fh, where are you?
(DIR) Post #AwFfIecrP0iPSYY0g4 by foone@digipres.club
2025-07-18T08:07:40Z
0 likes, 0 repeats
I wonder how hard it would be to make this better (IO tracing).probably "quite a bit" because I'd need to hack it into dosbox-x
(DIR) Post #AwFfObnapFYOQhPI8W by foone@digipres.club
2025-07-18T08:08:41Z
0 likes, 0 repeats
maybe I make it generic and hack in a way to add ad-hoc logging to dosbox. like "save some watch-expressions to a file every time a pseudo-breakpoint is fit"
(DIR) Post #AwFfRMKQngpfJm4uvI by foone@digipres.club
2025-07-18T08:08:49Z
0 likes, 0 repeats
then build an IO tracer on that
(DIR) Post #AwFfVw29zUxtDLiKsC by GezThePez@mastodon.scot
2025-07-18T08:10:00Z
0 likes, 0 repeats
@foone lzw lossless algorithm
(DIR) Post #AwFfuzUCID9pA1m9gW by foone@digipres.club
2025-07-18T08:14:32Z
0 likes, 0 repeats
hmm. they read resource.dir in one read of 16384 bytes. but the file is currently 15062 bytes, and grows by 25 bytes per chunk. They were close to not being able to read the whole thing
(DIR) Post #AwFfytJFCQBjA8VpD6 by foone@digipres.club
2025-07-18T08:15:15Z
0 likes, 0 repeats
reverse engineering is a fun drug that makes you think about potential bugs that could have existed (but don't) in software from 30 years ago
(DIR) Post #AwFg66l1b90etjwp4S by foone@digipres.club
2025-07-18T08:16:30Z
0 likes, 0 repeats
I did some manual tracing of file handles to file names.it turns out that file #5 is ssw.cfg, #5 is resource.dir, and #5 is resource.001.(it closes each file before opening a new one, so they all got the same id)
(DIR) Post #AwFgGlJvdn5db7M16e by foone@digipres.club
2025-07-18T08:18:31Z
0 likes, 0 repeats
hmm. that may be just designed into their IO system, it seems they're reading resource.001 in 16384 blocks. chunks are bigger or smaller than that...
(DIR) Post #AwFgJippL2LCl2gZjU by philpem@digipres.club
2025-07-18T08:18:32Z
0 likes, 0 repeats
@foone It's even more fun when you do that and it ends in a CVE for a current product.
(DIR) Post #AwFhCI7ANxKXoTogwC by foone@digipres.club
2025-07-18T08:28:49Z
0 likes, 0 repeats
oh hey that's the EMS page size. that's definitely related
(DIR) Post #AwFhVx6GE7ukQflgGW by foone@digipres.club
2025-07-18T08:32:28Z
0 likes, 0 repeats
oh fuck me do they just inhale the whole file into RAM?
(DIR) Post #AwFha3lrMm70HFBUMy by foone@digipres.club
2025-07-18T08:33:13Z
0 likes, 0 repeats
the pirates who wrote the info.txt file say the minimum ram is 4mb, and the datafile is 5mb. so no, they must not.
(DIR) Post #AwFhzwyRGCpwj2PhJ2 by foone@digipres.club
2025-07-18T08:37:54Z
0 likes, 0 repeats
this code is an interesting mixture I've not personally run into before: it's 32bit, real mode. So they're still using segmented memory (and it uses LIM EMS for >640kb), and require a 386 (because they use 32bit registers often) but it's still in real mode
(DIR) Post #AwFi3qhSWp2yQSKYRE by foone@digipres.club
2025-07-18T08:38:32Z
0 likes, 0 repeats
at least for now. maybe it switches into protected mode for each sub-game?
(DIR) Post #AwFibrwyO1aU9IoDvE by neko@aus.social
2025-07-18T08:44:38Z
0 likes, 0 repeats
@foone do you not?
(DIR) Post #AwFir89QQze2jruWfY by foone@digipres.club
2025-07-18T08:47:26Z
0 likes, 0 repeats
@neko yeah but I live in 2025 where I have 16gb of ram even on this shit laptop, not back in 1995 when I only had 4mb
(DIR) Post #AwFj8NNZ4P8UtHkPce by neko@aus.social
2025-07-18T08:50:35Z
0 likes, 0 repeats
@foone Oh, no way, I live in 2025 too!... wouldn't recommend it.
(DIR) Post #AwFjBV46wuqXb88cEa by foone@digipres.club
2025-07-18T08:51:05Z
0 likes, 0 repeats
hmm. this code reads 0x8000 bytes each pass, but the pointer stays the same: 0.but they adjust DS up by 0x800 each loop. seems ugly from a future prospective, but I guess it makes sense. the segments are only 64kb, and you're reading 32kb each run though. adjusting the pointer would make less sense
(DIR) Post #AwFjf60Kgp9IYnU0bg by foone@digipres.club
2025-07-18T08:56:30Z
0 likes, 0 repeats
the game definitely does seem to be trying to read the whole datafile into RAM. and according to it, it only needs 2240 kb of EMS free. How's it loading 5mb into that?
(DIR) Post #AwFkCMWYI67rLqPr6W by foone@digipres.club
2025-07-18T09:02:29Z
0 likes, 0 repeats
it only allocates one (16kb) page? WHAT ARE YOU EVEN DOING
(DIR) Post #AwFkELtVbSZbyf6QSm by ozzelot@mstdn.social
2025-07-18T09:03:18Z
0 likes, 0 repeats
@foone time lord allocation
(DIR) Post #AwFkOFWM9csj6ezbcW by foone@digipres.club
2025-07-18T09:04:32Z
0 likes, 0 repeats
I'm looking at the wrong fucking code.this is the code to load the resource.dir file. which is 15kbOF COURSE THEY ONLY NEED ONE PAGE
(DIR) Post #AwFkPskLnd5X3JJhxI by foone@digipres.club
2025-07-18T09:05:01Z
0 likes, 0 repeats
@ozzelot ooh, I want a tardis::malloc function! reserve ram in chips that are bigger on the inside!
(DIR) Post #AwFkicAjeB2V9Laflg by foone@digipres.club
2025-07-18T09:08:17Z
0 likes, 0 repeats
okay. the first file it loads is "main.drv". makes sense.
(DIR) Post #AwFl3ArgN0NiXTTxaK by ozzelot@mstdn.social
2025-07-18T09:12:29Z
0 likes, 0 repeats
@foone My 60GB iPod had a tendency to show up as being implausibly large; don't remember the exact size, but it might have reported hundreds of terabytes or even low petabytes. To this day, I have no idea what caused it. (Nothing was readable, of course.)
(DIR) Post #AwFn97UC2rv9hnST44 by foone@digipres.club
2025-07-18T09:35:31Z
0 likes, 0 repeats
arg. can't find the compression. the CPU trace starts skipping after a point, in some kind of weird DOSBox bug I don't understand
(DIR) Post #AwFntMlLZyACPEX9LE by foone@digipres.club
2025-07-18T09:43:55Z
0 likes, 0 repeats
hey future foone: this is past foone. hi. turn off the dynamic core. it fucks up the debugger
(DIR) Post #AwFoPMEf4gsO2OV3qK by foone@digipres.club
2025-07-18T09:49:39Z
0 likes, 0 repeats
ugh. this call goes directly to a function that instantly RETs.that makes me suspicious. these demoscene punks better not be dynamically changing the code
(DIR) Post #AwFpCUrdmXw4zMACUS by foone@digipres.club
2025-07-18T09:58:35Z
0 likes, 0 repeats
hmm. a bunch of functions start with NOP. and a bunch start with RET.those are both one-byte instruction. I wonder if they're dynamically turning functions on and off by swapping them between NOP & RET ?
(DIR) Post #AwFqZ9fOrM0ZrPo2ee by foone@digipres.club
2025-07-18T10:13:36Z
0 likes, 0 repeats
@alilly I tend to scream anyway when that happens
(DIR) Post #AwFsIFL6iP9ERJNat6 by mkoek@mastodon.nl
2025-07-18T10:33:03Z
0 likes, 0 repeats
@foone could be an optimization to remove a dynamic check on something that changes only once, or only rarely - but then I would find something more useful than a NOP to put there 😀
(DIR) Post #AwFtItm0U0TBnTpv3A by foone@digipres.club
2025-07-18T10:44:31Z
0 likes, 0 repeats
this game makes use of the optimization that filenames are exactly 4 words long.
(DIR) Post #AwFtMyvfFvWUwhIhjE by foone@digipres.club
2025-07-18T10:45:16Z
0 likes, 0 repeats
12345678.ABCit writes it as one 32bit int (1234), another (5678), and a third (.ABC)
(DIR) Post #AwFtQ0tMPlO1tzfWEq by foone@digipres.club
2025-07-18T10:45:40Z
0 likes, 0 repeats
except 4321,8765,CBA. because little endian
(DIR) Post #AwFvouHeJwiKYT1lBI by foone@digipres.club
2025-07-18T11:12:37Z
0 likes, 0 repeats
@riley Denmark, apparently.
(DIR) Post #AwFywq4GBASDetEqf2 by foone@digipres.club
2025-07-18T11:47:44Z
0 likes, 0 repeats
I still can't find the decompression routine! I've manually stepped through every single function in the EXE. I must have missed it... unless it loads some chunks uncompressed and one of them is the uncompressor?
(DIR) Post #AwG0Yi06iiJJb6uxqy by foone@digipres.club
2025-07-18T12:05:45Z
0 likes, 0 repeats
ugh i think I found the dynamic code. it doesn't make any sense, it's overwriting a 1 or 0 on a CALL, not doing a RET/NOP switch
(DIR) Post #AwG1Zkjy7T3oL2Qlu4 by foone@digipres.club
2025-07-18T12:17:07Z
0 likes, 0 repeats
I found a function that vaguely looks like a decompression routine... naturally it's never called
(DIR) Post #AwG7bJEvw761Lp2Wa8 by foone@digipres.club
2025-07-18T13:24:37Z
0 likes, 0 repeats
I've mapped out 27 of the 80 possible f1 subfunctions
(DIR) Post #AwGAML9wohoqp6GH0y by deater78@mastodon.social
2025-07-18T13:55:28Z
0 likes, 0 repeats
@foone I wrote a game like that back in the day, probably in a similar timeframeIt was written in Turbo Pascal which could only do real mode, but I was targeting a 386 so it had a lot of hand-written x86 32-bit assembly sprinkled in. Also the soundblaster code I was using (also written by a teenager) was using XMS (I think?) to store the sound samples
(DIR) Post #AwGED36oxTDe3Ecktc by olsner@social.vivaldi.net
2025-07-18T14:38:15Z
0 likes, 0 repeats
@foone although widely believed to have been released by Intel in 1985, new research indicates the 386 co-evolved with archaic humans in the Middle to Late Pleistocene.
(DIR) Post #AwGHp5VulWUENNBvQO by foone@digipres.club
2025-07-18T15:19:10Z
0 likes, 0 repeats
@NekoEd no, they're not doing anything tricky with segment registers, they're just making use of 32bit registers for some math
(DIR) Post #AwHMZ8Tag2UnrMHEcS by foone@digipres.club
2025-07-19T03:16:29Z
0 likes, 0 repeats
okay so I can breakpoint two points:A. when (and thus where) the compressed data is loaded out of the file2.When that decompressed code is first executed. Now I just need to find out what happens in between, to find the decompression
(DIR) Post #AwHMZ9FRo6mEFmfSDI by foone@digipres.club
2025-07-19T03:18:16Z
0 likes, 0 repeats
the main problem is that I'm not 100% sure that there's only one step A: I think it loads several chunks that are code: I'm not sure which one it executes first
(DIR) Post #AwHMZ9wLEd5WOoji4W by foone@digipres.club
2025-07-19T03:19:41Z
0 likes, 0 repeats
back to the debugger mines
(DIR) Post #AwHPItPxCGMENwWRge by rotopenguin@mastodon.social
2025-07-19T04:05:20Z
0 likes, 0 repeats
@trysdyn @foone I love how devs sometimes get so bent out of shape doing this that they create entirely unnecessary compatibility and support headaches.
(DIR) Post #AwHPIumg7G84ciA6kK by foone@digipres.club
2025-07-19T04:08:34Z
0 likes, 0 repeats
@rotopenguin @trysdyn I know people who use FAT32 in 2025 and they're all cowards
(DIR) Post #AwHPOyKfpv8nMjx3IW by foone@digipres.club
2025-07-19T03:55:40Z
0 likes, 0 repeats
okay so I've identified f1 subfunction 0501, which looks up a chunk by name and then allocates memory for it (it doesn't seem to load it, just get read to load it)but the thing is, the first thing it loads is some cutscene stuff.but none of the code in the EXE tries to load cutscene stuff. so it's already loaded MAIN.DRV (presumably) by this point. Meaning it has an API for loading chunks from the file, and it's NOT USING IT
(DIR) Post #AwHWFnK06Xm8HzCvWC by foone@digipres.club
2025-07-19T03:55:49Z
0 likes, 0 repeats
why must you do this to me, game
(DIR) Post #AwHWFo6ZByciibviDY by foone@digipres.club
2025-07-19T03:57:33Z
0 likes, 0 repeats
sometimes I dream of a world where every game doesn't design their own WAD file and we just store game assets IN THE FILESYSTEM and I haven't spent half my life figuring out how they hide some game resource in some weird bin file
(DIR) Post #AwHWFodXDOzkMrM2bY by foone@digipres.club
2025-07-19T04:39:24Z
0 likes, 0 repeats
okay it seems to be decompressing in the function I called load_some_chunks.it's one of those fuckers where they interleaved the decompression with file reading. and also I think this is a relatively simple RLE system?
(DIR) Post #AwHWFpiXCIaXiehY2K by foone@digipres.club
2025-07-19T04:40:05Z
0 likes, 0 repeats
my kingdom for a step-to-return in dosbox's debugger
(DIR) Post #AwHWFqrmvNaJHe2S6C by foone@digipres.club
2025-07-19T04:40:23Z
0 likes, 0 repeats
I'm gonna rewrite the whole debugger in python so I can add 5000 features. I'm gonna do it
(DIR) Post #AwHWYz86QVKqPgnEBc by foone@digipres.club
2025-07-19T04:47:45Z
0 likes, 0 repeats
Finally got an example of compressed data & uncompressed data
(DIR) Post #AwHWuC8FHNncovyPTc by kg6hxm@social.makerforums.info
2025-07-19T04:53:28Z
0 likes, 0 repeats
@fooneDo it. I believe in you.
(DIR) Post #AwHYj0kLTBzKERaasC by whitequark@mastodon.social
2025-07-19T04:21:42Z
0 likes, 0 repeats
@foone "find the entry point and shove it into unicorn"?
(DIR) Post #AwHfuEoiCDIKjdvr4i by vurpo@mastodon.coffee
2025-07-19T07:21:44Z
0 likes, 0 repeats
@foone but but we can't assume there will always be a filesystem! /s
(DIR) Post #AwHt2rB0l4uhQUnop6 by rakslice@mastodon.social
2025-07-19T04:28:56Z
0 likes, 0 repeats
@foone i do wonder what you would do with all your free time in that timeline :P
(DIR) Post #AwHtBRTrfG6EL1iO4O by foone@digipres.club
2025-07-19T04:37:46Z
0 likes, 0 repeats
@rakslice hack more games, since I wouldn't have spent half my game-hacking time on the fucking resource files!
(DIR) Post #AwHtFejqJYxicACKi8 by Alrecenk@peoplemaking.games
2025-07-19T09:04:07Z
0 likes, 0 repeats
@foone #PortalFoxesTD uses the open GLB format for models, WAV for audio, and the levels and story are loaded from plaintext JSON files. Nothing is even compressed, and the whole game is still only like 30 MB. I wasn't trying to make it hackable. I just don't want to deal with that shit either.
(DIR) Post #AwHtH4wINzDAAGhWL2 by foone@digipres.club
2025-07-19T04:26:50Z
0 likes, 0 repeats
@whitequark possibly! I gotta find it first, which is proving to be the tricky part
(DIR) Post #AwHukBbMnI0VBDM4Ui by eniko@mastodon.gamedev.place
2025-07-19T08:19:20Z
0 likes, 0 repeats
@foone hey so I have good news for you about Kitsune Tails
(DIR) Post #AwHvymdM0SMy2boDQ0 by Ra@mstdn.social
2025-07-19T05:07:29Z
0 likes, 0 repeats
@foone That's so weird, what is all the '...' padding for in the uncompressed version?
(DIR) Post #AwHxSNEZ6fu3uGt6iu by brouhaha@mastodon.social
2025-07-19T04:32:00Z
0 likes, 0 repeats
@foone Me too.
(DIR) Post #AwICiroMgeMCgcxIcy by ClarusPlusPlus@gamedev.lgbt
2025-07-19T04:02:25Z
0 likes, 0 repeats
@foone *raises hand* I was guilty of that as recently as Acronia.Never again.
(DIR) Post #AwIp4FmMZE4HMPdzTk by pyromuffin@mastodon.gamedev.place
2025-07-19T20:41:03Z
0 likes, 0 repeats
@foone sorry we love to just mmap
(DIR) Post #AwJAQ9oZWNWUGpxllA by foone@digipres.club
2025-07-20T00:40:27Z
0 likes, 0 repeats
@pyromuffin this is game from 1995! there is no mmap yet!
(DIR) Post #AwJYuLqFlc4v9wgDce by foone@digipres.club
2025-07-20T05:14:44Z
0 likes, 0 repeats
the code looks relatively RLE but from looking closer at the compressed/uncompressed data, yeah this is doing lookbehind stuff. so it's presumably some kind of LZ*
(DIR) Post #AwJZrUcukTH9UTdqRE by foone@digipres.club
2025-07-20T05:25:31Z
0 likes, 0 repeats
(DIR) Post #AwJaTBd3pUztZggSci by foone@digipres.club
2025-07-20T05:32:21Z
0 likes, 0 repeats
this compression uses BP as the variable for how much into the loaded data it is, which is a slightly annoying choice since BP is normally used as frame pointer.
(DIR) Post #AwJb8KIMVvCSKDcS1o by barubary@infosec.exchange
2025-07-20T05:39:42Z
0 likes, 0 repeats
@foone It's a free register.
(DIR) Post #AwJbUIYPfTJdIPbV8i by foone@digipres.club
2025-07-20T05:43:48Z
0 likes, 0 repeats
compression_mask = (1 << num_bits) - 1;oh hey math! that formula gives you a mask with that many bits set. so 1 is 1, 2 is 11(binary), 3 is 111(bin), 4 is 1111(bin), etc.
(DIR) Post #AwJc9tPNY7UBTEDCc4 by foone@digipres.club
2025-07-20T05:51:16Z
0 likes, 0 repeats
interesting. this code keeps a running checksum of the decompression, using the source bytes. but then it never checks it!
(DIR) Post #AwJce2YC7i44Vni8Ku by cinebox@masto.hackers.town
2025-07-20T05:56:40Z
0 likes, 0 repeats
@foone uncheckedsum
(DIR) Post #AwJctbwgo82odDaozY by foone@digipres.club
2025-07-20T05:59:32Z
0 likes, 0 repeats
they read every byte twice in their inner loop. come on guys, AL already has the current byte in it, you don't need to read it again! that's, like, 4 cycles on a 386!
(DIR) Post #AwJdceSSJUPbSFvc8G by foone@digipres.club
2025-07-20T06:07:39Z
0 likes, 0 repeats
every time they read a byte, they rotate a 16bit word in memory that's initialized to 0x8000. Every time the bit rotates around (so one out of every 16 bytes), THEN it updates the input checksum. but only then!
(DIR) Post #AwJdiMswYrwMgv2lZA by foone@digipres.club
2025-07-20T06:08:44Z
0 likes, 0 repeats
this saves like one byte on the traditional way to do this, where you have a variable that counts up and you reset it when it hits max.
(DIR) Post #AwJdkxa36HUR4wRRy4 by foone@digipres.club
2025-07-20T06:09:05Z
0 likes, 0 repeats
which is a nice optimization on something they forgot to use
(DIR) Post #AwJgGeI4YTkoQXGtcW by foone@digipres.club
2025-07-20T06:37:16Z
0 likes, 0 repeats
there are definitely two functions that read chunks, but they do it slightly differently. I'm not sure why yet
(DIR) Post #AwJhXjATm1xOQoQYzY by foone@digipres.club
2025-07-20T06:51:32Z
0 likes, 0 repeats
ahh! one of them allocates some memory for the loaded chunk, the other one takes a pointer and overwrites
(DIR) Post #AwJiaw2STeoxAilkIa by foone@digipres.club
2025-07-20T07:03:25Z
0 likes, 0 repeats
@cinebox nice
(DIR) Post #AwJyNQbTdjVZBBjKQy by foone@digipres.club
2025-07-20T10:00:06Z
0 likes, 0 repeats
I've named 121 of 123 functions.but keep in mind, at least 16 of them are NOPs
(DIR) Post #AwfJYslzcLdX5YvezY by foone@digipres.club
2025-07-30T17:06:28Z
0 likes, 0 repeats
@marcel you'd think. maybe there's more to it that I don't understand yet?