dely Posted July 4 Share Posted July 4 I managed to get the right CPU for my Z80 card, so I can finally perform some tests. Most software works flawlessly, but I noticed some strange behaviour in terminal. Take a look at video - you can not use "backspace" because commands are not recognised. However using CTRL+H works - even if screen output is garbled. Quote Link to comment Share on other sites More sharing options...
ivop Posted July 4 Share Posted July 4 (edited) 10 hours ago, dely said: I managed to get the right CPU for my Z80 card, so I can finally perform some tests. Most software works flawlessly, but I noticed some strange behaviour in terminal. Take a look at video - you can not use "backspace" because commands are not recognised. However using CTRL+H works - even if screen output is garbled. AFAIK reifsneiderb didn't implement any terminal emulation. Its keyboard input should map Atari "Delete Back Space" key to ASCII $08. The screen output driver should implement at least the most basic terminal CP/M expects, completely ignoring the Atari E: terminal codes. Writing $08 to the screen should move the cursor one location to the left. Without clearing the character underneath, because that's not what BS used to do back in the day. The "garbage" that you see is CCP writing BS,space,BS to clear the last typed character. Edited July 4 by ivop Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 4 Author Share Posted July 4 10 hours ago, dely said: I managed to get the right CPU for my Z80 card, so I can finally perform some tests. Most software works flawlessly, but I noticed some strange behaviour in terminal. Take a look at video - you can not use "backspace" because commands are not recognised. However using CTRL+H works - even if screen output is garbled. Hello, It's good to see you got the card working! Since I never used CP/M, I am at a disadvantage. If somebody can post some sort of keyboard equates, I'll start making corrections Best Regards, Brian Quote Link to comment Share on other sites More sharing options...
drac030 Posted July 4 Share Posted July 4 (edited) 1 hour ago, ivop said: AFAIK reifsneiderb didn't implement any terminal emulation. Its keyboard input should map Atari "Delete Back Space" key to ASCII $08. The screen output driver should implement at least the most basic terminal CP/M expects, completely ignoring the Atari E: terminal codes. Writing $08 to the screen should move the cursor one location to the left. Without clearing the character underneath, because that's not what BS used to do back in the day. The "garbage" that you see is CCP writing BS,space,BS to clear the last typed character. This is rather funny way to say that the terminal emulation - which is rather crucial in CP/M - is faulty. 1 hour ago, reifsnyderb said: If somebody can post some sort of keyboard equates, I'll start making corrections It is not about the keyboard equates. It is about the display control characters. There are many terminals for CP/M, every one featuring a specific set of control characters. You need to implement a specific terminal, then allow the users to configure their applications for that specific terminal. I recommend Lear Siegler ADM-31, it is quite advanced. Here is the documentation http://bitsavers.org/pdf/learSiegler/ADM_31/DP-211_ADM_31_Users_Manual_May80.pdf Otherwise, you can also try Lear Siegler ADM-3a (aka dumb terminal) or Kaypro 2/4/10 which is its (the dumb terminal's) extension. Good luck, while writing the CP/Emu for Rapidus I found the terminal emulation to be a rather challenging topic. So, don't give up Edited July 4 by drac030 link fix Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 4 Author Share Posted July 4 5 minutes ago, drac030 said: This is rather funny way to say that the terminal emulation - which is rather crucial in CP/M - is faulty. It is not about the keyboard equates. It is about the display control characters. There are many terminals for CP/M, every one featuring a specific set of control characters. You need to implement a specific terminal, then allow the users to configure their applications for that specific terminal. I recommend Lear Siegler ADM-31, it is quite advanced. Here is the documentation https://www.progettosnaps.net/manuals/pdf/adm31.pdf Otherwise, you can also try Lear Siegler ADM-3a (aka dumb terminal) or Kaypro 2/4/10 which is its (the dumb terminal's) extension. Good luck, while writing the CP/Emu for Rapidus I found the terminal emulation to be a rather challenging topic. So, don't give up Ok. What's the simplest terminal emulation to implement that would work? Quote Link to comment Share on other sites More sharing options...
drac030 Posted July 4 Share Posted July 4 (edited) 36 minutes ago, reifsnyderb said: What's the simplest terminal emulation to implement that would work? The dumb terminal, Lear Siegler ADM-3a. EDIT: sorry, bad link to the ADM-31 manual, here is what is possibly a better one http://bitsavers.org/pdf/learSiegler/ADM_31/DP-211_ADM_31_Users_Manual_May80.pdf Edited July 4 by drac030 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 4 Author Share Posted July 4 49 minutes ago, drac030 said: The dumb terminal, Lear Siegler ADM-3a. EDIT: sorry, bad link to the ADM-31 manual, here is what is possibly a better one http://bitsavers.org/pdf/learSiegler/ADM_31/DP-211_ADM_31_Users_Manual_May80.pdf Is this what I am looking for? Quote Link to comment Share on other sites More sharing options...
ivop Posted July 4 Share Posted July 4 The easiest would be ADM-3a: https://vt100.net/lsi/adm3a-om.pdf See table at page 3-5 You need to implement: BS (cursor left, non-destructive) LF (cursor down) VT (cursor up) FF (cursor right) CR (cursor to left margin) SUB (clear screen) ESC (=YX position cursor) RS (home cursor, no clear screen) Other ASCII values < 32 should do nothing (i.e. don't print control graphics characters) You keyboard input should map Atari RETURN (155) to CR (13), DELETE (126) to DEL/RUB (127) or BS(8), and TAB (127) to HT (9). Quote Link to comment Share on other sites More sharing options...
aeberbach Posted July 4 Share Posted July 4 It might be easier to start with something slightly more complicated but also more documented. Such as the VT220 - I have done this in Objective C and it is not too hard to follow and end up with something that passes vttest (and there are parts you can skip if you prefer to aim for VT100 etc.) Quote Link to comment Share on other sites More sharing options...
drac030 Posted July 4 Share Posted July 4 (edited) 2 hours ago, reifsnyderb said: Is this what I am looking for? Table 4.1 is what you're looking for. Every terminal will implement the dumb terminal codes. Then, when asked about, you should choose "dumb terminal" or "Lear Siegler ADM-3a". This is the sort of questions CP/M programs ask, or their configuration utilities. Ctrl/G $07 bell Ctrl/H $08 cursor left Ctrl/I $09 tab Ctrl/J $0a cursor down/line feed Ctrl/K $0b cursor up Ctrl/M $0c carriage return Ctrl/Z $1a clear screen/cursor home Ctrl/^ $1e cursor home As the next step, you could consider implementing the Kaypro terminal codes. It is few codes more than the dumb terminals implement. When done so, you could configure your programs to use either "dumb terminal", "Lear Siegler ADM-3a" or "Kaypro 2/4/10". Ctrl/W $17 clear to end of screen Ctrl/X $18 clear to end of line The Lear Siegler ADM-31 implements all of the ADM-3a plus 16 additional Esc sequences described in the documentation. Once you implement them, you can configure your programs as using the Lear Siegler ADM-31 terminal. EDIT: here is the Wordstar 3.0 terminal menu. WeLcOmE tO tHe Cp/M! Edited July 4 by drac030 4 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 5 Author Share Posted July 5 (edited) @drac030 and/or @ivop Any thoughts on how to handle the CR/LF situation? It appears that CP/M sends a CR/LF separately. But the Atari doesn't handle the situation very well. Then, I am using E:, as well. The closest I have is a Return ($9B) which does both the CR/LF together. Thanks! Edit to add: My temporary solution is to ignore line feeds and only process carriage returns. I did get the delete back space key working under many circumstances. Edited July 5 by reifsnyderb Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted July 5 Share Posted July 5 line feed is cursor movement down, (CTRL DOWN ARROW). Carriage return is jump to beginning of line. CR LF is those two in that order. Atari Return does the same thing all at once but also is immediate mode execution. So process then independently when alone and as Atari Return when together. Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 5 Author Share Posted July 5 23 minutes ago, _The Doctor__ said: line feed is cursor movement down, (CTRL DOWN ARROW). Carriage return is jump to beginning of line. CR LF is those two in that order. Atari Return does the same thing all at once but also is immediate mode execution. So process then independently when alone and as Atari Return when together. Ok. What do I send to E: to do this? i.e. For a line feed, CP/M sends $0A. So I can use a $1D. However, for a carriage return CP/M sends an $0D. Using $9B clearly isn't the answer and I don't see anything I can send to E: that can just move the cursor to the left side of the screen. I've started using tables to make these translations. What do I use instead of $9B? ;DB $0A,$1D ; LF - Line Feed (Move cursor down one space) ;DB $0D,$9B ; CR - Carriage Return (Move cursor to beginning of line) Quote Link to comment Share on other sites More sharing options...
+kheller2 Posted July 5 Share Posted July 5 SHIFT F3 (whatever that is) does it. Code $90? Quote Link to comment Share on other sites More sharing options...
cathrynm Posted July 5 Share Posted July 5 1 hour ago, reifsnyderb said: Ok. What do I send to E: to do this? i.e. For a line feed, CP/M sends $0A. So I can use a $1D. However, for a carriage return CP/M sends an $0D. Using $9B clearly isn't the answer and I don't see anything I can send to E: that can just move the cursor to the left side of the screen. I've started using tables to make these translations. What do I use instead of $9B? ;DB $0A,$1D ; LF - Line Feed (Move cursor down one space) ;DB $0D,$9B ; CR - Carriage Return (Move cursor to beginning of line) $9B,$1C -- maybe? Do a CR, and then up arrow one line so it stays on the same line? Would cause cause chaos at the bottom of the screen, but maybe close enough? Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 5 Author Share Posted July 5 1 hour ago, kheller2 said: SHIFT F3 (whatever that is) does it. Code $90? I'll need the ATASCII code, if it exists. So far, the ATASCII codes for the arrows don't appear to be it. Whatever it is, it needs to go through the CIO E: handler. Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 5 Author Share Posted July 5 1 hour ago, cathrynm said: $9B,$1C -- maybe? Do a CR, and then up arrow one line so it stays on the same line? Would cause cause chaos at the bottom of the screen, but maybe close enough? I thought about this but it makes it more difficult in many ways. If I have the ATASCII code, it will be easy. I am hoping that somebody can point me in the right direction. Otherwise, it could be days worth of screwing around with this. (I already spent a day at it.) Quote Link to comment Share on other sites More sharing options...
ivop Posted July 6 Share Posted July 6 (edited) The arrow codes should work to move the cursor left/right/up/down but they wrap at the edges which is not what you want. There is no ATASCII code to go to the beginning of the line. Also note that the delete line code (156) may delete one, two or three lines, depending on where it thinks you are in the 120 character line. The E: handler will constantly be working against you, and it's slow (80 columns might be faster, I don't know, but 40 columns E: is slooow). You'll be better off writing your own screen driver. If you really insist on going through CIO, you could try keep track of the cursor location yourself and start fiddling with ROWCRS/COLCRS to change the cursor position each time before you print a character. I don't know if the 80 column handler supports that. Edited July 6 by ivop 2 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 6 Author Share Posted July 6 2 hours ago, ivop said: The arrow codes should work to move the cursor left/right/up/down but they wrap at the edges which is not what you want. There is no ATASCII code to go to the beginning of the line. Also note that the delete line code (156) may delete one, two or three lines, depending on where it thinks you are in the 120 character line. The E: handler will constantly be working against you, and it's slow (80 columns might be faster, I don't know, but 40 columns E: is slooow). You'll be better off writing your own screen driver. If you really insist on going through CIO, you could try keep track of the cursor location yourself and start fiddling with ROWCRS/COLCRS to change the cursor position each time before you print a character. I don't know if the 80 column handler supports that. Thanks! I'll take another look at the arrow codes as they seem to be a compromise. Both the standard 40 column display and 80 column card have their own E: handler. So, it makes some sense to try to use what already exists. Most likely, the 80 column card solutions would work best, anyhow, as CP/M appears to have been written for 80 column displays. (The 40 column output is a little "jumbled".) I checked through some of the previously disassembled original code and it doesn't look like Atari dealt with this, either. Quote Link to comment Share on other sites More sharing options...
drac030 Posted July 6 Share Posted July 6 18 hours ago, reifsnyderb said: Any thoughts on how to handle the CR/LF situation? There are no corresponding ATASCII characters, but you can do that on E: provided that you have control on the cursor position variables ($55, $54). CR is "cursor to left margin", so: crscol=lmargn (lda $52 sta $55), then, to make the cursor actually appear there, do something that is virtually a NOP, e.g. send ATASCII characters "cursor right", then "cursor left" ($1F, $1E). LF looks more complicated, I would try this: check if the cursor is in the last line (i.e. if peek($54) = 23, or better if peek($54) = peek($2bf)-1). If not, just send ATASCII cursor down ($1D). If it is, save the X position ($55), send EOL, restore the X position, do cursor right, cursor left. 3 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 6 Author Share Posted July 6 5 hours ago, drac030 said: There are no corresponding ATASCII characters, but you can do that on E: provided that you have control on the cursor position variables ($55, $54). CR is "cursor to left margin", so: crscol=lmargn (lda $52 sta $55), then, to make the cursor actually appear there, do something that is virtually a NOP, e.g. send ATASCII characters "cursor right", then "cursor left" ($1F, $1E). LF looks more complicated, I would try this: check if the cursor is in the last line (i.e. if peek($54) = 23, or better if peek($54) = peek($2bf)-1). If not, just send ATASCII cursor down ($1D). If it is, save the X position ($55), send EOL, restore the X position, do cursor right, cursor left. I was thinking that the E: handlers didn't bother with CRSCOL and others. So, I checked both the OS and 80 column card and they use these values. I am working on code to use these values. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 6 Share Posted July 6 As people have mentioned, you're going to run into problems with the way that the Display Handler emulates longer logical lines on top of physical lines. In addition to Delete Line deleting logical lines instead of physical lines, it'll also push down lines when printing characters off the right margin, since it extends the logical line to up to 3 physical lines. 80 column handlers also differ in the handling of this; the XEP80 for instance, has no limit on logical line length. 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted July 7 Share Posted July 7 ACE80's E: handler implements logical lines of just 80 columns. I never heard any complaints. 3 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted July 12 Author Share Posted July 12 Latest boot disk and code. The code is GPL'd. I'll be releasing the development environment soon. Boot disk: cpm10f.atr Source code to boot disk I/O code and CP/M BIOS: atariio.asm CBIOS.asm 2 Quote Link to comment Share on other sites More sharing options...
sup8pdct Posted July 12 Share Posted July 12 I don't know if this will help any. Here is character translation tables from original atari cpm boot disk Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................ 00000010 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................ 00000020 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F !"#$%&'()*+,-./ 00000030 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>? 00000040 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO 00000050 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_ 00000060 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F ` abcdefghijklmno 00000070 70 71 72 73 74 75 76 77 78 79 7A 0B 7C 0C 08 09 pqrstuvwxyz.|... 00000080 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F €.‚ƒ„…†‡ˆ‰Š‹Œ.Ž. 00000090 90 91 92 93 94 95 96 97 98 99 9A 0D 9C 9D 9E 9F .‘’“”•–—˜™š.œ.žŸ 000000A0 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF ¡¢£¤¥¦§¨©ª«¬®¯ 000000B0 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF °±²³´µ¶·¸¹º»¼½¾¿ 000000C0 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ 000000D0 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß 000000E0 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF àáâãäåæçèéêëìíîï 000000F0 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD 7F FF ðñòóôõö÷øùúûüý.ÿ 00000100 00 01 02 03 04 05 06 FD 7E 7F 1D 7B 7D 9B 0E 0F .......ý~..{}›.. 00000110 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................ 00000120 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F !"#$%&'()*+,-./ 00000130 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0123456789:;<=>? 00000140 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ABCDEFGHIJKLMNO 00000150 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F PQRSTUVWXYZ[\]^_ 00000160 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F ` abcdefghijklmno 00000170 70 71 72 73 74 75 76 77 78 79 7A 5B 7C 5D 5E FE pqrstuvwxyz[|]^th 00000180 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F €.‚ƒ„…†‡ˆ‰Š‹Œ.Ž. 00000190 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F .‘’“”•–—˜™š›œ.žŸ 000001A0 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF ¡¢£¤¥¦§¨©ª«¬®¯ 000001B0 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF °±²³´µ¶·¸¹º»¼½¾¿ 000001C0 C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ 000001D0 D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß 000001E0 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF àáâãäåæçèéêëìíîï 000001F0 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF ðñòóôõö÷øùúûüýthÿ 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.