Another update.
The code has been extensively refactored, meaning it is now more readable, less ugly, and less likely to drive me insane.
What's new:
- dialogs and menus (started on)
- customization of fonts, colors, etc (started on)


Some eye candy.



with adjusted dialogs:

Update: with blinking cursor:
Update:
After another refactoring, I'm getting a weird error:

Code:
macro ? [224] :script.require [11] (CALM)
Error: symbol ':sections..libs?.length' is undefined or out of scope.
make: *** [bin/CEDIT.bin] Error 2

I have no idea what's causing it, although it seems to be a linker problem.
Any help is appreciated.
Michael0x18 wrote:



I love the style of the windows! They remind me of the dialog boxes on the TI-68k series. Keep up the great work!
Michael0x18 wrote:
Update:
After another refactoring, I'm getting a weird error:

Code:
macro ? [224] :script.require [11] (CALM)
Error: symbol ':sections..libs?.length' is undefined or out of scope.
make: *** [bin/CEDIT.bin] Error 2

I have no idea what's causing it, although it seems to be a linker problem.
Any help is appreciated.

Delete the "src_old" directory. I'm not sure why the toolchain is using it for linking; so I'll look into that tonight.

Also, some other things:

* You don't need to pass the same structure around to every function -- if you are going to do that, may as well just use a global. Generally what you want to try to do is separate your structures into the different things they do, for example a structure that is just input stuff, another that handles the screen layout and maybe another that handles the graphics. Then each file can just use the structure that is reserved for it.

* You shouldn't include every include file in the header like this: https://github.com/Michael0x18/CEdit/blob/master/src/dialogs.h#L11-L29
Includes should only be used to get the file they are in to compile. Otherwise you might have dependencies that your source files actually depend on, but are hidden by this include.

* https://github.com/Michael0x18/CEdit/blob/master/src/tigcclib.h#L95-L180 -- Declaring variables in header like this is not right. Every time this header is included in different source files, the variables are duplicated. Include guards don't protect against this sort of thing; they are only there to prevent inclusion in a single source file, not multiple.
These variables are fine to be global, but should really be static at the very least and defined in a C file.

* https://github.com/Michael0x18/CEdit/blob/master/src/main.c#L53 -- This should be "int main(int argc, char **argv)"

* https://github.com/Michael0x18/CEdit/blob/master/src/state.h#L33 -- Lowercase defines are generally discouraged; it is going to be fun to debug if you also name a variable "fw" and forget you had a define that represented it. Something more descriptive like "FONT_WIDTH" might be better. Same for the other defines.
Okay; thank you for the pointers.
I'll go and fix these things.
Quote:

* You don't need to pass the same structure around to every function -- if you are going to do that, may as well just use a global. Generally what you want to try to do is separate your structures into the different things they do, for example a structure that is just input stuff, another that handles the screen layout and maybe another that handles the graphics. Then each file can just use the structure that is reserved for it.

*groan*.
Now you tell me.whatever; it's fine. My code looks like Xlib now Razz - for the X windowing system
Double post, but it's a major update.

I revised the bottom bar to make the keys more intuitive, and I got cut/copy/paste working.



Here's the beta release link:
https://github.com/Michael0x18/CEdit/releases/tag/BETA.3
Thanks to beck, CEdit now supports BOS.
Can someone please take a look at the repo? I believe the file IO section for TIOS is broken: The text in the editor disappears after saving. I suspect there's a deeper problem because the code for that hasn't changed recently, and modifying other sections of code produces slightly different results.

Edit:

I have now fixed it. The issue was that the buffer was allocated with os_MemChk, and that means the memory wasn't really "allocated." And saving means creating a file in RAM. This overwrote the buffer. As a workaround, I have dropped the buffer size to 16384 bytes for TIOS, while leaving it at the full 64Kb for BOS. This allows the buffer to be moved into the main saferam area. (it's now on the bss again.)

I'm working on a release now; it'll probably be ready in a few days.
Also, when I have time, I'll open a pull request on the toolchain about mentioning this, because it's not really obvious
How does this compare to the other CE text editors?
arusher999 wrote:
How does this compare to the other CE text editors?

It's different. Most other editors have a specific format for appvars. CEdit is a general purpose editor.
New version available on github:
https://github.com/Michael0x18/CEdit/releases/tag/BETA.4
This version brings several important changes:
Fixed (more) bugs in the saving process
Custom colors
CEDITRC - the config file
And probably more things I've forgotten.
Screenshots:





Edit:
the "**"s around the filename do indicate that it's unsaved.
This looks really nice. I like the look of the dialog boxes the best I think. Does the * around the file name indicate it is unsaved?
New release!
https://github.com/Michael0x18/CEdit/releases/tag/BETA.0.01
I'll update with some screen shots later
I am pleased to announce that CEdit has reached the first release!
You can grab the release here: https://github.com/Michael0x18/CEdit/releases/tag/release.1
Some eye candy:








When's the upload to Cemetech coming? Razz

Just kidding, looks sick! Is there a text converter that my eyes are too blind to find?
I love the 68k-style dialog boxes and the style in general, very nice
I'm actually really annoyed at how good that looks, goodness! That's some really impressive work though honestly. Can't wait to try it.
All right, just a couple of things that need doing.
Currently, the entire editor is written in C, but it's rather unoptimized.
Specifically, what takes a long time is rendering the text to the screen.
Also, if someone wants to add python syntax highlighting, that would be great Very Happy
Here is the issues page:
https://github.com/Michael0x18/CEdit/issues
Update:

CEDIT is currently undergoing a complete rewrite, including the usage of a custom set of graphics routines instead of the ones provided with GraphX. The editor interface will use 4bpp, column major mode, freeing up the upper half of vram for use as the editor buffer. This will remove the 16Kb limit. Additionally, the color changes will be done by changing the palette itself, allowing the full range of the colors instead of just 256.
Sounds good! I particularly like the idea of changing the palette colors instead of the the color indices: that seems like it would be a pretty elegant solution. Out of curiosity, what moved you to rewrite this completely? I'm probably ignorant of the complexity of the project, but it seems like you could maybe just rework the graphics routines and change where the editor starts instead. "I didn't like how it was implemented before" is a perfectly fine answer.

Keep up the great work, looking forward to more updates!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement