Page 1 of 2

Thoughts on an IDE for nes development

Posted: Thu Apr 15, 2010 9:50 pm
by Banshaku
I have been toying around during my lunch time recently on how you could make an IDE for nes development with the scintilla component.

I first started with color highlighting in my lexer for ca65 and was able to reproduce the same color scheme that I defined in notepad++. I decided to push it further.

Now slowly I'm adding small options like extracting symbols like variables, procedure, constants and make them available with some auto-complete logic (for now file scope only), show comments and value (ex: PPU_ADDR shows $2002 because it found in in my header file) for a symbol on a mouse over, giving basic documentations on 6502 instructions (on mouse over again) etc.

It seems that it could take some time but if I continue that way, it could become something useful.

Now my question would be: if you had an ide for nes coding, what would be useful in your everyday coding?

I have a lot of things that I want to try but I will wait before I mention more on the subject to see if people are thinking about the same thing.

Posted: Fri Apr 16, 2010 3:51 am
by Rid
Excuse me for the question but doesn't nesicide is an efficient NES IDE?

Why bothering to create a new one ?

Posted: Fri Apr 16, 2010 5:53 am
by Banshaku
I don't want to dish nesicide but my goal is different than his. In the case of Nesicide he has his own assembler and is kind of a complete proprietary solution (that how it was for first one, I didn't check second one yet). In my case, I want to support the syntax of the assembler(s) that I like. Nesicide doesn't support ca65, my editor will. Basically what I'm making while toying with Scintilla is a specialized text editor that:

- Support CA65 (and maybe other ones in future)
- Support syntax color highlighting
- Recognize my symbols that I write in my project, project wide
- Can show me the content on mouse over of symbol
- Can give me online help for 6502 instructions
- Offer me intellisense like Visual studio for my symbol
- Show me a list of my function for current document
- Could validate my syntax (if I can make it goes that far)
- Give me some tool to re-factor variables when I rename one

So, back on the subject, what option that could be interesting for a nes "text" editor (I will remove the IDE in this case) for your favorite assembler then?

Posted: Fri Apr 16, 2010 7:30 am
by thefox
Just going to throw it out there for fun: This could also be done as an extension to Visual Studio. You can add support for new languages and even debugging. But the extension framework seems quite complex, so I doubt anybody is going to take the time to do anything with it. But it would be cooooool, IMO. It should be able to do most if not all of the stuff you listed if properly implemented.

Posted: Fri Apr 16, 2010 9:36 am
by tepples
thefox wrote:This could also be done as an extension to Visual Studio. You can add support for new languages and even debugging. But the extension framework seems quite complex, so I doubt anybody is going to take the time to do anything with it.
That and something based on Scintilla would work even if you don't happen to have a copy of Visual Studio. Do VS extensions work in the express edition? I seem to remember some extensions, such as the Windows Mobile SDK, requiring the paid versions of VS.

Posted: Fri Apr 16, 2010 9:44 am
by thefox
tepples wrote:
thefox wrote:This could also be done as an extension to Visual Studio. You can add support for new languages and even debugging. But the extension framework seems quite complex, so I doubt anybody is going to take the time to do anything with it.
That and something based on Scintilla would work even if you don't happen to have a copy of Visual Studio. Do VS extensions work in the express edition? I seem to remember some extensions, such as the Windows Mobile SDK, requiring the paid versions of VS.
AFAIK Visual Studio Shell can be used to distribute custom IDEs for free: http://stackoverflow.com/questions/9398 ... l-good-for But I'm not really an expert in any of this stuff.

Posted: Fri Apr 16, 2010 12:45 pm
by Rid
May be you could try to create an plugin for Eclipse. I've never work on them, but it seems you can use many features provided by Eclipse (auto-completion, refactoring tools, ...).
And most of all : it would be multi-platform :)

Posted: Fri Apr 16, 2010 5:43 pm
by Banshaku
@Tepples/TheFox:

