LibVT

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: LibVT

Post by dilwyn »

tofro wrote:
Derek_Stewart wrote:Hi,

I was going to port ncurses to C68, do you think this would be of any use?
Of curse!
If that was a typo, Tobias, well done. If it wasn't a typo, even more well done! ;)


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: LibVT

Post by tofro »

Thanks, no it wasn't. Sorry Derek, but I couldn't resist :D

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Peter
QL Wafer Drive
Posts: 1953
Joined: Sat Jan 22, 2011 8:47 am

Re: LibVT

Post by Peter »

Of c(o)urse I know that ncurses is newer than curses, but most ncurses calls are said to be easily portable to the old curses, which exists for C68.

What is the exact point in an ncurses port?


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: LibVT

Post by tofro »

Peter,

the major changes between "traditional Unix" curses and ncurses are:
  • Improved feature set (ncurses API consists of roughly twice the number of API calls than traditional curses)
  • Support for forms, windows, menus
  • Panel stacks (that is, stacked windows that have a z-order and a back buffer to restore them)
  • Wide character support (wchar_t)
  • Color support
  • many more...
And, of course, the main thing is that many modern open source Unix text mode applications (like Lynx, vim,...) rely on ncurses support rather than curses.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
SM7I
ROM Dongle
Posts: 41
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Post by SM7I »

I would surely appreciate every effort to port ncurses to (xt)C68. I´m going nuts with curses here....I can´t for my life do a simple thing as print a text at a specified location on the screen....move(15,15) does not do anything for my printf and following refresh()


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: LibVT

Post by Derek_Stewart »

Peter wrote:Of c(o)urse I know that ncurses is newer than curses, but most ncurses calls are said to be easily portable to the old curses, which exists for C68.

What is the exact point in an ncurses port?
Hi,

I am still trying to write the make file for C68, so early days at present.


Regards,

Derek
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: LibVT

Post by swensont »

SM71,

Check out SMSQzine #7 for some working examples of curses. The source files are in the accompanying .zip file. SMSQzine can be found on my website:

http://swensont.epizy.com/

Tim


SM7I
ROM Dongle
Posts: 41
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Post by SM7I »

swensont wrote:SM71,

Check out SMSQzine #7 for some working examples of curses. The source files are in the accompanying .zip file. SMSQzine can be found on my website:

http://swensont.epizy.com/

Tim
Compiled testcur1.c without any problems like so: qcc testcur1.c -o testcur -lcurses

However, when run on a QL I only get 'no terminal defined' in the window.

What´s the problem ?


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: LibVT

Post by Derek_Stewart »

Hi,

The problem here is that you have not set the Environmental Variable for the terminal type, which uses "terminfo_qdos"

I set my VT52 terminal in the boot file with the following commands:

Code: Select all

REMark Set variable for terminal type
SETENV "TERM=QDOS"
:
REMark Set variable for terminal info file
SETENV "TERMINFO=terminfo"
This allows the Curses compiled programme to load the VT52 screen emulation file.

It is detailed in the LIBcurses documentation, the terminfo_qdos file is contained in the C68 distribution runtime disk 2

Having the VT52 terminal defines all the "testcur" C files now compile correctly, giving the "-lcurses" option on the command line at the end of the command string:

ex CC;"-o testcur1_exe testcur1_c -lcurses"


Regards,

Derek
SM7I
ROM Dongle
Posts: 41
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Post by SM7I »

Derek_Stewart wrote:Hi,

The problem here is that you have not set the Environmental Variable for the terminal type, which uses "terminfo_qdos"

I set my VT52 terminal in the boot file with the following commands:

Code: Select all

REMark Set variable for terminal type
SETENV "TERM=QDOS"
:
REMark Set variable for terminal info file
SETENV "TERMINFO=terminfo"
This allows the Curses compiled programme to load the VT52 screen emulation file.

It is detailed in the LIBcurses documentation, the terminfo_qdos file is contained in the C68 distribution runtime disk 2

Having the VT52 terminal defines all the "testcur" C files now compile correctly, giving the "-lcurses" option on the command line at the end of the command string:

ex CC;"-o testcur1_exe testcur1_c -lcurses"
Aha, so I must set this in my bootfile of both my real QL as well as QLAY2 ? I do all development and compiling on Linux with qcc and then I use mdvtools to create an MDV file which I then use on QL, both real and emulated.

I tried what you suggested, but the QL won´t recognize SETENV.


Post Reply