This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CoderPuppy's profile picture

Termu - Terminal-based Emulator

Started by CoderPuppy, 20 January 2016 - 05:14 AM
CoderPuppy #1
Posted 20 January 2016 - 06:14 AM

Termu
A ComputerCraft Emulator for the Terminal



This is a simple emulator written in Lua.
It definitely doesn't have perfect emulation (e.g. LuaJ string bug, error checking).
But it's pretty lightweight, supports very old versions of CC and with a couple small tweaks to the ROM can be automated (just in case you want to do that).
It's only been tested on Linux, but it should work on OS X and you might be able to get it to work on Windows (using MinGW or Cygwin or something).

Github: CoderPuppy/cc-emu
License: MIT

Recomended Installation
SpoilerFirst install the dependencies:
Arch Linux:

pacman -S lua unibilium nanomsg
# install termcap from the AUR
Ubuntu (and most other Debian-based distros):

apt-get install lua5.2 libncurses5-dev libunibilium0 libnanomsg0 libnanomsg-dev

Install LuaRocks:
Instructions

Either clone the repository or download and unpack the zip

Either clone alekso56/ComputercraftLua or download and unpack the zip so that you have a directory structure that looks like:

.
├── cc
│   ├── bios.lua
│   ├── README.md
│   ├── rom
│   └── treasure
├── ccpost.bbcode
├── cli.lua
├── emu.lua
├── keyboard-test.lua
├── LICENSE.txt
└── README.md

In a terminal run:

luarocks install penlight
luarocks install luv
luarocks install terminfo
luarocks install luaposix
luarocks install nn
luarocks install utf8

To start the emulator, run in a terminal in the directory the contains cli.lua:

lua cli.lua . # replace with where you want the computer's root directory to be
In the emulator Ctrl-Shift-tilde is mapped to left control (since that can't be captured on it's own).

Configuration
SpoilerPeripherals
SpoilerCreate a tree like this (replacing [id] with the id or side that the peripheral should be on):

.
└── .termu/
   └── peripherals/
      └── [id]/
         └── type

Currently supported types:
SpoilerNanomsg Modem
SpoilerPut "nanomsg-modem" in the type file.

You'll need to run a server (for the addresses look at these: ipc, tcp):

lua nanomsg-server.lua [publish address] [input address]

Create a tree like this:

.
└── .termu/
   └── peripherals/
      └── [id]/
         ├── send_addr
         ├── sub_addr
         └── type

In the sub_addr and send_addr files put addresses to connect to the server (sub_addr to publish address and send_addr to input address).

Also you can run multiple server and have multiple modems connected to the same computer.
And this whole section probably needs to be rewritten (if I suddenly get better at writing or someone else wants to help).

CUPS Printer
SpoilerPut "cups-printer" in the type file.

You'll need a2ps installed and CUPS installed and setup (with a printer)

It should work straight away.

It's possible to customize it with the following files:
  • cmd (default: "a2ps –columns=1 -l $$width$$ -L $$height$$ –center-title=$$title$$ 2>/dev/null | lpr >/dev/null 2>/dev/null")
  • width (default: 25)
  • height (default: 21)

Colors
SpoilerCreate a tree like this:

.
└── .termu/
   └── term-colors/
      └── [fg/bg]/
         └── [color]
in each of the files put the escape sequence you want Termu to output to switch to the color

for example if you want CC's light blue color (in a terminal that supports truecolor):

echo -e '\e[38;2;153;178;242m' > .termu/term-colors/fg/lightBlue
echo -e '\e[48;2;153;178;242m' > .termu/term-colors/bg/lightBlue

Font
SpoilerYou need:
  • Fontforge (fontforge on Arch Linux)
  • Python 3
  • Python Imaging Library (I used Pillow and pil-compat)
  • svgwrite
  • Imagemagick (imagemagick on Arch Linux)

Grab assets/computercraft/textures/gui/termFont.png from a CC jar and put it in fonts

Then in fonts run:

./build.sh

That should generate a termu.otf file in fonts.

To use create a tree like this:

.
└── .termu/
   └── term-munging


Plans / To Do

Spoiler
  • Better filesystem (support for more mounts, etc..)
  • Better compatibility (error checking, etc..)
  • Disks
