Ejemplo n.º 1
0
void ProcFlip( void )
{
    char        *old;
    unsigned    wait;
    unsigned    cmd;

    wait = 0;
    if( !ScanEOC() ) {
        old = ScanPos();
        cmd = ScanCmd( OnOffNameTab );
        switch( cmd ) {
        case 1:
            ReqEOC();
            _SwitchOn( SW_FLIP );
            return;
        case 2:
            ReqEOC();
            _SwitchOff( SW_FLIP );
            return;
        default:
            ReScan( old );
            wait = ReqExpr();
            ReqEOC();
            break;
        }
    }
    Flip( wait );
}
Ejemplo n.º 2
0
void ProcFlip( void )
{
    const char  *old;
    uint_16     wait;

    wait = 0;
    if( !ScanEOC() ) {
        old = ScanPos();
        switch( ScanCmd( "ON\0OFf\0" ) ) {
        case 0:
            ReqEOC();
            _SwitchOn( SW_FLIP );
            return;
        case 1:
            ReqEOC();
            _SwitchOff( SW_FLIP );
            return;
        default:
            ReScan( old );
            wait = (uint_16)ReqExpr();
            ReqEOC();
            break;
        }
    }
    Flip( wait );
}
Ejemplo n.º 3
0
static brkp *PointBreak( memory_expr def_seg, address *addr )
{
    unsigned    index;
    brkp        *bp;
    unsigned    old;

    if( addr != NULL ) {
        *addr = NilAddr;
    }
    if( CurrToken == T_SHARP ) {
        Scan();
        old = NewCurrRadix( 10 );
        index = ReqExpr(); // always decimal
        NewCurrRadix( old );
        for( bp = BrkList; bp != NULL; bp = bp->next ) {
            if( bp->index == index ) {
                break;
            }
        }
    } else {
        ReqMemAddr( def_seg, addr );
        for( bp = BrkList; bp != NULL; bp = bp->next ) {
            if( AddrComp( bp->loc.addr, *addr ) == 0 ) {
                break;
            }
        }
    }
    ReqEOC();
    if( bp != NULL && addr != NULL ) {
        *addr = bp->loc.addr;
    }
    return( bp );
}
Ejemplo n.º 4
0
OVL_EXTERN brkp *ImageBreak( memory_expr def_seg )
{
    const char  *start;
    size_t      len;
    bool        clear = false;
    int         cmd;

    def_seg=def_seg;
    while( CurrToken == T_DIV ) {
        Scan();
        cmd = ScanCmd( PointNameTab );
        if( cmd < 0 )
            break;
        switch( cmd ) {
        case B_CLEAR:
            clear = true;
            break;
        default:
            Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_BREAK ) );
            break;
        }
    }
    if( !ScanItem( true, &start, &len ) ) {
        BadPoint( def_seg );
    }
    BreakOnImageLoad( start, len, clear );
    Scan();
    ReqEOC();
    return( NULL );
}
Ejemplo n.º 5
0
OVL_EXTERN brkp *ImageBreak( memory_expr def_seg )
{
    char        *start;
    size_t      len;
    bool        clear = FALSE;

    def_seg=def_seg;
    while( CurrToken == T_DIV ) {
        Scan();
        switch( ScanCmd( PointNameTab ) ) {
        case 0:
            goto done;
        case B_CLEAR:
            clear = TRUE;
            break;
        default:
            Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_BREAK ) );
            break;
        }
    }
