all right here is the new code. i think i did what you suggested. oh and that jr has to be there it is part of the ion header.
Code:
.nolist
#include "ion.inc"
#include "keyval.inc"
.list
charx =sram
chary =sram+1
#ifdef ti83p
.org progstart-2
.db $BB,$6D
#else
.org progstart
#endif
ret
jr nc,begin
.db "ION Sprite Moving Test",0
begin:
bcall(_clrlcdfull)
bcall(_indicatoroff)
ld a,5
ld (charx),a
ld (chary),a
ld l,a
ld b,8
ld ix,sprite
call ionputsprite
call ionfastcopy
jr keypress
keypress:
bcall(_getkey)
cp gkright
jr z,right
cp gkdel
jp z,exit
cp gkleft
jp z,left
cp gkup
jr z,up
cp gkdown
jr z,down
jr nz,keypress
right:
ld a,(charx)
cp 86
jp z,keypress
call erase
ld a,(chary)
ld l,a
ld a,(charx)
inc a
ld (charx),a
call display
jp keypress
left:
ld a,(charx)
cp 1
jp z,keypress
call erase
ld a,(chary)
ld l,a
ld a,(charx)
dec a
ld (charx),a
call display
jp keypress
up:
ld a,(chary)
cp 1
jp z,keypress
call erase
ld a,(chary)
dec a
ld (chary),a
ld l,a
ld a,(charx)
call display
jp keypress
down:
ld a,(chary)
cp 54
jp z,keypress
call erase
ld a,(chary)
inc a
ld (chary),a
ld l,a
ld a,(charx)
call display
jp keypress
exit:
bcall(_clrlcdfull)
ret
sprite:
.db %11111111
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %11111111
erase:
ld a,(chary)
ld l,a
ld a,(charx)
ld b,8
ld ix,sprite
call ionputsprite
ret
display:
ld b,8
ld ix,sprite
call ionputsprite
call ionfastcopy
ret
.end
END