Jump to content




Termu - Terminal-based Emulator


58 replies to this topic

#21 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

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 by Selim, 23 January 2016 - 09:25 PM.


#22 CoderPuppy

  • Members
  • 121 posts

Posted 24 January 2016 - 04:52 AM

View PostSelim, on 23 January 2016 - 07:17 PM, said:

> 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 by CoderPuppy, 24 January 2016 - 04:54 AM.


#23 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

Posted 24 January 2016 - 03:14 PM

Ok, I am just going to go through and find missing functions :P
So far I have:
Spoiler

Actually, I will move this one to GitHub issues.

Edited by Selim, 24 January 2016 - 03:15 PM.


#24 CoderPuppy

  • Members
  • 121 posts

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:
Posted Image
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.


#25 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

Posted 27 January 2016 - 06:57 PM

View PostCoderPuppy, on 27 January 2016 - 05:29 PM, said:

--snip--
This is awesome :)

#26 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

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?

#27 CoderPuppy

  • Members
  • 121 posts

Posted 30 January 2016 - 12:45 AM

View PostSelim, on 29 January 2016 - 11:25 PM, said:

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).

#28 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

Posted 30 January 2016 - 01:00 AM

View PostCoderPuppy, on 30 January 2016 - 12:45 AM, said:

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

View PostCoderPuppy, on 30 January 2016 - 12:45 AM, said:

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.

#29 apemanzilla

  • Members
  • 1,421 posts

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.

#30 CoderPuppy

  • Members
  • 121 posts

Posted 30 January 2016 - 04:12 PM

View Postapemanzilla, on 30 January 2016 - 05:03 AM, said:

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?

#31 apemanzilla

  • Members
  • 1,421 posts

Posted 30 January 2016 - 08:41 PM

View PostCoderPuppy, on 30 January 2016 - 04:12 PM, said:

View Postapemanzilla, on 30 January 2016 - 05:03 AM, said:

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 by apemanzilla, 30 January 2016 - 08:41 PM.


#32 CoderPuppy

  • Members
  • 121 posts

Posted 30 January 2016 - 09:30 PM

View Postapemanzilla, on 30 January 2016 - 08:41 PM, said:

View PostCoderPuppy, on 30 January 2016 - 04:12 PM, said:

View Postapemanzilla, on 30 January 2016 - 05:03 AM, said:

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.

#33 apemanzilla

  • Members
  • 1,421 posts

Posted 30 January 2016 - 09:37 PM

View PostCoderPuppy, on 30 January 2016 - 09:30 PM, said:

View Postapemanzilla, on 30 January 2016 - 08:41 PM, said:

View PostCoderPuppy, on 30 January 2016 - 04:12 PM, said:

View Postapemanzilla, on 30 January 2016 - 05:03 AM, said:

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.

#34 CoderPuppy

  • Members
  • 121 posts

Posted 30 January 2016 - 09:40 PM

View Postapemanzilla, on 30 January 2016 - 09:37 PM, said:

By the way, you have a typo for HTTP handles - you have handle.gerResponseCode when it should be handle.getResponseCode.

Fixed.

#35 apemanzilla

  • Members
  • 1,421 posts

Posted 30 January 2016 - 09:42 PM

View PostCoderPuppy, on 30 January 2016 - 09:40 PM, said:

View Postapemanzilla, on 30 January 2016 - 09:37 PM, said:

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!

#36 Selim

  • Members
  • 189 posts
  • LocationHiding in Online Storage

Posted 06 February 2016 - 03:10 AM

Is it at all possible to add support for the teletext characters?

#37 apemanzilla

  • Members
  • 1,421 posts

Posted 06 February 2016 - 04:29 AM

View PostSelim, on 06 February 2016 - 03:10 AM, said:

Is it at all possible to add support for the teletext characters?

I doubt it, without some pretty crazy hacking.

#38 CoderPuppy

  • Members
  • 121 posts

Posted 08 February 2016 - 03:09 AM

View PostSelim, on 06 February 2016 - 03:10 AM, said:

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.

#39 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

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.

[email protected]:~/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 ?


#40 CoderPuppy

  • Members
  • 121 posts

Posted 08 February 2016 - 04:13 AM

View PostLDDestroier, on 08 February 2016 - 03:54 AM, said:

I seem to be getting an error. I had installed LuaRocks through 'sudo apt-get install luarocks', and I have Lua 5.2.

[email protected]:~/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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users