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

Function GetFullPrefixAddrForBreakpoint

source/Debugger/Debug.cpp:2105–2183  ·  view source on GitHub ↗

=========================================================================== Called by: . CheckBreakpointsIO(), padding=false - to set g_sBreakMemoryFullPrefixAddr (used later for 'stop reason') . _BWZ_List(), padding=true - ie. 'bpl' . _CmdMemoryDump(), padding=false - ie. 'm1' to show current prefix for mini mem area

Source from the content-addressed store, hash-verified

2103// . _BWZ_List(), padding=true - ie. 'bpl'
2104// . _CmdMemoryDump(), padding=false - ie. 'm1' to show current prefix for mini mem area
2105static std::string GetFullPrefixAddrForBreakpoint(const AddressPrefix_t& addrPrefix, WORD address, DEVICE_e device, bool padding)
2106{
2107 char sSlot [] = "sN/"; // Saturn slot
2108 char sLangCard[] = "lN/"; // Language Card 4K bank
2109 int prefixPad = 1; // whitespace padding
2110 std::string prefix = CHC_INFO; // "sN/bbb/lN/" (10 chars) or "ROM/"
2111
2112 if (addrPrefix.nSlot != AddressPrefix_t::kSlotInvalid)
2113 {
2114 sSlot[1] = addrPrefix.nSlot + '0';
2115 prefix += sSlot;
2116 }
2117 else
2118 {
2119 prefixPad += 3;
2120 }
2121
2122 if (addrPrefix.nBank != AddressPrefix_t::kBankInvalid)
2123 {
2124 if (addrPrefix.nBank < 0x100)
2125 {
2126 prefix += StrFormat("%02X", addrPrefix.nBank);
2127 }
2128 else
2129 {
2130 prefix += StrFormat("%03X", addrPrefix.nBank);
2131 prefixPad--;
2132 }
2133 prefix += '/';
2134 }
2135 else
2136 {
2137 prefixPad += 3;
2138 }
2139
2140 if (addrPrefix.nLangCard != AddressPrefix_t::kLangCardInvalid)
2141 {
2142 sLangCard[1] = addrPrefix.nLangCard + '0';
2143 prefix += sLangCard;
2144 }
2145 else
2146 {
2147 prefixPad += 3;
2148 }
2149
2150 if (addrPrefix.bIsROM)
2151 {
2152 prefix += "ROM/";
2153 prefixPad = 6; // 10 chars in total
2154 }
2155
2156 std::string prefixFinal;
2157
2158 if (padding)
2159 {
2160 while (prefixPad--)
2161 prefixFinal += " ";
2162 }

Callers 3

CheckBreakpointsIOFunction · 0.85
_BWZ_ListFunction · 0.85
_CmdMemoryDumpFunction · 0.85

Calls 1

StrFormatFunction · 0.85

Tested by

no test coverage detected