MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / DrawFlags

Function DrawFlags

source/Debugger/Debugger_Display.cpp:1910–1996  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

1908
1909//===========================================================================
1910static void DrawFlags ( int line, BYTE nRegFlags )
1911{
1912 if (! ((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
1913 return;
1914
1915 RECT rect;
1916
1917 int nFontWidth = g_aFontConfig[ FONT_INFO ]._nFontWidthAvg;
1918
1919 // Regs are 10 chars across
1920 // Flags are 8 chars across -- scale "up"
1921 int nSpacerWidth = nFontWidth;
1922
1923#if OLD_FLAGS_SPACING
1924 const int nScaledWidth = 10;
1925 if (nFontWidth)
1926 nSpacerWidth = (nScaledWidth * nFontWidth) / 8;
1927 nSpacerWidth++;
1928#endif
1929
1930 //
1931
1932 GetDebuggerMemDC();
1933
1934 rect.top = line * g_nFontHeight;
1935 rect.bottom = rect.top + g_nFontHeight;
1936 rect.left = DISPLAY_FLAG_COLUMN;
1937 rect.right = rect.left + (10 * nFontWidth);
1938
1939 DebuggerSetColorBG( DebuggerGetColor( BG_DATA_1 )); // BG_INFO
1940 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_REG ));
1941 PrintText( "P ", rect );
1942
1943 rect.top += g_nFontHeight;
1944 rect.bottom += g_nFontHeight;
1945
1946 DebuggerSetColorBG( DebuggerGetColor( BG_INFO ));
1947 DebuggerSetColorFG( DebuggerGetColor( FG_INFO_OPCODE ));
1948 PrintText( ByteToHexStr( nRegFlags ).c_str(), rect);
1949
1950 rect.top -= g_nFontHeight;
1951 rect.bottom -= g_nFontHeight;
1952
1953 rect.left += ((2 + _6502_NUM_FLAGS) * nSpacerWidth);
1954 rect.right = rect.left + nFontWidth;
1955
1956 //
1957
1958 int iFlag = 0;
1959 int nFlag = _6502_NUM_FLAGS;
1960 while (nFlag--)
1961 {
1962 iFlag = (_6502_NUM_FLAGS - nFlag - 1);
1963
1964 bool bSet = (nRegFlags & 1);
1965
1966
1967 if (bSet)

Callers 1

DrawRegistersFunction · 0.85

Calls 6

GetDebuggerMemDCFunction · 0.85
DebuggerSetColorBGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorFGFunction · 0.85
PrintTextFunction · 0.85
ByteToHexStrFunction · 0.85

Tested by

no test coverage detected