Commit Graph

421 Commits

Author SHA1 Message Date
Bobbi Webber-Manners
294f77c4e8 Improved status display 2020-06-23 22:50:52 -04:00
Bobbi Webber-Manners
e0c33191c5 POP65 downloads to files now, and has a nice progress spinner 2020-06-23 19:05:44 -04:00
Bobbi Webber-Manners
d72fefa0f4 New version of POP65.c (work-in-progress). Uses Uthernet-II TCP. 2020-06-22 22:40:32 -04:00
Bobbi Webber-Manners
14ccbd1a1d Maybe slightly less slow?? 2020-06-21 23:01:22 -04:00
Bobbi Webber-Manners
1b1e391e32 Started work on POP3 client for ProDOS 2020-06-21 22:21:26 -04:00
Bobbi Webber-Manners
9c5bc1a270 Fixed a file-reading bug 2020-06-21 02:54:41 -04:00
Bobbi Webber-Manners
6858da9747 Print actual timezone in effect after the date/time 2020-06-21 02:31:08 -04:00
Bobbi Webber-Manners
f12af42b16 Automatically determine if ProDOS 2.5 2020-06-21 02:27:11 -04:00
Bobbi Webber-Manners
4fbe994a90 Timezone configuration file TZONE.TXT 2020-06-21 02:19:55 -04:00
Bobbi Webber-Manners
da16e97d00 Improvements to date65: auto-DST support, timezones from file 2020-06-21 02:19:12 -04:00
Oliver Schmidt
e83fe9a9fe Added support using the W5100 with a single socket.
The W5100 has the undocumented feature to wrap around the Address Register on an Auto-Increment at the end of physical address space to its beginning.

However, the only way to make use of that feature is to have only a single socket that uses all of the W5100 physical address space. But having only a single socket by defining SINGLE_SOCKET comes with downsides too:

One mustn't call into IP65 network functions anymore after w5100_config(). Additionally the program doesn't support 'W5100 Shared Access' anymore (https://github.com/a2retrosystems/uthernet2/wiki/W5100-Shared-Access).
2020-05-06 22:37:45 +02:00
Oliver Schmidt
edccf1d1dc Fixed physical address calculation.
The address mask to use is of course dependent on the actual socket memory size.
2020-04-25 23:19:50 +02:00
Oliver Schmidt
f9e28e79b9 Factored out W5100 HTTP client handling.
In order to reduce code duplication for a planned W5100 HTTP client program beside wget65 the W5100 HTTP client code is now available for reuse.
2020-04-20 20:40:28 +02:00
Oliver Schmidt
bbd2906f6f Always return a consistent value. 2020-04-15 21:54:44 +02:00
Oliver Schmidt
6971e9216f Added central error strings. 2020-04-15 14:52:59 +02:00
Oliver Schmidt
a25ed5051f Set disk tool variables to defaults.
If the user fails to set the disk tool variable(s) he now doesn't get syntactically wrong commands but rather file-not-founds. Maybe he even chooses to drop tool(s) into the current directory or add the disk tool path(s) to the PATH variable...
2019-07-15 12:28:27 +02:00
Oliver Schmidt
bcff253678 Bump user visible versions. 2019-05-10 17:47:06 +02:00
Oliver Schmidt
0fb3869716 Added support for the upcoming 'Dracarys' ATARI PBI device.
See https://atariage.com/forums/topic/287376-preannouncement-dragon-cart-ii/
2019-05-08 17:23:00 +02:00
Oliver Schmidt
757d360925 Don't increment string position if nothing was written to the string. 2019-05-07 18:32:46 +02:00
Oliver Schmidt
fe1ea2358d Minor optimization. 2019-05-05 11:37:20 +02:00
Oliver Schmidt
4577c2ab19 Removed Ethernet driver I/O base.
So far the base address of the Ethernet chip was a general property of all Ethernet drivers. It served two purposes:
1. Allowing to use a single Ethernet driver for a certain Ethernet chip, no matter what machine was connected to the chip.
2. Allowing use an Ethernet card in all Apple II slots.

However, we now use customized Ethernet drivers for the individual machines so 1.) isn't relevant anymore. In fact one wants to omit the overhead of a runtime-adjustable base address where it isn't needed.

So only the Apple II slots are left. But this should rather be a driver-internal approach then. We should just hand the driver the slot number the user wants to use and have the driver do its thing.

Independently from the aspect if the driver parameter is a base address or a slot number the parameter handling was changed too. For asm programs there was so far a specific init function to be called prior to the main init function if it was desired to chnage the parameter default. This was done to keep the main init function backward compatible. But now that the parameter (now the slot number) is only used on the Apple II anyhow it seems reasonable to drop the specific init function again and just provide the parameter to the main init function. All C64-only user code can stay as-is. Only Apple II user code needs to by adjusted. Please note that this change only affects asm programs, C programs always used a single init function with the Apple II slot number as parameter.
2019-05-02 14:44:24 +02:00
Oliver Schmidt
43d7d33c31 Removed support for W5100 on the C64.
Now that we have per-target combo driver wrappers we can remove the W5100 support from the C64. There isn't any actual (known) W5100-based solution for the C64.
2019-04-29 16:41:27 +02:00
Oliver Schmidt
6a296b2058 Improved URL selector handling.
parse_url stores the URL selector in the output_buffer - which is currently 520 bytes. A new entry point called parse_url_buffer was added which instead stores the URL selector in a buffer provided by the user.

