2012-10-17 20:39 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/hbnf.hbx
  * contrib/hbnf/video1.c
    + Implemented FT_REVATTR(), FT_REVCHR()

  * contrib/hbnf/floptst.prg
    + Implemented FT_FLOPTST()

  * contrib/hbct/doc/en/*.txt
    ! fixed lib name where wrong

  * contrib/hbnf/cint86.c
  * contrib/hbnf/support.c
    * changed TODOs to visible warnings on MS-DOS platform

  * contrib/hbnf/ftattr.c
    % FT_RESTATT(): buffering output
    * minor cleanups

  * contrib/hbnf/readme.txt
    * updated

  * contrib/hbnf/doc/en/*.txt
    ! minor fixes
This commit is contained in:
Viktor Szakats
2012-10-17 18:47:20 +00:00
parent 10e5f09d4a
commit 8a3cba5756
27 changed files with 221 additions and 269 deletions

View File

@@ -16,6 +16,31 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-17 20:39 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/hbnf.hbx
* contrib/hbnf/video1.c
+ Implemented FT_REVATTR(), FT_REVCHR()
* contrib/hbnf/floptst.prg
+ Implemented FT_FLOPTST()
* contrib/hbct/doc/en/*.txt
! fixed lib name where wrong
* contrib/hbnf/cint86.c
* contrib/hbnf/support.c
* changed TODOs to visible warnings on MS-DOS platform
* contrib/hbnf/ftattr.c
% FT_RESTATT(): buffering output
* minor cleanups
* contrib/hbnf/readme.txt
* updated
* contrib/hbnf/doc/en/*.txt
! minor fixes
2012-10-17 16:31 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbct/doc/en/*.txt
* doc/en/*.txt

View File

@@ -60,7 +60,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$

View File

@@ -34,7 +34,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHECKSUM()
* $END$

View File

@@ -40,7 +40,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* SETATLIKE(),CSETATMUPA()
* $END$

View File

@@ -108,7 +108,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
* $END$

View File

@@ -61,7 +61,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CSETATMUPA() SETATLIKE()
* $END$

View File

@@ -32,7 +32,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARODD() CHARMIX()
* $END$
@@ -67,7 +67,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHAREVEN() CHARMIX()
* $END$

View File

@@ -41,7 +41,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$

View File

@@ -47,7 +47,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHAREVEN() CHARODD()
* $END$

View File

@@ -40,7 +40,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARREM() WORDONE()
* $END$
@@ -81,7 +81,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARONE() CHARREM()
* $END$

View File

@@ -35,7 +35,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARREM() WORDONLY() WORDREM()
* $END$
@@ -74,7 +74,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARONLY() CHARREM() WORDREM()
* $END$
@@ -112,7 +112,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARONLY() WORDONLY() WORDREM()
* $END$
@@ -151,7 +151,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARONLY CHARREM() WORDREM()
* $END$

View File

@@ -43,7 +43,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARSUB() CHARAND() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
@@ -92,7 +92,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
@@ -137,7 +137,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARSHL()
@@ -186,7 +186,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHARAND() CHARXOR() CHARSHL()
@@ -233,7 +233,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHARAND() CHAROR() CHARSHL()

View File

@@ -43,7 +43,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARAND() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
@@ -89,7 +89,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
@@ -135,7 +135,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
@@ -181,7 +181,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
@@ -227,7 +227,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()

View File

@@ -59,7 +59,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* WORDREPL() POSREPL() RANGEREPL()
* CSETREF()

View File

@@ -77,7 +77,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$

View File

@@ -29,7 +29,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
*
* $END$
@@ -62,7 +62,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
*
* $END$

View File

@@ -50,7 +50,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* ADDASCII() BLANK() CHARADD()
* CHARAND() CHARMIRR() CHARNOT()
@@ -100,7 +100,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* ATNUM() AFTERATNUM() BEFORATNUM()
* ATREPL() NUMAT() ATADJUST()
@@ -164,7 +164,7 @@
* $PLATFORMS$
* All
* $FILES$
* Header is ct.ch, library is ct3.
* Header is ct.ch, library is libct.
* $SEEALSO$
*
* $END$

View File

@@ -60,7 +60,7 @@
* $PLATFORMS$
* All
* $FILES$
* Library is ct3.
* Library is libct.
* $SEEALSO$
* CHARREPL(),RANGEREPL(),POSREPL(),CSETREF(),CSETATMUPA()
* $END$

View File

@@ -7,7 +7,9 @@
HB_FUNC( FT_INT86 )
{
#if defined( HB_OS_DOS )
/* TODO */
{
int iTODO;
}
#endif
hb_retl( HB_FALSE );
}