I read a little bit on the subject and no, you don't need VS for distributing your package but some kind of stand alone player that is already 130 megs. A little bit of a heavy requirement. Then by reading TheFox link, you need all kind of thing to create your package like some valid key etc. That seems quite a painful process. But I agree, it would be interesting to have an extension to VS.

@Rid:

As for Eclipse.. I like the fact that it's multi-platform but I never felt at home with it. I prefer Visual studio. Maybe it's because I have been using it for a while I prefer the debugging feature that it offer.

My current prototyping is done with Scintilla with the .net wrapper and I'm using dockpanel suite for the tabbing function. For now my main goal was to be able to program a few things during my lunch time that could pass under the radar and I can use more or less 30-40 minutes when I'm lucky. I started to work on that idea to help me refresh on regex and to see if I could do my own lexer with scintilla or not. It went more far than expected (more than coloring). It's not operational yet. I use my current project as a test bed to see what I can do or not with the scintilla control.

For now I don't like the auto-complete with scintilla since I cannot receive an event when the auto complete stop on a specific item. I want to show information about the symbol when it's available. I may have to make my own.

But still, the main goal of the thread was not "it would be great to extend an ide" but more "if I had that option in my code editor, that would be great or save me time". I will give some example.

1- I don't code 6502 code often or rarely these days. Because of that, when I go back to coding, I tend to forget addressing mode, which bit are affected or how a specific instruction can be used. By having some simple mouse over help for basic options and online help, that save me time to hunt in a different document.

Mouse over and online help example
Image Image

2- I want to use symbol over pure address/value but I tend to forget their value. To mouse over a specific item and tell me the comment I wrote about it without opening the include file is useful.

Example:
Image

3- I don't remember all the symbol I wrote and it what scope. To have auto-complete for them is a time saver.

