Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:09 03 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: XEdit Text Editor

     Page 2 of 4    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 10:55am 22 Nov 2020
Copy link to clipboard 
Print this post

Amazing, seems more responsive and better featured than the inbuilt EDIT. If it were not for the fact that I'm generally working through TeraTerm or PuTTY I would definitely be using this in preference.

One bug I've noticed running with 5.06.00b2, pressing F1 for Help reproducably reports:
Error in line 920: Not enough heap memory

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 11:30am 22 Nov 2020
Copy link to clipboard 
Print this post

  thwill said   If it were not for the fact that I'm generally working through TeraTerm or PuTTY I would definitely be using this in preference.

One bug I've noticed running with 5.06.00b2, pressing F1 for Help reproducably reports:
Error in line 920: Not enough heap memory


Thank you Tom. I was worried that I would be pushing the heap a bit too hard in certain configurations.

The help overlay is currently a huge sprite, which probably goes onto the heap. With some BLIT and/or PAGE COPY work I should be able to avoid (ab)using a sprite for the overlay. Still, the fact that one (big) sprite can trigger a heap overflow probably means I'm cutting is a bit too close.
In the interim, you can reduce the MAX_NUM_ROWS% value on line 175 to something like 10000. That should free up enough heap.

I'm putting serial input (not output), with alternative keybindings, on the to-do list.
Epsilon CMM2 projects
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 01:41pm 22 Nov 2020
Copy link to clipboard 
Print this post

  epsilon said  I'm putting serial input (not output), with alternative keybindings, on the to-do list.


That would help.

I'm hopeful a better VT100 compatible editor is possible from BASIC too, but xEdit is probably not the correct starting point. My personal gold standard for serial input would probably be an implementation of Vim, which I know isn't everyone's cup-of-teat. If that existed I might even bother to learn the Vi keystrokes beyond the basics I currently grasp ... maybe one day I'll even get around to implementing it myself.

Keep up the good work,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 227
Posted: 02:01pm 22 Nov 2020
Copy link to clipboard 
Print this post

  epsilon said  I'm putting serial input (not output), with alternative keybindings, on the to-do list.


I agree with Tom, if it was usable over TeraTerm it would be my editor of choice.  At the risk of being cheeky, a killer function for me would be the ability to move quickly between files with a buffer intact (cut & paste between files, file explorer)

Working with includes is OK using the current editor, but the ability to move around in a "project" would be great (obviously not a an implementation of VS Code on the CMM), but as an illustration.



Is it possible to make the keyword list customisable?
Edited 2020-11-23 00:18 by elk1984
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 03:09pm 22 Nov 2020
Copy link to clipboard 
Print this post

I'm holding out for vegipete's upcoming Ultrabox implementation for the file dialog/explorer type of functionality.

The keyword list is customizable. All the keywords are defined in CMD_LIST_DATA block starting at line 372. If you're adding or removing keywords, make sure you also update the NUM_COMMANDS constant (which I realize now is a misnomer, sorry), just before, at line 368.


CONST NUM_COMMANDS% = 219
DIM CMD_LIST$(NUM_COMMANDS%-1) LENGTH 16

