home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / ForcePRAM.sit / ForceQuadCache.a < prev    next >
Text File  |  1994-03-01  |  2KB  |  65 lines

  1.     Title    'Force Quadra Cache to be turned on or off' ;
  2. *
  3. * Module for "Force" shell.
  4. * Ben Cranston March 1, 1994
  5. *
  6.     Print    Off            ; Here be includes
  7.     Include    'GestaltEqu.a'        ;
  8.     Include    'Traps.a'        ;
  9.     Print    On,NoGen        ; Here be includes
  10.     Main                ; Begin module
  11. *
  12.     Sub.L    #2,A7            ; Make two bytes on stack
  13.     Tst.L    D1            ; Did we get a data resource?
  14.     BEq.S    @999            ; If not then get out
  15.     Move.L    D1,A0            ; Get handle
  16.     Move.L    (A0),A0            ; Get pointer
  17.     Move.B    1(A0),1(A7)        ; Get flag
  18. *
  19. * If not 68040 hardware then just get out
  20. *
  21.     Move.L    #gestaltProcessorType,D0 ; Ask about processor type
  22.     _Gestalt            ; Get processor type
  23.     BNE.S    @900            ; If error then get out
  24.     Cmp.W    #gestalt68040,A0    ; Is this a quadra?
  25.     BNE.S    @900            ; If not then just get out
  26. *
  27.     Eject                ;
  28. *
  29. * Get current PRAM contents, decide if we have to reset and reboot.
  30. *
  31.     Move.L    #$0001008A,D0        ; Byte 8A
  32.     Move.L    A7,A0            ; Point to stack space
  33.     _ReadXPram            ; Read current from parameter RAM
  34.     BNE.S    @900            ; If error then get out
  35.     Clr.L    D1            ; Get value for cache on
  36.     Tst.B    1(A7)            ; Did he want it on?
  37.     BNE.S    @020            ; Yes, skip this
  38.     Move.B    #$80,D1            ; Else set value for off
  39. @020    ;
  40.     Move.B    (A7),D2            ; Get current value
  41.     And.B    #$80,D2            ; Get just our bit
  42.     Cmp.B    D1,D2            ; Is it set correctly?
  43.     BEq.S    @900            ; Yes, no need to change
  44. *
  45. * Write desired contents to PRAM and force reboot.
  46. *
  47.     Move.B    (A7),D2            ; Get current value
  48.     And.B    #$7F,D2            ; Keep lower bits
  49.     Or.B    D1,D2            ; Set desired value
  50.     Move.B    D2,(A7)            ; Save desired value
  51.     Move.L    A7,A0            ; Point to stack space
  52.     Move.L    #$0001008A,D0        ; Byte 8A
  53.     _WriteXPram            ; Write back to parameter RAM
  54.     Move.L    #1,D0            ; Set flat to force reboot
  55.     Bra.S    @999            ; Return to driver
  56. *
  57. @900    ;
  58.     Clr.L    D0            ; Set no reboot
  59. @999    ;
  60.     Add.L    #2,A7            ; Drop local frame
  61.     RTS                ; Return to driver
  62. *
  63.     EndMain                ; Keep MPW happy
  64.     End                ; ForceQuadCache.a
  65.