home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 95
/
af095sub.adf
/
MBlank.LZX
/
MBlank
/
Test.blm.asm
< prev
Wrap
Assembly Source File
|
2011-05-06
|
3KB
|
100 lines
ttl 'Save blanker module'
incdir "Includes:"
include "exec/funcdef.i"
include "exec/memory.i"
include "dos/dosextens.i"
include "dos/dos_lib.i"
include "exec/exec_lib.i"
include "intuition/intuition.i"
include "intuition/intuition_lib.i"
include "graphics/displayinfo.i"
include "graphics/gfx.i"
include "graphics/graphics_lib.i"
include "libraries/commodities.i"
include "workbench/startup.i"
include "workbench/workbench.i"
include "module.i"
bra DataSave
module_name dc.b "Test.blm",0
cnop 0,4
blm_start ds.b blm_SIZEOF ;see 'module.i'
;insert your taglist or whatever here
cnop 0,4
codeentry EQU *-blm_start ;needs to be a relative
; Insert position-independant code here:
; a5 = APTR AllGlobals (need not be saved)
;--------------------------------------------------------------------------
;Code for external module for Blanker of type 'BLMS'
Blank
BlankLoop btst #GB_BLANK,gb_Flags(a5) ;test blank-flag
beq ExitBlank
; Perform any action you want here!!! Use Wait(gb_ResetSignal) whenever
; you can! Task will get a signal (gb_ResetSignal) on reset(if GB_BLANK
; is SET)
; move.l gb_ResetSignal(a5),d0 ;wait for reset-signal
; CALLEXEC Wait
move.w d0,$dff180
addq #2,d0
bra.s BlankLoop
ExitBlank moveq #TRUE,d0 ;OK
;bra to BLNKexitFALSE with a BEQ-condition(zero-flag set) to let
;'Black-Screen' do the blanking.
BLNKexitFALSE rts ;exit module
;--------------------------------------------------------------------------
; Here it should be finished
cnop 0,4
modulesize EQU *-blm_start
; Data_saver: saves code as a data-block to a file,
; code starts at buffer
DataSave lea blm_start(pc),a0
move.l #modulesize,blm_Length(a0) ;module.i
move.l #codeentry,blm_Code(a0) ;module.i
move.l #'BLMS',blm_ID(a0) ;module.i
Openl move.l #4,a6 ;Open dos.library
move.l (a6),a6
move.l #37,d0 ;Version 37 min.
lea libname,a1
jsr -552(a6)
move.l d0,a5
beq exit ;If enable to open, exit
usel move.l a5,a6
lea module_name,a0
move.l a0,d1 ;Point at name
move.l #1006,d2 ;Open new file-modus
jsr -30(a6) ;Open functie in Dos.lib
move.l d0,a4 ;store handle(ID) for later use
beq Closel ;Unable to open file
move.l a4,d1 ;file-ID
lea blm_start,a0
move.l a0,d2 ;Data to write to file
move.l #modulesize,d3 ;number of bytes
jsr -48(a6) ;Write functie in Dos.lib
closef move.l a4,d1 ;Close file!
jsr -36(a6)
Closel move.l #4,a6
move.l (a6),a6
move.l a5,a1 ;Close dos.library
jsr -414(a6)
exit rts
libname dc.b "dos.library",0