Ejemplo n.º 1
0
void GUImain( void )
{
#if defined(__OSI__) || __WATCOMC__ < 1000
    {
    long    result;

#if defined(__OSI__)
    _Extender = 1;
#endif
    result = DPMIAllocateLDTDescriptors( 1 );
    if( result < 0 ) {
        StartupErr( LIT( Unable_to_get_rm_sel ) );
    }
    _ExtenderRealModeSelector = result & 0xffff;
    if( DPMISetSegmentLimit( _ExtenderRealModeSelector, 0xfffff ) ) {
        StartupErr( LIT( Unable_to_get_rm_sel ) );
    }
    }
#endif
    SaveOrigVectors();
    Orig28.a = MyGetRMVector( 0x28 );

    RMData.a = DPMIAllocateDOSMemoryBlock( _NBPARAS( RMSegEnd - RMSegStart ) );
    if( RMData.s.pm == 0 ) {
        StartupErr( LIT( Unable_to_alloc_DOS_mem ) );
    }
    PMData = MK_FP( RMData.s.pm, 0 );
    _fmemcpy( PMData, RMSegStart, RMSegEnd - RMSegStart );
    if( _osmajor == 2 ) {
        PMData->fail = 0;
    } else {
        PMData->fail = 3;
    }
    DebugMain();
}
Ejemplo n.º 2
0
void __far __fortran __nTinySetDTA( void __far *a )
{
    long                rc;
    unsigned long       base;

    /*
     * get a DTA descriptor that will survive across the 16/32 bit
     * interface
     */
    if( DTA == 0 ) {
        rc = DPMIAllocateLDTDescriptors( 1 );
        if( rc <= 0 ) return;
        /*
         * set up a basic DTA descriptor
         */
        DTA = (unsigned short) rc;
        DPMISetSegmentLimit( DTA, sizeof(tiny_find_t) );
        DPMISetDescriptorAccessRights( DTA, DPL+ACCESS_DATA16 );
    }

    base = DPMIGetSegmentBaseAddress( FP_SEG( a ) );
    base += FP_OFF( a );
    DPMISetSegmentBaseAddress( DTA, base );
    _fTinySetDTA( MK_FP( DTA,0) );
}