TIC-80: `poke` to VRAM does nothing inside OVR()

function TIC() 
  cls(13)
end

function OVR()
	print("HELLO WORLD!",0,0)
	for i=0,20 do
		poke(i, 0xcc)
	end
end

Expected result:

  • See HELLO WORLD
  • See a ~40px line of white on the first row

Actual result:

  • Only HELLO WORLD is shown
  • The pokes to VRAM seem to have no effect

What I’m wanting to accomplish

I’m trying to build a filter in OVR()… something to read/modify every frame (INCLUDING the overlay):

function OVR()
-- do final overlay stuff, if needed

-- read VRAM
-- modify/filter
-- write VRAM
end

I wondered if I might have issues with the “do final overlay stuff” not being “committed” to VRAM yet, but first I ran into the fact that changes to VRAM inside OVR seem to be entirely ignored… I suppose this either wasn’t considered or is some type of optimization?

The expected behavior here (IMHO) would be that ANY changes to VRAM are written to the display.

It would seem to make sense to draw the VRAM (to screen) once per frame so I’d expect something like this sequence:

  • frame begins
    • TIC/SCN fires
    • buffer is committed to VRAM(?)
    • OVR fires
    • buffer is committed to VRAM(?)
    • VRAM is written to actual display
  • wait for next frame

I put ? because it’s not clear that every single draw command shouldn’t actually be writing directly to VRAM… In any case it seems the key thing would be a single final flush of VRAM after the entire sequence, so I’m quite puzzled why my pokes inside OVR do nothing.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

It seems yes 😃