TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Poking the palette index doesn't affect `circ()` anymore

Open borbware opened this issue 2 years ago • 5 comments

I noticed that in 1.0, my palette cycling functions don't work anymore for circ calls as they did in 0.9. rect in comparison works fine.

0.90.1723: video2

1.0.2164: video3

Here's the code to replicate the issue.

function pal(c0,c1)--replace c0 with c1
	if(c0==nil and c1==nil)then for i=0,15 do poke4(0x3FF0*2+i,i)end
	else poke4(0x3FF0*2+c0,c1) end
end

function palcycl(T,cols,cols2)--cycle palette
	T=T or 0
	if cols and cols2 then
		for i,v in ipairs(cols)do
			local col2=cols2[(i-1+T//1)%#cols2+1]
			pal(v,col2)
		end
	else
		for i=0,15 do pal(i,(i+T)%16)end
	end
	return retcol
end

t=0
x=120
y=60
palette={{1,2,6,8,10,14,15},{1,2,6,8,10,14,15}}
function TIC()
	cls(13)
	palcycl(t//8,palette[1],palette[2])
	circ(x,y,10,6)
	rect(x,y+20,10,10,6)
	palcycl()
	t=t+1
end

borbware avatar Jun 15 '22 08:06 borbware

Also, a circle with zero radius shouldn't draw anything (now draws a 1px dot).

nesbox avatar Jun 15 '22 14:06 nesbox

i actually prefer circ with 0 radius drawing a single pixel , lot of my carts work that way

potato25 avatar Jun 16 '22 12:06 potato25

i actually prefer circ with 0 radius drawing a single pixel , lot of my carts work that way

I don't know how to please everyone, one says he doesn't want to see anything with zero radius, the other wants to see a 1px dot :)

nesbox avatar Jun 17 '22 10:06 nesbox

Also, a circle with zero radius shouldn't draw anything (now draws a 1px dot).

@nesbox Why would this be bad? I mean technically a circle with a radius 0 would be a point, not a circle, but what is the harm if it renders as a point? If someone doesn't want to draw anything they shouldn't call a drawing function... I'm not sure there is a 100% right or wrong here but I don't see any problem with a 0px radius circle drawing a point/pixel.

joshgoebel avatar Jun 17 '22 10:06 joshgoebel

i'm fine either way. Maybe leaning towards "0 radius drawing 1px dot", only because that's how it has worked previously, and changing the behaviour would change how some old cartridges look.

borbware avatar Jun 21 '22 11:06 borbware

Closing this as resolved by #1960. If we want to continue the 0 vs 1 pixel radius discussion we should open a separate issue.

joshgoebel avatar Dec 04 '22 17:12 joshgoebel

yeah good call as if was fixed in d23ffe1daebf33780f6b8f7bc6d7c83c2716af0c.

borbware avatar Dec 05 '22 11:12 borbware