url_download now calls the new parse_url_buffer instead of parse_url. The buffer for the URL selector is simply the download_buffer. So the download_buffer is used twice: First to hold the URL selector to be sent as request to the server and then to hold the response received from the server.

However, the URL selector still can't exceed the MSS (aka 1460 bytes).

Note: The User-Agent string was shortened by two bytes as that allows a "default" URL (incl. 'http://' but without port number) of exactly 1400 bytes to end up as 1460 bytes URL selector.
2018-11-13 13:19:47 +01:00
Oliver Schmidt
f349ac6bd3 Increased IFTTT webhook key length. 2018-11-07 20:43:20 +01:00
Oliver Schmidt
334bdb88a0 Added Tweet65.
Tweet65 is sample application for triggering an IFTTT maker webhook. If ~450 chars are not enough for the URL then either the IP65 output_buffer needs to be increased or url_parse needs to be modified to use a different buffer. E.g. when called from url_download then the url_download_buffer could be temporarily used to hold the selector.
2018-11-01 14:21:20 +01:00
Oliver Schmidt
5fcfb2beeb Include Apple II specific header only for Apple II. 2018-10-30 20:00:17 +01:00
Oliver Schmidt
63df5ac99e Adjusted line editor to recent change in cc65 CONIO. 2018-09-08 19:38:14 +02:00
Oliver Schmidt
300ca8626a Make use of clock_settime().
clock_gettime(), clock_settime() and clock_getres() were added to the cc65 C libaries the other day.
2018-08-18 23:28:59 +02:00
Oliver Schmidt
56c28694ca Fixed access to argv. 2018-08-06 23:13:22 +02:00
Oliver Schmidt
e7f0b6759b Added download to disk feature.
Beside the code for the actual feature this change introduces analysis of the URL to extract a potential filename to be used for saving. Doing so was a prerequisite for disk download because the filename extension in the URL is the only hint for distinguishing ProDOS sector order disk images from DOS 3.3 sector order images.

So far only the URL input was potentially repeated. Now the file input is potentially repeated as well. For normal file paths there's deliberately still no check. But when entering a drive specifier ("!Sx,Dx") then it is checked for plausibility - and there's an additional confirmation question to keep the user from overwriting the "wrong" disk.

With now having both the URL and file input potentially repeated it became clear that loading and saving the input history shouldn't be repeated - and if the user quits without having entered a valid input the history deliberately isn't saved at all.
2018-08-06 20:33:32 +02:00
Oliver Schmidt
7ac8c55603 First step towards download to disk.
So far we were reading (much) more bytes from the W5100 than necessary when processing the HTTP header. The byte were memmove'd to the beginning of the buffer.

However, when downloading a DOS 3.3 sector order disk image (*.dsk / *.do) then we need to place every DOS 3.3 sector at a certain point in the buffer to avoid additional memcpy's later. Therefore the HTTP header processing mustn't read (or rather commit) any body bytes from the W5100. So we now just check for the "\r\n\r\n" after each and every byte. This is of course less than optimal but small/simple - and the header isn't supposed to be that large anyway.
2018-08-04 13:10:13 +02:00
Oliver Schmidt
66ac29285b Interpret empty input as intend to exit. 2018-08-03 13:58:46 +02:00
Oliver Schmidt
fe215b4eda Added timezone support.
After quite some thoughts it was considered best to simply have the timezone configured in the source code and rebuild if a change is desired/necessary.
2018-08-02 17:37:54 +02:00
Oliver Schmidt
29793d4814 Added (Apple II specific) wget65 program.
IP65 doesn't support TCP flow control. Therefore it doesn't make sense to write a program receiving a significant amount of data via TCP using IP65. From that perspective it makes sense that IP65's HTTP client doesn't allow to handle incoming data with a callback but requires a buffer being able to hold the whole HTTP body.

However, on the Apple II there's the Uthernet II card with its W5100 Ethernet controller chip. That chip has it's own TCP implementation supporting TCP flow control. Therefore the wget65 program uses the W5100 TCP capabilities for the HTTP client.

But even with the W5100 TCP implementation in place IP65 still plays a role for the wget65 program as it desires DHCP and requires (usually) DNS. Both are not supported by the W5100 capabilities.
2018-08-01 19:39:06 +02:00
Oliver Schmidt
dcbe2e002b Enable register variables.
Nowadays register variables are out-of-style. So if they appear in some source code they can be assumed to be explicitly meant for cc65, so don't ignore them.
2018-08-01 19:27:08 +02:00
Oliver Schmidt
cfaa0d7c0d Added generic CL65FLAGS and made use of it.
- Maybe not all Apple II C programs want to use the special I/O buffer setup.
- All Make-target-specific variables should go at the top of the Makefile as they are user settings.
2018-08-01 19:24:12 +02:00
Oliver Schmidt
26648fba7f Allow C programs to override the IP driver library used. 2018-08-01 19:17:53 +02:00
Oliver Schmidt
76843a7737 Allow C programs to consist of multiple source files. 2018-08-01 19:14:52 +02:00
Oliver Schmidt
95f97d807d Renamed object files generated from asm files.
Make sure that 'make' doesn't mix up object files generated from asm files and object files generated from C files.
2018-08-01 19:11:47 +02:00
Oliver Schmidt
b9d6a92534 Minor beautification. 2018-08-01 19:00:38 +02:00
Oliver Schmidt
5f9fe0ad1e Just some minor code style adjustment. 2018-07-23 22:13:32 +02:00
Oliver Schmidt
ee0e11b41f Reduced Apple II binary file sizes.
The Apple II file I/O needs a $400 byte page-aligned buffer for every open file. The default implementation takes those buffers from the heap. However, if a program doesn't use the heap for anything else it is more efficient to place those buffers below the program at $800 by linking iobuf-0800.o and thus avoiding to link any heap code at all. If a program never opens more than one file at a time it can have its start address at $800 + 1 x $400 = $C00.
2018-07-23 14:55:56 +02:00
Oliver Schmidt
29c802c835 Adjusted parameter type to match header file. 2018-07-22 19:35:43 +02:00
Oliver Schmidt
fbdc712e06 Added LOADER.SYSTEM for the Apple II C programs.
It may be useful to be able to run the C programs right from the selector (without loading BASIC.SYSTEM first). Or maybe run them on boot by placing the LOADER.SYSTEM as first file in the root directory.
2018-07-22 16:08:21 +02:00
Oliver Schmidt
8e7454580f Have Date65 set the ProDOS date on the Apple II.
If there's RTC active then the user can at least have the current date set. However, if the machine runs for several days the user needs to re-run Date65.
2018-07-22 15:26:39 +02:00
Oliver Schmidt
3ff1771d4b Added files necessary to build disk images. 2018-07-20 19:12:51 +02:00
Oliver Schmidt
32d5b1e004 Added hack to make HFS65 build on Atari.
The resulting program is defunct!
2018-07-20 18:28:02 +02:00
Oliver Schmidt
9a21f96863 Adjusted to cc65 2.17 which generates AppleSingle files. 2018-03-08 16:12:23 +01:00
Oliver Schmidt
0f6cbffe83 Removed the (defunct) include file dependencies. 2018-02-23 16:59:31 +01:00
Oliver Schmidt
989c35e168 Just append the 65-suffix to all cc65/IP65 apps. 2018-02-23 16:52:45 +01:00
Oliver Schmidt
d4f7569278 Removed last KPR_* constants. 2018-02-23 16:41:33 +01:00
Oliver Schmidt
c89a2ae1ba Adjusted include file extension to ca65 practice. 2018-02-23 16:36:05 +01:00
Oliver Schmidt
b84527c8a3 Removed last KIPPER leftover. 2018-02-23 16:33:21 +01:00
Oliver Schmidt
7090fb5bdd Allow C programs to set the Apple II slot number. 2018-02-22 22:33:47 +01:00
Oliver Schmidt
a07e889d7b Added HttpFileServer65.
HttpFileServer65 is inspired by "HFS ~ Http File Server" (http://www.rejetto.com/hfs/). It features an intuitive mapping of local disks and directories to HTTP paths. This allows to not only navigate to some file but to directly enter some file URL. This is especially usefull for downloads via wget, curl or alike.

However, in contrast to HFS it doesn't allow file uploads, only file downloads. On targets with complete DIO support it additionally allows disk image downloads.

Note: The Atari build currently fails as there's so far no getdevicedir() in the Atari C library.
2018-02-20 00:18:48 +01:00
Oliver Schmidt
a64e08786c Enable lowercase display on the Apple II.
Given that Telnet65's 80 column display requires an enhanced Apple //e anyway it seems reasonable to have the C applications benefit from building for that target too.
2017-11-10 12:01:30 +01:00
Oliver Schmidt
3034150a6e Minor output beautification. 2017-11-10 11:53:27 +01:00
Oliver Schmidt
393e27922b Added first C application :-)
The date application isn't of much actual use. But it shows
- how easy to use the IP65 C API is
- the power of combining IP65 with the C library
  (going from SNTP time format to a date string in two lines of code)
2017-11-09 22:13:42 +01:00
Oliver Schmidt
a40942075d Removed VIC20 application build.
I don't have plans to support VIC20 applications.
2017-11-09 22:10:11 +01:00
Christian Groessler
411b945972 Fix Atari linker config file in "apps" and "test" directories. 2017-10-02 08:05:39 +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
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
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
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
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
357aed74cb Use VT100 for some welcome screen bautification. 2017-06-02 19:00:22 +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
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