-
Notifications
You must be signed in to change notification settings - Fork 13
/
MBOOTS.MAC
1107 lines (1032 loc) · 26.1 KB
/
MBOOTS.MAC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;Copyright (C) 1980 by
;Roy Trubshaw, Richard Bartle & Brian Mallett,
;Essex University, Colchester. CO4 3SQ.
;
; This software is furnished on the understanding that
;it may be used and or copied only with the inclusion of this
;notice. No title or ownership of this software is hereby
;transferred. The information in this software is subject to
;change without notice. No responsibility is assumed for the
;use or reliability of this software.
TITLE BCPL
TWOSEG 400K
SEARCH UUOSYM
CODE1==617022
CODE2==13731
CODE3==26262
JRST .BCPL.## ; CATCH FALL THROUGH
..BCPL::TDZA 1, 1
SETO 1, 0 ; SET UP CCL VALUE
MOVEM 1, %CCL## ;Store it.
MOVEM 0, %CALLNM## ;Save name of this game...
CAIN .SGPPN, 75 ;Frig for 7.001 monitor - get 75 instead of ppn
MOVE .SGPPN, 77 ;Real ppn is in 77 (part of lookup block)
MOVEM .SGPPN, MAINTA## ;Save as maintainer's ppn
MOVEM .SGPPN, PATHPP ;Save for assigning MUD:
CAIN .SGDEV, 75 ;Same palaver for device now
MOVE .SGDEV, 75 ;Device is 1st entry in lookup block
SKIPN .SGDEV ;Did he give a disc?
MOVEI .SGDEV, 'DSK' ;No so assume dsk...
MOVEM .SGDEV, DISC ;stow away...
MOVEM .SGDEV, PATHDV ;...again.
came .sgdev, [ sixbit /dsk/ ]
camn .sgdev, [ sixbit /all/ ]
jrst past
camn .sgdev, [ sixbit /lib/ ]
jrst past
movei 2, 4
lop: move 1, [ xwd 3, loc]
jobstr 1,
jrst past
move 1, loc
jumpe 1, over
camn 1, addr+1
jrst past
movem 1, addr(2)
addi 2, 3
jrst lop
over: sos 2
hrli 1, @2
hrri 1, addr
struuo 1,
trn
past: hrri 1, pathbk
hrli 1, 12
path. 1,
trn
RESET
setz 1,
setuwp 1,
halt
SKIPE 74
JRST [ OUTSTR [ ASCIZ /
If you think I'll let you DDT me you've another think coming, squire...
/ ]
JRST @.
EXIT
]
movei 1, imrtrp
movem 1, .jbapr
movei 1, ap.pov+ap.ilm+ap.nxm+ap.par
aprenb 1, 0
moveI 1,vec
piini. 1,0
trn
movei 1,swint
movem 1,vec+4
movei 1,imrtrp
movem 1,vec+10
move 1,[ ps.fon+ps.fac+args]
pisys. 1,0
trn
move 1,[ ps.fon+ps.fac+args1]
pisys. 1,0
trn
skipn esxwd##
jrst ripple
movei 1, 2
hrli 1, 3
movei 2, 2036
seto 3,
trmno. 3,
trn
setz 4,
trmop. 1,
trn
movei 2, 2003
trmop. 1,
trn
ripple: JRST 400010 ;Start ripple through
swint: movem 1, sumadd
hrrz 1, status
cain 1, code1
jrst cone
caie 1, code2
cain 1, code3
jrst ctwo
wally: setzm half
okok: move 1, sumadd
debrk.
halt
cone: setom half
jrst okok
ctwo: skipn half
jrst wally
caie 1, code2
jrst nice
skipe maint##
jrst [ outstr [asciz /
Someone has just tried to do something magical to you nastily.
/ ]
jrst wally
]
outstr [asciz /
Someone has done something magical to you, nastily...
/ ]
exit
halt
nice: outstr [asciz /
Someone has done something magical to you, nicely...
/]
setom ctcflg##
jrst wally
imrtrp: movei 1, imrext
movem 1, .jbapr
outstr [asciz /
Something amazingly magical has happened!
/]
skipe magic##
jrst imrext
setom magic##
jsp 14, @resetgame##
subi 16, 2
imrext: exit 1,
reloc
sumadd: block 1
half: 0
vec: block 4
new: 0
old: 0
flags: 0
status: 0
new1: 0
old1: 0
flags1: 0
stats1: 0
args: .pcjbi
xwd 4,0
xwd 2,0
args1: .pciuu
xwd 10,0
xwd 2,0
pathbk: -5
0
sixbit /MUD/
0
pathdv: exp 0, 0, 0
pathpp: exp 0, 0, 0, 0
addr: .fssrc
disc:: block 1
0
0
block ^d21 ;should be enough for most searchlists...
loc: exp -1,0,0
END ..BCPL
\\\\\
SUBFILE: POWER.BCL @11:29 13-NOV-1986 <477> (3816)
/*
Copyright (C) 1980 by
Roy Trubshaw & Richard Bartle,
Essex University, Colchester. CO4 3SQ.
This software is furnished on the understanding that
it may be used and or copied only with the inclusion of this
notice. No title or ownership of this software is hereby
transferred. The information in this software is subject to
change without notice. No responsibility is assumed for the
use or reliability of this software.
*/
get "bcl:acs"
get "bcl:scb"
get "bcl:iolib"
get "dungen"
get "bcl:rfslib"
$LDTEXT "/RUNAME:power"
external "."
$( fn
$)
manifest
$( TREESIZE = RECLENGTH+2
RIGHT = RH | TREESIZE-1
LEFT = LH | TREESIZE-1
CHAIN = RH | TREESIZE
PPPN = #2011002011//MPPN
$)
static
$( lastblock = 0
cbl = vec 1
dmpbuf = vec BUFFERS
cbll = vec 1
perputt = ?
dmpbuff = vec BUFFERS
bcntt = 1
nextrec = ?
game = $6"mud"
rock = $6"rock"
blud = $6"blud"
perput = ?
rec = ?
gender = 0
me = 0
ch = ?
name = vec 1
room = 0
tree = 0
$)
let start() be
$( let bcnt=1
output:=tty
outs("The power program!*C*L")
$[ $rescan
zonk: $inchrs 1
$jrst plonk
$caie 1, '-'
$jrst zonk
cronk: $inchrs 1
$jrst plonk
$trz 1, #40
$caie 1, 'M'
$cain 1, 'V'
$jrst wonk
$caie 1, 'B' //spot the hacks...
$cain 1, 'R'
$trna
$jrst cronk
$move 2, rock
$cain 1, 'B'
$move 2, blud
$movem 2, game
wonk: $inchrs 1
$trna
$jrst wonk
plonk: $]
input:=tty
Readname(name, "Password: ")
test !name=!"bushbaby" then outs("*C*LThat'll do...*C*L") or
$( Outs("*C*LEek! Go away!*C*L")
finish
$)
$( Outs("Frig, Start, League, Transfer, Enumerate, Password, Dot, Reveal, Mud, Kill*C*Lor One-off? ")
switchon valof
$[ $clrbfi
$inchrw 1
$trz 1, #40
$] into
$(
case 'R': outs("eveal*C*L")
reveal()
finish
case 'M': outs("ud*C*L")
run($6"dsk", $6"mud", $6"exe", PPPN)
case 'S': outs("tart*C*L")
strat()
finish
case 'D': outs("ot*C*L")
dot()
finish
case 'F': outs("rig*C*L")
break
case 'L': outs("eague*C*L")
league()
finish
case 'T': outs("ransfer*C*L")
Transfer()
finish
case 'E': outs("numerate*C*L")
Enumerate()
finish
case 'P': outs("assword*C*L")
password()
finish
case 'K': outs("ill*C*L")
kill()
finish
case 'O': outs("ne-off*C*L")
oneoff()
finish
default 0 ... #137:
Outs("*C*LEh?*C*L")
$)
$) repeat
setup()
readname(name, "Name: ")
if !name =!"richard" Outs("*C*LYou're so naive...*C*L")<>finish
searchrec(name)
if rec then rec_rec rem 128+dmpbuf
test rec then
$( let sc, sx=SCRE of rec, WRD1 of rec bitand 1
outs("Current character profile is:*C*L")
out("Name*T*T:s:s*C*Lscore*T*T:n*T:s*C*Lstrength*T:n*C*L",rec+2,WIZD of rec bitand WIZMASK -> "*TWIZ","",sc,lev(sc,sx),STRN of rec)
out("dexterity*T:n*C*Lstamina*T*T:n*T(max*T:n)*C*Lgames played*T:n*C*Lsex*T*T:smale*C*Lp/w*T:8*C*L",
dxty of rec,stna of rec,stmx of rec,games of rec, sx -> "fe", "",PSWD of rec)
dumpersona(true)
save.block()
$) or
$( out("No current persona! I'll make one for you, :s.*C*L",name)
addrec(name)
rec_rec rem 128+dmpbuf
games of rec_1
WRD1 of rec_!name
WRD2 of rec_LENGTH of name>4 -> 1!name,0
WIZD of rec_false
dumpersona()
save.block()
$)
Close(perput)
deq(sc.channel^perput)
$)
and dumpersona(pw) be
$( unless numbargs() pw_false
if pw pw_ESSEX
if pw pw_appendfile($6"dsk",$6"prolog",$6"prl", MPPN,label(oops))
if pw
$( write(pw,"POWERing :S*C*LStr.*TDex.*TSta.*TScore*TSex*TP/w*C*L",name)
write(pw,":N*T:N*T:N*T:N*T:S*T:8*C*L",STRN of rec,DXTY of rec,
STMX of rec,SCRE of rec,((WRD1 of rec) bitand 1)->"f","m",PSWD of rec)
$)
outs("Prepare to fulfill your wildest dreams!*C*L")
outs("Strength ?"); STRN of rec_getno(STRN)
outs("Stamina (max) ?"); STNA of rec_getno(STMX); STMX of rec_STNA of rec
outs("Dexterity ?"); DXTY of rec_getno(DXTY)
outs("Score ?"); SCRE of rec_getno(SCRE)
outs("Sex ?")
$[ $CLRBFI
$INCHRW ch
$]
Gender_(WRD1 of rec) bitand 1
TEST ch='M'\/ch='m' THEN OUTS("ale*C*L")<>gender_0
OR if ch= 'F'\/ch='f' THEN OUTS("emale*C*L")<>
gender_1
outs("Pn ?"); PN of rec_Getno(PN,true)
unless PN of rec PN of rec_valof $[ $getppn 1, 0 $]
WRD1 of rec_((WRD1 of rec) bitand ~1) bitor gender
LSTM of rec_valof
$[ $hrri ac, #11
$hrli ac, #53
$gettab ac, 0
$trn
$]
if pw /\ (PSWD of rec ne 0)
$( outs("Zero p/w ?")
if valof
$[ $clrbfi
$inchrw 1
$trz 1, #40
$caie 1, 'Y'
$jrst render
$outstr $az"es*C*L"
$trna
render: $setz 1, 0
$clrbfi
$] then PSWD of rec_0
$)
if pw
$( write(pw,":N*T:N*T:N*T:N*T:S*T:8*C*L",STRN of rec,DXTY of rec,
STMX of rec,SCRE of rec,((WRD1 of rec) bitand 1)->"f","m",PSWD of rec)
close(pw)
$)
return
oops: Outs("*C*LI can't log this frig, so I won't do it, sorry.*C*L")
$)
and load.block(stream,block) be
$( if block=lastblock return
useti(perput,block)
inuuo(stream,cbl)
lastblock_block
$)
and save.block(block) be
$( let blk=numbargs()->block,lastblock
useto(perput,blk)
outuuo(perput,cbl)
$)
and searchrec(nam) = valof
$( let pnt,lrec,str=?,0,vec 1
!str_!nam
1!str_LENGTH of nam>4 -> 1!nam, 0
load.block(perput,1)
lrec_hashval(str)
rec_dmpbuf!lrec
while rec
$( load.block(perput,rec/WDSPERBUF+1)
pnt_(rec rem WDSPERBUF)+dmpbuf
if namesame(str,2+pnt) break
lrec_rec
rec_POINTR of pnt
$)
resultis lrec
$)
and saverec(nam) = valof
$( searchrec(nam)
unless rec addrec(nam)
if rec //In case addrec hasn't added them.
$( load.block(perput,rec/WDSPERBUF+1)
dumpersona(rec rem WDSPERBUF+dmpbuf)
save.block()
$)
resultis rec //return a value to indicate whether you've been saved.
$)
and deleterec(nam) be
$( let olrec,odel,lrec=?,?,searchrec(nam)
and pnt=rec rem WDSPERBUF+dmpbuf
unless rec return //Can't find record
//Ok, this may look a little long-winded
load.block(perput,rec/WDSPERBUF+1) //but it's worth it not to corrupt the persona file in case of a crash
WRD1 of pnt_0
WRD2 of pnt_0 //Zero names for purges etc.
GAMES of pnt_0 //Yawn thinks we need this, too! (WE DO! - Yawn xx)
olrec_!pnt
save.block()
load.block(perput,lrec/WDSPERBUF+1)
dmpbuf!(lrec rem WDSPERBUF)_olrec //Old pointer to rec now points to old pointer of rec.
save.block()
load.block(perput,1) //Get the deleted record pointer
odel_DEL of dmpbuf
save.block()
load.block(perput,rec/WDSPERBUF+1) //And plonk it in the record to be deleted
!pnt_odel //Does anyone read all these comments?
save.block()
load.block(perput,1) //Finally update the deleted record pointer to point to the newly deleted record!
DEL of dmpbuf_rec
save.block()
$)
and addrec(nam) be
$( let hashcont,olrec,str=?,?,vec 1
!str_!nam
1!str_LENGTH of nam>4 -> 1!nam,0
load.block(perput,1)
rec_DEL of dmpbuf
test rec then
$( load.block(perput,rec/WDSPERBUF+1)
olrec_POINTR of (rec rem WDSPERBUF+dmpbuf)
save.block()
$) or
$( rec_FLEN of dmpbuf
unless rec //No persona file exists.
$( rec_2*WDSPERBUF
FLEN of dmpbuf_rec //Create hash table
$)
olrec_0 //No deleted records
FLEN of dmpbuf+_RECLENGTH
save.block()
$)
load.block(perput,1)
DEL of dmpbuf_olrec
hashcont_dmpbuf!hashval(str)
dmpbuf!hashval(str)_rec
save.block()
load.block(perput,rec/WDSPERBUF+1)
POINTR of (dmpbuf+rec rem WDSPERBUF)_hashcont
save.block()
$)
and hashval(nam) = ((!nam+1!nam)>>1) rem 253
and kill() be
$( setup()
readname(name, "Name: ")
if !name =!"richard" Outs("*C*LNot Richard...*C*L")<>finish
deleterec(name)
test rec then out(":s terminated.",name)
or out(":s already dead - you can only kill people once!",name)
Close(perput)
deq(sc.channel^perput)
$)
and getno(sel,octal)=valof
$( let ch=valof
$[ $clrbfi
$inchrw 1
$]
unless numbargs()=2 octal_false
unless '0' le ch le '9'
$( $[ $clrbfi $]
resultis sel of rec
$)
putback(input, ch)
ch_(octal->inoct,inno)()
$( let stk=SC.PUTSTACK^input
SC.PUTSTACK^input, SC.READER^input _ !stk, stk!2
freevec(stk)
$)
resultis ch
$)
and inoct(nopb)=valof
$( let res=0 and ch=?
ch_inch() repeatuntil '0' le ch le '7'
while '0' le ch le '7' do
$( res_(res<<3)-'0'+ch
ch_inch()
$)
unless numbargs() putback(input,ch)
resultis res
$)
and readname(nm, pr) be
$( let n,ch,linev=0,?,vec NAMELENGTH
write(tty, pr)
readch(input,@ch)
while 'a'<=(ch bitor #40)<='z' do
$( n+:1
unless n>NAMELENGTH linev!n:='A'<=ch<='Z'->ch+#40,ch
readch(input,@ch)
$)
!linev:=n>NAMELENGTH->NAMELENGTH,n
packstring(linev,nm)
until ch='*L' do readch(input,@ch)
$) repeatuntil LENGTH of nm
and dot() be
$( let stfl,no,ch=0,?,?
writes(tty,"Please enter the job number of the about to be dotted job*C*L(0 for all of them)*C*L")
writes(tty,"**")
no_rdno(tty)
$( let res=?
writes(tty,"dotted nicely or horribly N/H? ")
$[ $clrbfi
$inchrw ch
$]
stfl_0
test ch='H' \/ ch='h' then stfl_#13731<>writes(tty,"orribly*C*L") or
if ch='N' \/ ch='n' then stfl_#26262<>writes(tty,"icely*C*L")
unless stfl writes(tty,"*Binvalid character*C*L")<>loop
for i=1 to 200 dispose(#617022,i)
test no then res_dispose(stfl, no)
or for i=1 to 200 if dispose(stfl, i) res_true
unless res Writes(tty, "*C*L?POWIDW - it didn't work so stop pissing around.*C*L")
finish
$) repeat
$)
and dispose(stfl, no) be
$[ $hrrz 2,stfl
$hrl 2,no
$calli 2,#175
$setz 1,0 //uh?
$]
and namesame(nam1,nam2)=
(!nam1>>1)=(!nam2>>1)/\((LENGTH of nam1<=4)\/(1!nam1>>1)=(1!nam2>>1))
and strat() be
$( let resp=?
$( writes(tty, "*C*LMud, Valley or Rock? ")
$[ $inchrw 1
$trz 1, ' '
$movem 1, resp
$]
$) repeatuntil resp='V' | resp='M' | resp='R'
write(tty, ":s*C*L", resp='R'->"ock", resp='V'->"alley", "ud")
resp_resp='R' -> $6"rock",resp='V'->$6"valley", $6 "mud"
output_createtmp(resp)
readname(name, "Name: ")
writes(tty, "*C*LRoom: ")
$[ $clrbfi $]
for i=0 to 5 do
$( let letter = byte 6:30-6*i
and next = valof $[ $inchrw 1 $]
if 'a' le next le 'z' next-_'a'-'A'
if next = '*C' break
letter from room _ next-' '
$)
$[ $clrbfi $]
out(":s*^C:n*$:n*$:n", name,
valof $[ $mstime 1, 0 $],
valof $[ $mstime 1, 0 $],
room)
close(output)
run($6 "dsk", resp, $6 "exe", 0)
$)
and setup() be
$( !cbl_(-BUFFERS<<18)bitor(dmpbuf-1)
1!cbl_0
if false
$(
dogoneit: perput_createfile($6"dsk",game,$6".pm",PPPN,0,#17,1)
enq(SC.CHANNEL^perput)
useto(perput,2)
outuuo(perput,cbl)
close(perput)
deq(sc.channel^perput)
$)
perput_updatefile($6"dsk",game,".pm",PPPN,label(dogoneit),#17,1)
enq(sc.channel^perput)
useti(perput,1)
$)
and reveal() be
$( let ch, f, fil, ext=?, ?, vec 1, vec 1
readname(fil, "File part: ")
readname(ext, "Extension part: ")
f_findfile($6"dsk", fil, ext, 0, label(absent))
if false
absent: f_findfile($6"dsk", fil, ext, PPPN, label(nowhere))
input_f
ch_Inch()
while ch ne '*E'
$( outch(ch)
ch_inch()
$)
close(f)
input_tty
return
nowhere: out("Sorry, I can't find :S.:S*C*L", fil, ext)
$)
and password() be
$( let num,numrecs,bcnt=?,?,3
setup()
out("*C*LOctal password: ")
num_inoct(true)
useti(perput,1)
inuuo(perput,cbl)
numrecs_(FLEN of dmpbuf-256)/12 //First find the number of records
useti(perput,bcnt) //Load in the first block of records
inuuo(perput,cbl)
rec_dmpbuf
for i=1 to numrecs
$( if WRD1 of rec /\ num=PSWD of rec
out(":S on :N points*C*L", rec+2, SCRE of rec)
if (rec-dmpbuf)>128
$( rec -_ 128
bcnt +_ 1
useti(perput,bcnt)
inuuo(perput,cbl)
$)
rec+_RECLENGTH
$)
close(perput)
deq(sc.channel^perput)
$)
and Lev(pts, fem)=valof
$( let sc=exp.step
for i=0 to 9
$( if sc ge pts resultis i
sc+_sc
$)
resultis 9
$)!(fem!(table
(table "novice",
"warrior",
"hero",
"champion",
"superhero",
"enchanter",
"sorcerer",
"necromancer",
"legend",
"wizard"
),
(table "novice",
"warrior",
"heroine",
"champion",
"superheroine",
"enchantress",
"sorceress",
"necromancess",
"legend",
"witch"
)
)
)
and Enq(chan) be
$( let addr=vec 4
!addr_#1000005
1!addr_142857
2!addr_chan
3!addr_$az"mud"+(-1<<18)
4!addr_0
Out("*C*LENQ. error code :8*C*L", valof
$[ $move 1, addr
$enq. 1, 0
$trna
$( return $)
$])
$)
and Deq(chan) be
$( let addr=vec 1
!addr_#1000005
1!addr_142857
Out("*C*LDEQ.error code :8*C*L", valof
$[ $move 1, addr
$hrli 1, 1
$deq. 1, 0
$trna
$( return $)
$])
$)
and transfer() be
$( let peep, bcnt, numrecs=?, 3, ?
outs("where from? (0 for everywhere) ")
peep_inoct(true)
setup()
useti(perput,1)
inuuo(perput,cbl)
numrecs_(FLEN of dmpbuf-256)/12 //First find the number of records
useti(perput,bcnt) //Load in the first block of records
inuuo(perput,cbl)
rec_dmpbuf
for i=1 to numrecs
$( if WRD1 of rec /\ (PN of rec=peep | peep=0)
$( out(":s: [**,:8] -> ", rec+2, PN of rec)
PN of rec_Getno(PN, true)
$)
if (rec-dmpbuf)>128
$( rec -_ 128
useto(perput, bcnt)
outuuo(perput, cbl)
bcnt +_ 1
useti(perput,bcnt)
inuuo(perput,cbl)
$)
rec+_RECLENGTH
$)
close(perput)
deq(sc.channel^perput)
$)
and League() be
$( let numrecs,bcnt=?,3
setup()
useti(perput,1)
inuuo(perput,cbl)
numrecs_(FLEN of dmpbuf-256)/12 //First find the number of records
useti(perput,bcnt) //Load in the first block of records
inuuo(perput,cbl)
rec_dmpbuf
for i=1 to numrecs
$( if WRD1 of rec tree_insert(SCRE of rec, tree)
if (rec-dmpbuf)>128
$( rec -_ 128
bcnt +_ 1
useti(perput,bcnt)
inuuo(perput,cbl)
$)
rec+_RECLENGTH
$)
close(perput)
deq(sc.channel^perput)
outs("Writing to LEAGUE.ENM")
output_createfile("dsk","league","enm",0)
outree(tree)
while me
$( let p=LH of me
Out("richard*T*T[**,:8]:c*T34359738369*T9999*Tyes*TWIZARD*C*L",p, p ls #1000->'*T','*0')
me of_RH
$)
close(output)
$)
and today()=valof
$[ $hrli 1, #53
$hrri 1, #11
$gettab 1, 0
$trn
$hlrz 1, 1
$]
and Enumerate() be
$( let now,bcnt,numrecs=today(),3,?
setup()
outs("Writing to POWER.ENM*C*L")
output_Createfile($6"dsk",$6"power",$6"enm", 0, Label(rats))
outs("Enumeration of personas as of ")
outtime()
outs(" on ")
outdate()
outs(":*C*L*L")
useti(perput,1)
inuuo(perput,cbl)
numrecs_(FLEN of dmpbuf-256)/12 //First find the number of records
useti(perput,bcnt) //Load in the first block of records
inuuo(perput,cbl)
rec_dmpbuf
for i=1 to numrecs
$( if WRD1 of rec
$( let t, sx, wz=now-(LH from LSTM of rec), (WRD1 of rec) bitand 1, WIZD of rec
Out("Name:*T*T:S*C*LPpn:*T*T[**,:8]*C*LScore:*T*T:N*C*LStrength:*T:N*C*LDexterity:*T:N*C*LStamina:*T:N*Tmax :N*C*L",
rec+2,PN of rec,SCRE of rec,STRN of rec,DXTY of rec,STNA of rec,STMX of rec)
Out("Last game:*T:N day:S ago*C*Lgames:*T*T:N*C*Lsex:*T*T:Smale*C*L",
t,t=1->"","s",GAMES of rec,sx->"fe","")
if wz bitand WIZMASK Out("Mode:*T*TWI:S*C*L", sx->"TCH","ZARD")
if wz bitand 4 Outs("Mode:*T*TBERSERK*C*L")
Outs("*C*L*L")
$)
if (rec-dmpbuf)>128
$( rec -_ 128
bcnt +_ 1
useti(perput,bcnt)
inuuo(perput,cbl)
$)
rec+_RECLENGTH
$)
close(perput)
deq(sc.channel^perput)
close(output)
Writes(tty,"*C*LEnumerated in DSK:POWER.ENM*C*L")
if false
rats: Writes(tty,"*C*LCan't create DSK:POWER.ENM*C*L")
$)
and insert(sc, tree)=valof
$( if tree test sc ls SCRE of tree then
$( LEFT of tree_insert(sc, LEFT of tree)
resultis tree
$) or if sc gr SCRE of tree then
$( RIGHT of tree_insert(sc, RIGHT of tree)
resultis tree
$)
sc_Newvec(TREESIZE)
for i=0 to RECLENGTH sc!i_rec!i
sc!(RH from RIGHT)_0
if tree
$( CHAIN of sc_CHAIN of tree
CHAIN of tree_sc
resultis tree
$)
CHAIN of sc_0
resultis sc
$)
and outree(tree) be if tree
$( let l, r, n, p=LEFT of tree, RIGHT of tree, tree+2, PN of tree
outree(l)
test !n=!"richard" then
$( let m=newvec(0)
LH of m_p
RH of m_me
me_m
$) or
Out(":s:c*T[**,:8]:c*T:N*T:c:N*T:8:S:S*C*L",
n, LENGTH of n ge 8 -> '*0', '*T', p, p ls #1000->'*T','*0', SCRE of tree,SCRE of tree > 9999999 -> '*0','*t', GAMES of tree,
PSWD of tree, (WIZD of tree bitand 4)-> "*TBERSERK", "",(WIZD of tree bitand WIZMASK)->WRD1 of tree bitand 1->"*TWITCH","*TWIZARD", "")
Outree(CHAIN of tree)
outree(r)
$)
and Oneoff() be
$( let now,newrec,lastrec,recptr,rec2,old.lastrec,hashbuf=
today(),0,?,?,0,?,vec 256
!cbll_(-BUFFERS<<18)bitor(dmpbuff-1)
1!cbll_0
clearvec(dmpbuff, BUFFERS)
perputt_createfile($6"dsk",game,$6"off",0,0,#17,1)
useto(perputt,1)
nextrec_dmpbuff
setup()
$( inuuo(perput,cbl)
rec_dmpbuf
while LH of rec
$(
//Do the processing between here...
let temp,pswrd=newrec,? //record list pointer
newrec_newvec(RECLENGTH) //new reclength
!newrec_temp
for i=0 to 7 do (2+i)!newrec_i!rec //copy over oldrec
for i=8 to RECLENGTH-2 do (2+i)!newrec_0 //and zero the rest
pswrd_9!newrec
9!newrec_(pswrd rem ((1<<20)-1))*(pswrd rem ((1<<25)-1))
if LENGTH of (rec+1)<5 4!newrec_0
//...and here!
rec+_8
$)
unless rec=dmpbuf+2*WDSPERBUF-8 & rec!1 then break
$) repeat
bcntt_3
for hashno=0 to 252
$( let nextrec=newrec
out("****************HASH=:N*****************C*L",hashno)
lastrec_0
while nextrec
$( let recptr=rec2+dmpbuff
if hashno=hashval(nextrec+3)
$( out(":s :n*C*L",nextrec+3,bcntt)
1!nextrec_lastrec
lastrec_rec2+(bcntt-1)*WDSPERBUF
old.lastrec_lastrec
for i=0 to 11 i!recptr_(i+1)!nextrec
rec2+_12
if rec2>128
$( useto(perputt,bcntt)
outuuo(perputt,cbll)
bcntt+_1
rec2 rem_ 128
for i=0 to rec2-1 do i!dmpbuff_(i+12-(rec2-1))!nextrec
$)
$)
nextrec_!nextrec
$)
hashno!hashbuf_lastrec
$)
useto(perputt,bcntt) //tidy up.
outuuo(perputt,cbll)
255!hashbuf_old.lastrec+12
254!hashbuf_0
for hashno=0 to 255 hashno!dmpbuff_hashno!hashbuf
useto(perputt,1)
outuuo(perputt,cbll) //Output hash table
close(perput)
deq(sc.channel^perput)
close(perputt)
Writes(tty,"*C*LOne-offed in the .OFF file*C*L")
$)
and clearvec(vect,size) be
$[ $MOVE AC, vect
$HRLI B, 0(AC)
$HRRI B, 1(AC)
$SETZM 0(AC)
$ADD AC, size
$BLT B, 0(AC)
$]
and yes(rec, str) =valof
write(tty, ":s :s", rec+1, str)<>
$[ $clrbfi
$inchrw 1
$caie 1, 'y'
$cain 1, 'Y'
$jrst ep
$cain 1, '*C'
$jrst yep
$clrbfi
$outstr $az"o*C*L"
$setz 1, 0
$( return $)
yep: $outchr 'y'
ep: $outstr $az"es*C*L"
$]
$[ fn: $exit 1, 0
$jrst fn
$]
\\\\\
SUBFILE: DBADAT.MAC @15:11 16-AUG-1986 <477> (786)
;Copyright (C) 1980 by
;Roy Trubshaw, Richard Bartle & Ronan Flood,