Whats Wrong HELP
[Prev][Next][Index][Thread]
Whats Wrong HELP
-
Subject: Whats Wrong HELP
-
From: Frank <Jblaze77@MSN.COM>
-
Date: Fri, 27 Sep 1996 00:49:18 -0700
-
In-Reply-To: <>
I wrote this program which is supposed to be like etch a sketch ..
but for some reason it wont go more than a few pixels left....can
some1 help....
#include "ti-85.h"
.org 0
.db "By Frank Apap",0
X = $80E0 ;X in mem
Y = $80E1 ; Y in mem
Init:
ld a,4
out (5),a
ROM_CALL(CLEARLCD)
ld a,30 ; x start
ld (X),a
ld a,60 ; y start
ld (Y),a
Start:
call GET_KEY ; get a key
cp K_UP
CALL_Z(up)
cp K_DOWN
CALL_Z(down)
cp K_LEFT
CALL_Z(left)
cp K_RIGHT
CALL_Z(right)
cp 0F
JUMP_Z(clear)
cp $37
JUMP_Z(exit)
jr Start
up:
ld a,(X) ; x=x+1
inc a
ld (X),a
CALL_(PlotPixel) ; draw it
ret
down:
ld a,(X)
dec a
ld (X),a ; x=x-1
CALL_(PlotPixel)
ret
right:
ld a,(Y) ; y=y+1
inc a
ld (Y),a
CALL_(PlotPixel) ; draw it
ret ; go back
left:
ld a,(Y) \
dec a \
ld (Y),a > IS SOMETHING WRONG?
CALL_(PlotPixel) ; draw it /
ret ; go back /
clear:
ROM_CALL(CLEARLCD)
JUMP_(init)
PlotPixel:
ld a,(Y) ; LOAD Y into B
ld b,a
ld a,(X) ; LOAD X into C
ld c,a
ROM_CALL(FIND_PIXEL)
ld de,$FC00
add hl,de
or (HL)
ld (HL),a
ret
exit:
ROM_CALL(CLEARLCD)
ld hl,$1A1A
ld ($8333), hl
ld hl, (PROGRAM_ADDR)
ld de,bye
add hl,de
ROM_CALL(D_ZM_STR)
exitloop:
call GET_KEY
cp $37
ret z
jr nz,exitloop
bye: .db "BYE THANKS FOR TESTING",0
.end