Author Topic: Guts of a program editor  (Read 7367 times)

0 Members and 1 Guest are viewing this topic.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Guts of a program editor
« on: September 26, 2019, 01:34:52 pm »
A long time ago I made a small font program editor. At @Xeda112358's request I recently revived it and am working on beating it into a working shape. Im posting it here so I don't have to constantly upload to a 3rd party site every time I update it and on the off chance someone else might want to use it.
I'm still around... kind of.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Guts of a program editor
« Reply #1 on: September 26, 2019, 06:32:44 pm »
That menu looks so nice in your editor example! I'm about an hour from being able to actually check it out, but it all looks fantastic so far!

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Guts of a program editor
« Reply #2 on: October 17, 2019, 01:22:07 pm »
I want to be a part of this and help wherever I can. Whether it's testing for or giving ideas.
Grammer2 is Good!

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Guts of a program editor
« Reply #3 on: October 18, 2019, 08:34:09 am »
I want to be a part of this and help wherever I can. Whether it's testing for or giving ideas.
Ok, I kinda just threw it out there as a base for anyone to expand on but if you are interested, I can pick development back up. First, a couple questions for you so I know how experienced you are. Are you really comfortable with Axe? How familiar are you with assembly? Do you know what an edit buffer is? Do you know how to dynamically resize variables either using Memkit or using Bcalls? Do you know how memory mapping works? (ports 5, 6 and 7)
Its fine if you don't know any of these, I just need to know so I can figure out what parts you can help with.

Also you mentioned ideas. What do you have in mind? If I were to finish it I would add copy / paste, search, search + replace, jump to label, jump to line number, editing from archive, the ability to look at other programs without closing the current one, and others that I can't think of off hand.
I'm still around... kind of.

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Guts of a program editor
« Reply #4 on: October 23, 2019, 08:54:55 am »
So at the moment I'm just getting comfortable with Xeda Elenara's Grammer 2. I have a friend who is teaching me the absolute basics of Axe and I'm learning it on my own through comprehensive tutorials that I found and printed. I'm slowly learning assembly using the Learn Assembly in 28 Days tutorials. I printed the entire thing out, hole punched it, inserted it in a binder, and started reading. So as of now I'm able to understand a little assembly. Xeda's asm hex tutorials helped me with learning how the structure works.

As for edit buffer, I would assume that it is a temporary location for the data in programs, above the ram(as not to erase any user ram) that is used to edit the data. I might be wrong though. :angel:

Ideas are another thing. I just have a large imaginative range and I can help with UI. My current process is to make a BASIC version of my idea then port it to Grammer, as it is more optimized. Then after I've learned enough with Axe, I will port the Grammer Port to Axe because Axe is super fast. I can help with bug reporting to. I've done so a lot with Grammer.
Grammer2 is Good!

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Guts of a program editor
« Reply #5 on: October 23, 2019, 03:05:36 pm »
That gives me a pretty good idea of where you are at. Take a look at the UI I have implemented and tell me what you think of it. What do you think of everything from the way the cursor works to the size of the menus? Ive tried to make sure it feels just like the built in program editor. That way no one has to relearn their muscle memory. If there are any differences, that is a problem. Make sure to tell me. I know that alpha-scrolling is messed up and pressing numbers to select an item in a menu is a little off but the rest of it should be 100% accurate.

Don't bother trying to understand the editor's code. I don't know why it works, only that it does. And I wrote it.

I forgot to ask you if you know what tokens are. iirc Grammer uses them so you might know about them. (If you know the difference between tokens and characters then you are probably fine) Also do you have a emulator or some way of getting screenshots and recordings? If not, it is really easy and I can walk you through how to get it.
I'm still around... kind of.

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Guts of a program editor
« Reply #6 on: October 24, 2019, 12:19:15 pm »
I can easily download an emulator. Like most calculator lovers, they probably have a lot of background knowledge of some type of OS. I use Windows 10 and will probably download and install the most popular Wabbitemu.

I will try to get as much feedback on the program as I can muster. (I'm glad I'm not the only one who has muscle memory already  :P)

As for Tokens... It's kind of hard not to know what they are. I think the whole idea that everyone is sharing is adding customs tokens for custom editors so that no one has to use the BASIC Tokens and create hooks that disguise them so they are more readable and understandable.

Also, I'll probably figure it out but..., witch source do I compile first?

Grammer2 is Good!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Guts of a program editor
« Reply #7 on: October 24, 2019, 12:36:32 pm »
When you put it on your calculator, open Axe and compile prgmEDITORSC (it takes a little bit; it's a lot of code!)

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Guts of a program editor
« Reply #8 on: October 24, 2019, 01:35:46 pm »
Woah. The editor is super buggy. (I didn't expect that  O.O)
Grammer2 is Good!

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Guts of a program editor
« Reply #9 on: October 24, 2019, 01:44:49 pm »
So are you building it first before you optimize it?

A lot of the issues are with the menus I think. Every time I open a menu(except for the prgm menu) it freezes, opens the menu, then refreezes with random letters but not random numbers, then I have to pull the batteries.
Grammer2 is Good!

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Guts of a program editor
« Reply #10 on: October 24, 2019, 06:16:06 pm »
When you put it on your calculator, open Axe and compile prgmEDITORSC (it takes a little bit; it's a lot of code!)
A little bit? You should see my 'main' project. The executable is over 100k and takes almost a half hour to do a full recompile.

So are you building it first before you optimize it?

A lot of the issues are with the menus I think. Every time I open a menu(except for the prgm menu) it freezes, opens the menu, then refreezes with random letters but not random numbers, then I have to pull the batteries.
Oh, yea. I forgot about that. I messed something up with the loop that selects the tokens. It doesn't *actually* freeze, just displays so many tokens on the screen at once that it is like 5 secs between frames.

As for optimizing it, the core of it is as optimized as it is going to get. The cursor movement and scrolling was a huge pain to get right and I'm not spending 10 hours optimizing it and fixing all the bugs I made for a boost in speed which won't matter once I limit the framerate. Not that it is terribly inefficient or anything though. Almost all the cpu's time is spent on text and displaying the screen. Im using a custom text routine that I made that is 2x faster than the OS's and Ill eventually make a custom lcd update that is 6+ times faster than the default one Axe is using. (partial update instead of the whole screen) Speed isn't an issue. And since the finished editor will be an app anyway space doesn't really matter. I think that pressing 2nd + right to scroll to the end of a really, really long line of code takes a long time but Ill deal with it later. Trying to scroll past the bottom line might be an issue.

Ill work intermittently on this as I find time / motivation. Don't expect speedy updates though. The whole reason I put this up was to help Zeda since she? is making one for Grammer 3. From what I have heard of what is done though, I don't know why mine is needed. That might get more constant updates but I really don't know.
I'm still around... kind of.