Help : how to get nice 6502 syntax colouring on Notepad++ ?

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

Moderator: Moderators

Post Reply
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Help : how to get nice 6502 syntax colouring on Notepad++ ?

Post by Bregalad »

Everything is in the title. I am not too bad at programming computers but I suck at using other people's programs.
I know I somehow managed to make my own plugin for that years ago on an old version but now I couldn't port it to my new computers after reinstallation of Windows, so I have no idea how I made it and it seems all the menus/etc... has changed since then anyways.
WedNESday
Posts: 1231
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by WedNESday »

Something wrong with Microsoft Visual Studio?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by tokumaru »

WedNESday wrote:Something wrong with Microsoft Visual Studio?
It's big, bloated and overkill for 6502 code?

Anyway, my old Notepad++ syntax file still works with more recent versions. I simply put my userDefineLang.xml file into %APPDATA%/Notepad++.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Bregalad »

Oh thanks, I didn't know it had to be in that location ! I tried Notepad++'s own folder, but that didn't work.

Well there's no links to your configuration file, but there is one to TheFox321's.
And I made it working but I have the following isses :

1) I don't like the font he's using it's way too big and it's not a monospace font (ok this is probably very easy to change manually)
2) I have to manually go to Language -> fox6502 every. single. time. Cannot it be made automatically for .asm files ?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by tokumaru »

Bregalad wrote:Well there's no links to your configuration file
I'm attaching it to this message, in case you want to check it out. I made it according to my own needs, so you might disagree with some of my choices.
I have to manually go to Language -> fox6502 every. single. time. Cannot it be made automatically for .asm files ?
Mine does that. Apparently there's an "ext" attribute you can use to associate the language definition to a file extension.
Attachments
userDefineLang.zip
(971 Bytes) Downloaded 147 times
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Sik »

I don't know what people think, but may I suggest using a different extension than .asm, e.g. .6502 or something like that? With different assembly languages around, I find that using separate extensions for each CPU is a good idea (e.g. for 68000 and Z80 I use .68k and .z80 respectively)
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by thefox »

It's pretty easy to create custom syntax colorings for Notepad++, especially if you base them on an existing syntax definition. Just go to "Language" -> "Define your language" menu. The new "user defined language" feature is also documented fairly well.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Bregalad »

Thank you very much Tokumaru, your syntax files makes my sources very beautiful. And it's better than the default X86 assembly skin that is loaded with .asm files.
Drag
Posts: 1350
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Drag »

One thing I'd like to suggest, which has helped me out a great deal with organizing my source code, was to define some "folders" (as my version of notepad++ calls it).

In C (for example), you can have something like:

Code: Select all

int butt() {
  an
  amazing
  amount
  of
  code
}
and most IDEs allow you to collapse what's between the { }.
Notepad++ lets you define what constitutes as the start and end of a collapsable block of code, and when defining my 6502 highlighting, I defined it as ";bs" and ";be".

So my assembly looks like this:

Code: Select all

routine_for_butts: ;bs
  A
  BUNCH
  OF
  OPCODES
butt_loop: ;bs
  HERE'S
  SOME
  MORE
  CODE
  BNE butt_loop
;be
  TIME
  TO
  CLEAN
  UP
  RTS
;be
and that allows me to collapse chunks of code like loops and subroutines, and because ;bs and ;be are interpreted as comments by the assembler, they don't interfere with anything. You can define it however you want, I just chose bs and be because "block start" and "block end". Derp.
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Kasumi »

Heh. I do the same thing. Except I didn't know there was a way to make them collapsible. I usually just used the find matching brace hotkey (ctrl+B) to skip around.

Code: Select all

div7:;{
	sta <reserved1F
	lsr a  
	lsr a  
	lsr a
	adc <reserved1F
	ror a
	lsr a
	lsr a
	adc <reserved1F
	ror a
	lsr a
	lsr a
	
	rts;}
But I should probably make them folders too.
Drag
Posts: 1350
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by Drag »

I highly recommend it; having them as actual folders makes it much easier.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Help : how to get nice 6502 syntax colouring on Notepad+

Post by thefox »

Drag wrote:I defined it as ";bs" and ";be".
For ca65 users it's quite natural to define them for .proc/.endproc and .scope/.endscope. I never thought about using special comments for them, but I guess that works just as well.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Post Reply