extern void WndVarInspect( const char *buff ) { a_window *wnd; wnd = WndClassInspect( WND_WATCH ); if( wnd != NULL ) { WndVarAdd( wnd, buff, strlen( buff ), false ); WndScrollBottom( wnd ); } }
static void BrkMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { brkp *bp; piece=piece; if( row < 0 ) { bp = NULL; } else { bp = BrkGetBP( row ); } switch( id ) { case MENU_INITIALIZE: if( bp != NULL ) { WndMenuEnableAll( wnd ); WndMenuEnable( wnd, MENU_BREAK_ENABLE, !bp->status.b.active ); WndMenuEnable( wnd, MENU_BREAK_DISABLE, bp->status.b.active ); WndMenuEnable( wnd, MENU_BREAK_SOURCE, bp != NULL && IS_BP_EXECUTE( bp->th ) ); WndMenuEnable( wnd, MENU_BREAK_ASSEMBLY, bp != NULL && IS_BP_EXECUTE( bp->th ) ); } else { WndMenuGrayAll( wnd ); } WndMenuEnable( wnd, MENU_BREAK_CREATE_NEW, true ); break; case MENU_BREAK_ENABLE: ActPoint( bp, true ); break; case MENU_BREAK_DISABLE: ActPoint( bp, false ); break; case MENU_BREAK_CREATE_NEW: if( DlgBreak( NilAddr ) ) WndScrollBottom( wnd ); break; case MENU_BREAK_CLEAR: RemoveBreak( bp->loc.addr ); break; case MENU_BREAK_MODIFY: DlgBreak( bp->loc.addr ); break; case MENU_BREAK_SOURCE: WndSrcInspect( bp->loc.addr ); break; case MENU_BREAK_ASSEMBLY: WndAsmInspect( bp->loc.addr ); break; } }
OVL_EXTERN void IOMenuItem( a_window wnd, gui_ctl_id id, wnd_row row, wnd_piece piece ) { io_window *io = WndIO( wnd ); address addr; bool ok; item_mach item; io_location *curr; mad_radix old_radix; /* unused parameters */ (void)piece; if( row < io->num_rows && row >= 0 ) { curr = &io->list[row]; } else { curr = NULL; } switch( id ) { case MENU_INITIALIZE: if( curr == NULL ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); } WndMenuEnable( wnd, MENU_IO_NEW_ADDRESS, true ); break; case MENU_IO_DELETE: io->num_rows--; memcpy( &io->list[row], &io->list[row + 1], ( io->num_rows - row ) * sizeof( io_location ) ); WndNoSelect( wnd ); WndSetRepaint( wnd ); break; case MENU_IO_NEW_ADDRESS: addr = NilAddr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; WndRowDirty( wnd, io->num_rows ); IOAddNewAddr( wnd, &addr, MENU_IO_FIRST_TYPE ); WndScrollBottom( wnd ); break; case MENU_IO_MODIFY: if( row >= io->num_rows || row < 0 ) break; if( piece == PIECE_VALUE ) { old_radix = NewCurrRadix( IOData.info[curr->type].piece_radix ); item.ud = curr->value_known ? curr->value.ud : 0; ok = DlgMadTypeExpr( TxtBuff, &item, IOData.info[curr->type].mth ); if( ok ) { curr->value = item; curr->value_known = true; } NewCurrRadix( old_radix ); } else { addr = curr->addr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; curr->addr = addr; curr->value_known = false; } WndRowDirty( wnd, row ); break; case MENU_IO_READ: curr->value_known = true; if( ItemGetMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ) == IT_NIL ) { curr->value_known = false; } WndPieceDirty( wnd, row, PIECE_VALUE ); break; case MENU_IO_WRITE: if( curr->value_known ) { ItemPutMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ); } break; default: curr->type = PIECE_TYPE( id ); WndZapped( wnd ); break; } }