*
* User-Toolset shell for Apple IIgs FakeModalDialog code
*
* David A. Lyons
*
* Developer Technical Support Apple II Sample Code
*
* v3.0  12-Mar-90  DAL
*
	case on

Version	equ $0100	;v1.0

fmdUserTool	proc


	import fmdStartUp
	import fmdShutDown
	import fakeModalDialog
	import fmdSetMenuProc
	import fmdGetMenuProc
	import fmdStdDrawProc
	import fmdEditMenu
	import fmdFindCursorCtl
	import fmdLESetText
	import fmdLEGetText
	import fmdWhichRadio
	import fmdIBeamCursor
	import fmdInitIBeam
	import fmdSetIBeam
	import fmdGetIBeamAdr
	import fmdGetCtlPart
	import fmdGetError

	dc.l (@fmdEnd-@fmdStart)/4 + 1
@fmdStart	dc.l fNoError-1	;01xx fmdBootInit
	dc.l fStartUp-1	;02xx fmdStartUp
	dc.l fShutDown-1	;03xx fmdShutDown
	dc.l fVersion-1	;04xx fmdVersion
	dc.l fNoError-1	;05xx fmdReset
	dc.l fStatus-1	;06xx fmdSTatus
	dc.l fNoError-1	;07xx reserved
	dc.l fNoError-1	;08xx reserved
	dc.l fFakeMdlDlg-1	;09xx fakeModalDialog
	dc.l fSetMenuProc-1	;0Axx fmdSetMenuProc
	dc.l fGetMenuProc-1	;0Bxx fmdGetMenuProc
	dc.l fmdStdDrawProc-1 ;0Cxx fmdStdDrawProc*
	dc.l fmdEditMenu-1	;0Dxx fmdEditMenu*
	dc.l fFindCursCtl-1	;0Exx fmdFindCursorCtl
	dc.l fSetText-1	;0Fxx fmdLESetText
	dc.l fGetText-1	;10xx fmdLEGetText
	dc.l fWhichRadio-1	;11xx fmdWhichRadio
	dc.l fmdIBeamCursor-1 ;12xx fmdIBeamCursor*
	dc.l fmdInitIBeam-1	;13xx fmdInitIBeam*
	dc.l fSetIBeam-1	;14xx fmdSetIBeam
	dc.l fGetIBeamAdr-1	;15xx fmdGetIBeamAdr
	dc.l fGetCtlPart-1	;16xx fmdGetCtlPart
	dc.l fGetError-1	;17xx fmdGetCtlPart
@fmdEnd

*	
save6	lda >myStatus
	beq notStarted
	plx
	pla
	sta >temp
	pla
	sta >temp+2
	pla
	sta >temp+4
	phx
	rts

temp	ds.b 6

myStatus	ds.w 1

notStarted	pla	;discard return address
	txa
	xba
	and #$FF00
	ora #$8001
	sec
	rtl

fStartUp	jsl fmdStartUp
	lda #$FFFF
	bra startStop

fShutDown	jsl fmdShutDown
	lda #$0000
startStop	sta >myStatus
fNoError	lda #0
	clc
	rtl

fVersion	lda #Version
	sta 7,s
	bra fNoError

fStatus	lda >myStatus
	sta 7,s
	bra fNoError

fFakeMdlDlg	jsr save6
	jsl fakeModalDialog
	bra restore6

fSetMenuProc	jsr save6
	jsl fmdSetMenuProc	;Ahhhhh!!  We are falling.


restore6	tay	;This is here so everybody
	lda >temp+4	;can reach it.
	pha
	lda >temp+2
	pha
	lda >temp
	pha
	tya
	rtl

	
fGetMenuProc	jsr save6
	jsl fmdGetMenuProc
	bra restore6

fFindCursCtl	jsr save6
	jsl fmdFindCursorCtl
	bra restore6

fSetText	jsr save6
	jsl fmdLESetText
	bra restore6

fGetText	jsr save6
	jsl fmdLEGetText
	bra restore6

fWhichRadio	jsr save6
	jsl fmdWhichRadio
	bra restore6

fSetIBeam	jsr save6
	jsl fmdSetIBeam
	bra restore6

fGetIBeamAdr	jsr save6
	jsl fmdGetIBeamAdr
	bra restore6

fGetCtlPart	jsr save6
	jsl fmdGetCtlPart
	bra restore6

fGetError	jsr save6
	jsl fmdGetError
	bra restore6

	endp
	
	end
