home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 May / 1994-05b.d64 / fn.trans (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  503b  |  15 lines

  1. 600 rem code conversion functions
  2. 605 :
  3. 610 :
  4. 615 :
  5. 650 rem fn ps(x):petascii->screen pokes
  6. 655 rem fn sp(x):screen pokes->petascii
  7. 660 rem fn cv(x):true ascii<->petascii
  8. 665 :
  9. 670 def fn p1(x)=x+128+128*(x>31)+64*(x>63)-32*(x>95)-96*(x>127)+128*(x>159)
  10. 675 def fn ps(x)=fn p1(x)+64*(x>191)+33*(x>254)
  11. 680 def fn sp(x)=x+64+64*(x>31)-128*(x>63)+64*(x>95)+192*(x>127)-64*(x>191)
  12. 685 def fn a1(x)=x+(x*(x>127))-126*(x>127)
  13. 690 def fn a2(x)=x-32*(x>64 and x<91)+32*(x>96 and x<123)+128*(x>192 and x<219)
  14. 695 def fn cv(x)=fn a1(fn a2(x))
  15.