Example of auto-complete (but Scintilla one doesn't work well yet...):
Image

4- I use scope and struct often in ca65. If I had auto-complete for that, that would be great.

5- I would like to go automatically where a symbol is defined at a press of a button

6- (wishful thinking) If my code editor could check my syntax and found error that cannot be found by the compiler, that would be great.

Thinks like this. Those are not specific to integration in an IDE but just what I would find useful. Like mentioned, I'm just prototyping. This editor is not operational yet, just testing what I can do and how to do. I hope I can prototype an example of scope between file (i.e. I can see the symbols of the local file and included one without issue).

If it does become an editor someday, I want to support more than ca65 so it could be useful to other people too. I think once most of what I want to do in ca65 is done, doing it for other assembler that don't have scope should be a breeze.

Posted: Fri Apr 16, 2010 6:14 pm
by Anders_A
Did anyone try this out?

Posted: Fri Apr 16, 2010 7:44 pm
by cpow
Banshaku wrote:I don't want to dish nesicide but my goal is different than his.
Not so sure it's all that different. In fact, I could really use your help! You are correct about the first nesicide. The second nesicide still has an in-built assembler. It is ASM6 written in new clothes [flex/bison].
Banshaku wrote:Nesicide doesn't support ca65, my editor will.
The intent of nesicide is to contain an internal assembler to "get people going" but also to be externally hookable to a compiler/assembler/linker of user choice. I got to the point with the original nesicide of being able to interact with a stand-alone ASM6. The drawback there is that there was no efficient way to marry the assembler with the main tool [and get everything I wanted from the assembler for use with the debugger]. In the second nesicide with the internal assembler I can do things like step through the original source code. It currently works well for some NROM examples I've tried.
Banshaku wrote: - Support CA65 (and maybe other ones in future)
- Support syntax color highlighting
- Recognize my symbols that I write in my project, project wide
- Can show me the content on mouse over of symbol
- Can give me online help for 6502 instructions
- Offer me intellisense like Visual studio for my symbol
- Show me a list of my function for current document
- Could validate my syntax (if I can make it goes that far)
- Give me some tool to re-factor variables when I rename one
The second nesicide has a syntax colorizer that essial wrote back when he was helping me. He's long since disappeared, hence the need for more help! The assembler I wrote provides symbols, IR-to-file/line mappings and symbol addresses which can be used by the debugger. As a matter of fact I am probably minutes away from implementing symbolic debugging, which would include [in my hopes anyway] the 'hover over to inspect' variety.

Lastly the second nesicide is cross-platform...works on Linux, Windows, MacOS, etc.

Well...check out nesicide2 and see if you think it would be worth helping get your features into the IDE. I really could use the help and I agree that your list of planned or existing features is must have!

Posted: Fri Apr 16, 2010 10:13 pm
by Banshaku
Since my time for hobby is almost non existent with my second child and the rules that changed at work, my first goal for the prototype was to make a quick editor that would be useful right away to do some nes programming (and remove some stress from the current the boring stuff at work).

I will check how to get the source code of Nesicide 2 (git? Don't know the tool so I must figure that out first), try to compile it and see what it does. After that I can see if I can contribute some of the thing I want to do in my code editor. If there is any doc on how to make it work on the windows platform, I would like to read it because from my quick overview of the site, the information seemed to be lacking (maybe I didn't check properly).

But still, what would be the other "must have" option for the code editor? Multi-assembler support? Other things that could be useful?

Posted: Sat Apr 17, 2010 12:28 am
by thefox
Anders_A wrote:Did anyone try this out?
Hadn't heard of it before. Downloaded it but couldn't get it to work (seems to require something more than just the regsvr).

Anyways, good work Banshaku. If you can get something like this to work well it's going to be very useful. Just be careful about adding features, it's better to have a few features that work well than a bunch that don't. Also don't neglect the basic features that you would find in any text editor.

Posted: Sat Apr 17, 2010 3:05 am
by Banshaku
thefox wrote:
Anders_A wrote:Did anyone try this out?
Hadn't heard of it before. Downloaded it but couldn't get it to work (seems to require something more than just the regsvr).
Same thing here. DLL is not enough unless I missed something. But still, I guess what it would cover is syntax highlighting. There is no documentation so it's hard to know what it does actually.
thefox wrote: Anyways, good work Banshaku. If you can get something like this to work well it's going to be very useful. Just be careful about adding features, it's better to have a few features that work well than a bunch that don't. Also don't neglect the basic features that you would find in any text editor.
Yeah. For now I'm only prototyping ideas but I want to get out of that phase soon since already it would be useful to edit some of my code. To make it more viable, I need to add a project explorer. Then the next step is to be able to see symbols across file when the scope apply. Once this is done, that would already be quite useful.

There is still the grunt job of defining the complete help file from this reference (I asked permission long time ago) and the mouse over reference too.

As for the text editing, the scintilla control by itself covers many editing need which is a good thing. What is left it to program a few things like commenting up code and a few other things. I just hope I can get something working soon because I already want to use it myself.

Posted: Sat Apr 17, 2010 5:54 pm
by albailey
Rid wrote:May be you could try to create an plugin for Eclipse. I've never work on them, but it seems you can use many features provided by Eclipse (auto-completion, refactoring tools, ...).
And most of all : it would be multi-platform :)
I actually started working on a NES IDE using Eclipse Plugins, but I don't have Eclipse Plugin experience so for me it has been a painful ordeal, and I have next to nothing to show for it. My short term goals are to simply have the ability to run external tools (assemblers, emulators, etc..) and over time provide a more integrated experience.

Prior to that I just created a standalone java program that ran several of the tools I'd written (nametable layout, sprite drawing, converting images to NES format, etc..) but I think most of us dream of the day when we can do NES development as easily as we can develop for other languages and platforms.

Al

Posted: Sat Apr 17, 2010 6:45 pm
by tepples
Can Eclipse itself run GNU Make? If so, a makefile can run most of your external tools for you. If not, I'd be surprised.