home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 83plus / asm / source / zpic.z80 < prev   
Encoding:
Text File  |  2001-07-01  |  2.1 KB  |  64 lines

  1. ;Zpic v1.2
  2. ;11:38 AM 3/12/00
  3. ;TI-83+ ASM
  4. ;Recalls a pic based on X.
  5. ;Recalls pics 1-255 (256 should never be saved as a pic!)
  6. ;⌐ (Copyright) 2000 Kevtiva Interactive
  7. ;http://calc.kevtiva.com/
  8. ;sorry I forgot to include this source in the program...
  9.  
  10.  
  11. .nolist
  12.  
  13. #define bcall(xxxx)    rst 28h \ .dw xxxx
  14. #define bjump(xxxx)    call 50h \ .dw xxxx
  15.  
  16. _rclX         .EQU  4AE0h
  17. op1          .equ  8478h
  18. _convoOp1    .equ  4AEFh
  19. tvarpict     .equ  60h
  20. picobj       .equ  07h
  21. _flashtoram  .equ  5017h
  22. _ChkFindSym  .equ  42F1h
  23. _ConvOP1     .EQU  4AEFh
  24. _GrBufCpy    .EQU  486Ah
  25.  
  26. .LIST
  27. .org 9D95h         ;this is where TI-83+ ASM programs are loaded
  28.                    ;
  29.   bcall(_rclX)     ;recal the value of X
  30.   bcall(_ConvOP1)  ;convert it to a HEX number, and place in DE.
  31.   dec  de          ;make it have the correct pic #
  32.   ex  de , hl      ;pic # => HL
  33.   ld (op1+2),hl    ;Put pic # in OP1
  34.   ld a,tvarpict    ;part of the pic name
  35.   ld (op1+1),a     ;pic object code.
  36.   ld a,picobj      ;
  37.   ld (op1),a       ;Now check to see if it exists.
  38.   bcall(_ChkFindSym)  ;DE = Offset in Archive
  39.   ret c              ;A now contains meaningless stuff.
  40.   ld a,b             ;B contains Rom page # so store that to A
  41.   cp 0               ;See if A=0, if yes, then we jump to rclpic
  42.   jr z,rclpic        ;otherwise we use the FLASHTORAM rom call.
  43.   ld a,b         ;B->A so A=ROM PAGE
  44.   ld hl,000Eh        ;Data is a little off...
  45.   add hl,de          ;Now HL contains the Offset in the Archive
  46.   ld de,9340h        ;de now Equals the GRAPH
  47.   ld bc,756d         ;size of picture
  48.   bcall(_flashtoram) ;copy it.
  49.   bcall(_GrBufCpy)   ;Display it.
  50.   ret                 ;return!
  51.  
  52. rclpic:
  53.  
  54.   ex de,hl            
  55.   inc hl              ;the first 2 bytes of a picture contain
  56.   inc hl              ;meaningless garbage (well not really, but...)
  57.   ld de, 9340h        ;location of the graphscreen
  58.   ld bc,756d          ;number of bytes to be copied.
  59.   ldir                ;copy the picture from its place onto the graph buffer
  60.   bcall(_GrBufCpy)    ;_GRBUFCPY_V    ;now display it.
  61.   ret
  62.  
  63. .end
  64. END