Jump to content

Compact levels representation question


Recommended Posts


this might be a stupid question but I will ask it anyway :)

I am learning how to scroll levels based on the compact data representation.

To quote nanoness' book,

DATA 0,0,0,0,0,0,0,0,1,1,1,1 for a column can be represented instead as:


This means repeat this column one time with eight 0 tiles and four 1 tiles, and then finish.

If I understand correctly this is relying on DATA PACKED representation.

Is is possible to use this representation for tiles with 2 digits?

For example, how to represent "repeat this column one time with eight 0 tiles and four 17 tiles, and then finish"


Link to comment
Share on other sites

In my book I didn't use DATA PACKED, but you got the idea, instead of putting two counts by word, you can put only one count per word. The upper byte being the count, and the lower byte being the tile used.



  DATA $0800,$0411


count = leveldata(#offset) / 256

tile_no = leveldata(#offset) AND 255


  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...