Like you do.
This isn't to be confused with Mah Jongg by Nels Anderson.
I'm also hacking that one, but not in THIS thread.
so I'm building a tool to convert the tile files to PNGs.
The files are TIS files, which are made of:
1. one metadata string
2. 44 TIL files.
3. PAL.CFG
There's PAKTIL.COM and UNPAKTIL.COM to separate out/rejoin the TIL files. So I gotta figure out how TIL files work.
it turns out they're a 6-byte header and then they're a 48x60 image, but they're vertically planar: The first row is the least significant bit, fourth row is the most significant bit, and so on.
This indexes into the palette, which is stored in PAL.CFG
PAL.CFG is simple: It's a 16-line text file, each line containing 3 numbers separated by spaces.
As is common for VGA-only software, it's 6-bit VGA, so the RGB is 0-63 instead of 0-255
the DRAFTSMN.DOC file explains some of the special palette entries:
0 is used for the screen background
1 is used for tile backgrounds
7 is used for the tile edges
11 is used for numbers
15 is used for menus
so really you get 11 colors.
some very ugly python code using strings rather than some smart bitshifting code, but it worked first time.
now I just need to wrap this up into a script that unpacks each file one by one, then converts each TIL, then merges them together into a spritesheet
I made the foolish mistake that all tilesets would define a remotely sensible palette
that was a mistake. several of them do black on black text
who thought this tileset was a good idea? because they were very wrong.
it's tiled "Carol, Cheryl and Christie" and I have no idea who those women are.
that's Carol Alt, Cheryl Tiegs, and Christie Brinkley.
thanks to @[email protected]
I put it on the internet archive but it seems to be unplayably laggy in-browser:
_putpixel? what are you doing with putpixel, game?
oh, no.
> LOOK
There is a sign on the wall
> LOOK SIGN
The sign reads "It has been zero days since x86's segmented addressing has made foone's day harder"
The sign has no way to increase the number: it's a static unchanging piece of paper.
oh good, I just missed how putimage/getimage was being compiled.
It's at least using BGI's slow blitter, rather than manually plotting every pixel through BGI's slow pixelplotter.
this set of FIDBs helps with that, btw. Real handy if you regularly reverse engineer 16-bit dos applications.
Fun fact: This game from 1991 supports dual monitors.
The PC didn't usually support this until way later, but you COULD install a monochrome card alongside a regular VGA display, and use the monochrome card simultaneously. It was mainly used by programmers, running their debugger/IDE on the secondary monitor, but a few games supported it for things like this.
The dumb reason is that DOS was so starved for memory that one trick that was actually used was to get an extra 8k (I think? My math may be off, it's 2am) for TSRs by using storing them in the upper memory block reserved for the monochrome video card framebuffer.
Which works fine as long as you don't try to use that memory as a framebuffer, which usually doesn't happen if you have a VGA card.
A game blindly drawing to it will draw into the ram of a device driver and stuff will break, hard.
uint __cdecl16far FUN_26f4_0672(int param_1)
{
uint uVar1;
do {
uVar1 = _rand();
} while (param_1 < (int)(uVar1 & 0xff));
return uVar1 & 0xff;
}
I KNOW PROGRAMMERS WHO USE MODULO AND THEY'RE ALL COWARDS
I found another place in the code where it does this.
I'm scared.
for (int i = 0; i < 10; i++) {
local_8 = _rand();
}
ahh, make sure your random numbers are properly seasoned, a good plan.
I haven't fully reversed this function but I think it is bubble sorting the tilesets.
no wonder it was so slow when I had 372 of them in the directory
A password? you ask me for a password?
ARE YOU CHALLENGING ME?
and looking in the (hidden!) MJVGA3.HOF file, the first 8 bytes are the following:
AF BE AC AC A8 B0 AD BB
which is "PASSWORD" XOR'd with FF
the manual:
When you first start EDITHOF, you'll be asked for a password. When
MJVGA creates MJVGA.HOF, the default password is PASSWORD (in upper
case). You can, of course, change this password to your own. More on
that shortly.
@foone files that store the password simply are <3
Shout out to PDF where you can remove the password easily.
@foone They even used 8 dashes for a password hint. The XOR-ing was what somebody did after a couple of hits of the company bong.
"Dude! This is going to totally work!"
@foone when I was doing programming the one thing we really wanted was more random random numbers.
"5 occurred 3 times in a row!?"
eventually we started building lists of all the values we wanted and using the random numbers to select which one would be used and REMOVED from the list.
@foone Oh yes indeed.
DEVICE=C:\DOS\EMM386.EXE RAM I=B000-B7FF
Committed to memory decades ago, it's so useful.
One `mode mono` command and "goodnight Vienna."
The thing that vexes me most about reserved driver memory blocks is that even today, Windows still has one.
On 64bit systems this aint so bad, but on 32 bit it was slap in the middle of the address space. Even if you had a load of RAM and could page out, the maximum _contiguous_ address space you could get was about 1.2GB
Guess what wants to allocate a single block of contiguous address space for it's heap? Java.
No Java programs with over 1.2GB of heap for you, person with 4GB RAM.
@AT1ST @eniko I know a way to get up to 3 (add a 3DFX card) but 4 would be tricky. There's no way to do that in a standardized way, you'd have to build a system with multiple PCI cards and program them directly.
Doable, but not easily, and support would basically be zero: it'd need that specific card.