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 >
Wrap
Text File
|
1994-03-01
|
2KB
|
65 lines
Title 'Force Quadra Cache to be turned on or off' ;
*
* Module for "Force" shell.
* Ben Cranston March 1, 1994
*
Print Off ; Here be includes
Include 'GestaltEqu.a' ;
Include 'Traps.a' ;
Print On,NoGen ; Here be includes
Main ; Begin module
*
Sub.L #2,A7 ; Make two bytes on stack
Tst.L D1 ; Did we get a data resource?
BEq.S @999 ; If not then get out
Move.L D1,A0 ; Get handle
Move.L (A0),A0 ; Get pointer
Move.B 1(A0),1(A7) ; Get flag
*
* If not 68040 hardware then just get out
*
Move.L #gestaltProcessorType,D0 ; Ask about processor type
_Gestalt ; Get processor type
BNE.S @900 ; If error then get out
Cmp.W #gestalt68040,A0 ; Is this a quadra?
BNE.S @900 ; If not then just get out
*
Eject ;
*
* Get current PRAM contents, decide if we have to reset and reboot.
*
Move.L #$0001008A,D0 ; Byte 8A
Move.L A7,A0 ; Point to stack space
_ReadXPram ; Read current from parameter RAM
BNE.S @900 ; If error then get out
Clr.L D1 ; Get value for cache on
Tst.B 1(A7) ; Did he want it on?
BNE.S @020 ; Yes, skip this
Move.B #$80,D1 ; Else set value for off
@020 ;
Move.B (A7),D2 ; Get current value
And.B #$80,D2 ; Get just our bit
Cmp.B D1,D2 ; Is it set correctly?
BEq.S @900 ; Yes, no need to change
*
* Write desired contents to PRAM and force reboot.
*
Move.B (A7),D2 ; Get current value
And.B #$7F,D2 ; Keep lower bits
Or.B D1,D2 ; Set desired value
Move.B D2,(A7) ; Save desired value
Move.L A7,A0 ; Point to stack space
Move.L #$0001008A,D0 ; Byte 8A
_WriteXPram ; Write back to parameter RAM
Move.L #1,D0 ; Set flat to force reboot
Bra.S @999 ; Return to driver
*
@900 ;
Clr.L D0 ; Set no reboot
@999 ;
Add.L #2,A7 ; Drop local frame
RTS ; Return to driver
*
EndMain ; Keep MPW happy
End ; ForceQuadCache.a