+ {
+//NOTE: The following doesn't put BORDER color on the sides... !!! FIX !!!
+#warning "The following doesn't put BORDER color on the sides... !!! FIX !!!"
+ if (vjs.renderType == RT_NORMAL)
+// scanline_render[TOMGetVideoMode()](TOMBackbuffer);
+ scanline_render[TOMGetVideoMode()](TOMCurrentLine);
+ else//TV type render
+ {
+/*
+ tom_render_16bpp_cry_scanline,
+ tom_render_24bpp_scanline,
+ tom_render_16bpp_direct_scanline,
+ tom_render_16bpp_rgb_scanline,
+ tom_render_16bpp_cry_rgb_mix_scanline,
+ tom_render_24bpp_scanline,
+ tom_render_16bpp_direct_scanline,
+ tom_render_16bpp_rgb_scanline
+#define VMODE 0x28
+#define MODE 0x0006 // Line buffer to video generator mode
+#define VARMOD 0x0100 // Mixed CRY/RGB16 mode (only works in MODE 0!)
+*/
+ uint8 pwidth = ((GET16(tomRam8, VMODE) & PWIDTH) >> 9) + 1;
+ uint8 mode = ((GET16(tomRam8, VMODE) & MODE) >> 1);
+ bool varmod = GET16(tomRam8, VMODE) & VARMOD;
+//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;
+
+ while (width)
+ {
+ uint32 g = *current_line_buffer++;
+ uint32 r = *current_line_buffer++;
+ current_line_buffer++;
+ uint32 b = *current_line_buffer++;
+ *backbuffer++ = 0xFF000000 | (b << 16) | (g << 8) | r;
+ width--;
+ }
+}
+#endif
+
+ }
+ }