示例#1
0
static void ReqComma( void )
{
    if( CurrToken != T_COMMA ) {
        Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_BREAK ) );
    }
    Scan();
}
示例#2
0
void SourceSet( void )
{
    char_ring **owner;
    char      *start;
    unsigned   len;

    if( CurrToken == T_DIV ) {
        Scan();
        if( ScanCmd( AddTab ) == 0 ) {
            Error( ERR_LOC, LIT( ERR_BAD_SUBCOMMAND ), GetCmdName( CMD_SET ) );
        }
        owner = RingEnd( &SrcSpec );
    } else {
        owner = &SrcSpec;
        FiniSource();
    }
    while( ScanItem( TRUE, &start, &len ) ) {
        while( len > 0 && *start == ' ' ) {
            ++start;
            --len;
        }
        InsertRing( owner, start, len );
    }
    DbgUpdate( UP_NEW_SRC );
}
示例#3
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 );
}
示例#4
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 );
}
示例#5
0
static  void    PrintPosition( disp_optn optn, wnd_class_wv wndclass,
                               gui_rect *rect, char *buff, char *buff2 )
{
    GetCmdEntry( WndNameTab, wndclass, buff );
    GetCmdEntry( DispOptions, optn, buff2 );
    Format( TxtBuff, "%s %s /%s %d,%d,%d,%d", GetCmdName( CMD_DISPLAY ), buff, buff2,
                     rect->x, rect->y, rect->width, rect->height );
    WndDlgTxt( TxtBuff );
}
示例#6
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( &OnOffNameTab, _IsOn( SW_FLIP ) ? 1 : 2, p );
    DUIDlgTxt( TxtBuff );
}
示例#7
0
void ConfigFlip( void )
{
    char *p;

    ReqEOC();
    p = StrCopy( GetCmdName( CMD_FLIP ), TxtBuff );
    *p++ = ' ';
    GetCmdEntry( "ON\0OFf\0", _IsOff( SW_FLIP ), p );
    DUIDlgTxt( TxtBuff );
}
示例#8
0
static void PrintStatusColour( void )
{
    char        fore[20];
    char        back[20];

    GetColourName( WndStatusColour.fore, fore );
    GetColourName( WndStatusColour.back, back );
    Format( TxtBuff, "%s status %s on %s", GetCmdName( CMD_PAINT ), fore, back );
    WndDlgTxt( TxtBuff );
}
示例#9
0
static void ProcStatus( void )
{
    disp_optn   optn;

    optn = GetOption();
    if( optn == OPEN ) {
        WndCreateStatusWindow( &WndStatusColour );
    } else if( optn == CLOSE ) {
        WndCloseStatusWindow();
    } else {
        Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_DISPLAY ) );
    }
}
示例#10
0
static void PrintFont( wnd_class_wv wndclass, char *def )
{
    char        wndname[20];
    char        *font;

    font = WndFontInfo[wndclass];
    if( font == NULL )
        return;
    if( def == NULL || strcmp( font, def ) != 0 ) {
        GetCmdEntry( WndNameTab, wndclass, wndname );
        Format( TxtBuff, "%s %s {%s}", GetCmdName( CMD_FONT ), wndname, font );
        WndDlgTxt( TxtBuff );
    }
}
示例#11
0
void GetBreakOnImageCmd( const char *name, char *buff, bool clear )
{
    char        *p;

    p = Format( buff, "%s", GetCmdName( CMD_BREAK ) );
    *p++ = '/';
    p = GetCmdEntry( PointNameTab, B_IMAGE, p );
    if( clear ) {
        *p++ = '/';
        p = GetCmdEntry( PointNameTab, B_CLEAR, p );
    }
    *p++ = ' ';
    p = StrCopy( name, p );
}
示例#12
0
static char     GetOption( void )
{
    char        optn;

    if( CurrToken == T_DIV ) {
        Scan();
        optn = ScanCmd( DispOptions );
        if( optn == 0 ) {
            Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_DISPLAY ) );
        }
    } else {
        optn = OPEN;
    }
    return( optn );
}
示例#13
0
void SetBPPatch( brkp *bp, char *patch )
{
    char        *end;

    end = StrCopy( patch, StrCopy( " ", StrCopy( GetCmdName( CMD_DO ), TxtBuff ) ) );
    if( bp->cmds != NULL ) {
        FreeCmdList( bp->cmds );
    }
    if( patch == NULL || patch[0] == '\0' ) {
        bp->cmds = NULL;
    } else {
        bp->cmds = AllocCmdList( TxtBuff, end - TxtBuff );
    }
    bp->status.b.use_cmds = ( bp->cmds != NULL );
}
示例#14
0
static disp_optn GetOption( void )
{
    int         cmd;
    disp_optn   optn = OPEN;

    if( CurrToken == T_DIV ) {
        Scan();
        cmd = ScanCmd( DispOptions );
        if( cmd < 0 ) {
            Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_DISPLAY ) );
        } else {
            optn = (disp_optn)cmd;
        }
    }
    return( optn );
}
示例#15
0
unsigned Go( bool do_flip )
{
    char        *p;
    unsigned    conditions;

    p = StrCopy( GetCmdName( CMD_GO ), TxtBuff );
    if( UserTmpBrk.status.b.active ) {
        p = Format( p, " %A", UserTmpBrk.loc.addr );
        RecordEvent( TxtBuff );
    } else {
        RecordGo( TxtBuff );
    }
    conditions = Execute( false, do_flip );
    CheckEventRecorded();
    return( conditions );
}
示例#16
0
static void PrintDialogColours( void )
{
    int             i;
    gui_dlg_attr    dlgattr;
    char            fore[20];
    char            back[20];
    char            attr[30];

    GUIGetDialogColours( WndDlgColours );
    for( i = 0; i < ArraySize( DlgAttrMap ); ++i ) {
        dlgattr = DlgAttrMap[i].attr;
        GetAttrName( DlgAttrMap, i, attr );
        GetColourName( WndDlgColours[dlgattr].fore, fore );
        GetColourName( WndDlgColours[dlgattr].back, back );
        Format( TxtBuff, "%s dialog %s %s on %s", GetCmdName( CMD_PAINT ), attr, fore, back );
        WndDlgTxt( TxtBuff );
    }
}
示例#17
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 );
}
示例#18
0
void ChangeMemUndoable( address addr, const void *data, size_t size )
{
    char                *p;
    char                *end;

    if( AdvMachState( ACTION_MODIFY_MEMORY ) ) {
        ChangeMem( addr, data, size );
        end = TxtBuff + TXT_LEN;
        p = Format( TxtBuff, "%s %A", GetCmdName( CMD_MODIFY ), addr );
        for( ; size > 0 && p < end - ( 2 + 8 ); --size ) {
            p = StrCopy( ", ", p );
            p = CnvULong( *(unsigned char *)data, p, end - p );
            data = (char *)data + 1;
        }
        RecordEvent( TxtBuff );
        DbgUpdate( UP_MEM_CHANGE );
        CollapseMachState();
    }
}
示例#19
0
void ChangeMemUndoable( address addr, const void *item, unsigned size )
{
    char                *p;
    const unsigned char *it;
    char                *end;

    if( AdvMachState( ACTION_MODIFY_MEMORY ) ) {
        ChangeMem( addr, item, size );
        it = item;
        end = TxtBuff + TXT_LEN;
        p = Format( TxtBuff, "%s %A", GetCmdName( CMD_MODIFY ), addr );
        for( ; size > 0; --size ) {
            p = StrCopy( ", ", p );
            p = CnvULong( *it++, p, end - p );
        }
        RecordEvent( TxtBuff );
        DbgUpdate( UP_MEM_CHANGE );
        CollapseMachState();
    }
}
示例#20
0
static void PrintColours( wnd_class wndcls, gui_colour_set *set, gui_colour_set *def )
{
    char        wndname[20];
    char        attr[30];
    char        fore[20];
    char        back[20];
    int         i;
    wnd_class   wndcls1;

    GetCmdEntry( WndNameTab, wndcls, wndname );
    for( i = 0; i < ArraySize( AttrMap ); ++i ) {
        wndcls1 = AttrMap[i].attr;
        if( def == NULL || memcmp( &set[wndcls1], &def[wndcls1], sizeof( *set ) ) != 0 ) {
            GetAttrName( AttrMap, i, attr );
            GetColourName( set[wndcls1].fore, fore );
            GetColourName( set[wndcls1].back, back );
            Format( TxtBuff, "%s %s %s %s on %s", GetCmdName( CMD_PAINT ), wndname, attr, fore, back );
            WndDlgTxt( TxtBuff );
        }
    }
}
示例#21
0
void ProcModify( void )
{
    const char          *startpos;
    mad_type_handle     mth;
    mad_type_kind       tk;

    if( !AdvMachState( ACTION_MODIFY_MEMORY ) ) {
        FlushEOC();
        return;
    }
    startpos = ScanPos();
    if( CurrToken != T_DIV ) {
        MemMod( GetMADTypeHandleDefaultAt( NilAddr, MTK_BASIC ), MAS_MEMORY );
    } else {
        Scan();
        mth = ScanType( MAS_ALL | MTK_ALL, &tk );
        if( mth == MAD_NIL_TYPE_HANDLE ) {
            Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_MODIFY ) );
        }
        MemMod( mth, tk );
    }
    RecordCommand( startpos, CMD_MODIFY );
}
示例#22
0
static void oops( void )
{
    Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_SET ) );
}
示例#23
0
void ProcGo( void )
{
    address     start;
    address     stop;
    bool        have_start;
    bool        have_stop;
    bool        have_keep;
    bool        doflip;
    bool        flip_on;
    bool        until;
    unsigned    conditions;
    int         count;

    have_keep = FALSE;
    doflip = TRUE;
    until = FALSE;
    while( CurrToken == T_DIV ) {
        Scan();
        switch( ScanCmd( GoOptionTab ) ) {
        case KEEP:
            have_keep = TRUE;
            break;
        case NOFLIP:
            doflip = FALSE;
            break;
        case UNTIL:
            until = TRUE;
            break;
        default:
            Error( ERR_LOC, LIT( ERR_BAD_OPTION ), GetCmdName( CMD_GO ) );
        }
    }
    if( !have_keep ) TraceKill();
    NullStatus( &DbgTmpBrk );
    start = GetRegIP();
    have_stop = FALSE;
    have_start = FALSE;
    if( !ScanEOC() ) {
        stop = start;
        ReqMemAddr( EXPR_GIVEN, &stop );
        if( CurrToken == T_COMMA ) {
            start = stop;
            have_start = TRUE;
            Scan();
            if( !ScanEOC() ) {
                ReqMemAddr( EXPR_GIVEN, &stop );
                have_stop = TRUE;
            }
        } else {
            have_stop = TRUE;
        }
    }
    ReqEOC();
    count = 0;
    do {
        if( have_stop ) {
            if( have_keep ) {
                if( UserTmpBrk.status.b.has_address ) {
                    NullStatus( &UserTmpBrk );
                    UserTmpBrk.status.b.has_address = TRUE;
                } else {
                    NullStatus( &UserTmpBrk );
                }
                Error( ERR_NONE, LIT( ERR_INCONSISTENT_GO ) );
            }
            SetTempBreak( stop );
        } else if( have_keep ) {
            if( UserTmpBrk.status.b.has_address ) {
                UserTmpBrk.status.b.active = TRUE;
            }
        } else {
            NullStatus( &UserTmpBrk );
        }
        if( have_start ) {
            RecordSetRegIP( start );
        }
        flip_on = _IsOn( SW_FLIP );
        if( !doflip ) {
            _SwitchOff( SW_FLIP );
        }
        conditions = Go( doflip );
        if( flip_on ) _SwitchOn( SW_FLIP );
        if( UserTmpBrk.status.b.has_address ) {
            NullStatus( &UserTmpBrk );
            UserTmpBrk.status.b.has_address = TRUE;
        } else {
            NullStatus( &UserTmpBrk );
        }
    } while( until && (conditions & COND_BREAK) && AddrComp( stop, GetRegIP() ) != 0 && ++count < 100 );
}
示例#24
0
static void WndBadCmd( a_window *wnd )
{
    wnd=wnd;
    Error( ERR_LOC, LIT_ENG( ERR_BAD_SUBCOMMAND ), GetCmdName( CMD_WINDOW ) );
}
示例#25
0
void ConfigDisp( void )
{

    a_window        *wnd, *scan;
    char            buff[20];
    char            buff2[20];
    a_window        *head, *next;
    int             h;
    wnd_class_wv    wndclass;
    gui_rect        rect;

    ReqEOC();
    GetCmdEntry( WndNameTab, WND_ALL, buff );
    GetCmdEntry( DispOptions, CLOSE, buff2 );
    Format( TxtBuff, "%s %s /%s", GetCmdName( CMD_DISPLAY ), buff, buff2 );
    WndDlgTxt( TxtBuff );
    if( WndHaveStatusWindow() ) {
        GetCmdEntry( MiscTab, MISC_STATUS, buff );
        Format( TxtBuff, "%s %s", GetCmdName( CMD_DISPLAY ), buff );
        WndDlgTxt( TxtBuff );
    }
    if( WndHaveToolBar() ) {
        h = WndToolHeight();
        GetCmdEntry( MiscTab, MISC_TOOL, buff );
        GetCmdEntry( DispOptions, WndToolFixed() ? FIXED : FLOATING, buff2 );
        Format( TxtBuff, "%s %s /%s %d", GetCmdName( CMD_DISPLAY ),
                buff, buff2, h );
        WndDlgTxt( TxtBuff );
    }
    for( wndclass = 0; wndclass < WND_NUM_CLASSES; ++wndclass ) {
        if( wndclass == WND_ALL )
            continue;
        if( WndFindClass( NULL, wndclass ) != NULL )
            continue;
        WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
        if( rect.width == 0 )
            continue;
        if( rect.height == 0 )
            continue;
        PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
    }
    head = WndNext( NULL );
    if( head == NULL )
        return;
    // traverse in reverse order so that windows get created in correct order
    for( wnd = head; (next = WndNext( wnd )) != NULL; wnd = next )
        ;
    for( ;; ) {
        if( WndHasClass( wnd ) ) {
            wndclass = WndClass( wnd );
            switch( wndclass ) {
            case WND_ALL:
                break;
            case WND_BINARY:
            case WND_FILE:
            case WND_MEMORY:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
                break;
            case WND_VARIABLE:
            case WND_TMPFILE:
                break;
            default:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( OPEN, wndclass, &rect, buff, buff2 );
                break;
            }
        }
        if( wnd == head )
            break;
        for( scan = head; (next = WndNext( scan )) != wnd; scan = next )
            ;
        wnd = scan;
    }
}
示例#26
0
static void BadSet( void )
{
    Error( ERR_LOC, LIT_ENG( ERR_BAD_SUBCOMMAND ), GetCmdName( CMD_SET ) );
}
示例#27
0
OVL_EXTERN void BadLog( void )
{
    Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_LOG ) );
}
示例#28
0
static void ProcSize( wnd_class_wv wndclass )
{
    gui_rect    size;
    disp_optn   optn;
    a_window    *wnd;
    a_window    *next;
    gui_coord   min;
    bool        coord_specified;
    gui_rect    def_rect;

    optn = GetOption();
    if( optn == FLOATING || optn == FIXED ) {
        Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_DISPLAY ) );
    }
    size.x = OptExpr( -1 );
    size.y = -1;
    size.width = -1;
    size.height = -1;
    if( CurrToken == T_COMMA ) {
        Scan();
        size.y = OptExpr( -1 );
        if( CurrToken == T_COMMA ) {
            Scan();
            size.width = OptExpr( -1 );
            if( CurrToken == T_COMMA ) {
                Scan();
                size.height = OptExpr( -1 );
            }
        }
    }
    ReqEOC();

    GUIGetMinSize( &min );
    if( size.x != -1 || size.y != -1 || size.width != -1 || size.height != -1 ) {
        coord_specified = true;
    } else {
        coord_specified = false;
    }
    WndPosToRect( &WndPosition[wndclass], &def_rect, &WndScreen );
    size.x = range( size.x, 0, WndScreen.x, def_rect.x );
    size.y = range( size.y, 0, WndScreen.y, def_rect.y );
    if( size.x + size.width > WndScreen.x ) size.width = WndScreen.x - size.x;
    if( size.y + size.height > WndScreen.y ) size.height = WndScreen.y - size.y;
    size.width = range( size.width, min.x, WndScreen.x, def_rect.width );
    size.height = range( size.height, min.y, WndScreen.y, def_rect.height );
    if( coord_specified ) {
        WndRectToPos( &size, &WndPosition[wndclass], &WndScreen );
    }
    if( wndclass == WND_CURRENT ) {
        wnd = WndFindActive();
    } else {
        wnd = WndFindClass( NULL, wndclass );
    }
    switch( optn ) {
    case OPEN:
    case NEW:
        if( optn == NEW || wnd == NULL ) {
            WndOpenTab[wndclass]();
        } else {
            WndRestoreToFront( wnd );
            WndPosToRect( &WndPosition[wndclass], &size, WndMainClientSize() );
            WndResizeWindow( wnd, &size );
        }
        break;
    case CLOSE:
        if( wndclass == WND_ALL ) {
            for( wnd = WndNext( NULL ); wnd != NULL; wnd = next ) {
                next = WndNext( wnd );
                if( WndHasClass( wnd ) ) WndClose( wnd );
            }
        } else {
            if( wnd != NULL ) {
                WndClose( wnd );
            }
        }
        break;
    case MINIMIZE:
        if( wnd == NULL )
            wnd = WndOpenTab[wndclass]();
        WndMinimizeWindow( wnd );
        break;
    case MAXIMIZE:
        if( wnd == NULL )
            wnd = WndOpenTab[wndclass]();
        WndMaximizeWindow( wnd );
        break;
    case RESTORE:
        if( wnd == NULL )
            wnd = WndOpenTab[wndclass]();
        WndRestoreWindow( wnd );
        break;
    }
}
示例#29
0
void ConfigSet( void )
{
    DoConfig( GetCmdName( CMD_SET ), SetNameTab, SetConfJmpTab, SetNotAllTab );
}
示例#30
0
void RecordSetRegIP( address addr )
{
    Format( TxtBuff, "%s %A", GetCmdName( CMD_SKIP ), addr );
    RecordEvent( TxtBuff );
    SetRegIP( addr );
}