SGB: fix bugs in attr chr. Fixes some graphical glitches in Daffy Duck Marvin Missions

This commit is contained in:
nattthebear 2017-07-18 20:45:06 -04:00
parent bfd7337a32
commit 09672a6bf9
1 changed files with 3 additions and 3 deletions

View File

@ -332,7 +332,7 @@ static void cmd_attr_chr()
return;
}
int npacket = (n + 87) / 64;
if ((sgb.command[0] & 7) != npacket)
if ((sgb.command[0] & 7) < npacket)
{
utils_log("SGB: cmd_attr_chr bad length\n");
return;
@ -343,9 +343,9 @@ static void cmd_attr_chr()
if (y > 17)
y = 17;
int vertical = sgb.command[5];
for (int i = 0; i < 360; i++)
for (int i = 0; i < n; i++)
{
uint8_t v = i / 4 + 6;
uint8_t v = sgb.command[i / 4 + 6];
int a = v >> (2 * (3 - (i & 3))) & 3;
dst[y * 20 + x] = a;
if (vertical)