$include (..\lib\compStch.ext) /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ vInvAtModule: do; $if not noID declare IDString (*) byte data ( '@(#)vInvAt.p86 $Author: rmgillmore $ $Date:: 2025-05-04 19:35:39#$:', 0 ); $endif $set( vInvertAtImplementation ) $include (..\lib\videoIO.ext) $include (..\lib\sysCalls.ext) vInvertAttributeAt: procedure ( positionPtr ) reentrant public; declare positionPtr pointer, position based positionPtr coordinate_t, currentAttribute byte, newAttribute byte, newAttributeSpecs byte; declare currentLocation word, ( savedX, savedY ) byte at ( @currentLocation ), currentCharacter char, cpuRegisters; currentLocation = curpos; /* * change to the desired location before doing any work */ call gotoxy( position.x, position.y ); /* * get the character and the attribute */ byteRegs.Ah = 8; byteRegs.Bh = 0; call int86( VIDEO_CALL, @byteRegs ); /* * save the character for the next call, save the attribute to perform * the inversion magic */ currentCharacter = byteRegs.Al; currentAttribute = byteRegs.Ah; newAttribute = vInvertAttribute( currentAttribute ); /* * write the character, and desired attribute */ byteRegs.Al = currentCharacter; byteRegs.Ah = 9; byteRegs.Bh = 0; byteRegs.Bl = newAttribute; wordRegs.Cx = 1; call int86( VIDEO_CALL, @byteRegs ); /* * return to the current location */ call gotoxy( savedX, savedY ); end vInvertAttributeAt; end vInvAtModule;