CMD_LIST_DATA:
 DATA " ,%$!()=<>/\*+-:" 'Whitespaces
 DATA "ADC","BOX","CLEAR","CONTINUE","DATA","DO","END","SELECT","EXECUTE","EXIT","SUB","FUNCTION"
 DATA "I2C3","IRETURN","LIST","MAP","MKDIR","ONEWIRE","PIN","PORT","READ","RMDIR","SERVO","SPI2"
 DATA "TEXT","TURTLE","WII","ARC","CASE","CLOSE","COPY","DATE","EDIT","CSUB","FILES","GOSUB","IF"
 DATA "KILL","LOAD","MAP","MODE","OPEN","PIXEL","PRINT","REM","RUN","SETPIN","SPRITE","TIME"
 DATA "UPDATE","FIRMWARE","XMODEM","AUTOSAVE","CASE","ELSE","CLS","CPU","DEFINEFONT","ENDIF"
 DATA "FONT","GOTO", "IMAGE","LET","LOCAL","MATH","NEW","OPTION","PLAY","PULSE","RENAME","SAVE"
 DATA "SETTICK","STATIC", "TIMER","VAR","BITBANG","CHDIR","COLOUR","DHT22","ERASE"
 DATA "FOR","I2C","INPUT","LINE","LONGSTRING","MEMORY","NEXT","PAGE","POKE","PWM","RESTORE"
 DATA "SEEK","SORT","TRACE","WATCHDOG","BLIT","CIRCLE","CONST","DAC","DIM","ELSEIF","ERROR"
 DATA "FRAMEBUFFER","I2C2","IR","LOOP","MID","ON","PAUSE","POLYGON","RBOX","RETURN","SPI"
 DATA "TEMPR","START","TRIANGLE","WHILE","THEN","INSTR","CHR","ASC","VAL","STR","AND"
 DATA "OR","XOR","INV","INT","WRITE","SHOW","NOT","SKIP","LOADARRAY","SPACE","RGB"
 DATA "LEN","LEFT","RIGHT","EOF","MAX","MIN","COLOR","UCASE","LCASE","LCOMPARE","HIDE"
 DATA "SAFE", "MM", "INFO", "DEVICE", "ERRNO", "ERRMSG", "HRES", "VRES", "PEEK", "MOD"
 DATA "INTEGER", "STRING", "FLOAT", "OFF", "OUTPUT", "RANDOM"
 DATA "INCLUDE", "TO", "LENGTH", "UNTIL","IR","LS"
 DATA "ABS", "ACOS", "ASC", "ASIN", "ATAN2", "ATN","BAUDRATE","BIN"
 DATA "BIN2STR", "BOUND", "CINT", "CLASSIC", "COS","CWD"
 DATA "DATETIME", "DAY", "DEG", "DIR", "DISTANCE", "EPPOCH", "EVAL", "EXP"
 DATA "FIELD", "FIX", "FORMAT", "GETSCANLINE", "GPS", "HEX", "INKEY", "KEYDOWN"
 DATA "LGETBYTE", "LGETSTR", "LINSTR", "LLEN", "LOC", "LOF", "LOG", "NUNCHUK", "OCT"
 DATA "PI", "PULSIN", "RAD", "RND", "SGN", "SIN","STR2BIN", "SQR", "STR", "TAB", "TAN"


Epsilon CMM2 projects
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 227
Posted: 03:16pm 22 Nov 2020
Copy link to clipboard 
Print this post

  epsilon said  I'm holding out for vegipete's upcoming Ultrabox implementation for the file dialog/explorer type of functionality.

The keyword list is customizable.

Great, thanks.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 07:27pm 22 Nov 2020
Copy link to clipboard 
Print this post

  epsilon said  I'm holding out for vegipete's upcoming Ultrabox implementation for the file dialog/explorer type of functionality.

Yeah, I get the hint.

I was side tracked with the octahedron and my latest game porting. This game though needs the ability for the user to select a file, so I must get back at it.

I was working on a dialog box routine but perhaps I was getting ahead of myself trying to encode colour in the display string. Back to basics.

====================
For XEdit, I don't understand why you would bother make it work via serial port at all. My CMM2 is connected via serial port to a PC. When I need to do some serious editing, I use Notepad++. To me it makes no sense to use an editor on the CMM2 via serial port when the host computer can do a so much better job. I _do_ use the built in editor for quick tests, syntax fixes, etc but as soon as more extensive editing is required, I "LIST ALL" the program back to the PC and work there.

Now it would be cool if there were an OPTION that allowed us to change what got used when the "EDIT" command is typed.
Visit Vegipete's *Mite Library for cool programs.
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 425
Posted: 10:57am 24 Nov 2020
Copy link to clipboard 
Print this post

  epsilon said  
XEdit Text Editor for Color Maximite 2 by Epsilon
-------------------------------------------------
Current Version: 0.3



hi
good job

just 1 question:
Why I can't use black color for background
when I change to RGB(0,0,0), all text color and back color are same


CONST BG_COLOR% = RGB(0,0,0)
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 11:37am 24 Nov 2020
Copy link to clipboard 
Print this post

  goc30 said  
Why I can't use black color for background
when I change to RGB(0,0,0), all text color and back color are same


It has to do with black being treated as transparent, which is used for the syntax highlighting implementation (Syntax highlighting is actually inverted printing over colored boxes).

The darkest gray that doesn't get mapped to black in MODE 1,8 appears to be RGB(32,32,32). On my old monitor this is indistinguishable from true black.
Epsilon CMM2 projects
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 12:43pm 24 Nov 2020
Copy link to clipboard 
Print this post

  Quote  The darkest gray that doesn't get mapped to black in MODE 1,8 appears to be RGB(32,32,32).


Watch for V5.06.00b6. I'm introducing a new "colour" - NOTBLACK. For any mode this will be the darkest colour that can be displayed that will not act as transparent. I'll also make a change to the colour map so in 8-bit modes this colour really does look BLACK
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 02:23pm 24 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  
Watch for V5.06.00b6. I'm introducing a new "colour" - NOTBLACK. For any mode this will be the darkest colour that can be displayed that will not act as transparent. I'll also make a change to the colour map so in 8-bit modes this colour really does look BLACK


