Commit Graph

79 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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