I am thinking that you don't need to do "real" 3D for this. You could have predrawn dungeon pieces (left, right and front facing walls at different depths) and then go through the array in the direction the player is facing with the furtherst most field first and then closer to the player.
[edit] Here is a quick idea of how to use polys to draw walls. You would need a textured poly function ofcause, this one is using the regular one.
Graphics 640,480
Cls
Global wallLeft0:Float[] = [0.0,0.0,32.0,16.0,32.0,144.0,0.0,160.0]
Global wallLeft1:Float[] = [32.0,16.0,64.0,32.0,64.0,128.0,32.0,144.0]
Global wallLeft2:Float[] = [64.0,32.0,96.0,48.0,96.0,112.0,64.0,128.0]
Global wallMid2:Float[] = [96.0,48.0,160.0,48.0,160.0,112.0,96.0,112.0]
Global wallRight2:Float[] = [160.0,48.0,192.0,32.0,192.0,128.0,160.0,112.0]
Global wallRight1:Float[] = [192.0,32.0,224.0,16.0,224.0,144.0,192.0,128.0]
Global wallRight0:Float[] = [224.0,16.0,256.0,0.0,256.0,160.0,224.0,144.0]
SetScale 2.0,2.0
SetColor(255,255,255)
DrawPoly(wallLeft0)
SetColor(208,208,208)
DrawPoly(wallLeft1)
SetColor(160,160,160)
DrawPoly(wallLeft2)
SetColor(112,112,112)
DrawPoly(wallMid2)
SetColor(160,160,160)
DrawPoly(wallRight2)
SetColor(208,208,208)
DrawPoly(wallRight1)
SetColor(255,255,255)
DrawPoly(wallRight0)
Flip
WaitKey
End
Another example:
Graphics 640,480
Cls
Global wallLeft0a:Float[] = [0.0,0.0,32.0,16.0,32.0,144.0,0.0,160.0]
Global wallLeft1a:Float[] = [32.0,16.0,64.0,32.0,64.0,128.0,32.0,144.0]
Global wallLeft2a:Float[] = [64.0,32.0,96.0,48.0,96.0,112.0,64.0,128.0]
Global wallMid2:Float[] = [96.0,48.0,160.0,48.0,160.0,112.0,96.0,112.0]
Global wallRight2a:Float[] = [160.0,48.0,192.0,32.0,192.0,128.0,160.0,112.0]
Global wallRight1a:Float[] = [192.0,32.0,224.0,16.0,224.0,144.0,192.0,128.0]
Global wallRight0a:Float[] = [224.0,16.0,256.0,0.0,256.0,160.0,224.0,144.0]
Global wallLeft0b:Float[] = [0.0,16.0,32.0,16.0,32.0,144.0,0.0,144.0]
Global wallLeft1b:Float[] = [32.0,32.0,64.0,32.0,64.0,128.0,32.0,128.0]
Global wallLeft2b:Float[] = [64.0,48.0,96.0,48.0,96.0,112.0,64.0,112.0]
Global wallRight2b:Float[] = [160.0,48.0,192.0,48.0,192.0,112.0,160.0,112.0]
Global wallRight1b:Float[] = [192.0,32.0,224.0,32.0,224.0,128.0,192.0,128.0]
Global wallRight0b:Float[] = [224.0,16.0,256.0,16.0,256.0,144.0,224.0,144.0]
SetScale 2.0,2.0
'ceiling
SetColor 0,0,255
DrawRect 0,0,256,80
'floor
SetColor 0,0,128
DrawRect 0,160,256,80
'walls
SetColor(255,255,255)
DrawPoly(wallLeft0b)
SetColor(208,208,208)
DrawPoly(wallLeft1a)
SetColor(160,160,160)
DrawPoly(wallLeft2b)
SetColor(112,112,112)
DrawPoly(wallMid2)
SetColor(160,160,160)
DrawPoly(wallRight2b)
SetColor(208,208,208)
DrawPoly(wallRight1a)
SetColor(255,255,255)
DrawPoly(wallRight0b)
Flip
WaitKey
End