Requesting Windows CLI version of Git Glulxe interpreter

Hello,
I was trying to use the Windows Git program with my screen reader - a program for the blind that, in short, reads the contents of the computer screen audibly or in a tactile form (Braille). To my surprise, Windows Git works quite nicely for the most part. I was able to access the multi-line edit box for which the output is located, and can reasonably read the output and play interactive fiction without too much trouble. The problem I am having, is that my screen reader, NVDA (free and open-source), does not read the output automatically as text is updated, and there are a few other problems that detract from the playing experience.

Looking at the subject for this post must have been surprising. Why would anyone want to have a CLI version of a program, when a perfectly usable GUI is available for Windows? The simple answer is that almost all screen readers for Windows, Linux, and presumably OSX, read and interact with a console/terminal’s input/output just fine. When output is updated, it is automatically read, when one line changes in the output and everything else stays the same (like in a setting screen), it (NVDA) reads only the changed line and not the whole entire screen. These features, if you will, are only a few advantages of using CLIs rather than a custom output, though I assume Windows Git’s controls aren’t custom at all…

I am not a programmer, only taking basic C++ and JAVA classes in college, so I don’t know how difficult compiling a separate console version would be, though I assume the source code for Git outputs to a console. I have also not looked at the source code, so don’t really know how hard it would be to implement (I.E. changing a output function to use ‘cout’ instead of using a GUI). I also don’t know too much about compiling programs in Windows. I have used the terminal and dabbled a bit in compiling in Linux, but don’t really know of any environments that would allow me to use the make file in Windows (besides Cygwin and MinGW, but that would require me to install so many dependencies).

In short, I am wondering if anyone would be able to provide a compiled CLI version for Git? It would be quite easier to play games, without having to work for it, making the appeal lessen.

I am hoping that it would be a relatively simple process to do, and am assuming that it hasn’t been done only because there seems to be no demand for console applications for Windows nowadays. I also hope that someone already has a build environment set up for compiling Git (outlined in the readme) as to not make it an arduous task.

I’ve tried using dosgit, but it crashed after the preferences for a game and right before beginning the game, probably because there were multiple changes made since 2004 to both Git as well as the glulx engine/standard.

I hope that this post isn’t too lengthy or hard to understand, and thank you for taking the time to read this. I’ve also read the entirety of theFAQ (to the best of my knowledge) as well as the terms of use before registering and posting, so I hope this post complies with the rules of this forum.

Hello, Twynn, and welcome to the forum!

I’ve been looking for a CLI version of Git or Glulxe myself. I know Floyd (the interpreter bot on the IFMUD) uses something called “Cheap Glk” to play Glulx games, and it seems that it must be CLI, but searching for it finds nothing but used-car ads.

I thing I have a CLI version of FyreVM somewhere (Glulx). Let me dig around my archive for it and I’ll get back to you.

David C.
www.textfyre.com

I’m not sure if this is what you are trying to find, but check caad.es/fichas/cheapglulxe-win32-2011.html

Also, there’re some (old?) instructions in spanish, for compiling at wiki.caad.es/Cheapglulxe

CheapGlk source code is available at the Archive (eblong.com/zarf/glk/).

If you do Windows development, it should be very easy to compile a Windows binary of Glulxe+CheapGlk. I am not the person to do that, though.

I’ll try it, I have some free time.

After installing the base package for MinGW, I was able to compile a CLI version of Glulxe 0.5.1, using CheapGlk 1.0.4 as the Glk library. I had to change the bzero function in cgfref.c to use memset instead, as either MinGW or GCC through a hissy fit.

All in all I didn’t like the compiled version because 1) glulxe took way too long to respond, and 2) CheapGlk (who I think is the culprit) does weird things with line display (or maybe it’s the dos compilation), and my screen reader kept repeating lines for some reason. I also wasn’t able to change options, as the game author used the menu system (where one arrows to options and press Enter to change/select) as arrowing didn’t work and I don’t know of any other methods of going through choices.