Edited on 02 August 2016 - 02:35 AM
Admicos #2
Posted 20 January 2016 - 10:20 AM
There is no cli.lua in the zip. Only the lua files from computercraft

EDIT: Didn't see the other repo
EDIT 2: My terminal just flashed black and gone back to shell. No errorrs, nothing.
Edited on 20 January 2016 - 09:34 AM
CoderPuppy #3
Posted 20 January 2016 - 03:54 PM
I just pushed an update that lets you actually see the error message, but you could just append ">/dev/null" to the end of the command, which should let you see the error.
Selim #4
Posted 20 January 2016 - 04:22 PM
Installed as recommended, ran
lua cli.lua ./0/
and got the error:
./cc/bios.lua:232: attempt to index global 'colors' (a nil value)

Edit: Ok, the error code was interfering with the code tags. That was wierd.

[This isn't a proper closing code tag: [/CODE] -L]
Edited on 20 January 2016 - 05:59 PM
CoderPuppy #5
Posted 20 January 2016 - 07:55 PM
snip

I just pushed a new branch: debug (here's a zip), it should provide more information.
Just looking at your error it seems like it's erroring before loading colors.
Selim #6
Posted 20 January 2016 - 08:49 PM
./emu.lua:516: bad argument #1 to 'log' (number expected, got nil)
./cc/bios.lua:232: @
./cc/bios.lua:554: @
./cc/bios.lua:704: @
Edited on 20 January 2016 - 07:49 PM
CoderPuppy #7
Posted 20 January 2016 - 10:31 PM
snip
Oh, my colors polyfill was broken, that's what happens when you don't test code (I tested it this time). I pushed an update that fixes it (which is available at the same link).
Edited on 20 January 2016 - 09:32 PM
Selim #8
Posted 20 January 2016 - 10:38 PM
Cool! It works on my first system now, but when I am trying to install it on my Raspberry Pi it gives me:
lua: ./emu.lua:641: attempt to call field 'initscr' (a nil value)
stack traceback:
./emu.lua:641: in function 'emu'
cli.lua:16: in main chunk
[C]: in ?

On a side note, is it possible to get the HTTP API ported over?
Edited on 20 January 2016 - 09:52 PM
CoderPuppy #9
Posted 20 January 2016 - 10:57 PM
snip
On your first system could you try disabling multishell (using the new set program), there should be an error. Actually I wonder if it's colours loading before colors, which would explain the whole thing. I just pushed another new version that tests that. What OS are you running this on?

And on you RPi you may need to install ncurses (if you're on Rasbian that should be some combination of ncurses, libncurses5, libncurses5-dbg, libncursesw5 and libncursesw5-dev) then you may need to reinstall luaposix.
That's just from looking at the error though, I can't test further (too many packages that depend on ncurses).

EDIT: I'll see about the HTTP API, it might require a rewrite.
Edited on 20 January 2016 - 10:07 PM
Selim #10
Posted 20 January 2016 - 11:15 PM
Disabling multishell does not throw any errors. Running with the update does not throw any errors as well. System #1 is Debian Linux running alongside Chome OS via crouton on my Chromebook. On the Pi after installing the ncurses packages and reinstalling luaposix, it works!
CoderPuppy #11
Posted 20 January 2016 - 11:40 PM
snip
Ok, good! I've merged all the fixes back into master, so you probably switch back to that (if you're using git). Also I've looked into implementing the HTTP API, I don't think it'll be a complete rewrite, I will have to use plain ANSI escapes instead of using curses but I think that'll be the only real change.
Edited on 20 January 2016 - 10:41 PM
Selim #12
Posted 21 January 2016 - 05:03 PM
Updated and got
lua: cc-emu/emu.lua:256: module 'terminfo' not found:
		no field package.preload['terminfo']
		no file '/usr/local/share/lua/5.2/terminfo.lua'
		no file '/usr/local/share/lua/5.2/terminfo/init.lua'
		no file '/usr/local/lib/lua/5.2/terminfo.lua'
		no file '/usr/local/lib/lua/5.2/terminfo/init.lua'
		no file '/usr/share/lua/5.2/terminfo.lua'
		no file '/usr/share/lua/5.2/terminfo/init.lua'
		no file './terminfo.lua'
		no file 'cc-emu/terminfo.lua'
		no file '/usr/local/lib/lua/5.2/terminfo.so'
		no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/terminfo.so'
		no file '/usr/lib/lua/5.2/terminfo.so'
		no file '/usr/local/lib/lua/5.2/loadall.so'
		no file './terminfo.so'
stack traceback:
		[C]: in function 'require'
		cc-emu/emu.lua:256: in main chunk
		[C]: in function 'require'
		cc-emu/cli.lua:9: in main chunk
		[C]: in ?

EDIT: Nevermind, I forgot to install luv.
EDIT2: Apparently I still get the error after installing luv.
Edited on 21 January 2016 - 04:58 PM
columna1 #13
Posted 21 January 2016 - 06:16 PM
Updated and got
lua: cc-emu/emu.lua:256: module 'terminfo' not found:
		no field package.preload['terminfo']
		no file '/usr/local/share/lua/5.2/terminfo.lua'
		no file '/usr/local/share/lua/5.2/terminfo/init.lua'
		no file '/usr/local/lib/lua/5.2/terminfo.lua'
		no file '/usr/local/lib/lua/5.2/terminfo/init.lua'
		no file '/usr/share/lua/5.2/terminfo.lua'
		no file '/usr/share/lua/5.2/terminfo/init.lua'
		no file './terminfo.lua'
		no file 'cc-emu/terminfo.lua'
		no file '/usr/local/lib/lua/5.2/terminfo.so'
		no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/terminfo.so'
		no file '/usr/lib/lua/5.2/terminfo.so'
		no file '/usr/local/lib/lua/5.2/loadall.so'
		no file './terminfo.so'
stack traceback:
		[C]: in function 'require'
		cc-emu/emu.lua:256: in main chunk
		[C]: in function 'require'
		cc-emu/cli.lua:9: in main chunk
		[C]: in ?

EDIT: Nevermind, I forgot to install luv.
EDIT2: Apparently I still get the error after installing luv.

I get the same error as well.
Admicos #14
Posted 21 January 2016 - 07:34 PM
I can currently run it. But it's a little bit slow

EDIT: Pressing backspace prints "unknown key: 127"
EDIT2: CTRL doesnt work in edit.
Edited on 21 January 2016 - 06:35 PM
Selim #15
Posted 21 January 2016 - 10:35 PM
Updated again, now I have
there's an error
lua: cc-emu/emu.lua:467: attempt to index local 'termNat' (a nil value)
stack traceback:
cc-emu/emu.lua:467: in function 'emu'
cc-emu/cli.lua:16: in main chunk
[C]: in ?
Edited on 21 January 2016 - 09:36 PM
CoderPuppy #16
Posted 21 January 2016 - 10:40 PM
snip
snip
Sorry, I forgot about the terminfo dependency.

I can currently run it. But it's a little bit slow

EDIT: Pressing backspace prints "unknown key: 127"
EDIT2: CTRL doesnt work in edit.
It is rather slow when using the window API (probably because my implementation of term.blit is slow), but you can disable multishell (the main use of windows) using the new set program.
Backspace (and other keys) not working will probably be a problem, but that's an error from an old version (new errors should say "unknown key seq").
CTRL can't be captured on it's own in the terminal, but I mapped Ctrl-Shift-Tilde to it.

Updated again, now I have
there's an error
lua: cc-emu/emu.lua:467: attempt to index local 'termNat' (a nil value)
stack traceback:
cc-emu/emu.lua:467: in function 'emu'
cc-emu/cli.lua:16: in main chunk
[C]: in ?
Just pushed a fix that'll hopefully print the error even if termNat is nil.
Selim #17
Posted 21 January 2016 - 11:01 PM
Just pushed a fix that'll hopefully print the error even if termNat is nil.
I will test later, my Pi is currently down. I am borrowing the USB hub that was powering it for another purpose atm.

Side note: Personally, I like when emulators have a variable set somewhere so that programs can identify it as not standard CC. Like CCEmuRedux changed the _HOST variable in its latest version to include details about the CCEmuRedux version. Now, as you are advertising this as working with any version of CC and cannot throw it in with _HOST (as it hasn't been around long), I would suggest a new _G variable.
Edited on 21 January 2016 - 10:42 PM
CoderPuppy #18
Posted 22 January 2016 - 07:46 AM
I've pushed a bunch of updates including:
  • Add the HTTP API (probably buggy)
  • Add fs.find
  • Fix LuaJIT compat
  • Use terminfo for keybindings (should fix Admicos's problem with backspace)
  • Fix reading from files
  • Fix term.clearLine
  • Add _HOST, set to 'termu'

EDIT: and a hotfix for fs.find erroring when it doesn't find matches in a location
Edited on 22 January 2016 - 06:49 AM
Selim #19
Posted 22 January 2016 - 06:28 PM
Ok, now I have
lua: cc-emu/emu.lua:377: attempt to index global 'bit' (a nil value)
stack traceback:
        cc-emu/emu.lua:377: in function 'emu'
        cc-emu/cli.lua:16: in main chunk
        [C]: in ?
CoderPuppy #20
Posted 22 January 2016 - 11:56 PM
Ok, now I have
lua: cc-emu/emu.lua:377: attempt to index global 'bit' (a nil value)
stack traceback:
        cc-emu/emu.lua:377: in function 'emu'
        cc-emu/cli.lua:16: in main chunk
        [C]: in ?
Just pushed an update to fix that (I should test stuff that I say is supported).
Selim #21
Posted 23 January 2016 - 07:17 PM
> reboot
Goodbye
/home/pi/cc-emu/cc/bios.lua:596: attempt to call upvalue 'nativeReboot' (a nil value)

Sidenote: You are missing the fs.makeDir function.
Edited on 23 January 2016 - 08:25 PM
CoderPuppy #22
Posted 24 January 2016 - 04:52 AM
> reboot
Goodbye
/home/pi/cc-emu/cc/bios.lua:596: attempt to call upvalue 'nativeReboot' (a nil value)

Sidenote: You are missing the fs.makeDir function.

Just pushed an update to fix both those, though os.reboot still doesn't work (the emulator just isn't designed for it).
Also fixed term.setCursorPos not working fix decimals, and fs sandboxing (you could do ".." and get access to a directory outside the emulated computer's root directory).
Edited on 24 January 2016 - 03:54 AM
Selim #23
Posted 24 January 2016 - 03:14 PM
Ok, I am just going to go through and find missing functions :P/>
So far I have:
Spoileros API:
- getComputerName
- setComputerName

Actually, I will move this one to GitHub issues.
Edited on 24 January 2016 - 02:15 PM
CoderPuppy #24
Posted 27 January 2016 - 05:29 PM
I just pushed a new branch which contains GPIO integration (mainly for Raspberry Pi): rpi-gpio (here's a zip).
It's completely untested.
If you want to test it you need to install lua-periphery.
Then create a tree like:

.
└── .termu/
   └── redstone-gpio/
In the redstone-gpio directory create a file (the name is how you reference it) containing "[GPIO pin] [direction]".
If you have a Raspberry Pi, GPIO pin is probably based on this diagram:

Direction can be in, out, high or low (high and low are the same as out but with an initial value).
Then just use normal redstone functions to read/write to/from them.
Selim #25
Posted 27 January 2016 - 06:57 PM
–snip–
This is awesome :)/>
Selim #26
Posted 29 January 2016 - 11:25 PM
So, I see in your todo list you have Rednet and mouse support. I am curious on how you plan to implement both.
Will Rednet be data between Termu sessions on other computers?
Will it have to move out of the terminal to use the mouse?
CoderPuppy #27
Posted 30 January 2016 - 12:45 AM
So, I see in your todo list you have Rednet and mouse support. I am curious on how you plan to implement both.
Will Rednet be data between Termu sessions on other computers?
Will it have to move out of the terminal to use the mouse?

Modems will probably use ØMQ or RabbitMQ. Either way it'll have a server running that all the sessions connect to.

Mouse will work in terminals that support mouse reporting (which seems to be sort of a mess).
Selim #28
Posted 30 January 2016 - 01:00 AM
Modems will probably use ØMQ or RabbitMQ. Either way it'll have a server running that all the sessions connect to.
Ok.
Mouse will work in terminals that support mouse reporting (which seems to be sort of a mess).
Huh. Didn't know that was a thing.
apemanzilla #29
Posted 30 January 2016 - 05:03 AM
This is quite impressive! I have noticed a few issues however.
  • When the computer shuts down, it throws a segfault
  • Whenever I hit backspace, I get an error (unknown key seq: "\127")
I'm running Arch Linux and followed the instructions in the OP.
CoderPuppy #30
Posted 30 January 2016 - 04:12 PM
This is quite impressive! I have noticed a few issues however.
  • When the computer shuts down, it throws a segfault
  • Whenever I hit backspace, I get an error (unknown key seq: "\127")
I'm running Arch Linux and followed the instructions in the OP.

The segfault is a known bug, I can't figure out why it happens (because it happens after my code has exited).

Backspace not working means the terminal you're running it in is sending '\127' instead of whatever it has in it's termcap entry.
What terminal are you using? What does "tput kbs | cat -v" output?
apemanzilla #31
Posted 30 January 2016 - 08:41 PM
This is quite impressive! I have noticed a few issues however.
  • When the computer shuts down, it throws a segfault
  • Whenever I hit backspace, I get an error (unknown key seq: "\127")
I'm running Arch Linux and followed the instructions in the OP.

The segfault is a known bug, I can't figure out why it happens (because it happens after my code has exited).

Backspace not working means the terminal you're running it in is sending '\127' instead of whatever it has in it's termcap entry.
What terminal are you using? What does "tput kbs | cat -v" output?

Running gnome-terminal. When I run that command I get
^H
Edited on 30 January 2016 - 07:41 PM
CoderPuppy #32
Posted 30 January 2016 - 09:30 PM
This is quite impressive! I have noticed a few issues however.
  • When the computer shuts down, it throws a segfault
  • Whenever I hit backspace, I get an error (unknown key seq: "\127")
I'm running Arch Linux and followed the instructions in the OP.

The segfault is a known bug, I can't figure out why it happens (because it happens after my code has exited).

Backspace not working means the terminal you're running it in is sending '\127' instead of whatever it has in it's termcap entry.
What terminal are you using? What does "tput kbs | cat -v" output?

Running gnome-terminal. When I run that command I get
^H

I just pushed an update that should fix that.
It does include hardcoding some codes that I shouldn't have to.
It could mix up delete and backspace though.
apemanzilla #33
Posted 30 January 2016 - 09:37 PM
This is quite impressive! I have noticed a few issues however.
  • When the computer shuts down, it throws a segfault
  • Whenever I hit backspace, I get an error (unknown key seq: "\127")
I'm running Arch Linux and followed the instructions in the OP.

The segfault is a known bug, I can't figure out why it happens (because it happens after my code has exited).

Backspace not working means the terminal you're running it in is sending '\127' instead of whatever it has in it's termcap entry.
What terminal are you using? What does "tput kbs | cat -v" output?

Running gnome-terminal. When I run that command I get
^H

I just pushed an update that should fix that.
It does include hardcoding some codes that I shouldn't have to.
It could mix up delete and backspace though.

Seems to be working fine now.

By the way, you have a typo for HTTP handles - you have handle.gerResponseCode when it should be handle.getResponseCode.
CoderPuppy #34
Posted 30 January 2016 - 09:40 PM
By the way, you have a typo for HTTP handles - you have handle.gerResponseCode when it should be handle.getResponseCode.

Fixed.
apemanzilla #35
Posted 30 January 2016 - 09:42 PM
By the way, you have a typo for HTTP handles - you have handle.gerResponseCode when it should be handle.getResponseCode.

Fixed.

Congrats on 100 posts by the way!
Selim #36
Posted 06 February 2016 - 03:10 AM
Is it at all possible to add support for the teletext characters?
apemanzilla #37
Posted 06 February 2016 - 04:29 AM
Is it at all possible to add support for the teletext characters?

I doubt it, without some pretty crazy hacking.
CoderPuppy #38
Posted 08 February 2016 - 03:09 AM
Is it at all possible to add support for the teletext characters?
Unless those characters exist in Unicode I can't add them in the emulator.
It should be possible to create a font that has them, though.
LDDestroier #39
Posted 08 February 2016 - 03:54 AM
I seem to be getting an error. I had installed LuaRocks through 'sudo apt-get install luarocks', and I have Lua 5.2.


evan@evan-linuxBox:~/applications/termu$ lua cli.lua ./comp
lua: cli.lua:5: module 'pl.path' not found:
no field package.preload['pl.path']
no file '/usr/local/share/lua/5.2/pl/path.lua'
no file '/usr/local/share/lua/5.2/pl/path/init.lua'
no file '/usr/local/lib/lua/5.2/pl/path.lua'
no file '/usr/local/lib/lua/5.2/pl/path/init.lua'
no file '/usr/share/lua/5.2/pl/path.lua'
no file '/usr/share/lua/5.2/pl/path/init.lua'
no file './pl/path.lua'
no file '/usr/local/lib/lua/5.2/pl/path.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/pl/path.so'
no file '/usr/lib/lua/5.2/pl/path.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './pl/path.so'
no file '/usr/local/lib/lua/5.2/pl.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/pl.so'
no file '/usr/lib/lua/5.2/pl.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './pl.so'
stack traceback:
[C]: in function 'require'
cli.lua:5: in main chunk
[C]: in ?
CoderPuppy #40
Posted 08 February 2016 - 04:13 AM
I seem to be getting an error. I had installed LuaRocks through 'sudo apt-get install luarocks', and I have Lua 5.2.


evan@evan-linuxBox:~/applications/termu$ lua cli.lua ./comp
lua: cli.lua:5: module 'pl.path' not found:
no field package.preload['pl.path']
no file '/usr/local/share/lua/5.2/pl/path.lua'
no file '/usr/local/share/lua/5.2/pl/path/init.lua'
no file '/usr/local/lib/lua/5.2/pl/path.lua'
no file '/usr/local/lib/lua/5.2/pl/path/init.lua'
no file '/usr/share/lua/5.2/pl/path.lua'
no file '/usr/share/lua/5.2/pl/path/init.lua'
no file './pl/path.lua'
no file '/usr/local/lib/lua/5.2/pl/path.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/pl/path.so'
no file '/usr/lib/lua/5.2/pl/path.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './pl/path.so'
no file '/usr/local/lib/lua/5.2/pl.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/pl.so'
no file '/usr/lib/lua/5.2/pl.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './pl.so'
stack traceback:
[C]: in function 'require'
cli.lua:5: in main chunk
[C]: in ?

Have you installed penlight? It's part of the second to last code block in the recommended installation instructions.
LDDestroier #41
Posted 08 February 2016 - 06:53 AM
Have you installed penlight? It's part of the second to last code block in the recommended installation instructions.

Yeah, I installed all of those things with luarocks.
Selim #42
Posted 08 February 2016 - 01:53 PM
Unless those characters exist in Unicode I can't add them in the emulator.
It should be possible to create a font that has them, though.
That's too bad. The closest Unicode gets is 2x2: http://jrgraphix.net...icode/2580-259F
So, how would I go about making a font for that? I assume the characters it renders instead is what it gets when you attempt to render them? Or are they just a placeholder can't cannot just be swapped out for the proper characters with a font.
If so, what values does it use?
Edited on 08 February 2016 - 01:06 PM
CoderPuppy #43
Posted 08 February 2016 - 06:59 PM
Unless those characters exist in Unicode I can't add them in the emulator.
It should be possible to create a font that has them, though.
That's too bad. The closest Unicode gets is 2x2: http://jrgraphix.net...icode/2580-259F
So, how would I go about making a font for that? I assume the characters it renders instead is what it gets when you attempt to render them? Or are they just a placeholder can't cannot just be swapped out for the proper characters with a font.
If so, what values does it use?

Unfortunately the codes used for them (128 - 159) are continuation code units in UTF-8.
Which means any terminal that interprets that output as UTF-8 will see them as invalid text.
It should be possible to remap the output to valid UTF-8 such that the codepoint is the same as the original byte.
However that means mangling any actual UTF-8 that's output and my very limited testing hasn't been successful.
Selim #44
Posted 08 February 2016 - 10:48 PM
–snip–
Well, if you get that working so that each 128-159 are unique characters, let me know and I will attempt to make a font for the teletext from there.
amtra5 #45
Posted 08 February 2016 - 11:53 PM
You may be able to set a custom font through she'll commands with "setfont" http://man7.org/linux/man-pages/man8/setfont.8.html
Selim #46
Posted 09 February 2016 - 01:19 AM
You may be able to set a custom font through she'll commands with "setfont" http://man7.org/linu.../setfont.8.html
That will not help currently as each teletext character is printing as the same character. A font will not be able to fix that.
CoderPuppy #47
Posted 09 February 2016 - 04:48 AM
You may be able to set a custom font through she'll commands with "setfont" http://man7.org/linux/man-pages/man8/setfont.8.html
That looks like it only works for the real terminal not any terminal emulators.

–snip–
Well, if you get that working so that each 128-159 are unique characters, let me know and I will attempt to make a font for the teletext from there.
I got the output remapped from a bytes to Unicode code points (encoded as UTF-8) (pushed to the debug branch).
Unfortunately U+0080 - U+009F (what 128-159 are mapped to) are control characters in Unicode, which seems to make the not render at all (tested in st and urxvt).
The only fix I can think of is having a custom mapping that maps a bunch of CC-specific characters to Unicode code points.
So I need suggestions for where to map them to (just pick a code page from here that you think CC won't add support for in the future).
Edited on 09 February 2016 - 03:48 AM
Selim #48
Posted 09 February 2016 - 01:46 PM
–snip–
So I need suggestions for where to map them to (just pick a code page from here that you think CC won't add support for in the future).
I would say use any language page that isn't from the Americas or Europe.
FUNCTION MAN! #49
Posted 11 February 2016 - 12:47 AM
I'd use the CJK sets.
CoderPuppy #50
Posted 11 February 2016 - 06:24 PM
Ok, 128-159 (the teletext characters) now mapped to U+1D100 - U+1D10F (the first two columns of this) on the debug branch.

I'd use the CJK sets.
–snip–
So I need suggestions for where to map them to (just pick a code page from here that you think CC won't add support for in the future).
I would say use any language page that isn't from the Americas or Europe.

Any reason why you think using a language page is best?
Edited on 11 February 2016 - 05:25 PM
Selim #51
Posted 11 February 2016 - 06:32 PM
–snip–
Any reason why you think using a language page is best?
Not really.
CoderPuppy #52
Posted 14 February 2016 - 06:32 AM
I just pushed an update with modems.

I added some instructions to the OP. However I feel they're terrible, so if anyone feels like writing documentation…

Also I need ideas for more peripherals to add, maybe modems for other things (such as SPI or I2C for RPis), something with printers or peripherals from other mods.
Selim #53
Posted 14 February 2016 - 05:37 PM
I just pushed an update with modems.
–snip–
Also I need ideas for more peripherals to add, maybe modems for other things (such as SPI or I2C for RPis), something with printers or peripherals from other mods.
Oooooo…..
And, yes, Pi modems too :)/>
CoderPuppy #54
Posted 14 February 2016 - 05:51 PM
-snip-
And, yes, Pi modems too :)/>/>

Are there any specific devices that you want to work? I might be able to add custom support for some things (maybe ZigBee or XBee radios could be modems and LCDs could be monitors).
Selim #55
Posted 14 February 2016 - 05:58 PM
Are there any specific devices that you want to work? I might be able to add custom support for some things (maybe ZigBee or XBee radios could be modems and LCDs could be monitors).
I'm not sure what else. Is it possible to have USB printers act similar to CC Printers?
FUNCTION MAN! #56
Posted 14 February 2016 - 10:48 PM
With enough buffering and invocation of lpr, everything is possible.
Selim #57
Posted 15 February 2016 - 01:30 AM
What about using USB drives as mounts?
I would think that would be quite a bit simpler than the printer idea.
Maybe Noteblock peripheral? Acts like either a Noteblock itself would via OpenPeripherals, or like one of various mods' Iron Note Blocks.
What about using either Jasper or just a STT and TTS service on their own to make a "Chatbox"?
Edited on 15 February 2016 - 02:37 AM
CoderPuppy #58
Posted 02 August 2016 - 04:41 AM
I've added a bunch of new features:

  • CUPS printers (actually somewhat old)
  • Term munging: use all of the CC characters in Unicode terminals
  • Font generation: use the actual characters from CC
  • Term colors: custom colors
  • Mouse (only SGR 1006, so it won't work in old terminals and urxvt)
  • key_up

Look at the OP for instructions.
golem cur #59
Posted 02 August 2016 - 09:43 PM
This is really awesome I really like this :D/>