diff --git a/SourceGen/AsmGen/WpfGui/GenAndAsm.xaml b/SourceGen/AsmGen/WpfGui/GenAndAsm.xaml
index 191eec0..78e9a11 100644
--- a/SourceGen/AsmGen/WpfGui/GenAndAsm.xaml
+++ b/SourceGen/AsmGen/WpfGui/GenAndAsm.xaml
@@ -91,7 +91,7 @@ limitations under the License.
Near the top-left of the SourceGen window is a set of toolbar icons. -Click the left-arrow, and watch the selection moves. Click it again. Then -click the right-arrow a couple of times. Whenever you jump around in the -file by using the Go To feature, or by double-clicking on opcodes or -lines in side-windows, the locations are added to a navigation history. The -arrows let you move forward and backward through it.
+Click the curly left-pointing arrow, and watch the selection move. Click +it again. Then click the curly right-arrow a couple of times. Whenever +you jump around in the file by using the Go To feature, or by double-clicking +on opcodes or lines in the side windows, the locations are added to a +navigation history. The arrows let you move forward and backward +through it.Note the way the code list has changed. When you changed the address, the "JMP $2000" at L1014 found a home inside the bounds of the file, so @@ -190,8 +191,8 @@ so you'll be forgiven if you reduce the offset column width to zero.)
On the line at address $2000, select Actions > Edit Label, or double-click on the label "L2000". Change the label to "MAIN", and hit Enter. The label changes on that line, and on the two lines that refer -to address $2000. (If you're not sure what refers to line $2000, select -it and check the References window.)
+to address $2000. (If you're not sure what refers to address $2000, select +that line and check the References window.)On that same line, select Actions > Edit Comment. Type a short comment, and hit Enter. Your comment appears in the "comment" column.
@@ -219,7 +220,8 @@ carefully you would have noticed that the label at $2009 ("L2009") has disappeared. This happened because the code at $2005 used to have a numeric reference to $2009, and SourceGen automatically created a label. However, you changed the code at $2005 to have a symbolic -reference to a symbol called "IS_OK", so the auto-label was no longer +reference to a symbol called "IS_OK", and there were no other numeric +references to $2009, so the auto-label was no longer needed. Because IS_OK doesn't exist, the operand at $2005 is just formatted as a hexadecimal value.Let's fix this. Select the line at address $2009, then @@ -300,7 +302,7 @@ separate ".STR" statements.
You can generate assembly source code from the disassembled data. -Select File > Assembler (or hit Ctrl+Shift+A) to open the generation +Select File > Assembler (or hit Ctrl+Shift+A) to open the source generation and assembly dialog.
Pick your favorite assembler from the drop list at the top right,
then click "Generate". An assembly source file will be generated in the
@@ -368,7 +370,8 @@ the data item (double-click on "$b4"), click "Single bytes", then type "FUNC"
(note the text field gets focus immediately, and the radio button
automatically switches to "symbolic reference" when you start typing).
Click OK. The operand at $1d97 should now say <FUNC-1
.
-Repeat the process at $1da6, this time clicking the "High" part button,
+Repeat the process at $1da6, this time clicking the "High" part radio button
+below the symbol entry text box,
to make the operand there say >FUNC
. (If it says
<FUNC-152
, you forgot to select the High part.)
Down near the bottom, check the "add code entry hint if needed" checkbox. Because we saw the table contents being pushed onto the stack for RTS, we know that they're all code entry points.
-Click OK. The table of address bytes should now all be references to -symbols -- 15 low parts followed by 15 high parts. If you scroll down, -you should see nothing but instructions until you get to the last dozen -bytes at the end of the file. (If this isn't the case, use Edit > Undo, -then work through the steps again.)
+Click OK. The table of address bytes at $1d97 should now all be +references to symbols -- 15 low parts followed by 15 high parts. If you +scroll down, you should see nothing but instructions until you get to the +last dozen bytes at the end of the file. (If this isn't the case, use +Edit > Undo, then work through the steps again.)
The formatter did the same steps you went through earlier -- set a label, apply the label to the low and high bytes in the table, add a code entry point hint -- but did several of them at once.
@@ -439,10 +442,9 @@ the words "last string"). option is not available. This is because we didn't include the null byte on the last string. To be recognized as one of the "special" string types, every selected string must match the expected pattern. -Cancel out of the dialog. Hold the control key down, and double-click
-on the operand on line $203c (.DD1 $00
). Control-clicking
-adds the line to the selection, and double-clicking the operand reopens
-the dialog. You should see "Null-terminated strings (4)" as an available
+
Cancel out of the dialog. Hold the shift key down, and double-click
+on the operand on line $203c ($00
).
+You should see "Null-terminated strings (4)" as an available
option now. Click on that, then click OK. The strings are now shown
as .ZSTR operands.
Select line $2063, and use Actions > Edit Label to give it the -label "XDATA". Now edit the operand on line $203d, and set it to the -symbol "XDATA", with the part "low". Edit the operand on line $2043, +
Select the line at address $2063, and use Actions > Edit Label to
+give it the label "XDATA". Now edit the operand on line $203d, and set it
+to the symbol "XDATA", with the part "low". Edit the operand on line $2043,
and set it to "XDATA" with the part "high". (Note the symbol text box
gets focus immediately, so you can start typing the symbol name as soon
as the dialog opens; you don't need to click around first.) If all
@@ -485,7 +487,8 @@ This confirms our idea that XDATA holds 16-bit addresses, so let's
format it. Select lines $2063 to $2066, and Actions > Edit Operand.
It should say "8 bytes selected" at the top. Select "16-bit words,
little-endian", and then from the Display As box, select "Address".
-Click OK. If you scroll up, you'll see that your .ZSTR strings now have
+Click OK. XDATA should now be four .dd2
16-bit addresses.
+If you scroll up, you'll see that the .ZSTR strings near the top now have
labels that match the labels in XDATA.
Now that we know what XDATA holds, let's rename it. Change the label to STRADDR. The symbol parts in the operands at $203d and $2041 update @@ -511,11 +514,12 @@ you add an end-of-line comment, it appears after the cycle count.
The rest of the code isn't really intended to do anything useful. It just exists to illustrate some odd situations.
Look at the code starting at $206b. It ends with a BRK at $2074, which -as noted earlier is a bad sign. If you look up two lines, you'll see that -it's loading the accumulator with zero, then doing a BNE, which should never -be taken (note the cycle count for the BNE is 2). The trick is in the -two lines before that, which use self-modifying code to change the LDA -immediate operand from $00 to $ff. The BNE is actually a branch-always.
+as noted earlier is a bad sign. If you look two lines above the BRK, +you'll see that it's loading the accumulator with zero, then doing a BNE, +which should never be taken (note the cycle count for the BNE is 2). The +trick is in the two lines before that, which use self-modifying code to +change the LDA immediate operand from $00 to $ff. The BNE is actually +a branch-always.We can fix this by correcting the status flags. Select line $2072,
and then Actions > Override Status Flags. This lets us specify what
the flags should be before the instruction is executed. For each flag,
diff --git a/SourceGen/WpfGui/EditAddress.xaml b/SourceGen/WpfGui/EditAddress.xaml
index 6d78384..de18ce7 100644
--- a/SourceGen/WpfGui/EditAddress.xaml
+++ b/SourceGen/WpfGui/EditAddress.xaml
@@ -24,7 +24,7 @@ limitations under the License.
Title="Set Address"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
- Loaded="Window_Loaded">
+ ContentRendered="Window_ContentRendered">