Page 1 of 1

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

Posted: Wed Nov 12, 2014 6:32 am
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.

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

Posted: Wed Nov 12, 2014 7:49 am
by WedNESday
Something wrong with Microsoft Visual Studio?

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

Posted: Wed Nov 12, 2014 8:29 am
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++.

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

Posted: Wed Nov 12, 2014 3:38 pm
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 ?

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

Posted: Wed Nov 12, 2014 4:07 pm
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.

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

Posted: Wed Nov 12, 2014 10:22 pm
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)

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

Posted: Thu Nov 13, 2014 2:58 am
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.

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

Posted: Thu Nov 13, 2014 3:40 am
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.

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

Posted: Thu Nov 13, 2014 10:29 pm
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.

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

Posted: Thu Nov 13, 2014 10:38 pm
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.

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

Posted: Thu Nov 13, 2014 10:49 pm
by Drag
I highly recommend it; having them as actual folders makes it much easier.

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

Posted: Fri Nov 14, 2014 12:27 am
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.