[A83] Someone please help


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

[A83] Someone please help




Ok I have this problem of 'ret' not working correctly at the end of my
program when it leaves the program it just gives me all these strange
characters on the display and then when ever I goto lets say memory or the
program menu and hit 2nd Quit it leaves the menu up and then just blinks a
cursor in the corner so i have to take out the batteries or reset it for it
to work, could someone please help, thanx,this is my quit comand:
quit:
res (write_on_graph),(iy+sgrflags) 
ei
ret
 the source for the whole program is below:
nolist
#include ion.inc
_RunIndicOff =4570h
#include keys.inc
list
#ifdef TI83P
org progstart-2
db $BB,$6D
#else
org progstart
#endif
ret
jr nc,lblStart
db "a",0
lblstart:
set (write_on_graph),(iy+sgrflags) 
bcall(_runindicoff) ; turn off run indicator
bcall(_GrBufClr)
ld a,00h ;reset xtest and ytest to zero
ld (xtest),a
ld a,00h
ld (ytest),a
ld a,03h
ld (lives),a ;set lives to 3
start:
ld a,1 ;set level to one
LvlSetup:
bcall(_clrlcdfull) ;clear screen
bcall(_GRBUFCPY) ;clear graphscreen
ld b,a ;load level to b
push af 
ld hl,5
cp b
jp z,lvla
dec hl
cp b
jp z,lvlb
dec hl
cp b
jp z,lvlc
dec hl
cp b
jp z,lvld
jp lvle
lvla:
(lots of drawing right here with (_iline) left it out because it is so huge
it is calling on line down at the bottom)
ld hl,1928h
ld (pencol),hl
ld hl,name
bcall(_vputs)
ld a,50h ;set initial x to 50h
ld (xtest),a
ld a,20h
ld (ytest),a ;set initial y to 20h x,y=50,20
ld a,01h
ld (direction),a ;set initial direction to 1 which is up direction 1-up
2-right 3-down 4-left
jp txt
lvlb:
lvlc:
lvld:
lvle:
txt:
ld hl,3702h ;load position on screen x37 y2
ld (pencol),hl
ld hl,livestxt ;print "lives on screen"
bcall(_vputs) ;put string on display
bcall(_getkey) ;pause progarm until key entry
jp move ;jump to move section
getkey:
halt
halt
halt
halt
halt
ld a,(xtest)
ld b,a
ld a,(ytest)
ld c,a
ld a,(direction)
ld e,a
bcall(_getcsc)
cp g_left
jp z,left
cp g_down
jp z,down
cp g_right
jp z,right
cp g_up
jp z,up
cp g_mode
jp z,quit
cp g_2nd
jp z,pause
dec e
ld a,0
cp e
jp z,up
dec e
ld a,0 
cp e
jp z,left
dec e
ld a,0
cp e
jp z,down
jp right
move: ;thanx Jimmy Pardey
ld d,3 ; pixel test part
ld a,(xtest)
ld b,a
ld a,(ytest)
ld c,a
bcall(_IPoint)
jp nz,quit
ld d,2 ;Pixel draw part
ld a,(xtest)
ld b,a
ld a,(ytest)
ld c,a
ld a,b
ld (xtest),a
ld a,c
ld (ytest),a
bcall(_IPoint)
jp getkey
pause:
bcall(_getcsc)
ld a,0
cp a
jp z,pause
jp move
right:
ld bc,(xtest)
inc bc
ld (xtest),bc
ld hl,00000100b
ld (direction),hl
jp move
down:
ld bc,(ytest)
dec bc
ld (ytest),bc
ld bc,00000011b
ld (direction),bc
jp move
left:
ld bc,(xtest)
dec bc
ld (xtest),bc
ld bc,00000010b
ld (direction),bc
jp move
up:
ld bc,(ytest)
inc bc
ld (ytest),bc
ld bc,00000001b
ld (direction),bc
jp move
line:
ld h,1
bcall(_iline)
quit:
res (write_on_graph),(iy+sgrflags) 
ei
ret
xtest: .db 00h
ytest: .db 00h
direction: .db 00h
lives: .db 00h
name: .db "S.Z.",0
livestxt: .db "LIVES: ",0
end
END




Follow-Ups: