Commit Graph

490 Commits

Author SHA1 Message Date
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
Oliver Schmidt
9fb964c828 Generalized Apple II slot setting.
In order to allow setting the Apple II slot from host computer independent code the slot setting function was renamed and dummies were added for the other host computers.
2017-06-04 00:10:36 +02:00
Oliver Schmidt
22bac4665e Some minor comment fixes. 2017-06-03 13:36:50 +02:00
Oliver Schmidt
357aed74cb Use VT100 for some welcome screen bautification. 2017-06-02 19:00:22 +02:00
Oliver Schmidt
70f6f06e0f Some minor (style) fixes. 2017-06-02 18:55:27 +02:00
Oliver Schmidt
22d6ff26c2 Some minor style fixes. 2017-05-29 22:26:38 +02:00
Oliver Schmidt
127f3031aa Map C64 F1-F8 keys to terminal keys.
The VT100 has (P)F1-(P)F4 keys. The C64 F1-F4 keys are mapped them. Additionally the C64 F5-F8 keys are mapped to the XTERM F5-F8 keys. However as we pretend to be a VT100 applications tend to ignore them.
2017-05-29 21:35:41 +02:00
Oliver Schmidt
ec848d7369 Added VT100 SCS (Select Character Set) capability.
Apple II: The MouseText chars only allow for a partial representation of the VT100 Special Graphics glyphs. Additionally the MouseText chars are not available for reversed video.

C64: The VT100 Special Graphics repurposes the ASCII(!) code points $60-$7f. And the C64 custom font used places them on the same code points. Therefore it makes sense to "tunnel" them through the usual ASCII->PETSCII->ScreenCode processing pipeline by moving them as-is to otherwise unused PETSCII code points ($80-$9f).
2017-05-25 15:46:21 +02:00
Oliver Schmidt
dabb02c638 Removed Latin-9 support.
The currently used font doesn't contain any Latin-9 glyphs so it doesn't make sense to try to process Latin-9 chars. Instead now only 7-bit ASCII chars are processed - as the original VT100 does. Setting LANG=C in the host shell should make programs aware of the fact that only 7-bit ASCII chars are to be generated.
2017-05-24 00:41:54 +02:00
Oliver Schmidt
7d50e73b5b Streamlined display character selection.
The reverse characters of the alternate char set are place in a somewhat strange arrangement in the Apple II character ROM. This is because of backward compatibility with the standard char set. Therefore it seems more efficient and hopefully easier to understand to use a table to select them.
2017-05-23 23:56:57 +02:00
Oliver Schmidt
c7b1c77367 Some minor (style) fixes. 2017-05-22 21:28:14 +02:00
Oliver Schmidt
9362e6d00c Fixed Cursor Control Key Codes.
http://vt100.net/docs/vt100-ug/table3-6.html says that ESC O A..D is to be send if Cursor Key Mode is set and http://vt100.net/docs/vt100-ug/chapter3.html says "A mode is considered set until it is reset by a reset mode (RM) control sequence.". So ESC O A..D is the default.

