Ecernosoft Posted August 2, 2022 Share Posted August 2, 2022 Hello! On this post I will explain the ridiculously simple, and effective way I compress ICT levels in the ROM. Enemies will be explained in the second section, as it's easier to understand. Each byte of the level data is split up into 2 parts, let's call them A and B. $xx AB B is the type of block (The ID divided by 2) plus the ground type. A is the # of times to repeat that block down the column. If A is less than 12, then another byte is fetched to fill in the rest of the space, and if that doesn't, another is fetched, untill all 12 columns are filled. First the column is stored in a 12 byte buffer (16 bytes for overflow reasons) and then copied to the screen. If A = 0 then B = the number of times to skip drawing and just load what's in the buffer N times. (n is B) If the entire column hasn't been filled, then it will just leave the rest of the buffer unchanged and copy that to the screen. If it has, then again, it leaves the buffer unchanged and copies it to the screen. Keep in mind that Level 1's level data is only ~150 bytes. Enemies use 2 bytes per enemy / object. The first byte is how many columns to wait to fetch the next enemy. The second byte is split up. $xx CD C is the enemy's YPOS and D is the Enemy ID + the Enemybase. (Enemybase isn't implemented yet) It's very effective, and fast. Quote Link to comment Share on other sites More sharing options...
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.