Jump to content
IGNORED

Stevie Development Thread


retroclouds

Recommended Posts

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.

 

 

 

 

stevie_beta1.thumb.png.34cff684a3cd9b9dbb95cb828e94dbb3.png

 

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:
 

 

Threads on Atariage discussing topics -somewhat- related to Stevie:

F18a

 

 

File handling

 

TI Basic integration


Others:

 

github:

 

 

Edited by retroclouds
Stevie v1.1x released
  • Like 14
Link to comment
Share on other sites

  • 2 weeks later...

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

  • Like 2
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 

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.

Threads on Atariage discussing topics -somewhat- related to TiVi:

Others:

 

 

These are great resources. I am playing with an editor design myself.

 

Thanks!

  • Like 2
Link to comment
Share on other sites

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 by retroclouds
  • Like 5
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

 

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

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...

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.

Link to comment
Share on other sites

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

 

  • Like 3
Link to comment
Share on other sites

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.

 

  • Like 1
Link to comment
Share on other sites

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.

  • Like 4
Link to comment
Share on other sites

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.

 

  • Like 4
Link to comment
Share on other sites

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!

  • Like 2
  • Haha 1
Link to comment
Share on other sites

  • 3 weeks later...

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 by retroclouds
Removed binary
  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...