Skip to content

Commit

Permalink
SLP parser: Fixed some X values with extended commands.
Browse files Browse the repository at this point in the history
This fixes some small display faults with wrong X offsets.
  • Loading branch information
fredreichbier committed Mar 17, 2013
1 parent f397fd9 commit a238077
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions genie/slp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def _get_palette_index(player, relindex):
# from reading the correct number of bytes from the
# stream to parse the image data correctly.
extended = opcode >> 4
if extended not in (4,6,5,7):
print 'Extended command!', extended
if extended == 0:
# woho! this should only be drawn if the
# sprite is not x-flipped. TODO.
Expand All @@ -180,10 +182,12 @@ def _get_palette_index(player, relindex):
pass
elif extended in (4, 6):
# special color 1/2, but only 1 byte.
x += 1
pass
elif extended in (5, 7):
# special color 1/2, read amount from stream.
amount = _get_byte()
x += amount
else:
raise NotImplementedError('Unknown extended opcode: %r' % extended)
elif fourbit == 0x07:
Expand Down

0 comments on commit a238077

Please sign in to comment.