Jump to content

Long line demo

Thomas Jentzsch

Recommended Posts

Attached you find a simple tech demo, which resulted from discussing with @johnnywc about his newest project Qix.


All it does is drawing a single (Qix) line on the screen. The line data is created on-the-fly using the Bresenham line algorithm. The clue is, that this line is quite long (up to 44 pixel), using just one sprite an no flicker. To achieve this length, I combined several tricks:

  • depending of the width (and angle) of the line, the sprite is double or quad sized
  • the sprite position is updated every line
  • the sprite bits forming the line are shifted to allow larger line segments (> 7 pixel)


When you start the demo, you only see a line rotating. You can use the switches to change that.

  • Color/B&W = B&W: The Qix line color reflects the sprite size (blue = single, green = double, red = quad sized)
  • Left Difficulty = A: The Qix line independently changes it horizontal and vertical size
  • Right Difficulty = A: The Qix line moves around the screen (this is a demo, so just for the show :))


Maybe I will further enhance the demo. Not sure yet.


BTW: When using Stella, for a nice Qix like effect, try to set the phosphor blend to ~90. 



QixDemo_V1.bin QixDemo_V1.asm Sine_12_05.h

Edited by Thomas Jentzsch
  • Like 17
Link to comment
Share on other sites

It'd be amusing to have Stella conduct a savestate, then load a demo (like this one) after a pre-determined time. And as soon as the user does something like moving the joystick or toggling a switch, Stella would re-load the original ROM and its savestate.


Thereby simulating a Windows-like screensaver.

Edited by Keatah
spelling mistake
  • Like 2
Link to comment
Share on other sites

A little update which mainly improves the trailing Qix lines. I also increased the speed, which was way too low before. PAL60 version added too.



  • Color/B&W = B&W: The Qix line color reflects the sprite size (blue = single, green = double, red = quad sized)
  • Left difficulty: A = Qix moves faster and more erratic

QixDemo_V3 (NTSC).bin QixDemo_V3 (PAL60).bin

  • Like 5
Link to comment
Share on other sites

2 hours ago, Andrew Davie said:

Masterful. Can't wait to see it implemented in a Qix!

Probably not like this. The HMOVE blanks further reduce the horizontal resolution.


But I have an idea how to avoid these by doing a well timed RESP each line.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...