Zeus

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
Profmyster
Drutt
Posts: 13
Joined: Wed Apr 10, 2019 8:46 am

Zeus

Post by Profmyster »

Hi Everyone

So got my toolkit organised (so I thought). I was using Visual Studio Code Editor, Pasmo for assembly and Fuse/ZXSP/RVM for emulation. And using the debug feature of RVM, which to be fair seemed to alright.

But just using that RVM Tape emulation to get a file into memory to run and debug is painful, On the odd occasion I got my Tap file loaded and tested, but the majority of times, I get the screen freeze with the blue and yellow loading border, or the tape keeps running and the screen carries on showing the loading and colours and the same just keeps running, or it resets - so I've decided to take a look at Zeus.

Does it have the feature for colour syntax, otherwise I'll continue to code in VSC and then load into Zeus to emulate and debug. And with the right hand Register window is there a button/switch to flick between hex and dec.

It seems that we have some apps that have great features but don't work well, others that work very well, but just need the odd tweak.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Zeus

Post by Ast A. Moore »

Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Zeus

Post by djnzx48 »

Yes, Zeus does have colour syntax highlighting. The colours are set with a pseudo-op in the source, so it would probably be best to put them in a separate source file and have an 'include' in your main source file to use them.

The documentation says this:
Spoiler
- Added zeussyntaxhighlight pseudo-op to allow the users to play with the editor syntax highlighting.

The syntax is "zeussyntaxhighlight Index, Red, Green, Blue, Bold" where:
Index is a number which specifies the type of syntax item
0 = Tokens
1 = Identifiers
2 = Comments
3 = Constants
4 = LineNumbers
5 = Markers
6 = Errors
7 = Margin data bytes
..
16 = Memory Panel Addr Background
17 = Memory Panel Addr Foreground
18 = Memory Panel Data Background
19 = Memory Panel Data Foreground
20 = Memory Panel Changed Data Background
21 = Memory Panel Changed Data Foreground
..
100 = Diana background
101 = Diana foreground
102 = Diana defn background
103 = Diana defn foreground
..
249 = editor "marked line" colour. [not used in this version]
250 = margin separator line colour
251 = margin separator line2 colour
252 = current executing line background colour
253 = current editing line background colour
254 = margin background colour
255 = editor background colour

300 = CP/M terminal Normal background colour
301 = CP/M terminal Normal foreground colour
302 = CP/M terminal Highlight background colour
303 = CP/M terminal Highlight background colour

Red,Green,Blue specify an RGB colour (0,0,0 = black, 255,0,0 = bright red, 255,255,255 = white, etc)

Bold is optionally true or false to select bold or normal font. It defaults to false.

So, Zeus's normal syntax highlighting uses the following:

zeussyntaxhighlight 0, $00,$00,$00, true ; Set the token colour
zeussyntaxhighlight 1, $00,$00,$00, false ; Set the identifier colour
zeussyntaxhighlight 2, $00,$00,$FF, false ; Set the comment colour
zeussyntaxhighlight 3, $00,$00,$00, false ; Set the constant colour
zeussyntaxhighlight 4, $00,$00,$00, true ; Set the line number colour
zeussyntaxhighlight 5, $00,$00,$00, true ; Set the marker colour
zeussyntaxhighlight 6, $FF,$00,$00, true ; Set the error colour
zeussyntaxhighlight 7, $00,$00,$00, false ; Set the margin data colour

zeussyntaxhighlight 16, $00,$00,$30 ; Set the memory panel addr background
zeussyntaxhighlight 17, $00,$FF,$FF ; Set the memory panel addr foreground
zeussyntaxhighlight 18, $00,$00,$30 ; Set the memory panel data background
zeussyntaxhighlight 19, $C0,$C0,$FF ; Set the memory panel data foreground
zeussyntaxhighlight 20, $00,$00,$30 ; Set the memory panel new data background
zeussyntaxhighlight 21, $FF,$FF,$FF ; Set the memory panel new data foreground

zeussyntaxhighlight 250, $D8,$D8,$D8 ; Set the margin separator line colour
zeussyntaxhighlight 251, $F8,$F8,$F8 ; Set the margin separator line2 colour
zeussyntaxhighlight 252, $00,$FF,$FF ; Set the current executing line background colour
zeussyntaxhighlight 253, $F8,$F8,$F8 ; Set the current editing line background colour
zeussyntaxhighlight 254, $F0,$F0,$F0 ; Set the margin background colour
zeussyntaxhighlight 255, $FF,$FF,$FF ; Set the editor background colour

Or you could use something like these for an alternate light on dark editor:

zeussyntaxhighlight 0, $FF,$FF,$FF, true ; Set the token colour
zeussyntaxhighlight 1, $FF,$FF,$FF, false ; Set the identifier colour
zeussyntaxhighlight 2, $00,$C0,$FF, false ; Set the comment colour
zeussyntaxhighlight 3, $FF,$FF,$FF, false ; Set the constant colour
zeussyntaxhighlight 4, $FF,$FF,$FF, true ; Set the line number colour
zeussyntaxhighlight 5, $FF,$FF,$FF, true ; Set the marker colour
zeussyntaxhighlight 6, $FF,$FF,$FF ; Set the error colour
zeussyntaxhighlight 7, $80,$FF,$FF ; Set the margin data colour

zeussyntaxhighlight 100, $FF,$FF,$FF ; Diana background
zeussyntaxhighlight 101, $00,$00,$A0 ; Diana foreground
zeussyntaxhighlight 102, $FF,$FF,$FF ; Diana defn background
zeussyntaxhighlight 103, $00,$00,$A0 ; Diana defn foreground

