mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-15 00:57:38 +00:00
Improve jumps
This commit is contained in:
parent
d52af801a0
commit
7306d7a992
@ -379,43 +379,48 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
|
||||
|
||||
skip_lines:
|
||||
// The layout in BETA10 strongly suggests that lots of `goto`s are used.
|
||||
// LINE: LEGO1 0x100bdb05
|
||||
// LINE: BETA10 0x1013e684
|
||||
row += token;
|
||||
|
||||
start_packet:
|
||||
do {
|
||||
// LINE: LEGO1 0x100bdaef
|
||||
// LINE: BETA10 0x1013e692
|
||||
token = *(short*) data;
|
||||
data += 2;
|
||||
|
||||
// LINE: LEGO1 0x100bdafb
|
||||
if (token >= 0) {
|
||||
goto column_loop;
|
||||
}
|
||||
|
||||
// LINE: LEGO1 0x100bdb00
|
||||
if ((unsigned short) token & 0x4000) {
|
||||
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;
|
||||
}
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Something is still slightly incorrect here - orig has two `jmp`s, recomp only has one
|
||||
else {
|
||||
|
||||
column_loop:
|
||||
// LINE: LEGO1 0x100bdb49
|
||||
// LINE: BETA10 0x1013e71e
|
||||
short column = xofs;
|
||||
|
||||
column_loop_inner:
|
||||
// LINE: LEGO1 0x100bdb50
|
||||
// LINE: BETA10 0x1013e726
|
||||
column += *data++;
|
||||
// LINE: BETA10 0x1013e73a
|
||||
@ -452,6 +457,7 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
|
||||
}
|
||||
return;
|
||||
// the `while (0)` looks off, but produces the correct `jmp` instructions near the end
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user