This is David Williams's 'digital Christmas card' from 2021, I think it was one of the last complete BBC BASIC programs he wrote before 'retiring'. An amazing talent, much missed. You can run it in your own browser at this link, there are more animations than shown in the video if you leave it running.
https://youtube.com/shorts/z6wMgIxPj4M
Digital Christmas Card
-
- Posts: 21
- Joined: Wed 11 Dec 2024, 17:15
Re: Digital Christmas Card
Splendid! I may never go back to conventional, physical decorations again.
(The YouTube video is unavailable though.)
(The YouTube video is unavailable though.)
-
- Posts: 272
- Joined: Tue 18 Jun 2024, 09:32
-
- Posts: 272
- Joined: Tue 18 Jun 2024, 09:32
Re: Digital Christmas Card
David never released the source code of this program, sadly. In fact he said here that it "resembles an absolute dog's breakfast, so I'm not releasing it - sorry!". He also said that it's "Currently Windows only." so you may well wonder how I was able to make it available for running in a browser without the source.
The answer is that although what he provided was a Windows 'executable' the actual BASIC program it contained - albeit crunched and thoroughly obfuscated - isn't itself specific to Windows. Because of the cross-platform compatibility of BBC BASIC for SDL 2.0, that same binary program will run on all the supported platforms so long as the appropriate run-time engine is attached.
Therefore all I had to do was to write a simple wrapper program, containing the necessary Compiler Directives to load the resource files, and disable crunching (since the program is already crunched, attempting to do so again wouldn't be a good idea!) to make it work:
The one remaining 'gotcha' was that not only was the program itself crunched, so were the libraries it used. Therefore it wouldn't run unless the crunched libraries, not the standard libraries, were used. That's the purpose of the first two lines of the wrapper above, they point @lib$ to the directory containing the crunched libraries rather than the normal ones.

The answer is that although what he provided was a Windows 'executable' the actual BASIC program it contained - albeit crunched and thoroughly obfuscated - isn't itself specific to Windows. Because of the cross-platform compatibility of BBC BASIC for SDL 2.0, that same binary program will run on all the supported platforms so long as the appropriate run-time engine is attached.

Therefore all I had to do was to write a simple wrapper program, containing the necessary Compiler Directives to load the resource files, and disable crunching (since the program is already crunched, attempting to do so again wouldn't be a good idea!) to make it work:
Code: Select all
$PTR(@lib$) = @dir$ + "lib/"
!(^@lib$+4) = LEN(@dir$ + "lib/")
CHAIN "xmas2021"
REM!Crunch
REM!Exefile exe/xmas2021
REM!Embed @dir$+"xmas2021.bbc"
REM!Embed @dir$+"resources/tune_mp3_128kbps.mp3", @dir$+"resources/scrolltext.dat"
etc.