This commit is contained in:
jonschz 2025-05-25 07:38:28 +02:00
parent 7306d7a992
commit 38e5b06808

View File

@ -384,70 +384,53 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
row += token; row += token;
start_packet: start_packet:
do { // LINE: LEGO1 0x100bdaef
// LINE: LEGO1 0x100bdaef // LINE: BETA10 0x1013e692
// LINE: BETA10 0x1013e692 token = *(short*) data;
token = *(short*) data; data += 2;
data += 2; // LINE: LEGO1 0x100bdafb
// LINE: LEGO1 0x100bdafb if (token >= 0) {
if (token >= 0) { goto column_loop;
goto column_loop; }
} // LINE: LEGO1 0x100bdb00
// LINE: LEGO1 0x100bdb00 if ((unsigned short) token & 0x4000) {
if ((unsigned short) token & 0x4000) { goto skip_lines;
goto skip_lines; }
// LINE: LEGO1 0x100bdb0a
WritePixel(p_bitmapHeader, p_pixelData, xmax, row, token);
token = *(short*) data;
data += 2;
// LINE: LEGO1 0x100bdb2f
// LINE: BETA10 0x1013e6ef
if (!token) {
row--;
if (--lines > 0) {
goto start_packet;
} }
return;
}
else {
// LINE: LEGO1 0x100bdb0a column_loop:
WritePixel(p_bitmapHeader, p_pixelData, xmax, row, token); // LINE: LEGO1 0x100bdb49
token = *(short*) data; // LINE: BETA10 0x1013e71e
data += 2; short column = xofs;
// LINE: LEGO1 0x100bdb2f column_loop_inner:
// LINE: BETA10 0x1013e6ef // LINE: LEGO1 0x100bdb50
if (!token) { // LINE: BETA10 0x1013e726
row--; column += *data++;
if (--lines > 0) { // LINE: BETA10 0x1013e73a
goto start_packet; short type = *(char*) data++;
} type += type;
return;
}
else {
column_loop: if (type >= 0) {
// LINE: LEGO1 0x100bdb49 WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*) data, type);
// LINE: BETA10 0x1013e71e
short column = xofs;
column_loop_inner:
// LINE: LEGO1 0x100bdb50
// LINE: BETA10 0x1013e726
column += *data++;
// LINE: BETA10 0x1013e73a
short type = *(char*) data++;
type += type;
if (type >= 0) {
WritePixels(p_bitmapHeader, p_pixelData, column, row, (BYTE*) data, type);
column += type;
data += type;
// LINE: BETA10 0x1013e797
if (--token != 0) {
goto column_loop_inner;
}
row--;
if (--lines > 0) {
goto start_packet;
}
break;
}
type = -type;
WORD* p_pixel = (WORD*) data;
data += 2;
WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, *p_pixel, type >> 1);
column += type; column += type;
// LINE: BETA10 0x1013e813 data += type;
// LINE: BETA10 0x1013e797
if (--token != 0) { if (--token != 0) {
goto column_loop_inner; goto column_loop_inner;
} }
@ -456,9 +439,23 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
goto start_packet; goto start_packet;
} }
return; return;
// the `while (0)` looks off, but produces the correct `jmp` instructions near the end
} }
} while (0);
type = -type;
WORD* p_pixel = (WORD*) data;
data += 2;
WritePixelPairs(p_bitmapHeader, p_pixelData, column, row, *p_pixel, type >> 1);
column += type;
// LINE: BETA10 0x1013e813
if (--token != 0) {
goto column_loop_inner;
}
row--;
if (--lines > 0) {
goto start_packet;
}
return;
}
} }
// FUNCTION: LEGO1 0x100bdc00 // FUNCTION: LEGO1 0x100bdc00