diff --git a/test/cp437.tal b/test/cp437.tal new file mode 100644 index 0000000..0d4998d --- /dev/null +++ b/test/cp437.tal @@ -0,0 +1,259 @@ +&nul ( null ) + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 7e c3 81 a5 81 bd 99 c3 7e 00 00 00 00 00 00 + 00 7e ff ff db ff c3 e7 ff 7e 00 00 00 00 00 00 + 00 00 44 ee fe fe fe 7c 38 10 00 00 00 00 00 00 + 00 10 38 7c fe fe 7c 38 10 00 00 00 00 00 00 00 + 00 18 3c 3c ff e7 e7 18 18 7e 00 00 00 00 00 00 + 00 18 3c 7e ff ff 7e 18 18 7e 00 00 00 00 00 00 + 00 00 00 00 3c 7e 7e 3c 00 00 00 00 00 00 00 00 + ff ff ff ff c3 81 81 c3 ff ff ff ff 00 00 00 00 + 00 00 3c 7e 66 42 42 66 7e 3c 00 00 00 00 00 00 + ff ff c3 81 99 bd bd 99 81 c3 ff ff 00 00 00 00 + 00 3e 0e 3a 72 f8 cc cc cc 78 00 00 00 00 00 00 + 00 3c 66 66 66 3c 18 7e 18 18 00 00 00 00 00 00 + 00 1f 19 19 1f 18 18 78 f8 70 00 00 00 00 00 00 + 00 7f 63 7f 63 63 63 67 e7 e6 c0 00 00 00 00 00 + 00 00 18 db 7e e7 e7 7e db 18 00 00 00 00 00 00 + 00 80 c0 e0 f8 fe f8 e0 c0 80 00 00 00 00 00 00 + 00 02 06 0e 3e fe 3e 0e 06 02 00 00 00 00 00 00 + 00 18 3c 7e 18 18 18 7e 3c 18 00 00 00 00 00 00 + 00 66 66 66 66 66 00 00 66 66 00 00 00 00 00 00 + 00 7f db db db 7b 1b 1b 1b 1b 00 00 00 00 00 00 + 00 7e 63 30 3c 66 66 3c 0c c6 7e 00 00 00 00 00 + 00 00 00 00 00 00 00 fe fe fe 00 00 00 00 00 00 + 00 18 3c 7e 18 18 18 7e 3c 18 7e 00 00 00 00 00 + 00 18 3c 7e 18 18 18 18 18 18 00 00 00 00 00 00 + 00 18 18 18 18 18 18 7e 3c 18 00 00 00 00 00 00 + 00 00 00 18 0c fe 0c 18 00 00 00 00 00 00 00 00 + 00 00 00 30 60 fe 60 30 00 00 00 00 00 00 00 00 + 00 00 00 00 c0 c0 c0 fe 00 00 00 00 00 00 00 00 + 00 00 00 24 66 ff 66 24 00 00 00 00 00 00 00 00 +&rs ( record separator ) + 00 00 10 10 38 38 7c 7c fe fe 00 00 00 00 00 00 + 00 00 fe fe 7c 7c 38 38 10 10 00 00 00 00 00 00 +&space ( space ) + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 30 78 78 78 30 30 00 30 30 00 00 00 00 00 00 + 00 66 66 66 24 00 00 00 00 00 00 00 00 00 00 00 + 00 6c 6c fe 6c 6c 6c fe 6c 6c 00 00 00 00 00 00 + 30 30 7c c0 c0 78 0c 0c f8 30 30 00 00 00 00 00 + 00 00 00 c4 cc 18 30 60 cc 8c 00 00 00 00 00 00 + 00 70 d8 d8 70 fa de cc dc 76 00 00 00 00 00 00 + 00 30 30 30 60 00 00 00 00 00 00 00 00 00 00 00 + 00 0c 18 30 60 60 60 30 18 0c 00 00 00 00 00 00 + 00 60 30 18 0c 0c 0c 18 30 60 00 00 00 00 00 00 + 00 00 00 66 3c ff 3c 66 00 00 00 00 00 00 00 00 + 00 00 00 18 18 7e 18 18 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 38 38 60 00 00 00 00 00 + 00 00 00 00 00 fe 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 38 38 00 00 00 00 00 00 + 00 00 02 06 0c 18 30 60 c0 80 00 00 00 00 00 00 + 00 7c c6 ce de d6 f6 e6 c6 7c 00 00 00 00 00 00 + 00 10 30 f0 30 30 30 30 30 fc 00 00 00 00 00 00 + 00 78 cc cc 0c 18 30 60 cc fc 00 00 00 00 00 00 + 00 78 cc 0c 0c 38 0c 0c cc 78 00 00 00 00 00 00 + 00 0c 1c 3c 6c cc fe 0c 0c 1e 00 00 00 00 00 00 + 00 fc c0 c0 c0 f8 0c 0c cc 78 00 00 00 00 00 00 + 00 38 60 c0 c0 f8 cc cc cc 78 00 00 00 00 00 00 + 00 fe c6 c6 06 0c 18 30 30 30 00 00 00 00 00 00 + 00 78 cc cc cc 78 cc cc cc 78 00 00 00 00 00 00 + 00 78 cc cc cc 7c 18 18 30 70 00 00 00 00 00 00 + 00 00 00 38 38 00 00 38 38 00 00 00 00 00 00 00 + 00 00 00 38 38 00 00 38 38 18 30 00 00 00 00 00 + 00 0c 18 30 60 c0 60 30 18 0c 00 00 00 00 00 00 + 00 00 00 00 7e 00 7e 00 00 00 00 00 00 00 00 00 + 00 60 30 18 0c 06 0c 18 30 60 00 00 00 00 00 00 + 00 78 cc 0c 18 30 30 00 30 30 00 00 00 00 00 00 + 00 7c c6 c6 de de de c0 c0 7c 00 00 00 00 00 00 + 00 30 78 cc cc cc fc cc cc cc 00 00 00 00 00 00 + 00 fc 66 66 66 7c 66 66 66 fc 00 00 00 00 00 00 + 00 3c 66 c6 c0 c0 c0 c6 66 3c 00 00 00 00 00 00 + 00 f8 6c 66 66 66 66 66 6c f8 00 00 00 00 00 00 + 00 fe 62 60 64 7c 64 60 62 fe 00 00 00 00 00 00 + 00 fe 66 62 64 7c 64 60 60 f0 00 00 00 00 00 00 + 00 3c 66 c6 c0 c0 ce c6 66 3e 00 00 00 00 00 00 + 00 cc cc cc cc fc cc cc cc cc 00 00 00 00 00 00 + 00 78 30 30 30 30 30 30 30 78 00 00 00 00 00 00 + 00 1e 0c 0c 0c 0c cc cc cc 78 00 00 00 00 00 00 + 00 e6 66 6c 6c 78 6c 6c 66 e6 00 00 00 00 00 00 + 00 f0 60 60 60 60 62 66 66 fe 00 00 00 00 00 00 + 00 c6 ee fe fe d6 c6 c6 c6 c6 00 00 00 00 00 00 + 00 c6 c6 e6 f6 fe de ce c6 c6 00 00 00 00 00 00 + 00 38 6c c6 c6 c6 c6 c6 6c 38 00 00 00 00 00 00 + 00 fc 66 66 66 7c 60 60 60 f0 00 00 00 00 00 00 + 00 38 6c c6 c6 c6 ce de 7c 0c 1e 00 00 00 00 00 + 00 fc 66 66 66 7c 6c 66 66 e6 00 00 00 00 00 00 + 00 78 cc cc c0 70 18 cc cc 78 00 00 00 00 00 00 + 00 fc b4 30 30 30 30 30 30 78 00 00 00 00 00 00 + 00 cc cc cc cc cc cc cc cc 78 00 00 00 00 00 00 + 00 cc cc cc cc cc cc cc 78 30 00 00 00 00 00 00 + 00 c6 c6 c6 c6 d6 d6 6c 6c 6c 00 00 00 00 00 00 + 00 cc cc cc 78 30 78 cc cc cc 00 00 00 00 00 00 + 00 cc cc cc cc 78 30 30 30 78 00 00 00 00 00 00 + 00 fe ce 98 18 30 60 62 c6 fe 00 00 00 00 00 00 + 00 3c 30 30 30 30 30 30 30 3c 00 00 00 00 00 00 + 00 00 80 c0 60 30 18 0c 06 02 00 00 00 00 00 00 + 00 3c 0c 0c 0c 0c 0c 0c 0c 3c 00 00 00 00 00 00 + 10 38 6c c6 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 ff 00 00 00 00 00 + 30 30 18 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + 00 e0 60 60 7c 66 66 66 66 dc 00 00 00 00 00 00 + 00 00 00 00 78 cc c0 c0 cc 78 00 00 00 00 00 00 + 00 1c 0c 0c 7c cc cc cc cc 76 00 00 00 00 00 00 + 00 00 00 00 78 cc fc c0 cc 78 00 00 00 00 00 00 + 00 38 6c 60 60 f8 60 60 60 f0 00 00 00 00 00 00 + 00 00 00 00 76 cc cc cc 7c 0c cc 78 00 00 00 00 + 00 e0 60 60 6c 76 66 66 66 e6 00 00 00 00 00 00 + 00 18 18 00 78 18 18 18 18 7e 00 00 00 00 00 00 + 00 0c 0c 00 3c 0c 0c 0c 0c cc cc 78 00 00 00 00 + 00 e0 60 60 66 6c 78 6c 66 e6 00 00 00 00 00 00 + 00 78 18 18 18 18 18 18 18 7e 00 00 00 00 00 00 + 00 00 00 00 fc d6 d6 d6 d6 c6 00 00 00 00 00 00 + 00 00 00 00 f8 cc cc cc cc cc 00 00 00 00 00 00 + 00 00 00 00 78 cc cc cc cc 78 00 00 00 00 00 00 + 00 00 00 00 dc 66 66 66 66 7c 60 f0 00 00 00 00 + 00 00 00 00 76 cc cc cc cc 7c 0c 1e 00 00 00 00 + 00 00 00 00 ec 6e 76 60 60 f0 00 00 00 00 00 00 + 00 00 00 00 78 cc 60 18 cc 78 00 00 00 00 00 00 + 00 00 20 60 fc 60 60 60 6c 38 00 00 00 00 00 00 + 00 00 00 00 cc cc cc cc cc 76 00 00 00 00 00 00 + 00 00 00 00 cc cc cc cc 78 30 00 00 00 00 00 00 + 00 00 00 00 c6 c6 d6 d6 6c 6c 00 00 00 00 00 00 + 00 00 00 00 c6 6c 38 38 6c c6 00 00 00 00 00 00 + 00 00 00 00 66 66 66 66 3c 0c 18 f0 00 00 00 00 + 00 00 00 00 fc 8c 18 60 c4 fc 00 00 00 00 00 00 + 00 1c 30 30 60 c0 60 30 30 1c 00 00 00 00 00 00 + 00 18 18 18 18 00 18 18 18 18 00 00 00 00 00 00 + 00 e0 30 30 18 0c 18 30 30 e0 00 00 00 00 00 00 + 00 73 da ce 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 10 38 6c c6 c6 fe 00 00 00 00 00 00 00 + 00 78 cc cc c0 c0 c0 cc cc 78 30 60 00 00 00 00 + 00 cc cc 00 cc cc cc cc cc 76 00 00 00 00 00 00 + 0c 18 30 00 78 cc fc c0 cc 78 00 00 00 00 00 00 + 30 78 cc 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + 00 cc cc 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + c0 60 30 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + 38 6c 6c 38 f8 0c 7c cc cc 76 00 00 00 00 00 00 + 00 00 00 00 78 cc c0 c0 cc 78 30 60 00 00 00 00 + 30 78 cc 00 78 cc fc c0 c0 7c 00 00 00 00 00 00 + 00 cc cc 00 78 cc fc c0 c0 7c 00 00 00 00 00 00 + c0 60 30 00 78 cc fc c0 c0 7c 00 00 00 00 00 00 + 00 6c 6c 00 78 18 18 18 18 7e 00 00 00 00 00 00 + 10 38 6c 00 78 18 18 18 18 7e 00 00 00 00 00 00 + 60 30 18 00 78 18 18 18 18 7e 00 00 00 00 00 00 + 00 cc 00 30 78 cc cc fc cc cc 00 00 00 00 00 00 + 78 cc cc 78 78 cc cc fc cc cc 00 00 00 00 00 00 + 0c 18 00 fc c4 c0 f8 c0 c4 fc 00 00 00 00 00 00 + 00 00 00 00 fe 1b 7f d8 d8 ef 00 00 00 00 00 00 + 00 3e 78 d8 d8 fe d8 d8 d8 de 00 00 00 00 00 00 + 30 78 cc 00 78 cc cc cc cc 78 00 00 00 00 00 00 + 00 cc cc 00 78 cc cc cc cc 78 00 00 00 00 00 00 + c0 60 30 00 78 cc cc cc cc 78 00 00 00 00 00 00 + 30 78 cc 00 cc cc cc cc cc 76 00 00 00 00 00 00 + c0 60 30 00 cc cc cc cc cc 76 00 00 00 00 00 00 + 00 66 66 00 66 66 66 66 3c 0c 18 f0 00 00 00 00 + 00 cc 00 78 cc cc cc cc cc 78 00 00 00 00 00 00 + cc 00 cc cc cc cc cc cc cc 78 00 00 00 00 00 00 + 00 00 00 00 78 cc dc ec cc 78 00 00 00 00 00 00 + 3c 66 60 60 60 fc 60 60 c0 fe 00 00 00 00 00 00 + 00 3a 6c ce d6 d6 d6 e6 6c b8 00 00 00 00 00 00 + 00 00 00 00 00 c6 6c 38 6c c6 00 00 00 00 00 00 + 0e 1b 18 18 7e 18 18 18 d8 70 00 00 00 00 00 00 + 0c 18 30 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + 0c 18 30 00 78 18 18 18 18 7e 00 00 00 00 00 00 + 0c 18 30 00 78 cc cc cc cc 78 00 00 00 00 00 00 + 0c 18 30 00 cc cc cc cc cc 76 00 00 00 00 00 00 + 00 76 dc 00 f8 cc cc cc cc cc 00 00 00 00 00 00 + 76 dc 00 c6 e6 f6 de ce c6 c6 00 00 00 00 00 00 + 00 78 cc cc 7e 00 fe 00 00 00 00 00 00 00 00 00 + 00 78 cc cc 78 00 fe 00 00 00 00 00 00 00 00 00 + 00 30 30 00 30 60 c0 c0 cc 78 00 00 00 00 00 00 + 00 38 44 ba aa ba b2 aa 44 38 00 00 00 00 00 00 + 00 00 00 00 00 fc 0c 0c 0c 00 00 00 00 00 00 00 + 00 62 e6 6c 78 30 6e c3 86 0c 1f 00 00 00 00 00 + 00 63 e6 6c 78 37 6f db b3 3f 03 00 00 00 00 00 + 00 30 30 00 30 30 78 78 78 30 00 00 00 00 00 00 + 00 00 00 00 33 66 cc cc 66 33 00 00 00 00 00 00 + 00 00 00 00 cc 66 33 33 66 cc 00 00 00 00 00 00 + 24 92 49 24 92 49 24 92 49 24 92 49 00 00 00 00 + 55 aa 55 aa 55 aa 55 aa 55 aa 55 aa 00 00 00 00 + 6d db b6 6d db b6 6d db b6 6d db b6 00 00 00 00 + 18 18 18 18 18 18 18 18 18 18 18 18 00 00 00 00 + 18 18 18 18 18 f8 18 18 18 18 18 18 00 00 00 00 + 0c 18 00 30 78 cc cc fc cc cc 00 00 00 00 00 00 + 78 cc 00 30 78 cc cc fc cc cc 00 00 00 00 00 00 + 60 30 00 30 78 cc cc fc cc cc 00 00 00 00 00 00 + 00 38 44 ba a2 a2 a2 ba 44 38 00 00 00 00 00 00 + 66 66 66 66 e6 06 06 e6 66 66 66 66 00 00 00 00 + 66 66 66 66 66 66 66 66 66 66 66 66 00 00 00 00 + 00 00 00 00 fe 06 06 e6 66 66 66 66 00 00 00 00 + 66 66 66 66 e6 06 06 fe 00 00 00 00 00 00 00 00 + 00 30 30 78 cc c0 c0 cc 78 30 30 00 00 00 00 00 + cc cc cc cc 78 fc 30 fc 30 30 00 00 00 00 00 00 + 00 00 00 00 00 f8 18 18 18 18 18 18 00 00 00 00 + 18 18 18 18 18 1f 00 00 00 00 00 00 00 00 00 00 + 18 18 18 18 18 ff 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 ff 18 18 18 18 18 18 00 00 00 00 + 18 18 18 18 18 1f 18 18 18 18 18 18 00 00 00 00 + 00 00 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 + 18 18 18 18 18 ff 18 18 18 18 18 18 00 00 00 00 + 00 76 dc 00 78 0c 7c cc cc 76 00 00 00 00 00 00 + 76 dc 00 30 78 cc cc fc cc cc 00 00 00 00 00 00 + 66 66 66 66 67 60 60 7f 00 00 00 00 00 00 00 00 + 00 00 00 00 7f 60 60 67 66 66 66 66 00 00 00 00 + 66 66 66 66 e7 00 00 ff 00 00 00 00 00 00 00 00 + 00 00 00 00 ff 00 00 e7 66 66 66 66 00 00 00 00 + 66 66 66 66 67 60 60 67 66 66 66 66 00 00 00 00 + 00 00 00 00 ff 00 00 ff 00 00 00 00 00 00 00 00 + 66 66 66 66 e7 00 00 e7 66 66 66 66 00 00 00 00 + 00 00 00 00 00 c6 7c 6c 7c c6 00 00 00 00 00 00 + cc 30 d8 0c 06 7e c6 c6 c6 7c 00 00 00 00 00 00 + 00 f8 6c 66 66 f6 66 66 6c f8 00 00 00 00 00 00 + 78 cc 00 fc c4 c0 f8 c0 c4 fc 00 00 00 00 00 00 + 00 cc 00 fc c4 c0 f8 c0 c4 fc 00 00 00 00 00 00 + 60 30 00 fc c4 c0 f8 c0 c4 fc 00 00 00 00 00 00 + 00 f0 30 30 30 fc 00 00 00 00 00 00 00 00 00 00 + 18 30 00 78 30 30 30 30 30 78 00 00 00 00 00 00 + 78 cc 00 78 30 30 30 30 30 78 00 00 00 00 00 00 + 00 cc 00 78 30 30 30 30 30 78 00 00 00 00 00 00 + 18 18 18 18 18 f8 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 1f 18 18 18 18 18 18 00 00 00 00 + ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 + 00 00 00 00 00 00 ff ff ff ff ff ff 00 00 00 00 + 00 18 18 18 18 00 18 18 18 18 00 00 00 00 00 00 + 60 30 00 78 30 30 30 30 30 78 00 00 00 00 00 00 + ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 + 18 30 00 78 cc cc cc cc cc 78 00 00 00 00 00 00 + 00 78 cc cc d8 cc cc cc f8 c0 60 00 00 00 00 00 + 78 cc 00 78 cc cc cc cc cc 78 00 00 00 00 00 00 + 60 30 00 78 cc cc cc cc cc 78 00 00 00 00 00 00 + 00 76 dc 00 78 cc cc cc cc 78 00 00 00 00 00 00 + 76 dc 00 78 cc cc cc cc cc 78 00 00 00 00 00 00 + 00 00 00 00 66 66 66 66 66 7b 60 c0 00 00 00 00 + 00 00 e0 60 7c 66 66 7c 60 f0 00 00 00 00 00 00 + 00 f0 60 7c 66 66 66 7c 60 f0 00 00 00 00 00 00 + 18 30 00 cc cc cc cc cc cc 78 00 00 00 00 00 00 + 78 cc 00 cc cc cc cc cc cc 78 00 00 00 00 00 00 + 60 30 00 cc cc cc cc cc cc 78 00 00 00 00 00 00 + 06 0c 18 00 66 66 66 66 3c 0c 18 f0 00 00 00 00 + 18 30 00 cc cc cc 78 30 30 78 00 00 00 00 00 00 + 00 fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0c 18 30 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 fc 00 00 00 00 00 00 00 00 00 00 + 00 00 30 30 fc 30 30 00 fc 00 00 00 00 00 00 00 + 00 00 00 00 00 f8 00 00 f8 00 00 00 00 00 00 00 + e0 33 66 3c f8 37 6f db b3 3f 03 00 00 00 00 00 + 00 7f db db db 7b 1b 1b 1b 1b 00 00 00 00 00 00 + 00 7e 63 30 3c 66 66 3c 0c c6 7e 00 00 00 00 00 + 00 00 30 30 00 fc 00 30 30 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 30 70 00 00 00 00 + 00 3c 66 66 66 3c 00 00 00 00 00 00 00 00 00 00 + 00 cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 + 00 30 70 30 30 78 00 00 00 00 00 00 00 00 00 00 + 00 78 0c 38 0c 78 00 00 00 00 00 00 00 00 00 00 + 00 78 0c 18 30 7c 00 00 00 00 00 00 00 00 00 00 + 00 00 00 fc fc fc fc fc fc 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/test/term.tal b/test/term.tal index 2e4d2f7..dd1d07b 100644 --- a/test/term.tal +++ b/test/term.tal @@ -76,15 +76,32 @@ ( ESC [ ? 1060 l -> unset legacy keyboard emulation ) ( ESC [ ? 1061 h -> set VT220 keyboard emulation ) -( special graphics [] changes 95-126 ) +|00 @System [ + &vect $2 &expansion $2 &title $2 &metadata $2 + &r $2 &g $2 &b $2 ] -|00 @System [ &vect $2 &expansion $2 &title $2 &metadata $2 &r $2 &g $2 &b $2 ] -|10 @Console [ &vect $2 &stdin $1 &exec $2 &mode $1 &dead $1 &exit $1 &stdout $1 &stderr $1 &child $1 ] -|20 @Screen [ &vect $2 &w $2 &h $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &px $1 &sprite $1 ] -|80 @Controller [ &vect $2 &button $1 &key $1 &fn $1 ] -|90 @Mouse [ &vect $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2 ] -|a0 @File1 [ &vect $2 &ok $2 &stat $2 &del $1 &append $1 &name $2 &len $2 &r $2 &w $2 ] -|b0 @File2 [ &vect $2 &ok $2 &stat $2 &del $1 &append $1 &name $2 &len $2 &r $2 &w $2 ] +|10 @Console [ + &vect $2 &stdin $1 &pad1 $4 &type $1 + &stdout $1 &stderr $1 &proc-put $1 &pad2 $1 ¶m $2 &opts $1 &host-put $1 ] + +|20 @Screen [ + &vect $2 &w $2 &h $2 &auto $1 &pad $1 + &x $2 &y $2 &addr $2 &px $1 &sprite $1 ] + +|80 @Controller [ + &vect $2 &button $1 &key $1 &fn $1 ] + +|90 @Mouse [ + &vect $2 &x $2 &y $2 &state $1 &pad1 $1 + &pad2 $2 &scrollx $2 &scrolly $2 &pad3 $2 ] + +|a0 @File1 [ + &vect $2 &ok $2 &stat $2 &del $1 &append $1 + &name $2 &len $2 &r $2 &w $2 ] + +|b0 @File2 [ + &vect $2 &ok $2 &stat $2 &del $1 &append $1 + &name $2 &len $2 &r $2 &w $2 ] |0000 @tint $1 ( draw mode. 01=regular, 04=inverted ) @@ -120,15 +137,11 @@ @tcem $1 ( 01: cursor is visible, 00: cursor is invisible ) @paste $1 ( 01: bracketed paste is on, 00: is off ) - ( margins ) - @margin-top $2 - @margin-bot $2 - ( user configuration ) @debug $1 ( use debug log? ) @show-banner $1 ( show banner on startup? ) - @visual-bell $1 ( use visual belL? 01: visual bell, 00: do nothing ) - @border-pad $2 ( use border? must be either 0000 or 0010 ) + @visual-bell $1 ( flash visual bell? otherwise do nothing ) + @border-pad $2 ( use border? should be 0000 or 0010 ) |0100 ( metadata ) @@ -138,13 +151,13 @@ ( user configuration defaults ) #00 .debug STZ #01 .show-banner STZ +( #0010 .border-pad STZ2 ) #0000 .border-pad STZ2 #01 .visual-bell STZ ( 80 cols x 24 rows by default ) + #0018 .rows STZ2 #0050 .cols STZ2 - #0018 DUP .rows STZ2 .margin-bot STZ2 - #0000 .margin-top STZ2 ( start cursor at origin - including border ) .border-pad LDZ2 .Screen/x DEO2 @@ -172,12 +185,14 @@ ( these only work with a patched uxnemu ) ( on other emulators they should be no-ops ) @setup-subprocess ( -> ) - ;shell .Console/exec DEO2 ( set up bash subprocess ) - #80 .Console/mode DEO ( start bash subprocess ) + #80 .Console/opts DEO + ;shell .Console/param DEO2 + #01 .Console/host-put DEO JMP2r @setup-debugging ( -> ) .debug LDZ ?&continue JMP2r &continue +( #99 #010e DEO ) ( put 99 in wst so #010e DEO reliably logs ) ;debug-log .File1/name DEO2 #01 .File1/append DEO JMP2r @@ -189,7 +204,8 @@ @reset-terminal ( -> ) ( set initial cursor ) - #0000 DUP2 .cur-x STZ2 .cur-y STZ2 + #0000 .cur-x STZ2 + #0000 .cur-y STZ2 ( confirm no buttons pressed yet ) #00 .lastkey STZ @@ -198,7 +214,8 @@ update-dimensions ( set starting tint: reverse=0, bg=0, fg=2 ) - #02 .attr STZ update-tint + #02 .attr STZ + update-tint ( set initial modes ) #00 .irm STZ ( insert and move right ) @@ -206,8 +223,11 @@ #01 .tcem STZ ( show cursor ) #00 .paste STZ ( bracketed paste is off ) - init-screen ( ; prepare for initial draw ) - draw-border ( ; draw border ) + ( prepare for initial draw ) + init-screen + + ( draw border ) + .border-pad LDZ2 ORA ?draw-border JMP2r @update-dimensions ( -> ) @@ -224,7 +244,7 @@ .rows LDZ2 #000c MUL2 ADD2 .Screen/h DEO2 JMP2r -@shell "bash 00 "-i 00 00 +@shell "bash 20 "-i 00 @load-theme ( -> ) ;&path .File1/name DEO2 @@ -283,15 +303,13 @@ ( uses the existing .Screen/x and .Screen/y ) ( returns them to their starting values when finished ) @erase-fg-cell ( -> ) - ;cp437/nul .Screen/addr DEO2 ( ; use nul character to erase ) - #43 .Screen/sprite DEO ( ; s/s<-40 ) + #40 .Screen/sprite DEO ( ; s/s<-40 ) .Screen/y DEI2k STH2k ( zp^ y* [y*] ) #0004 ADD2 ROT DEO2 ( [y*] ; s/y<-y+4 ) - #43 .Screen/sprite DEO STH2r ( y* ; s/s<-40 ) + #40 .Screen/sprite DEO STH2r ( y* ; s/s<-40 ) .Screen/y DEO2 JMP2r ( ; s/y<-y ) @draw-border ( -> ) - .border-pad LDZ2 ORA ?{ JMP2r } ;cp437/space .Screen/addr DEO2 #04 .Screen/sprite #0000 draw-border/row @@ -383,20 +401,21 @@ ( send ESC [ $c ) @arrow ( c^ -> ) - .Console/w STH - ( TODO: send ESC-$c in VT-52 mode ) - ( TODO: send ESC-O-$c in "cursor key mode set" ) +( .Console/w STH ) + .Console/proc-put STH #1b STHkr DEO LIT "[ STHkr DEO STHr DEO JMP2r @paste-from-buf ( size* -> ) ;paste-buf SWP2 OVR2 ADD2 SWP2 ( limit* start* ) &loop ( limit* pos* ) - LDAk .Console/w DEO INC2 ( limit* pos+1* ) +( LDAk .Console/w DEO INC2 ( limit* pos+1* ) ) + LDAk .Console/proc-put DEO INC2 ( limit* pos+1* ) GTH2k ?&loop POP2 POP2 JMP2r @bracket-paste ( c^ -> ) - .Console/w STH +( .Console/w STH ) + .Console/proc-put STH #1b STHkr DEO LIT "[ STHkr DEO LIT "2 STHkr DEO @@ -611,16 +630,19 @@ .Controller/key DEI DUP #08 NEQ ?&done POP #7f ( send DEL instead of BS ) - &done .Console/w DEO BRK +( &done .Console/w DEO BRK ) + &done .Console/proc-put DEO BRK @ctrl ( -> is-down? ) .Controller/button DEI #01 AND JMP2r @alt ( -> is-down? ) .Controller/button DEI #02 AND JMP2r ( alt-XYZ emits ESC and then emits XYZ ) @on-alt-key ( -> BRK ) - #1b .Console/w DEO +( #1b .Console/w DEO ) + #1b .Console/proc-put DEO ctrl ?on-ctrl-key - .Controller/key DEI .Console/w DEO BRK +( .Controller/key DEI .Console/w DEO BRK ) + .Controller/key DEI .Console/proc-put DEO BRK ( control seqs: ) ( ctrl-sp -> 00 ) @@ -655,10 +677,11 @@ &rs #1e !&done &us #1f !&done &c1 LIT "@ SUB - &done .Console/w DEO BRK +( &done .Console/w DEO BRK ) + &done .Console/proc-put DEO BRK @on-read-priv ( -> BRK ) - .Console/r DEI + .Console/stdin DEI DUP LIT "; EQU ?next-arg DUP LIT "0 LTH ?end-arg-priv DUP LIT "9 GTH ?end-arg-priv @@ -668,7 +691,7 @@ POP ;on-read-priv .Console/vect DEO2 BRK @on-read-csi ( -> BRK ) - .Console/r DEI + .Console/stdin DEI DUP LIT "? EQU ?start-priv DUP LIT "; EQU ?next-arg DUP LIT "0 LTH ?end-arg @@ -676,7 +699,7 @@ !add-to-arg @on-read-osc ( -> BRK ) - .Console/r DEI + .Console/stdin DEI DUP #07 ( bell ) EQU ?&end-osc #9c ( esc-\ ) EQU ?&end-osc BRK &end-osc ;on-read .Console/vect DEO2 BRK @@ -756,51 +779,41 @@ @end-arg ( c^ -> BRK ) ;on-read .Console/vect DEO2 DUP debug-csi - DUP LIT "@ EQU ?exec-ich ( ICH: insert blank characters ) - ( TODO ($n-sp-@) SL: shift left $n cols ) - DUP LIT "A EQU ?exec-cuu ( CUU: up ) - ( TODO ($n-sp-A) SR: shift right $n cols ) - DUP LIT "B EQU ?exec-cud ( CUD: down ) - DUP LIT "C EQU ?exec-cuf ( CUF: forward ) - DUP LIT "D EQU ?exec-cub ( CUB: back ) - DUP LIT "E EQU ?exec-cnl ( CNL: next line $n times ) - DUP LIT "F EQU ?exec-cpl ( CPL: prev line $n times ) - DUP LIT "G EQU ?exec-cha ( CHA: move cursor to abs col ) - DUP LIT "H EQU ?exec-cup ( CUP: move cursor [row;col] ) - DUP LIT "I EQU ?exec-cht ( CHT: forward by tab stops ) - DUP LIT "J EQU ?exec-ed ( ED: erase display ) - DUP LIT "K EQU ?exec-el ( EL: erase line ) - DUP LIT "L EQU ?exec-il ( IL: insert $n blank lines ) - DUP LIT "M EQU ?exec-dl ( DL: delete $n lines ) - DUP LIT "P EQU ?exec-dch ( DCH: delete n chars ) - DUP LIT "S EQU ?exec-su ( SU: scroll up ) - DUP LIT "T EQU ?exec-sd ( SD: scroll down ) - DUP LIT "X EQU ?exec-ech ( ECH: erase $n characters ) - DUP LIT "Z EQU ?exec-cbt ( CBT: backward by tab stops ) - DUP LIT "` EQU ?exec-hpa ( HPA: char pos abs col=$n ) - DUP LIT "a EQU ?exec-hpr ( HPR: char pos rel col=$n ) - ( TODO: b - REP: repeat previous graphic char $n times ) - ( TODO: c - DA: send device attributes ) - DUP LIT "d EQU ?exec-vpa ( VPA: move cursor to row ) - DUP LIT "e EQU ?exec-vpr ( VPR: line pos rel row+=$n ) - ( TODO: $r;$c f - HVP: horizontal/vertical position ) - DUP LIT "g EQU ?exec-tbc ( TBC: clear tab stops ) - DUP LIT "h EQU ?exec-sm ( SM: set mode ) - ( TODO: ?-$n-h - DECSET: set dec options ) - DUP LIT "l EQU ?exec-rm ( RM: reset mode ) - ( TODO: ?-$n-l - DECRST: reset dec options ) - DUP LIT "m EQU ?exec-sgr ( SGR: set graphical rendering ) - DUP LIT "n EQU ?exec-dsr ( DSR: device status reports ) - ( TODO: ?-$n-n - dec device status ) - ( TODO: $n-q - DECLL: load leds ) - DUP LIT "r EQU ?exec-set-scrolling-region ( [$top;$bot] DECSTM: set scrolling reg ) - DUP LIT "s EQU ?exec-scosc ( SCOSC: saved current cursor position ) - DUP LIT "u EQU ?exec-scorc ( SCORC: restore saved cursor position ) + DUP LIT "@ EQU ?exec-ich ( insert blank characters ) + DUP LIT "A EQU ?exec-cuu ( up ) + DUP LIT "B EQU ?exec-cud ( down ) + DUP LIT "C EQU ?exec-cuf ( forward ) + DUP LIT "D EQU ?exec-cub ( back ) + DUP LIT "E EQU ?exec-cnl ( next line $n times ) + DUP LIT "F EQU ?exec-cpl ( prev line $n times ) + DUP LIT "G EQU ?exec-cha ( move cursor to col ) + DUP LIT "H EQU ?exec-cup ( move cursor ) + DUP LIT "I EQU ?exec-cht ( forward by tab stops ) + DUP LIT "J EQU ?exec-ed ( erase screen ) + DUP LIT "K EQU ?exec-el ( erase line ) + DUP LIT "L EQU ?exec-il ( insert blank lines ) + DUP LIT "M EQU ?exec-dl ( delete n lines ) + DUP LIT "P EQU ?exec-dch ( delete n chars ) + DUP LIT "S EQU ?exec-su ( scroll up ) + DUP LIT "T EQU ?exec-sd ( scroll down ) + DUP LIT "X EQU ?exec-ech ( erase $n characters ) + DUP LIT "Z EQU ?exec-cbt ( backward by tab stops ) + DUP LIT "` EQU ?exec-hpa ( char pos abs col=$n ) + DUP LIT "a EQU ?exec-hpr ( char pos rel col=$n ) + DUP LIT "d EQU ?exec-vpa ( move cursor to row ) + DUP LIT "e EQU ?exec-vpr ( line pos rel row+=$n ) + DUP LIT "g EQU ?exec-tbc ( clear tab stops ) + DUP LIT "h EQU ?exec-sm ( set mode ) + DUP LIT "l EQU ?exec-rm ( reset mode ) + DUP LIT "m EQU ?exec-sgr ( set graphical rendering ) + DUP LIT "n EQU ?exec-dsr ( device status reports ) + DUP LIT "r EQU ?exec-set-scrolling-region + DUP LIT "s EQU ?exec-scosc ( saved current cursor position ) + DUP LIT "u EQU ?exec-scorc ( restore saved cursor position ) ( = 0 C - normal cursor ) ( = 1 C - bold cursor ) debug-csi BRK -( TODO ) @exec-set-scrolling-region ( c^ -> BRK ) POP BRK @exec-tbc ( c^ -> BRK ) POP BRK @@ -814,10 +827,9 @@ draw-cursor BRK @mode-addr ( n* -> zp^ ) - DUP2 #0004 NEQ2 ?{ POP2 .irm JMP2r } ( TODO: permanently reset ) - DUP2 #0007 NEQ2 ?{ POP2 .awm JMP2r } ( TODO: rename to DECAWM ) - ( TODO: 20 is LNM: line feed/newline mode ) - POP2 .ignored JMP2r + DUP2 #0004 NEQ2 ?¬-irm POP2 .irm JMP2r + ¬-irm DUP2 #0007 NEQ2 ?¬-awm POP2 .awm JMP2r + ¬-awm POP2 .ignored JMP2r @sm ( n* -> ) mode-addr #01 SWP STZ JMP2r @rm ( n* -> ) mode-addr #00 SWP STZ JMP2r @@ -888,12 +900,16 @@ @dsr ( n* -> ) #0006 NEQ2 ?&done - #1b .Console/w DEO - LIT "[ .Console/w DEO +( #1b .Console/w DEO ) + #1b .Console/proc-put DEO +( LIT "[ .Console/w DEO ) + LIT "[ .Console/proc-put DEO .cur-y LDZ2 INC2 emit-dec2 - LIT "; .Console/w DEO +( LIT "; .Console/w DEO ) + LIT "; .Console/proc-put DEO .cur-x LDZ2 INC2 emit-dec2 - LIT "R .Console/w DEO +( LIT "R .Console/w DEO ) + LIT "R .Console/proc-put DEO &done BRK @cnl ( n* -> ) clear-cursor #0000 .cur-x STZ2 !down-n @@ -963,27 +979,20 @@ JMP2r @on-read-esc ( -> BRK ) - .Console/r DEI + .Console/stdin DEI DUP debug-esc - &after - ( TODO: SP-F, SP-G, SP-L, SP-M, SP-N ) - ( TODO: #-3, #-4, #-5, #-6, #-8 ) - ( TODO: %-@, %-G ) - DUP LIT "D EQU ?exec-ind ( IND: index ) - DUP LIT "E EQU ?exec-nel ( NEL: next line ) - DUP LIT "H EQU ?exec-hts ( HTS: tab set ) - DUP LIT "M EQU ?exec-ri ( RI: reverse index ) - DUP LIT "P EQU ?exec-dcs ( DCS: device control string ) - DUP LIT "[ EQU ?start-csi ( CSI: control sequence introducer ) - DUP LIT "] EQU ?start-osc ( OSC: operating system command ) - DUP LIT "c EQU ?exec-ris ( RIS: full reset ) + DUP LIT "D EQU ?exec-ind + DUP LIT "E EQU ?exec-nel + DUP LIT "H EQU ?exec-hts + DUP LIT "M EQU ?exec-ri + DUP LIT "P EQU ?exec-dcs + DUP LIT "[ EQU ?start-csi + DUP LIT "] EQU ?start-osc + DUP LIT "c EQU ?exec-ris DUP LIT "( EQU ?start-charset DUP LIT ") EQU ?start-charset - DUP LIT "7 EQU ?&skip ( DECSC: save cursor ) - DUP LIT "8 EQU ?&skip ( DECRC: restore cursor ) - DUP LIT "> EQU ?&skip ( DECKPNM: normal keypad ) - DUP LIT "~ EQU ?&skip ( LS1R: invoke G1 charset as GR ) - DUP LIT "# EQU ?&skip ( TODO: DECALN, fill screen with Es ) + DUP LIT "7 EQU ?&skip ( save cursor ) + DUP LIT "8 EQU ?&skip ( restore cursor ) debug-esc ;on-read .Console/vect DEO2 !on-read @@ -1003,10 +1012,10 @@ ;on-read .Console/vect DEO2 BRK -( preceeded by '(' [G0] or ')' [G1] ) -( "A" -> UK ) -( "B" -> USASCII ) -( "0" -> DEC special graphics, line drawing ) +( '(' = designate G0 charset ) +( ')' = designate G1 charset ) +( '*' = designate G2 charset ) +( '+' = designate G3 charset ) @start-charset ( c^ -> BRK ) POP ;on-read-skip .Console/vect DEO2 BRK @@ -1016,12 +1025,8 @@ @start-osc ( c^ -> BRK ) POP reset-args ;on-read-osc .Console/vect DEO2 BRK -( TODO: 8-bit input not ready for prime time yet ) @on-read ( -> BRK ) - .Console/r DEI ( DUP #7f GTH ?read-8bit ) read BRK - -@read-8bit ( c^ -> BRK ) - DUP debug-esc #80 SUB !on-read-esc/after + .Console/stdin DEI read BRK @read ( c^ -> ) DUP debug-read @@ -1037,25 +1042,21 @@ clear-cursor !forward @read-ctrl ( c^ -> ) - DUP #05 EQU ?&skip ( ENQ - return terminal status ) DUP #07 EQU ?read-bel DUP #08 EQU ?read-bs - DUP #09 EQU ?read-tab ( HT ) - DUP #0a EQU ?read-lf ( NL - LF ) - DUP #0b EQU ?read-lf ( VT - treated as LF ) - DUP #0c EQU ?read-lf ( FF - treated as LF ) - DUP #0d EQU ?read-cr ( CR ) -( DUP #0e EQU ?&skip ( TODO: SO - shift out; G0 charset ) ) -( DUP #0f EQU ?&skip ( TODO: SI - shift in; G1 charset ) ) + DUP #09 EQU ?read-tab + DUP #0a EQU ?read-lf + DUP #0b EQU ?read-lf + DUP #0c EQU ?read-lf + DUP #0d EQU ?read-cr DUP #1b EQU ?read-esc - &skip POP JMP2r + POP JMP2r @read-bel ( 07 -> ) POP .visual-bell LDZ #00 EQU ?&done #06 .flash STZ #01 .dirty STZ &done JMP2r -( TODO: handle reverse wrap-around and dec auto-wrap ) @read-bs ( 08 -> ) POP clear-cursor #0001 !back-n @@ -1065,7 +1066,6 @@ @read-del ( 7f -> ) POP JMP2r -( TODO: respect tab stops ) @read-tab ( 09 -> ) POP .cur-x LDZ2 ( x* ) @@ -1091,8 +1091,6 @@ @read-lf ( 0a -> ) POP !lf -( TODO: cur-wrap machinery not vt100 compliant. ) -( cursor should stay on previous line normally ) @lf ( -> ) .cur-wrap LDZ ?&skip clear-cursor down-or-scroll &skip JMP2r @@ -1324,7 +1322,7 @@ &name "determ 0a &details "ansi 20 "terminal 20 "emulator 0a &author "by 20 "d_m 0a - &date "13 20 "nov 20 "2023 00 + &date "3 20 "jan 20 2023 00 02 ( device mask ) 41 0d07 ( 24x24 icon ) 83 =icon-2-bit @@ -1333,9 +1331,9 @@ 0d 0a 20 20 c9 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd bb 0d 0a 20 20 ba 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ba 0d 0a - 20 20 ba 20 20 "d "e "t "e "r "m 20 20 "v "1 "1 20 20 ba 0d 0a + 20 20 ba 20 20 "d "e "t "e "r "m 20 20 "v "1 "0 20 20 ba 0d 0a 20 20 ba 20 20 20 20 "b "y 20 "d "_ "m 20 20 20 20 20 ba 0d 0a - 20 20 ba 20 20 "1 "3 20 "n "o "v 20 "2 "0 "2 "3 20 20 ba 0d 0a + 20 20 ba 20 20 "1 "8 20 "m "a "r 20 "2 "0 "2 "3 20 20 ba 0d 0a 20 20 ba 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ba 0d 0a 20 20 c8 cd cd cb cd cd cd cd cd cd cd cd cd cb cd cd bc 0d 0a 20 20 c9 cb cb ce cb cb cb cb cb cb cb cb cb ce cb cb bb 0d 0a @@ -1357,19 +1355,5 @@ @paste-buf $0780 ( max 80 x 24 characters ) @paste-pos $2 -( TODO: tab stops ) - -( state ) -@setup - &alternate-keypad-mode 00 ( 00 numeric [DECKPNM], 01 application [DECKPAM] ) - &ansi-vt52 00 ( DECANM; 00 ansi, 01 vt-52 ) - &chars-per-line 00 ( DECCOLM; 00 80, 01 132 ) - &cursor-key-modes 00 ( DECCKM ) - &new-line 00 ( LNM; 00 return=CR, return=CRLF; ignored by IND/NEL ) - &origin-mode 00 ( DECOM; ) - &screen 00 ( DECSCNM; 00 normal, 01 reverse video ) - &wraparound 00 ( DECAWM; right margin 00 replace, 01 next line/scroll ) - &3-shifted "B ( SCS; character set selected; B is ASCII ) - ( store tint+char for each screen position ) @cells ( width x height x 2 bytes )