1
0
mirror of https://github.com/PDP-10/its.git synced 2026-03-21 08:48:51 +00:00
This commit is contained in:
Lars Brinkhoff
2019-02-24 21:40:03 +01:00
parent bb69c7e680
commit e69ba05264
2 changed files with 151 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ SRC = syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa \
macsym lmcons dmcg hack hibou agb gt40 rug maeda ms kle aap common \
fonts zork 11logo kmp info aplogo bkph bbn pdp11 chsncp sca music1 \
moon teach ken lmio1 llogo a2deh chsgtv clib sys3 lmio turnip \
mits_s rab stan_k bs cstacy kp dcp2 -pics- victor imlac rjl mb
mits_s rab stan_k bs cstacy kp dcp2 -pics- victor imlac rjl mb lars
DOC = info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc \
chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system \
xfont maxout ucode moon acount alan channa fonts games graphs humor \

150
src/lars/3dcube.84 Normal file
View File

@@ -0,0 +1,150 @@
title 3DCUBE - Rotating 3D cube.
a
a=1
b=2
c=3
d=4
e=5
t=6
ptr=7
x1=10
y1=11
x2=12
y2=13
p=17
dstop==003000
point==020000
vecto==100000
verti==200000
define ssfix a,b
muli a,400
tsc a,a
ash a+1,-243+19.!b(a)
termin
define ifix a
push p,a+1
ssfix a,-19.
move a,a+1
pop p,a+1
termin
loc 42
;tsint
loc 100
start: move p,[-pdllen,,pdl-1]
;Get the 340 started.
hrlzi a,dstop
movem a,dlist
.dstart [-dlen,,dlist-1]
.lose
loop: movei a,3
.sleep a,
pushj p,draw
jrst loop
draw:
move ptr,[442200,,dlist]
movei a,point+17 ;Set intentity and scale, go to point mode.
idpb a,ptr
movei x1,512.
movei y1,512.
move a,[0.01]
fadrb a,angle
pushj p,cos
fmpr a,[500.0]
ifix a
movei x2,512.(a)
move a,angle
pushj p,sin
fmpr a,[300.0]
ifix a
movei y2,512.(a)
pushj p,line
movei a,400000
idpb a,ptr
movei a,dstop
idpb a,ptr
popj p,
;Draw line from x1,y1 to x2,y2.
;Expect point mode. Clobber x1,x2,y1,y2.
line: sub x2,x1
sub y2,y1
caige x2,200
camg x2,[-200]
jrst divide
caige y2,200
camg y2,[-200]
jrst divide
tro x1,point ;Stay in point mode.
idpb x1,ptr ;Point mode, horizontal.
tro y1,verti+vecto
idpb y1,ptr ;Point mode, vertical. Go to vector.
jumpge x2,line1
movns x2
tro x2,200 ;Negate bit.
line1: jumpge y2,line2
movns y2
tro y2,200 ;Negate bit.
line2: lsh y2,8.
ior x2,y2
tro x2,600000 ;Escape bit, Intensify bit.
idpb x2,ptr
movei a,point
idpb a,ptr
popj p,
divide: push p,x1
push p,x2
push p,y1
push p,y2
ash x2,-1
ash y2,-1
addm x2,-3(p)
addm y2,-1(p)
subm x2,-2(p)
movns -2(p)
subm y2,(p)
movns (p)
add x2,x1
add y2,y1
pushj p,line
pop p,y2
pop p,y1
pop p,x2
pop p,x1
add x2,x1
add y2,y1
jrst line
COS: FADR A,[1.57079632679]
SIN: MOVM T,A
CAMG T,[.00017]
POPJ P,
FDVRI A,(-3.0)
PUSHJ P,SIN
FMPR T,T
FSC T,2
FADRI T,(-3.0)
FMPRB A,T
POPJ P,
angle: 0.0
.vector pdl(pdllen==1000)
.vector dlist(dlen==4000) ;Display list.
end start