C64 BASIC Bouncing Pixel Inside Bouncing Sprite Optimization Challenge

Published: 21 February 2025
on channel: 8-Bit Show And Tell
15,476
897

We've optimized the C64 BASIC bouncing ball program before, but how about optimizing a bouncing pixel ball within a sprite frame that also bounces around the screen? That's TWO things happening at once. Thanks to Eyvind for this challenge!

Check out Eyvind's github for more C64 code: https://github.com/eyvindebsen
CBM .prg Studio: https://www.ajordison.co.uk/

Previous episodes mentioned:
"One-Line Bouncing Ball: Commodore 64 BASIC"    • One-Line Bouncing Ball: Commodore 64 ...  
"38911 Bytes Free? Commodore 64's BASIC RAM"    • 38911 Bytes Free? Commodore 64's BASI...  

To support 8-Bit Show And Tell:
Become a patron:   / 8bitshowandtell  
One-time donation: https://paypal.me/8BitShowAndTell
2nd channel:    / @8-bitshowandtell247  

Index:
0:00 A Facebook C64 BASIC challenge
1:24 Measuring code size, general thoughts
5:05 About optimizing for program size
7:17 Robin's V0: Line 10: the magic FN
15:17 Lines 20-30: Initializing the sprite
18:37 Lines 40-50: Main loop moving sprites
23:30 Robin's V1: Four logical lines
27:20 Line 1: V=53269, and how less lines saves memory
30:15 Line 2: Creating the sprite
34:05 Lines 3-4: The main loop
36:42 Eyvind's Final version
45:19 A few more bytes saved in both our programs
47:32 Thanks to Eyvind and my patrons!


Watch video C64 BASIC Bouncing Pixel Inside Bouncing Sprite Optimization Challenge online, duration hours minute second in high quality that is uploaded to the channel 8-Bit Show And Tell 21 February 2025. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 15,476 times and liked it 897 visitors.