Still, it was a good attempt at my first compilation in Windows at least. I’m trying to use Git instead of Glulxe, but the make file is quite different, and I don’t think there’s a dos option anymore. :smiley:

If anyone wants my compilation, it is attached (if I did it correctly).
NOTE: It works fine on my system (running Windows XP SP3) but I don’t know about anyone else’s system, so run at your own risk.
Glulxe.zip (285 KB)

I got Git to compile after changing bzero to memset in cgdate.c and commenting out the error message about not being able to move the cursor to the status window (which is an annoying hack but I can’t recompile all the I7 games with Zarf’s patch). Everything I tested works, although menus tend to flicker when you move through them.

This is actually an EXE file, but the forum doesn’t like the extension. Just rename it after downloading.

EDIT: Cross-post! Well, now you have two options.
git.exe.zip (401 KB)

An out-of-the-box I7 game should play in CheapGlk/Glulx without trouble. Once you add menu extensions, you may wind up in a situation where the game crashes or is unplayable because no status line is available. This is unfortunate; it should ideally be fixed in the extension but I realize this won’t always happen.

A more sophisticated RemGlk wrapper could take the game display and make it completely accessible through stdin/stdout (including multiple windows, text styles, and so on). This is how the Floyd MUD bot works. The code for this is at github.com/ziz/sleepmask , but it’s probably a bear to set up on Windows.

Isn’t there the old bug where it spams “can’t move cursor” messages when it tries to draw the status line?

In a previous release of I7? I vaguely remember this.

I’m curious if anyone, particularly zarf, could tell me how the CheapGlk renders output to the screen, as my screen reader repeats text where it shouldn’t. When running the dos version for Git, the same phenomena does not occur. I notice that is only occurs when a blank line is encountered, and it, the synthesizer, speaks the first 35 or so characters from the next line before reading the next line all over again, though this time completely.

Output from both the console and my screen reader are below. I’m just curious why this occurs is all, so don’t look too much into it.

I ran Alabaster.gblorb from Git’s source. Original output from console window is pasted below:

This is the text that is sent to the synthesizer to synthesize. The only thing deleted were the trailing spaces at the end of each line (if it doesn’t reach eighty characters long exactly):

The first passage you quote is how it should come out (in an 80-column terminal window).

I know that. I did figure out why the screen reader repeats things, though. Seems your CheapGlk outputs onto the screen character by character, and the screen reader would read said character as they appear. If many characters go into the buffer, the screen reader will read what’s in the buffer as words, hence the repeating issue. I assume that the blank line tells the screen reader "Hey, I’m done reading. Send in the next bit from the buffer. Now I wish there was a small delay between readouts, as to have the full text before reading.

By the way, any chance of word wrap? Or is CheapGlk not supposed to handle that.

Thank you all for all your help. It is highly appreciated.

Okay. I don’t know much about screen reader technology (except on iPhones), so I have no idea how to improve the behavior of your system.

CheapGlk is not supposed to handle line-wrapping, buffering, or anything else. It just throws the text out there. A wrapper could be constructed to do additional work.

I have some old word-wrapping code from another project. If I can find it it might do the trick.

Word wrap isn’t really an issue for me. I was just curious if CheapGlk did anything like that as an extra setting that I didn’t know about. Now all I need to do is to write a simple function that outputs to the console as whole lines (maybe look for \n?) rather than just streaming output character by character.

A big “thank you” to both zarf and Draconis for patiently answering my questions and posing suggestions. I appreciate it a lot.

Have a wonderful day/night,
T. Wynn

