mcurses ported to P2 with FlexC
Rayman
Posts: 14,646
Was able to get this Arduino code, mcurses, from GitHub to work with FlexC. "Porting" might be too strong a word... Just had to change a few lines...
https://github.com/ChrisMicro/mcurses
There is a lot of C code out there that uses ncurses and I'm hopeful that this will let them work.
The attached code runs the hexadecimal memory editor example, screenshot attached.
But, the downside is that it doesn't run right in the loadp2 terminal window, nor in Parallax Serial Terminal.
It does run in both Putty and Teraterm. But, the issue there is that it resets the P2 on startup. So, you have to load the code into flash in order for it to work with these.
Update: See next post for how to fix reset issue.
However, maybe I can use the P2 with VGA and USB keyboard as the terminal and use these codes directly on P2.
https://github.com/ChrisMicro/mcurses
There is a lot of C code out there that uses ncurses and I'm hopeful that this will let them work.
The attached code runs the hexadecimal memory editor example, screenshot attached.
But, the downside is that it doesn't run right in the loadp2 terminal window, nor in Parallax Serial Terminal.
It does run in both Putty and Teraterm. But, the issue there is that it resets the P2 on startup. So, you have to load the code into flash in order for it to work with these.
Update: See next post for how to fix reset issue.
However, maybe I can use the P2 with VGA and USB keyboard as the terminal and use these codes directly on P2.
zip
47K
Comments
If you uncheck the top item "Serial Enumeration" it won't reset when you plug and unplug a device from the system.
Mike
Update: Well, it seemed to work, but now doesn't.. Oh, well.
Biggest issue is the special line drawing characters... It seems something is wrong in translation.
This page is trying to tell me something about this, but I don't get it yet: https://invisible-island.net/ncurses/man/curs_addch.3x.html#h3-Line-Graphics