; Ever used a boot picture viewer like IFFBoot and got a jumpy display ?
; This program magically generates an 1.3 compatible Prefs file that
; removes this quirk.

 lea INTUITIONNAME,a1
 moveq #0,d0 ;don't care about version
 move.l $4,a6 ;call Exec
 jsr -$228(a6) ;OpenLibrary
 move.l d0,a5 ;remember IntuitionBase in a5
 lea DOSNAME,a1
 moveq #0,d0 ;don't care about version
 jsr -$228(a6) ;OpenLibrary
 move.l d0,a4 ;remember DosBase in a4
 lea PREFS,a0 
 move.l #232,d0 ;size of struct Prefs
 move.l a5,a6 ;call Intuition
 jsr -$84(a6) ;GetPrefs
 move.l #FILENAME,d1
 move.l #1006,d2 ;MODE_NEWFILE
 move.l a4,a6 ;call dos
 jsr -$1e(a6) ;Open
 bne OpenOK
  moveq #10,d0 ;fail returncode
  rts
OpenOK:
 move.l d0,d7 ;remember filehandle in d7
 move.l d7,d1
 move.l #PREFS,d2
 move.l #232,d3
 jsr -$30(a6) ;Write
 move.l d7,d1
 jsr -$24(a6) ;Close
 moveq #0,d0
 rts

 dc.b "$VER: FixPrefs 1.1 06-Feb-94 by Nils Petersen",0
DOSNAME:
 dc.b "dos.library",0
INTUITIONNAME:
 dc.b "intuition.library",0
FILENAME:
 dc.b "DEVS:system-configuration",0

 bss
 align
PREFS:
 ds.b 232 ;232 bytes BSS
 end

