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 / ForceDiskCache.a < prev    next >
Text File  |  1994-03-01  |  1KB  |  48 lines

  1.     Title    'Force Disk Cache to specific size' ;
  2. *
  3. * Module for "Force" shell.
  4. * Ben Cranston March 1, 1994
  5. *
  6.     Print    Off            ; Here be includes
  7.     Include    'Traps.a'        ;
  8.     Print    On,NoGen        ; Here be includes
  9.     Main                ; Begin module
  10. *
  11.     Sub.L    #2,A7            ; Make local frame
  12.     Tst.L    D1            ; Was our data resource present?
  13.     BEq.S    @999            ; If not then just return
  14.     Move.L    D1,A0            ; Get resource handle
  15.     Move.L    (A0),A0            ; Get resource pointer
  16.     Clr.L    D1            ; Clear slack bits
  17.     Move.W    (A0),D1            ; Get desired size in K
  18.     LSR.L    #5,D1            ; Convert to 32K chunks
  19.     Move.B    D1,1(A7)        ; Save desired value
  20. *
  21. * Get current PRAM contents, decide if we have to reset and reboot.
  22. *
  23.     Move.L    #$0001000A,D0        ; Byte 0A
  24.     Move.L    A7,A0            ; Point to stack local
  25.     _ReadXPram            ; Read current setting from parameter RAM
  26.     BEq.S    @010            ; If no error then skip
  27.     Clr.L    D0            ; Set no reboot
  28.     Bra.S    @999            ; Return to caller
  29. *
  30. @010    ;
  31.     Move.B    (A7),D1            ; Get current value
  32.     Cmp.B    1(A7),D1        ; Is it the desired value?
  33.     BEq.S    @999            ; Yes, skip reset no reboot
  34. *
  35. * Write desired contents to PRAM and force reboot.
  36. *
  37.     LEA    1(A7),A0        ; Get address of desired
  38.     Move.L    #$0001000A,D0        ; Bytes 0A
  39.     _WriteXPram            ; Write back to parameter RAM
  40.     Move.W    #1,D0            ; Set flag to force reboot
  41. *
  42. @999    ;
  43.     Add.L    #2,A7            ; Drop local frame
  44.     RTS                ; Return to driver
  45. *
  46.     EndMain                ; Keep MPW happy
  47.     End                ; ForceDiskCache.a
  48.