-//The video texture line buffer ranges from 0 to 1279, with its left edge starting at LEFT_VISIBLE_HC.
-//So, we need to start writing into the backbuffer at HDB1, using pwidth as our scaling factor. The
-//way it generates its image on a real TV!
+//The video texture line buffer ranges from 0 to 1279, with its left edge starting at
+//LEFT_VISIBLE_HC. So, we need to start writing into the backbuffer at HDB1, using pwidth
+//as our scaling factor. The way it generates its image on a real TV!
+
+//So, for example, if HDB1 is less than LEFT_VISIBLE_HC, then we have to figure out where
+//in the VTLB that we start writing pixels from the Jaguar line buffer (VTLB start=0,
+//JLB=something).
+#if 0
+//
+// 24 BPP mode rendering
+//
+void tom_render_24bpp_scanline(uint32 * backbuffer)
+{
+//CHANGED TO 32BPP RENDERING
+ uint16 width = tomWidth;
+ uint8 * current_line_buffer = (uint8 *)&tomRam8[0x1800];
+
+ //New stuff--restrict our drawing...
+ uint8 pwidth = ((GET16(tomRam8, VMODE) & PWIDTH) >> 9) + 1;
+ //NOTE: May have to check HDB2 as well!
+ int16 startPos = GET16(tomRam8, HDB1) - (vjs.hardwareTypeNTSC ? LEFT_VISIBLE_HC : LEFT_VISIBLE_HC_PAL); // Get start position in HC ticks
+ startPos /= pwidth;
+ if (startPos < 0)
+ current_line_buffer += 4 * -startPos;
+ else
+//This should likely be 4 instead of 2 (?--not sure)
+ backbuffer += 2 * startPos, width -= startPos;