Building WinVICE 2.4

WinVICE is a Commodore emulator that lets you run Commodore 64, VIC-20, PET, etc programs on your modern computer. I prefer an older version (2.4) the most as I feel newer versions have too many extra features that I don't require.

I am also interested in Bulletin Board Systems (BBS), and I'd like to set up WinVICE on an older computer and run a Commodore BBS on it. One item has gotten in my way: any versions of WinVICE that I use will not report the presence of a modem carrier tone to the BBS software (DCD). I think this is because of this line of code in the RS232 emulation source:

return rsuser_get_rx_bit() | CTS_IN | (rsuser_baudrate > 2400 ? 0 : DCD_IN);

I believe this is raising the DCD line (Carrier Detect) but only if the baud rate of the connection is over 2400. I prefer to use a baud rate of 300 as that was the speed of my actual Commodore modem back in the 1980's when I ran real Commodore BBSes.

So I found a patched version here:

https://roxburysoftware.com/color64-bbs-in-vice-2-4/

and all I needed to do is rebuild VICE. That turned out to be the more difficult part. I went through various gyrations, and eventually found the following solution:

  • using VirtualBox, I set up a Windows 2000 Pro SP4 install (32-bit)
  • installed MingW 3.1 [link]
  • installed msys 1.0 [link]
  • downloaded VICE source and expanded it into my msys home folder [link]
  • downloaded the patched rsuser.c file and put it into the ./src/rs232drv/ folder [link]
  • ran msys to enter the build envrionment
  • moved into the vice-24 folder (root of the VICE downloaded above)
  • read the notes in /src/vice-2.4/doc/building/Win32-Cygwin-Howto.txt
  • essentially: ./configure, then make, then make bindist
  • ran into one issue where a reference to info_contrib_text was not found - this was in uihelp.c. I edited the C file and just replaced info_contrib_text with info_licence_text and that seemed to work (you can re-run make as many times as you want, and it will pick up where it left off).

The resulting xvic.exe did run (although it came up with an exception error that only happened the first time I ran it - subsequent runs were fine?!). My next task is to test it and see if the DCD line in xvic.exe actually changes when an external connection is made (via tcpser). We'll see!

[UPDATE] Fantastic news! I wrote a quick terminal program in BASIC that allows me to open a modem channel, and then process modem input and keyboard output. Here is a simplified version:

10 OPEN 5,2,0,CHR$(6)+CHR$(0)
20 GETA$:GET#5,B$:PRINTA$;B$;:PRINT#5,A$:GOTO20

My terminal is a bit more sophisticated, and when I press F2 on my keyboard, it outputs all the bits of address 37136 which is the output register for the RS232 port (user port). What I was expecting is that bit 16 would go high (on) when there was no carrier, and go low (off) when there is a carrier (which sounds backwards, but this is how it is supposed to work). Unfortunately, with the stock xvic.exe there were no differences of 37136's value regardless of the connection state. One of the keys for a BBS to work is it has to realize when the user has disconnected. But after patching and building my new xvic.exe, it works! When my remove connection (through tcpser) is down, the value of bit 16 is 1. When the connection is made, it goes to 0! Now, my BBS program can know when someone is connected or not. Fantastic!