Page 1 of 1

Emulator that runs as server?

Posted: Mon Jul 13, 2015 8:56 am
by nippur72
I was wondering if there is an emulator that allows a VIC-20 program to run as a "server", e.g working with serial port on the VIC side but then have the I/O translated into TCP/IP or even HTTP.

Is there a similar thing?

Re: Emulator that runs as server?

Posted: Tue Jul 14, 2015 3:51 am
by groepaz
recent VICE? i haven't tried it myself, but iirc blacky made it so that RS232 can work over telnet

Re: Emulator that runs as server?

Posted: Tue Jul 14, 2015 4:54 am
by nippur72
do you have a link? I cant find anything

Re: Emulator that runs as server?

Posted: Tue Jul 14, 2015 4:58 am
by groepaz
you can download nightly (windows) builds at http://vice.pokefinder.org ... if i recall correctly you just have to enter the remote IP into the "serial device" dialog. or perhaps it was the IP it should listen to, dont recall (i dont use this feature, nor the windows port)

Re: Emulator that runs as server?

Posted: Tue Jul 14, 2015 6:24 am
by nippur72
ok thanks! It seems to be an undocumented feature, because the manual talks about UNIX devices (/dev) but doesn't say anything about TCP ports. I guess one has to setup a server listening to that port?

BTW, I don't remeber what device #number is serial port on the vic... is it 4?

Re: Emulator that runs as server?

Posted: Tue Jul 14, 2015 7:22 am
by Mike
RS232 listens to dev. #2.

Remember, that two 256 byte transmit/receive buffers are allocated with the OPEN command. If those buffer pointers haven't been set beforehand to an address outside the range available for BASIC, the buffers are placed at the end of BASIC memory, clearing all variables.

Re: Emulator that runs as server?

Posted: Fri Jul 17, 2015 7:05 am
by nippur72
I'm having trouble to make it work.

I made a node.js server that listens both TCP and UDP port, and run VICE with the following program:

Code: Select all

10 open 2,2
20 get#2,a$
30 print a$;".";
35 print#2,"x";
40 goto20
but nothing on the server happens, no UDP messages and no TCP incoming connections.

Any idea?

Re: Emulator that runs as server?

Posted: Sat Jul 18, 2015 4:22 am
by groepaz
you'll have to setup the baudrate for the port in the open statement.... cant tell how that works though, last time i did is 25+ years ago :)

Re: Emulator that runs as server?

Posted: Mon Jul 20, 2015 5:10 am
by nippur72
I've found this code from C64 manual that should set 300 baud communication

Code: Select all

10 open 2,2,0,chr$(6)
20 get#2,a$
30 print a$;".";
35 print#2,"x";
40 goto20
I've enabled RS232 user port emulation at 300 baud, linked to a device that is "127.0.0.1:6464" (where my node.js application is listening) but it doesn't work :(

Don't know what other to try.

Re: Emulator that runs as server?

Posted: Mon Jul 20, 2015 5:37 am
by nippur72
Update! by chance I made it work. :D

Apparently, after the connection is broken an hard reset of the emulator is required. So all my good attempts were being done in vain.

Here is a simple echo server in node.js, sending back the "X" coming from the VIC:
screen.jpg
screen.jpg (96.78 KiB) Viewed 2361 times

Re: Emulator that runs as server?

Posted: Mon Jul 20, 2015 5:46 am
by groepaz
good to hear!

if you dont mind... write up a small howto, i'd be happy to include it in the documentation :)

Re: Emulator that runs as server?

Posted: Mon Jul 20, 2015 6:07 am
by nippur72
sure, once I figure out how to overcome the lost-connection problem I'll put a repo on github with the source code for the server and a small howto.