home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / scnote / scrnfkey.022 / ScreenFKEY.a < prev    next >
Text File  |  1989-10-04  |  3KB  |  68 lines

  1. ;#############################################################################################
  2. ;                                                                   
  3. ;    Apple Macintosh Developer Technical Support                        
  4. ;                                                                   
  5. ;    FKEY6 : Saves the contents of the main Macintosh screen to a PICT file.    
  6. ;    Macintosh Developer Technical Support                            
  7. ;                                                                   
  8. ;    ScreenFKEY.a                                                           
  9. ;                                                                   
  10. ;    Copyright ⌐ 1989 Apple Computer, Inc.                            
  11. ;    All rights reserved.                                            
  12. ;                                                                    
  13. ;    Versions:                                                            
  14. ;            1.00                     10/89                            
  15. ;                                                                   
  16. ;    Components:                                                        
  17. ;            ScreenFKEY.p            October 1, 1989                     
  18. ;            ScreenFKEY.a              October 1, 1989                     
  19. ;            ScreenFKEY.make          October 1, 1989                    
  20. ;                                                                   
  21. ;    ScreenFKEY is a basic example on how to spool a PICT file to disk by replacing the 
  22. ;    bottleneck PutPICProc, it saves the contents of the screen to a file. The FKEY creates 
  23. ;    ten files Screen 0 through Screen 9; it is necessary to erase or rename old files when 
  24. ;    the limit is reached. 
  25. ;    
  26. ;    This FKEY works in any Macintosh computer and saves the screen regardless of the 
  27. ;    setting of the screen; to use, it has to be added to the System file using ResEdit.
  28. ;                                                                   
  29. ;#############################################################################################
  30.  
  31.             BLANKS      ON
  32.             STRING      ASIS
  33.  
  34. LocalSize    EQU        0                    ; no locals in this sample
  35.  
  36. ; this is the header stuff for the FKEY
  37. ; its only function to call the main Pascal routine that does the work
  38. ; A FKEY resource is basically a 'CODE' resource with no parameters
  39. ; with ID the number equal to the numerical key it is supposed to responde to.
  40. ;
  41.             
  42.                 
  43. FKEY6       MAIN    EXPORT
  44.             IMPORT    PICTOut                ; the real thing
  45.             
  46. Funkey6
  47.             BRA.S   @0                    ; skip around header
  48.  
  49. ; For arcane reasons we keep using the following header
  50.             DC.W    0                      ; flags word
  51.             DC.B    'FKEY'                ; I am an FKEY resource
  52.             DC.W    6                      ; whose ID is 6:
  53.             DC.W    0                      ; Does someone care?
  54.  
  55. @0            LINK    A6,#LocalSize        ; stack locals
  56.             MOVEM.L D0-D7/A0-A5,-(SP)   ; save all regs
  57.             
  58.             JSR        PICTOut                ; Go do your stuff
  59.             
  60.             MOVEM.L (SP)+,D0-D7/A0-A5
  61.             UNLK    A6
  62.             RTS
  63.             
  64.  
  65.            END 
  66.  
  67.  
  68.