View File

@@ -35,7 +35,7 @@
* should be no problems.
*
* This function does not currently check subst'd drives. So if you
* have SUBST E: A:\ then FT_FLOPTST( Asc("E")-Asc("A") ) == 4
* have SUBST E: A:\ then FT_FLOPTST( Asc( "E" ) - Asc( "A" ) ) == 4
* Any suggestions to fix this limitation are appreciated.
*
* $EXAMPLES$

View File

@@ -173,13 +173,13 @@
/* $DOC$
* $FUNCNAME$
* FT_REVChr()
* FT_REVCHR()
* $CATEGORY$
* Video
* $ONELINER$
* Reverse the color of a single character on the screen
* $SYNTAX$
* FT_REVChr( <nTRow>, <nLCol> ) -> NIL
* FT_REVCHR( <nTRow>, <nLCol> ) -> NIL
* $ARGUMENTS$
* <nTRow>, <nLCol> are the screen coordinates of the character.
* $RETURNS$
@@ -190,7 +190,7 @@
* This function is the same as FT_REVATTR() except that it changes
* only one character on screen and hence is faster and uses less memory.
* $EXAMPLES$
* FT_REVChr( 10, 20 )
* FT_REVCHR( 10, 20 )
*
* This example will change the text and background at 10, 20 to it's
* reverse color attributes without changing or overwriting the

View File

@@ -3,214 +3,90 @@
*/
/*
* Author....: Gary Smith
* CIS ID....: 70714,3015
* Harbour Project source code:
* FT_FLOPTST()
*
* This work is based on an original work by Joseph LaCour that
* was placed in the public domain. This work is placed in the
* public domain.
* Copyright 2012 Viktor Szakats (harbour syenar.net)
* www - http://harbour-project.org
*
* ACKNOWLEDGEMENTS:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* PAOLO RAMOZZI FOR HIS WORK IN DBDCHECK FOR SHOWING HOW TO
* USE INT 13H.
* 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* Modification history:
* ---------------------
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* Rev 1.4 05 May 1995 03:05:00 TED
* Gary Smith ported ASM source to Clipper.
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* Rev 1.3 23 Sep 1991 14:56:42 GLENN
* Bug reports from Craig Austin, James Finnal, and Ted Means. Line 128
* had MOV FDRIVE,AL which should have been MOV FDRIVE,BL. This caused the
* function to erroneously use the last drive available instead of the one
* specified by the calling process.
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* Rev 1.2 15 Aug 1991 23:07:48 GLENN
* Forest Belt proofread/edited/cleaned up doc
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
* Rev 1.1 11 May 1991 00:21:42 GLENN
* File header changed to conform to Toolkit standard.
*/
#include "ftint86.ch"
#include "fileio.ch"
#define ERR_WRONG_PARAMETERS -1
#define ERR_WRONG_PARAMETERS ( -1 )
#define ERR_NO_ERROR 0
#define ERR_DRIVE_NOT_READY 1
#define ERR_UNFORMATTED 2
#define ERR_DRIVE_NOT_READY 1 /* unused */
#define ERR_UNFORMATTED 2 /* unused */
#define ERR_WRITE_PROTECTED 3
#define ERR_UNKNOWN 4
// error code defined by ERR_*
FUNCTION FT_FLOPTST( nDriveNum_i /* letter of floppy drive */ )
LOCAL cBuffer
LOCAL nErrorCode
LOCAL nRetCode
/* NOTE: Harbour port accepts a path as a string for checking
for writability. It also won't detected unformatted
state and "not ready" state. [vszakats] */
FUNCTION FT_FLOPTST( nDriveNum )
LOCAL cFileName
LOCAL fhnd
nRetCode := ERR_WRONG_PARAMETERS
IF HB_ISNUMERIC( nDriveNum_i )
IF _GetDisketteNum( nDriveNum_i )
_ResetDisketteSystem()
_ReadBootSector( nDriveNum_i, @cBuffer, @nErrorCode )
IF nErrorCode == 0
_WriteBootSector( nDriveNum_i, cBuffer, @nErrorCode )
DO CASE
CASE nErrorCode == 0
nRetCode := ERR_NO_ERROR
CASE nErrorCode == 3
nRetCode := ERR_WRITE_PROTECTED
OTHERWISE
nRetCode := ERR_UNKNOWN
ENDCASE
ELSE
DO CASE
CASE nErrorCode == 128 // 80h
nRetCode := ERR_DRIVE_NOT_READY
CASE nErrorCode == 2
nRetCode := ERR_UNFORMATTED
OTHERWISE
nRetCode := ERR_UNKNOWN
ENDCASE
ENDIF
ENDIF
IF HB_ISNUMERIC( nDriveNum )
cFileName := Chr( Asc( "A" ) + nDriveNum ) + hb_osDriveSeparator()
ELSEIF HB_ISSTRING( nDriveNum )
cFileName := nDriveNum
ELSE
RETURN ERR_WRONG_PARAMETERS
ENDIF
RETURN nRetCode
cFileName := hb_DirSepAdd( cFileName ) + "nf$rwtst.tmp"
#define BITS_6AND7 192 // value of byte when bits 6&7 are high
// returns false if no floppy drive installed or nDrive_i is invalid
STATIC FUNCTION _GetDisketteNum( nDrive_i ) // drive number to query status
LOCAL aRegs[ INT86_MAX_REGS ]
LOCAL lRetCode
LOCAL nByte
LOCAL nDriveCount
// ASSERT 0 <= nDrive_i
lRetCode := .F.
IF FT_INT86( 1 * 16 + 1, aRegs ) // INT for equipment determination
nByte := LOWBYTE( aRegs[ AX ] )
// bit 0 indicates floppy drive installed
IF Int( nByte / 2 ) * 2 != nByte // is it odd i.e. is bit 0 set??
// bits 6 & 7 indicate number of floppies installed upto 4.
nDriveCount := hb_BCode( FT_BYTEAND( hb_BChar( nByte ), hb_BChar( BITS_6AND7 ) ) )
IF nDriveCount >= nDrive_i
lRetCode := .T.
ENDIF
IF hb_FileExists( cFileName )
IF ( fhnd := FOpen( cFileName, FO_DENYNONE + FO_READWRITE ) ) == F_ERROR
RETURN ERR_WRITE_PROTECTED
ENDIF
FClose( fhnd )
ELSE
IF ( fhnd := hb_FCreate( cFileName, FC_NORMAL, FO_DENYNONE + FO_READWRITE ) ) == F_ERROR
RETURN ERR_WRITE_PROTECTED
ENDIF
FClose( fhnd )
FErase( cFileName )
ENDIF
RETURN lRetCode
STATIC PROCEDURE _ResetDisketteSystem()
LOCAL aRegs[ INT86_MAX_REGS ]
aRegs[ AX ] := 0
FT_INT86( 1 * 16 + 3, aRegs )
RETURN
#define BUFFER_SIZEOF_SECTOR 512+1
STATIC FUNCTION _ReadBootSector( ;
nDriveNum, ;
cBuffer_o, ;
nErrCode_o ;
)
// call BIOS INT 13 for sector read
LOCAL aRegs[ INT86_MAX_REGS ]
LOCAL cBuffer := Space( BUFFER_SIZEOF_SECTOR )
LOCAL lSuccess
LOCAL nErrorCode
LOCAL lCarryFlag
aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ ES ] := cBuffer
aRegs[ AX ] := MAKEHI( 2 ) + 1 // AH = 02 read, AL=1 read one sector
lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode )
cBuffer_o := aRegs[ ES ]
nErrCode_o := nErrorCode
RETURN lSuccess
STATIC FUNCTION _WriteBootSector( ;
nDriveNum, ;
cBuffer_i, ;
nErrCode_o ;
)
// call BIOS INT 13 for sector write
LOCAL aRegs[ INT86_MAX_REGS ]
LOCAL lSuccess
LOCAL nErrorCode
LOCAL lCarryFlag
aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ ES ] := cBuffer_i
aRegs[ AX ] := MAKEHI( 3 ) + 1 // AH = 03 write, AL=1 read one sector
lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode )
nErrCode_o := nErrorCode
RETURN lSuccess
STATIC FUNCTION _CallInt13hRetry( ; // logical: did the interrupt succeed?
aRegs_io, ; // registers values for INT 13h
lCarrySet_o, ; // status of carry flag if return code is true.
nDriveStatus_o ; // status of drive ( error code )
)
LOCAL lCarrySet
LOCAL aRegisters
LOCAL lSuccess
LOCAL nInterrupt_c := 1 * 16 + 3 // INT 13h
LOCAL i
lCarrySet := .F.
aRegisters := AClone( aRegs_io )
lSuccess := FT_INT86( nInterrupt_c, aRegisters )
IF lSuccess
lCarrySet := CARRYSET( aRegisters[ FLAGS ] )
IF lCarrySet
_ResetDisketteSystem()
aRegisters := AClone( aRegs_io )
FT_INT86( nInterrupt_c, aRegisters )
lCarrySet := CARRYSET( aRegisters[ FLAGS ] )
IF lCarrySet
_ResetDisketteSystem()
aRegisters := AClone( aRegs_io )
FT_INT86( nInterrupt_c, aRegisters )
lCarrySet := CARRYSET( aRegisters[ FLAGS ] )
IF lCarrySet
_ResetDisketteSystem()
ENDIF
ENDIF
ENDIF
ENDIF
FOR i := 1 TO INT86_MAX_REGS
// pass altered register back up
aRegs_io[ i ] := aRegisters[ i ]
NEXT
lCarrySet_o := lCarrySet
nDriveStatus_o := HIGHBYTE( aRegisters[ AX ] )
RETURN lSuccess
RETURN ERR_NO_ERROR

View File

@@ -35,7 +35,7 @@ HB_FUNC( FT_SAVEATT )
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxRow );
HB_SIZE ulSize;
HB_SIZE nSize;
char * pBuffer;
char * pAttrib;
@@ -50,23 +50,23 @@ HB_FUNC( FT_SAVEATT )
if( iTop <= iBottom && iLeft <= iRight )
{
ulSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 );
pBuffer = pAttrib = ( char * ) hb_xgrab( ulSize + 1 );
nSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 );
pBuffer = pAttrib = ( char * ) hb_xgrab( nSize + 1 );
while( iTop <= iBottom )
{
int iCol = iLeft;
while( iCol <= iRight )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar );
*pBuffer++ = ( char ) iColor;
++iCol;
}
++iTop;
}
hb_retclen_buffer( pAttrib, ulSize );
hb_retclen_buffer( pAttrib, nSize );
}
else
hb_retc_null();
@@ -96,17 +96,17 @@ HB_FUNC( FT_SAVEATT )
HB_FUNC( FT_RESTATT )
{
HB_SIZE ulLen = hb_parclen( 5 );
HB_SIZE nLen = hb_parclen( 5 );
if( ulLen )
if( nLen )
{
int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */
int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
int iMaxRow = hb_gtMaxRow();
int iMaxCol = hb_gtMaxCol();
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxCol );
const char * pAttrib = hb_parc( 5 );
int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */
int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
int iMaxRow = hb_gtMaxRow();
int iMaxCol = hb_gtMaxCol();
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxCol );
const char * pAttrib = hb_parc( 5 );
if( iTop < 0 )
iTop = 0;
@@ -119,22 +119,26 @@ HB_FUNC( FT_RESTATT )
if( iTop <= iBottom && iLeft <= iRight )
{
while( ulLen && iTop <= iBottom )
hb_gtDispBegin();
while( nLen && iTop <= iBottom )
{
int iCol = iLeft;
while( ulLen && iCol <= iRight )
while( nLen && iCol <= iRight )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar );
iColor = ( HB_UCHAR ) *pAttrib++;
hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar );
++iCol;
--ulLen;
--nLen;
}
++iTop;
}
hb_gtDispEnd();
}
}
}

