home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 May
/
1994-05b.d64
/
fn.trans
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
503b
|
15 lines
600 rem code conversion functions
605 :
610 :
615 :
650 rem fn ps(x):petascii->screen pokes
655 rem fn sp(x):screen pokes->petascii
660 rem fn cv(x):true ascii<->petascii
665 :
670 def fn p1(x)=x+128+128*(x>31)+64*(x>63)-32*(x>95)-96*(x>127)+128*(x>159)
675 def fn ps(x)=fn p1(x)+64*(x>191)+33*(x>254)
680 def fn sp(x)=x+64+64*(x>31)-128*(x>63)+64*(x>95)+192*(x>127)-64*(x>191)
685 def fn a1(x)=x+(x*(x>127))-126*(x>127)
690 def fn a2(x)=x-32*(x>64 and x<91)+32*(x>96 and x<123)+128*(x>192 and x<219)
695 def fn cv(x)=fn a1(fn a2(x))