Notepad++ 6502 Highlighting

You can talk about almost anything that you want to on this board.

Moderator: Moderators

User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Notepad++ 6502 Highlighting

Post by 67726e »

I got bored a while back and made a 'User Defined Language' file that you can use with Notepad++. If anyone wants it, you can download it from my site: http://nesmods.com/resources/6502/.

Note: The reason I didn't provide a direct link is because it actually took me a little while to figure out how to get it 'installed' so I put a video tutorial on the page on how to do it.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Post by GradualGames »

I think I've seen a couple of others provide their own 6502 highlighters as well. I ended up hacking out my own, due to a need for seeing a totally black background. I've tried to use the global overrides but they don't usually look nice with built in language definitions or others' definitions.

One thing that I wish Notepad++ would do is add a feature where when you open a .asm file, your user-defined highlighter is used instead of the built in one. As far as I know there is no way to do this.
User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Post by 67726e »

Perhaps its just some dumb luck on my part but when I open up one of my .asm files, it opens the 6502 highlighting, not to mention I put a backup file extention of .650 just in case someone wants to be a little too organized.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Gradualore wrote:I ended up hacking out my own, due to a need for seeing a totally black background.
I ended up making my own too, because my preferences are always slightly different... =)
One thing that I wish Notepad++ would do is add a feature where you can load a user defined language for a given extension. The only ones for which this works are the built in ones, as far as I know. (So the built in asm highlighter is set up for x86, not 6502).
Don't ask me what I did, but my Notepad++ highlights 6502 code in files with the "asm" extension automatically. I believe there I specified the extension(s) somewhere...
User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Post by 67726e »

When you make the 'userDefinedLanguage' file, there is an option to add extension recognition. I am not sure how it decides which assembly to use, but I would guess it may check for keywords or something to see which one fits.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Maybe the user defined languages have the preference if they use the same extensions as the built in languages?
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Post by GradualGames »

Hmm, I'll have to take another look at that. I doubt it was dumb luck that it worked for you, I probably just didn't dig deep enough to make it work. All I did was go into I think view/user-defined-dialogue, and I did associate it with ".asm, " but so far npp still opens the default asm language. Did you actually replace the default one with your own or..?
User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Post by 67726e »

I meant dumb luck that the .asm extension took priority in the user-lang file as opposed to the already existent assembly language file.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Post by GradualGames »

Turns out the problem was, I had entered ".asm" instead of just "asm". When I changed it to "asm" my user defined lang overrode the default one. How refreshing to finally be able to open all my source files at once and not have to select my lang for each one I want to look at. :) I can't believe I put up with that for so long.
User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Post by 67726e »

Isn't that the way of things? The most mundane little detail can screw up an entire process.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

I think I had this problem before, just forgot about it.

For now I'm using Notepad++ but if my prototype for my ca65 text editor goes well, I may use it less for 6502 coding. The current concept is to allow syntax highlighting, pull down with name of symbols/function for finding them, suggestion for name based on the symbols defined in your code etc.

If it become more than a prototype, I may post it someday. For now I can only work only a few minutes per day during lunch time so I'm not expecting anything for a while. I have a few other ideas but unless I can make them work, I won't mention them yet.
3gengames
Formerly 65024U
Posts: 2284
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Sorry to bring this back up, but I just got tired of notepad and wanted something more useful but with the same. Got N++ and now this and want to say thanks so much. This is so helpful! Your work definitely doesn't go cherished here! :D
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

The main problem with Notepad (the built in Windows program) is that it doesn't automatically indent code, so every new line you have to hit the TAB key. At least that's what bothered me the most.
User avatar
67726e
Posts: 129
Joined: Sat Apr 03, 2010 5:45 pm
Location: South Carolina
Contact:

Post by 67726e »

Another problem I have with notepad is when you hit tab, it is about the size of two tabs in pretty much any code editor. I know some people advocate the 'two spaces' idea in lieu of a tab but I cannot do it.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Maybe that is me who am stupid, but I never got any of those downloaded .xml files to work (there 2 or 3 links around on this boards).

I made my own, but then I can use it but I have to manually select it every time I open a .asm file (which default to 386 ASM).
Useless, lumbering half-wits don't scare us.
Post Reply