home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 55
/
Amiga_Dream_55.iso
/
RISCOS
/
APPS
/
TEXT
/
MISC
/
CRIB.ZIP
/
!Crib
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1996-04-04
|
6KB
|
239 lines
!RunImage for Crib
written on 4-4-1996 by Richard 'Strider' Atterer
This program is in the PD. I am not responsible for it!
Happy cribbing - (but maybe you should see an oculist first)
Address: Richard Atterer, Beethovenstr. 30, 86391 Stadtbergen, FRG
*@%=&1000509:
3,3)
$" (";
get$="RAM:*"
put$="RAM:CribImage"
7dpi%=360:gfx$="<Crib$Dir>.CharSet2":ch$="m":bold%=
#extraleading%=0:
ver in pixels
#extraspacing%=0:
hor in pixels
Juppercaseonly%=
set TRUE if your charset only has uppercase letters
29:sx%=1600:sy%=1200
"Pointer 1"
ch$,1)
4
"s":ch$="small ("+
(11/dpi%*72)+" pt) "
5
"m":ch$="medium ("+
(13/dpi%*72)+" pt) "
1
ch$="large ("+
(17/dpi%*72)+" pt) "
0,0)"C R I B"'"
"Written on 10/3/1996 by Richard
Strider
Atterer."
"This program is in the public domain."'
"Note that you need a text file in
RAM::RamDisc0.$
for this one to run!"''
"Character set: ";ch$
"dpi of your printer (for correct scaling): ";dpi%
bold%
"Thick lines"
"Thin lines "
''"Press: "
" 1 small character set, uppercase only (";11/dpi%*72" pt) "
" 2 medium character set, uppercase only (";13/dpi%*72" pt) "
" 3 large character set, uppercase only (";17/dpi%*72" pt) "
" 4 for 360 dpi"
" 5 for 180 dpi (360 dpi printing with doubled size)"
" 6 for 300 dpi"
" 7 for 150 dpi (300 dpi printing with doubled size)"
" 8 to enter other value for dpi"
" 9 to toggle thin/thick lines"'
"Press Space to start."''
0,26)
a$=
-/
"1":gfx$="<Crib$Dir>.CharSet1":ch$="s"
./
"2":gfx$="<Crib$Dir>.CharSet2":ch$="m"
//
"3":gfx$="<Crib$Dir>.CharSet3":ch$="l"
"4":dpi%=360
"5":dpi%=180
"6":dpi%=300
"7":dpi%=150
4"
"Value for dpi";dpi%
"9":bold%=
bold%
a$=" "
0,255,255,255:
1,0,0,0
32,0,sx%-34,sy%-34
23,17,7,%110,8;8;0,0:
pr(-2,sy%-18,"mm")
23,17,7,%100,9;8;0,0
0,0,30,sy%:
32,sy%-32,sx%,30
32,sy%-34
message("Choose X/Y size...")
mm(sx%)
a%=
os(i%)
E#
a%,4,a%,32:
-4,-a%,-32,-a%
F,
pr(a%-16,32,
pr(-34,-a%-4,
G
H%
a%,16,a%,32:
-16,-a%,-32,-a%
load and prepare character set
gfx$:len%=
len%<((sx%*sy%)>>5) len%=((sx%*sy%)>>5)
sa% len%:!sa%=len%:sa%!8=16:
"OS_SpriteOp",256+9,sa%
"OS_SpriteOp",256+10,sa%,gfx$
s%(255),width%(255)
"OS_SpriteOp",256+24,sa%,"ndef"
,,ndef%:s%()=ndef%
"OS_SpriteOp",256+40,sa%,"ndef"
,,,a%,height%:width%()=a%
"OS_SpriteOp",512+60,sa%,ndef%,0
A%,B%,C%,D%
"XOS_SpriteOp",256+24,sa%,
,,a%;b%
1)=0
X@ s%(i%)=a%:
"OS_SpriteOp",512+40,sa%,a%
,,,width%(i%),b%
Y<
b%<>height%
1,"Height of sprite
wrong."
Zv
bold%
"OS_SpriteOp",512+60,sa%,a%,0:
"OS_SpriteOp",512+34,sa%,a%,2,0,1:
"OS_SpriteOp",512+34,sa%,a%,0,2,1
"OS_SpriteOp",A%,B%,C%,D%
uppercaseonly%
"Territory_UpperCaseTable",-1
aR
s%(i%)=ndef%
s%(a%?i%)<>ndef% s%(i%)=s%(a%?i%):width%(i%)=width%(a%?i%)
load source text
get$:b%=
get% b%+1:end%=get%+b%:
"Load "+get$+" "+
~get%
end%?-1<>10 ?end%=10:end%+=1
0,-sy%,sx%,sy%
message("Choose X/Y size...")
oldx%=0:oldy%=0
x%,y%,z%
r$ x%=
mm(x%)+.5:y%=
mm(-y%)+.5
x%<>oldx%
y%<>oldy%
t/
os(oldx%),0,
os(oldx%),-
os(oldy%)
u0
os(oldy%),
os(oldx%),-
os(oldy%)
v&
os(x%),0,
os(x%),-
os(y%)
w'
os(y%),
os(x%),-
os(y%)
oldx%=x%:oldy%=y%
y
{( xbox%=
os(x%)>>1:ybox%=
os(-y%)>>1
xbox%<<1,0,xbox%<<1,ybox%<<1
0,ybox%<<1,xbox%<<1,ybox%<<1
a%,a%,b%:
plot!
message("(Click with right button to restart.)")
ptr%=get%
3 x%=0:y%=1-height%:lastspace%=-1:lastspacex%=0
+ a%=?ptr%:ptr%+=1:
ptr%=end% ybox%=0
8
a%=32 lastspace%=ptr%:lastspacex%=x%+width%(32)
a%=10
3 lastspacex%=x%:x%=xbox%+1:lastspace%=ptr%
S
"OS_SpriteOp",546,sa%,s%(a%),x%<<1,y%<<1,0:x%+=width%(a%)+extraspacing%
x%>xbox%
D
lastspace%=-1 lastspace%=ptr%-1:lastspacex%=x%-width%(a%)
:
lastspacex%<<1,y%<<1,sx%,(height%-1)<<1
F x%=0:y%-=height%+extraleading%:ptr%=lastspace%:lastspace%=-1
a%,a%,z%
y%<ybox%
1)=0
Y
message("Click with left button to save and quit, with right button to restart")
a%,a%,z%:
a%,a%,z%:
a%,a%,b%:
grab and save sprite (in Draw file)
message("")
0!sa%=len%:sa%!8=16:
"OS_SpriteOp",256+9,sa%
"OS_SpriteOp",256+16,sa%,"image",1,0,(y%+height%)<<1,xbox%<<1,0
"OS_SpriteOp",256+40,sa%,"image"
,,,x%,y%
put$:
"SetType "+put$+" aff"
#a%,"Draw";:
put(201):
put(0):
#a%,"Crib ";
put(0):
put(0):
put(x%*256*180/dpi%):
put(y%*256*180/dpi%)
put(5):
Transformed sprite object
b%=sa%+sa%!8:
put(24+!b%)
put(0):
put(0):
put(x%*256*180/dpi%):
put(y%*256*180/dpi%)
"OS_GBPB",2,a%,b%,!b%
0,0,sx%,sy%
"OS_SpriteOp",256+34,sa%,"image",16,16,0
give OS units for mm and v.v.
os(mm)
=mm/25.4*2*dpi%
mm(os)
=os*25.4/2/dpi%
pr(x%,y%,a$)
x%,y%:
message(a$)
8,40-sy%,sx%,16:
pr(8,56-sy%,a$):
put(x%)
#a%,x%:
#a%,x%>>8:
#a%,x%>>16:
#a%,x%>>24: