Created
February 1, 2025 11:26
-
-
Save jarnoh/40b386cd24b1fd411041a82342deb1a0 to your computer and use it in GitHub Desktop.
eight raster bars for copper showdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local num_frames = 128 | |
local copper_lists_builder = CopperListsBuilder.new() | |
for frame=1,num_frames do | |
local colors = {} | |
function rasterbar(y) | |
for i=0,15 do | |
colors[y+i]=i*0x111 | |
colors[y+31-i]=i*0x111 | |
end | |
colors[y]=0 | |
colors[y+32]=0 | |
end | |
for n=1,8 do | |
y=math.floor((math.sin(n*0.25 + frame/num_frames * math.pi * 2)+1)*(180)*0.5+32) | |
rasterbar(y) | |
end | |
local copper_list_builder = CopperListBuilder:new() | |
copper_list_builder:add_label("frame_" .. frame - 1) | |
local cc=0 | |
for y=0,255 do | |
if colors[y] and colors[y]~=cc then | |
cc=colors[y] | |
copper_list_builder:push(y*256+0x11, 0xfffe) | |
copper_list_builder:push(COLOR00, cc) | |
end | |
end | |
local next_copper_list_label = "frame_" .. frame % num_frames | |
copper_list_builder:push(0x80, next_copper_list_label .. "%h", 0x82, next_copper_list_label .. "%l") | |
copper_lists_builder:push_copper_list_builder(copper_list_builder) | |
end | |
return copper_lists_builder:build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment