Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Text editors

Reply to topic
Author Message
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Text editors
Post Posted: Sat Aug 30, 2014 11:04 am
[Discussion split from http://www.smspower.org/forums/viewtopic.php?t=14900]

Maxim wrote
(I have an unpublished WLA Z80 highlighter for Notepad++ that gets you code folding, but it's not as nicely integrated in other respects; I have improved the compiler batch file too), which would also let you learn what's going on underneath.

Will you publish this highlighter in the future?
Or do you recommend to stay with ConTEXT instead?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Sun Aug 31, 2014 12:52 pm
NP++ has some very annoying issues for me, so I'm hoping someone will produce something better. Sublime Text offers some very nice possibilities, but is not free.

I'm open to suggestions for better text editors; ideally, I'd like intelligent autocomplete (e.g. suggest valid things after I type "ld", plus complete labels for me) and the ability to sometimes show help for opcodes (for seeing cycle counts and flag effects), and configurable enough to let me teach it WLA DX syntax.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Dec 2005
  • Posts: 607
  • Location: São Paulo - Brazil
Reply with quote
Post Posted: Sun Aug 31, 2014 5:00 pm
There's Vim :) I was an user till I found PhpStorm from Jetbrains (and it emulates Vim!).

Any editor from Jetbrains is a good choice :)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Sun Aug 31, 2014 8:07 pm
:wq

If JetBrains would do a Z80 IDE I'd be happy to use it. I'd still like to use an editor with sane key bindings, or at least supporting standard ones.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Dec 2005
  • Posts: 607
  • Location: São Paulo - Brazil
Reply with quote
Post Posted: Sun Aug 31, 2014 11:33 pm
You saved and quited if in Normal mode, that means you dig vim ?

Phpstorm is very expandable, color coding and inline help are easy to do, I don't know about code completion.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Mon Sep 01, 2014 3:40 pm
<offtopic>

":wq" means "thank god I'm finished, get me out of here". There's also ":q!" which means "I got into such a mess by typing text into command mode, and I don't know how to undo it, please let me out so I can start again". Although I've spent plenty of time in vim for lack of any other editor.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Dec 2005
  • Posts: 607
  • Location: São Paulo - Brazil
Reply with quote
Post Posted: Mon Sep 01, 2014 4:54 pm
Yeah it's an 8 / 80 situation.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3761
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Sep 01, 2014 7:37 pm
http://en.wikipedia.org/wiki/Comparison_of_text_editors#Programming_features
here it says ConText has autocompletion too :|
I'm using Programmer's Notepad when coding for NDS/GBA, and it's good. Again, it should have autocompletion but I've never seen it.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Tue Sep 02, 2014 8:56 am
That's the kind of page that I dread seeing on Wikipedia - way too many rows, inaccurate information, and not covering what I actually need (there's a huge difference between syntax highlighting and user-defined syntax highlighting). Completely useless for actually making a decision.

