private static void XGA_DrawCmd(/*Bitu*/ int val, /*Bitu*/ int len) { /*Bit16u*/ int cmd; cmd = val >> 13; // if (XGA_SHOW_COMMAND_TRACE) // Log.log_msg("XGA: Draw command %x", cmd); xga.curcommand = val; switch (cmd) { case 1: /* Draw line */ if ((val & 0x100) == 0) { if ((val & 0x8) == 0) { if (XGA_SHOW_COMMAND_TRACE) Log.log_msg("XGA: Drawing Bresenham line"); XGA_DrawLineBresenham(val); } else { if (XGA_SHOW_COMMAND_TRACE) Log.log_msg("XGA: Drawing vector line"); XGA_DrawLineVector(val); } } else { Log.log_msg("XGA: Wants line drawn from PIX_TRANS register!"); } break; case 2: /* Rectangle fill */ if ((val & 0x100) == 0) { xga.waitcmd.wait = false; if (XGA_SHOW_COMMAND_TRACE) Log.log_msg( StringHelper.sprintf( "XGA: Draw immediate rect: xy(%3d/%3d), len(%3d/%3d)", new Object[] { new Integer(xga.curx), new Integer(xga.cury), new Integer(xga.MAPcount), new Integer(xga.MIPcount) })); XGA_DrawRectangle(val); } else { xga.waitcmd.newline = true; xga.waitcmd.wait = true; xga.waitcmd.curx = xga.curx; xga.waitcmd.cury = xga.cury; xga.waitcmd.x1 = xga.curx; xga.waitcmd.y1 = xga.cury; xga.waitcmd.x2 = (/*Bit16u*/ int) ((xga.curx + xga.MAPcount) & 0x0fff); xga.waitcmd.y2 = (/*Bit16u*/ int) ((xga.cury + xga.MIPcount + 1) & 0x0fff); xga.waitcmd.sizex = xga.MAPcount; xga.waitcmd.sizey = xga.MIPcount + 1; xga.waitcmd.cmd = 2; xga.waitcmd.buswidth = VGA.vga.mode | ((val & 0x600) >> 4); xga.waitcmd.data = 0; xga.waitcmd.datasize = 0; if (XGA_SHOW_COMMAND_TRACE) Log.log_msg( StringHelper.sprintf( "XGA: Draw wait rect, w/h(%3d/%3d), x/y1(%3d/%3d), x/y2(%3d/%3d), %4x", new Object[] { new Integer(xga.MAPcount + 1), new Integer(xga.MIPcount + 1), new Integer(xga.curx), new Integer(xga.cury), new Integer((xga.curx + xga.MAPcount) & 0x0fff), new Integer((xga.cury + xga.MIPcount + 1) & 0x0fff), new Integer(val & 0xffff) })); } break; case 6: /* BitBLT */ if (XGA_SHOW_COMMAND_TRACE) Log.log_msg("XGA: Blit Rect"); XGA_BlitRect(val); break; case 7: /* Pattern fill */ if (XGA_SHOW_COMMAND_TRACE) Log.log_msg( StringHelper.sprintf( "XGA: Pattern fill: src(%3d/%3d), dest(%3d/%3d), fill(%3d/%3d)", new Object[] { new Integer(xga.curx), new Integer(xga.cury), new Integer(xga.destx), new Integer(xga.desty), new Integer(xga.MAPcount), new Integer(xga.MIPcount) })); XGA_DrawPattern(val); break; default: Log.log_msg("XGA: Unhandled draw command " + Integer.toString(cmd, 16)); break; } }