done:;
    if( !ScanItem( TRUE, &start, &len ) ) {
        BadPoint( def_seg );
    }
    BreakOnImageLoad( start, len, clear );
    Scan();
    ReqEOC();
    return( NULL );
}
Ejemplo n.º 6
0
void TypeSet( void )
/******************/
{
    type_display        *parent;
    type_display        *field;

    ScanLeftBrace();
    while( !ScanRightBrace() ) {
        if( ScanCmd( &TypeSettings ) != TY_STRUCT ) oops();
        parent = VarDisplayAddStruct( ScanName() );
        ScanLeftBrace();
        while( !ScanRightBrace() ) {
            if( ScanAttribute( parent, ScanCmd( &TypeSettings ) ) == TY_FIELD ) {
                field = VarDisplayAddField( parent, ScanName() );
                ScanLeftBrace();
                while( !ScanRightBrace() ) {
                    if( ScanAttribute( field, ScanCmd( &TypeSettings ) ) == TY_FIELD ) {
                        oops();
                    }
                }
            }
        }
    }
    ReqEOC();
}
Ejemplo n.º 7
0
extern void ProcCapture( void )
{
    cmd_list    *cmds;
    const char  *start;
    size_t      len;
    const char  *old;
    char        *p;
    char        *end;

    if( !ScanItem( false, &start, &len ) )
        Error( ERR_NONE, LIT_ENG( ERR_WANT_COMMAND_LIST ) );
    ReqEOC();
    cmds = AllocCmdList( start, len );
    end = FileName + sizeof( FileName );
    p = FileName + PREFIX_LEN;
    p = CnvULongHex( TaskId, p, end - p );
    *p++ = RemFile.ext_separator;
    p = CnvULongDec( FileNum++, p, end - p );
    *p = NULLCHAR;
    old = ReScan( FileName+PREFIX_LEN );
    StdOutNew();
    ReScan( old );
    cmds->use++;
    CaptureOk = true;
    PushInpStack( cmds, DoneCapture, false );
    TypeInpStack( INP_CAPTURED );
    FreeCmdList( cmds );
}
Ejemplo n.º 8
0
void ProcSkip( void )
{
    address    start;

    ReqMemAddr( EXPR_GIVEN, &start );
    ReqEOC();
    SkipToAddr( start );
}
Ejemplo n.º 9
0
static void LangSet( void )
{
    const char  *start;
    size_t      len;

    ScanItem( TRUE, &start, &len );
    ReqEOC();
    NewLang( start );
}
Ejemplo n.º 10
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( "ON\0OFf\0", _IsOff( SW_FLIP ), p );
    DUIDlgTxt( TxtBuff );
}
Ejemplo n.º 11
0
bool SwitchOnOff( void )
{
    int     cmd;

    cmd = ScanCmd( "ON\0OFf\0" );
    if( cmd < 0 )
        Error( ERR_LOC, LIT_ENG( ERR_WANT_ON_OFF ) );
    ReqEOC();
    return( cmd == 0 );
}
Ejemplo n.º 12
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( &OnOffNameTab, _IsOn( SW_FLIP ) ? 1 : 2, p );
    DUIDlgTxt( TxtBuff );
}
Ejemplo n.º 13
0
void AsmExam()
{
    address     addr;
//    bool        prompt;

    addr = GetCodeDot();
    OptMemAddr( EXPR_CODE, &addr );
//    prompt = TRUE;
    ReqEOC();
    WndAsmInspect( addr );
}
Ejemplo n.º 14
0
void ProcError( void )
{
    const char  *start;
    size_t      len;

    ScanItem( false, &start, &len );
    ReqEOC();
    memcpy( TxtBuff, start, len );
    TxtBuff[len] = NULLCHAR;
    Error( ERR_NONE, LIT_ENG( ERR_GENERIC ), TxtBuff );
}
Ejemplo n.º 15
0
void ProcError( void )
{
    char        *start;
    unsigned    len;

    ScanItem( FALSE, &start, &len );
    ReqEOC();
    memcpy( TxtBuff, start, len );
    TxtBuff[ len ] = NULLCHAR;
    Error( ERR_NONE, LIT( ERR_GENERIC ), TxtBuff );
}
Ejemplo n.º 16
0
void ProcWindow( void )
{
    a_window    *wnd = WndFindActive();
    unsigned    cmd;

    cmd = ScanCmd( WindowNameTab );
    ReqEOC();
    if( wnd != NULL ) {
        WndJmpTab[ cmd ]( wnd );
    }
}
Ejemplo n.º 17
0
void SrcExam( void )
{
    address     addr;
//    bool        prompt;

    addr = GetCodeDot();
    OptMemAddr( EXPR_CODE, &addr );
//    prompt = true;
    ReqEOC();
    WndSrcInspect( addr );
}
Ejemplo n.º 18
0
OVL_EXTERN      void    TestExpression( void *_bp )
{
    brkp        *bp = _bp;
    const char  *old;
    int         val;

    old = ReScan( bp->condition );
    val = ReqExpr();
    ReqEOC();
    ReScan( old );
    if( val ) {
        bp->status.b.expr_true = true;
    }
}
Ejemplo n.º 19
0
static brkp *ClearPoint( memory_expr def_seg )
{
    address addr;
    if( CurrToken == T_MUL ) {
        Scan();
        ReqEOC();
        while( BrkList != NULL ) {
            RemovePoint( BrkList );
        }
    } else {
        RemovePoint( BPNotNull( PointBreak( def_seg, &addr ) ) );
    }
    return( NULL );
}
Ejemplo n.º 20
0
void ProcAssign( void )
{
    char        *startpos;

    if( !AdvMachState( ACTION_ASSIGNMENT ) ) {
        FlushEOC();
        return;
    }
    startpos = ScanPos();
    NormalExpr();
    PopEntry();
    ReqEOC();
    RecordCommand( startpos, CMD_ASSIGN );
}
Ejemplo n.º 21
0
void ProcPaint( void )
{
    wnd_class           wndcls;
    gui_colour          fore;
    gui_colour          back;
    gui_colour_set      *set;
    bool                dialog;
    int                 attr;

    dialog = FALSE;
    wndcls = WND_NO_CLASS;
    if( ScanStatus() ) {
        attr = 0;
    } else if( ScanCmd( "DIalog\0" ) == 0 ) {
        dialog = TRUE;
        attr = ScanAttr( DlgAttrMap, ArraySize( DlgAttrMap ) );
    } else {
        wndcls = ReqWndName();
        attr = ScanAttr( AttrMap, ArraySize( AttrMap ) );
    }
    fore = ScanColour();
    ScanCmd( "On\0" );
    back = ScanColour();
    ReqEOC();
    if( attr < 0 )
        return;
    if( wndcls == WND_NO_CLASS ) {
        if( dialog ) {
            GUIGetDialogColours( WndDlgColours );
            set_dlg_attr( (gui_dlg_attr)attr, fore, back );
            GUISetDialogColours( WndDlgColours );
        } else {
            WndStatusColour.fore = fore;
            WndStatusColour.back = back;
            if( WndHaveStatusWindow() ) {
                WndCloseStatusWindow();
                WndCreateStatusWindow( &WndStatusColour );
            }
        }
    } else {
        set = WndClassColour[wndcls];
        if( set == NULL ) {
            set = WndAlloc( sizeof( WndColours ) );
            memcpy( set, WndColours, sizeof( WndColours ) );
            WndClassColour[wndcls] = set;
        }
        set_wndcls_attr( (wnd_attr)attr, set, fore, back, ( wndcls == WND_ALL ) );
        _SwitchOn( SW_PENDING_REPAINT );
    }
}
Ejemplo n.º 22
0
void RadixSet( void )
{
    unsigned   radix;
    unsigned   old;

    old = SetCurrRadix( 10 ); /* radix sets are always base 10 */
    radix = ReqExpr();
    ReScan( TokenStart );
    ReqEOC();
    if( radix < 2 || radix > 36 ) {
        Error( ERR_NONE, LIT( ERR_BAD_RADIX ), radix );
    }
    SetCurrRadix( old );
    DefaultRadixSet( radix );
}
Ejemplo n.º 23
0
void WndDumpFile( a_window *wnd )
{
    const char          *start;
    size_t              len;
    bool                got;

    got = ScanItem( TRUE, &start, &len );
    ReqEOC();
    if( !got ) {
        WndDumpPrompt( wnd );
    } else {
        memcpy( TxtBuff, start, len );
        TxtBuff[len] = '\0';
        DoWndDumpFile( TxtBuff, wnd );
    }
}
Ejemplo n.º 24
0
OVL_EXTERN void GetModName( void *value )
{
    mod_handle  mod;
    char        *start;
    size_t      len;

    RawScanInit();
    ScanItem( FALSE, &start, &len );
    mod = LookupModName( NO_MOD, start, len );
    if( mod == NO_MOD ) {
        Error( ERR_NONE, LIT( ERR_NO_MODULE ), start, len );
    }
    Scan();
    ReqEOC();
    *(mod_handle *)value = mod;
}
Ejemplo n.º 25
0
void ProcIf( void )
{
    const char          *start;
    size_t              len;
    const char          *true_start;
    size_t              true_len;
    unsigned_64         res;
    cmd_list            *cmd;
    bool                have_true;

    true_len = 0;
    have_true = false;
    for( ;; ) {
        if( have_true ) {
            ChkExpr();
            U64Clear( res );
        } else {
            res = ReqU64Expr();
        }
        if( !ScanQuote( &start, &len ) ) {
            Error( ERR_LOC, LIT_ENG( ERR_WANT_COMMAND_LIST ) );
        }
        if( U64Test( &res ) != 0 ) {
            true_start = start;
            true_len   = len;
            have_true  = true;
        }
        if( ScanCmd( ElseifTab ) < 0 ) {
            break;
        }
    }
    ScanCmd( ElseTab ); /* optional else */
    if( ScanQuote( &start, &len ) && !have_true ) {
        true_start = start;
        true_len   = len;
    }
    ReqEOC();
    if( true_len != 0 ) {
        cmd = AllocCmdList( true_start, true_len );
        PushCmdList( cmd );
        CopyInpFlags();
        FreeCmdList( cmd );
    }
}
Ejemplo n.º 26
0
void ProcSystem()
{
    char        *start;
    size_t      len;
    int         loc;

    loc = 0;
    if( CurrToken == T_DIV ) {
        Scan();
        loc = ScanCmd( SystemOps );
        if( loc == 0 ) {
            Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_SYSTEM ) );
        }
        if( loc == 2 ) loc = -1;
    }
    ScanItem( FALSE, &start, &len );
    ReqEOC();
    DoSystem( start, len, loc );
}
Ejemplo n.º 27
0
static brkp *Ac_DeacPoint( memory_expr def_seg,
                          bool act, void ( *rtn ) ( brkp *, bool ) )
{
    brkp        *bp;
    address     addr;

    if( CurrToken == T_MUL ) {
        Scan();
        ReqEOC();
        for( bp = BrkList; bp != NULL; bp = bp->next ) {
            rtn( bp, act );
        }
        return( NULL );
    } else {
        bp = BPNotNull( PointBreak( def_seg, &addr ) );
        rtn( bp, act );
        return( bp );
    }
}
Ejemplo n.º 28
0
void ProcFont( void )
{
    wnd_class_wv    wndclass;
    const char      *start;
    size_t          len;
    wnd_class_wv    wndclass1;

    wndclass = ReqWndName();
    if( !ScanItem( false, &start, &len ) )
        return;
    ReqEOC();
    if( wndclass == WND_ALL ) {
        for( wndclass1 = 0; wndclass1 < WND_NUM_CLASSES; ++wndclass1 ) {
            SetFont( wndclass1, NULL );
        }
    }
    SetFont( wndclass, GUIDupStrLen( start, len ) );
    _SwitchOn( SW_PENDING_REPAINT );
}
Ejemplo n.º 29
0
static void OpenLog( open_access mode )
{
    const char  *start;
    size_t      len;

    if( LogHndl != NIL_HANDLE ) {
        Error( ERR_NONE, LIT_ENG( ERR_LOG_STARTED ) );
    } else if( !ScanItem( TRUE, &start, &len ) ) {
        Error( ERR_LOC, LIT_ENG( ERR_WANT_FILENAME ) );
    } else {
        if( len > TXT_LEN ) len = TXT_LEN;
        ReqEOC();
        memcpy( TxtBuff, start, len );
        TxtBuff[len] = NULLCHAR;
        LogHndl = FileOpen( TxtBuff, mode );
        if( LogHndl == NIL_HANDLE ) {
            Error( ERR_NONE, LIT_ENG( ERR_FILE_NOT_OPEN ), TxtBuff );
        }
    }
}
Ejemplo n.º 30
0
void ProcWhile( void )
{
    char                *start;
    unsigned            len;
    unsigned_64         res;
    cmd_list            *cmd;

    res = ReqU64Expr();
    if( !ScanQuote( &start, &len ) || len == 0 ) {
        Error( ERR_LOC, LIT( ERR_WANT_COMMAND_LIST ) );
    }
    ReqEOC();
    if( U64Test( &res ) != 0 ) {
        cmd = AllocCmdList( start, len );
        ReScan( CmdStart );
        PushCmdList( cmd );
        CopyInpFlags();
        FreeCmdList( cmd );
    }
}