Home  Articles  Programs 

Transfer SEQ Text Files in C64 to Evernote over RS232

This method helps to transfer PETSCII text in Commodore to Evernote over a RS-232 connection.

Evernote is a nice app. to organize notes that I use actively. It is also compatible with Linux under Wine emulator. In addition, there is an Evernote-compatible NixNote program, and Evernote apps. for Android, iPad etc.

I do use Evernote to keep my notes and tips on Commodore as well. And today, I've just found a practical way to transfer old notes in sequential files kept in Commodore diskettes.

That is to say:

* Evernote has an "Import Folders" option. First, we select a directory for this. I used, /home/ilker/cbm/ .

* Then, I connected C64 and Linux using a null-modem cable (with 3 wires: RX, TX and GND).

* I added the following line to /etc/inittab to be able to use Linux through C64. and, I executed init q to activate this new inittab that makes Linux to listen the serial port.

S0:123:respawn:/sbin/getty -L ttyS0 1200 dumb

* In the C64, I opened a RS232 port as in here: http://cbm.ficicilar.name.tr/commodore/a-method-to-use-commodore-basic-programs-remotely-over-rs232 and logged in Linux:

100 OPEN 1,2,0,CHR$( 8 )+CHR$(0):GET#1,A$
110 print#1,chr$(10);:print#1,"USERNAME"+chr$(10);:fori=1to1000:next
120 print#1,"PASSWORD"+chr$(10):fori=1to1000:next:rem upper case PETSCII chars should be changed with ASCII equivalents
130 print#1,chr$(10);:print#1,"CD CBM"+chr$(10);:fori=1to1000:next

(This code segment is not included in the program)

* I wrote a small program in the C64. The program finds the seq files in a diskette; opens them one by one; executes CAT > FILENAME command in Linux over RS232; and, dumps this SEQ text file onto FILENAME through PETSCII-ASCII conversion. At the end of file, the program sends CHR$(4) character to notify Linux, and this EOF closes the CAT command.

* Program exits after repeating this procedure for all SEQ files in the diskette.

* And, NixNote synchronizes the files in that directory with Evernote servers. * And, I happily watch 20-year-old SEQ notes appeared -beamed- in the Evernote in my tablet connected to Internet over WiFi.

* That's all.

I used the same program to transfer its own listing, as well:

10 rem seq2enote
20 rem sequential file to evernote
30 rem
100 open1,2,0,chr$( 8 )+chr$(16):get#1,a$:rem rs232 1200bps 8n1 open
110 dimi,a$,as(255),a,s$,d,ds$,z$:z$=chr$(0)
120 gosub520:rem prepare ascii table
200 open2,8,0,"$0:*=s":d=0:ds$=""
210 get#2,a$,a$,a$,a$,a$,a$:rem dir prg-start and disk name start
215 get#2,a$:ifa$<>""thengoto215:rem skip disk name
216 get#2,a$,a$:ifa$=""goto260
220 get#2,a$,a$:rem number of blocks. we don't need this info here
230 get#2,a$
232 if(d=1)and(asc(a$+chr$(0))=34)thend=0:printds$:gosub570
234 if(d=0)and(asc(a$+chr$(0))=34)thend=1
236 if(d=1)and(asc(a$+chr$(0))<>34)thends$=ds$+a$
240 ifa$<>""thenprint"";:goto230
250 get#2,a$,a$:ifa$<>""thend=0:ds$="":goto220
260 close2
270 close1
280 end
499 end
520 fori=32to63:as(i)=i:as(65+i)=33+i:as(33+i)=65+i:next
530 as(7)=7:as(13)=10:as(19)=10:as(17)=10:as(20)=8:as(29)=32:as(64)=64
540 as(10)=13:as(127)=8:return:rem petscii to ascii table
550 rem print#1,chr$(10);
555 fori=1tolen(s$):a=as(asc(mid$(s$,i,1))):print#1,chr$(a);:next
560 print#1,chr$(10);:return
570 s$="cat > "+ds$+".txt":gosub550
575 open3,8,3,ds$+",s,r"
580 get#3,a$:ifst<>64thenprint#1,chr$(as(asc(a$+z$)));:goto580
585 print#1,chr$(4);chr$(10);
590 close3:return
700 get#1,a$:ifa$<>""thenprinta$:goto700
710 return
800 geta$:ifa$<>""thenprinta$;:print#1,chr$(as(asc(a$)));
810 get#1,a$:ifa$<>""thenprintchr$(as(asc(a$)));
815 remget#1,a$:ifa$<>""thenprintasc(a$);" ";as(asc(a$))
820 goto800
5000 rem functions list
5020 rem 520: petscii to ascii table
5030 rem 550: send s$ string in ascii
5040 rem 570: save seq file over rs232
5050 rem 700: listen input channel
5070 rem 800: simple terminal
9999 end
10000 rem ============================
10010 rem =
10020 rem = seq to evernote
10030 rem =
10040 rem = sends seq files in a disk
10050 rem = over rs232 to a linux pc
10060 rem = for further import to
10070 rem = evernote via nixnote prg.
10080 rem =
10090 rem = (c) ilker ficicilar
10100 rem = ilkerf AT geocities dot com
10110 rem = version: 20141021
10120 rem =
10130 rem ============================

I don't know how to do this practically in Windows. It may be possible in the DOS mode using x/y/z modem transfers. However, a simple null-modem cable will not suffice (Windows requires RTS, DTR etc. lines).

In short, the procedure is as follows:

. Run the seq2enote program in the C64 for each diskette.

. The PETSCII SEQ text files in diskettes appear in the given directory in Linux as ASCII .txt text files.

. And, NixNote synchronizes them with Evernote servers.

İlker Fıçıcılar
21.10.2014

Keywords: Networking, Linux, Commodore, Organization


C64 Projects Twitter Page

İlker Fıçıcılar's CBM Page