Indeed. Thats where I got the idea from.
? The above mentioned video says: "As there is only a finite number of possible heights, Wolfenstein code generates one routine for every possible height".
Right now I store the textures in VRAM. When I generate such a routine its simply looks something like this:
In that example it writes about 2-3 times more to the screen than it reads from the texture (which is 64x64 pixels). The nice thing about VERA is that you can do this
vertically, which suits drawing columns for each ray very well.
This takes less than 8 cycles per pixel. Sometimes you read more than you write (when walls are smaller than the textures). Sometimes you write more than you read (when the walls are taller than the texture). All in all a little less than 8 cycles. I still need to optimize the smaller walls (as they dummy-load too much right now, so I probably need a secondary, smaller texture or double my stride).
For the ceiling and floor I simply have a single routine with a whole bunch to STA VERA_DATA0's and I jump in that routine at exactly the right place (with the correct color in A). So those take only 4 cycles per pixel.
I can still speed that up a little by remembering how tall the wall (on that column) was the previous frame, so I only have to remove that old wall and not redraw the entire ceiling or floor.
Fun stuff!
?