*** TimesTest.s
*** Here's a small test source for the MASTERSEKA or ARGASM assembler.
*** It uses a Times 24 font module produced by FontGlue.
*** Remember to place this in CHIP mem!
*** Note the SECTION lines produced by FontGlue have been removed.
*** (see bottom of source)
***                                                  J.I.Bruarøy

ExecBase    = 4
OpenLib     = -408
CloseLib    = -414
OpenScreen  = -198
CloseScreen = -66
SetFont     = -66
Move        = -240
Text        = -60
TextLength  = -54

*** main

s:	bsr	InitFGFont		; <-- Remember to call this

	bsr	open_gfx_lib
	bsr	open_int_lib

	move.l	IntBase,a6
	lea	NewScreen,a0
	jsr	OpenScreen(a6)		; we open a screen
	move.l	d0,Screen
	beq	out
	add.l	#$54,d0
	move.l	d0,RastPort

	move.l	GfxBase,a6
	move.l	RastPort,a1
	lea	FGFont,a0		; <-- Use our font
	jsr	SetFont(a6)		;     on this screen

	move.l	GfxBase,a6
	move.l	RastPort,a1
	lea	myText,a0
	move.l	#EOmyText-myText,d0
	jsr	TextLength(a6)

	move.l	d0,d1			; center text
	lsr.l	#1,d1
	move.l	#160,d0
	sub.l	d1,d0
	bpl.s	ok
	moveq	#0,d0
ok:
	move.l	GfxBase,a6
	move.l	RastPort,a1
	move.w	#130,d1
	jsr	Move(a6)

	move.l	RastPort,a1
	lea	myText,a0
	move.l	#EOmyText-myText,d0
	jsr	Text(a6)		; write text

hog:	cmp.b	#$39,$bfec01
	bne.s	hog
*** end
	move.l	IntBase,a6
	move.l	Screen,a0
	jsr	CloseScreen(a6)
out:	bsr	close_int_lib
	bsr	close_gfx_lib
	rts

**************************************************

myText:		dc.b	"A FontGlue 1.0 example."
EOmyText:	dc.b	" "
		even
Screen:		dc.l	0
RastPort:	dc.l	0

******************************************************************
*  GRAPHICS Library - V1.0                             © TRIUMPH *
******************************************************************
open_gfx_lib:
	move.l	ExecBase,a6
	lea	GfxName,a1
	jsr	OpenLib(a6)
	move.l	d0,GfxBase
	rts

close_gfx_lib:
	move.l	ExecBase,a6
	move.l	GfxBase,a1
	jsr	CloseLib(a6)
	rts

GfxBase:	dc.l	0
GfxName:	dc.b	'graphics.library',0
		even

******************************************************************
*  INTUITION Library - V1.0                            © TRIUMPH *
******************************************************************
open_int_lib:
	move.l	ExecBase,a6
	lea	IntName,a1
	jsr	OpenLib(a6)
	move.l	d0,IntBase
	rts

close_int_lib:
	move.l	ExecBase,a6
	move.l	IntBase,a1
	jsr	CloseLib(a6)
	rts

IntBase:	dc.l	0
IntName:	dc.b	'intuition.library',0
		even

******************************************************************
*  NewScreen-STRUCTURE - V1.0                          © TRIUMPH *
******************************************************************
NewScreen:
	dc.w	0	;LeftEdge
	dc.w	0	;TopEdge
	dc.w	336	;Width
	dc.w	256	;Height	(-1 = STDSCREENHEIGHT)
	dc.w	1	;Depth
	dc.b	0	;DetailPen
	dc.b	1	;BlockPen
	dc.w	$0	;ViewModes:
			;	Hex:	Meaning: Viewport specs
			;	----------------
			;	   2	GENLOCK_VIDEO
			;	   4	LACE
			;	  40	PFBA
			;	  80	EXTRA_HALFBRITE
			;	 100	GENLOCK_AUDIO
			;	 400	DBPF
			;	 800	HAM
			;	2000	VP_HIDE
			;	4000	SPRITES
			;	8000	HIRES (640)
	dc.w	$F	;Type:
			;	Hex:	Meaning: Screen type
			;	----------------
			;	  1	WBENCHSCREEN
			;	  F	CUSTOMSCREEN
			;	 10	(SHOWTITLE)
			;	 20	(BEEPING)
			;	 40	CUSTOMBITMAP (Supply own BM)	
			;	 80	SCREENBEHIND (create behind)
			;	100	SCREENQUIET (No Int.rendering
	dc.l	0	;*Font		(struct TextAttr)(0=standard)
	dc.l  scrtitle	;*DefaultTitle  (string/0)
	dc.l	0	;*Gadgets	(struct Gadget)  (0=no gadgs) 
	dc.l	0	;*CustomBitMap	(struct BitMap)  (0=create BM

scrtitle:  dc.b	"Hit CTRL to exit.",0
even

*** Here's the module produced by FontGlue >>>

********************************************************************
* FONT: Times24                      FontGlue 1.0 - by J.I.Bruarøy *
*                                                                  *
* Put data section in chip memory. Call the init-function below,   *
* and use the label `FGFont' instead of that returned by           *
* a successfull call to OpenDiskFont. But never close the font!    *
* If you're using SEKA, just remove the two SECTION lines.         *
********************************************************************

InitFGFont:
	lea	FGFont,a0
	move.l	a0,d0
	cmp.l	34(a0),d0
	blt.s	doneFGFont
	add.l	d0,34(a0)
	add.l	d0,40(a0)
	add.l	d0,44(a0)
	add.l	d0,48(a0)
doneFGFont:
	rts

FGFont:
	INCBIN "Times24"
