1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-04-20 04:16:47 +00:00

SGEC update, part 2 (of 2)

Expand SGEC to include long comments and notes.  These are serialized
in JavaScript form.

SGEC now accepts addresses and relative position deltas.  Exported
content uses addresses, and can be configured for deltas.
This commit is contained in:
Andy McFadden
2020-07-15 17:43:08 -07:00
parent c5d764d11f
commit 0860a00a54
4 changed files with 233 additions and 45 deletions
+2 -11
View File
@@ -273,7 +273,7 @@ namespace SourceGen {
Text = mlc.Text;
BoxMode = mlc.BoxMode;
MaxWidth = mlc.MaxWidth;
BackgroundColor = ColorToInt(mlc.BackgroundColor);
BackgroundColor = CommonWPF.Helper.ColorToInt(mlc.BackgroundColor);
}
}
public class SerSymbol {
@@ -730,7 +730,7 @@ namespace SourceGen {
continue;
}
proj.Notes[intKey] = new MultiLineComment(kvp.Value.Text,
ColorFromInt(kvp.Value.BackgroundColor));
CommonWPF.Helper.ColorFromInt(kvp.Value.BackgroundColor));
}
// Deserialize user-defined labels.
@@ -1261,14 +1261,5 @@ namespace SourceGen {
return false;
}
}
private static int ColorToInt(Color color) {
return (color.A << 24) | (color.R << 16) | (color.G << 8) | color.B;
}
private static Color ColorFromInt(int colorInt) {
return Color.FromArgb((byte)(colorInt >> 24), (byte)(colorInt >> 16),
(byte)(colorInt >> 8), (byte)colorInt);
}
}
}