Re: A83: problem solved
[Prev][Next][Index][Thread]
Re: A83: problem solved
In a message dated 7/15/99 5:58:43 AM Eastern Daylight Time,
s_roodenburg@hotmail.com writes:
<< a different question...
>
>How can I make a program that uses an external file for it's graphics ...
>PROG1= prog code
>PROG2= sprites and pictures....
>
>and prog1 takes it's data from prog2..
>Any examples ?
It isn't to hard to program:
-----> PROG1 <-----------------------------------------------
call _GRBUFCLR ; clear the graph buffer
ld hl,prog2
rst 20h ; copy 9 bytes from (hl) to (OP1)
call _CHKFINDSYM ; check if file exists on calc
ret c ; not? then return
ex de,hl ; move start of file(=de) to hl
inc hl
inc hl ; skip first WORD: file length, hl now contains
ld de,PLOTSCREEN ; a pointer to the 1 byte of data in PROG2
ld bc,5*12 ; if there are more sprites, just add the offset
ldir ; of the sprite you want to display to hl
jp _GRBUFCPY_V ; copy 5 lines of gfx to the graph screen and
; return to the TI-OS
prog2: .db 06,"PROG2",0 ; Name of gfxfile
-----> END OF PROG1 <----------------------------------------
-----> PROG2 <-----------------------------------------------
.db $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA
.db $55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55
.db $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA
.db $55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55,$55
.db $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA
-----> END OF PROG2 <----------------------------------------
Send both files to your calc, squish PROG2 and run PROG1 by typing:
Send(9prgmPROG1
Hope this helps!
Grtx,
Sebastiaan >>
I'm assuming in the last line of prog one that 06 = <PROGOBJ> (.equ 05h)?
Just need a little clarification there, thanx.
Bud