1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-01 22:41:32 +00:00

Keep map small.

This commit is contained in:
Thomas Harte 2023-09-07 11:09:33 -04:00
parent b7a27fbc6b
commit 2f5d710441
2 changed files with 13 additions and 4 deletions

View File

@ -546,8 +546,17 @@ struct Z80Disassembler {
disassembly.disassembly.internal_calls.insert(entry_point);
Accessor accessor(memory, address_mapper, entry_point);
auto &touched = disassembly.touched[entry_point];
touched = entry_point;
uint16_t *touched = nullptr;
auto lower_bound = disassembly.touched.lower_bound(entry_point);
if(lower_bound != disassembly.touched.begin()) {
--lower_bound;
if(lower_bound->second == entry_point) {
touched = &lower_bound->second;
}
} else {
touched = &disassembly.touched[entry_point];
*touched = entry_point;
}
while(!accessor.at_end()) {
Instruction instruction;
@ -562,7 +571,7 @@ struct Z80Disassembler {
disassembly.disassembly.instructions_by_address[instruction.address] = instruction;
// Apply all touches.
touched = accessor.address();
*touched = accessor.address();
// Update access tables.
int access_type =

View File

@ -115,7 +115,7 @@ static Analyser::Static::TargetList CartridgeTargetsFrom(
// be at play; disassemble to try to figure it out.
std::vector<uint8_t> first_8k;
first_8k.insert(first_8k.begin(), segment.data.begin(), segment.data.begin() + 8192);
Analyser::Static::Z80::Disassembly disassembly =
const Analyser::Static::Z80::Disassembly disassembly =
Analyser::Static::Z80::Disassemble(
first_8k,
Analyser::Static::Disassembler::OffsetMapper(start_address),