[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NuMustang?



Some like HW, others do SW (hopefully, W is not reversed)
antoine

********************************************
* Boot Failure exit routine
* resets the host state	and
* issues an error message
* to be	polite to the user
*******************************************
bootfail	equ	*
		bit	$C082		;switch	in the ROM for sure
		lda	loc0		;see if	card called by Monitor autoscan
		bne	@noauto
		lda	loc1		;
		cmp	mslot_h		;
		bne	@noauto		;
		jmp	autoscan	;if so,	jump back in

@noauto		jsr	setvid_h	;
		jsr	setkbd_h	;
		jsr	text_h		;
		jsr	home_h		;

		ldy	#bfstr1-bfstr1
		lda	g_error		;never ready msg?
		cmp	#$30
		bne	@20		;no.
		ldy	#bfstr2-bfstr1	;yes.
@20		ldx	#0
@25		lda	bfstr1,Y
		beq	@30
		sta	$488,X		;on 2nd	line of	screen
		iny
		inx
		bne	@25
@30
		jmp	Basic		;restore for beta

		msb	on
bfstr1		DC.B	'UNABLE TO BOOT'
		DC.B	0
bfstr2		DC.B	'CONTROLLER NEVER READY'
		DC.B	0
		msb	off

**********************************************************************
*	Firmware "access" detector logic for GS/OS driver to use
**********************************************************************
Notifier	lda	g_unitnum
		beq	@notZero
		cmp	#maxUnits+1
		bcs	@notZero	;only notify if unitnum = 1..4
		tya
		pha
		txa
		pha
		lda	$C080+2,x	;switch in Bank2 of RAM ($800-$BFF of slave RAM)
		jsr	Caller
		pla
		tax
		lda	$C080+0,x	;switch Bank0 back in for execute
		pla
		tay			;restore Y
@notZero	rts

Caller		lda	#$CB		;high address byte of "user" routines
		pha
		ldx	g_unitnum
		lda	CBentry-1,x
		pha
		rts			;dispatch to "user" routine notify routine

CBentry		dc.b	$80-1		;=$CB80 for unit #1
		dc.b	$A0-1		;=$CBA0
		dc.b	$C0-1		;=$CBC0
		dc.b	$E0-1		;=$CBE0 for unit #4

**********************************************************************
* Check the re Entry Flag to prevent reentrant call to my firmware
*
* Assumes RAM bank 02 has been selected before calling
*
* Assumes isIIgs is reset to "unknown" on every reset Warm/Cold
*
* Must preserve Y reg
**********************************************************************
CheckRE:
		bvs	@boot		;reset flag on a boot entry
		bit	isIIgs		;has flag been cleared since RESET?
		bpl	@10		;yep
@boot		lda	#00
		sta	reEntryFlag	;	1st call after reset!
		rts
@10		bit	reEntryFlag
		bmi	@NOTREENTRANT
		lda	#$80
		sta	reEntryFlag	;set the "I am BUSY flag"
		rts
@NOTREENTRANT	pla
		pla			;discard return address of my JSR
		LDA	#$01		;BAD COMMAND ERROR FOR EVERYTHING NOW
		plp
		sec
		rts	;return for entire call to firmware



Host_ROM_length	equ	*-Host_ROM_code
		if	(Host_ROM_length > 1536) then
		aerror	'!! Host_ROM_code length is longer than 1.5K !!'
		else
		DCB.B	1536-Host_ROM_length,$00 ;fill the remaining bytes with	zero's
		endif

		ENDP