2012-10-18 00:55 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/sysmem.prg
  * contrib/hbnf/readme.txt
    + Implemented FT_SYSMEM()

  * contrib/hbnf/dosver.c
  * contrib/hbnf/isshare.c
  * contrib/hbnf/kspeed.c
  * contrib/hbnf/mouse.c
  * contrib/hbnf/page.c
  * contrib/hbnf/setdate.c
  * contrib/hbnf/settime.c
  * contrib/hbnf/support.c
  * contrib/hbnf/vidmode.c
    ! fixed to #include <dos.h> (not "dos.h")

  * src/vm/fm.c
    + Memory( HB_MEM_FM ) to report low-memory on MS-DOS systems
      (build tested)

  * contrib/hbnf/nwsem.prg
  * contrib/hbnf/nwuid.prg
    * code cleanup, TODOs added
This commit is contained in:
Viktor Szakats
2012-10-17 22:59:28 +00:00
parent 7c86b77b5f
commit 8a2e26e429
15 changed files with 54 additions and 40 deletions

View File

@@ -16,6 +16,30 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-18 00:55 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/sysmem.prg
* contrib/hbnf/readme.txt
+ Implemented FT_SYSMEM()
* contrib/hbnf/dosver.c
* contrib/hbnf/isshare.c
* contrib/hbnf/kspeed.c
* contrib/hbnf/mouse.c
* contrib/hbnf/page.c
* contrib/hbnf/setdate.c
* contrib/hbnf/settime.c
* contrib/hbnf/support.c
* contrib/hbnf/vidmode.c
! fixed to #include <dos.h> (not "dos.h")
* src/vm/fm.c
+ Memory( HB_MEM_FM ) to report low-memory on MS-DOS systems
(build tested)
* contrib/hbnf/nwsem.prg
* contrib/hbnf/nwuid.prg
* code cleanup, TODOs added
2012-10-18 00:32 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/3rd/tiff/Makefile
- src/3rd/tiff/warning.c

View File

@@ -53,7 +53,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_DOSVER )

View File

@@ -53,7 +53,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_ISSHARE )

View File

@@ -26,7 +26,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_SETRATE )

View File

@@ -53,7 +53,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_MGETPAGE )

View File

@@ -38,15 +38,11 @@
#include "ftint86.ch"
#define INT21 33
#define WAIT_SEMAPHORE 2
#define SIGNAL_SEMAPHORE 3
#define CLOSE_SEMAPHORE 4
// Sorry this test routine is pretty lame but it sort of gets
// the point across
/* TODO: rewrite in C */
FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
LOCAL aRegs[ INT86_MAX_REGS ], cRequest, nRet
@@ -64,7 +60,7 @@ FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
aRegs[ DX ] := REG_DS
aRegs[ CX ] := nInitVal
ft_int86( INT21, aRegs )
ft_int86( 33, aRegs )
nHandle := Bin2L( I2Bin( aRegs[ CX ] ) + I2Bin( aRegs[ DX ] ) )
nOpenCnt := LOWBYTE( aRegs[ BX ] )
@@ -73,6 +69,7 @@ FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
RETURN iif( nRet < 0, nRet + 256, nRet )
/* TODO: rewrite in C */
FUNCTION ft_nwSemEx( nHandle, nValue, nOpenCnt )
LOCAL aRegs[ INT86_MAX_REGS ], nRet
@@ -85,7 +82,7 @@ FUNCTION ft_nwSemEx( nHandle, nValue, nOpenCnt )
aRegs[ CX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 1, 2 ) )
aRegs[ DX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 3, 2 ) )
ft_int86( INT21, aRegs )
ft_int86( 33, aRegs )
nValue := aRegs[ CX ]
nOpenCnt := LOWBYTE( aRegs[ DX ] )
@@ -109,6 +106,7 @@ FUNCTION ft_nwSemClose( nHandle )
// _ftnwsem() - internal for the semaphore package
// ---------------------------------------------------------
/* TODO: rewrite in C */
STATIC FUNCTION _ftnwsem( nOp, nHandle, nTimeout )
LOCAL aRegs[ INT86_MAX_REGS ], nRet
@@ -122,7 +120,7 @@ STATIC FUNCTION _ftnwsem( nOp, nHandle, nTimeout )
aRegs[ DX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 3, 2 ) )
aRegs[ BP ] := nTimeout
ft_int86( INT21, aRegs )
ft_int86( 33, aRegs )
nRet := LOWBYTE( aRegs[ AX ] )
nRet := iif( nRet < 0, nRet + 256, nRet )
@@ -130,10 +128,8 @@ STATIC FUNCTION _ftnwsem( nOp, nHandle, nTimeout )
FUNCTION ft_nwSemLock( cSemaphore, nHandle )
LOCAL nRc
LOCAL nOpenCnt := 0
nRc := FT_NWSEMOPEN( cSemaphore, 0, @nHandle, @nOpenCnt )
LOCAL nRc := FT_NWSEMOPEN( cSemaphore, 0, @nHandle, @nOpenCnt )
IF nRc == 0
IF nOpenCnt != 1

