Contact me | Login | Search | Sitemap | Site Notice

XMAS-Demo 2020 in 6502-Assembler


This year's XMAS-Demo is just a small feasibility study connecting the DOLORes library with a PT3-file audio player and a particle simulation state machine and some timed automatism in order to create a self-running demo of a Galton's Board simulation in double LORES on an Apple //e (128kB or better @1MHz).



Key Features:

  • Apple ][ Christmas Demo using 40 column text mode and double LORES graphics with MockingBoard sound.
  • Simulation of  Galton's Board in double LORES with sound:

    • Animation of 102 particles following a graviational force
    • Pseudo random number generation for movement direction decision of each particle
    • Automatic gravitational force reverse every ten seconds
    • User interaction possible
    • Music playback via a MockingBoard (or compatible sound card)


  • Download the DSK-image (Apple //e enhanced or better only!)!

Keyboard Commands:

  • <T>: Toggle particle gate
  • <R>: Reverse gravitational force
  • <Q>: Quit the main part


  • Code & Gfx: SingleMalt
  • Music: unknown artist
  • Additional Advice: Dr. N. H. Cham

 System Requirements:

  • Apple //e enhanced or better
  • 65C02 CPU
  • 128 kB RAM
  • MockingBoard (no automatic gravitational force change and music without MockingBoard!)


This demo would not have reached its current point of progress without the help and software of other great guys out there. Thank you for your great software and support!

I want to point out some major contributors to this demo:

Some Technical Information:

  1. The DOLORES library and the PT3-player module reside directly below the DOS 3.3 area
  2. The state machine for the particle simulation is located directly before the both modules starting from $6000, so a CALL 24576 restarts the demo after "quitting".
  3. Half of the zero page is used for DOLORES and PT3-player variables. Some of the rest is used by the particle state machine. The zero page is saved during the algorithm startup and restored when leaving the demo which keeps the Apple in "normal" working state afterwards. Maybe not necessarily needed - I like this feature of a clean quit from the demo algorithm
  4. The song data is loaded from $2000. Theoretically using the current memory layout the maximum song file length could be 16 kB (PT3-file / Vortex-Tracker)
  5. AUX memory is used by the DOLORES library: parts of the machine code is copied to AUX RAM. When using the SCRN-function DOLORES execution switches to AUX memory as well as when using the flood fill algorithm which builds its search trees completely in the AUX memory area. 
  6. The interrupt handler controlling the sound file playback got an extra JSR to a user defined routine that will manage things that need timed action during the particle simulation state machine. Here I am reversing gravity direction each 10 s, so the pixels will move back upwards after a simulation run and the Galton board will be simulated over and over again without any need for user interaction (standalone demo function). 
  7. The modular setup enables the creation of new games or demos by using the DOLORES and PT3-player framework and adding just your own code. The PT3 player uses about 15% of the cycles when playing music files.

I am happy to discuss the technical stuff in more detail if anybody is interested!