PrEditor Alpha 005
CassLan
Posts: 586
OK here is an Alpha version of PrEditor.
It has bugs, but hopefully if people give it a try, we can find them and squish them quicker.
What you need to run/use it:
Propeller
SD Card / uSD Card*
KeyBoard
Display - Composite or VGA compatible
To Choose between the Display options, You want to change the value of the DisplayChoice constant, and make sure that the one you want to use is uncommented in the OBJ Section.
Currently only choices 1 & 3 are working, the others will work when there is some more space. I will be moving· a bunch of static data to the SD card, this will free up space to use these other drivers in the future.
If you want PAL, change the DisplayMode to 0, this is currently only supported if DisplayChoice=1 (TV_Text_HalfHeight)
* on your SD or uSD card, you need a file called "swap.sys" you can either rename a large file with that name or create a new blank file with that name.
For Windows users here is a command to create a new blank file :"fsutil file createnew swap.sys <SizeInBytes>", just replace SizeInBytes with a number (10000000 = ~10MB).
I am using a 10MB file, if you want to open up something larger than that, then you need a larger swap.sys file. I wouldn't make one less than 1MB though.
Once you have your swap.sys file, I would BACKUP ALL DATA you want on your SD, format it, copy the swap.sys to it first, then whatever else was on it.
I really don't want anyone to loose something they need so you have been warned.
The Pin/xtal definitions are currently setup for a Demo Board, the only Pin Definition that is not a Constant up top is the DisplayBasePin, this is located in the pub DisplayConfig (pic below) Change this to match your needs.
*WARNING* DO not open the swap.sys file with PrEditor!! (I will put something in later to not display this file as an option)
A Complete feature and shortcut key list is in the works but basicly everything on the File Menu works (New, Open, Save, Save As, Exit), and thats it currently.
You can get the file Menu by hitting Alt-F, I would like the F to light up when you press Alt, but thats not setup right now.
EDITS:
Alpha-006 - Fixed Issue where up/down arrow would place the cursor on the 2nd column of the target line instead of the column you came from or end of that line.
Alpha-005 - Added Special Character Insertion Menu under the Help Tool bar, Switched Screen Backup Buffer to vMem.
Alpha-004·- Switched to FSRW 2.6 using safe_spi with added vMem by MagIO2 ;o) - This resolved some hardware compatibility issues I was having with various boards.
Alpha-003·- Fixed Bug which would de-synch the GAP Buffer and the Parser Buffer - Uploaded Alpha-003, Added Ariba's Compressed Swap.sys file up here.
Alpha-002·- Updated to allow easier switch to PAL, also changed some colors that would cause a PAL display to loose synch (Doubled Checked, now that last statement is true)
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PrEditor·- Text Editor
NYC Area Prop Club
Post Edited (CassLan) : 1/22/2010 2:08:49 PM GMT
It has bugs, but hopefully if people give it a try, we can find them and squish them quicker.
What you need to run/use it:
Propeller
SD Card / uSD Card*
KeyBoard
Display - Composite or VGA compatible
To Choose between the Display options, You want to change the value of the DisplayChoice constant, and make sure that the one you want to use is uncommented in the OBJ Section.
Currently only choices 1 & 3 are working, the others will work when there is some more space. I will be moving· a bunch of static data to the SD card, this will free up space to use these other drivers in the future.
If you want PAL, change the DisplayMode to 0, this is currently only supported if DisplayChoice=1 (TV_Text_HalfHeight)
* on your SD or uSD card, you need a file called "swap.sys" you can either rename a large file with that name or create a new blank file with that name.
For Windows users here is a command to create a new blank file :"fsutil file createnew swap.sys <SizeInBytes>", just replace SizeInBytes with a number (10000000 = ~10MB).
I am using a 10MB file, if you want to open up something larger than that, then you need a larger swap.sys file. I wouldn't make one less than 1MB though.
Once you have your swap.sys file, I would BACKUP ALL DATA you want on your SD, format it, copy the swap.sys to it first, then whatever else was on it.
I really don't want anyone to loose something they need so you have been warned.
The Pin/xtal definitions are currently setup for a Demo Board, the only Pin Definition that is not a Constant up top is the DisplayBasePin, this is located in the pub DisplayConfig (pic below) Change this to match your needs.
*WARNING* DO not open the swap.sys file with PrEditor!! (I will put something in later to not display this file as an option)
A Complete feature and shortcut key list is in the works but basicly everything on the File Menu works (New, Open, Save, Save As, Exit), and thats it currently.
You can get the file Menu by hitting Alt-F, I would like the F to light up when you press Alt, but thats not setup right now.
EDITS:
Alpha-006 - Fixed Issue where up/down arrow would place the cursor on the 2nd column of the target line instead of the column you came from or end of that line.
Alpha-005 - Added Special Character Insertion Menu under the Help Tool bar, Switched Screen Backup Buffer to vMem.
Alpha-004·- Switched to FSRW 2.6 using safe_spi with added vMem by MagIO2 ;o) - This resolved some hardware compatibility issues I was having with various boards.
Alpha-003·- Fixed Bug which would de-synch the GAP Buffer and the Parser Buffer - Uploaded Alpha-003, Added Ariba's Compressed Swap.sys file up here.
Alpha-002·- Updated to allow easier switch to PAL, also changed some colors that would cause a PAL display to loose synch (Doubled Checked, now that last statement is true)
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PrEditor·- Text Editor
NYC Area Prop Club
Post Edited (CassLan) : 1/22/2010 2:08:49 PM GMT
Comments
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
But here are some ideas on how to decrease the size:
Use·vMem ;o) I mean, you can have a second·vMem file which contains the PASM part of all the drivers - except the SD card driver of course. This file can simply be delivered with Prediter, no user has to create it by himself.
Remember, slot·0 and·1 are used for gap-buffer, but you still have 2 other slots. And you can attach each slot to another file.
You can put all the dropdown menus into vMem. No need to draw them in Preditor. You only need an extra program to draw it initially and then store it in vMem. Have dropdown menus, popup windows, error messages ... whatever ... any number you want and it won't eat any HUB RAM.
Put the screen backup into vMem.
Put the initial screen into vMem. Just load it directly in the screenbuffer.
Settings dialog ... Ascii-Art ...
·
If a swap.sys file exists on the sd card, maybe it could exist on an external ram as well? If so, it could open up a way to faster code.
Dumb question here, but what is PrEditor? Is it a text file editor? Can it do more, eg exist within an operating system of some sort?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
A question: Does the SWAP.SYS need to be $0 filled (or anything else)? If $E5 are ok, then I can post an 8MB file (or sift through the TriBlade or ZiCOg threads for a blank disk format) which can be copied to uSD.
Drac: It's a text editor and can work with big files. Hopefully we can combine it into SphinxOS soon. And yes, we will have to get it to use the RAM as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Thanks, its been a long time coming.
MagIO2: Good idea about the storage of the PASM Drivers on the SD. Do you not have any composite screen besides the brilldea screen, TV_Text_HH does PAL.
Dr_Acula: You know something, after seeing your post I looked and it says nothing about what it actually is. I had meant to put a video up, but my capture device is encoding in something youtube doesn't like.
PrEditor is meant to be a full fledged text editor, cut, copy paste, search, special character insertion etc.
Whats posted is only the core operation at the moment. Yes, it could be run off of RAM, but at the moment its really as fast as the keyboard repeat timing.
The end goal in sight for me is to eventually add the indention Lines (like proptool does) and some other things, to make this a usefull program for people to write code in for the prop. Then it can be compiled with Sphinx.
Cluso99: The swap.sys doesn't need to be $0, its really not relevant whats inside of it, as the nature of the Gap buffer is to put the data in sequential order at a pre-defined starting point. Then it just keeps track·of·the first and last address.·I'm sure remnents of all the files I have been working with still have peices floating·in mine.
There is a method called VMInitialize(ByteCount) which will zero the swap.sys file if you want. I mainly used this while setting up the Gap buffer sceme initially for debuging.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
Post Edited (CassLan) : 1/17/2010 5:15:50 AM GMT
looks promising !
Sometimes when I load a big file, scroll down more than a page und up again, the lines are not in sync with the screen.
> "... TV_Text_HH does PAL"
Yes, if you not had hardcoded the NTSC mode in Half_Height_Text
Tooks me half an hour to find out, why changing to PAL not works -> the $01 colors in the palette were it.
I have attached the PAL version for the Half_Height_Text driver, and a zipped swap.sys with 8 MByte. The swap has all zeros, and is therfore compressable over 99 %.
Andy
I see some interesting synergies here. Eg, you fire up Sphinx, run the text editor, save a big prop file, then compile it (Sphinx again?).
But in a general sense, if you have a huge text file and you are moving bits in and out so you can focus on the bit you are interested in, that is not really much different to running a big program, and moving bits of that big program in and out of hub memory. As long as the big program doesn't jump around too much (and it wouldn't if you wrote it carefully), then you could run huge programs.
I see intriguing possibilities here.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
PrEditor is a big piece of the puzzle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Interesting about the scrolling, do you know if the file is·line terminated·with a CR then a Linefeed? This is also hardcoded at the moment.
And the problem only occurs when you scroll up?
Dr_Acula: The vMem functions added to fsrw by MagIO2·are how the swap.sys file gets used, I found it very helpfull. You just treat it like a large byte addressable peice of memory. Its pretty fast when you want to pull data or write it in large chunks, I did find that decision making based off reading individual bytes from it was kind of slow for what I was doing, so I use HUB Ram as a sort of shadow of it for decision making.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
I only got a bit distracted, as I received the gadgetganster propeller boards. I now see the need to have a layer which makes it possible to run one program on different setups ;o) So, maybe the next OS is comeing the next months.
Back to vMem, you should only keep the addresses flexible in code that usese vMem. For example the Preditor currently uses vMem for the gap-buffer. If Rick keeps the code flexible he later on can simply change the start-address of the gap-buffer and then the Preditor will use RAM instead of the SD-card.
For the menus and screens and other things that rarely change he can still use an address range mapped to SD.
AND yep ... with some minor changes in the SPIN interpreter it should easyly be possible to run HUGE SPIN programs in vMem. But it would also need some changes in the SPIN compiler. Nifty idea, but no time currently.
@Rick: don't have a TV in my lab ... would distract to much ... let's see ... maybe I can solder a connector to an old VGA monitor this evening.
This I can reproduce:
1. Load "ed.spn" from SD card. This file has CR-LFs and is 15kB big.
2. Scroll down until you see: pri Args, or a bit more. (> 95 lines)
3. Move the cursor some characters right in the line, and back to column 0
4. Scroll down another line or two
5. When you move the cursor right and left, now you get characters from another line at the cursor position, and other strange things happen.
"ed.spn" is part of Sphinx, but I have attached it, so that you not need to search it.
Andy
The color $02, looks the same to me on NTSC as $01 so I've just changed it to $02.
Also it seems my monitor can run PAL·so I have a simple way to test. I will update the top thread with a revision to switch to PAL.
As for the bug, I did what you said and I see it, I will check on that now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
And I had a copy of codegen.spn named codegen2.spn and when I opened that it crashed and corrupted the sd card [noparse]:)[/noparse].
I thought I had changed the $01s to $02s in the most recent upload; I must not have saved it. I will sort that now.
Did you also have a problem with $3C for cyan?
I will try the codegen2.spn out and see what happens.
EDIT: stevenmess I can't find codegen.spn, was it codegen.bin?
I opened up codegen.bin and its giberish on screen, but I could still add characters to it, etc.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
Post Edited (CassLan) : 1/19/2010 6:27:13 PM GMT
I believe I've taken care of that bug.
The GapTransferOne(dir) function was removed, all references to that now use GapTransfer(dir,count).
I made the GapTransferOne(dir) Function at a time when I didn't have the smallbuffer[noparse]/noparse, and the GapTransfer(dir,count) function was using what later became the shadow buffer.
Thanks for Bringing it to my attention. I think maybe the issue was calling one of the vMem functions recursively..ie vbpeek(vbPoke), but I'm not sure, either way it doesn't do that anymore.
Uploaded at top of thread. Only Changed File is "Pred_Alpha.spin"
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
This version works much better. And also PAL is no problem anymore.
When the cursor is not at left margin and you move it up or down, it jumps to column 2, is this intended?
And if you have scrolled right horizontally, the cursor can't be moved in y direction.
What I miss most is: Page Up/Down, especially for big files.
Andy
I don't know if the other colours caused any problems, I just loaded up the colour palette program and then chose colours that were the closest to what was the list in tv_text.
It's the alpha version ... please be patient ... Rick already mentioned that a lot of stuff will be added when he cleaned up some HUB-RAM.
About possible problems with SD card:
When I remember right I used FSRW 2.5 for the vMem. It has a timing which is on the edge of what's working. For example with my SD card using pins 16-19 I had problems to run the FSRW-test-program. Then we figured out that choosing another COG (calling COGINIT instead of COGNEW in FSRW.start) fixed the problem. Have a look into the FSRW-code. If you find a COGINIT you should maybe choose another COG.
I guess next preditor will come with FSRW2.6 which should be more stable with all setups.
I'm going to try fsrw2.6 today with that new board and see.
@stevenmess2004:
Ahh that file only uses LFs (Unix/Mac) and not CR+LF, I'm working on that.
@Ariba:
>>When the cursor is not at left margin and you move it up or down, it jumps to column 2, is this intended?
>>And if you have scrolled right horizontally, the cursor can't be moved in y direction.
The column 2 is not intended, its supposed to go to the same column or the end of the line if it is shorter, I thought that was working, I will check it out.
I will look into the vertical scroll when horizonatally offset as well, its the same area of code.
Yeah Page Up/Down next addition [noparse]:)[/noparse]
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club
Prop Forum Search (Via Google)
·
Also I moved the Screen Backup Buffer to vMem works like a charm.
Code up top.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PrEditor·- Text Editor
NYC Area Prop Club