zeussyntaxhighlight 249, $00,$00,$A0 ; Set the "marked line" colour. [not used in this version]
zeussyntaxhighlight 250, $00,$00,$A0 ; Set the margin separator line colour
zeussyntaxhighlight 251, $00,$00,$C8 ; Set the margin separator line2 colour
zeussyntaxhighlight 252, $00,$C0,$C0 ; Set the current executing line background colour
zeussyntaxhighlight 253, $10,$40,$80 ; Set the current editing line background colour
zeussyntaxhighlight 254, $20,$20,$90 ; Set the margin background colour
zeussyntaxhighlight 255, $00,$00,$80 ; Set the editor background colour

Memory panels can also be recoloured, note that it may take a couple of assemble cycles for the
changes to propogate depending on how you have placed the colour changes/panel definitions

zeussyntaxhighlight 16, $FF,$FF,$FF ; Set the memory panel addr background
zeussyntaxhighlight 17, $FF,$00,$FF ; Set the memory panel addr foreground
zeussyntaxhighlight 18, $FF,$FF,$FF ; Set the memory panel data background
zeussyntaxhighlight 19, $00,$00,$00 ; Set the memory panel data foreground
zeussyntaxhighlight 20, $FF,$00,$00 ; Set the memory panel new data background
zeussyntaxhighlight 21, $00,$00,$FF ; Set the memory panel new data foreground

Note that the dynamic change highlighting will automatically adapt to use whatever fore/back colours
you provide.

The CP/M terminal window can also be customised.

zeussyntaxhighlight 300,$00,$20,$00 ; Normal background = light green
zeussyntaxhighlight 301,$00,$FF,$00 ; Normal foreground = bright green
zeussyntaxhighlight 302,$00,$80,$00 ; Highlight background = Medium green
zeussyntaxhighlight 303,$00,$00,$00 ; Highlight foreground = Black
Profmyster
Drutt
Posts: 13
Joined: Wed Apr 10, 2019 8:46 am

Re: Zeus

Post by Profmyster »

Cheers, great!

Had a little play and got me some nice colouring - well I like it. So now just need to use it a nit and see if it suits me after getting used to VSC. Just got to get used to windows keys instead of my Mac (CTRL instead of CMD) one key but my fingers are pre-programmed to go for CMD. LOL!

Anyway thanks for the pointer... much appreciated.

Image
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Zeus

Post by djnzx48 »

Glad you got it working.

Zeus is a pretty nice IDE. The most useful features IMO are the ability to see your source as you debug, and the memory paging on the 128k machines. I will warn you though, the command line assembler and the IDE sometimes behave slightly differently, and the IDE may trip up on syntax that the command line version accepts without a problem. This only really crops up if you're doing advanced macro stuff. Putting parentheses around parameters tended to work for me when I was getting errors.

If you decide you don't like the IDE, you can still use the command line version of Zeus with VSC like you would for Pasmo.

RVM maybe isn't the best emulator for testing .tap files as it doesn't (yet) have loading acceleration. But if you choose, you can have the development version of your project generate snapshots instead to make testing easier. I generally stick with .tap files just to keep things simple and so I don't have to change the whole loading process at the end.
Profmyster
Drutt
Posts: 13
Joined: Wed Apr 10, 2019 8:46 am

Re: Zeus

Post by Profmyster »

Thanks for the info,

Hopefully not trying anything to advanced. Simple-ish Z80 stuff to create a speccie game.

I think with all the various tools I have now, I can come up with a dev toolkit. Somewhere it said the RVM dev side was going to develop and change so watch this space I guess. I like the register window , you have the pairs but also the single registers and an easy switch between Hex & Dec which is handy.

But yeah gonna give zeus a go, see how it goes. Cheers for everyones responses, appreciated.
User avatar
Joefish
Rick Dangerous
Posts: 2054
Joined: Tue Nov 14, 2017 10:26 am

Re: Zeus

Post by Joefish »

I use Crimson Editor for editing code. When you save as .asm, that has syntax highlighting. Although it's not always quite right for Z80 code. I use the ZXSpin emulator for testing and debugging. It lets you view code and step through, but its search doesn't work properly and can sometimes get stuck on the wrong byte of multi-byte instructions. It's very easy to operate as an emulator though, and when run from the command line, re-starts itself rather than opening a new window.

I should give RVM a try for debugging as I want to have a go at 128K programming, and being able to view the memory banks and both screens would be a big help. I like how you can open a separate window to view registers, memory, and the screens, and they are resizeable, but it'd be better if these extra windows had maximise and minimise buttons to click on, to use with a twin-monitor setup.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Zeus

Post by Seven.FFF »

There’s some confusion here in the previous answers. Zeus has been an assembler since the late 70s, written by Simon Brattel and his old business partners. Early versions of the Z80 version were sold for the spectrum, including a version republished by Sinclair Research.

The current free incarnation is a Windows IDE for Z80/6x09/68000 and more. These modern versions combine an editor, assembler and development emulator, with a much more sophisticated parser and debugger than fitted in the native Spectrum versions. Command line variants of the assemblers also exist. These are all still actively developed by Simon, who also sells commercial Zeus IDEs built on the same codebase in his electronics design and manufacturing business to support his industrial CPU designs.

At some point someone seems to have unilaterally appropriated the name for their syntax highlighter, probably as a homage, but without checking with Simon. It is this highlighter that the OP is referring to, not what most people refer to as Zeus.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Zeus

Post by djnzx48 »

Huh? I thought the OP was talking about the Zeus IDE, not someone's syntax highlighter lookalike. Now I'm even more confused ;)
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Zeus

Post by Seven.FFF »

You're right! I've reread it and the OP is talking about Simon's Zeus. Soz ;)
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Post Reply