Beside this spec perspective sending ESC O A..D instead of ESC [ A..D makes i.e. aptitude and midnight commander work out-of-the-box.
2017-05-22 00:41:42 +02:00
Oliver Schmidt
29587a1ebe Avoid unnecessary timeout checks.
On the Apple II the timer_read function is actually a delay function. Therefore we want to avoid calling it if we're busy processing incoming data. Fortunately timer_read is only necessary to trigger a TCP keep alive message. But if we're busy processing incoming data then we for sure need no TCP keep alive. So we simply mark if we just processed incoming data and skip the timeout check.
2017-05-21 22:39:10 +02:00
Oliver Schmidt
7586cc1651 Added font for C64 VT100.
The commit e1a29ae411 was missing the font file. It sports the VT100 'special graphics and line drawing' glyphs in the chars $60-$7F. However so far the code to make use of them isn't implemented.
2017-05-20 21:41:18 +02:00
Oliver Schmidt
579b6f3334 Added VT100 test.
Re-added VT100 test that was created for KIPPERTERM development. Not very usefully as-is but a good template for any offline VT100 rendering test/debugging.

Additionally the disk images were renamed to distinguish them from the disk images created in the apps directory.
2017-05-19 00:17:38 +02:00
Oliver Schmidt
3359061ce2 Added Telnet65 app.
The file telnet.s in the 'ip65' directory for sure wasn't belonging into a library as it contained a main loop. So I introduced an 'apps' directory for actual apps coming with IP65. The file telnet.s was moved to apps, renamed telnet65.s and heavily modified.

The file c64vt100.s was made up from several files taken from CaTer (www.opppf.de/Cater) and adjusted for the new use case. The was done before for KIPPERTERM. However this time I deliberately avoided unnecessary code reformatting to allow for as easy as possible integration of potential upcoming changes in CaTer.

The file a2vt100.s was copied from c64vt100.s and adjusted to the monochrome 80 column screen of the Apple //e. Again unnecessary code changes were avoided to allow to easily merge upcoming changes from c64vt100.s.

The files atrvt100.s and vic20vt100.s are for now just dummies to allow to successfully link Telnet65. Work for an actually functional Telnet65 would start with a copy of c64vt100.s (as it was done with a2vt100.s).
2017-05-19 00:12:42 +02:00
Oliver Schmidt
ae69fe0a77 Added get_filtered_input for the ATARI.
The code is totally(!) untested but added for now to just make programs link that refer to it.
2017-05-18 23:48:15 +02:00
Oliver Schmidt
860be3357e Adjusted to commit 3d5dd29988 2017-05-18 23:23:03 +02:00
Oliver Schmidt
23381c5f0a Have get_key display a cursor.
On the Apple II this is already the case. The ATARI would need to be checked.
2017-05-16 23:44:04 +02:00
Oliver Schmidt
48efd846f5 Allow lower case input too.
The ][ doesn't have lower case but the //e defaults to lower case so we need to allow both upper case and lower case (and convert to lower case before DNS lookup).
2017-05-16 22:56:38 +02:00
Oliver Schmidt
e3b941008c Fixed error value.
So far the error value was set to KPR_ERROR_TIMEOUT_ON_RECEIVE on negative answer from the DNS server. Now KPR_ERROR_DNS_LOOKUP_FAILED (which was already defined) is set.
2017-05-15 22:09:10 +02:00
Oliver Schmidt
1a5bd8c7e5 Fixed ARP setup.
In general I consider the approach of a netmask length a typical case of over-optimzation - incl. the typical downside of an "unnecessary" bug. However as the optimization is already present I opted to not remove it but rather fix the bug:

So far the gateway was in usual environments only used if the target IP address differed already in the first byte from the local net IP addresses. Now the gateway is used correctly - even for i.e. the address 192.168.1.1 from the local net  192.168.0.x
2017-05-15 21:20:51 +02:00
Oliver Schmidt
3193774a31 Use actual Delete key for delete (too). 2017-05-12 13:30:02 +02:00
Oliver Schmidt
2566a26253 Some minor changes. 2017-05-07 20:53:04 +02:00
Oliver Schmidt
344d76829a Made get_key_if_available actually work.
On the A2 get_key deletes any already pressed key. Therefore it's a bad idea(tm) to call it to retrieve the key detected in get_key_if_available. So now get_key_if_available insteads retrieves the key on its own via direct hw access. This was already done the very same way in check_for_abort_key. And apart from not working as expected the benefit of get_key displaying a cursor wasn't useful here anyway because get_key was supposed to return right away with the pressed key so the cursor wouldn't have been visible at all.
2017-05-03 20:51:06 +02:00
Oliver Schmidt
9dd014cded Replaced jsr get_key_ip65 with jsr get_key.
- The C64 variant already used get_key and I don't see a reason why the A2 has different requirements when it comes to the question when it is necessary to call ip65_process.

- On the A2 get_key does display a cursor while get_key_ip65 does not. However get_filtered_input is used to get a string of characters. This is exactly the scenario asking for a cursor.
2017-05-03 20:39:59 +02:00
Oliver Schmidt
fccc7e2dc2 Some minor changes. 2017-05-02 20:39:27 +02:00
Oliver Schmidt
09a98a6372 Adjusted test to recent change.
c9b309eff4 changed tftp_filename from zeropage to absolute.
2017-05-02 20:36:58 +02:00
Oliver Schmidt
8745021d7d Avoid trash of zero page variable.
It's not save to presume any zero page variable to stay intact after using the Ethernet drivers to perform actual network I/O. In example a necessary ARP lookup may require network I/O in not anticipated scenarios. Therefore the tftp_filename is rather to be placed in a normal variable and copied to a zero page variable just-in-time.
2017-04-10 09:06:18 +02:00
Oliver Schmidt
39975cab33 Switched from DOS3.3 to ProDOS for IP65demo.dsk
With ProDOS 2.4.1 there's now a nice universal ProDOS - and testing/showcasing compatibility with 'Uther II Drive' requires ProDOS...
2016-10-16 23:51:53 +02:00
Oliver Schmidt
c4f196c71b Check for W5100 first.
Check first for a W5100 as checking for the CS8900A / LAN91C96 on similiar ports accidentally screws up a potential W5100 shared access (https://github.com/a2retrosystems/mxp/wiki/W5100-Shared-Access).
2016-09-18 17:57:13 +02:00
Oliver Schmidt
aea88482dd Added compatibility with W5100 shared access.
If the setup of socket 0 to 3 with 4+2+1+1KB is detected then the W5100 is _not_ initialized, otherwise it does set up socket 0 and 1 with 4KB each. Either way socket 0 is used - now with 4KB instead of 8KB as before.
2016-04-05 20:55:45 +02:00
Oliver Schmidt
f878fa8709 Adjusted to recent cc65 linker config changes. 2016-03-30 16:06:45 +02:00
Oliver Schmidt
ac653f55bd Removed W5100 demo code.
The W5100 demo programs are now available at https://github.com/oliverschmidt/uthernet
2016-02-13 18:34:38 +01:00
Oliver Schmidt
51abda7b8d Fixed comment. 2015-11-23 20:42:43 +01:00