mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-11 12:29:46 +00:00
Added ATASCII text codec
This commit is contained in:
parent
e32887b6b7
commit
0231e4c4fd
@ -4,6 +4,8 @@
|
||||
|
||||
* Added array initialization syntax with `for` (not yet finalized).
|
||||
|
||||
* Added `atascii` text codec.
|
||||
|
||||
* Fixed several bugs, most importantly invalid offsets for branching instructions.
|
||||
|
||||
## 0.2.2
|
||||
|
@ -205,6 +205,8 @@ case class MfParser(filename: String, input: String, currentDirectory: String, o
|
||||
case (_, "petscii") => TextCodec.Petscii
|
||||
case (_, "pet") => TextCodec.Petscii
|
||||
case (_, "scr") => TextCodec.CbmScreencodes
|
||||
case (_, "atascii") => TextCodec.Atascii
|
||||
case (_, "atari") => TextCodec.Atascii
|
||||
case (p, x) =>
|
||||
ErrorReporting.error(s"Unknown string encoding: `$x`", Some(p))
|
||||
TextCodec.Ascii
|
||||
|
@ -28,15 +28,24 @@ object TextCodec {
|
||||
"@abcdefghijklmnopqrstuvwxyz[£]↑←" +
|
||||
0x20.to(0x3f).map(_.toChar).mkString +
|
||||
"–ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
Map('^' -> 0x3E, 'π' -> 0x5E))
|
||||
Map('^' -> 0x3E, 'π' -> 0x5E, '♥' -> 0x53, '♡' -> 0x53, '♠' -> 0x41, '♣' -> 0x58, '♢' -> 0x5A, '•' -> 0x51))
|
||||
|
||||
val Petscii = new TextCodec("PETSCII",
|
||||
"\ufffd" * 32 +
|
||||
0x20.to(0x3f).map(_.toChar).mkString +
|
||||
"@abcdefghijklmnopqrstuvwxyz[£]↑←" +
|
||||
"–ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
Map('^' -> 0x5E, 'π' -> 0x7E)
|
||||
Map('^' -> 0x5E, 'π' -> 0x7E, '♥' -> 0x73, '♡' -> 0x73, '♠' -> 0x61, '♣' -> 0x78, '♢' -> 0x7A, '•' -> 0x71)
|
||||
)
|
||||
|
||||
val Atascii = new TextCodec("ATASCII",
|
||||
"♡" +
|
||||
"\ufffd" * 15 +
|
||||
"♣\ufffd–\ufffd•" +
|
||||
"\ufffd" * 11 +
|
||||
0x20.to(0x5f).map(_.toChar).mkString +
|
||||
"♢abcdefghijklmnopqrstuvwxyz♠|",
|
||||
Map('♥' -> 0, '·' -> 0x14)
|
||||
)
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user