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

Calling pix() function in OVR() to check for color values in TIC() doesn't work anymore ( v 1.0.2164 )

Open potato25 opened this issue 2 years ago • 7 comments

Calling pix() function in OVR() to check for color values of TIC() doesn't work anymore . It used to work in 0.90 before This broke : https://tic80.com/play?cart=2695 test1

potato25 avatar May 03 '22 07:05 potato25

It wont work like this scince we added vbank switching. In your example you clear the screen in the vbank0 and try to get pixel color in vbank1.

nesbox avatar May 03 '22 08:05 nesbox

This would work if they switched back to bank0 first then used pix, right?

joshgoebel avatar May 03 '22 08:05 joshgoebel

yes, this would work if you switched to proper vbank

nesbox avatar May 03 '22 13:05 nesbox

The only problem with this architecture that I don't think I even thought of before is that if you are writing some sort of complex graphic effect that is literally reading every pixel from vram modifying it quickly and then writing it back to OVR vram.

You could do that kind of thing before but now you have to wrap every single pixel access with two calls to vbank. I guess now I'm curious if anyone is actually doing that kind of thing.

Personally I don't mind this limitation. It feels retro.

joshgoebel avatar May 03 '22 22:05 joshgoebel

You could do that kind of thing before but now you have to wrap every single pixel access with two calls to vbank.

I forgot if we're still using memcopy internally for vbank switching but if we are that might rule out this type of approach since you'd be copying 64 kB of RAM every time you read a single pixel.

This could be another potential argument for increasing the memory of the base system. In that case one could do this but they'd first copy VRAM to 32 kB of free memory for easy access.

joshgoebel avatar May 03 '22 22:05 joshgoebel

See this : https://github.com/nesbox/TIC-80/issues/1908 I made that cart and now it's broken :(

potato25 avatar May 04 '22 03:05 potato25

I made that cart and now it's broken :(

Unfortunately, sometimes we have to sacrifice backward compatibility as in this case, sience 1.0 you have to specify which VBANK you want to use before calling pix() API, sorry for that.

nesbox avatar May 04 '22 06:05 nesbox