hlabrand Posted October 6, 2020 Share Posted October 6, 2020 (edited) Hello everyone, I have a bit of a puzzle for you, if anyone could help me I'm trying to compile a program called JZIP 2.1 (jzip.sourceforge.net), which is an interpreter that runs text adventure games in the Infocom format. The code is C, and there is Atari ST-specific code in there. It does not compile out of the box, but after a few sensible changes, it compiles. However, when I launch the program on an ST, all the output happens on the same line, that just keeps erasing itself. This, I was told, suggests a termcap issue. The program has a built-in fallback if no termcap is defined, and uses a "basic default Atari vt52" in that case. An earlier version of the program, JZIP 2.01f, has been compiled; unfortunately the person who did it has since lost the source and cannot remember what they did back then (1995...). All I have is a changelog, which states among other things: "- Termcaps weren't set up properly, if you didn't have them. Fixed." This suggests that the termcap definition on line 186 of the attached file "atariio.c" was wrong somehow. I don't know much about vt52, termcap, or Atari ST programming actually. Is someone able to see what is wrong in the termcap fallback, and recreate the patch? (To get a successful compilation, download the source from jzip.sourceforge.net, then download the 3 attachments below and use them to overwrite files. If you want to test it, run the .ttp program on this file, which is Zork 1 (in the public domain).) Thank you so much in advance, I'd really appreciate being able to figure it out and compile the program correctly atari.mak atariio.c ztypes.h Edited October 6, 2020 by hlabrand Quote Link to comment Share on other sites More sharing options...
zzip Posted October 6, 2020 Share Posted October 6, 2020 Sounds like an end of line issue. It might be using ASCII-13 for ending a line, but I believe the ST needs a 13 and a 10 (line feed) to advance to the next line. Typically in C, you might use "\n" to end a line, which the compiler should translate to the correct sequence for the local machine. I took a quick look at the code and it looks to be outputting raw characters. I'm not an expert in termcap, but it looks like the way to define a carriage return is nw= so perhaps adding nw=^J^M: to one of the strings in that termcap entry around line 168 will help? Quote Link to comment Share on other sites More sharing options...
zzip Posted October 6, 2020 Share Posted October 6, 2020 The vt52 entry from this site has :nw=\r\n: instead. That might work better than using ^j^n https://invisible-island.net/xterm/termcap.html Quote Link to comment Share on other sites More sharing options...
hlabrand Posted October 7, 2020 Author Share Posted October 7, 2020 (edited) Hi! Thanks for your reply! I tried this and it didn't help. (I think the program writes directly '\r', without asking the "nw" parameter or defining its own) I asked on another forum, and someone just compiled it with the original termcap library, and it just... worked. It didn't work for them either when they used the "termcap" library in ncurses, but using another one (an older one? I think? I don't know), it worked. The moral seems to be "TOS doesn't like ncurses" (apparently, it always worked on MiNT). Thanks for your help. I'm just relieved it works now Edited October 7, 2020 by hlabrand Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.