CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Windows/GEDebugger/CtrlDisplayListView.h
Views: 1401
#pragma once12#include <algorithm>3#include "Common/CommonWindows.h"4#include "GPU/Common/GPUDebugInterface.h"56class CtrlDisplayListView7{8HWND wnd;9RECT rect;10static LPCTSTR windowClass;11DisplayList list;1213HFONT font;14HFONT boldfont;15u32 windowStart;16u32 curAddress;17u32 selectRangeStart;18u32 selectRangeEnd;1920int visibleRows;21int rowHeight;22int instructionSize;23bool hasFocus;24bool validDisplayList;2526struct {27int addressStart;28int opcodeStart;29} pixelPositions;3031void toggleBreakpoint();32void PromptBreakpointCond();3334public:35CtrlDisplayListView(HWND _wnd);36~CtrlDisplayListView();37static void registerClass();38static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);39static CtrlDisplayListView * getFrom(HWND wnd);4041HWND GetHWND() {42return wnd;43}4445void onPaint(WPARAM wParam, LPARAM lParam);46void onKeyDown(WPARAM wParam, LPARAM lParam);47void onMouseDown(WPARAM wParam, LPARAM lParam, int button);48void onMouseUp(WPARAM wParam, LPARAM lParam, int button);49void onVScroll(WPARAM wParam, LPARAM lParam);5051void redraw();52void setDisplayList(DisplayList& displayList)53{54validDisplayList = true;55list = displayList;56gotoAddr(list.pc);57}58void clearDisplayList()59{60validDisplayList = false;61}6263void scrollWindow(int lines)64{65windowStart += lines*instructionSize;66redraw();67}6869void gotoAddr(unsigned int addr)70{71u32 windowEnd = windowStart+visibleRows*instructionSize;72u32 newAddress = addr&(~(instructionSize-1));7374if (newAddress < windowStart || newAddress >= windowEnd)75{76windowStart = newAddress-visibleRows/2*instructionSize;77}7879setCurAddress(newAddress);80redraw();81}8283void setCurAddress(u32 newAddress, bool extend = false)84{85u32 after = newAddress + instructionSize;86curAddress = newAddress;87selectRangeStart = extend ? std::min(selectRangeStart, newAddress) : newAddress;88selectRangeEnd = extend ? std::max(selectRangeEnd, after) : after;89}9091void scrollAddressIntoView();92bool curAddressIsVisible();93};949596