Пример #1
0
void CtrlMemView::onMouseDown(WPARAM wParam, LPARAM lParam, int button)
{	
	int x = LOWORD(lParam); 
	int y = HIWORD(lParam);

	gotoPoint(x,y);
}
Пример #2
0
void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
{
	if (button==2)
	{
		//popup menu?
		POINT pt;
		GetCursorPos(&pt);
		switch (TrackPopupMenuEx(GetSubMenu(g_hPopupMenus,0),TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0))
		{
		case ID_MEMVIEW_DUMP:
     
			if (!Core_IsStepping()) // If emulator isn't paused
			{
				MessageBox(wnd,L"You have to pause the emulator first",0,0);
				break;
			}
			else
			{
				DumpMemoryWindow dump(wnd,debugger);
				dump.exec();
				break;
			}

		case ID_MEMVIEW_COPYVALUE:
			{
				char temp[24];

				// it's admittedly not really useful like this
				if (asciiSelected)
				{
					unsigned char c = Memory::IsValidAddress(curAddress) ? Memory::ReadUnchecked_U8(curAddress) : '.';
					if (c < 32|| c >= 128) c = '.';
					sprintf(temp,"%c",c);
				} else {
					sprintf(temp,"%02X",Memory::IsValidAddress(curAddress) ? Memory::ReadUnchecked_U8(curAddress) : 0xFF);
				}
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;

		case ID_MEMVIEW_COPYADDRESS:
			{
				char temp[24];
				sprintf(temp,"0x%08X",curAddress);
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;
		}
		return;
	}

	int x = LOWORD(lParam); 
	int y = HIWORD(lParam);
	ReleaseCapture();
	gotoPoint(x,y);
}
Пример #3
0
void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
{
	if (button==2)
	{
		//popup menu?
		POINT pt;
		GetCursorPos(&pt);
		FILE* outputfile;
		switch (TrackPopupMenuEx(GetSubMenu(g_hPopupMenus,0),TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0))
		{
		case ID_MEMVIEW_DUMP:
     
			if (!Core_IsStepping()) // If emulator isn't paused
			{
				MessageBox(wnd,"You have to pause the emulator first","Sorry",0);
				break;
			}
			else
			{
				outputfile = fopen("Ram.dump","wb");		// Could also dump Vram, but not useful for now.
				fwrite(Memory::GetPointer(0x08800000), 1, 0x1800000, outputfile); 
				fclose(outputfile);
				break;
			}

		case ID_MEMVIEW_COPYVALUE:
			{
				char temp[24];

				// it's admittedly not really useful like this
				if (asciiSelected)
				{
					unsigned char c = Memory::IsValidAddress(curAddress) ? Memory::ReadUnchecked_U8(curAddress) : '.';
					if (c < 32 || c >= 128) c = '.';
					sprintf(temp,"%c",c);
				} else {
					sprintf(temp,"%02X",Memory::IsValidAddress(curAddress) ? Memory::ReadUnchecked_U8(curAddress) : 0xFF);
				}
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;
		}
		return;
	}

	int x = LOWORD(lParam); 
	int y = HIWORD(lParam);
	ReleaseCapture();
	gotoPoint(x,y);
}
Пример #4
0
void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
{
	if (button==2)
	{
		//popup menu?
		POINT pt;
		GetCursorPos(&pt);

		bool enable16 = !asciiSelected && (curAddress % 2) == 0;
		bool enable32 = !asciiSelected && (curAddress % 4) == 0;

		HMENU menu = GetSubMenu(g_hPopupMenus,0);
		EnableMenuItem(menu,ID_MEMVIEW_COPYVALUE_16,enable16 ? MF_ENABLED : MF_GRAYED);
		EnableMenuItem(menu,ID_MEMVIEW_COPYVALUE_32,enable32 ? MF_ENABLED : MF_GRAYED);

		switch (TrackPopupMenuEx(menu,TPM_RIGHTBUTTON|TPM_RETURNCMD,pt.x,pt.y,wnd,0))
		{
		case ID_MEMVIEW_DUMP:
			{
				DumpMemoryWindow dump(wnd, debugger);
				dump.exec();
				break;
			}
			
		case ID_MEMVIEW_COPYVALUE_8:
			{
				char temp[24];

				// it's admittedly not really useful like this
				if (asciiSelected)
				{
					unsigned char c = Memory::IsValidAddress(curAddress) ? Memory::Read_U8(curAddress) : '.';
					if (c < 32|| c >= 128) c = '.';
					sprintf(temp,"%c",c);
				} else {
					sprintf(temp,"%02X",Memory::IsValidAddress(curAddress) ? Memory::Read_U8(curAddress) : 0xFF);
				}
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;
			
		case ID_MEMVIEW_COPYVALUE_16:
			{
				char temp[24];

				sprintf(temp,"%04X",Memory::IsValidAddress(curAddress) ? Memory::Read_U16(curAddress) : 0xFFFF);
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;
			
		case ID_MEMVIEW_COPYVALUE_32:
			{
				char temp[24];

				sprintf(temp,"%08X",Memory::IsValidAddress(curAddress) ? Memory::Read_U32(curAddress) : 0xFFFFFFFF);
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;

		case ID_MEMVIEW_COPYADDRESS:
			{
				char temp[24];
				sprintf(temp,"0x%08X",curAddress);
				W32Util::CopyTextToClipboard(wnd,temp);
			}
			break;
		}
		return;
	}

	int x = LOWORD(lParam); 
	int y = HIWORD(lParam);
	ReleaseCapture();
	gotoPoint(x,y);
}
Пример #5
0
//Same as above but for cylindrical polar coodrinates
void meArm::gotoPointCylinder(float theta, float r, float z){
    float x, y;
    polarToCartesian(theta, r, x, y);
    gotoPoint(x,y,z);
}
Пример #6
0
void printPoint(Point* pos, char ch)
{
	gotoPoint(pos);
	_putch(ch);
}