home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / MRFiles / PHOTO.SFX / photo (.txt) < prev    next >
Encoding:
GEOS ConVerT  |  1990-02-12  |  2.8 KB  |  117 lines

  1. 'Photo
  2. PRG formatted GEOS file V1.0
  3. CONVERTED WITH GEOSHELL V2.2
  4. Write Image V2.1
  5. geoWrite    V2.1
  6. ;*************************************
  7. ;    Photo
  8. ;    this is developed for use with
  9. ;    GeoBasic. This routine may be
  10. ;    loaded into memory at 30976 and
  11. ;    then CALL 30976,a,x,y to display
  12. ;    the current photo scrap from the
  13. ;    disk. x and y should be loaded
  14. ;    with the upper left corner location
  15. ;    where the bitmap should be displayed.
  16. ;*************************************
  17. .if    Pass1
  18. .noeqin
  19. .noglbl
  20. .include    geosSym
  21. .include    geosMac
  22. .glbl
  23. .eqin
  24. .endif
  25.     .psect
  26. Photo:
  27.     jsr    FindPhotoScrap
  28.     PopB    r1H
  29.     PopB    r1L
  30.     beq    10$
  31.     jsr    GetNxtBitmapByte
  32.     sta    bitmapWidth
  33.     jsr    GetNxtBitmapByte
  34.     sta    bitmapHeight+0
  35.     jsr    GetNxtBitmapByte
  36.     sta    bitmapHeight+1
  37.     lda    #40
  38.     sbc    r1L
  39.     sta    r2L
  40.     cmp    bitmapWidth
  41.     bcc    65$
  42.     MoveB    bitmapWidth,r2L
  43.     LoadB    r11H,#0
  44.     beq    68$    ;branch always.
  45.     lda    bitmapWidth
  46.     sbc    r2L
  47.     sta    r11H
  48.     lda    bitmapHeight+1
  49.     bne    70$
  50.     lda    #200
  51.     sbc    r1H
  52.     cmp    bitmapHeight+0
  53.     bcc    70$
  54.     lda    bitmapHeight+0
  55.     sta    r2H
  56.     jsr    ReloadR0
  57.     LoadB    r11L,#0
  58.     sta    r12L
  59.     sta    r12H
  60.     LoadW    r13,#GetBitmapByte
  61.     LoadW    r14,#ReloadR0
  62.     jsr    BitOtherClip
  63.     ldx    #0
  64. FindPhotoScrap:
  65.     LoadW    r6,#photoName
  66.     jsr    FindFile
  67.     bne    90$
  68.     Move
  69. FindPhotoScrap:
  70.     LoadW    r6,#photoName
  71.     jsr    FindFile
  72.     bne    90$
  73.     MoveB    dirEntryBuf+1,saveR1L
  74.     MoveB    dirEntryBuf+2,saveR1H
  75.     LoadB    saveR5+0,#0
  76.     sta    saveR5+1
  77. photoName:
  78.     .byte    "Photo Scrap",0
  79. ReloadR0:
  80.     LoadW    r0,#bitmapBuffer
  81. GetBitmapByte:
  82.     jsr    GetNxtBitmapByte
  83.     ldy    #0
  84.     sta    (r0),y
  85. GetNxtBitmapByte:
  86.     PushW    r1
  87.     PushW    r4
  88.     PushW    r5
  89.     MoveB    saveR1L,r1L
  90.     MoveB    saveR1H,r1H
  91.     LoadW    r4,#diskBlkBuf
  92.     MoveW    saveR5,r5
  93.     jsr    ReadByte
  94.     sta    bitmapByte
  95.     MoveB    r1L,saveR1L
  96.     MoveB    r1H,saveR1H
  97.     MoveW    r5,saveR5
  98.     PopW    r5
  99.     PopW    r4
  100.     PopW    r1
  101.     lda    bitmapByte
  102.     .ramsect
  103. saveR1L:
  104.     .block    1
  105. saveR1H:
  106.     .block    1
  107. saveR5:
  108.     .block    2
  109. bitmapWidth:
  110.     .block    1
  111. bitmapHeight:
  112.     .block    2
  113. bitmapByte:
  114.     .block    1
  115. bitmapBuffer:
  116.     .block    134
  117.