View Single Post
Old 25 December 2019, 11:03   #12
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 60
Code:
INTENASET_DISK      = %1001000000001010
INTENACLR_DISK      = %0001000000001010
DMASET_DSKEN	= %1000000000010000
DMACLR_DSKEN	= %0000000000010000

*****************************************************************************************
ENABLE_DISK_IO:
	move.w	#INTENASET_DISK,$dff09a ;INTENA
	move.w	#DMASET_DSKEN,$dff096 ;DMACON
	rts
	
*****************************************************************************************
DISABLE_DISK_IO:
	move.w	#INTENACLR_DISK,$dff09a ;INTENA
	move.w	#DMACLR_DSKEN,$dff096 ;DMACON
	rts
I use these helpers before and after any disk io (Once the system has been taken over)

I have blitter enabled as well.
I open Dos library prior to system takeover
Close dos library after system restored - So it remains open for life of program.

Code:
OPEN_FILE:
 	movem.l	d1-d7/a0-a6,-(sp)
		bsr ENABLE_DISK_IO
		move.l _DOSBASE,a6
		jsr _LVOOpen(a6)
		bsr DISABLE_DISK_IO
	movem.l	(sp)+,d1-d7/a0-a6
		rts

READ_FILE:
 	movem.l	d1-d7/a0-a6,-(sp)
		bsr ENABLE_DISK_IO
		move.l _DOSBASE,a6
		jsr _LVORead(a6)
		bsr DISABLE_DISK_IO
	movem.l	(sp)+,d1-d7/a0-a6
		rts
I am definitely not an expert, but after some trial and error, these flags seemed to work. Note the overkill push/pop of the registers.

Last edited by Auscoder; 25 December 2019 at 11:09.
Auscoder is offline  
 
Page generated in 0.05611 seconds with 11 queries