Exemplo n.º 1
0
void GrabHandlers( void )
{
    PMData->oldint10.a = MyGetRMVector( 0x10 );
    OldInt1b.a = MyGetRMVector( CTRL_BREAK_VECTOR );
    OldInt23.a = MyGetRMVector( 0x23 );
    OldInt24.a = MyGetRMVector( 0x24 );
    OldInt28.a = MyGetRMVector( 0x28 );
    MySetRMVector( 0x10, RMData.s.rm, RM_OFF( Interrupt10 ) );
    MySetRMVector( CTRL_BREAK_VECTOR, RMData.s.rm, RM_OFF( Interrupt1b_23 ) );
    MySetRMVector( 0x23, RMData.s.rm, RM_OFF( Interrupt1b_23 ) );
    MySetRMVector( 0x24, RMData.s.rm, RM_OFF( Interrupt24 ) );
    MySetRMVector( 0x28, Orig28.s.segment, Orig28.s.offset );
}
Exemplo n.º 2
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();
}
Exemplo n.º 3
0
void SaveOrigVectors( void )
{
    rm_data             *p;
    unsigned            i;
    unsigned            old;

#ifdef FULL_SAVE
    for( i = 0; i < INT_VECT_COUNT; ++i ) PMVectSaveList[i]=i;
    for( i = 0; i < EXCEPT_COUNT; ++i ) PMExceptSaveList[i]=i;
#endif
    old = D32NullPtrCheck( 0 );
    /* haven't moved things yet, so PMData isn't set up */
    p = (rm_data *)RMDataStart;
    for( i = 0; i < NUM_VECTS; ++i ) {
        p->orig_vects[i].a = MyGetRMVector( i );
    }
    D32NullPtrCheck( old );
    for( i = 0; i < NUM_PM_SAVE_VECTS; ++i ) {
        OrigPMVects[i] = DPMIGetPMInterruptVector( PMVectSaveList[i] );
    }
    for( i = 0; i < NUM_PM_SAVE_EXCEPTS; ++i ) {
        OrigPMExcepts[i] = DPMIGetPMExceptionVector( PMExceptSaveList[i] );
    }
    memcpy( p->vecttable1, p->orig_vects, sizeof( p->vecttable1 ) );
    memcpy( p->vecttable2, p->orig_vects, sizeof( p->vecttable2 ) );
    memcpy( SavePMVects, OrigPMVects, sizeof( SavePMVects ) );
    memcpy( SavePMExcepts, OrigPMExcepts, sizeof( SavePMExcepts ) );
}