The first thing drawn is the ceiling, and then the floor is drawn immediately after. The code for rendering this stuff is a bit complicated due to the need to support alternate wallsets, but it all kind of "just works" from the perspective of someone designing a wallset.
There are four range values to be concerned with: 0 is the party's own square, 1 is the square just ahead, 2, and 3. Each of the ranges has a left, center, and right square, and range 3 also has far-left and far-right squares which draw those barely visible
walls you can see off in the distance.
So after drawing the floor and ceiling, the next
walls drawn are the range 3 far-left and far-right
walls, in that order. It doesn't draw wall decorations on these
walls. After that, it draws the range 3 left wall, the range 3 right wall, and finally the range 3 center wall, including drawing all wallitems and other decorative features on these
walls. This left-right-center order holds throughout the process; it then draws left-2, right-2, center-2, left-1, right-1, and center-1, in that order. The code for drawing the range 1 center wall is pretty complicated due to the need to handle magic windows and such, but anyway, after all that, it draws the
walls to the immediate left and right (i.e., range 0) of the party. No wall is drawn for the square the party is on.
I hope that helps! You can see the code for yourself in
https://github.com/sparkletwist/DSB/blo ... r/render.c although it's, quite honestly, pretty awful code.
Anyway, I should also note that I hope you're creating an "ex" wallset, that is, a (mostly?) RTC-compatible wallset. The "standard" wallset is the style used by CSBwin and can be imported more or less directly into the CSB engine but it's actually pretty cumbersome to work with, and the difficulty of creating any new wallsets in this form are mostly why the "ex" wallsets even exist.