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
/
ForceMap.a
< prev
next >
Wrap
Text File
|
1994-04-11
|
2KB
|
59 lines
Title 'Force Map location to known value' ;
*
* Module for "Force" shell.
* Ben Cranston April 11, 1994
*
Print Off ; Here be includes
Include 'Traps.a' ;
Print On,NoGen ; Here be includes
Main ; Begin module
*
S Record {A6Link},Decr ; Stack frame
A6Link DS.L 1 ; Caller's A6
Curr DS.B 8 ; Current PRAM value
Want DS.L 1 ; Desired PRAM value
SS Equ * ; Stack size
EndR ; Stack frame
*
Eject ;
*
Link A6,#S.SS ; Make local frame
Tst.L D1 ; Did we get a data resource?
BEq.S @999 ; No, just return
Move.L D1,A0 ; Get handle
Move.L (A0),A0 ; Get pointer
Move.L A0,S.Want(A6) ; Save pointer for compare
*
* Get current PRAM contents, decide if we have to reset and reboot.
*
Move.L #$000800E4,D0 ; Bytes E4 to EB
LEA S.Curr(A6),A0 ; Point to stack space
_ReadXPram ; Read current from parameter RAM
BEq.S @010 ; If no error then skip
Clr.L D0 ; Else set no reboot
Bra.S @999 ; Return to driver
*
@010 ;
LEA S.Curr(A6),A0 ; Point to current value
Move.L S.Want(A6),A1 ; Point to desired value
Cmp.L (A0)+,(A1)+ ; Compare latitude
BNE.S @030 ; If not equal then must reset
Cmp.L (A0)+,(A1)+ ; Compare longitude
BNE.S @030 ; If not equal then must reset
Clr.L D0 ; Set no reboot
Bra.S @999 ; Return to driver
*
* Write desired contents to PRAM and force reboot.
*
@030 ;
Move.L S.Want(A6),A0 ; Get address of desired
Move.L #$000800E4,D0 ; Bytes E4 to EB
_WriteXPram ; Write back to parameter RAM
Move.L #1,D0 ; Set flag to reboot
@999 ;
UnLk A6 ; Drop local frame
RTS ; Return to driver
*
EndMain ; Keep MPW happy
End ; ForceMap.a