here's the 0A ("farm") tile: it turns out it's a mix of farms, ranches, and grain elevators.
Conversation
Notices
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:34 JST
Alice Averlong🏳️⚧️
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:20 JST
Alice Averlong🏳️⚧️
god help me I don't want to have to write an extension to link ghidra and dosbox but that might be easier on my brain than figuring out this whole compression algorithm without being able to see all the RAM at once
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:21 JST
Alice Averlong🏳️⚧️
who wants to play Railroad Tycoon on Memory Uninitialized World?
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:21 JST
Alice Averlong🏳️⚧️
fun fact: because the saved game map files are the same format as PIC, you can swap them around. Want to build a railroad on Lenin's face? YOU CAN!
GreenSkyOverMe (Monika) repeated this. -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:22 JST
Alice Averlong🏳️⚧️
yeah I'm randomly corrupting it, and this isn't any RLE. This is definitely some kind of LZ*-style compression
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:23 JST
Alice Averlong🏳️⚧️
so what the heck
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:23 JST
Alice Averlong🏳️⚧️
well I interestingly corrupted it
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:24 JST
Alice Averlong🏳️⚧️
NOPE! I decoded (using my load-it-as-a-logo trick) the all-1 and all-2 tiles and got this. They're fully one color.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:25 JST
Alice Averlong🏳️⚧️
okay so a map of all the same tile results in an 83 byte file, which only varies in one byte (0x7) which is the specified byte that it's full of.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:25 JST
Alice Averlong🏳️⚧️
now the reason it's not smaller is that a map actually looks like this:
It's a 320x200 pixel image, with only the top-left 256x192 actually used for the map. Most of those 83 bytes are probably encoding the rest of this area
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:26 JST
Alice Averlong🏳️⚧️
and done.
I was so busy trying to use my HACKER SKILLS to realize I didn't need to
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:27 JST
Alice Averlong🏳️⚧️
well my code was supposed to generate a world that's entirely water, but I got the 05 or 08 world. strange.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:27 JST
Alice Averlong🏳️⚧️
oh I'm a doofus.
I was trying to hack the game to save a game where every tile is 01, so that it would be "pure" and not mixed 01 tiles and 01-spans.
but I have already made the mixed map: I can just load it, and SAVE IT BACK OUT
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:28 JST
Alice Averlong🏳️⚧️
MOV AL, 01
MOV DI, [BP-6]
MOV CX, 320
REP STOSBthat's 10 bytes.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:29 JST
Alice Averlong🏳️⚧️
so I need to write 256 bytes into RAM, without a pointer to it, in... 5 bytes.
oh boy
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:29 JST
Alice Averlong🏳️⚧️
okay maybe I can take out a function call
that gives me like, 45 bytes. more than enough -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:30 JST
Alice Averlong🏳️⚧️
it's possible the intermediate RLE is making this weirder than it should be. I should try hacking the map to be fully one type PRIOR to the intermediate RLE step
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:31 JST
Alice Averlong🏳️⚧️
judging by how this works
I think it might be writing data files in 47-bit chunks?
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:31 JST
Alice Averlong🏳️⚧️
so, a datapoint:
a map entirely full of 01 and a map entirely full of 02 are different by 4 bytes, scattered around the 5k file. -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:32 JST
Alice Averlong🏳️⚧️
okay checked the rest (except rivers, because... no)
so 05 and 08 are mines, 0a is farms/ranches/grain elevators, 0c is village/industries, 0e is cities and industries, and the rest (at least in 16 and under) are single-types.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:33 JST
Alice Averlong🏳️⚧️
villages are also paper mills, stock yards, factories, and food proc.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Tuesday, 19-Dec-2023 04:37:34 JST
Alice Averlong🏳️⚧️
0b (foothills) are not special. set it to all 0b, and you really get all 0b
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:03:53 JST
Alice Averlong🏳️⚧️
anyway this is where I'm leaving it for now:
stations are all rendered as Depots and the special industries/landings are all being located wrong. But that's a lot of progress!
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:04:43 JST
Alice Averlong🏳️⚧️
they store the type of the station outside of the tracks list, which is weird. annoying.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:05:19 JST
Alice Averlong🏳️⚧️
gah.
There's 4 types of stations: and three types of stations in the tiles.
these fuckers generate one of the 4 variants at runtime
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:05:37 JST
Alice Averlong🏳️⚧️
yeah it seems to basically draw the regular track, but it offsets it tangent to the track direction.
2 pixels in each direction
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:05:47 JST
Alice Averlong🏳️⚧️
yeah I can't fully decode this (TOO PLANAR) but I'm pretty sure there's no doubled tiles here. it generates them when it draws the double-tracks
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:05:57 JST
Alice Averlong🏳️⚧️
I thought I might could cheat and just pull the generated tiles from RAM but I forgot, this is EGA: it's PLANAR
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:05 JST
Alice Averlong🏳️⚧️
oh god
you can have double tracks, right?
but where are the tiles for the double tracks stored?answer: NOWHERE! they get generated at runtime!
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:14 JST
Alice Averlong🏳️⚧️
completely normal train layout
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:21 JST
Alice Averlong🏳️⚧️
found another bug:
the game doesn't use the same bridge logic for AI players as the human player. This means that they can make really really long bridges
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:26 JST
Alice Averlong🏳️⚧️
gah this is weird.
the tracks tilesheet is 20x20, right?
but the rest of the tiles are 16x16. -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:30 JST
Alice Averlong🏳️⚧️
anyway I have touched that shit yet, but I finished up the ocean stuff:
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:36 JST
Alice Averlong🏳️⚧️
meaning my individual per-tile work isn't helping. fuck.
I'm gonna need to either do a LOT of testing with variations... or find the code. Either are going to be hard
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:40 JST
Alice Averlong🏳️⚧️
but I don't think this is actually how the game works. I think it's more like there's a single running accumulator which affects ALL types of special tiles.
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:43 JST
Alice Averlong🏳️⚧️
so I think I've fundamentally misunderstood how this works.
my theory was that a given tile would default to a standard thing, but then it would pick a secondary thing depending on where it is on the map. Things like "every 6th tile can be a coal mine".
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:48 JST
Alice Averlong🏳️⚧️
okay I think I've found a problem.
I can generate single-tile maps and they work exactly the same in my rendererbut then I render a real map and a bunch of things are misaligned
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:52 JST
Alice Averlong🏳️⚧️
okay I have a HALF RIVER WORLD, which does load properly.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:06:56 JST
Alice Averlong🏳️⚧️
hmm. I can't load up the riverworld (damn you Philip José Farmer!) because it hangs the game
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:00 JST
Alice Averlong🏳️⚧️
uh oh. there's some incorrectly placed blocks
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:03 JST
Alice Averlong🏳️⚧️
wow. the river layout code worked first try! I'm a better programmer than I thought.
The "landing"s aren't working yet though, because I don't know how they work. Some rivers are picked to be Landings instead of Rivers. Why? no idea
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:05 JST
Alice Averlong🏳️⚧️
I of course mean these 4 stray pixels.
whatta heck
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:07 JST
Alice Averlong🏳️⚧️
this is terrible. did you even pay attention to what you were making, Sidney?
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:10 JST
Alice Averlong🏳️⚧️
okay I gave up and just stuck the list of known positions into the script.
Here it is with 0xA (Farms/Grain/Ranch) added
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:11 JST
Alice Averlong🏳️⚧️
(0, 118), (1, 137), (2, 156), (3, 175), (8, 14), (9, 33), (10, 52), (11, 71), (12, 90), (13, 109), (14, 128), (15, 147), (16, 166), (17, 185), (21, 5), (22, 24),
what kind of pattern even is this
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:13 JST
Alice Averlong🏳️⚧️
okay. regenerated.
197 grains, 196 livestock.In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:14 JST
Alice Averlong🏳️⚧️
I ran it again... and it didn't work. FUCK
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:15 JST
Alice Averlong🏳️⚧️
ARGH this process already takes 15 minutes to run and now I need to fix it by slowing it down more
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:16 JST
Alice Averlong🏳️⚧️
yeah look.
two cursors. that's not right.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:17 JST
Alice Averlong🏳️⚧️
FUCK
my recognition is right.
my screenshots were NOT.
I think my program was taking screenshots while the game was still redrawing the screen, and so it got partial map updates
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:18 JST
Alice Averlong🏳️⚧️
FUCK something in my recognition is wrong. Those numbers are not correct
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:19 JST
Alice Averlong🏳️⚧️
okay I have now similar-image recognized my 1324 screenshots.
There are apparently 347 positions where grain mills can spawn, and 353 locations where livestock farms can spawn.now here's the real question: do I figure out the pattern? or do I just stuff that list into my script?
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:23 JST
Alice Averlong🏳️⚧️
I have taken 1,324 screenshots. that should help.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:24 JST
Alice Averlong🏳️⚧️
You ever stay up until 5:30 am and you're really really tired but you also kinda want to write some image-recognition code to extract Railroad Tycoon maps from the game?
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:25 JST
Alice Averlong🏳️⚧️
anyway here's my partial rendering of a full Railroad Tycoon map. All unhandled tiles (4, 9, A, C, D) are in black.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:26 JST
Alice Averlong🏳️⚧️
ugh. I'm gonna have to write some hacky code to explore the map and figure out what tiles are at what locations. that's gonna be a pain.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:27 JST
Alice Averlong🏳️⚧️
so I figured out the patterns of the tile types 5 and 8 (they're identical!) and E (it repeats vertically every 32 vertical tiles and pretends the map is 205 tiles tall) but tile 0xA is kicking my ass.
it's... weird. like I think it might be repeating every... 224 tiles? or 219, depending on how tall it thinks the map is?
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:28 JST
Alice Averlong🏳️⚧️
also, my trans agenda has apparently sunk the city of Redding, CA.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:29 JST
Alice Averlong🏳️⚧️
if you go into the game to see what's what, it turns out the blue is clear land, the pink is ocean, and the white is mountains
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:30 JST
Alice Averlong🏳️⚧️
There we go. The trans-continental railroad tycoon.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:31 JST
Alice Averlong🏳️⚧️
I love that it's 2023 and I just did "copy *.* A:" like it's 1981.
DOS is forever. DOS will never die
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:32 JST
Alice Averlong🏳️⚧️
and another.
I even tried on a different disk.
HOW MANY FLOPPIES ARE GONNA DIE ON MY TODAY?In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:32 JST
Alice Averlong🏳️⚧️
I grabbed another random floppy disk and it turns out it has been formatted with NTFS.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:33 JST
Alice Averlong🏳️⚧️
MY FLOPPY DISK HAS DEVELOPED A BAD TRACK ZERO?
TRANSPHOBIA!
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:34 JST
Alice Averlong🏳️⚧️
turns out the copyright notice is 63 bytes long
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:35 JST
Alice Averlong🏳️⚧️
I need to figure out where to stuff 60 bytes of VGA manipulation code though, my existing solution is kinda DOSBox-specific
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:36 JST
Alice Averlong🏳️⚧️
now I just need to write this onto a floppy disk (or two) so I can take it down to my pentium and get a picture on a CRT monitor
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:37 JST
Alice Averlong🏳️⚧️
but there we go.
There's my pink. Just needed to use the VGA registers instead of the EGA registersIn conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:37 JST
Alice Averlong🏳️⚧️
there we go. Using my patches to pic2png/png2pic and modifying EGRAPHICS.EXE to program the colors differently and a minor fix to the GAME.EXE file to send post-processed colors instead of the default ones...
BEHOLD: THE Trans(continental) Railroad Tycoon!
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:38 JST
Alice Averlong🏳️⚧️
THAT WAS THE WRONG INDEX OH GOD
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:39 JST
Alice Averlong🏳️⚧️
it helps if you don't have your DOSBox set to emulate an EGA card, I'm sure
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:40 JST
Alice Averlong🏳️⚧️
so one way I could fix this is to stay in mode 0D (320x200x16) but use the VGA palette registers instead of the EGA registers.
That'd lose the compatibility with EGA, but it's 2023, I don't think I need to worry TOO hard about that.In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:41 JST
Alice Averlong🏳️⚧️
there's my pink!
it's just rendering completely incorrectly because I'm in color mode 10 instead of 0D, so I'm seeing WAY more than I should and things are kinda terrible and different.In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:42 JST
Alice Averlong🏳️⚧️
yeah that's fine
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:43 JST
Alice Averlong🏳️⚧️
ah-ha! I found a hint:
EGA apparently only supports color remapping in 350-line mode!In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:45 JST
Alice Averlong🏳️⚧️
ugh. maybe the mod register has the shift register turned off? that supposedly enables "CGA graphics mode" which might mean 16-colors only.
unfortunately that's a read-only register
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:47 JST
Alice Averlong🏳️⚧️
that grey color is color index 07: so it's acting like it's truncating the high-bits.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:49 JST
Alice Averlong🏳️⚧️
it's in EGA/VGA video mode 0D: that's 320x200, 16 colors, 8 pages.
I don't know why it'd be interpreting my colors as weird alternative thingsIn conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:53 JST
Alice Averlong🏳️⚧️
but instead of a pink color for index 1, I'm getting grey. AAAAAA grey.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:07:56 JST
Alice Averlong🏳️⚧️
I don't get it.
I'm using the following:
INP 0x3CA; Clear 3c0 index
OUTP 0x3C0, 01 ; set 3c0 index to 1
OUTP 0x3C0, 0x27 ; set palette entry 1 to 0x27: 100111: blue/green/red on, secondary red on. This should result in color FFAAAA: a pink.INP 0x3CA
OUTP 0x3C0, 0x20 ; re-enable videoIn conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:00 JST
Alice Averlong🏳️⚧️
it's still not working. I think something deeply fucky is happening inside my virtual VGA card that's making it not properly set EGA colors.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:03 JST
Alice Averlong🏳️⚧️
Turning off the color-shifting logic makes the intro a bit uglier
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:07 JST
Alice Averlong🏳️⚧️
this translation means the actual colors end up being:
00 01 02 03 04 00 06 07 10 11 12 13 14 15 16 17I don't know why they didn't want to use that last color slot.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:10 JST
Alice Averlong🏳️⚧️
that list, btw, is the following:
00 01 02 03 04 00 06 07 08 09 0A 0B 0C 0D 0E 0FCOLOR 5 KNOWS WHAT IT FUCKING DID
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:13 JST
Alice Averlong🏳️⚧️
so the EGA/VGA driver handles colors in a weird way: The main EXE passes a list of 16 colors, and then the driver does this to all of them:
((x&0xF)+8)&0x17
why not JUST CHANGE THE LIST OF COLORS YOU TELL IT TO SET?
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:14 JST
Alice Averlong🏳️⚧️
I'm sure that's fine
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:18 JST
Alice Averlong🏳️⚧️
ugh. so the palette-setup call is into an external overlay and called from an internal overlay.
I hate 16bit DOS programming
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:20 JST
Alice Averlong🏳️⚧️
bah. dosbox doesn't let me set breakpoints on io ports.
WHY NOT?
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:22 JST
Alice Averlong🏳️⚧️
as well as put this code online and make a pull request.
but all that can wait. it's 11pm and I've been working on this project for A WEEK and my brain hurts
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:22 JST
Alice Averlong🏳️⚧️
time to close every tab and program I have open.
it's over. I won.
all that's left is bookkeepingIn conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:23 JST
Alice Averlong🏳️⚧️
so I need to do some stuff to modify this to not write PNG files but instead write binary files I can easily parse, and then I need to reverse engineer the algorithm for handling the weird tiles, where what they are depends on their position
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:25 JST
Alice Averlong🏳️⚧️
this thread has been going for a week and I finally got the result I needed and the answer has been sitting in a github repo since 2018!
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:25 JST
Alice Averlong🏳️⚧️
(okay not really. I had to modify the code, and the modifications were only possible using what I learned over this week)
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:26 JST
Alice Averlong🏳️⚧️
And it works. We have decoding of Railroad Tycoon MAP files!
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:27 JST
Alice Averlong🏳️⚧️
well it's not decoding it exactly right, but it's... close?
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:28 JST
Alice Averlong🏳️⚧️
SID MEIER'S RAILROAD TYCOON VIOLATED THE UNISYS GIF PATENT
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:29 JST
Alice Averlong🏳️⚧️
it's LZW! the same one that powers GIF
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:30 JST
Alice Averlong🏳️⚧️
and you know WHY that's a big deal?
THERE'S TOOLS THAT CAN EXTRACT COVERT ACTION FILES!
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:30 JST
Alice Averlong🏳️⚧️
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:31 JST
Alice Averlong🏳️⚧️
made a BIG discovery:
the labs.PIC file in railroad tycoon is identical to the one in Covert Action, released by Microprose the same year.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:32 JST
Alice Averlong🏳️⚧️
and there's again an interesting pattern at 9-bits wide.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:33 JST
Alice Averlong🏳️⚧️
okay it only appears in my super-compressed files. not in the semi-compressed ones or the regular compressed files.
so it's probably nothing. sadly.
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:33 JST
Alice Averlong🏳️⚧️
okay so I've done an interesting experiment: I turned off the RLE.
So the fully-compressed max-RLE version of the file is 83 bytes.
Turning off RLE means that the intermediate compression is just 01 for 64,000 times.
So how big is the output file, given that a standard map is something like 13k?it's 423 bytes!
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:34 JST
Alice Averlong🏳️⚧️
I've gotten weirder and I tried dumping a compressed map into a bitmap renderer, and there's a suspicious pattern at 9-bits wide.
is this a 9-bits-per-element format? why would you do this, sidney?
In conversation permalink Attachments
-
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:35 JST
Alice Averlong🏳️⚧️
I haven't written an x86 emulator since... oh yeah the last time I tried to reverse engineer a compression algorithm
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:36 JST
Alice Averlong🏳️⚧️
maybe I just need to write an x86 emulator
like you do
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:37 JST
Alice Averlong🏳️⚧️
although it's amusing when you see code like:
MOV BX, AX
ADD BX, AX
ADD BX, AX
SHL BX, 1
MOV AX, word ptr[BX+4]to read data from AX*6+4.
like come on, x86. don't you have a way to do a multiplication+addition pointer interdirected read in a single instruction? you're losing your touch!
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:37 JST
Alice Averlong🏳️⚧️
it probably does but this code is targeting 8086 so it couldn't use it yet
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:38 JST
Alice Averlong🏳️⚧️
it's physically impossible to stare at x86 code for long without wanting to design a RISC architecture
because good lord
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:39 JST
Alice Averlong🏳️⚧️
ahh I've hit another function where ghidra has decided it can no longer rename variables
that certainly helps me reverse this shit! I have to remember what uVar5 meansIn conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:40 JST
Alice Averlong🏳️⚧️
this debugger needs a "step backwards" command
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:41 JST
Alice Averlong🏳️⚧️
I do not have a smart brain, I have a clever brain. they are not the same. and this is annoyingly one problem I can't clever may way around
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:42 JST
Alice Averlong🏳️⚧️
and I have EXACTLY the wrong kind of brain to be any good at that. my brain is optimized for "let's take a different route and avoid the long slog"
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:43 JST
Alice Averlong🏳️⚧️
compression is the ultimate "you stare at this code until you understand it. good fucking luck"
and you can't avoid it. you just have toIn conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:44 JST
Alice Averlong🏳️⚧️
I am a fucking MASTER at finding shortcuts. I have endless tools and tricks and "I know a guy"s and research methods and everything. I can get out of just about any work I supposedly need to do, by doing things in a different way.
not compression.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:46 JST
Alice Averlong🏳️⚧️
that's one of the problems with being a game hacker: you don't use "good" solutions. you might try editing the RAM of your program from an external program. and once you realize you can do that, you realize you can use it everywhere
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:46 JST
Alice Averlong🏳️⚧️
here's why I hate reversing compression code:
there's no shortcuts.
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:47 JST
Alice Averlong🏳️⚧️
I think I'm gonna try abusing external memory reading into letting me watch the "dictionary" array through the course of a compression. that might tell me some interesting info
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:48 JST
Alice Averlong🏳️⚧️
it's kinda telling about how my brain works that I keep running into reverse engineering projects that stall out with "to continue, I need to write my own debugger for the platform I'm targeting"
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:49 JST
Alice Averlong🏳️⚧️
basically I need to watch the input buffer, the output buffer, about 15 random global variables, the half dozen or so local variables across 4 functions, and then a 768 byte dictionary
In conversation permalink -
Embed this notice
Alice Averlong🏳️⚧️ (foone@digipres.club)'s status on Sunday, 07-Jan-2024 12:08:50 JST
Alice Averlong🏳️⚧️
I might just write my own debugger. the dosbox one is slightly terrible.
In conversation permalink
-
Embed this notice