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 >
Text File  |  1994-04-11  |  2KB  |  59 lines

  1.     Title    'Force Map location to known value' ;
  2. *
  3. * Module for "Force" shell.
  4. * Ben Cranston April 11, 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. S    Record    {A6Link},Decr        ; Stack frame
  12. A6Link    DS.L    1            ; Caller's A6
  13. Curr    DS.B    8            ; Current PRAM value
  14. Want    DS.L    1            ; Desired PRAM value
  15. SS    Equ    *            ; Stack size
  16.     EndR                ; Stack frame
  17. *
  18.     Eject                ;
  19. *
  20.     Link    A6,#S.SS        ; Make local frame
  21.     Tst.L    D1            ; Did we get a data resource?
  22.     BEq.S    @999            ; No, just return
  23.     Move.L    D1,A0            ; Get handle
  24.     Move.L    (A0),A0            ; Get pointer
  25.     Move.L    A0,S.Want(A6)        ; Save pointer for compare
  26. *
  27. * Get current PRAM contents, decide if we have to reset and reboot.
  28. *
  29.     Move.L    #$000800E4,D0        ; Bytes E4 to EB
  30.     LEA    S.Curr(A6),A0        ; Point to stack space
  31.     _ReadXPram            ; Read current from parameter RAM
  32.     BEq.S    @010            ; If no error then skip
  33.     Clr.L    D0            ; Else set no reboot
  34.     Bra.S    @999            ; Return to driver
  35. *
  36. @010    ;
  37.     LEA    S.Curr(A6),A0        ; Point to current value
  38.     Move.L    S.Want(A6),A1        ; Point to desired value
  39.     Cmp.L    (A0)+,(A1)+        ; Compare latitude
  40.     BNE.S    @030            ; If not equal then must reset
  41.     Cmp.L    (A0)+,(A1)+        ; Compare longitude
  42.     BNE.S    @030            ; If not equal then must reset
  43.     Clr.L    D0            ; Set no reboot
  44.     Bra.S    @999            ; Return to driver
  45. *
  46. * Write desired contents to PRAM and force reboot.
  47. *
  48. @030    ;
  49.     Move.L    S.Want(A6),A0        ; Get address of desired
  50.     Move.L    #$000800E4,D0        ; Bytes E4 to EB
  51.     _WriteXPram            ; Write back to parameter RAM
  52.     Move.L    #1,D0            ; Set flag to reboot
  53. @999    ;
  54.     UnLk    A6            ; Drop local frame
  55.     RTS                ; Return to driver
  56. *
  57.     EndMain                ; Keep MPW happy
  58.     End                ; ForceMap.a
  59.