Jump to content

New demo uploaded: quick sort color demo


Recommended Posts

quick sort color demo

View File

Variation of the quick sort demo, but this one using the 320x240x8bpp mode, which uses double the memory, and is that much cooler to watch 🙂

Tap any key to progress from:

  • Random
  • Slowed down sort
  • Random
  • Full speed sort
  • Back to Basic

Note: that band of "non random" pixels below the middle of the screen is the default location of character tiles at $0f800 = $0ffff.  This gets moved to right after screen memory at $04000 - $047ff (which is probably where it *should* default to, if you ask me :))


Link to comment
Share on other sites

36 minutes ago, desertfish said:

what RNG are you using to set everything back to random?

entropy_get ($fecf)
then I just use part of the routine in the example in the doc:

  JSR entropy_get
  STX tmp   ; combine 24 bits
  EOR tmp   ; using exclusive-or
  STY tmp   ; to get a higher-quality
  EOR tmp   ; 8 bit random value

Then STA that value into mem

The doc recommends that "this data should be fed into a pseudo-random number generator" but it seems to work well enough.

Edited by x16tial
  • Thanks 1
Link to comment
Share on other sites

Just added "sortdemocolor2.prg"
This one will pause at each "level" of the sort, kinda fun to see how the colors separate at each level.
Will have to be downloaded to use it, as the "Try it now" button in the download dialog runs the original.

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.

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.


  • Create New...

Important Information

Please review our Terms of Use