View File

@@ -33,9 +33,6 @@
#include "ftint86.ch"
#define DOS 33
#define NW_LOG 227
FUNCTION FT_NWUID( nConn )
LOCAL aRegs[ INT86_MAX_REGS ]
@@ -45,23 +42,20 @@ FUNCTION FT_NWUID( nConn )
nConn := iif( nConn == NIL, FT_NWLSTAT(), nConn )
// Set up request packet
cReqPkt := hb_BChar( 22 ) // Function 22: Get Connection Information
cReqPkt := hb_BChar( 22 ) // Get Connection Information
cReqPkt += hb_BChar( nConn )
cReqPkt := I2Bin( hb_BLen( cReqPkt ) ) + cReqPkt
// Set up reply packet
cRepPkt := Space( 63 )
// Assign registers
aRegs[ AX ] := MAKEHI( NW_LOG )
aRegs[ AX ] := MAKEHI( 227 ) // NW_LOG
aRegs[ DS ] := cReqPkt
aRegs[ SI ] := REG_DS
aRegs[ ES ] := cRepPkt
aRegs[ DI ] := REG_ES
FT_INT86( DOS, aRegs )
FT_INT86( 33, aRegs )
RETURN AllTrim( StrTran( hb_BSubStr( aRegs[ ES ], 9, 48 ), hb_BChar( 0 ) ) )

View File

@@ -53,7 +53,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_GETVPG )

View File

@@ -15,6 +15,4 @@ nwuid.prg FT_NWUID()
scancode.prg FT_SCANCODE()
sysmem.prg FT_SYSMEM()
vidcur.prg FT_GETVCUR(), FT_SETVCUR()

View File

@@ -79,7 +79,7 @@
#include "hbdate.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_SETDATE )

View File

@@ -79,7 +79,7 @@
#include "hbdate.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_SETTIME )

View File

@@ -54,7 +54,7 @@
#include "hbapiitm.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( _FT_NWKSTAT )

View File

@@ -29,15 +29,8 @@
*
*/
#include "ftint86.ch"
#define MEMSIZE 18
#include "hbmemory.ch"
FUNCTION FT_SYSMEM()
LOCAL aRegs[ INT86_MAX_REGS ]
aRegs[ AX ] := 0
FT_INT86( MEMSIZE, aRegs )
RETURN aRegs[ AX ]
RETURN Memory( HB_MEM_FM )

View File

@@ -78,7 +78,7 @@
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
# include <dos.h>
#endif
HB_FUNC( FT_SETMODE )

View File

@@ -98,6 +98,8 @@
#if defined( HB_OS_WIN )
# include <windows.h>
#elif defined( HB_OS_DOS )
# include <dos.h>
#endif
#if defined( HB_MT_VM )
@@ -1339,6 +1341,13 @@ HB_SIZE hb_xquery( int iMode )
else
nResult = ulSysInfo / 1024;
}
#elif defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0;
HB_DOS_INT86( 0x12, &regs, &regs );
iMode = regs.h.al;
}
#else
nResult = 9999;
#endif