mirror of
https://github.com/irmen/prog8.git
synced 2024-11-23 07:32:10 +00:00
ddb8346711
cx16: added new character encodings, and routines in textio to enable the character sets for them. cx16: added txt.chrout_lit() and txt.print_lit() to always print the literal characters and never as control codes
66 lines
2.0 KiB
Lua
66 lines
2.0 KiB
Lua
%import textio
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
str buf = "?" * 20
|
|
|
|
sub start() {
|
|
txt.print("a demonstration of the various non-petscii character sets in the x16.")
|
|
wait()
|
|
latin()
|
|
wait()
|
|
cyrillic()
|
|
wait()
|
|
eastern()
|
|
wait()
|
|
ibmpc()
|
|
}
|
|
|
|
sub latin() {
|
|
txt.iso()
|
|
repeat 3 txt.nl()
|
|
write_screencodes(iso:"Latin: Le garçon n'a pas acheté d'œuf.")
|
|
txt.print(iso:"Latin: Le garçon n'a pas acheté d'œuf.")
|
|
}
|
|
|
|
sub cyrillic() {
|
|
txt.iso5()
|
|
repeat 3 txt.nl()
|
|
write_screencodes(iso5:"Cyrillic: 'Хозяин и Работник' написана Лев Толстой.")
|
|
txt.print(iso5:"Cyrillic: 'Хозяин и Работник' написана Лев Толстой.")
|
|
}
|
|
|
|
sub eastern() {
|
|
txt.iso16()
|
|
repeat 3 txt.nl()
|
|
write_screencodes(iso16:"Eastern European: zażółć gęślą jaźń")
|
|
txt.print(iso16:"Eastern European: zażółć gęślą jaźń")
|
|
}
|
|
|
|
sub ibmpc() {
|
|
txt.color2(5,0)
|
|
void cx16.screen_mode(1,false)
|
|
txt.cp437()
|
|
repeat 3 txt.nl()
|
|
write_screencodes(cp437:"≈ IBM Pc ≈ ÇüéâäàåçêëèïîìÄ ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐ ☺☻♥♦♣♠•◘○◙♂♀♪♫☼ ►◄↕‼¶§▬↨↑↓→←∟↔▲▼")
|
|
; regular print() won't work because of control codes (<32) in this one.
|
|
txt.print_lit(cp437:"≈ IBM Pc ≈ ÇüéâäàåçêëèïîìÄ ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐ ☺☻♥♦♣♠•◘○◙♂♀♪♫☼ ►◄↕‼¶§▬↨↑↓→←∟↔▲▼")
|
|
txt.nl()
|
|
}
|
|
|
|
sub wait() {
|
|
txt.print("\n\npress enter: ")
|
|
void txt.input_chars(buf)
|
|
}
|
|
|
|
sub write_screencodes(str message) {
|
|
ubyte column=0
|
|
repeat {
|
|
if message[column]==0
|
|
return
|
|
txt.setchr(column, 1, message[column])
|
|
column++
|
|
}
|
|
}
|
|
}
|