static void ModSetCurrent( a_window *wnd ) { int i; mod_window *mod = WndMod( wnd ); wnd_row row; int piece; WndGetCurrent( wnd, &row, &piece ); if( row != WND_NO_ROW && ModListMod( ModList( mod ), row ) == ContextMod ) { return; } for( i = 0; i < ModListNumRows( ModList( mod ) ); ++i ) { if( ModListMod( ModList( mod ), i ) == ContextMod ) { WndMoveCurrent( wnd, i, PIECE_MODULE ); } } }
static void GotoLine( a_window *wnd ) { long line; mad_radix old_radix; wnd_row curr_row; int curr_piece; old_radix = NewCurrRadix( 10 ); WndGetCurrent( wnd, &curr_row, &curr_piece ); if( curr_row < 0 || curr_row == WND_NO_ROW ) { line = WndTop( wnd ); } else { line = curr_row; } ++line; if( DlgLongExpr( LIT_DUI( New_Line ), &line ) ) { --line; WndDirtyCurr( wnd ); Centre( wnd, line ); WndNewCurrent( wnd, line, PIECE_SOURCE ); } NewCurrRadix( old_radix ); }
static void GotoLine( a_window *wnd ) { long line; unsigned old; wnd_row row; int piece; old = NewCurrRadix( 10 ); WndGetCurrent( wnd, &row, &piece ); if( row < 0 || row == WND_NO_ROW ) { line = WndTop( wnd ); } else { line = row; } ++line; if( DlgLongExpr( LIT( New_Line ), &line ) ) { --line; WndDirtyCurr( wnd ); Centre( wnd, line ); WndNewCurrent( wnd, line, PIECE_SOURCE ); } NewCurrRadix( old ); }
STATIC void sampFixDirtyCurr( a_window *wnd ) /*******************************************/ { sio_data *curr_sio; wp_srcfile *src_file; rtn_info *curr_rtn; int src_line; int row; int piece; curr_sio = WndExtra( wnd ); WndGetCurrent( wnd, &row, &piece ); if( row == WND_NO_ROW ) return; if( curr_sio->level_open == LEVEL_SAMPLE ) { if( !simageGetLine( wnd, row ) ) return; } else if( curr_sio->level_open == LEVEL_IMAGE ) { if( !smodGetLine( wnd, row ) ) return; } else if( curr_sio->level_open == LEVEL_MODULE ) { if( !sfileGetLine( wnd, row ) ) return; } else if( curr_sio->level_open == LEVEL_FILE ) { if( !srtnGetLine( wnd, row ) ) return; } else { if( curr_sio->level_open == LEVEL_ROUTINE ) { if( !ssrcGetLine( wnd, row ) ) return; } else { if( !sasmGetLine( wnd, row ) ) return; } src_line = row + 1; if( curr_sio->level_open == LEVEL_SOURCE ) { src_line = WPAsmFindSrcLine( curr_sio, src_line ); } curr_rtn = curr_sio->curr_rtn; findRtnFromRow( curr_sio, src_line ); if( curr_rtn != curr_sio->curr_rtn ) { WndRowDirty( wnd, LEVEL_ROUTINE-STATUS_ROW-1+WndTop(wnd) ); } src_file = curr_sio->src_file; if( src_file != NULL ) { src_file->samp_line = src_line; } } curr_sio->curr_proc_row = -WND_MAX_ROW; if( row != curr_sio->curr_display_row ) { curr_sio->curr_display_row = row; if( curr_sio->total_samples == 0 || localTicks == 0 ) { curr_sio->abs_count = 0; curr_sio->rel_count = 0; } else { curr_sio->abs_count = (dispCount*1000) / curr_sio->total_samples; curr_sio->rel_count = (dispCount*1000) / localTicks; } curr_sio->abs_on_screen = absGraphBar; curr_sio->rel_on_screen = relGraphBar; if( dispCount > 0 ) { if( curr_sio->rel_count == 0 ) { curr_sio->rel_count = 1; } if( curr_sio->abs_count == 0 ) { curr_sio->abs_count = 1; } } WndRowDirty( wnd, -2+WndTop(wnd) ); } }
static void FileTrack( a_window *wnd, cue_handle *ch ) { unsigned active, old_active; unsigned end_line; int slack; file_window *file = WndFile( wnd ); mod_handle mod; cue_fileid id; wnd_row curr_row; int curr_piece; if( ch == NULL ) { mod = NO_MOD; id = 0; } else { mod = CueMod( ch ); id = CueFileId( ch ); } if( file->viewhndl == NULL || file->mod != mod || file->file_id != id ) { if( file->viewhndl != NULL ) { FDoneSource( file->viewhndl ); } file->mod = mod; file->file_id = id; FileSetDotAddr( wnd, GetCodeDot() ); if( file->mod == NO_MOD ) { file->viewhndl = NULL; } else { file->viewhndl = OpenSrcFile( ch ); } FileSetTitle( wnd, mod ); SeekToTheEnd( file ); file->eof = UINT_MAX; WndZapped( wnd ); FilePosInit( wnd ); file->active = NOT_ACTIVE; FilePos( wnd, 0 ); DbgUpdate( UP_OPEN_CHANGE ); } active = ActiveLine(); if( active != file->active ) { FileSetDotAddr( wnd, GetCodeDot() ); WndGetCurrent( wnd, &curr_row, &curr_piece ); WndNoCurrent( wnd ); if( curr_row != WND_NO_ROW ) { WndRowDirty( wnd, curr_row ); } } old_active = file->active; file->active = NOT_ACTIVE; slack = WndRows( wnd ) / 4; if( slack > 2 ) slack = 2; end_line = WndTop( wnd ) + WndRows( wnd ) - 1; if( old_active == NOT_ACTIVE || active > end_line ) { WndZapped( wnd ); WndScroll( wnd, active - slack - WndTop( wnd ) ); } else if( active > end_line - slack ) { WndRowDirtyImmed( wnd, old_active ); WndScroll( wnd, WndRows( wnd ) - 2 * slack ); } else if( active < WndTop( wnd ) ) { WndRowDirtyImmed( wnd, old_active ); WndScroll( wnd, active - WndTop( wnd ) - slack ); } else { WndRowDirty( wnd, old_active ); } WndNewCurrent( wnd, active, PIECE_SOURCE ); WndRowDirty( wnd, active ); file->active = active; }