Skip to content

Instantly share code, notes, and snippets.

@m0ppers
Created May 26, 2017 10:01
Show Gist options
  • Save m0ppers/c4fdedd873c961644ed9a665509d9789 to your computer and use it in GitHub Desktop.
Save m0ppers/c4fdedd873c961644ed9a665509d9789 to your computer and use it in GitHub Desktop.
#l 2 8 images/emojis.png
pi $0, si 0
pi $1, si 1
pi $2, si 2
pi $255, si 255
pi $sxoffset, si 160
pi $syoffset, si 2
pi $sw, si 16
pi $sh, si 16
pi $dw, si 32
pi $dh, si 32
@mainloop
pi $halfdw, s $dw, div $2
pi $halfdh, s $dh, div $2
pi $y, si 0
@yloop
pi $fac1, s $y
pi $fac2, s $sh
pi $div, s $dh
xi 0, yi 1, zi 17, s $fac1, sf $fac2
pi $sy, s $syoffset
pi $_x, si 0
pi $_r, si 0
@ycalc
x $_x, yi 1, zi 17, g $v
pi $_f, s $v, div $div
pi $sy, add $_f
pi $_r2, s $v, mod $div
pi $_r, add $_r2
pi $_f, s $_r, div $div
pi $_r, mod $div
pi $sy, add $_f
pi $_x, add $1
pi $v, seq $0, j @ycalc
pi $x, si 0
@xloop
pi $fac1, s $x
pi $fac2, s $sw
pi $div, s $dw
xi 0, yi 0, zi 17, s $fac1, sf $fac2
pi $sx, s $sxoffset
pi $_x, si 0
pi $_r, si 0
@xcalc
x $_x, yi 0, zi 17, g $v
pi $_f, s $v, div $div
pi $sx, add $_f
pi $_r2, s $v, mod $div
pi $_r, add $_r2
pi $_f, s $_r, div $div
pi $_r, mod $div
pi $sx, add $_f
pi $_x, add $1
pi $v, seq $0, j @xcalc
//pi $sx, s $x, mul $sw, div $dw
x $sx, y $sy, zi 8, g $r
x $sx, y $sy, zi 9, g $g
x $sx, y $sy, zi 10, g $b
x $sx, y $sy, zi 11, g $a
xi 111, yi 111, zi 4, s $r
pi $targetx, si 127, sub $halfdw, add $x
pi $targety, si 127, sub $halfdh, add $y
x $targetx, y $targety, zi 4, s $r
x $targetx, y $targety, zi 5, s $g
x $targetx, y $targety, zi 6, s $b
x $targetx, y $targety, zi 7, s $a
pi $x, add $1, seq $dw, j @xloop
pi $y, add $1, seq $dh, j @yloop
pi $dw, add $1
pi $dh, add $1
w $1
j @mainloop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment