Jump to content

Photo

TiVi Development Thread

asm f18a editor tms9900

15 replies to this topic

#1 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,705 posts
  • Location:Germany

Posted Sat Dec 22, 2018 1:02 PM

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.
  • Will support FinalGROM 512K bankswitched RAM in addition to SAMS and 32K memory expansion, useful for those without SAMS and PEB.
  • 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 or FinalGROM 512K bankswitched RAM.
  • 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:

Edited by retroclouds, Sat Apr 6, 2019 11:38 AM.


#2 mizapf OFFLINE  

mizapf

    River Patroller

  • 3,665 posts
  • Location:Germany

Posted Sat Dec 22, 2018 1:16 PM

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.



#3 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sat Dec 22, 2018 1:18 PM

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 by retroclouds, Sat Dec 22, 2018 1:20 PM.


#4 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,791 posts
  • Location:Eagan, MN, USA

Posted Sat Dec 22, 2018 9:46 PM

Really looking forward to this. I've been using Preditor in 80col mode, but it's a bit slow and limited in memory.

#5 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 10,744 posts
  • Location:Hustisford, WI

Posted Wed Dec 26, 2018 12:03 AM

Cool!!!

#6 atrax27407 OFFLINE  

atrax27407

    Stargunner

  • 1,272 posts

Posted Wed Dec 26, 2018 9:01 AM

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.


  • RXB likes this

#7 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sat Jan 5, 2019 9:51 AM

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



#8 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sat Jan 12, 2019 1:27 AM

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.

#9 atrax27407 OFFLINE  

atrax27407

    Stargunner

  • 1,272 posts

Posted Sat Jan 12, 2019 7:41 AM

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.



#10 TheBF ONLINE  

TheBF

    Stargunner

  • 1,040 posts
  • Location:The Great White North

Posted Sat Jan 12, 2019 8:08 AM

 

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!



#11 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sun Jan 20, 2019 2:41 AM

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, Sun Jan 20, 2019 2:48 AM.


#12 BeeryMiller OFFLINE  

BeeryMiller

    Dragonstomper

  • 952 posts
  • Location:Campbellsburg, KY

Posted Sun Jan 20, 2019 9:14 AM

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

 



#13 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sun Jan 20, 2019 10:23 AM

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?



#14 BeeryMiller OFFLINE  

BeeryMiller

    Dragonstomper

  • 952 posts
  • Location:Campbellsburg, KY

Posted Sun Jan 20, 2019 10:38 AM

 

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



#15 retroclouds OFFLINE  

retroclouds

    Stargunner

  • Topic Starter
  • 1,705 posts
  • Location:Germany

Posted Sun Jan 20, 2019 11:03 AM

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.

#16 Ksarul OFFLINE  

Ksarul

    Quadrunner

  • 5,318 posts

Posted Sun Feb 3, 2019 2:25 PM

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.







Also tagged with one or more of these keywords: asm, f18a, editor, tms9900

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users