uxn/examples/controller.usm

57 lines
901 B
Plaintext
Raw Normal View History

2021-02-14 19:51:36 +00:00
( comment )
:dev/r fff8 ( const read port )
:dev/w fff9 ( const write port )
;x 2 ;y 2
|0100 @RESET
2021-02-15 01:00:17 +00:00
#05 =dev/r ( set dev/read to ctrl )
#04 =dev/w ( set dev/write to ppu-sprite )
#0080 =x #0040 =y ( origin )
#01 ,cursor_icn ~x ~y ,putsprite JSR ( draw sprite )
2021-02-14 19:51:36 +00:00
BRK
|0200 @SPRITESHEET
@cursor_icn .80c0 .e0f0 .f8e0 .1000 .0000 .0000 .0000 .0000
@star_icn .1054 .28c6 .2854 .1000 .0000 .0000 .0000 .0000
BRK
|c000 @FRAME
#00 IOR #10 NEQ ,next0 ROT JMP? POP2
2021-02-15 01:00:17 +00:00
~y #0001 SUB2 =y
2021-02-14 19:51:36 +00:00
@next0
2021-02-15 01:00:17 +00:00
2021-02-14 19:51:36 +00:00
#00 IOR #20 NEQ ,next1 ROT JMP? POP2
2021-02-15 01:00:17 +00:00
~y #0001 ADD2 =y
2021-02-14 19:51:36 +00:00
@next1
#00 IOR #40 NEQ ,next2 ROT JMP? POP2
2021-02-15 01:00:17 +00:00
~x #0001 SUB2 =x
2021-02-14 19:51:36 +00:00
@next2
2021-02-15 01:00:17 +00:00
#00 IOR #80 NEQ ,end ROT JMP? POP2
~x #0001 ADD2 =x
@end
2021-02-14 19:51:36 +00:00
( redraw )
2021-02-15 01:00:17 +00:00
#01 ,cursor_icn ~x ~y ,putsprite JSR
2021-02-14 19:51:36 +00:00
BRK
@putsprite
IOW2 ( y short )
IOW2 ( x short )
IOW2 ( sprite address )
IOW ( redraw byte )
RTS
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR