VER246.TXT 29-Jul-2004 Version 2.4.6 of the XPL0 runtime code (Native and I2L) fixes some problems with background colors when using text in graphic video modes, and runs some graphic routines much faster than before. There are also some bug fixes. The worst bug, introduced in version 2.4, involved the combination of the Restart intrinsic (6) and segment variables. The problem was that the extra segment register (ES) did not point to the program segment prefix (PSP) when the program restarted. Thus after a call to Restart, the internal runtime variable PSPSEG was corrupted. This affected the Resize routine, which is called at the beginning of every XPL0 program, as well as the Shrink (78) and Chain (28) intrinsics. The Malloc intrinsic (73) was also indirectly affected. The break vector ($1B) has been fixed...again. The code that preserved the divide-by-zero vector broke the break vector, which was worse, so the code has been restored to its original form. This means that the divide-by-zero vector is not restored if a Ctrl+C or Ctrl+Break is used to exit an XPL0 program. Any programs that were compiled with Native versions 2.4.3 through 2.4.5 do not restore the break vector. Thus after running one of these programs, hitting Ctrl+Break will jump to an undefined memory location (i.e. will blow up). Any XPL0 .EXE file with a date after April 14, 2002 should be recompiled. This problem did not occur in the interpreted version, which produces .COM files. A bug involving the 'for' loop control variable in the optimizing, XPLX, compiler has been fixed. The conditions under which this bug occurred were extremely unusual. They involved using a 'for' loop control variable defined at an intermediate level (not global or local) and referenced inside a loop (such as a while, repeat, or loop). COLORED TEXT The SetWin intrinsic (70) now fills and scrolls the proper background color when the display is set in graphic modes, such as with SetVid($12). In other words, colors set by the Attrib intrinsic (69) for output device 6 now work in graphic modes the same as they have always worked for text modes (except flashing). Characters displayed in video mode $13 can have 256 colors for both their foreground and background. Previously the background was always black (color 0). In this mode the Attrib intrinsic uses all 16 bits of its argument, not just the low two nibbles that are used to specify the foreground and background colors for all the other modes. The high byte specifies the color of the background, and the low byte specifies the color of the foreground. FASTER GRAPHICS The Point intrinsic (41) now runs about 70 times faster in graphic mode $13, and runs 5 times faster in planar modes such as mode $12. This amazing speed increase was accomplished by accessing the VGA registers directly (as was already done by the Line intrinsic) rather than by calling BIOS routines. CGA modes 4, 5, and 6 still call BIOS like before. The Line intrinsic (42) now draws horizontal lines up to 4 times faster in planar graphic modes ($0D to $12). This was accomplished by replacing REP MOVSB with REP STOSW. Almost all the time it takes to execute the Line routine is in this single instruction because I/O is so incredibly slow. Using words instead of bytes gives a 2-times speed increase; and avoiding the read with MOVS, which is unnecessary for solid (non-dotted) horizontal lines because all pixels in a word are overwritten, gives another 2-times speed increase. NVIDIA XPL0's graphic routines compensate for a bug in the nVidia graphics accelerator card's BIOS routines that causes a screen (or window) full of vertical lines when calling the Clear or SetWind intrinsics. The problem was caused by nVidia not resetting VGA registers to their default states. (This is not just an incompatibility with XPL0, nVidia BIOS is incompatible with itself.) The worst problem with nVidia is that it does not generate the correct sync signals for resolutions greater than 640x480 when running under Windows XP. nVidia seems unconcerned about this despite numerous complaints. The problem can be solved by unplugging the nVidia card, using Windows 98 instead of XP, or by using an ATI accelerator card. XPL0 does not take advantage of any accelerator card features. TRIVIA MASM 6.11 does not assemble "JL $-2" optimally, so XPLX now generates "DB 07Ch, 0FCh" instead. -Loren Blaney