Jump to content
Sign in to follow this  
jrhodes

Commodore style code entry on TI99

Recommended Posts

Is there any version of Basic/Extended Basic/RXB/similar that already has a code input method more similar to Commodore machines?

If i could navigate around the entire screen similar to vic-20/C64 Basic, while writing XB/RXB code on my TI, i would be in coders heaven.

Rich, if you read this, please consider adding (if at all possible) a "full screen, free form" code editor, similar to the one found on Commodore machines.

You find a way to let users enter code in a more C64-like fashion from RXB, and i don't think i would ever boot into normal TI-XB again.

Share this post


Link to post
Share on other sites

If I remember correctly, the Commodore parser simply read the characters on the line that your cursor is on and processed them. This is quite different to an approach where you wait for the user's input and process it.

 

The advantage of the Commodore approach was that you could list the floppy directory, walk up to the desired line, type load (or l-shift-o), walk behind the name, add ",8:" and press Return. The disadvantage was that you could accidentally execute stuff that you never planned to invoke. When you pressed Return on the line with "READY", you got a DATA ERROR because it parsed the line as "READ Y" (I somewhat hated that sloppy parser).

  • Thanks 1

Share this post


Link to post
Share on other sites
13 hours ago, mizapf said:

If I remember correctly, the Commodore parser simply read the characters on the line that your cursor is on and processed them. This is quite different to an approach where you wait for the user's input and process it.

The Apple II's editor was similar. You could enter an 'escape' mode and move the cursor anywhere around the screen, but pressing right-arrow entered whatever character was under the cursor as if you typed it. A little weird, but not too hard to implement (since you only need to special case one key) and quite flexible. However, pretty easy for the user to get confused ;) 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
22 hours ago, jrhodes said:

Is there any version of Basic/Extended Basic/RXB/similar that already has a code input method more similar to Commodore machines?

If i could navigate around the entire screen similar to vic-20/C64 Basic, while writing XB/RXB code on my TI, i would be in coders heaven.

Rich, if you read this, please consider adding (if at all possible) a "full screen, free form" code editor, similar to the one found on Commodore machines.

You find a way to let users enter code in a more C64-like fashion from RXB, and i don't think i would ever boot into normal TI-XB again.

Funny this topic came up. I have been considering modifying CAMEL99 Forth to do this.

It is very convenient, and the text is sitting there in VDP memory so why not?

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, TheBF said:

Funny this topic came up. I have been considering modifying CAMEL99 Forth to do this.

It is very convenient, and the text is sitting there in VDP memory so why not?

I was thinking for specifically Basic dialects, but if you do go ahead with this for CAMEL99, i may have to take a deeper look at it.

  • Like 1

Share this post


Link to post
Share on other sites

Warning: The Surgeon General has warned that moving from BASIC to Forth can lead to people backing talkwards. 😎

  • Haha 2
  • Confused 1

Share this post


Link to post
Share on other sites

So this question gave me a little push to try this out and it works pretty well.  Thank you JRhodes.

Currently you can only edit around the screen and when you hit ctrl X the current line, left of the cursor gets put into a buffer in CPU RAM.

It's not too hard to put the text into Forth's "Terminal input buffer" (TIB) but I want to add some features before I make a new Forth kernel.

 

Spoiler  has the code it took to do it.

Video shows it working.

Spoiler
\ VDP Screen editor
\ Allows cursoring around the screen and passing VDP text to CPU buffer

INCLUDE DSK1.TOOLS    \ debugging

VARIABLE INSERT    \ insert/over-write flag

\ cursor movement controls
: CUP       VROW @ 1-  0 MAX VROW ! ;
: CDOWN     VROW @ 1+  L/SCR 1- MIN  VROW ! ;
: CRGHT     VCOL @ 1+  C/[email protected] 1- MIN  VCOL ! ;
: CLEFT     VCOL @ 1-  0 MAX  VCOL ! ;

: NEWLINE   CDOWN  VCOL OFF ;

: INS/DEL   INSERT @ -1 XOR INSERT ! ; \ toggle insert mode

\ ========================
\ Helpers

\ return vdp address of current screen row
: VLINE ( -- VDPaddr)  VROW @ C/[email protected] * ;

\ return text right of the cursor as a VDP stack string
: RIGHTSIDE  ( -- VDPaddr len)  VLINE C/[email protected]  VCOL @ /STRING ;

\ return text left of cursor as a VDP stack string
: LEFTSIDE   ( -- VDPaddr len)  VLINE VCOL @ ;

