Commit Graph

524 Commits

Author SHA1 Message Date
Oliver Schmidt
7af0dcd1fa Moved ip65_process directly to data processing.
Now that we process incoming data from the main loop - and use 'buf' both for incoming and outgoing data we should of course make sure that we never trash the incoming data with outgoing data.
2017-11-07 22:57:15 +01:00
Oliver Schmidt
d059cf858a Don't try to get new data while still processing previous data. 2017-11-06 23:40:05 +01:00
Oliver Schmidt
9a8ba804bc Added C interface to TCP functions. 2017-11-06 23:36:44 +01:00
Oliver Schmidt
c4f5c7dbfc Made C program more robust.
The C test program may serve as copy & paste templates so it should make clear that ip65_process() is supposed to be called pretty regularly. Additionally it isn't supposed to be called recursively meaning that recv callbacks need to return quickly and defer longer processing.
2017-11-06 23:23:00 +01:00
Oliver Schmidt
c6efcebf97 Added C interface to timer handling. 2017-11-05 23:16:34 +01:00
Oliver Schmidt
3c9ab2eb5f Added C interface to abort key control. 2017-11-05 22:55:55 +01:00
Oliver Schmidt
6680772b04 Introduced C interface to IP65.
The IP5 usage of ld65 segments and zeropage variables was made compatible with cc65 C programs already a while ago. This commit is the next logical step which is to introduce the actual C interface to IP65.

IP65 for C programs shares the the ip65.lib / ip65_tcp.lib with IP65 for assembler programs. However the various libraries from the 'drivers' are not reused. Instead there's exactly one library for every target named ip65_<target>.lib. Those libraries contain only functions used by ip65.lib / ip65_tcp.lib.

TODOs:

- Introduce c64_timer.s and atr_timer.s.
- Add a C interface to the rest of the IP65 functionality (especially TCP).
2017-11-05 14:28:49 +01:00
Oliver Schmidt
32a66c5d7c Moved httpd.slotscan to ip65test.dsk and dropped ip65demo.dsk.
Now that with Telnet65 there is a "real" application there's no point anymore in the
ip65demo.dsk. Therefore httpd.slotscan is now part of the ordinary ip65test.dsk.
2017-11-04 00:40:35 +01:00
Oliver Schmidt
b6a6a2f66f Renamed 'tcp' to 'math' as the name 'tcp' will be needed soon. 2017-11-04 00:25:09 +01:00
Oliver Schmidt
23ae6c155b Adjusted comment to (surprising) reality. 2017-10-29 00:08:33 +02:00
Oliver Schmidt
ce98f5d738 Removed obsolete test. 2017-10-28 23:01:28 +02:00
Oliver Schmidt
90c83387f2 Removed unused stuff. 2017-10-27 22:56:04 +02:00
Christian Groessler
244df7212e test/vt100.s: add comments and a line with "line drawing" characters 2017-10-11 23:41:16 +02:00
Christian Groessler
411b945972 Fix Atari linker config file in "apps" and "test" directories. 2017-10-02 08:05:39 +02:00
Oliver Schmidt
6ae6037549 Merge pull request #4 from groessler/something_to_pull
c64: fix latency
2017-10-01 20:12:52 +02:00
Christian Groessler
fc4a2aab96 c64input.s: fix latency when typing 2017-09-30 16:17:07 +02:00
Christian Groessler
6e82e722ad Revert "c64input.s: fix stray cursor image in host and port entry"
This reverts commit 03b2579e33.
2017-09-30 15:57:30 +02:00
Oliver Schmidt
8b3c53ee67 c64input.s: fix stray cursor image in host and port entry
This introduces some latency when typing in host name and port. But
I think that's acceptable. (reverted from commit 36369fb714)
2017-09-30 14:57:18 +02:00
Christian Groessler
7145c4e8a0 c64input.s: fix stray cursor image in host and port entry
This introduces some latency when typing in host name and port. But
I think that's acceptable.
2017-09-29 15:47:44 +02:00
Christian Groessler
78864d2c56 atrvt100.s: use ADRESS instead of xVector variable
This was probably an artifact from early stages of porting to the
Atari. Problem manifested itself e.g. when hitting DEL in the middle
of a 'bash' input line.
The change also includes some cleanups as suggested by Oliver.
2017-09-25 23:40:55 +02:00
Christian Groessler
0c0fd3f397 atrtimer.s: initialize the interrupt variables before enabling the interrupt 2017-09-25 17:07:25 +02:00
Christian Groessler
7652194703 atrtimer.s, vic20timer.s: use decimal mode in interrupt handler
Using decimal mode (SED/CLD) reduces the memory footprint and execution time
of the interrupt routine. Some comments were added or fixed, too.
2017-09-24 02:29:42 +02:00
Christian Groessler
2685d01fe5 Adapt Atari timer code to PAL systems.
The vertical blank interrupt (which is used by the timer) runs with
60Hz on NTSC systems and 50Hz on PAL systems.
This commit also clears 'vbichain' in 'timer_exit', so a subsequent
'timer_init' would do the right thing.
2017-09-12 14:14:14 +02:00
Christian Groessler
e87fbb6111 atrvt100.s: remove a superfluous test introduced in last commit
The same test is eventually done in PrnChr.
2017-09-12 13:41:59 +02:00
Christian Groessler
12d66a2bd0 Atari: add line-drawing chars in font.
Also adds a check for valid ASCII char (<= 0x7f) in ProcIn, and fixes
two typos in a2vt100.s.
2017-09-11 23:35:16 +02:00
Christian Groessler
9fce65d948 atrvt100.s: remove spurious "jsr SLV"s
They were an artifact of previous tests.
2017-09-04 22:23:49 +02:00
Christian Groessler
96cfc32511 Atari: fix stray cursor image when connecting to BSDs.
FreeBSD and NetBSD, at least, have a banner message when you telnet into them
which has an empty line as first line. On those systems, an old "cursor" char
was visible at the top of the login prompt message.
This is fixed by enabling and disabling the cursor in 'get_key' while waiting
for a key press.
2017-09-04 20:03:50 +02:00
Christian Groessler
0a546a7eef Add custom font for the Atari version, fix Atari keyboard input handling. 2017-09-01 22:36:35 +02:00
Oliver Schmidt
a4552b0e34 Improved cursor handling consistency.
So far most of the time the cursor drawing was handled with a 'jsr COff - jsr COn' bracket around the drawing code. However in the area of screen erasing a different approach was used - which caused subtile issues.

