Due to the reference to RandomAccessFiles, I'm going to assume that it's Java. You'd have to compile it to make a program, so you'd have to download the SDK and such. This isn't all the code anyway, just the data conversion bit. Besides, all it does so far is create a non-RLE version of the file, the palette would still need to be applied to the file separately.
Ploaj also said it doesn't work with all files, which I am going to assume are ones that have one or more 2-byte instruction chunks with $00 as the first byte. I'll try look into these.
10-25-2014, 03:07 AM
(This post was last modified: 10-25-2014, 03:32 AM by puggsoy.)
0x80 doesn't seem to do what you suggested, there isn't always a corresponding 0x80 for each 0x00, and there isn't always an 0x80 before an 0x00. I know what you mean though, they do crop up in some suspicious looking places. On the other hand, it's not unlikely for an RLE length to require to be 0x80 pixels long, so it wouldn't be smart to give it a special meaning.
As for the other compression type, I don't know which files contain anything other than 0x003, other than those uncompressed ones. Can you give some filenames next time you find these?
Posts: 999
Threads: 40
Joined: Aug 2010
10-25-2014, 09:22 AM
(This post was last modified: 10-25-2014, 06:36 PM by Ploaj.)
No, I believe 0x80 has a special meaning. Look at STAR100.BMP.
If whenever there is a 0x80, you only need one pixel, not 128.
Having the decompressor write only one byte when there's a 0x80 gives the correct output.
Edit:
I believe all values larger than 127 have a special function. It may be that whenever it's larger than 127, you repeat the next byte by that minus 128.
Posts: 999
Threads: 40
Joined: Aug 2010
Yeah, java's bit operators are the same, but I can't just mask it out like that.
I need to first check to make sure it's not a 0xFF. Then I need to add 1 afterwards and stuff.
Do you think maybe 00 just means 1? It could just not be special in the compression. It seems that the ones >0x80 should be what we look at.
Oh yeah of course, my bad.
I was thinking about that too, but I don't think 0x00 is simply 1. I mean, if you go to 0x30 in BIGBUBSY.BMP, it looks like you should just skip it (although that doesn't seem to work either). And both 0xFF and 0x80 are already 1. I'm pretty sure it has some sort of function.