home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
system_utils
/
general
/
ntsc-pal
/
pal.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-22
|
2KB
|
81 lines
OPT c+,l-,o+
*********************
* *
* PAL 1.0 *
* *
* by Nico François *
*********************
incdir "INCLUDE:"
include "exec/types.i"
include "exec/execbase.i"
include "exec/memory.i"
include "exec/resident.i"
include "exec/exec_lib.i"
include "graphics/gfxbase.i"
include "graphics/graphics_lib.i"
include "libraries/dos_lib.i"
move.l ($4).w,a6
lea DosName(PC),a1
jsr _LVOOldOpenLibrary(a6) ; open DOS
move.l d0,a6
jsr _LVOOutput(a6)
move.l d0,d7
move.l d0,d1
lea header.txt(PC),a0
move.l a0,d2
move.l #header.len,d3
jsr _LVOWrite(a6)
move.w $DFF004,d0 ; check for new 1Mb Agnus
and.w #$2000,d0
bne.s ok1MbAgnus
lea oldagnus.txt(PC),a0 ; if not available print
move.l a0,d2
move.l #oldagnus.len,d3 ; message
move.l d7,d1
jsr _LVOWrite(a6)
move.l a6,a1
move.l ($4).w,a6
jsr _LVOCloseLibrary(a6)
bra.s exit
ok1MbAgnus:
move.l a6,a1
move.l ($4).w,a6
jsr _LVOCloseLibrary(a6)
lea GfxName(PC),a1
jsr _LVOOldOpenLibrary(a6) ; open graphics.library
move.l d0,a1
move.w gb_DisplayFlags(a1),d0
and.b #%11111110,d0 ; clear NTSC flag
or.b #%00000100,d0 ; set PAL flag
move.w d0,gb_DisplayFlags(a1)
move.w #256,gb_NormalDisplayRows(a1) ; WorkBench 256 pixels high
or.b #LIBF_CHANGED,LIB_FLAGS(a1)
move.l a1,a2
jsr _LVOSumLibrary(a6) ; recalculate checksum
move.l a2,a1
jsr _LVOCloseLibrary(a6)
move.b #50,VBlankFrequency(a6) ; change VBLANK
or.b #LIBF_CHANGED,LIB_FLAGS(a6)
jsr _LVOSumLibrary(a6) ; recalculate checksum
move.w #32,$dff1dc ; this one does all the magic
exit:
moveq #0,d0
rts
header.txt:
dc.b $9b,'1mPAL 1.0 ',$9b,'0m',$9b,'33mby Nico François',$9b,'0m',10
header.len equ *-header.txt
oldagnus.txt:
dc.b 'You haven''t got the ECS 1Mb Agnus, so run out and buy one !',10,0
oldagnus.len equ *-oldagnus.txt
DosName: dc.b 'dos.library',0
GfxName: dc.b 'graphics.library',0
EVEN
END