for zx spectrum experts

By PingPong

Prophet (3769)

PingPong's picture

28-11-2017, 20:18

I report one comment:
some enemy move smothly in vertical direction. So there are times where the enemy is across the 8px boundary.
Why we do not see the usual colorclash?

And effectively.... why?

Login or register to post comments

By Timmy

Master (167)

Timmy's picture

28-11-2017, 21:22

The Spectrum has always have the abilty to display more colours on 1 square, but it was never consistent, was hard to get it correct, and takes a lot of CPU time.

A few years ago, we (a lot of developers discussing about it on a forum) worked out how to make a consistent 8x1 graphics on the Spectrum. So now we can have 8x1 colour games. It still costs a lot of CPU resources and careful interrupt manipulations to do it but simple games can be made now.

The only reason I haven't used it in my games is that I can't draw 8x1 graphics, yet. But it's not hard any more, technically. I can just include a C library if I need it.

By karloch

Prophet (2139)

karloch's picture

28-11-2017, 21:23

In the Youtube video comments:


The game uses the Nirvana engine, and when Nirvana and Bifrost engines is used there is no 8px boundary:

By TomH

Champion (327)

TomH's picture

28-11-2017, 22:07

To expand on the two answers above, the way these engines work is:

  1. wait for the retrace interrupt;
  2. go into a busy loop, constantly rewriting the attribute memory until the end of pixels;
  3. spend the time between end of pixels and the next retrace interrupt updating graphics for the next frame.

Underlying observations are: the Spectrum doesn't buffer or cache the attributes, it fetches them once per scan line. So if you change them at the right time, you can display different attribute values for the same 8x8 block. Also its retrace interrupt is genuinely signalling the retrace, so it's a short while after the end of pixels, giving you that brief window for code that isn't rigourously timed before the hard-display-synchronised stuff begins.

By eimaster

Master (249)

eimaster's picture

30-11-2017, 04:07

Can't that be done in MSXs 1, 2, 2+ and turboR as well?!

By Timmy

Master (167)

Timmy's picture

30-11-2017, 11:44

Well, I heard that 8x1 graphics for MSX1 is out-of-the-box. So this trick isn't needed for MSX machines.

By PingPong

Prophet (3769)

PingPong's picture

30-11-2017, 17:35

Msx1 already have 8x1 mode without any tricks
We call this mode screen 2

By Zarchos

Supporter (5)

Zarchos's picture

01-12-2017, 20:41

Thanks for the clear explanations about how it works on the Speccy. I had always wondered how it was achieved.