[A83] Help!
[Prev][Next][Index][Thread]
[A83] Help!
I have problems with a program I am currently making. It first draws a Line
and some text on the screen. After that there is an animation of a tiny
spaceship flying by. But when the ship flies by, the letters are erased(do I
have to write the letters to the graphbuffer?), and I used Movax routine but
the ship leaves set bits on it's way so it isn't erased, anyone know what to
do?
Code:
.NOLIST ;Necessary stuff,
#define end .end
#define END .end
#define equ .equ
#define EQU .equ
#include "ti83asm.inc"
#include "tokens.inc"
.LIST
#DEFINE shipx 8265h
#DEFINE shipy 8266h
KClear .equ 191
.org 9327h ; Begin
progstart:
call _clrLCDFull
ld hl,256*0+1 ; in the routine
ld (pencol),hl
ld hl,nameandversion
call _vputs
ld b,0
ld c,56
ld d,94
ld e,56
ld h,1
call _Iline
ld a,0
ld (shipx),a
ld a,20
ld (shipy),a
clearloop:
ld a,0ffh
out (1),a
ld a, 0fdh
out (1),a
in a,(1)
cp KClear
jp z, startgame
flyship:
ld a,(shipx)
inc a
ld (shipx),a
call drawship
jr clearloop
drawship:
ld a,(shipy)
ld e,a
ld a,(shipx)
ld bc,ship ;Load sprite name to bc
call SPRXOR ;Call movax' Sprite Routine
call _grbufcpy_v
ret
startgame:
ret
ship:
.db %00000000
.db %00000000
.db %10000000
.db %01110110
.db %10001001
.db %11111111
.db %00000000
.db %00000000
;Hannes sprite routine, XOR.
SPRXOR:
push bc ; Save sprite address
;==== Calculate the address in graphbuf ====
ld hl,0 ; Do y*12
ld d,0
add hl,de
add hl,de
add hl,de
add hl,hl
add hl,hl
ld d,0 ; Do x/8
ld e,a
srl e
srl e
srl e
add hl,de
ld de,8e29h
add hl,de ; Add address to graphbuf
ld b,00000111b ; Get the remainder of x/8
and b
cp 0 ; Is this sprite aligned to 8*n,y?
jp z,ALIGN
;==== Non aligned sprite blit starts here ====
pop ix ; ix->sprite
ld d,a ; d=how many bits to shift each line
ld e,8 ; Line loop
LILOP: ld b,(ix+0) ; Get sprite data
ld c,0 ; Shift loop
push de
SHLOP: srl b
rr c
dec d
jp nz,SHLOP
pop de
ld a,b ; Write line to graphbuf
xor (hl)
ld (hl),a
inc hl
ld a,c
xor (hl)
ld (hl),a
ld bc,11 ; Calculate next line address
add hl,bc
inc ix ; Inc spritepointer
dec e
jp nz,LILOP ; Next line
jp DONE1
;==== Aligned sprite blit starts here ====
ALIGN: ; Blit an aligned sprite to graphbuf
pop de ; de->sprite
ld b,8
ALOP1: ld a,(de)
xor (hl)
ld (hl),a
inc de
push bc
ld bc,12
add hl,bc
pop bc
djnz ALOP1
DONE1:
ret
nameandversion:
.db "Ultimate Bomber v 0.11",0
.end
END
----------------------------------------------------------
"If I have seen farther than others, it is because I was standing on the
shoulders of giants." - scientist Sir Isaac Newton, in a letter to his
colleague Robert Hooke, February 1676.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Follow-Ups: