Separate thread (from Bible Builder) for hacking on Captain Bible in Dome of Darkness
Conversation
Notices
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:03:01 JST Foone🏳️⚧️
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:04:40 JST Foone🏳️⚧️
it looks to use a very similar DAT format to Bible Builder, including .ART chunks. I've not looked into the details of the formats yet though, so they may be different.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:05:09 JST Foone🏳️⚧️
Bible Builder was 1992, Captain Bible was 1994.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:21:04 JST Foone🏳️⚧️
oh yeah, the thing that nerdsniped me last time: the fact you can only see the map by hitting a button.
With my form of ADHD, that's a pain... so I go "hey why don't I just hack it so I can see my position while I'm walking around the overworld?" and I get bogged down in that until I run out of fixation
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:22:44 JST Foone🏳️⚧️
hopefully that won't happen this time.
but on an unrelated note I've already figured out where the game stores your X/Y position on the map, it's at 1E06:0 for X, and 1E06:2 for Y
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:24:51 JST Foone🏳️⚧️
this, btw, is the only game I know of where your boss prays with your character before you go on the mission.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:28:27 JST Foone🏳️⚧️
also I think this game is technically a metroidvania? it's just one where the keys you pick up are bible verses
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:32:30 JST Foone🏳️⚧️
@TomF no, I'm allergic
-
Tom Forsyth (tomf@mastodon.gamedev.place)'s status on Monday, 17-Feb-2025 11:32:31 JST Tom Forsyth
@foone You need to play more WH40k :-)
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:37:58 JST Foone🏳️⚧️
I restored an earlier save (for cheat-finding reasons) continued playing, then realized I had to backtrack because I forgot to pick up the Proverbs 22:15 so now I can't get through this door
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 11:44:15 JST Foone🏳️⚧️
1 Corinthians 15:4-6 is really the Hookshot of Captain Bible
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 12:12:13 JST Foone🏳️⚧️
@jonhendry hah, oh dear!
-
Jonathan Hendry (jonhendry@iosdev.space)'s status on Monday, 17-Feb-2025 12:12:14 JST Jonathan Hendry
About 30 years ago (fuck) after lunch I and some coworkers stopped in at an odd “remaindered software" shop near La Jolla. There was a table full of boxes for something called “Screen Savior”. I said something like “ooh, screen savior” and a chuckle. (Nothing too caustic or nasty.)
Voice from the checkout counter “I wrote that”.
Awkward.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 12:23:51 JST Foone🏳️⚧️
yeah the DAT format is similar enough that my bible builder tools can open it
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 12:32:43 JST Foone🏳️⚧️
but the way I cheated at compression isn't gonna work here, not without redoing all that work.
UGH I hate compression algorithms
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 12:44:41 JST Foone🏳️⚧️
oh hey, multi-return! that's not something you can do in C! (I mean, at least not elegantly
someone wrote some assembly.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 12:50:31 JST Foone🏳️⚧️
WHAT DO YOU MEAN PART OF THE DECOMPRESSION ALGORITHM IS RECURSIVE
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 14:13:45 JST Foone🏳️⚧️
ghidra is asking me philosophical computer science questions, like "can you have two distinct variables with the same data type and stored in the same location?"
either that or it's just completely confused disassembling this function
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 14:18:17 JST Foone🏳️⚧️
I don't mean to alarm anyone, but I just realized the decompression algorithm doesn't return. ever.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 14:19:40 JST Foone🏳️⚧️
OH GOD I THINK IT USES A DOUBLERETURN
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 14:20:20 JST Foone🏳️⚧️
double return is a secret feature never included in C, where you can do "returnreturn;" and it returns from your parent function
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 14:21:10 JST Foone🏳️⚧️
you of course can't really do this in C
but you can in x86 assembly: pop your own return address into a temp register, then do the cleanup for your parent function, then return. now you return to what your parent function was called from!
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 15:50:04 JST Foone🏳️⚧️
oh goody the recursive function is using tagged pointers.
15 bit pointers... -
Foone🏳️⚧️ (foone@digipres.club)'s status on Monday, 17-Feb-2025 15:51:03 JST Foone🏳️⚧️
32kb ought to be enough for anyone!
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 18-Feb-2025 09:38:20 JST Foone🏳️⚧️
trying to get back to compression hacking and I can't find the source. there's some files named "decomp" in my hack folder for this game, but they're all assembly, because of my hack with using the game to extract its own files.
I finally find it: crying.py
I should have guessed! -
Foone🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 18-Feb-2025 10:18:52 JST Foone🏳️⚧️
AHHH HOW DO I SUPPORT HAVING AN ARRAY THAT'S ALSO SOME LOCAL VARIABLES IN PYTHON WITHOUT DRIVING MYSELF MAD?
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 18-Feb-2025 10:26:20 JST Foone🏳️⚧️
@parsingphase this is a decompression implementation, even I am not mad enough to attempt writing a compressor
-
Parsingphase (parsingphase@m.phase.org)'s status on Tuesday, 18-Feb-2025 10:26:21 JST Parsingphase
@foone and you adjust the compression level by telling it to cry harder?
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 18-Feb-2025 10:45:18 JST Foone🏳️⚧️
okay I have rewritten 90% of the decompression routine I don't understand in python. I just need to do the recursive function, but this is giving me a migraine. So hopefully I can do the remaining 10% later
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 02:19:28 JST Foone🏳️⚧️
what the fuck does unaff_00000015 mean, ghidra?
an unaffected... 15 constant?
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 02:22:28 JST Foone🏳️⚧️
it was caused because this function takes a parameter in BP. You're not supposed to do that, but you can. There's no x86 cops.
but ghidra for some reason thought it was a undefined, which is a 1-byte type. BP is a 16-bit register. So instead of just using the parameter directly, it decompiled the code as doing this:
iVar7 = CONCAT11(unaff_00000015, bp_parameter)
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 02:24:24 JST Foone🏳️⚧️
if I instead tell it bp_parameter is a word, it just stops decompiling an iVar7 variable at all, and uses bp_parameter itself
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 10:17:28 JST Foone🏳️⚧️
I caught myself thinking "at this rate, maybe I should just write an x86 machine code to python transpiler" and that's really too much
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 10:18:17 JST Foone🏳️⚧️
my brain is constantly coming up with weirder and worse solutions to this "reverse the decompression" problem because I HATE REVERSING DECOMPRESSION and it leads me to constantly try to think of ways to make it easier by not doing it
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 10:19:04 JST Foone🏳️⚧️
anything to avoid having to reverse decompression
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 10:19:57 JST Foone🏳️⚧️
I haven't even completed this script enough for it to run, and already I'm thinking about completely rewriting it. The way I structured it is proving to be too hard to implement the last bits into.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 10:20:40 JST Foone🏳️⚧️
I might even switch to my terrible "implement bochcpu-lib emulation from python to just emulate the original code" idea to avoid having to actually finish this
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 11:30:24 JST Foone🏳️⚧️
okay I wrote a module to let me define some memory and then define multiple variables of different types in it, and it's all backed by the same set of bytes and you can read and write from any of them and they'll all work.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 11:30:57 JST Foone🏳️⚧️
so basically I removed type safety from python, kinda.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 11:31:41 JST Foone🏳️⚧️
but this'll make it way easier to port the decompiled decompression routine without having to understand how it works.
which I don't
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 11:33:05 JST Foone🏳️⚧️
I'm gonna have two of these Memory objects for DS and ES, and since I haven't implemented it I'm gonna PRAY the fact that those two segments are partially overlapping doesn't matter
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 11:33:41 JST Foone🏳️⚧️
if it does end up mattering, I'm gonna cry a lot, then implement OVERLAPPING MEMORY RANGE EMULATION
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 13:07:01 JST Foone🏳️⚧️
@SvenGeier pretty much!
-
Σ(i³) = (Σi)² (svengeier@mathstodon.xyz)'s status on Wednesday, 19-Feb-2025 13:07:02 JST Σ(i³) = (Σi)²
@foone So you implemented the FORTRAN "COMMON" block in python?
(I keep saying real programmers can write FORTRAN programs in any language...)
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 23:43:53 JST Foone🏳️⚧️
My everything hurts, I'm starving and can't eat, my brain is fogged, and I have a lot of stuff to do today that's important.
Clearly it's time to write my own x86 emulator, again
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Wednesday, 19-Feb-2025 23:45:35 JST Foone🏳️⚧️
I should build an x86 usb device. It's stupid because I literally am on an x86 machine, but SOMEONE didn't think 16bit backwards compatibility was important. Philistines!
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 02:21:41 JST Foone🏳️⚧️
I finally went and confirmed something I assumed:
The compression routines from Bible Builder and Captain Bible are identical. like, I'm not even sure they were even recompiled identical.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 02:25:39 JST Foone🏳️⚧️
okay it was recompiled/reassembled: some globals are in different locations.
but it's 100% the same code.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:34:02 JST Foone🏳️⚧️
alright, I ported over enough of the decompression algorithm for it to run for the first time!
Did it work? NO OF COURSE NOT! but running is at least PROGRESS
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:35:04 JST Foone🏳️⚧️
it "decompressed" to the compressed input, but with 3 bytes missing from the beginning and an extra "G" at the end.
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:36:11 JST Foone🏳️⚧️
if you decompress a file and it gets smaller, you fucked up.
(or it has really high entropy and your compression algorithm has a big header)
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 03:53:12 JST Foone🏳️⚧️
@lunarood would you like to make a contract?
-
Luna Rood (lunarood@mastodon.gamedev.place)'s status on Thursday, 20-Feb-2025 03:53:13 JST Luna Rood
@foone Wait a second... How did you get your hands on the very thing I'm working on right now?
Leave my entropy alone! It's there for a reason, ok!? 😤
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 04:06:51 JST Foone🏳️⚧️
after fixing some bugs, I am now correctly decompressing an entire 8 bytes!
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 05:03:14 JST Foone🏳️⚧️
I suspect the tables aren't getting filled in correctly. I'm gonna need to set some breakpoints in both the python and DOS implementations and compare the current state of the tables.
ugh. my kingdom for a automatable dosbox debugger
-
Foone🏳️⚧️ (foone@digipres.club)'s status on Thursday, 20-Feb-2025 10:01:38 JST Foone🏳️⚧️
ran though about 300 iterations and the word table never gets filled in. on either implementation, the original or mine.
I understand this code way less than I thought
-