MaPa Posted March 19, 2012 Share Posted March 19, 2012 Hi, just sharing with you our (MaPa + PG) last 1k intro presented at Forever XIII party where it ended at the last place (2nd ). Source code again included. Grids.zip 7 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted March 19, 2012 Share Posted March 19, 2012 I really love your releases. First I see the effect and think: "How the hell..." Then I look at the source and think "Why the hell...". Very nice again. When I saw the unrolled code in the source :? , then I realized it must be for the benefit of the packing ratio. Is this a custom RLE packer? Quote Link to comment Share on other sites More sharing options...
sloopy Posted March 19, 2012 Share Posted March 19, 2012 Looks nice :') sloopy. Quote Link to comment Share on other sites More sharing options...
Bryan Posted March 20, 2012 Share Posted March 20, 2012 When I saw the unrolled code in the source :? , then I realized it must be for the benefit of the packing ratio. Usually, unrolled code is done for speed. If you use a packer that can recognize it, then all the better. Quote Link to comment Share on other sites More sharing options...
MaPa Posted March 20, 2012 Author Share Posted March 20, 2012 (edited) Yes, the unrolled code (and redundant repeating code) is for the benefit when packing as the packer is based on LZ77 algorithm. Btw. I'm not so happy with this intro but lack of time and ideas forced me to use 2 years old code and finish it to have at least some entry for compo. I coded it (the main effect) after Bitplanes intro (which was on New year's disk 2010) as it uses similar approach. Edited March 20, 2012 by MaPa Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted March 20, 2012 Share Posted March 20, 2012 Sorry, for the amateur coder could you tell me what rolled or unrolled code is? Code that packs well? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 20, 2012 Share Posted March 20, 2012 unrolled means that you expand code to avoid loops. f.e. LDX #10 loop LDA # STA MEM,X DEX BNE LOOP can be unrolled to LDA # STA MEM STA MEM+1 STA MEM+2 STA MEM+3 STA MEM+4 STA MEM+5 STA MEM+6 STA MEM+7 STA MEM+8 STA MEM+9 as an example. costs memory but saves CPU cycles as you don't need the loop commands like BNE, DEX etc 1 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 20, 2012 Share Posted March 20, 2012 or what packers might like would be LDA # LDX #10 STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX STA MEM,X DEX so packer might recognise the sequenze STA MEM,X DEX so packer could save "put 10 times following sequenze into memory" STA MEM,X DEX 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted March 20, 2012 Share Posted March 20, 2012 Unrolled code mean code which could be writte as (short but slow) loop is "unrolled" into a linear sequence of (long but fast) code. As Bryan stated this is normally done to trade space for speed. ldx #0 sta $d000,x inx adc #24 cpx #8 bne loop The following saves the "BNE" at the expense of 8 times the memory. ldx #0 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 sta $d000,x inx adc #24 MaPa's intro contains a very neat (small) unpacker which makes it worth while to unroll the code and let the packer compress it. 1 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted March 20, 2012 Share Posted March 20, 2012 (we definitely need a semaphore on this forum :-) ) Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted March 23, 2012 Share Posted March 23, 2012 Sorry for the late reply, thanks guys for the explanation.. I can see why its done.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.