+TheBF Posted September 3, 2022 Share Posted September 3, 2022 I had been threatening to try this for some time so it was time to get off the pot. Are there any people here that use vi regularly? I only used it when I had touch up a script on a UNIX system now and then, but I know some people love it or the improved version vim. This is a dumbed down preliminary version of a vi replica with a few differences because there is no O/S under it Rather, I use Forth as the command shell and as a safe place to bomb to, when there's an error. WARNING: This is only a 40 column editor. It can load files with 80 column records but it doesn't edit them and will mess them up if you try. I ignored the screen shuttling for 80 columns to get something going quicker and to see if it was practical my own projects. 40 columns is used for the Wycove Forth editor but it uses 1K block files. vi is an interesting project for Forth because it is an interpreter controlled system. I re-purpose the Forth interpreter for the job. This means that vi commands that take a leading numeric argument, need a space after the number and then the command. So far I only implemented G (go to line#) For better or worse vi99 starts at line 0. If that's a bad thing let me know and I will change it. Also to distinguish between command and insert mode I change the text color. Green command mode. Gray insert mode. Anyway I would appreciate someone else besides me beating it up. vi99 needs the Editor/Assembler cartridge. The zip file has the two binary files and a pdf with instructions for the supported functions. Cut/copy/paste is on the agenda and then a search/replace function. (I can dream a little can't I?) vi99.zip 9 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/ Share on other sites More sharing options...
+dhe Posted September 4, 2022 Share Posted September 4, 2022 Seems to work pretty true to VI, but not the later ease of use features found in VIM. Getting used to the command mode, vs insert mode, vs up case, lower case requires some thought, all though the green / white combo is very effect for letting you know what mode you are in. All and all - really kewl - great job! - tested under classic99. 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5117774 Share on other sites More sharing options...
+TheBF Posted September 4, 2022 Author Share Posted September 4, 2022 Thanks very much for giving it a spin. Yes VIM might be a stretch although I do have 8K RAM left. I looked it up and VI for i386 was 160Kbytes! So for a 16 bit machine that might come in at 80Kbytes or so? I am doing a bit better with ~13K. (which includes the text labels) I am working on getting a copy paste thing going. That will make it somewhat useable. Not sure how hard to pursue the 80 records on 40 column screen thing. We shall see... 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5117786 Share on other sites More sharing options...
+mizapf Posted September 4, 2022 Share Posted September 4, 2022 I've always been dreaming of a vi for MDOS; it's on my list of projects, but on a very low priority. Yes, and I'm using vim in Linux every day. As I sometimes say, I'm done editing with vi when your super-editor XY is still loading its splash screen. 1 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5117863 Share on other sites More sharing options...
+TheBF Posted September 4, 2022 Author Share Posted September 4, 2022 18 minutes ago, mizapf said: I've always been dreaming of a vi for MDOS; it's on my list of projects, but on a very low priority. Yes, and I'm using vim in Linux every day. As I sometimes say, I'm done editing with vi when your super-editor XY is still loading its splash screen. What does it take to emulate the platform that runs MDOS? Is that GENEVE? Might be able to port this project to give you a partial vi that fits in a smaller footprint. Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5117870 Share on other sites More sharing options...
+mizapf Posted September 4, 2022 Share Posted September 4, 2022 The interesting thing would be to use the memory management of GeneveOS to allow for large files to be edited. I'd be interested in the underlying data structures (gap buffer, rope etc.). (Usage of terms: I call the whole OS of the Geneve the GeneveOS, while MDOS is the command line interface for GeneveOS, that is, the shell with its prompt and white letters on blue background. But we don't have a fixed terminology here.) 2 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5117908 Share on other sites More sharing options...
+TheBF Posted September 5, 2022 Author Share Posted September 5, 2022 6 hours ago, mizapf said: The interesting thing would be to use the memory management of GeneveOS to allow for large files to be edited. I'd be interested in the underlying data structures (gap buffer, rope etc.). (Usage of terms: I call the whole OS of the Geneve the GeneveOS, while MDOS is the command line interface for GeneveOS, that is, the shell with its prompt and white letters on blue background. But we don't have a fixed terminology here.) Yes that's always the challenge with text editors. vi99 is a bit naïve at the moment. I cheated. The file data is held as a list of byte counted strings. The VDP screen RAM is the editing buffer. So the editing all takes place on the screen in VDP RAM. The data RAM updates the edited line when you hit enter or <Esc>. But it is actually just a line by line editor. No line wrapping in this version. It would be quite slow I think on a 64K data segment because of the insertion/deletion without a gap buffer. I have plans to make a 64K SAMS segment and see what happens. That could be a disaster. I have considered making a huge gap buffer the size of the screen and save it all back to RAM at some points in the editing. Might work. 2 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5118106 Share on other sites More sharing options...
+TheBF Posted September 8, 2022 Author Share Posted September 8, 2022 (edited) VI99 1.0 It ain't really vi yet but it can edit files and it has room to grow. It's less than 15K bytes as is. Changes: added a yy (yank) command *DIFFERENT* Since there is no highlight function I made yy a bit different that vi or vim. Lines are placed onto a line stack in VDP RAM. (Max 200 lines) added a p command to insert line buffer contents back into buffer hold the p key to put the entire buffer back Beeps when line stack is empty Improved seek to line time by 2X with a short ASM word. Fixed deleteln which was erasing past end of buffer (yuk) Fixed default cursor shape for 40 column mode Exposed COLD command which reboots the entire program Added short help message on opening page G command now starts at line 1, not line zero And... last but not least ... added an ls command (alias of dir) Removed faulty version. Look down a few posts for the updated version Edited September 17, 2022 by TheBF Removed bad zip file 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5119704 Share on other sites More sharing options...
+dhe Posted September 8, 2022 Share Posted September 8, 2022 A little cheat sheet. vi_cheat_sheet.pdf 2 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5119859 Share on other sites More sharing options...
+TheBF Posted September 8, 2022 Author Share Posted September 8, 2022 2 hours ago, dhe said: A little cheat sheet. vi_cheat_sheet.pdf 61.19 kB · 1 download Not sure I will ever get all of those commands in this thing but a sub-set is a beginning. Thanks for your support. 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5119904 Share on other sites More sharing options...
+TheBF Posted September 8, 2022 Author Share Posted September 8, 2022 9 hours ago, dhe said: A little cheat sheet. vi_cheat_sheet.pdf 61.19 kB · 2 downloads Thank you again @dhe. This cheat sheet is a lot simpler to read and is showing me a lot of commands that are quite simple to add. Not sure how many are useful but it gives me somethings to add to this project. I didn't actually start out wanting to write a vi clone but that's what it turned into. 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5120079 Share on other sites More sharing options...
+TheBF Posted September 17, 2022 Author Share Posted September 17, 2022 Version one of vi99 was built with my faulty E/A5 builder so it would never work on real iron. I rebuilt with the corrected lib file and it was still flakey on hardware. I had tried to make a smaller disk library but it is not field tested and was un-reliable. This new version reverts back to my tested handle-based file library and works on my stock console. It is still only 40 columns so of limited use to normal people, but I have plans to get this thing working with 80 column files on the 40 column screen. VI99-1.2.zip 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5124414 Share on other sites More sharing options...
+Vorticon Posted September 17, 2022 Share Posted September 17, 2022 In other works only abnormal people should apply. Good to know 😁 Are you planning for F18A support for 80 columns or just side-scrolling in the 40 column screen? Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5124478 Share on other sites More sharing options...
+TheBF Posted September 17, 2022 Author Share Posted September 17, 2022 3 hours ago, Vorticon said: In other works only abnormal people should apply. Good to know 😁 Are you planning for F18A support for 80 columns or just side-scrolling in the 40 column screen? Probably correct. Most people don't want a 40 column editor. ?? I could go that way like Wycove Forth but all my code is formatted for 80 columns now. I can recompile it with 80cols if you want a version like that. It "should" just work. I won't have time this week but I will try next weekend. 2 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5124528 Share on other sites More sharing options...
+TheBF Posted September 22, 2022 Author Share Posted September 22, 2022 On 9/17/2022 at 6:37 AM, Vorticon said: In other works only abnormal people should apply. Good to know 😁 Are you planning for F18A support for 80 columns or just side-scrolling in the 40 column screen? Hi @Vorticon I got home earlier than expected so I compiled a version using my 80 column code. I can't test this on hardware so let me know if it works ok on a real F18a vi9980.zip 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5127314 Share on other sites More sharing options...
+Vorticon Posted September 22, 2022 Share Posted September 22, 2022 39 minutes ago, TheBF said: Hi @Vorticon I got home earlier than expected so I compiled a version using my 80 column code. I can't test this on hardware so let me know if it works ok on a real F18a vi9980.zip 11.13 kB · 0 downloads Thanks! I am currently out of town for the next couple of weeks, but will give it a shot when I get back. 2 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5127330 Share on other sites More sharing options...
GDMike Posted September 23, 2022 Share Posted September 23, 2022 Sorry, just saw this...I'll give it a whirl as soon as I can get a break too. So crazy busy rt now. 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5127624 Share on other sites More sharing options...
+TheBF Posted September 23, 2022 Author Share Posted September 23, 2022 5 hours ago, GDMike said: Sorry, just saw this...I'll give it a whirl as soon as I can get a break too. So crazy busy rt now. No worries. I will just keep on making bugs. (IF debugging is removing bugs, then programming must be where we make bugs) 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5127764 Share on other sites More sharing options...
+TheBF Posted September 24, 2022 Author Share Posted September 24, 2022 @dhe ask for a simple man page to help with what commands are currently implemented. This can be loaded into the editor and read. It's the simplest thing to do for now. VI99MANPAGE.zip 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5128047 Share on other sites More sharing options...
+dhe Posted September 26, 2022 Share Posted September 26, 2022 I really like the fact, that you are also building in commands like ls. But, I had some problems getting vi99manpage to load initially. As you can see from the listing, the filename comes back as VI99MANPAG - but, that won't load, I had to give it VI99MANPAGE. I think setting expectations would be very helpful, like: Commands - must be all lower case. Device Names - like dskX - must be ---- File Names - should be the size they are on disk, and the same case, or does case matter - of course some of this might be Classic99 dependent, and I am using Files in a Directory format. Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5129159 Share on other sites More sharing options...
+TheBF Posted September 26, 2022 Author Share Posted September 26, 2022 Looks like I have trouble counting. VI99MANPAGE is 11 chars! I'll get my dunce hat out. You can use TIDIR and make the file name what ever you want or load it and w dsk1.ti99man OR whatever you prefer. Commands - must be all lower case. ok Device Names - like dskX - must be --- file paths in V1.2 are converted to UPPER case so entering them either case should work now. File Names - should be the size they are on disk, and the same case, or does case matter - of course some of this might be Classic99 dependent, and I am using Files in a Directory format. I think Classic99 does a conversion to upper case on file names all the time. 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5129174 Share on other sites More sharing options...
+TheBF Posted October 4, 2022 Author Share Posted October 4, 2022 (edited) Taking @dhe 's coaching, I have corrected the error of my ways. V 1.3 addresses the following: corrected the operation of dd and yy. I had to play with vim to understand their operation. dd deletes lines to copy buffer yy COPIES lines to copy buffer Neither command can take numeric parameters. (That's for the next version) p command now pastes all lines in the copy buffer to the screen. It's not real fast but it works. The copy buffer is deleted if you edit the file with A,a i or o commands. (I think that is correct operation) help command now gets the file VIMANPAGE from the disk that vi99 was loaded from. Keep VIMANPAGE with the editor binaries and it should work vi99 remembers the DSK# from where it loaded when it starts up clear command has been added to the vi99 shell bye is now lower case Source code for the editor and all the library files is in the zip file for the terminally curious I think it's better. ?? Needs testing. Once I get numeric parameters into the editing loop it will look/feel more like a proper sub-set of vi. Not bad for a 16K binary IMHO. VI99-1.3.zip Edited October 4, 2022 by TheBF typo 4 1 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5132981 Share on other sites More sharing options...
+TheBF Posted October 4, 2022 Author Share Posted October 4, 2022 (edited) vi99 Tip Due the clever design of Classic99 you can bring text files from vi99 to your PC with: :w clip Then pasted the windows clipboard to wherever you want it. Edited October 4, 2022 by TheBF 3 Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5132982 Share on other sites More sharing options...
+dhe Posted October 5, 2022 Share Posted October 5, 2022 SAD TIMES! LOAD. vi idanis<esc>yyp locks solid on classic99. One time it gave me a really kewl light show! Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5133610 Share on other sites More sharing options...
+TheBF Posted October 6, 2022 Author Share Posted October 6, 2022 3 hours ago, dhe said: SAD TIMES! LOAD. vi idanis<esc>yyp locks solid on classic99. One time it gave me a really kewl light show! I just replicated it. Looks like it's something to do with the top line. OK. Back to the pit. EDIT 1st clue: Does not exhibit the bug when a file is loaded. Quote Link to comment https://forums.atariage.com/topic/340529-vi99/#findComment-5133704 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.