View File

@@ -197,6 +197,8 @@ DYNAMIC FT_REBOOT
DYNAMIC FT_RESTARR
DYNAMIC FT_RESTATT
DYNAMIC FT_RESTSETS
DYNAMIC FT_REVATTR
DYNAMIC FT_REVCHR
DYNAMIC FT_RGNSTACK
DYNAMIC FT_RMDIR
DYNAMIC FT_ROUND

View File

@@ -2,17 +2,8 @@
* $Id$
*/
Functions to be rewritten:
c\video1.c FT_REVATTR(), FT_REVCHR()
Functions to be fixed:
cint86.c FT_INT86()
Functions using FT_INT86() to be rewritten:
floptst.prg FT_FLOPTST()
nwsem.prg FT_NWSEMOPEN()
nwsem.prg FT_NWSEMEX()
nwsem.prg FT_NWSEMWAIT()
@@ -21,8 +12,12 @@ nwsem.prg FT_NWSEMCLOSE()
nwsem.prg FT_NWSEMLOCK()
nwsem.prg FT_NWSEMUNLOCK()
nwuid.prg FT_NWUID()
scancode.prg FT_SCANCODE()
setdate.prg FT_SETDATE()
settime.prg FT_SETTIME()
sysmem.prg FT_SYSMEM()
vidcur.prg FT_GETVCUR(), FT_SETVCUR()

