[A83] Re: CREATEPICT


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

[A83] Re: CREATEPICT



Replace "ld hl, picdata" with "ld hl, gbuf", because plotsscreen is the 
source of the data to be copied with LDIR; the graphscreen buffer is where 
the ionsprite routine wrote the graphical data to. Also, you dont need that 
at "picdata".

-Jason_K


In a message dated 3/15/01 5:06:06 PM Central Standard Time, 
Sk8a4good@aol.com writes:


> I am trying to make a program that takes the screen and saves it to Pic1.  
> With my code, it IS creating Pic1, but it is just a glitchery image, and 
> not 
> the sprite I wanted to save.  The source follows.  What am I doing wrong?
> 
>         .nolist
> 
>         #include "ion.inc"      ;tells TASM--the compiler--what file to 
> read 
> from to define rom call memory addresses and such
>         .list
> _CreatePict = 4333h
> PICOBJ = 07h
> lcdinstport = 10h
> lcddataport = 11h
> tPic1 = 00h         
> tVarPict = 60h
> 
> #ifdef TI83P            ;a check for TASM to see whether it is making an 83 
> program--if so, do the next two commands
>         .org    progstart-2
>         .db     $BB,$6D
> #else               ;if it isn't an 83 program, then do something 
> [#]else--the next line
>         .org    progstart
> #endif              ;simply ends the #ifdef command
>         ret             
> 
>         jr      nc,begin        ;Jumps to the beginning of the program 
> (this 
> line and the below three will be 
>         .db     "Create A Pic",0        ;The title displayed by 
> ION--anything 
> you want
> begin:              ;defines where label begin is, program code follows 
> this 
> label
>     ld b,8                  ;the sprite is 8 high
>     ld a,0                  ;make register equal zero (0)
>     ld l,a                  ;now make register l equal (0)
>     ld ix,sprite                ;load the sprite into register ix
>     call ionPutSprite           ;call the library
>     call IonFastCopy            ;copy the graph buffer to the 
> screen--displays the sprite!
> 
>     bcall(_zeroop1)   ; load var name
>     ld hl,picname     
>     ld de,op1         
>     ld bc,3          
>     ldir              
>     bcall(_chkfindsym)  ; look it up
>     jp nc,load_data   ; skip to loaddata if exists.
>     bcall(_createpict)  ; else create pic
> load_data:
>     inc de            ; skip 1st length byte
>     inc de            ; skip 2nd length byte
>     ld hl,picdata     ; pic data
>     ld bc,756         ; pic size
>     ldir              ; copy data
>     ret
> picname:
> ; Recall our tokens class...?
>     .db picobj,tvarpict,tpic1
> picdata:
>     ld a,(gbuf)
>     ret
>        ;  I HAVE ALSO TRIED THIS, BUT IT DIDNT WORK:
>     ;   out (lcdinstport),a
>     ;   bcall(_lcdbusy)
>     ;   in a,(lcddataport)
>     ;   bcall(_lcdbusy)
>     ;ret        
> sprite:                     ;defines the sprite! Its a shiny ball where: 
> 1=pixel on and 0=pixel off
>     .db %00111100
>     .db %01000010
>     .db %10001001
>     .db %10000101
>     .db %10000001
>     .db %10000001
>     .db %01000010
>     .db %00111100
> .end
> END
>