mirror of
https://github.com/fadden/6502bench.git
synced 2026-04-26 12:18:26 +00:00
ORG rework, part 7
Implemented "is relative" flag. This only affects source code generation, replacing ".arstart <addr>" with ".arstart *+<value>". Only output by 64tass and ACME generators. Added a bold-text summary to radio buttons in address region edit dialog. This makes it much easier to see what you're doing. Added a warning to the label edit dialog when a label is being placed in a non-addressable region. Modified double-click behavior for .arstart/.arend to jump to the other end when the opcode is clicked on. This matches the behavior of instructions with address operands. Reordered Actions menu, putting "edit operand" at the top. Fixed AddressMap entry collision testing. Fixed PRG issue with multiple address regions at offset +000002. Added regression tests. Most of the complicated stuff with regions is tested by unit tests inside AddressMap, but we still need to exercise nested region code generation.
This commit is contained in:
+17
-10
@@ -1532,7 +1532,9 @@ namespace SourceGen {
|
||||
break;
|
||||
case LineListGen.Line.Type.ArStartDirective:
|
||||
case LineListGen.Line.Type.ArEndDirective:
|
||||
if (CanEditAddress()) {
|
||||
if ((CodeListColumn)col == CodeListColumn.Opcode) {
|
||||
JumpToOperandTarget(line, false);
|
||||
} else if (CanEditAddress()) {
|
||||
EditAddress();
|
||||
}
|
||||
break;
|
||||
@@ -1807,9 +1809,10 @@ namespace SourceGen {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If multiple lines with code/data are selected, there must not be an address change
|
||||
// If multiple lines with code/data are selected, there must not be a .arstart
|
||||
// between them unless we're resizing a region. Determining whether or not a resize
|
||||
// is valid is left to the edit dialog.
|
||||
// is valid is left to the edit dialog. It's okay for a .arend to be in the middle
|
||||
// so long as the corresponding .arstart is at the current offset.
|
||||
if (selLine.LineType == LineListGen.Line.Type.ArStartDirective) {
|
||||
// Skip overlapping region check.
|
||||
return true;
|
||||
@@ -1821,14 +1824,18 @@ namespace SourceGen {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Compute exclusive end point of selected range.
|
||||
int nextOffset = lastOffset + CodeLineList[lastIndex].OffsetSpan;
|
||||
// Anything else is too complicated to be worth messing with here. We could do
|
||||
// the work, but we have no good way of telling the user what went wrong.
|
||||
// Let the dialog explain it.
|
||||
|
||||
if (!mProject.AddrMap.IsRangeUnbroken(firstOffset, nextOffset - firstOffset)) {
|
||||
Debug.WriteLine("Found mid-selection AddressMap entry (len=" +
|
||||
(nextOffset - firstOffset) + ")");
|
||||
return false;
|
||||
}
|
||||
//// Compute exclusive end point of selected range.
|
||||
//int nextOffset = lastOffset + CodeLineList[lastIndex].OffsetSpan;
|
||||
|
||||
//if (!mProject.AddrMap.IsRangeUnbroken(firstOffset, nextOffset - firstOffset)) {
|
||||
// Debug.WriteLine("Found mid-selection AddressMap entry (len=" +
|
||||
// (nextOffset - firstOffset) + ")");
|
||||
// return false;
|
||||
//}
|
||||
|
||||
//Debug.WriteLine("First +" + firstOffset.ToString("x6") +
|
||||
// ", last +" + lastOffset.ToString("x6") + ",next +" + nextOffset.ToString("x6"));
|
||||
|
||||
Reference in New Issue
Block a user