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 >
Wrap
Text File
|
1994-03-01
|
1KB
|
48 lines
Title 'Force Disk Cache to specific size' ;
*
* Module for "Force" shell.
* Ben Cranston March 1, 1994
*
Print Off ; Here be includes
Include 'Traps.a' ;
Print On,NoGen ; Here be includes
Main ; Begin module
*
Sub.L #2,A7 ; Make local frame
Tst.L D1 ; Was our data resource present?
BEq.S @999 ; If not then just return
Move.L D1,A0 ; Get resource handle
Move.L (A0),A0 ; Get resource pointer
Clr.L D1 ; Clear slack bits
Move.W (A0),D1 ; Get desired size in K
LSR.L #5,D1 ; Convert to 32K chunks
Move.B D1,1(A7) ; Save desired value
*
* Get current PRAM contents, decide if we have to reset and reboot.
*
Move.L #$0001000A,D0 ; Byte 0A
Move.L A7,A0 ; Point to stack local
_ReadXPram ; Read current setting from parameter RAM
BEq.S @010 ; If no error then skip
Clr.L D0 ; Set no reboot
Bra.S @999 ; Return to caller
*
@010 ;
Move.B (A7),D1 ; Get current value
Cmp.B 1(A7),D1 ; Is it the desired value?
BEq.S @999 ; Yes, skip reset no reboot
*
* Write desired contents to PRAM and force reboot.
*
LEA 1(A7),A0 ; Get address of desired
Move.L #$0001000A,D0 ; Bytes 0A
_WriteXPram ; Write back to parameter RAM
Move.W #1,D0 ; Set flag to force reboot
*
@999 ;
Add.L #2,A7 ; Drop local frame
RTS ; Return to driver
*
EndMain ; Keep MPW happy
End ; ForceDiskCache.a