home *** CD-ROM | disk | FTP | other *** search
- 5 clr
- 10 rem ********************************
- 20 rem * adventure writing on the c64 *
- 30 rem * *
- 40 rem * written by jason finch *
- 50 rem * (c) cdu 1990 *
- 60 rem ********************************
- 70 :
- 80 my=28:rem ** text window size (vert)
- 90 :
- 95 cd$="":ifmy>14thenmy=14:rem ** max my is 14
- 100 poke53280,14:poke53281,6:print"[147][159][197]nter the text that you want to compress"
- 105 print"[213]se the standard cursor keys and the left arrow to mark the end"
- 110 print"[196][197][204] cannot be used but press [210][197][212][213][210][206] to begin compression"
- 115 print"[158][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"right$(cd$,my-1)
- 120 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":x=0:y=0
- 125 rem *******************************
- 130 rem * routine to enter text using *
- 135 rem * a fairly simple method *
- 140 rem * *
- 145 rem * alter line 225 to allow *
- 150 rem * other characters. *
- 155 rem *******************************
- 160 poke1344+x+y*40,peek(1344+x+y*40)+128:poke55616+x+y*40,1
- 165 geta$:ifa$=""then165
- 170 poke1344+x+y*40,peek(1344+x+y*40)-128:ifa$="[145]"theny=y+1*(y>0):goto160
- 175 ifa$=""theny=y-1*(y<(my-1)):goto160
- 180 ifa$="[157]"thenx=x+1*(x>0):goto160
- 185 ifa$=""thenx=x-1*(x<39):goto160
- 190 a=asc(a$):ifa=13thenprintcd$"[208]lease wait";:goto270: rem ** return key pressed
- 195 if(a>64anda<91)ora=95thena=a-64:goto255:rem *** lower letters/_ ***
- 200 ifa>192anda<219thena=a-128:goto255: rem *** upper letters ***
- 205 :
- 210 :
- 215 rem spc . , ! ? "
- 220 :
- 225 [139]a[178]32[176]a[178]46[176]a[178]44[176]a[178]33[176]a[178]63[176]a[178]34[176]a[178]42[176]a[178]45[176](a[177]47[175]a[179]58)[167]255
- 230 :
- 235 [143] * - 0-9
- 240 :
- 245 :
- 250 [137]160
- 255 [151]1344[170]x[170]y[172]40,a:x[178]x[170]1:[139]x[178]40[167]x[178]0:y[178]y[170]1
- 260 [139]y[178]my[167]y[178]my[171]1:x[178]39
- 265 [137]160
- 270 e[178]0:[129]i[178]0[164]my[172]40[171]1:[139][194](1344[170]i)[178]31[167]e[178]i:i[178]my[172]40:[143] ** find marker **
- 275 [130]:[139]e[167]290
- 280 [153]cd$"(NULL)o end marker - (NULL)ress any key":[151]198,0:[146]198,1
- 285 [151]198,0:[153]cd$" ":[137]160
- 290 [129]i[178]e[164]my[172]40[171]1:[151]1344[170]i,32:[130]:[153]", lenompressing...on"
- 295 [143] *******************************
- 300 [143] * begin compression and *
- 305 [143] * special coding of the non- *
- 310 [143] * standard characters like *
- 315 [143] * upper-case letters *
- 320 [143] *******************************
- 325 l[178]0:cl[178]0
- 330 [139](e[171]l)[177][171]1[167][153],,,e[171]l"cmd on"
- 335 [129]i[178]0[164]2:a[178][194](1344[170]l[170]i):[139]a[177]0[175]a[179]27[167]375
- 340 [139]a[178]32[167]a[178]0:[137]375:[143] ** space
- 345 [139]a[178]46[167]a[178]27:[137]375:[143] ** stop
- 350 [139]a[178]44[167]a[178]28:[137]375:[143] ** comma
- 355 [139]a[178]63[167]a[178]29:[137]375:[143] ** ?
- 360 [139]a[178]33[167]a[178]30:[137]375:[143] ** !
- 365 [139]a[177]64[175]a[179]91[167]a[178]a[170]128:[143] ** upper-case letters **
- 370 a[178][171]a:[143] ** special non-standard character **
- 375 c(i)[178]a:[130]
- 380 [129]i[178]0[164]2:c$(i)[178][196](c(i)):[139]c(i)[179]0[167]c$(i)[178]"31:"[170][196]([182](c(i)))
- 385 :
- 390 c(i)[178][197](c$(i)):[130]: [143] ** add special character if necessary **
- 395 :
- 400 ex[178]0:[139]c(0)[178]31[167]l[178]l[170]1:c1[178]255:c2[178][197]([202](c$(0),4)):[137]495
- 405 :
- 410 [139]c(1)[179][177]31[167]430: [143] ** if 2nd in sequence is non-standard, do line 420
- 415 :
- 420 [151]49152[170]cl[170]2,255:l[178]l[171]1:[151]49152[170]cl[170]3,[197]([202](c$(1),4)):ex[178]2:[137]480
- 425 :
- 430 [139]c(2)[179][177]31[167]480: [143] ** no non-standard characters
- 435 :
- 440 [151]49152[170]cl[170]2,255:[151]49152[170]cl[170]3,[197]([202](c$(2),4)):ex[178]2
- 445 :
- 450 :
- 455 [143] *******************************
- 460 [143] * line to compress most text *
- 465 [143] *******************************
- 470 :
- 475 :
- 480 c1[178]c(0)[172]4[170](c(1)[175]24)[173]8:c2[178](c(1)[175]7)[172]32[170]c(2):l[178]l[170]3
- 485 :
- 490 :
- 495 [151]49152[170]cl,c1:[151]49152[170]cl[170]1,c2:cl[178]cl[170]2[170]ex:[139]l[179]([181]((e[170]2.5)[173]3)[172]3)[167]330
- 500 [143] *******************************
- 505 [143] * compression complete - *
- 510 [143] * display information *
- 515 [143] *******************************
- 520 [153]"loadlenompression of text complete."
- 525 [153]"(NULL)riginal length.... "e:[153]"lenompressed length.. "cl
- 530 [153]"(NULL)ercentage saving.. "[181](((e[171]cl)[173]e)[172]10000)[173]100"%"
- 535 [153]"lenoded info stored 49152 to"49151[170]cl"incl.":[153]"str$ecompressed text:"
- 540 [143] *******************************
- 545 [143] * decompress coded characters *
- 550 [143] * at location 49152 *
- 555 [143] *******************************
- 560 [129]z[178]0[164]cl[171]1[169]2 :c1[178][194](49152[170]z):c2[178][194](49153[170]z)
- 565 [139]c1[178]255[167][153][199](c2);:[137]675: [143] ** non-standard character **
- 570 :
- 575 :
- 580 [143] *******************************
- 585 [143] * line to decompress text *
- 590 [143] *******************************
- 595 :
- 600 :
- 605 c(0)[178][181](c1[173]4):c(1)[178]((c1[175]3)[172]8)[170]((c2[175]224)[173]32):c(2)[178]c2[175]31
- 610 :
- 615 :
- 620 [129]i[178]0[164]2:c[178]c(i):[139]c[177]0[175]c[179]27[167]c(i)[178]c(i)[170]64:[137]660:[143] ** letters **
- 625 [139]c[178]0[167]c(i)[178]32:[137]660:[143] * space
- 630 [139]c[178]27[167]c(i)[178]46:[137]660:[143]* stop
- 635 [139]c[178]28[167]c(i)[178]44:[137]660:[143]* comma
- 640 [139]c[178]29[167]c(i)[178]63:[137]660:[143]* ?
- 645 [139]c[178]30[167]c(i)[178]33:[137]660:[143]* !
- 650 i[178]3:[137]670:[143] * forced end because byte '31' is reached *
- 655 :
- 660 [153][199](c(i));:[143] ** print decoded character **
- 665 :
- 670 [130]i
- 675 [130]z
- 680 [143] *******************************
- 685 [143] * end message *
- 690 [143] *******************************
- 695 [153]:[153]"(NULL)ry another example? [(NULL)/(NULL)]":[151]198,0
- 700 [161]a$:[139]a$[178]"y"[167][138]
- 705 [139]a$[179][177]"n"[167]700
- 710 [153]"loadreturn";:[128]
-