Hello,
My name is Nick, and I am new to this forum.
I have recently been writing an add-on for the NVDA screen reader to make it auto-speak game output from Windows Glulxe and Windows Git. I have for the most part been successful in doing this, but I have encountered an occasional problem in wich all the text of the output window gets spoken instead of just the new lines of text. I’m not really sure why this is, but I’m guessing it’s something to do with how text is sent to the main output window of Windows GLK. I’m not sure if this could be related, but when I was writing a similar module for Windows Frotz, I was having the same problem until I turned on ‘Fast Scrolling’ in the Windows Frotz preferences.
Even though some screen readers can be scripted, the ideal solution for automatic screen reader output of Windows GLK based interpreters would be to use the screen reader APIs to read new text from the various game windows when they are updated. There are existing GPL licensed projects that I think would make this a fairly trivial feature to implement. Universal Speech Access, available from vrac.quentinc.net/UniversalSpeech.zip is a small c/c++ DLL that defines some functions for detecting if a Windows screen reader is running, and for sending text to be spoken by the currently running screen reader. The DLL can also be registered as a Com server to provide the same functionality through Com.
That being said, I’ve found that the NVDA screen reader automatically speaks the output of Glulxe and Git pretty well in the Windows console. In case anyone finds it useful, I’m attaching a zip file containing Glulxe, Git, and NFrotz compiled under Cygwin.
console_interpreters.zip (1.5 MB)

This is a big bump but I wanted to just let you know that I’ve built git with a more advanced GLK than cheapGLK - I ported glkterm from POSIX + ncurses to Windows + PDCurses. I just had to define a few POSIX things and write a handler for ‘ctrl+c’ for exiting, and the rest was pretty simple. I built it in MinGW, and I’ve got binaries here for you.

My website is down at the moment due to factors beyond my control, but I’ve also uploaded it here:
ifarchive.org/indexes/if-arc … sXgit.html

[NOTE] I think that I may have put a different .exe in the .zip than in the .tar.gz tarball - the one in the .zip doesn’t support ‘ctrl+C’ properly. You can extract the .tar from the .gz in windows with 7-zip, and then extract the .tar to get all the files inside by using 7-zip on the .tar file. I will try to get that .zip file updated but my submissions have to be manually approved so expect it to take a little while. Sorry. The .exe in the tarball is under ‘git-win32/git-134/git.exe’.

This supports word wrapping, multiple windows, and other nice things. I also added a couple command-line arguments -

-fg NUM: change foreground color (see definitions in curses.h) -bg NUM: change background color (see definitions in curses.h)

the Windows console uses colors in BGR format instead of RGB, so you need to remember that. The pdcurses ‘curses.h’ file with colors defined is here:
https://github.com/macton/pdcurses/blob/master/curses.h
If you don’t feel like doing the maths on that, just start experimenting. Run ‘git -fg 1’, ‘git -fg 2’, ‘git -fg 3’… ‘git -fg 13’, ‘git -fg 14’, ‘git -fg 15’, etc. to find which number is the color you like. The same color codes work for backgrounds (with ‘-bg’).

Note that this list here looks pretty accurate.

If you were still looking for something, I hope that’s good. The source code is included in the .tar.gz archive on the site, and the .zip has just a .exe you can run (the .exe is 316 kb and unstripped, so the debug symbols are still present if you run into problems).

For best results with colors you should use the command line’s built-in ‘color’ command to set default background/foreground colors beforehand, AND specify them with ‘-bg’ and ‘-fg’. For help with the built-in ‘color’ command, run ‘color /?’. This is due to some lazy programming on my part. Feel free to fix it properly and release it!
Also note that the ‘color’ command uses colors in hexadecimal, where the git arguments use decimal. think of hexadecimal ‘A’ as being a tenth digit in a base-16 numbering system.

Decimal        Hexadecimal
1              1
2              2
3              3
4              4
5              5
6              6
7              7
8              8
9              9
10             A
11             B
12             C
13             D
14             E
15             F

A little example:

Thanks to both stockton and wyatt8740 for taking the time and effort to compile/port various interactive fiction interpreter CLI binaries for Windows - mainly git - and explaining what they did. Though I haven’t been an active gamer due to university, I am sure that these binaries will assist greatly those who are looking for Windows CLI alternatives - a pretty niche area in and of itself.

I may test these binaries with some games while decompressing one of these days, so again a big thank you to all who have assisted me in my endeavors for their kindness, patience, and time.