//Program to make GACHA10.br

get "streams.d"
get "altofilesys.d"

external
[	//OS
	OpenFile; FileLength; CallSwat; PositionPage
	ReadBlock; Closes; WriteBlock; Puts

//Defined here
	MakeFont
]

let MakeFont(Layout,userParams,CFA) be
[	let FontStream = OpenFile("GACHA10.AL",ksTypeReadOnly,wordItem)
	let SizeFont = (FileLength(FontStream)+1) rshift 1
	if SizeFont ne 2170B then CallSwat("Wrong size")
	PositionPage(FontStream,1)
	let FontP = vec 3000
	ReadBlock(FontStream,FontP,SizeFont)
	Closes(FontStream)
	let BRStream = OpenFile("gacha10.br",ksTypeWriteOnly,wordItem)
	for I = 0 to 30B do
	[ Puts(BRStream,table [
		1000B;	2226B;	0B;	17B;	0B;	25B
		0B;	30B;	0B;	2223B;	0B;	2225B
		0B;	0B;	0B;	1B;	140B;	2B
		2506B;	67556B;	72120B;	1B;	1B;	2B
		2172B ] !I)
	]
	WriteBlock(BRStream,FontP,SizeFont)
	Puts(BRStream,0); Puts(BRStream,77777B)
	Puts(BRStream,1); Puts(BRStream,0); Puts(BRStream,0)
	Closes(BRStream); finish
]