home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / code / asm_togg.sit < prev    next >
Encoding:
Text File  |  1988-05-14  |  2.4 KB  |  88 lines

  1. 11-May-88 21:28:24-MDT,2465;000000000000
  2. Return-Path: <u-lchoqu%sunset@cs.utah.edu>
  3. Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Wed, 11 May 88 21:28:18 MDT
  4. Received: by cs.utah.edu (5.54/utah-2.0-cs)
  5.     id AA04162; Wed, 11 May 88 21:28:55 MDT
  6. Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
  7.     id AA29325; Wed, 11 May 88 21:28:53 MDT
  8. Date: Wed, 11 May 88 21:28:53 MDT
  9. From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
  10. Message-Id: <8805120328.AA29325@sunset.utah.edu>
  11. To: rthum@simtel20.arpa
  12. Subject: ToggleCache.asm
  13.  
  14. Cache control is a handy tool for every 68020ed Mac user, including Mac II and
  15. Prodigy.  After using Prodigy 4, Prodigy SE, and now Mac II, which use advanced
  16. 32 bit 68020 CPU, we have found some compiled applications cannot
  17. work on it, if the Cache bit is enabled on processing.  I have not checked
  18. but obviously, there is a problem caused by applications compiled by
  19. Lightspeed C.  (e.g. Red Ryder 9.4, 10.0bd, etc.)  This problem can be solved
  20. only the user disables the Cache bit.
  21.  
  22. But Mac II doesn't have any Cache control.  Prodigy has only control d/a or
  23. cdev which wastes time (slow to control) and in most situations I want
  24. to switch it more easily.  In the Macintosh, the easiest way to implement
  25. fast switching is with an FKEY.
  26.  
  27. Here is easy 'Cache Control' FKey as ID=8.  Please install with ResEdit1.1b1
  28. or FKEY Installer.  The function is easy:
  29.  
  30. Hit Cmd+Shift+8 -> When beep 1 time  means enable  Cache. (Cache On)
  31. Hit Cmd+Shift+8 -> When beep 2 times means disable Cache. (Cache Off)
  32.  
  33. Switch above control as ever.
  34.  
  35. Kiyomasa Ono [CIS    70127,247]
  36.              [DELPHI UJL0018]
  37. Advanced Products Design
  38. Shinjuku 6-28-10 1002,
  39. Tokyo 160,
  40. Japan
  41. ------------------------------------------------------------------------
  42.             Machine    MC68020
  43. ;                    MC68881
  44. ;                    MC68851
  45.  
  46.             PRINT        OFF
  47.             INCLUDE     'Traps.a'
  48. ;            INCLUDE     'ToolEqu.a'
  49. ;            INCLUDE     'QuickEqu.a'
  50. ;            INCLUDE     'SysEqu.a'
  51.             PRINT        ON
  52.  
  53. CPUFlag        EQU        $012F
  54. ROMBase        EQU        $02AE
  55.  
  56. Cache        MAIN
  57.  
  58.             move.l    d0,-(sp)
  59. Check020    move.b    CPUFlag,d0
  60.             tst.w    d0
  61.             beq.s    is68000
  62.             cmp.w    #1,d0
  63.             beq.s    is68000
  64.             cmp.w    #2,d0
  65.             beq.s    is68020
  66.             bra.s    isOthers
  67. is68020        cmp.w    #4,ROMBase
  68.             bne.s    isMacII
  69. isProdigy    NOP            
  70.             
  71. isMacII        clr.l    d0
  72.             movec    CACR,d0
  73.             eori    #1,d0
  74.             movec    d0,CACR
  75.             btst    #0,d0
  76.             bne.s    isOn
  77. isOff        move.w    #3,-(sp)
  78.             _SysBeep
  79. isOn        move.w    #3,-(sp)
  80.             _SysBeep
  81.  
  82. isOthers
  83. is68000        move.l    (sp)+,d0
  84.             RTS
  85.  
  86.             END
  87.         
  88.