A89: help me!!
[Prev][Next][Index][Thread]
A89: help me!!
ok, please reply as soon as possible before i kill myself. why wont the
following code erase the sprite if it goes right or down, it only erases that
space it was at if it goes left or up. i am using fill instead of clearing
the whole screen. please help quickly.
include "doorsos.h"
include "graphlib.h"
include "userlib.h"
xdef _main
xdef _comment
xdef _ti89
_main
move.w #0,d6
move.w #0,d7
jsr graphlib::clr_scr
start move.w d6,d0
move.w d7,d1
move.w #8,d2
move.w #8,d3
move.w #1,d4
jsr graphlib::fill
lea sprite(pc),a0
jsr graphlib::put_sprite
key jsr userlib::idle_loop
move.w ($7596),d0
cmp.w #344,d0
beq east
cmp.w #338,d0
beq west
cmp.w #337,d0
beq north
cmp.w #340,d0
beq south
cmp.w #264,d0
beq quit
bra key
north tst.w d6
beq key
sub.w #5,d6
bra start
west tst.w d7
beq key
sub.w #5,d7
bra start
south cmp.w #70,d6
beq key
add.w #5,d6
bra start
east cmp.w #70,d7
beq key
add.w #5,d7
bra start
quit
rts
sprite dc.w 8,1
dc.b %11111111
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %10000001
dc.b %11111111
_comment: dc.b "Sprite moving example",0
end