home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 130 / 130.d81 / numcon (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  295 lines

  1. 10 rem *** universal base converter ***
  2. 20 rem ***    version 2.0 090194    ***
  3. 30 rem ***   by michael j. gulyas   ***
  4. 40 :
  5. 50 clr:dv=peek(186):if dv<8 then dv=8
  6. 60 poke788,52:gosub 270:gosub 870
  7. 70 poke214,16:poke211,2:sys58732:printc0$s0$(0)
  8. 80 poke214,16:poke211,21:sys58732:printc0$s0$(0)
  9. 90 poke214,19:poke211,2:sys58732:printc0$s0$(1)
  10. 100 poke214,22:poke211,2:sys58732:printc0$s0$(1):x=0:y=0
  11. 110 poke214,16+y0*3:poke211,2-19*x0*(y0=0):sys58732
  12. 120 printc0$s0$(y0)nv$(3*y0-(y0=0)*(1+x0));
  13. 130 poke214,16+y*3:poke211,2-19*x*(y=0):sys58732
  14. 140 printc0$s0$(y)nv$(3*y-(y=0)*(1+x));
  15. 150 poke214,16+y*3:poke211,2-19*x*(y=0):sys58732:ct=0:y0=y:x0=x
  16. 160 gosub 460:for n=1 to 50
  17. 170 get a$:if a$="" then next:goto 160
  18. 180 n=50:next:gosub 490:if mo then mo=0:mg=0:gosub 2140
  19. 190 for n=1tolen(pc$):if a$=mid$(pc$,n,1) then co=n:n=len(pc$):next:goto 210
  20. 200 next:gosub 1180:goto 160
  21. 210 on co gosub 1140,1150,1140,1150,2330,1890
  22. 220 on co goto 110,110,110,110,160,160
  23. 230 goto 160
  24. 240 print"
  25. 250 [161] a$:[139] a$[178]"" [167] 250
  26. 260 [128]:[138]
  27. 270 [143] *** load files ***
  28. 280 [141] 500
  29. 290 [158]57812"numcon.font",dv,0:[151]780,0:[151]781,0:[151]782,224:[158]65493
  30. 300 [158]57812"numcon.obj",dv,0:[151]780,0:[151]781,0:[151]782,192:[158]65493
  31. 310 [158] ad[170]21,1
  32. 320 [153]"load":[151] 53280,11:[151] 53281,0:[151] 53265,([194](53265)[175]191)
  33. 330 [151] 56578,[194](56578)[176]3
  34. 340 [151] 56576,([194](56576)[175]252)[176]0
  35. 350 [151] 53272,([194](53272)[175]15)[176]32
  36. 360 [151] 648,200
  37. 370 [151] 53272,([194](53272)[175]240)[176]8
  38. 380 [142]
  39. 390 [143]
  40. 400 [129] i[178]0 [164] 15
  41. 410 [158]ad[170]30,8,32,22,24,32,i[170]8,1
  42. 420 [158]ad[170]30,9,31,23,23,32,i,1
  43. 430 [129] j[178]1 [164] 10:[161] a$:[139] a$[178]"" [167] [130]:[130]:[137] 400
  44. 440 j[178]10:i[178]15:[130]:[130]:[142]
  45. 450 wd$[178]"":dp[178]0:[142]
  46. 460 z[178]51200[170]40[172][194](214)[170][194](211)
  47. 470 ct[178]1[171]ct:[145] ct[170]1 [137] 490,480
  48. 480 [151] z,[194](z)[176]128:[142]
  49. 490 [151] z,[194](z)[175] 127:[142]
  50. 500 [143] *** loading screen ***
  51. 510 [141] 730
  52. 520 [151]53265,[194](53265)[176]64
  53. 530 [151] 53280,6:[151] 53281,14:[151] 53282,0:[151]53283,1:[151]53284,6
  54. 540 tb[178]7
  55. 550 [153]"loadreturn"[163]tb[170]1)"sys+++++++++++++++++++++++++
  56. 560 printtab(tb)"[158][160][146][170]                       [146][170]
  57. 570 [153][163]tb)"sysclosewait+     stopuniversal base    syswait+
  58. 580 printtab(tb)"[158][160][146][170]       [144]converter       [158][146][170]
  59. 590 [153][163]tb)"sysclosewait+                       syswait+
  60. 600 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
  61. 610 [153][163]tb)"sysclosewait+                       syswait+
  62. 620 printtab(tb)"[158][160][146][170]  [144]version 2.0 090194   [158][146][170]
  63. 630 [153][163]tb)"sysclosewait+                       wait+
  64. 640 printtab(tb)"[158][160][146][170]  [144]by michael j. gulyas [146][158][170]
  65. 650 [153][163]tb)"sysclosewait+                       wait+
  66. 660 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
  67. 670 [153][163]tb)"sysclosewait+                       wait+
  68. 680 printtab(tb)"[158][160][146][170]       [144]loading...      [146][158][170]
  69. 690 [153][163]tb)"sysclosewait+                       wait+
  70. 700 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
  71. 710 [153][163]tb)"sysclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclose
  72. 720 return
  73. 730 rem *** variables ***
  74. 740 dim a,ad,a$,b,b0,b1,b%,b$,c,co,cp,ct,c0$,c1$,dp,fr,i,in
  75. 750 dim j,ln,lo,mg,mo,n,nu$,pc$,s,tb,tm,wd$,x,x0,xp,y,y0,yp,z
  76. 760 dim nv$(3),s0$(1),mg$(10)
  77. 770 rem reserved for dimming
  78. 780 s0$(0)="                 [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
  79. 790 s0$(1)="                                    "
  80. 800 s0$(1)=s0$(1)+"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
  81. 810 c0$="[158]":c1$="[129]"
  82. 820 nu$="0123456789abcdefghijklmnopqrstuvwxyz"
  83. 830 pc$="[145][157][133][136]"
  84. 840 for n=0 to 10:read mg$(n):next
  85. 850 ad=49152:s=54272
  86. 860 return
  87. 870 rem *** print screen ***
  88. 880 print"[147][151]                                        [184][188][188][188][188][188][188][188]";
  89. 890 print"[188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185][190][146]   [153]*** [213][206][201][214][197][210][211][193][204]";
  90. 900 print" [194][193][211][197] [195][207][206][214][197][210][212][197][210] [153]***[151]   [191][181][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182]";
  91. 910 print"[182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][183][190][146]             [201]nstructions    [152]";
  92. 920 print"         [151][191][190][152][146]                            [152]     ";
  93. 930 print"     [151][191][190][152][146] [154]1. [197]nter [154][198][210][207][205] base in decimal.   [152]";
  94. 940 print"    [151][191][190][152][146] [154]2. [197]nter [154][212][207] base in decimal.     [152] ";
  95. 950 print"   [151][191][190][152][146] [154]3. [197]nter numeral to be converted.  [152]  ";
  96. 960 print"[151][191][190][146] [154]4.[152] [154][210]ead converted numeral at bottom[152]  [151]";
  97. 970 print"[191][190][152][146]    window.[152]                           [151][191][190][152][146]";
  98. 980 print"                                      [151][191][186][189][189][189][189][189][189][189][189]";
  99. 990 print"[189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187]                   ";
  100. 1000 print"                      [198][210][207][205]:              [212][207]:      ";
  101. 1010 print"            [184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185][184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185]";
  102. 1020 print"  [190][152][146]                 [151][191][190][152][146]                 [151]";
  103. 1030 print"[191]  [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187][186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187]  [184][188][188][188][188][188]";
  104. 1040 print"[188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185]  [190][152][146]          ";
  105. 1050 print"                          [151][191]  [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189]";
  106. 1060 print"[189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187]  [184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188]";
  107. 1070 print"[188][188][188][188][188][188][188][188][188][185]  [190][152][146]                                 ";
  108. 1080 print"   [151][191]  [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187]    ";
  109. 1090 print"                                    [146]";
  110. 1100 poke53280,11:poke53281,00:poke52199,160:poke56295,11
  111. 1110 poke53282,02:poke53283,03:poke53284,04
  112. 1120 sys ad+6:return
  113. 1130 rem *** cursors ***
  114. 1140 y=1-y:gosub 450:return
  115. 1150 ify=0thenx=1-x:gosub 450:return
  116. 1160 co=5:return
  117. 1170 rem
  118. 1180 rem *** handle digits ***
  119. 1190 on -1*(a$=chr$(13))-2*(a$=".")-3*(a$=chr$(20))goto 1330,1830,2010
  120. 1200 if len(wd$)=0 and a$="0" then return:rem no leading zeros
  121. 1210 if y=1 then 1260
  122. 1220 if a$<"0" or a$>"9" the