Last active
November 17, 2022 19:34
-
-
Save sblendorio/70776d21155455c2f7695e23785b82ff to your computer and use it in GitHub Desktop.
Commodore 64: conversion PETSCII -> Screen Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 print chr$(147) | |
10 get a$:if a$="" then 10 | |
20 a=asc(a$) | |
30 c=-1 | |
40 if a>= 32 and a<=63 then c=a | |
50 if a>= 64 and a<=95 then c=a-64 | |
60 if a>= 96 and a<=127 then c=a-32 | |
70 if a>=160 and a<=191 then c=a-64 | |
80 if a>=192 and a<=254 then c=a-128 | |
90 if a=255 then c=a-161 | |
100 if c<>-1 then print chr$(147);chr$(13);a$:poke 1024,c | |
110 if c=-1 then poke 53280,0:poke 53280,14 | |
120 goto 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PETSCII | SCREEN | FORMULA | |
---------+---------+------------ | |
32..63 | 32..63 | PETSCII | |
64..95 | 0..31 | PETSCII-64 | |
96..127 | 64..95 | PETSCII-32 | |
160..191 | 96..127 | PETSCII-64 | |
192..254 | 64..126 | PETSCII-128 | |
255 | 94 | PETSCII-161 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment