LZ: What is wrong with this routine?


[Prev][Next][Index][Thread]

LZ: What is wrong with this routine?



This is a line drawing routine someone gave to me. However, it always 
ends unexpectently, that is, it gives me a TI-Basic ERROR 14 
UNDEFINED, and when i press [F5] QUIT it fills the screen with black 
dots. After you press CLEAR it goes away and everything works again. 
I'll post the ASM test program here: (I'm self teaching code, BTW)


#include "TI-85.H"


.org 0
.db "test",0


BlackScreen:
 ld hl, $FC00
 ld d, h
 ld e, l
 inc de
 ld (hl), $FF
 ld bc, 1023
 ldir
test:
 ld c, 30
 ld b, 10
 ld d, 20


HorzLine:
 ROM_CALL(FIND_PIXEL)
 ld b, d
 ld c, a
 ld de, $FC00
 add hl, de
HRep:
 ld de, 0
 ld a, c
 or (hl)
 ld (hl), a
 ld a, c     ; Skip these three lines
 xor (hl)   ; if you want to fill
 ld (hl), a  ; instead of erase
 rrc c
 adc hl, de
 djnz HRep
 ret


Wait2:				; wait for any key
 call	GET_KEY
 cp	0
 jr	z, Wait2
 ret


.end
     Computers are like drugs: Highly addictive,
incredibly expensive, and you keep having to buy more
and better to remain at the same level of amusement.