home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / newlibs / ifflb161.zoo / Grabber.S < prev    next >
Text File  |  1988-12-01  |  1KB  |  52 lines

  1. * Easy Picture Grabber by CHH & CHW
  2. * This program saves the contents of the first screen as an iff file
  3. * with filename 'grabber.pic'. The iff.library is required.
  4.  
  5.  
  6. main:        move.l    4,a6            ; AbsExecBase
  7.         lea    IffName(PC),a1        ; Library Name
  8.         moveq    #16,d0            ; Library Version
  9.         jsr    -552(a6)        ; OpenLibrary()
  10.         move.l    d0,a4            ; A4 : IFF Base
  11.         tst.l    d0
  12.         bne.s    IffOpen
  13.         moveq    #10,d0            ; return-code
  14.         rts                ; can't open iff.library
  15.  
  16. IffOpen:    lea    IntuiName(PC),a1    ; Library Name
  17.         jsr    -408(a6)        ; OldOpenLibrary()
  18.         move.l    d0,a5            ; A5 : IntuitionBase
  19.  
  20.         move.l    60(a5),a0        ; FirstScreen
  21.         move.l    88(a0),d6        ; BitMap
  22.  
  23.         move.l    48(a0),a1        ; struct ColorTable
  24.         move.l    4(a1),d7        ; struct Colormap
  25.         lea    44(a0),a1        ; sc_ViewPort
  26.         move.w    32(a1),d1        ; vp_Modes
  27.         moveq    #1,d0            ; Set cruncher-flag
  28.         btst    #11,d1            ; Hold And Modify ?
  29.         beq.s    NoHam            ; no --->
  30.         bset    #7,d0            ; Set HAM-Flag for iff.lib
  31.  
  32. NoHam:        move.l    a4,a6            ; IffBase
  33.         lea    FileName(PC),a0        ; Name of file to save
  34.         move.l    d6,a1            ; Pointer to BitMap
  35.         move.l    d7,a2            ; Pointer to ColorMap
  36.         jsr    -66(a6)            ; SaveBitMap() !!!
  37.  
  38.         move.l    4,a6            ; AbsExecBase
  39.         move.l    a4,a1            ; IffBase
  40.         jsr    -414(a6)        ; CloseLibrary() (IMPORTANT)
  41.  
  42.         move.l    a5,a1            ; IntuitionBase
  43.         jsr    -414(a6)        ; CloseLibrary()
  44.  
  45.         moveq    #0,d0
  46.         rts
  47.  
  48. IffName:    dc.b    "iff.library",0
  49. IntuiName:    dc.b    "intuition.library",0
  50. FileName:    dc.b    "grabber.pic",0
  51.  
  52.