4d729ec839 already fixed (most ?) of those issues for the Apple II and the ATARI. However it broke the approach 'jsr COff - jsr COn' brackets.

This is now adjusted - for all machines.
2017-08-30 20:04:57 +02:00
Oliver Schmidt
26e57930a0 Some minor changes.
In order to manage upcoming changes relevant to all machine types it's important that the files are easy to diff. This change improves the similarity between a2<...>.s and atr<...>.s.
2017-08-28 20:50:44 +02:00
Oliver Schmidt
981e3bb5f7 Merge pull request #3 from groessler/something_to_pull
Add VT100 driver for Atari.
2017-08-28 15:46:55 +02:00
Oliver Schmidt
9f611c5c1e Allow Telnet65 to send ASCII code 0 - on the C64.
Lars informed me that $F142 by default produces ASCII code 0 via Ctrl-@. One just needs a way to distinguish it from the no-key-press.

This means that the further processing can be done in that same as on the Apple II - meaning to just replace in the VT100 keyboard translation table $00 with $FF as code for ignore-key.
2017-08-20 20:58:49 +02:00
Christian Groessler
c6aaa3566f use $ff, $fe, etc. for special keys in the Atari version 2017-08-18 02:06:58 +02:00
Christian Groessler
9e3642c589 resolve conflicts with 'master' 2017-08-18 01:03:02 +02:00
Oliver Schmidt
3541c20ba2 Fixed sequence number of initial TCP ACK packet on tcp_connect.
So far the sequence number for the first packet after the initial SYN packet was calculated directly before returning from tcp_connect. This is however far to late as the ACK packet to be send as response for the SYN,ACK packet sent by the server already needs that sequence number. Therefore it is now calculated right after a successful reception of the SYN,ACK packet is detected.
2017-08-12 17:02:56 +02:00
Oliver Schmidt
463904988b Use symbols instead of hard coded constants for screen dimensions MkII. 2017-08-09 21:50:23 +02:00
Oliver Schmidt
39f83b7709 Allow Telnet65 to send ASCII code 0 - on the Apple II.
Chris made me aware that ASCII code 0 actually is a valid character (usually entered as Ctrl-Space or Ctrl-@) and that it is actually used (i.e. by EMACS).