Anyway, I split this off so we can discuss it more here. I realise text editors are a very religion-like choice, but let's post opinions about what we've actually tried.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Notepad++
Post Posted: Tue Sep 02, 2014 9:08 am
Last edited by Maxim on Sun Aug 16, 2020 11:41 pm; edited 5 times in total
Plus:
- user configurable syntax highlighting based on text tokens
- code folding (simplistic, doesn't notice mismatched start/end)
- basic autocomplete (just autocompletes based on every token in the file)
- lots of features, and a reasonably lively plugin community
- free as in beer

Minus:
- uses way too much CPU when you load a disassembly (unless you turn off autocomplete, syntax highlighting and URL detection)
- a bit rough around the edges
- seems not to be a nice way to configure compile/run commands with compile error support
- I didn't find a way to use bookmarks

Attached is a syntax highlighter definition, go to Language -> Define your language... -> Import...

My conclusion: I'm using this right now but why the hell am I manually invoking the assembler and launching Meka? Because nppexec is ridiculous, and nothing else seems to exist to do the job! Also, I typed "hlhl'" into a comment and now I find it hard to type "hl"! Grr...

Edit: updated highlighter for WLA DX 9.11 as at 2020-08-17. This highlighter is free for anyone to use for any purpose, under the WTFPL.

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Sep 02, 2014 9:11 am
I am using simple stuff like UltraEdit or Notepad2. I never tried or longed for syntax colouring, it seems a little overkill to me for Z80 assembly, so it instruction completion (I often have a Z80 sheet list open around).

Perhaps a solution would be to have a system where:
- the source code is assembled in the background on every edit (parsing errors, etc.)
- compiled code gets reloaded by emulator which can provide extra information live. if we had a standard way to inform the emulator of: breakpoint position and cursor position, the emulator could leverage those.

Or write a standalone program that does the live compilation/showing information in a separate window and you can have that open next to an editor. Perhaps the software can become a "service" that some text editor script can query.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2013
  • Posts: 200
Reply with quote
Post Posted: Tue Sep 02, 2014 10:21 am
I use Notepad++ primarily because it's portable, I travel a lot and code when I can on different computers. I've created a colouring scheme for oz80, demoed here:



I think colouring of comments is the most important, it makes it a lot easier to skim.
oz80_colouring.png (86.48 KB)
oz80_colouring.png

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
ConTEXT
Post Posted: Tue Sep 02, 2014 10:47 am
Last edited by Maxim on Tue Sep 02, 2014 10:54 am; edited 1 time in total
The first nice editor I found way back when I was first looking for one.

Plus:
- User-configurable syntax highlighters
- Reserves four F-keys for running tools against your code, configurable per file extension
- Parses command output for click-to-jump-to-error
- Seems to stay fast with large-ish files
- Relatively small feature set
- Free as in beer

Minus:
- Abandoned
- Falls over picking up errors in WLA-Z80 and WLALINK output where they differ slightly
- No code folding
- No autocomplete
- Very limited macros
- Relatively small feature set

My conclusion: I used and recommended it for years, but I'm sure there must be something better out there by now.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3761
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Sep 02, 2014 10:52 am
Maxim wrote
That's the kind of page that I dread seeing on Wikipedia - way too many rows, inaccurate information, and not covering what I actually need (there's a huge difference between syntax highlighting and user-defined syntax highlighting). Completely useless for actually making a decision.


True, I meant to post it as a list of possible candidates for evaluation.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Sublime Text
Post Posted: Tue Sep 02, 2014 10:54 am
The current flavour of the month?

Plus:
- Seems to be immensely powerful and extensible
- Very rich plugin interface
- Lively plugin community (Z80 stuff exists, WLA-Z80 not?)
- Dark themes by default
- Advanced stuff like multi cursor editing

Minus:
- Dark themes by default
- Costs real-world money (nagware on older versions)
- Powerful API means it's a bit harder to customise, e.g. syntax highlighters aren't just lists of words, you have to write regular expressions and deal with priority between them

My conclusion:
I tried to like it but I ended up giving up, it's too hard to customise without getting quite deep into its model of how things should work. But what I saw suggests great possibilities.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Apr 2013
  • Posts: 106
  • Location: Sydney Australia
Reply with quote
Post Posted: Tue Sep 02, 2014 12:27 pm
Hi,

I included a WLA DX Z80 syntax highlighter definition for vim in my minesweeper code comp entry. If anyone is interested. :)

http://www.smspower.org/uploads/Homebrew/Minesweeper-SMS-1.10.zip


Archive:  Minesweeper-SMS-1.10.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
    65536  03-27-14 19:15   minesweeper.sms
     1278  03-27-14 19:16   README.txt
        0  03-27-14 10:08   utils/
     2855  03-27-14 10:02   utils/asmz80.vim
     2497  03-27-14 10:07   utils/usb_loader.c
 --------                   -------
    72166                   5 files
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Sun Aug 16, 2020 11:55 pm
Thread necromancy...

The cool kids these days are using VSCode and Kroc has made a thing for integrating WLA DX syntax into it, search for "WLA-DX" in the program to install. It seems to work pretty well.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!