The Commodore 64's VIC-II video chip allows sprite multiplexing: dynamically re-using the sprites (or MOBs: Movable Object Blocks) to display more than the natural limit of 8. Normally sprite multiplexing requires the use of fast machine language code, but in 2008 programmer S.E.S. of Genesis Project managed the feat with a BASIC program: no assembly code required. But it's no ordinary use of BASIC either, and might actually be more complicated than the machine code version. Today we'll take a deep look at how this BASIC sprite demo works.
Download "BASIC sprite multiplexer" [2008]: https://csdb.dk/release/?id=91459
To support 8-Bit Show And Tell:
Become a patron: https://patreon.com/8BitShowAndTell
One-time donation: https://paypal.me/8BitShowAndTell
2nd channel: https://youtube.com/channel/UCAgWzEh5c8391eJnELDy9OA
PETSCII/Screencodes table: https://www.c64-wiki.com/wiki/PETSCII_Codes_in_Listings
C64 Programmer's Reference Guide (memory maps): https://archive.org/details/commodore-64-programmers-reference-guide_202205
Transactor's Complete Commodore Inner Space Anthology: https://archive.org/details/The_Complete_Commodore_Inner_Space_Anthology
Index:
0:00 RUNning BASIC Sprite Multiplexer
1:24 Trying to STOP the program
2:30 Line 1,4 Walkthrough: Sprite setup
5:26 Line 5: Loc. 648 (HIBASE), 56334 (CIA Control Register A)
10:30 Line 6: Printing a bunch of characters?
12:30 Line 2: WAIT for it
17:20 Line 3: The main multiplexer loop
18:18 String Examination program explanation
20:27 Examining Sprite Initialization String
31:16 Examining Main Multiplexer String
36:26 Back to the Multiplexer Demo
38:46 Why so crashy? KERNAL bug!
41:40 Sprite re-use; thanks!