NES has it own raycasting
http://www.youtube.com/watch?v=po69zgqyFWM&feature=related
something similar has to be possible on msx2
The key element for any raycasting is the scaler: it is a subroutine that accepts as inputs
- a pointer to a colum of a texture a a known size (say 64 pixels)
- a final size of the column (it can be larger or smaller of the inital size of the texture)
- a starting point on the screen
The scaler "just" plots the scaled colums of texture on the screen from the starting point at the heigth specified with teh final scale. The scaler has also to do clipping with respect to the borders of the view port. If the view port is, say 256x160, the scaler has to draw only the inner part of the scaled column when the final size is >=160
With this post I would like to open a sort of contest among ASM developers about the fastest way to plot a scaled version of a column of texture in screen 5.
I would assume that textures in screen 5 are plotted as bytes, so the actual horizontal resolution is halved.
It is a necessary assumption to speed up the ploting and the math.
Screen 8 or logical operations in screen 5 are quite unrealistic.
In order to make a bit cleaner the boundaries of the challenge I would assume the following:
YMAX EQU 160 ; Y size of the view port ; input HL -> texture colum: 64 bytes ; input A = final size in [1...255] ; input DE = (X,Y) coords for the starting point where to plot the scaled colum scaler: [propose your code here] ret
Those who will propose a solution (any of them) will see compiled and released their proposal within the maze 3D project
https://sites.google.com/site/testmsx/msx2-doom
Enjoy!