LibVT

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

Re: LibVT

Postby dilwyn » Thu Jan 23, 2020 5:56 pm

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! ;)


Dilwyn
All things QL: see www.dilwyn.me.uk
User avatar
tofro
QL Wafer Drive
Posts: 1820
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: LibVT

Postby tofro » Thu Jan 23, 2020 6:45 pm

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
Aurora
Posts: 986
Joined: Sat Jan 22, 2011 8:47 am

Re: LibVT

Postby Peter » Fri Jan 24, 2020 2:38 pm

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
QL Wafer Drive
Posts: 1820
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: LibVT

Postby tofro » Fri Jan 24, 2020 3:08 pm

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: 32
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Postby SM7I » Sat Jan 25, 2020 1:04 pm

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
QL Wafer Drive
Posts: 1656
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: LibVT

Postby Derek_Stewart » Sat Jan 25, 2020 10:32 pm

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: 171
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: LibVT

Postby swensont » Sun Jan 26, 2020 5:36 am

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: 32
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Postby SM7I » Sun Jan 26, 2020 9:47 pm

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
QL Wafer Drive
Posts: 1656
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: LibVT

Postby Derek_Stewart » Mon Jan 27, 2020 9:27 am

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: 32
Joined: Mon Dec 10, 2012 6:52 pm

Re: LibVT

Postby SM7I » Mon Jan 27, 2020 9:44 am

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.



Who is online

Users browsing this forum: No registered users and 7 guests