home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 July / 1992-07.d64 / pop-up.demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  56 lines

  1. 10 rem copyright 1992 - compute publications intl ltd - all rights reserved
  2. 20 poke53280,0:poke53265,11:poke53281,0:print"[147]":poke53265,27
  3. 30 poke147,0:sys57812"pop-up",8,1:sys62631
  4. 40 poke147,0:sys57812"calculator.spr",8,1:sys62631
  5. 50 :
  6. 60 sys49752,1020:rem enable pop-up and set line to branch to
  7. 70 :
  8. 80 a$="             copyright 1992"+chr$(13)
  9. 90 a$=a$+"    compute publications, intl, ltd"+chr$(13)
  10. 100 a$=a$+"          all rights reserved":fort=1to6:a$=a$+chr$(13):next
  11. 110 b$="[158]         pop-up demo press <f1>":fort=1to6:b$=b$+chr$(13):next
  12. 120 fort=1tolen(a$):printmid$(a$,t,1);:fordl=1to40:next:next
  13. 130 fort=1tolen(b$):printmid$(b$,t,1);:fordl=1to40:next:next
  14. 140 goto120
  15. 150 :
  16. 1000 rem pop-up calculator
  17. 1010 :
  18. 1020 v=53248:pokev+21,0:s=255:fort=2040to2047:poket,s:s=s-1:next
  19. 1030 fort=39to46:pokev+t,12:next:pokev+37,15:pokev+38,11:pokev+28,255
  20. 1040 s=0:fort=0to6step2:pokev+t,32+s:s=s+48:next
  21. 1050 s=0:fort=8to14step2:pokev+t,32+s:s=s+48:next
  22. 1060 fort=1to7step2:pokev+t,98:next:fort=9to15step2:pokev+t,140:next
  23. 1070 pokev+29,255:pokev+23,255:pokev+21,255
  24. 1080 print"":fort=1to7:print"                       ":next
  25. 1090 pokev+27,255:print""tab(15)"[149]c 7 8 9":print
  26. 1100 printtab(4)"m+ * + %   [149]. 4 5 6":print
  27. 1110 printtab(4)"mr / - =   [149]0 1 2 3"
  28. 1120 gosub1280
  29. 1130 rt=v:o1$=op$
  30. 1140 gosub1290:v1=v:o2$=op$
  31. 1150 ifo1$="+"thenrt=rt+v1
  32. 1160 ifo1$="-"thenrt=rt-v1
  33. 1170 ifo1$="*"thenrt=rt*v1
  34. 1180 ifo1$="/"andv1=0then1210
  35. 1190 ifo1$="/"thenrt=rt/v1
  36. 1200 iflen(str$(rt))<12then1230
  37. 1210 print"      error":geta$:ifa$<>""anda$<>"[147]"then1210
  38. 1220 goto1120
  39. 1230 print"           ":print""tab(13-len(str$(rt)))rt
  40. 1240 ifo2$<>"="theno1$=o2$:goto1140
  41. 1250 poke198,0:wait198,1:geta$:ifa$="="then1250
  42. 1260 ifa$="+"ora$="-"ora$="*"ora$="/"theno1$=a$:goto1140
  43. 1270 d$="":c=0:dp=0:z=0:gosub1310:goto1130
  44. 1280 print"          0"
  45. 1290 d$="":b$="           ":c=0:dp=0:z=0
  46. 1300 poke198,0:wait198,1:geta$
  47. 1310 ifa$=""ora$="[147]"thenclr:goto1120
  48. 1320 ifzand(a$="+"ora$="-"ora$="*"ora$="/"ora$="=")thenop$=a$:v=val(d$):return
  49. 1330 ifa$="."anddp=0thendp=1:gosub1370:goto1360
  50. 1340 ifasc(a$)<48orasc(a$)>57orc>9then1300
  51. 1350 ifa$="0"anddp=0andval(d$)=0thengosub1390:goto1300
  52. 1360 d$=d$+a$:print""tab(2)left$(b$,11-len(d$))d$:c=c+1:z=1:goto1300
  53. 1370 ifval(d$)=0thend$="0":c=1:z=1
  54. 1380 return
  55. 1390 print"          0":z=1:return
  56.