void MADIMPENTRY( RegUpdateEnd )( mad_registers *mr, unsigned flags, unsigned bit_start, unsigned bit_size ) { unsigned i; unsigned bit_end; mr = mr; flags = flags; memset( &mr->axp.u31, 0, sizeof( mr->axp.u31 ) ); memset( &mr->axp.f31, 0, sizeof( mr->axp.f31 ) ); bit_end = bit_start + bit_size; #define IN_RANGE( i, bit ) \ ((bit) >= RegList[i].info.bit_start && (bit) < (unsigned)( RegList[i].info.bit_start + RegList[i].info.bit_size )) for( i = 0; i < IDX_LAST_ONE; ++i ) { if( (IN_RANGE(i, bit_start) || IN_RANGE( i, bit_end )) && (RegList[i].pal == PAL_all || RegList[i].pal == mr->axp.active_pal) ) { MCNotify( MNT_MODIFY_REG, (void *)&RegSet[RegList[i].reg_set] ); break; } } switch( bit_start ) { case BIT_OFF( pal.nt.fir ): MCNotify( MNT_MODIFY_IP, NULL ); break; case BIT_OFF( u30 ): // sp MCNotify( MNT_MODIFY_SP, NULL ); break; case BIT_OFF( u15 ): // fp MCNotify( MNT_MODIFY_FP, NULL ); break; } }
void MADIMPENTRY( RegUpdateEnd )( mad_registers *mr, unsigned flags, unsigned bit_start, unsigned bit_size ) { unsigned i; unsigned bit_end; mr = mr; flags = flags; bit_end = bit_start + bit_size; #define IN_RANGE( i, bit ) \ ((bit) >= RegList[i].info.bit_start && (bit) < (unsigned)( RegList[i].info.bit_start + RegList[i].info.bit_size )) for( i = 0; i < IDX_LAST_ONE; ++i ) { if( IN_RANGE( i, bit_start ) || IN_RANGE( i, bit_end ) ) { MCNotify( MNT_MODIFY_REG, (void *)&RegSet[RegList[i].reg_set] ); break; } } switch( bit_start ) { case BIT_OFF( iar ): MCNotify( MNT_MODIFY_IP, NULL ); break; case BIT_OFF( u1 ): // sp MCNotify( MNT_MODIFY_SP, NULL ); break; case BIT_OFF( r31 ): // fp NYI: can float MCNotify( MNT_MODIFY_FP, NULL ); break; } }
static walk_result TouchesScreenBuff( address a, mad_type_handle th, mad_memref_kind mk, void *d ) { const mad_registers *mr = d; th = th; if( mk & MMK_IMPLICIT ) return( WR_CONTINUE ); switch( MCSystemConfig()->os ) { case OS_DOS: if( a.mach.segment < 0xa000 || a.mach.segment >= 0xc000 ) return( WR_CONTINUE ); break; case OS_RATIONAL: if( a.mach.segment != mr->x86.cpu.cs && a.mach.segment != mr->x86.cpu.ds ) return( WR_CONTINUE ); if( a.mach.offset < 0xa0000UL || a.mach.offset >= 0xc0000UL ) return( WR_CONTINUE ); break; case OS_AUTOCAD: case OS_PHARLAP: case OS_ECLIPSE: if( a.mach.segment == mr->x86.cpu.cs || a.mach.segment == mr->x86.cpu.ds ) return( WR_CONTINUE ); break; } MCNotify( MNT_EXECUTE_TOUCH_SCREEN_BUFF, NULL ); return( WR_STOP ); }
/* The client has just finished modifying a register (or registers). The MAD should take this chance to notify the client on what displays need to be updated. MCNotify should be called for the following MNT_MODIFY_REG - to notify client which register set has changed (2d parm is register set pointer). MNT_MODIFY_IP - instruction pointer special reg has changed. MNT_MODIFY_SP - stack pointer special reg has changed. MNT_MODIFY_FP - frame pointer special reg has changed. */ void DIGENTRY MIRegUpdateEnd( mad_registers *mr, unsigned flags, unsigned bit_start, unsigned bit_size ) { unsigned bit_end; bit_end = bit_start + bit_size; MCNotify( MNT_MODIFY_REG, (void *)&RegSet[CPU_REG_SET] ); switch( bit_start ) { case BIT_OFF( pc ): MCNotify( MNT_MODIFY_IP, NULL ); break; case BIT_OFF( optop ): MCNotify( MNT_MODIFY_SP, NULL ); break; case BIT_OFF( frame ): MCNotify( MNT_MODIFY_FP, NULL ); break; } }
mad_trace_how DIGENTRY MITraceOne( mad_trace_data *td, mad_disasm_data *dd, mad_trace_kind tk, const mad_registers *mr, address *brk ) { mad_trace_how th; th = DoTraceOne( td, dd, tk, mr ); th = CheckSpecial( td, dd, mr, th ); switch( MCSystemConfig()->os ) { case OS_OS2: case OS_NW386: case OS_QNX: case OS_WINDOWS: case OS_NT: break; default: DoDisasmMemRefWalk( dd, TouchesScreenBuff, mr, (void *)mr ); break; } td->prev_ins_type = dd->ins.type; td->prev_ins_flags.u.x86 = dd->ins.flags.u.x86; switch( th ) { case MTRH_BREAK: switch( td->prev_ins_type ) { case DI_X86_call: case DI_X86_call2: case DI_X86_call3: case DI_X86_call4: case DI_X86_int: case DI_X86_into: MCNotify( MNT_EXECUTE_LONG, NULL ); break; default: break; } /* fall through */ case MTRH_STEPBREAK: *brk = td->brk; break; } return( th ); }
unsigned MADIMPENTRY( RegSetDisplayToggle )( const mad_reg_set_data *rsd, unsigned on, unsigned off ) { unsigned toggle; unsigned *bits; unsigned index; unsigned old; toggle = on & off; index = (unsigned)( rsd - &RegSet[CPU_REG_SET] ); bits = &MADState->reg_state[index]; old = *bits; *bits ^= toggle; *bits |= on & ~toggle; *bits &= ~off | toggle; if( index == CPU_REG_SET && ((old ^ *bits) & CT_SYMBOLIC_NAMES) ) { /* We've changed from numeric regs to symbolic or vis-versa. Have to force a redraw of the disassembly window. */ MCNotify( MNT_REDRAW_DISASM, NULL ); } return( *bits ); }
void MCStatus( mad_status ms ) { MCNotify( MNT_ERROR, &ms ); }