View File

@@ -119,7 +119,9 @@ HB_FUNC( _FT_TEMPFIL )
HB_FUNC( FT_INP )
{
#if defined( HB_OS_DOS )
/* TODO */
{
int iTODO;
}
#endif
hb_retni( 0 );
}
@@ -127,7 +129,9 @@ HB_FUNC( FT_INP )
HB_FUNC( FT_OUTP )
{
#if defined( HB_OS_DOS )
/* TODO */
{
int iTODO;
}
#endif
hb_retl( HB_FALSE );
}
@@ -135,7 +139,9 @@ HB_FUNC( FT_OUTP )
HB_FUNC( FT_REBOOT )
{
#if defined( HB_OS_DOS )
/* TODO */
{
int iTODO;
}
#endif
hb_ret();
}

View File

@@ -4,10 +4,10 @@
/*
* Harbour Project source code:
* NF function: FT_SETATTR()
* NF functions: FT_SETATTR(), FT_REVATTR(), FT_REVCHR()
*
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*
* Copyright 2012 Viktor Szakats (harbour syenar.net)
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
@@ -63,16 +63,58 @@ HB_FUNC( FT_SETATTR )
hb_parni( 5 ) );
}
#if 0
HB_FUNC( FT_REVATTR )
{
hb_ret();
int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */
int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
int iMaxRow = hb_gtMaxRow();
int iMaxCol = hb_gtMaxCol();
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxCol );
if( iTop < 0 )
iTop = 0;
if( iLeft < 0 )
iLeft = 0;
if( iBottom > iMaxRow )
iBottom = iMaxRow;
if( iRight > iMaxCol )
iRight = iMaxCol;
if( iTop <= iBottom && iLeft <= iRight )
{
hb_gtDispBegin();
while( iTop <= iBottom )
{
int iCol = iLeft;
while( iCol <= iRight )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar );
iColor = ( iColor << 4 ) | ( iColor >> 4 );
hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar );
++iCol;
}
++iTop;
}
hb_gtDispEnd();
}
}
HB_FUNC( FT_REVCHR )
{
hb_ret();
}
int iRow = hb_parni( 1 );
int iCol = hb_parni( 2 );
#endif
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iRow, iCol, &iColor, &bAttr, &usChar );
iColor = ( iColor << 4 ) | ( iColor >> 4 );
hb_gtPutChar( iRow, iCol, iColor, bAttr, usChar );
}