\ copy vdp stack string to RAM address
: VCOPY      ( vaddr len addr -- ) SWAP VREAD ;

\ =======================
\ text manipulation

: DELCHAR    ( -- )
     RIGHTSIDE 1 /STRING TUCK     \ cut 1st char of RIGHTSIDE, tuck length
     PAD VCOPY                    \ copy to temp buffer
     PAD VPOS ROT VWRITE          \ write buffer back to CURSOR position
;

: PUSHRIGHT ( -- )
     RIGHTSIDE TUCK               \ tuck length for later
     PAD VCOPY                    \ read right side of line into PAD
     BL VPUT                      \ put a blank at cursor position
     PAD VPOS 1+ ROT VWRITE ;     \ write PAD back at VPOS+1
;


\ CASE compiler with BREAK that exits routine after a match
: CASE:      ( -- )
          POSTPONE OVER   POSTPONE =
          POSTPONE IF POSTPONE DROP  ; IMMEDIATE

: BREAK;   ( -- ) POSTPONE EXIT POSTPONE THEN ; IMMEDIATE

: KEYHANDLER ( char -- )
            0D CASE:  NEWLINE      BREAK;  \ ENTER key
            08 CASE:  CLEFT        BREAK;
            0B CASE:  CUP          BREAK;
            0A CASE:  CDOWN        BREAK;
            09 CASE:  CRGHT        BREAK;
            03 CASE:  DELCHAR      BREAK;
            04 CASE:  INS/DEL      BREAK;
            90 CASE:  PAGE         BREAK;  \ ^P

            INSERT @ IF  PUSHRIGHT THEN  VPUT VCOL 1+!
;

: EDITKEY ( -- char)              \ non-repeating KEY
            VPOS [email protected] >R           \ Read screen char & RPUSH
            BEGIN                 \ start the loop
              [email protected] 1FFF >         \ read 9901 timer. compare to >2000
              IF CURS @           \ true? fetch cursor char
              ELSE [email protected]             \ false? fetch screen char
              THEN VPUT           \ multi-tasking friendly screen write
              KEY?                \ check the keyboard
              ?DUP                \ DUP IF <> 0
            UNTIL                 \ loop until a key pressed
            R> VPUT ;             \ RPOP the screen char, put it back

\ Accept text from VDP screen, copy to Forth PAD buffer
\ Return address and length
: EDITOR ( -- addr n)
             BEGIN
                EDITKEY DUP 98 <>  \ ^X exit editor
             WHILE
                KEYHANDLER
             REPEAT
             DROP
             LEFTSIDE TUCK PAD VCOPY
             PAD SWAP ;

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
On 9/28/2019 at 12:52 PM, jrhodes said:

Is there any version of Basic/Extended Basic/RXB/similar that already has a code input method more similar to Commodore machines?

If i could navigate around the entire screen similar to vic-20/C64 Basic, while writing XB/RXB code on my TI, i would be in coders heaven.

Rich, if you read this, please consider adding (if at all possible) a "full screen, free form" code editor, similar to the one found on Commodore machines.

You find a way to let users enter code in a more C64-like fashion from RXB, and i don't think i would ever boot into normal TI-XB again.

As Mizapf and Tursi pointed out it is similar but different.

Secondly RXB has a thing that makes the Commodore look like crap:

CALL USER("DSK#.BATCHFILE")

What does this do? Well it does everything you could type in including move the cursor on screen or load, save, edit, merge or TRACE test XB programs.

Watch these 14 videos and tell me how the Commodore editor can touch this with a 10 foot pole:

RXB demo 1 to 9 and A, B, C, D all from 2011 in RXB 2012, but need to make a new group on RXB 2020 soon.

Keep in mind these video show RXB doing all of this from a single DV80 file, there is no FILE SIZE LIMIT!

It is quite possible in Classic99 to make a DV80 file RXB will run for weeks if you are crazy enough to do it.

Look you could put every single XB program ever made into this DV80 file and load and run all of them and edit or merge them....

 

Again can the Commodore touch this feature with a ten foot pole????

Edited by RXB
wrong number in this post.
  • Like 3

Share this post


Link to post
Share on other sites

That's pretty cool stuff Rich.  You are making this old man work hard to try and catch up! :)

 

I like the QUITON QUITOFF.  I have done it in programs with bit twiddling,  but never created a Forth command so I am going to "borrow" those. Thanks for the idea.

 

Because CAMEL99 reads DV80 files for source code I can do some of those things but you have a lot of years put into your system.

Very very nice work.

  • Like 2

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...