Пример #1
0
void MemWatcher::Update()
{
	for (int i = 0; i < m_watches.size(); i++)
	{
		Watch& watch = m_watches[i];
		u32 value = 0;

		switch (watch.size)
		{
		case 1:
			value = MEM_getByte(watch.address);
			break;
		case 2:
			value = MEM_getWord(watch.address);
			break;
		case 4:
			value = MEM_getLong(watch.address);
			break;
		}

		if (value != watch.cache)
		{
			watch.cache = value;
			watch.callback(watch.address, watch.size, value);
		}
	}
}
Пример #2
0
u_int32_t DissasembleAddress(u_int32_t x,u_int32_t y,u_int32_t address,int cursor)
{
	u_int32_t	insCount;
	int32_t	a;
	u_int32_t b;
	int cMask1=0x0F,cMask2=0xFF;
	
	insCount=GetOpcodeLength(address);		// note this also does the dissasemble

	for (a=0;a<numBps;a++)
	{
		if (address == bpAddresses[a])
		{
			cMask1=0x0F;
			cMask2=0x00;
			break;
		}
	}

	if (cursor)
	{
	PrintAt(cMask1,cMask2,x,y,"%08X >",address);
	}
	else
	{
	PrintAt(cMask1,cMask2,x,y,"%08X ",address);
	}
	
	for (b=0;b<(insCount+2)/2;b++)
	{
		PrintAt(cMask1,cMask2,x+10+b*5,y,"%02X%02X ",MEM_getByte(address+b*2+0),MEM_getByte(address+b*2+1));
	}
			
	PrintAt(cMask1,cMask2,x+30,y,"%s",mnemonicData);
	
	return insCount+2;
}