Perfect. Thank you Peter!
On the topic of transparency, I was wondering if there's an as of yet undocumented m-value in the PRINT @(x,y,m) expression that does a 'transparent letters, background colored background' print? Currently, to achieve that effect I do a PRINT @(x,y,2) using black background, followed by a BLIT of that row of text to another page using 'orientation' value 4.
Epsilon CMM2 projects
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 02:45pm 24 Nov 2020
Copy link to clipboard 
Print this post

Hi epsilon,
isn't better to finish DATA with some special word and use it for calculating the count and dimensioning of the array. You need to go through it 2 times, but it's small array...

DIM NUM_COMMANDS% = -1
DIM STRING keyWord = ""
DATA_WITH_KEYWORDS:
DATA "ADC","BOX","CLEAR","CONTINUE","DATA","DO","END","SELECT","EXECUTE","EXIT","SUB","FUNCTION"
...
DATA "PI", "PULSIN", "RAD", "RND", "SGN", "SIN","STR2BIN", "SQR", "STR", "TAB", "TAN", "eNdOfKeYwOrDs"
RESTORE DATA_WITH_KEYWORDS
DO WHILE keyWord <> "eNdOfKeYwOrDs"
      INC NUM_COMMANDS%
LOOP
RESTORE DATA_WITH_KEYWORDS
DIM CMD_LIST$(NUM_COMMANDS%) LENGTH 16
FOR NUM_COMMANDS% = 0 TO NUM_COMMANDS%
      READ LIST$(NUM_COMMANDS%)
NEXT NUM_COMMANDS%
NUM_COMMANDS% = UBOUND(LIST$()) 'I'm not sure if after loop is NUM_COMMANDS% +1 higher


You then don't need to calculate keywords number...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 03:01pm 24 Nov 2020
Copy link to clipboard 
Print this post

Good idea Jiri. I'll make that change. Thank you for the suggestion!
Epsilon CMM2 projects
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 12:10pm 25 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  The darkest gray that doesn't get mapped to black in MODE 1,8 appears to be RGB(32,32,32).


Watch for V5.06.00b6. I'm introducing a new "colour" - NOTBLACK. For any mode this will be the darkest colour that can be displayed that will not act as transparent. I'll also make a change to the colour map so in 8-bit modes this colour really does look BLACK

Peter, in the interest of readability, if you implement NOTBLACK as a predefined colour (shortcut form), would it be useful to also have TRASPARENT as a predefined colour shortcut ???

Just a thought.

Womble
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 12:24pm 25 Nov 2020
Copy link to clipboard 
Print this post

  Womble said  
  matherp said  
  Quote  The darkest gray that doesn't get mapped to black in MODE 1,8 appears to be RGB(32,32,32).


Watch for V5.06.00b6. I'm introducing a new "colour" - NOTBLACK. For any mode this will be the darkest colour that can be displayed that will not act as transparent. I'll also make a change to the colour map so in 8-bit modes this colour really does look BLACK

Peter, in the interest of readability, if you implement NOTBLACK as a predefined colour (shortcut form), would it be useful to also have TRASPARENT as a predefined colour shortcut ???

Just a thought.

Womble


I think normal BLACK will be transparent. For me make more sense to have BLACK as almost black (=opaque) and then to have TRANSPARENT as total bleck (=transparent)...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 12:26pm 25 Nov 2020
Copy link to clipboard 
Print this post

  jirsoft said  I think normal BLACK will be transparent. For me make more sense to have BLACK as almost black (=opaque) and then to have TRANSPARENT as total black (=transparent)...

Yes, that would make more sense  
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 12:56pm 25 Nov 2020
Copy link to clipboard 
Print this post

BLACK can't change as it would break many programs. NOTBLACK is what you get. Use or ignore as you wish
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 02:12pm 25 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  BLACK can't change as it would break many programs. NOTBLACK is what you get. Use or ignore as you wish

Fair enough, NOTBLACK it is.  Thanks for that Peter, I'm sure it will prove useful.
 
CardboardGuru
Newbie

Joined: 28/08/2020
Location: United Kingdom
Posts: 4
Posted: 10:43pm 26 Nov 2020
Copy link to clipboard 
Print this post

Is it possible to run BASIC programs from this editor, like you can with the built in editor?
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 08:43am 27 Nov 2020
Copy link to clipboard 
Print this post

Not currently, but I'll add that to the ever growing todo list.
I'm also working on a capability that lets you see from xedit the console screen as it was when you launched xedit, so you can see your trace list, previous program output, errors reported by MMbasic etc.
Epsilon CMM2 projects
 
     Page 2 of 4    
Print this page
© JAQ Software 2024