1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-22 16:31:02 +00:00

PET: Add oldpet and origpet encodings

This commit is contained in:
Karol Stasiak 2018-12-30 18:54:45 +01:00
parent 6c8ee34a2e
commit b068663729
4 changed files with 58 additions and 2 deletions

View File

@ -11,7 +11,11 @@
* `ascii` standard ASCII
* `pet` or `petscii` PETSCII (ASCII-like character set used by Commodore machines)
* `pet` or `petscii` PETSCII (ASCII-like character set used by Commodore machines from VIC-20 onward)
* `origpet` or `origpetscii` old PETSCII (Commodore PET with original ROMs)
* `oldpet` or `oldpetscii` old PETSCII (Commodore PET with newer ROMs)
* `cbmscr` or `petscr` Commodore screencodes

View File

@ -1,5 +1,7 @@
[compilation]
arch=nmos
encoding=oldpetscii
screen_encoding=petscr
modules=loader_0401,pet_kernal,default_panic

View File

@ -6,4 +6,8 @@
// CHROUT. Write byte to default output. (If not screen, must call OPEN and CHKOUT beforehands.)
// Input: A = Byte to write.
asm void putchar(byte a) @$FFD2 extern
asm void putchar(byte a) @$FFD2 extern
inline void new_line() {
putchar(13)
}

View File

@ -131,6 +131,10 @@ object TextCodec {
case (_, "ascii") => TextCodec.Ascii
case (_, "petscii") => TextCodec.Petscii
case (_, "pet") => TextCodec.Petscii
case (_, "oldpetscii") => TextCodec.OldPetscii
case (_, "oldpet") => TextCodec.OldPetscii
case (_, "origpetscii") => TextCodec.OriginalPetscii
case (_, "origpet") => TextCodec.OriginalPetscii
case (_, "cbmscr") => TextCodec.CbmScreencodes
case (_, "petscr") => TextCodec.CbmScreencodes
case (_, "atascii") => TextCodec.Atascii
@ -294,6 +298,48 @@ object TextCodec {
)
)
val OldPetscii = new TextCodec("Old PETSCII",
"\ufffd" * 32 +
0x20.to(0x3f).map(_.toChar).mkString +
"@abcdefghijklmnopqrstuvwxyz[\\]↑←" +
"\ufffd" * 32 +
"\ufffd" * 32 +
"\ufffd" * 32 +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ\ufffd\ufffd\ufffdπ",
Map('^' -> 0x5E, '♥' -> 0xD3, '♡' -> 0xD3, '♠' -> 0xC1, '♣' -> 0xC8, '♢' -> 0xDA, '•' -> 0xD1), Map.empty, Map(
"n" -> List(13),
"q" -> List('\"'.toInt),
"apos" -> List('\''.toInt),
"up" -> List(0x91),
"down" -> List(0x11),
"left" -> List(0x9d),
"right" -> List(0x1d),
"reverse" -> List(0x12),
"reverseoff" -> List(0x92)
)
)
val OriginalPetscii = new TextCodec("Original PETSCII",
"\ufffd" * 32 +
0x20.to(0x3f).map(_.toChar).mkString +
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]↑←" +
"\ufffd" * 32 +
"\ufffd" * 32 +
"\ufffd" * 32 +
"abcdefghijklmnopqrstuvwxyz\ufffd\ufffd\ufffdπ",
Map('^' -> 0x5E, '♥' -> 0xD3, '♡' -> 0xD3, '♠' -> 0xC1, '♣' -> 0xC8, '♢' -> 0xDA, '•' -> 0xD1), Map.empty, Map(
"n" -> List(13),
"q" -> List('\"'.toInt),
"apos" -> List('\''.toInt),
"up" -> List(0x91),
"down" -> List(0x11),
"left" -> List(0x9d),
"right" -> List(0x1d),
"reverse" -> List(0x12),
"reverseoff" -> List(0x92)
)
)
val Atascii = new TextCodec("ATASCII",
"♡" +
"\ufffd" * 15 +