[A83] Re: Displaying Characters


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

[A83] Re: Displaying Characters




ok here is the program its just a worm program that i made to get the feel
of writing in assembly (the string that i was referring to as 'A' is really 
lives') thanks for the help:

nolist
#include ion.inc
_RunIndicOff = 4570h
homeup  = 4558h
#include keys.inc
list
#ifdef TI83P
    .org progstart-2
    .db $BB,$6D
#else
    .org progstart
#endif
     ret
     jr nc,lblstart
    .db "SnArF",0
lblstart:
 set (write_on_graph),(iy+sgrflags)
 bcall(_runindicoff) ; turn off run indicator
 ld a,00h  ;reset xtest and ytest to zero
 ld (xtest),a
 ld a,00h
 ld (ytest),a
 ld a,3h
 ld (lives),a  ;set lives to 3
title:
 bcall(_grbufclr)  ; clear the buffer
 ld hl,picture  ; get address of splash screeen
 ld de,plotsscreen   ; get address of TI graphic buffer
 ld bc,768           ; set number of bytes to copy (96*64)/8
 ldir   ; copy the bytes
 bcall(_grbufcpy)  ; bind the graphic image
 bcall(_getkey)
start:
 ld a,1   ;set level to one
LvlSetup:
 bcall(_clrlcdfull) ;clear screen
 bcall(_grbufclr) ;clear graphscreen
 ld b,a   ;load level to b 
 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:
lvlb:    ;these are where i call on iline to draw the levels (its a worm
maze like game)
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
 ld a,(lives)
 ld h,0
 ld l,a
 bcall(_Setxxxxop2)
 bcall(_op2toop1)
 ld a,5 ;<--- number of digits, 5 is a safe number
 bcall(_dispop1a)
 ld b,0
 ld c,9
 ld d,94
 ld e,9
 call line
 call pause  ;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
 call 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:
 ld d,3   ;pixel test part
 ld a,(xtest)
 ld b,a
 ld a,(ytest)
 ld c,a
 bcall(_IPoint)
 jp nz,die
 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:
 ld b,0
 bcall(_getcsc)
 cp b
 jp z,pause
 ret
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
die:
 ld hl,lives
 dec (hl)
 jp lvlsetup 
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 0h
name: .db "S.Z.",0
livestxt: .db "LIVES:",0
picture:
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    .db     0,0,0,0,0,0,0,0,6,35,30,31,142,56,0,0,0,0,0,0,6,35,63,31,206,56
0,0,0,0,0
    .db     0,6,83,51,152,206,56,0,0,0,0,0,0,3,86,97,152,207,120,0,0,0,0,0,0
3,86,97,159,205,88
    .db     0,0,0,0,0,0,3,86,97,159,141,88,0,0,0,0,0,0,3,86,97,153,141,88,0
0,0,0,0,0,3
    .db     86,97,152,205,88,0,0,0,0,0,0,1,140,51,24,205,216,0,0,0,0,0,0,1
140,63,24,205,152,0,0
    .db     0,0,0,0,1,140,30,24,108,152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15
    .db     128,1,230,0,0,3,237,176,0,192,0,12,192,3,54,0,0,0,109,176,0,192
0,12,192,3,54,0,0,0,193
    .db     128,0,192,0,12,219,195,199,156,241,128,205,183,140,215,24,15,155
1,230,198,219,65,141,182,218,241,180,12,202,0
    .db     118,206,219,193,141,182,222,243,188,12,206,3,54,214,219,1,141
182,198,245,140,12,206,3,54,214,219,67,13,182,214
    .db     221,172,15,132,193,230,222,217,131,237,182,204,223,152,0,4,0,0,0
0,0,0,0,0,0,0,255,255,255,255,255
    .db     255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,128,8,20,0,12,0,0,0,0,0,0,17
217,92,28
    .db     164,17,164,128,0,0,0,0,8,133,136,29,228,20,125,192,0,0,0,0,4,157
8,21,60,21,229,0,0,0,0
    .db     0,24,93,4,20,216,13,228,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
8,0,0,0
    .db     0,0,0,0,0,0,12,0,128,0,0,0,0,0,0,0,0,0,16,153,217,148,128,0,0,0
0,0,0,0,17
    .db     84,137,85,192,0,0,0,0,0,0,0,17,84,137,85,0,0,0,0,0,0,0,0,12,148
73,76,192,0,0,0
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,24,8,0
    .db     0,0,0,0,0,0,0,0,0,37,157,137,140,0,0,0,0,0,0,0,0,37,72,149,88,0
0,0,0,0,0
    .db     0,0,37,72,149,68,0,0,0,0,0,0,0,0,25,132,137,88,0,0,0,0,0,0,0,0,1
0,0,0,0
    .db     0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,28,0,128,0,0,0,0,0,0,0,0,0
    .db     17,89,192,0,0,0,0,0,0,0,0,0,28,136,128,0,0,0,0,0,0,0,0,0,16,136
128,0,0,0,0
    .db     0,0,0,0,0,29,72,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    .db     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
end
END




Follow-Ups: References: