Created
April 16, 2012 03:05
-
-
Save devniel/2396183 to your computer and use it in GitHub Desktop.
picdasm test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Author : Daniel Flores(dnielf/devniel) | |
set [0x8202],0x8000 | |
set [0x8203],0x0000 | |
jsr draw_sprite | |
:end | |
set pc,end | |
:get_color | |
set b,a | |
shl a,11 | |
add a,65 | |
set pc,pop | |
:new_line | |
;Use z as a counter of line | |
set push,z | |
mul z,32 | |
add c,z | |
set z,pop | |
set pc,pop | |
:draw_sprite | |
set j,0 | |
set c,[sprite_posx] | |
add c,[sprite_width] | |
set [sprite_endx],c | |
set c,[sprite_posy] | |
add c,[sprite_height] | |
set [sprite_endy],c | |
set c,[sprite_posx] | |
set j,[sprite_posy] | |
set i,0 | |
set z,0 | |
:loop_2 | |
set c,[sprite_posx] | |
:loop_1 | |
set a,[sprite + i] | |
jsr get_color | |
set x,[video] | |
set push,c | |
ifg z,0 | |
jsr new_line | |
add x,c | |
set [x],a | |
set c,pop | |
add i,1 | |
add c,1 | |
ifg [sprite_endx],c | |
set pc,loop_1 | |
add j,1 | |
ifg [sprite_endy],j | |
add z,1 | |
ifg [sprite_endy],j | |
set pc,loop_2 | |
set pc,pop | |
:video dat 0x8000 | |
:sprite_posx dat 0 | |
:sprite_posy dat 0 | |
:sprite_width dat 12 | |
:sprite_height dat 16 | |
:sprite_endx dat 0 | |
:sprite_endy dat 0 | |
:sprite dat 0,0 | |
:sprite dat 0,0,0,12,12,12,12,12,0,0,0,0,0,0,12,12,12,12,12,12,12,12,12,0,0,0,6,6,6,2,2,6,2,0,0,0,0,6,2,6,2,2,2,6,2,2,2,0,0,6,2,6,6,2,2,2,6,2,2,2,0,6,6,2,2,2,2,6,6,6,6,0,0,0,0,2,2,2,2,2,2,2,0,0,0,0,6,6,12,6,6,6,0,0,0,0,0,6,6,6,12,6,6,12,6,6,6,0,6,6,6,6,12,12,12,12,6,6,6,6,2,2,6,12,6,12,12,6,12,6,2,2,2,2,2,12,12,12,12,12,12,2,2,2,2,2,12,12,12,12,12,12,12,12,2,2,0,0,12,12,12,0,0,12,12,12,0,0,0,6,6,6,0,0,0,0,6,6,6,0,6,6,6,6,0,0,0,0,6,6,6,6,0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment