Skip to content

Commit

Permalink
Various minor changes
Browse files Browse the repository at this point in the history
- Freeze Note brushes, so HTML export doesn't blow up when it tries
  to access them.
- Add Ctrl+Shift+E as keyboard shortcut for File > Export.
- For code/data percentage, count inline data as data.
- Tweak code/data percentage text.
- Document Merlin32 '{' bug.
- Tweak tutorial text.
  • Loading branch information
fadden committed Mar 30, 2020
1 parent 65b960d commit 5010fba
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SourceGen/DisasmProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ private void GenerateXrefs() {
}
}

if (attr.IsDataStart) {
if (attr.IsDataStart || attr.IsInlineDataStart) {
// There shouldn't be data items inside of other data items.
offset += attr.Length;

Expand Down
1 change: 1 addition & 0 deletions SourceGen/DisplayList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public static FormattedParts CreateNote(string comment, Color color) {
if (color != NoColor) {
parts.HasBackgroundColor = true;
parts.BackgroundBrush = new SolidColorBrush(color);
parts.BackgroundBrush.Freeze(); // export runs on non-UI thread
}
return parts;
}
Expand Down
2 changes: 1 addition & 1 deletion SourceGen/Res/Strings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ limitations under the License.
<system:String x:Key="str_ScanC64ScreenCode">C64 Screen Code</system:String>
<system:String x:Key="str_SetupSystemSummaryFmt">{1} CPU @ {2} MHz</system:String>
<system:String x:Key="str_ShowCol">Show</system:String>
<system:String x:Key="str_StatusByteCountFmt">{0:F1}KB: {1:F1}% code, {2:F1}% data, {3:F1}% junk</system:String>
<system:String x:Key="str_StatusByteCountFmt">{0:F1}KB ({1:F1}% code, {2:F1}% data, {3:F1}% junk)</system:String>
<system:String x:Key="str_StatusReady">Ready</system:String>
<system:String x:Key="str_StrVfyDciMixedData">DCI string has mixed data</system:String>
<system:String x:Key="str_StrVfyDciNotTerminated">DCI string not terminated</system:String>
Expand Down
2 changes: 1 addition & 1 deletion SourceGen/RuntimeData/Help/codegen.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ <h3><a name="merlin32">Merlin 32</a></h3>
<li>PC relative branches don't wrap around at bank boundaries.</li>
<li>For some failures, an exit code of zero is returned.</li>
<li>Immediate operands with a comma (e.g. <code>LDA #','</code>)
cause an error.</li>
or curly braces (e.g. <code>LDA #'{'</code>) cause an error.</li>
<li>Some DP indexed store instructions cause errors if the label isn't
unambiguously DP (e.g. <code>STX $00,X</code> vs.
<code>STX $0000,X</code>). This isn't a problem with project/platform
Expand Down
15 changes: 9 additions & 6 deletions SourceGen/RuntimeData/Help/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2><a name="basic-features">Tutorial #1: Basic Features</a></h2>

<h3>Create the project</h3>

<p>Click "Start new project".</p>
<p>Click the "Start new project" button.</p>

<p>The New Project window has three parts. The top-left window has a
tree of known platforms, arranged by manufacturer. The top-right window
Expand Down Expand Up @@ -460,7 +460,7 @@ <h4>Pointers and Parts</h4>
"OK" to update the table.</p>
<p>There's now a ".var" statement (similar to a .equ) above line $203d,
and the stores to $02/$03 have changed to "PTR1" and "PTR1+1".</p>
<p>Double-click on the JSR on line $2045 to jump to L209A. This just
<p>Double-click on the JSR on line $2045 to jump to L20A7. This just
loads a value from $3000 into the accumulator and returns, so not much
to see here. Hit the back-arrow in the toolbar to jump back to the JSR.</p>
<p>The next bit of code masks the accumulator so it holds a value between
Expand Down Expand Up @@ -497,7 +497,8 @@ <h4>Pointers and Parts</h4>
the BEQ on line $205a shows "2+" cycles, meaning that it takes at least two
cycles but might take more. That's because conditional branches take an
extra cycle if the branch is taken. The BNE on line $2061" shows 3 cycles,
because we know that the branch is always taken. (If you want to see why,
because we know that the branch is always taken and doesn't cross a page
boundary. (If you want to see why it's always taken,
look at the value of the 'Z' flag in the "flags" column. Lower-case 'z'
means the zero-flag is clear. You can see it got set on the
<code>ORA #$80</code> line.)</p>
Expand Down Expand Up @@ -588,7 +589,8 @@ <h2><a name="address-tables">Tutorial #3: Address Table Formatting</a></h2>

<p>Start a new project. Select the Apple //e platform, click Select File
and navigate to the Examples directory. In A2-Amper-fdraw, select
<code>AMPERFDRAW#061d60</code>. Click "OK" to create the project.</p>
<code>AMPERFDRAW#061d60</code> (ignore the existing .dis65 file). Click
"OK" to create the project.</p>
<p>Not a lot to see here -- just half a dozen lines of loads and stores.
This particular program interfaces with Applesoft BASIC, so we can make it
a bit more meaningful by loading an additional platform
Expand Down Expand Up @@ -758,7 +760,7 @@ <h2><a name="visualizations">Tutorial #5: Visualizations</a></h2>
the file the bitmap starts; note this is an offset, not an address
(that way, if you change the address, your visualizations don't break).
This is followed by the bitmap's width in bytes, and the bitmap's height.
Because we have 8 pixels per byte, we're currently showing a 1x1 image.
Because we have 8 pixels per byte, we're currently showing an 8x1 image.
We'll come back to row stride.</p>
<p>We happen to know (by playing the game and/or reading the fictitious
drawing code) that the image is 8x8, so change the value in the height
Expand All @@ -775,7 +777,8 @@ <h2><a name="visualizations">Tutorial #5: Visualizations</a></h2>
above line $100A.</p>

<p>Repeat the process at line $1012: select the line, create a visualization
set, create a new bitmap, set the height to 8, click "OK" twice.</p>
set, create a new visualization. The height will default to 8 because
that's what you used last time. Click "OK" in both dialogs to close them.</p>

<p>Repeat the process at line $101A, but this time the image is 40x40
rather than 8x8. Set the width to 5, and the height to 40. This makes
Expand Down
6 changes: 5 additions & 1 deletion SourceGen/WpfGui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ limitations under the License.
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="ExitCmd" Text="Exit"/>
<RoutedUICommand x:Key="ExportCmd" Text="Export..."/>
<RoutedUICommand x:Key="ExportCmd" Text="Export...">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl+Shift+E</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="FindNextCmd" Text="Find Next">
<RoutedUICommand.InputGestures>
<KeyGesture>F3</KeyGesture>
Expand Down

0 comments on commit 5010fba

Please sign in to comment.