The Apple II allows to natively enter the ASCII code 0 via Ctrl-@. However so far get_key_if_available returned 0 in accumulator to signal that no key was pressed. In order to allow the Apple II get_key_if_available to return the ASCII code 0 in the accumulator I changed it to use the carry flag to signal that no key was pressed.

Because get_key_if_available needs of course to behave the same on all targets I changed the other implementations to use the carry flag too.

Unfortunately I don't know enough about input capabilities of the C64 to decide on how to best get Telnet65 to send ASCII code 0 there.
2017-08-09 21:27:28 +02:00
Christian Groessler
e2b58b0683 Add VT100 driver for Atari.
A special font will be needed for best user experience. This is not
included yet.
2017-08-02 23:25:00 +02:00
Oliver Schmidt
0ecc367b85 No need to split the help screen. 2017-08-02 20:45:34 +02:00
Oliver Schmidt
c731544dbf Minor sytle adjustment. 2017-08-02 14:29:27 +02:00
Oliver Schmidt
df239024ed Merge pull request #2 from groessler/something_to_pull
a2vt100.s: use symbols instead of hard coded constants for screen dimensions
2017-08-02 14:24:55 +02:00
Oliver Schmidt
eac9bfbec2 Resurrected help screen from CaTer. 2017-08-02 14:18:50 +02:00
Christian Groessler
2b858bf7df a2vt100.s: use symbols instead of hard coded constants for screen dimensions. 2017-08-02 14:09:38 +02:00
Oliver Schmidt
6717fb7bc0 Actively redraw cursor.
On the C64 the cursor is flashing (driven by a timer interrupt routine). So in order to have the cursor appear all it takes is to make sure that the interrupt routine:
- understands that it should actually work on the cursor
- has a correct understanding about what char is "under" the cursor

On the Apple II on the other hand the cursor has always to be actively drawn. Therefore all the places where the C64 code just updates the char under the cursor the Apple II code needs to actually draw the cursor.

We learned this the hard way with 'nvi'. When pressing <enter> in insert mode it sends the following data:

0d 00 1b 5b 31 42 1b 5b 4b

This means to return the cursor (to col 1), do nothing, then move it down 1 row and finally remove all chars from the cursor to the end of the line. The latter is one of the instances requiring to actively redraw the cursor (when set to be visible) as it was removed (when set to be visible).
2017-08-01 20:54:11 +02:00
Oliver Schmidt
deb972cd98 Bump version to 1.1 2017-06-05 20:54:43 +02:00
Oliver Schmidt
91bd4db939 Mark connection as closed on send error.
I would have expected that no matter what causes the TCP connection to be closed would be reported as a TCP call back with lenghth = -1. However there are scenarios where this isn't true. I.e. when the user aborts during a blocking TCP retransmit opration. I'm unsure if this behaviour is to be considered a bug or if this is by some design I don't understand.

So I opted to not change that behaviour but rather add an explicit check for tcp_send returning with an error indicating that the connection is closed. This way the users gets noticed on the closed connection at least on his next key press.
2017-06-05 18:21:59 +02:00
Oliver Schmidt
bcf581ed19 Normalize VT100 state on disconnect.
In order to avoid strange display effects on a potential next connection we normalize the character set and the display attributes on disconnect.
2017-06-05 17:41:41 +02:00
Oliver Schmidt
dd660e7159 Disable IP65 abort key during active connection.
It might be welcome to be able to abort DHCP, DNS and TCP connect operations. However while we're connected to the remote host we need full control over the keyboard. If TCP send operations don't work immediately the user will just have to wait until they do (or the timeout).
2017-06-05 17:24:26 +02:00
Oliver Schmidt
a987c40490 Allow to influence the user abort check.
It's imho in general a pretty unfortunate design to have IP65 check the keyboard during blocking operations. Rather it should call back into the application and have that decide what type of user abort it wants to offer.

Anyhow I don't want to change all that - at least not now. Therefore I just added the option to influence which key is considered the abort key - and provide a key value that isn't actually used and as such disables the abort check.
2017-06-05 17:20:27 +02:00
Oliver Schmidt
af4fb5a90b Allow Apple II slot setting.
The user can set the Apple II slot of his Ethernet card by patching the fourth byte of the binary.
2017-06-04 00:13:08 +02:00