Jump to content

Photo

Grids - 1k intro

Forever XIII party

10 replies to this topic

#1 MaPa ONLINE  

MaPa

    Dragonstomper

  • 964 posts
  • Location:Czech Republic

Posted Mon Mar 19, 2012 2:42 PM

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.png grids2.png grids3.png grids4.png

Attached Files



#2 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,846 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Mon Mar 19, 2012 3:56 PM

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?

#3 sloopy OFFLINE  

sloopy

    River Patroller

  • 2,424 posts
  • lookin for bits, i like bits...
  • Location:in my cave of despair, surrounded by toys...

Posted Mon Mar 19, 2012 5:59 PM

Looks nice :')

100_1560.JPG

sloopy.

#4 Bryan OFFLINE  

Bryan

    Quadrunner

  • 10,927 posts
  • Cruise Elroy = 4DB7
  • Location:Chesaning, MI

Posted Mon Mar 19, 2012 6:02 PM

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.

#5 MaPa ONLINE  

MaPa

    Dragonstomper

  • Topic Starter
  • 964 posts
  • Location:Czech Republic

Posted Tue Mar 20, 2012 1:51 AM

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 by MaPa, Tue Mar 20, 2012 1:54 AM.


#6 Mclaneinc OFFLINE  

Mclaneinc

    Retro Madman

  • 6,712 posts
  • Location:Northolt, UK

Posted Tue Mar 20, 2012 3:52 AM

Sorry, for the amateur coder could you tell me what rolled or unrolled code is?

Code that packs well?

#7 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 11,255 posts
  • Location:Baden-Württemberg, Germany

Posted Tue Mar 20, 2012 4:42 AM

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

#8 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 11,255 posts
  • Location:Baden-Württemberg, Germany

Posted Tue Mar 20, 2012 4:45 AM

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

#9 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,846 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Tue Mar 20, 2012 4:47 AM

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.

#10 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,846 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Tue Mar 20, 2012 4:48 AM

(we definitely need a semaphore on this forum :-) )

#11 Mclaneinc OFFLINE  

Mclaneinc

    Retro Madman

  • 6,712 posts
  • Location:Northolt, UK

Posted Fri Mar 23, 2012 5:25 AM

Sorry for the late reply, thanks guys for the explanation..

I can see why its done..





Also tagged with one or more of these keywords: Forever XIII party

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users