+retroclouds Posted December 22, 2018 Share Posted December 22, 2018 (edited) I will be using this thread to document the development of a new programmer editor for the TI-99/4a called "Stevie". Download the cartridge image in the official release thread. As you might expect from its name, the editor is somewhat inspired by the unix editor "vi" and will also take elements of "tmux". So what do I have in mind: Designed from the ground up for 80 columns mode, specifically using the F18A but 9938 will be supported as well. Designed from the ground up for using SAMS card. Programming language of choice is TMS9900 assembly language The editor itself will run from cartridge space (multi-bank cartridge). Uses my spectra2 library as foundation (been doing major changes in the last couple of months, not related to games) Will have some "API" so that I can integrate with external programs and go back and forth between programs. Would like to add some kind of mouse support. This will not be a GUI in the traditional sense. If you used tmux with a mouse before you know what I mean. Possibility to have multiple editor panes open at once. Should handle files with up to 65536 lines Undo functionality, well up to a certain extent that is. Language awareness, e.g. behave differently based upon language (e.g. assembly, C, Basic, ...) Internal text representation will be decoupled from what actually will be rendered on screen. Should make the editor more responsive when dealing with large files, allow split panes, etc. Reconfigurable keymaps, possibility to swap between keymap with single key combination. Not everyone is into VI This is the start of a large project and I don't expect to have a truely useful version anytime soon. I expect this project to take multiple years, but you gotta start somewhere. Now I've taken my mouth full, I will use this thread to keep myself motivated ? There aren't too many resources out there discussing the architecture of a text editor, so cross-linking here: Dr. Dobb's Journal 1993 - Text Editors: Algorithms and Architecture Gap Buffers: a data structure for editable text Rope (data structure) - Wikipedia Vi Editor: Why Programmers Think This Old Editor is Still Awesome Threads on Atariage discussing topics -somewhat- related to Stevie: F18a F18a 30 rows 80 columns mode F18A high-resolution timer How to lock the F18a and halt the F18a CPU File handling CRU scan sample code, my implementation of a CRC-16 Cyclic Reducancy Check DSRLINK Code Tutorial File operations in assembly language E/A file access Opinions on TI-99/4a text file formats TI Basic integration Jump to TI Basic from assembly language Detect if TI Basic is running a program TI Basic move crunch buffer in assembly TI Basic session manager Others: Favourite text (programmers) editor on the TI-99/4a Better keyboard scanning? tmux for developers github: Stevie source code Issue tracker Edited October 4, 2021 by retroclouds Stevie v1.1x released 14 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted December 22, 2018 Share Posted December 22, 2018 As you might expect from its name, the editor is somewhat expired by the unix editor "vi" and will also take elements of "tmux". inspired? BTW, I'm dreaming of a "vig" (vi for Geneve) for decades already, but I would keep it to a subset of the vi features. 2 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted December 22, 2018 Author Share Posted December 22, 2018 (edited) Here's a first little demo I recorded on js99er. The cursor is actually a sprite in 80 columns mode on the F18a. I've been doing a few of these to check out if certain things will or will not work. Edited December 22, 2018 by retroclouds 7 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted December 23, 2018 Share Posted December 23, 2018 Really looking forward to this. I've been using Preditor in 80col mode, but it's a bit slow and limited in memory. Quote Link to comment Share on other sites More sharing options...
Opry99er Posted December 26, 2018 Share Posted December 26, 2018 Cool!!! Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted December 26, 2018 Share Posted December 26, 2018 I use the F'WEB 80-col editors. With 192K of VRAM in my AVPC card, and cut and paste facility, I cab do just about anything I want with either text or A/L programming. 1 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 5, 2019 Author Share Posted January 5, 2019 Update: I will supported the 9938 as well. At least up to a certain extent. F18a is primary focus though. Progress is good. I have most of the memory structures in place and they are working as expected. fb - Frame buffer. This basically matches a rectangular window as part of the physical screen. This is basically where the text resides until enter is pressed or key up/down is used. idx - The index. It's the link between the line numbers and editor buffer. edb - The editor buffer. This is where the text resides after the line is "crunched" (packed). Currently it's a copy-on-write without compression, but might be going for RLE compression. For each of these structures I have a support module. Here's ane extract: *-------------------------------------------------------------- * Frame buffer structure @ >2000 * Frame buffer itself @ >3000 - >3fff *-------------------------------------------------------------- fb.top.ptr equ >2000 ; Pointer to frame buffer fb.current equ fb.top.ptr+2 ; Pointer to current position in frame buffer fb.topline equ fb.top.ptr+4 ; Top line in frame buffer (matching line X in editor buffer) fb.row equ fb.top.ptr+6 ; Current line in frame buffer (offset 0 .. @fb.screenrows) fb.row.length equ fb.top.ptr+8 ; Length of current row in frame buffer fb.row.dirty equ fb.top.ptr+10 ; Current row dirty flag in frame buffer fb.column equ fb.top.ptr+12 ; Current column in frame buffer fb.colsline equ fb.top.ptr+14 ; Columns per row in frame buffer fb.curshape equ fb.top.ptr+16 ; Cursor shape & colour fb.curtoggle equ fb.top.ptr+18 ; Cursor shape toggle fb.yxsave equ fb.top.ptr+20 ; Copy of WYX fb.dirty equ fb.top.ptr+22 ; Frame buffer dirty flag fb.screenrows equ fb.top.ptr+24 ; Number of rows on physical screen fb.top equ >3000 ; Frame buffer low memory 2400 bytes (80x30) ; >200c-20ff ; ** FREE ** *-------------------------------------------------------------- * Editor buffer structure @ >2100 *-------------------------------------------------------------- edb.top.ptr equ >2100 ; Pointer to editor buffer edb.index.ptr equ >2102 ; Pointer to index edb.lines equ >2104 ; Total lines in editor buffer edb.dirty equ >2108 ; Editor buffer dirty flag (Text changed!) edb.next_free equ >210a ; Pointer to next free line edb.top equ >a000 ; Editor buffer high memory 24576 bytes ; >2102-21ff ; ** FREE ** *-------------------------------------------------------------- * Index @ >2200 - >2fff *-------------------------------------------------------------- idx.top equ >2200 ; Top of index And here's how on of the routines in the edb support module looks like. I'm using xas99 which allows a lot of flexibility in using labels. That helps a lot. *************************************************************** * edb.line.pack * Pack current line in framebuffer *************************************************************** * bl @edb.line.pack *-------------------------------------------------------------- * INPUT * @fb.top = Address of top row in frame buffer * @fb.row = Current row in frame buffer * @fb.column = Current column in frame buffer * @fb.colsline = Columns per line in frame buffer *-------------------------------------------------------------- * OUTPUT *-------------------------------------------------------------- * Register usage * tmp0,tmp1,tmp2 *-------------------------------------------------------------- * Memory usage * rambuf = Saved @fb.column * rambuf+2 = Saved beginning of row * rambuf+4 = Saved length of row ********@*****@*********************@************************** edb.line.pack: dect stack mov r11,*stack ; Save return address ;------------------------------------------------------ ; Get values ;------------------------------------------------------ mov @fb.column,@rambuf ; Save @fb.column clr @fb.column bl @fb.calc_pointer ; Beginning of row ;------------------------------------------------------ ; Prepare scan ;------------------------------------------------------ clr tmp0 ; Counter mov @fb.current,tmp1 ; Get position mov tmp1,@rambuf+2 ; Save beginning of row ;------------------------------------------------------ ; Scan line for >00 byte termination ;------------------------------------------------------ edb.line.pack.scan: movb *tmp1+,tmp2 ; Get char srl tmp2,8 ; Right justify jeq edb.line.pack.idx ; Stop scan if >00 found inc tmp0 ; Increase string length jmp edb.line.pack.scan ; Next character ;------------------------------------------------------ ; Update index entry ;------------------------------------------------------ edb.line.pack.idx: mov tmp0,@rambuf+4 ; Save length of line mov @fb.row,@parm1 ; Current row in Framebuffer ;------------------------------------------------------ ; Store line inline in index if length <= 2 characters ;------------------------------------------------------ ci tmp0,2 jgt edb.line.pack.idx.normal mov @rambuf+2,tmp1 ; Retrieve beginning of line mov *tmp1,@parm2 ; Store word inline mov tmp0,@parm3 ; Length of line bl @idx.entry.update ; Update index entry jmp edb.line.pack.$$ ; Exit ;------------------------------------------------------ ; Update index and store line in editor buffer ;------------------------------------------------------ edb.line.pack.idx.normal: mov @edb.next_free,@parm2 ; Block where packed string will reside mov @rambuf+4,tmp2 ; Number of bytes to copy mov tmp0,@parm3 ; Set length of line bl @idx.entry.update ;------------------------------------------------------ ; Pack line from framebuffer to editor buffer ;------------------------------------------------------ mov @rambuf,tmp0 ; Source for memory copy mov @edb.next_free,tmp1 ; Destination for memory copy mov @rambuf+4,tmp2 ; Number of bytes to copy bl @xpym2m ; Copy memory block ;------------------------------------------------------ ; Update pointer to next free block ;------------------------------------------------------ a @rambuf+4,@edb.next_free ;------------------------------------------------------ ; Exit ;------------------------------------------------------ edb.line.pack.$$: mov @rambuf,@fb.column ; Retrieve @fb.column b @poprt ; Return to caller 2 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 12, 2019 Author Share Posted January 12, 2019 I use the F'WEB 80-col editors. With 192K of VRAM in my AVPC card, and cut and paste facility, I cab do just about anything I want with either text or A/L programming. I want to try out some more editors to see how they behave on the TI-99/4a. Does Funnelweb work with 32k as well? Would it be possible to do a short video. Interested in seeing how responsive it is with the 192k vram. thx. Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted January 12, 2019 Share Posted January 12, 2019 The 80-col Funnelweb requires a v9938 (or v9958) with its additional VRAM to use all of the "extras". It will run in 40-columns with a 9918. 1 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 12, 2019 Share Posted January 12, 2019 I will be using this thread to document the development of a new programmer editor for the TI-99/4a called "TiVi". (pronounced "TV" or "TeeVee") As you might expect from its name, the editor is somewhat inspired by the unix editor "vi" and will also take elements of "tmux". So what do I have in mind: Designed from the ground up for 80 columns mode, specifically using the F18A but 9938 will be supported as well. Designed from the ground up for using SAMS card, albeit 32K memory expansion should work as well Programming language of choice is TMS9900 assembly language The editor itself will run from cartridge space (multi-bank cartridge). Uses my spectra2 library as foundation (been doing major changes in the last couple of months, not related to games) Will have some "API" so that I can integrate with external programs and go back and forth between programs. Would like to add some kind of mouse support. This will not be a GUI in the traditional sense.If you used tmux with a mouse before you know what I mean. Possibility to have multiple editor panes open at once. Should handle files with up to 65536 lines when using SAMS. Undo functionality, well up to a certain extent that is. Language awareness, e.g. behave differently based upon language (e.g. assembly, C, Basic, ...) Internal text representation will be decoupled from what actually will be rendered on screen. Should make the editor more responsive when dealing with large files, allow split panes, etc. Reconfigurable keymaps, possibility to swap between keymap with single key combination. Not everyone is into VI This is the start of a large project and I don't expect to have a truely useful version anytime soon. I expect this project to take multiple years, but you gotta start somewhere. Now I've taken my mouth full, I will use this thread to keep myself motivated :-) There aren't too many resources out there discussing the architecture of a text editor, so cross-linking here. Dr. Dobb's Journal 1993 - Text Editors: Algorithms and Architecture Gap Buffers: a data structure for editable text Rope (data structure) - Wikipedia Vi Editor: Why Programmers Think This Old Editor is Still Awesome Threads on Atariage discussing topics -somewhat- related to TiVi: F18a 30 rows 80 columns mode F18A high-resolution timer CRU scan sample code, my implementation of a CRC-16 Cyclic Reducancy Check Favourite text (programmers) editor on the TI-99/4a Others: tmux for developers These are great resources. I am playing with an editor design myself. Thanks! 2 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 20, 2019 Author Share Posted January 20, 2019 (edited) Even though I didn't code this week progress has been good so far. Scrolling works and now one of the next steps is to get insert/delete lines working and really should start getting code in for loading files. The thing is that it is kinda of hard to try out scrolling, etc. if each time you reset you start with an empty editor buffer. As I wrote before, TiVi will work with both SAMS and plain 32K memory expansion. Then this got me thinking, looking at the finalgrom cartridge specs it supports up to 512K of bankswitched RAM (4K pages). Am seriously thinking adding support for that, as it would make it very interesting if you are running a stock TI-99/4A without PEB and SAMS, e.g. TiPi, nanopeb and the like. At this stage it is a lot experimenting and of course the feature list gets longer all the time, so will have to get my priorities straight. But hey, that is part of the fun right. Edited January 20, 2019 by retroclouds 5 Quote Link to comment Share on other sites More sharing options...
+9640News Posted January 20, 2019 Share Posted January 20, 2019 Just a FYI, You might want to consider adding EXTERNALS. Now, nobody really ever did anything with My-Word with Externals for the Geneve, however Petter Hoddie wrote out a good specification. It gave one the ability to add features to the program without modifying the program itself. My penny's worth...……. Beery Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 20, 2019 Author Share Posted January 20, 2019 Just a FYI, You might want to consider adding EXTERNALS. Now, nobody really ever did anything with My-Word with Externals for the Geneve, however Petter Hoddie wrote out a good specification. It gave one the ability to add features to the program without modifying the program itself. My penny's worth...……. Beery Sounds interesting. Did a quick search but could not find the spec. Interesting to see he was the mastermind behind the Apple Quicktime player. Do you know where the spec can be found? Quote Link to comment Share on other sites More sharing options...
+9640News Posted January 20, 2019 Share Posted January 20, 2019 Sounds interesting. Did a quick search but could not find the spec. Interesting to see he was the mastermind behind the Apple Quicktime player. Do you know where the spec can be found? Look at this path on whtech: ./Geneve/9640news/CAT28/EXTERNLS.ARK 1 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 20, 2019 Author Share Posted January 20, 2019 Thank you Beery, it is much appreciated. I downloaded the specs and took a look at it. Interesting concept. Will come in handy when doing the design. Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted February 3, 2019 Share Posted February 3, 2019 And if you support any form of bank switched cartridges, note that there are several solutions out there that include lots of banks, although many of those switch on 8K boundaries instead of 4K. Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted August 18, 2019 Share Posted August 18, 2019 Can one get access to a BETA version for testing & playing? Quote Link to comment Share on other sites More sharing options...
+TheBF Posted August 19, 2019 Share Posted August 19, 2019 Some questions for the group. Is there are standard set of command keys for editors on the TI-99 or is it every person for themselves? If there is a "more" standard set, is it documented somewhere? Retroclouds, can you provide a list of your command keys? ( I will match your set if there is some consensus on it) An option that I have seen in some editors built on top of Forth is a config file that sets the command keys so you can change them, so that's a possibility. Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted August 19, 2019 Share Posted August 19, 2019 2 hours ago, TheBF said: Some questions for the group. Is there are standard set of command keys for editors on the TI-99 or is it every person for themselves? If there is a "more" standard set, is it documented somewhere? Retroclouds, can you provide a list of your command keys? ( I will match your set if there is some consensus on it) An option that I have seen in some editors built on top of Forth is a config file that sets the command keys so you can change them, so that's a possibility. 1- yes no probably.. most ran out of the standard keys before running out of functions but the ones in ti-writer are pretty standard for ti programs 2- tiwriter manual? http://ftp.whtech.com/datasheets and manuals/Software Manuals/TI Writer manual.pdf 3 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted August 19, 2019 Author Share Posted August 19, 2019 22 hours ago, --- Ω --- said: Can one get access to a BETA version for testing & playing? sorry, not at this time. Currently have most of the editing features implemented but loading and saving files is not there yet. Might do a video in the next few days/weeks though, will see. 1 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted August 19, 2019 Author Share Posted August 19, 2019 4 hours ago, TheBF said: Some questions for the group. Is there are standard set of command keys for editors on the TI-99 or is it every person for themselves? If there is a "more" standard set, is it documented somewhere? Retroclouds, can you provide a list of your command keys? ( I will match your set if there is some consensus on it) An option that I have seen in some editors built on top of Forth is a config file that sets the command keys so you can change them, so that's a possibility. These are the keys I have currently defined and working: Movement keys ============= fctn + s cursor left fctn + d cursor right fctn + e cursor up fctn + x cursor down ctrl + a cursor home ctrl + f cursor end of line ctrl + s cursor word left ctrl + d cursor word right ctrl + e cursor page up ctrl + x cursor page down Modifier keys ============= enter enter line fctn + 1 delete char fctn + 3 delete line fctn + 2 insert char fctn + 5 insert line ctrl + 2 toggle insert/overwrite mode fctn + q quit ctrl + k delete until end of line. Note that I'm using my own keyscan routine (derived from the Simon Koppelmann book "TMS9900 assembler auf dem TI-99/4A". I want to add some custom behaviour when holding down the ctrl key or fctn key without pressing any other key. Even considering "repurposing" the right shift key on the TI-99/4A keyboard so that it behaves as a "TAB" key. Might also map "quit" on "ctrl + q" instead of "fctn + q" to prevent incidental quitting out of the editor (I found that a clever trick in MG Explorer). I'm open to suggestions. This is just a map I came up with that works quite well for me. 4 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted August 19, 2019 Share Posted August 19, 2019 The Koppelmann book is quite good. I remember talking to him at one of the TI Treffs--and bought a copy of the second edition of his book at some point during the conversation. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted August 19, 2019 Share Posted August 19, 2019 I don't know if you are interested in allowing the user to specify their own keypress for certain functions within the editor. A translation table would probable be easiest to maintain - whether within the editor or as a stand-alone configuration tool. Yea... I'm one of those people who edits the default keys whenever I load up a first person shooter That said, nothing wrong with selecting what works for you - and what might be better solutions than the old programs from back in the day. You might look at the Funnelweb/Funnelwriter Editor manual as it is one of the more robust editors available for the TI and may give you some ideas for implementation or experimentation. 4 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted August 22, 2019 Share Posted August 22, 2019 On 8/19/2019 at 6:59 PM, InsaneMultitasker said: I don't know if you are interested in allowing the user to specify their own keypress for certain functions within the editor. A translation table would probable be easiest to maintain - whether within the editor or as a stand-alone configuration tool. Yea... I'm one of those people who edits the default keys whenever I load up a first person shooter I knew there was something fishy about you ? I'm really super interested in how that editor turns out! 2 1 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted September 8, 2019 Author Share Posted September 8, 2019 (edited) With the discussion on file formats, index handling, etc. going on in the below thread, perhaps now is a good time to get a first "alpha" version of TiVi out. Attached is an 8k binary for use in js99er.net and on the real deal, F18A and 32k memory required. I don't think it works on classic99 yet, due to the F18a stuff I am using. There's no possibility to load/save files and if enter more than 80 characters on a line things get funky, but you get the idea. Keyboard usage is listed in this thread. Edited January 22, 2021 by retroclouds Removed binary 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.