mirror of
https://github.com/fadden/6502bench.git
synced 2024-12-28 01:29:29 +00:00
Rename FormatSplitAddress to FormatAddressTable
Updated menus and docs to match.
This commit is contained in:
parent
9fc61507ca
commit
6f81d748ee
@ -2181,14 +2181,14 @@ namespace SourceGen {
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanFormatSplitAddress() {
|
||||
public bool CanFormatAddressTable() {
|
||||
EntityCounts counts = SelectionAnalysis.mEntityCounts;
|
||||
// Must be at least one line of data, and no code. Note this is lines, not bytes,
|
||||
// so we can't screen out single-byte lines without additional work.
|
||||
return (counts.mDataLines > 0 && counts.mCodeLines == 0);
|
||||
}
|
||||
|
||||
public void FormatSplitAddress() {
|
||||
public void FormatAddressTable() {
|
||||
TypedRangeSet trs = GroupedOffsetSetFromSelected();
|
||||
if (trs.Count == 0) {
|
||||
// shouldn't happen
|
||||
@ -2196,7 +2196,7 @@ namespace SourceGen {
|
||||
return;
|
||||
}
|
||||
|
||||
FormatSplitAddress dlg = new FormatSplitAddress(mMainWin, mProject, trs,
|
||||
FormatAddressTable dlg = new FormatAddressTable(mMainWin, mProject, trs,
|
||||
mOutputFormatter);
|
||||
|
||||
dlg.ShowDialog();
|
||||
|
@ -58,7 +58,7 @@ and 65816 code. The official web site is
|
||||
<li><a href="mainwin.html#info">Info Window</a></li>
|
||||
<li><a href="mainwin.html#navigation">Navigation</a></li>
|
||||
<li><a href="mainwin.html#hints">Adding and Removing Hints</a></li>
|
||||
<li><a href="mainwin.html#split-address">Format Split-Address Table</a></li>
|
||||
<li><a href="mainwin.html#address-table">Format Address Table</a></li>
|
||||
<li><a href="mainwin.html#toggle-single">Toggle Single-Byte Format</a></li>
|
||||
<li><a href="mainwin.html#format-as-word">Format As Word</a></li>
|
||||
<li><a href="mainwin.html#toggle-data">Toggle Data Scan</a></li>
|
||||
|
@ -195,7 +195,7 @@ enabled will depend on what you have selected in the main window.</p>
|
||||
at least one line has hints. The keyboard shortcuts for hints are
|
||||
two-key combinations.</li>
|
||||
|
||||
<li><a href="#split-address">Format Split-Address Table</a>. Formats
|
||||
<li><a href="#address-table">Format Address Table</a>. Formats
|
||||
a series of bytes as parts of a table of addresses.</li>
|
||||
<li><a href="#toggle-single">Toggle Single-Byte Format</a>. Toggles
|
||||
a range of lines between default format and single-byte format. Enabled
|
||||
@ -357,7 +357,7 @@ again to re-enable the string & fill analyzer.</p>
|
||||
menu item to "flatten" the item.</p>
|
||||
|
||||
|
||||
<h3><a name="split-address">Format Split-Address Table</a></h3>
|
||||
<h3><a name="address-table">Format Address Table</a></h3>
|
||||
|
||||
<p>Tables of addresses are fairly common. Sometimes you'll find them as a
|
||||
series of 16-bit words, like this:</p>
|
||||
@ -383,12 +383,14 @@ values are to be pushed onto the stack for an RTS call.</p>
|
||||
|
||||
<p>While the .dd2 case is easy to format with the data operand editor,
|
||||
formatting addresses whose components are split into multiple tables can
|
||||
be tedious.</p>
|
||||
be tedious. Even in the easy case, you may want to create labels and set
|
||||
code hints for each item.</p>
|
||||
|
||||
<p>The Split-Address Table Formatter helps you associate symbols with the
|
||||
addresses in the table. To use it, start by selecting the entire table.
|
||||
In the example above, you would select all 6 bytes. The number of bytes
|
||||
in each part must be equal: here, it's 3 low bytes, followed by 3 high
|
||||
<p>The Address Table Formatter helps you associate symbols with the
|
||||
addresses in the table. It works for simple and "split" tables.</p>
|
||||
<p>To use it, start by selecting the entire table. In the examples above,
|
||||
you would select all 6 bytes. The number of bytes in each part of a
|
||||
split table must be equal: here, it's 3 low bytes, followed by 3 high
|
||||
bytes. If the number of bytes selected can't be evenly divided by the
|
||||
number of parts -- two parts for 16-bit data, three parts for 24-bit data --
|
||||
the formatter will report an error.</p>
|
||||
@ -398,15 +400,19 @@ is split into sections.</p>
|
||||
<ul>
|
||||
<li>Address Characteristics: select whether the table has 16-bit
|
||||
addresses or 24-bit addresses. (24-bit addresses are disabled if you
|
||||
don't have the CPU set to 65816.) If the address parts are being pushed
|
||||
don't have the CPU set to 65816.) If the table is split into individual
|
||||
sub-tables for low bytes and high bytes, check the "Parts are split
|
||||
across sub-tables" box. If the address parts are being pushed
|
||||
on the stack for an RTS/RTL, check the "Adjusted for RTS/RTL" box to
|
||||
adjust them by 1.</li>
|
||||
<li>Low Byte Source: indicate which part of the table holds the low bytes. In
|
||||
the example above, the low bytes came first, followed by the high bytes,
|
||||
so you would select "first part of selection". If they were stored the
|
||||
other way around, you would click "second part" instead.</li>
|
||||
<li>High Byte Source: indicate which part of the table holds the high bytes. For
|
||||
a 16-bit address this will be the part you didn't pick for the low bytes.
|
||||
<li>Low Byte Source: indicate which part of the table or word holds the
|
||||
low bytes. For common little-endian words, the low bytes come first. In
|
||||
the split-table example above, the low bytes came first, followed by the
|
||||
high bytes, so you would select "first part of selection". If they were
|
||||
stored the other way around, you would click "second part" instead.</li>
|
||||
<li>High Byte Source: indicate which part of the table or word holds
|
||||
the high bytes. For a 16-bit address this will be the part you didn't
|
||||
pick for the low bytes.
|
||||
Sometimes, if all addresses land on the same 256-byte page, the high byte
|
||||
will be a constant in the code, and only the low bytes will be stored in
|
||||
a table. If that's the case, select "Constant", and enter the high byte
|
||||
@ -424,7 +430,9 @@ is split into sections.</p>
|
||||
file, the offset is shown as dashes instead. If the address can be
|
||||
mapped, and it already has a user-specified label, the label will be
|
||||
shown. If no label was found, the table will show "(+)", indicating
|
||||
that a permanent label will be added at the target offset.</li>
|
||||
that a permanent label will be added at the target offset. If everything
|
||||
is set up correctly, and the addresses fall entirely within the program,
|
||||
you shouldn't see any unknown entries here.</li>
|
||||
</ul>
|
||||
|
||||
<p>For a 16-bit address, you have three choices: low byte first, high byte
|
||||
@ -443,7 +451,8 @@ pages. You just need to have all of the data selected.</p>
|
||||
data in question is part of a table. The formatting, labels, and code hints
|
||||
are applied as if you entered them all individually by hand. The formatter
|
||||
is just significantly more convenient. It also does everything as a single
|
||||
undoable action, so if it comes out looking wrong, just hit "undo".</p>
|
||||
undoable action, so if it comes out looking wrong, just hit "undo" and
|
||||
try something else.</p>
|
||||
|
||||
|
||||
<h3><a name="toggle-single">Toggle Single-Byte Format</a></h3>
|
||||
|
@ -333,7 +333,7 @@ on to the next tutorial to learn more.</p>
|
||||
can do. We assume you've already finished the Basic Features tutorial.</p>
|
||||
|
||||
|
||||
<h3>Split-Address Table Formatting</h3>
|
||||
<h3>Address Table Formatting</h3>
|
||||
|
||||
<p>Start a new project. Select the Apple //e platform, click Select File
|
||||
and navigate to the Examples directory. In A2-Amper-fdraw, select
|
||||
@ -381,9 +381,10 @@ to make the operand there say <code>>FUNC</code>. (If it says
|
||||
You could repeat these steps for the remaining items, but there's a faster
|
||||
way. Click on the line at address $1d97, then shift-click the line at
|
||||
address $1da9 (which should be <code>.FILL 12,$1e</code>). Select
|
||||
Actions > Format Split-Address Table.</p>
|
||||
Actions > Format Address Table.</p>
|
||||
<p>The message at the top should indicate that there are 30 bytes
|
||||
selected. In Address Characteristics, click the "adjusted for RTS/RTL"
|
||||
selected. In Address Characteristics, click the "Parts are split across
|
||||
sub-tables" checkbox and the "adjusted for RTS/RTL"
|
||||
checkbox. As soon as you do, the first line of the Generated Addresses
|
||||
list should show the symbol "FUNC". The rest of the addresses will look like
|
||||
<code>(+) T1DD0</code>. The "(+)" means that a label was not found at
|
||||
|
@ -137,8 +137,8 @@
|
||||
<Compile Include="WpfGui\FontPicker.xaml.cs">
|
||||
<DependentUpon>FontPicker.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WpfGui\FormatSplitAddress.xaml.cs">
|
||||
<DependentUpon>FormatSplitAddress.xaml</DependentUpon>
|
||||
<Compile Include="WpfGui\FormatAddressTable.xaml.cs">
|
||||
<DependentUpon>FormatAddressTable.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WpfGui\GotoBox.xaml.cs">
|
||||
<DependentUpon>GotoBox.xaml</DependentUpon>
|
||||
@ -306,7 +306,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WpfGui\FormatSplitAddress.xaml">
|
||||
<Page Include="WpfGui\FormatAddressTable.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<Window x:Class="SourceGen.WpfGui.FormatSplitAddress"
|
||||
<Window x:Class="SourceGen.WpfGui.FormatAddressTable"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@ -22,7 +22,7 @@ limitations under the License.
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
||||
mc:Ignorable="d"
|
||||
Title="Format Split-Address Table"
|
||||
Title="Format Address Table"
|
||||
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
|
||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
||||
Loaded="Window_Loaded">
|
||||
@ -55,7 +55,7 @@ limitations under the License.
|
||||
Content="16-bit" Checked="WidthRadio_CheckedChanged"/>
|
||||
<RadioButton Name="width24Radio" GroupName="Addr" Margin="0,4,0,0"
|
||||
Content="24-bit" Checked="WidthRadio_CheckedChanged"/>
|
||||
<CheckBox Margin="0,4,0,0" Content="Parts are split across tables"
|
||||
<CheckBox Margin="0,4,0,0" Content="Parts are split across sub-tables"
|
||||
IsChecked="{Binding IsSplitTable}"/>
|
||||
<CheckBox Margin="0,4,0,0" Content="Adjusted for RTS/RTL (target - 1)"
|
||||
IsChecked="{Binding IsAdjustedForReturn}"/>
|
||||
@ -129,7 +129,7 @@ limitations under the License.
|
||||
<Button Name="cancelButton" Content="Cancel" IsCancel="True"
|
||||
Width="70" Margin="4,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<GroupBox DockPanel.Dock="Top" Header="Generated Addresses">
|
||||
<!-- We're currently auto-sizing everything outside this, so the width of
|
||||
the columns determines the width of the window. Resizing the columns resizes
|
@ -29,7 +29,7 @@ namespace SourceGen.WpfGui {
|
||||
/// <summary>
|
||||
/// Split-address table generator.
|
||||
/// </summary>
|
||||
public partial class FormatSplitAddress : Window, INotifyPropertyChanged {
|
||||
public partial class FormatAddressTable : Window, INotifyPropertyChanged {
|
||||
/// Format descriptors to apply.
|
||||
/// </summary>
|
||||
public SortedList<int, FormatDescriptor> NewFormatDescriptors { get; private set; }
|
||||
@ -155,7 +155,7 @@ namespace SourceGen.WpfGui {
|
||||
}
|
||||
|
||||
|
||||
public FormatSplitAddress(Window owner, DisasmProject project, TypedRangeSet selection,
|
||||
public FormatAddressTable(Window owner, DisasmProject project, TypedRangeSet selection,
|
||||
Formatter formatter) {
|
||||
InitializeComponent();
|
||||
Owner = owner;
|
@ -105,7 +105,7 @@ limitations under the License.
|
||||
<KeyGesture>Ctrl+W</KeyGesture>
|
||||
</RoutedUICommand.InputGestures>
|
||||
</RoutedUICommand>
|
||||
<RoutedUICommand x:Key="FormatSplitAddressCmd" Text="Format Split-Address Table..."/>
|
||||
<RoutedUICommand x:Key="FormatAddressTableCmd" Text="Format Address Table..."/>
|
||||
<RoutedUICommand x:Key="GotoCmd" Text="Go To...">
|
||||
<RoutedUICommand.InputGestures>
|
||||
<KeyGesture>Ctrl+G</KeyGesture>
|
||||
@ -216,8 +216,8 @@ limitations under the License.
|
||||
CanExecute="IsProjectOpen" Executed="FindNextCmd_Executed"/>
|
||||
<CommandBinding Command="{StaticResource FormatAsWordCmd}"
|
||||
CanExecute="CanFormatAsWord" Executed="FormatAsWordCmd_Executed"/>
|
||||
<CommandBinding Command="{StaticResource FormatSplitAddressCmd}"
|
||||
CanExecute="CanFormatSplitAddress" Executed="FormatSplitAddressCmd_Executed"/>
|
||||
<CommandBinding Command="{StaticResource FormatAddressTableCmd}"
|
||||
CanExecute="CanFormatAddressTable" Executed="FormatAddressTableCmd_Executed"/>
|
||||
<CommandBinding Command="{StaticResource GotoCmd}"
|
||||
CanExecute="IsProjectOpen" Executed="GotoCmd_Executed"/>
|
||||
<CommandBinding Command="Help"
|
||||
@ -338,7 +338,7 @@ limitations under the License.
|
||||
<MenuItem Command="{StaticResource HintAsInlineDataCmd}" InputGestureText="Ctrl+H, Ctrl+I"/>
|
||||
<MenuItem Command="{StaticResource RemoveHintsCmd}" InputGestureText="Ctrl+H, Ctrl+R"/>
|
||||
<Separator/>
|
||||
<MenuItem Command="{StaticResource FormatSplitAddressCmd}"/>
|
||||
<MenuItem Command="{StaticResource FormatAddressTableCmd}"/>
|
||||
<MenuItem Command="{StaticResource ToggleSingleByteFormatCmd}"/>
|
||||
<MenuItem Command="{StaticResource FormatAsWordCmd}"/>
|
||||
<MenuItem Command="{StaticResource DeleteMlcCmd}"/>
|
||||
|
@ -979,8 +979,8 @@ namespace SourceGen.WpfGui {
|
||||
e.CanExecute = IsProjectOpen() && mMainCtrl.CanFormatAsWord();
|
||||
}
|
||||
|
||||
private void CanFormatSplitAddress(object sender, CanExecuteRoutedEventArgs e) {
|
||||
e.CanExecute = IsProjectOpen() && mMainCtrl.CanFormatSplitAddress();
|
||||
private void CanFormatAddressTable(object sender, CanExecuteRoutedEventArgs e) {
|
||||
e.CanExecute = IsProjectOpen() && mMainCtrl.CanFormatAddressTable();
|
||||
}
|
||||
|
||||
private void CanHintAsCodeEntryPoint(object sender, CanExecuteRoutedEventArgs e) {
|
||||
@ -1133,8 +1133,8 @@ namespace SourceGen.WpfGui {
|
||||
mMainCtrl.FormatAsWord();
|
||||
}
|
||||
|
||||
private void FormatSplitAddressCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
mMainCtrl.FormatSplitAddress();
|
||||
private void FormatAddressTableCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
mMainCtrl.FormatAddressTable();
|
||||
}
|
||||
|
||||
private void GotoCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
|
Loading…
Reference in New Issue
Block a user