Kinda fix the flow using gotos

This commit is contained in:
jonschz 2025-05-04 13:43:22 +02:00
parent 2c469af6bf
commit 84d3fc1582

View File

@ -374,7 +374,7 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
// LINE: BETA10 0x1013e666
short row = p_flcHeader->height - yofs - 1;
goto loop;
goto row_loop;
weird_code:
// This is very ugly, but it does yield the correct layout. This _may_ be correct.
@ -382,8 +382,8 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
// LINE: BETA10 0x1013e684
row += token;
do {
loop:
while (TRUE) {
row_loop:
// TODO: Can the typecast be removed?
// LINE: BETA10 0x1013e692
token = *((short*) data++);
@ -413,8 +413,8 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
}
short column = xofs;
while (1) {
// TODO: Try turning this while-loop into gotos
column_loop:
column += *(data++);
short type = *((char*) data++);
@ -426,11 +426,11 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
data = (short*) ((char*) data + type);
// LINE: BETA10 0x1013e797
if (--token != 0) {
continue;
goto column_loop;
}
row--;
if (--lines > 0) {
break;
goto row_loop;
}
return;
}
@ -441,18 +441,17 @@ void DecodeSS2(LPBITMAPINFOHEADER p_bitmapHeader, BYTE* p_pixelData, BYTE* p_dat
column += type;
// LINE: BETA10 0x1013e813
if (--token != 0) {
continue;
goto column_loop;
}
row--;
if (--lines > 0) {
break;
goto row_loop;
}
return;
}
// break;
}
} while (1);
}
}
// FUNCTION: LEGO1 0x100bdc00