First swing at a visualizer for Atari 2600 sprites and playfields.
Won't necessarily present an accurate view of what is displayed on
screen, but should provide a reasonable shape for data stored in
the obvious way.
The Adventure playfields looked squashed, so I added a simple row
duplication value.
Also, minor improvements to visualizers generally:
- Throw an exception, rather than an Assert, in VisBitmap8 when the
arguments are bad.
- Show the exception in the Visualization Edit dialog.
- If generation fails and we don't have an error message, show a
generic "stuff be broke" string.
- Set focus on OK button in Visualization Set Edit after editing,
so you can hit Enter twice after renaming a tag.
Various changes:
- Generally treat visualization sets like long comments and notes
when it comes to defining data region boundaries. (We were doing
this for selections; now we're also doing it for format-as-word
and in the data analyzer when scanning for strings/fill.)
- Clear the visualization cache when the address map is altered.
This is necessary for visualizers that dereference addresses.
- Read the Apple II screen image from a series of addresses rather
than a series of offsets. This allows it to work when the image
is contiguous in memory but split into chunks in the file.
- Put 1 pixel of padding around the images in the main code list,
so they don't blend into the background.
- Remember the last visualizer used, so we can re-use it the next
time the user selects "new".
- Move min-size hack from Loaded to ContentRendered, as it apparently
spoils CenterOwner placement.
Report visualization generation errors through an explicit
IApplication interface, instead of pulling messages out of the
DebugLog stream.
Declare that GetVisGenDescrs() is only called when the plugin is in
the "prepared" state, so that plugins can taylor the set based on
the contents of the file. (This could be used to set min/max on
the "offset" entries, but I want special handling for offsets, so
we might as well set it later.)
Bitmap fonts are a series of (usually) 1x8 bitmaps, which we arrange
into a grid of cells.
Screen images are useful for embedded screens, or for people who want
to display stand-alone image files as disassembly projects.
Various improvements:
- Switched to ReadOnlyDictionary in Visualization to make it clear
that the parameter dictionary should not be modified.
- Added a warning to the Visualization Set editor that appears when
there are no plugins that implement a visualizer.
- Make sure an item is selected in the set editor after edit/remove.
- Replaced the checkerboard background with one that's a little bit
more grey, so it's more distinct from white pixel data.
- Added a new Apple II hi-res color converter whose output more
closely matches KEGS and AppleWin RGB.
- Added VisHiRes.cs to some Apple II system definitions.
- Added some test bitmaps for Apple II hi-res to the test directory.
(These are not part of an automated test.)
Thumbnails are now visible in the main list and in the visualization
set editor. They're generated on first need, and regenerated when
the set of plugins changes.
Added a checkerboard background for the visualization editor bitmap
preview. (It looks all official now.)
The Visualization and Visualization Set editors are now fully
functional. You can create, edit, and rearrange sets, and they're
now stored in the project file.
Implemented Apple II hi-res bitmap conversion. Supports B&W and
color. Uses essentially the same algorithm as CiderPress.
Experimented with displaying non-text items in ListView. I assumed
it would work, since it's the sort of thing WPF is designed to do,
but it's always wise to approach with caution. Visualization Sets
now show a 64x64 button as a placeholder for the eventual thumbnail.
Some things were being flaky, which turned out to be because I
wasn't Prepare()ing the plugins before using them from Edit
Visualization. To make this a deterministic failure I added an
Unprepare() call that tells the plugin that we're all done.
NOTE: this breaks all existing plugins.
Added some rudimentary bitmap creation code. Got a test pattern
generated by the plugin to display in the app. (Most of the time
required for this was spent figuring out how bitmaps are handled
in WPF.)
Got parameter in/out working in EditVisualization dialog. Did some
rearranging in PluginCommon interfaces and data structures. Still
doesn't do anything useful.
Basic infrastructure for taking a list of parameters from a plugin
and turning it into a collection of UI controls, merging in values
from a Visualization object. Doesn't yet do anything useful.
WPF makes the hard things easy and the easy things hard. This was
a hard thing, so it was easy to do (with some helpful sample code).
Yay WPF?
Updated documentation for non-unique label changes. Added a new
section to tutorial #1.
Updated examples to use non-unique labels and variable tables.
Tweaked the EditLabel radio button names.
Correct handling of local variables. We now correctly uniquify them
with regard to non-unique labels. Because local vars can effectively
have global scope we mostly want to treat them as global, but they're
uniquified relative to other globals very late in the process, so we
can't just throw them in the symbol table and be done. Fortunately
local variables exist in a separate namespace, so we just need to
uniquify the variables relative to the post-localization symbol table.
In other words, we take the symbol table, apply the label map, and
rename any variable that clashes.
This also fixes an older problem where we weren't masking the
leading '_' on variable labels when generating 64tass output.
The code list now makes non-unique labels obvious, but you can't tell
the difference between unique global and unique local. What's more,
the default type value in Edit Label is now adjusted to Global for
unique locals that were auto-generated. To make it a bit easier to
figure out what's what, the Info panel now has a "label type" line
that reports the type.
The 2023-non-unique-labels test had some additional tests added to
exercise conflicts with local variables. The 2019-local-variables
test output changed slightly because the de-duplicated variable
naming convention was simplified.
The label localizer is now always on. The regression tests turned
it off by default, but that's no longer allowed, so the generated
output has changed for many of them. The tests themselves were not
altered.
Update the symbol lookup in EditInstructionOperand, EditDataOperand,
and GotoBox to correctly deal with non-unique labels.
This is a little awkward because we're doing lookups by name on
a non-unique symbol, and must resolve the ambiguity. In the case of
an instruction operand that refers to an address this is pretty
straightforward. For partial bytes (LDA #>:foo) or data directives
(.DD1 :foo) we have to take a guess. We can probably make a more
informed guess than we currently are, e.g. the LDA case could find
the label that minimizes the adjustment, but I don't want to sink a
lot of time into this until I'm sure it'll be useful.
Data operands with multiple regions are something of a challenge,
but I'm not sure specifying a single symbol for multiple locations
is important.
The "goto" box just finds the match that's closest to the selection.
Unlike "find", it always grabs the closest, not the next one forward.
(Not sure if this is useful or confusing.)
Added serialization of non-unique labels to project files.
The address labels are stored without the non-unique tag, because we
can get that from the file offset. (If we stored it, we'd need to
extract the value and verify that it matches the offset.) Operand
weak references are symbolic, and so do include the tag string.
We weren't validating symbol labels before. Now we are.
This also adds a "NonU" filter to the Symbols window so the labels
can be shown or hidden as desired.
Also, added source for a first pass at a regression test.
Continue development of non-unique labels. The actual labels are
still unique, because we append a uniquifier tag, which gets added
and removed behind the scenes. We're currently using the six-digit
hex file offset because this is only used for internal address
symbols.
The label editor and most of the formatters have been updated. We
can't yet assemble code that includes non-unique labels, but older
stuff hasn't been broken.
This removes the "disable label localization" property, since that's
fundamentally incompatible with what we're doing, and adds a non-
unique label prefix setting so you can put '@' or ':' in front of
your should-be-local labels.
Also, fixed a field name typo.
This adds the concept of label annotations. The primary driver of
the feature is the desire to note that sometimes you know what a
thing is, but sometimes you're just taking an educated guess.
Instead of writing "high_score_maybe", you can now write "high_score?",
which is more compact and consistent. The annotations are stripped
off when generating source code, making them similar to Notes.
I also created a "Generated" annotation for the labels that are
synthesized by the address table formatter, but don't modify the
label for them, because there's not much need to remind the user
that "T1234" was generated by algorithm.
This also lays some of the groundwork for non-unique labels.
It's too easy to hit Escape after making a bunch of changes, so
now we ask for confirmation.
(Might make sense to make this strictly an Esc guard, and not
pester the user if they actually hit the Cancel button or close
box. I'm not convinced though; Esc+Enter isn't terrible.)
Some style guides say you should only put one space between
sentences, but I and many others still put two. The line-folding
code was only eating one of them when they straddled the end of the
line, which looked a little funny because the following line was
indented by one space.
This tweaks the code to eat both spaces. Regression test updated.
Also, nudge some UI elements so they line up.
Jumps to the first offset associated with the change at the top of
the Undo stack. We generally jump to the code/data offset, not the
specific line affected. It's possible to do better (and we do, for
Notes), but probably not worthwhile.
As noted in issue #52, the side panels can't be resized once the
ListView gets focus. The root of the problem is a workaround for a
selection problem that involves catching the Item Container
Generator's Status Changed event, and setting an item's focus. It
appears that changing the size of the ListView causes the
StatusChanged event to fire, which cause the handler to grab the
focus, which causes the splitters to stop moving after one step.
This change adds a workaround that prevents the original workaround
from doing anything while a splitter is in the process of being
dragged. It doesn't solve all problems -- you can't move the
splitters more than one step with the keyboard -- but it allows them
to be dragged around with the mouse.
There's got to be a better way to deal with this.
The fix for Shift+F3 required briefly switching the code list view
to single-select mode. Unfortunately, while in that mode the
control throws an exception if you touch SelectedItems (plural)
rather than SelectedItem (singular), and in an unusual case the
selection-changed event handler was doing just that.
Project symbol address values are now limited to positive 24-bit
integers, just as they are for platform symbols. Constants may
still be 32-bit values.
If we detect a problem that requires intervention during loading,
e.g. we find unknown elements because we're loading a file created
by a newer version, default to read-only mode.
Read only mode (1) refuses to apply changes, (2) refuses to add
changes to the undo/redo list, and (3) disables Save/SaveAs. The
mode is indicated in the title bar.
Also, flipped the order of items in the title bar so that "6502bench
SourceGen" comes last. This allows you to read the project name in
short window title snippets. (Visual Studio, Notepad, and others
do it this way as well.)
Not a huge improvement, but things are slightly more organized, and
there's a splash of color in the form of a border around the text
describing the format of code and data lines.
Added an "IsConstant" property to Symbol.
Sometimes code relocates a few bits of itself but not others. We
don't currently have a way to say, "go back to where we would have
been". As a cheap alternative, we now show the "load address", i.e.
where we'd be if there were no address map entries after the first.
Mark the "info" window as read-only.
When the project closes, clear the contents of the Symbols and
Notes windows.
Clarify some Apple II I/O definitions.
This adds a window that displays all of the instructions for a
given CPU in a summary grid. Undocumented instructions are
included, but shown in grey italics.
Also, tweaked AppSettings to not mark itself as dirty if a "set"
operation doesn't actually change anything.
Implemented show/hide mechanic, using a button on the right side of
the status bar to show status and to trigger un-hide.
Also, show I/O direction in project symbols editor list.
This converts the "problem list viewer" tool to a grid that appears
below the code list view when non-empty. Not all messages are
problems, so it's being renamed to "message list".
Created a Navigate menu, and put the menu items for Find and Go To
in it. Added menu items for nav-forward and nav-backward, which
until now were only available as toolbar buttons.
Sometimes there's a bunch of junk in the binary that isn't used for
anything. Often it's there to make things line up at the start of
a page boundary.
This adds a ".junk" directive that tells the disassembler that it
can safely disregard the contents of a region. If the region ends
on a power-of-two boundary, an alignment value can be specified.
The assembly source generators will output an alignment directive
when possible, a .fill directive when appropriate, and a .dense
directive when all else fails. Because we're required to regenerate
the original data file, it's not always possible to avoid generating
a hex dump.
Memory-mapped I/O locations can have different behavior when read
vs. written. This is part 1 of a change to allow two different
symbols to represent the same address, based on I/O direction.
This also adds a set of address masks for systems like the Atari
2600 that map hardware addresses to multiple locations.
This change updates the data structures, .sym65 file reader,
project serialization, and DefSymbol editor.
Most of SourceGen uses standard WPF controls, which get their default
style from the system theme. The main disassembly list uses a
custom style, and always looks like the Windows default theme.
Some people greatly prefer white text on a black background, so we
now provide a way to get that. This also requires muting the colors
used for Notes, since those were chosen to contrast with black text.
This does not affect anything other than the ListView used for
code, because everything else can be set through the Windows
"personalization" interface. We might want to change the way the
Notes window looks though, to avoid having glowing bookmarks on
the side.
The last two tabs in the Edit App Settings dialog have "quick set"
buttons configure all fields for a particular assembler, or reset
them to default values. The previous UI was a little annoying,
because you had to pick something from the combo box and then hit
"set" to push the change. It was also confusing, because if you
came back later the combo box was just set to the first entry, not
the thing you picked last.
Now, picking an entry from the combo box immediately updates all
fields. The combo box selection is set to reflect the actual
contents (so if you set everything just right, the combo box will
change to a specific assembler). If nothing matches, a special
entry labeled "Custom" is selected.
Also, rearranged the tutorial sections in the manual so the
address table formatting comes last, and appears in the local TOC.
If you link to the file without escaping the '#', the browser will
think it's an anchor inside the page. Easier on everyone to just
alter the filename.
If you select a local variable, double-click on a reference entry,
and then hit "back", you aren't taken back to the correct place in
the local variable table. This is annoying if you're trying to
explore how a local variable is used.
The NavStack Location object now has a "line delta" that can be
applied to position the selection correctly. This isn't stable
across undo/redo, but it solves the common cases.
This makes LineListGen's "Top" class redundant, so uses of that have
been replaced with Location.
The Find box now has forward/backward radio buttons. Find Next
searches forward, and Find Previous searches backward, regardless
of the direction of the initial search.
The standard key sequence for "find previous" is Shift+F3. The WPF
ListView has some weird logic that does something like: if you hit
a key, and the selection changes, and the shift key was held down,
then you must have meant to select a range. So Shift+F3 often (but
not always) selects a range. I think this might be fixable if I can
figure out how ListView keeps track of the current keyboard
navigation position (which is not the same as the selection). For
now I'm working around the problem by using Ctrl+F3 to search.
Yay WPF.
Early data sheets listed BRK as one byte, but RTI after a BRK skips
the following byte, effectively making BRK a 2-byte instruction.
Sometimes, such as when diassembling Apple /// SOS code, it's handy
to treat it that way explicitly.
This change makes two-byte BRKs optional, controlled by a checkbox
in the project settings. In the system definitions it defaults to
true for Apple ///, false for all others.
ACME doesn't allow BRK to have an arg, and cc65 only allows it for
65816 code (?), so it's emitted as a hex blob for those assemblers.
Anyone wishing to target those assemblers should stick to 1-byte mode.
Extension scripts have to switch between formatting one byte of
inline data and formatting an instruction with a one-byte operand.
A helper function has been added to the plugin Util class.
To get some regression test coverage, 2022-extension-scripts has
been configured to use two-byte BRK.
Also, added/corrected some SOS constants.
See also issue #44.
The "add platform symbol file" and "add extension script" buttons
create a file dialog with the initial directory set to the
RuntimeData directory inside the SourceGen installation directory.
This is great if you're trying to add a file from the platform
definitions, but annoying if you're trying to add it from the
project directory.
It's really convenient to not have to hunt around though, so now
there are two buttons: one for platform, one for project. The
latter is disabled if the project is new and hasn't been saved yet.
We were changing the control template for lines with long comments
and notes, matching the default Win10 style. This got ugly when a
non-default theme was being used, particularly "dark" themes,
because the long-comment lines looked significantly different from
everything else.
We now fully specify the style for the ListView and ListViewItems,
which means everybody's main window now looks like the default Win10
style. Which is unfortunate, but significantly easier than creating
a full set of theme-specific styles.
We now specify black text for highlighted address/label fields,
because they otherwise become illegible when we apply our background
highlight color. In the Notes window, we set the background of
un-highlighted entries to white, so that we can always read it with
black text.
Addresses issue #50.
Implement multi-byte project/platform symbols by filling out a table
of addresses. Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority. This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.
The bounds on project/platform symbols are now rigidly defined. If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.
The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.
Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win. Now, the symbol
defined in the most-recently-loaded file wins. (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.) This allows the user to pick the winner by
arranging the load order of the platform symbol files.
Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.
These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses. The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky. (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)
Also, re-enabled some unit tests.
Also, added a bit of identifying stuff to CrashLog.txt.
Added a Width column to the list in the project symbol editor.
Changed the local variable table editor and the project symbol editor
to use DataGrid instead of ListView. This gets us easy sorting on
arbitrary columns. The previous code was reloading the display list
after every change; now we just add/edit/remove individual items,
which helps keep the list position and selection stable.
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
Change + save + undo + change was being treated as non-dirty.
Added link to "export" feature to documentation TOC.
Added keyboard shortcut for high part in data operand editor.
Corrected various things in the tutorial.
Added a blank line after local variable tables. Otherwise they
just sort of blend in with the stuff around them.
Put prefixes before the DOS 3.3 platform symbols.
Added a BAS_HBASH entry. We were getting BAS_HBASL and MON_GBASH
paired up, which looks weird.
Apply a very light tint to the preview section of the Edit Long
Comment dialog, to hint that the window is read-only.
HTML output should have had double quotes around internal anchors.
(Chrome and Edge didn't complain, but the w3c validator wasn't
happy.)
Made the text areas in the load-time problem report dialogs
scrollable.
Updated the manual.
The analyzer sometimes runs into things that don't seem right, like
hidden labels or references to non-existent symbols, but has no way
to report them. This adds a problem viewer.
I'm not quite ready to turn this into a real feature, so for now it's
a free-floating window accessed from the debug menu.
Also, updated some documentation.
Split "edit local variable table" into "create" and "edit prior".
The motivation is to allow the user to make changes to the most
recently defined table without having to go search for it. Having
table creation be an explicit action, rather than something that
just happens if you edit a table that isn't there, feels reasonable.
Show table offset in LV table edit dialog, so if you really want
to go find it there's a (clumsy) way to do so.
Increased the maximum width of a variable from 4 to 8. (This is
entirely arbitrary.)
Typing a long comment in the project symbol editor caused the
window to expand, which wasn't intended. Use the mono font in
the comment editor. Set the focus to the OK button after creating
or editing a project property. Show constant vs. address in the
info panel when an EQU directive is selected.
Changing an ASCII character operand back to default was going
through a path that tried to resolve low vs. high ASCII, which
isn't useful when you're removing the item. The root of the problem
was that the "default" button wasn't properly resetting the UI.
Also, updated keyboard shortcuts to be in sync with the instruction
operand editor.
It felt a little weird tying it to the asm generation setting,
so now it's just another checkbox in the export options.
Implemented the feature for plain text output. Did some rearranging
in the code. Fixed suppression of Notes in text and CSV.
We weren't escaping '<', '>', and '&', which caused browsers to get
very confused. Browsers seem to prefer <PRE> to <CODE> for long
blocks of text, so switch to that.
Also, added support for putting long labels on their own lines in
the HTML output.
Also, fixed some unescaped angle brackets in the manual.
Also, tweaked the edit instruction operand a bit more.
If you set things up just right, it's possible for flag status
changes to fail to get merged.
Added a regression test to 1003-flags-and-branches.
Also, tweaked the instruction operand editor to be a bit smoother
from the keyboard: added alt-key shortcuts, and put the focus on the
OK button after creating/editing a label so you can just hit the
return key twice.
I was using the plain names, but when you've got symbols like
READ and WAIT it's too easy to have a conflict and it's not plainly
obvious where something came from. Now all monitor symbols begin
with MON_, and Applesoft symbols begin with BAS_.
The Amper-fdraw example ended up with a few broken symbol refs,
because it was created before project/platform symbols followed the
"nearby" rules, and was explicitly naming LINNUM and AMPERV. I
switched the operands to default, and they now auto-format correctly.
I added a few more entries to Applesoft while I was at it.
I ran into a non-split table of 16-bit addresses, each of which
was (address-1) for a code location. I wanted to create a label,
add a code hint, and set the operand for each one, but there's no
easy way to do that.
It turns out the split-address table formatter can be made to work
for non-split tables with just a few minor changes.
It's possible to define multiple project symbols with the same
address. The way to resolve the ambiguity is to explicitly
reference the desired symbol from the operand. This was the
default behavior of the "create project symbol" shortcut in the
previous version.
It's rarely necessary, and it can get ugly if you rename a project
symbol, because we don't refactor operands in that case.
Also, removed "include symbol table" from export dialog. You can
exclude the table by removing it from the template, which right
now you'd need to do anyway to get rid of the H2 header and other
framing. To make this work correctly as an option we'd need to
parse the "div" in the template file and strip the whole section,
or split the template into multiple parts that get included as
needed. Not worth doing the work until we're sure it matters.
This feature "exports" the source code in the same format it appears
in on screen. The five columns on the left are optional, the four
on the right can be resized. Exported text can span the entire file
or just the current selection. Output can be plain text or CSV.
(I still haven't figured out a good use for CSV.)
The old copy-to-clipboard function is now implemented via the export
mechanism.
This adds a new clipboard mode that includes all columns. Potentially
useful for filing bug reports against SourceGen.
Ported the column width stuff from EditAppSettings, which it turns
out can be simplified slightly.
Moved the clipboard copy code out into its own class.
Disabled "File > Print", which has never done anything and isn't
likely to do anything in the near future.
Also, added a note to 2019-local-variables about a test case it
should probably have.
Updated the manual, and changed tutorial #2 to use local variables
for pointers.
If the symbol text box isn't empty, use the string as the initial
value for the Label when creating a new project property.
Fixed a crash when editing a project property.
Implemented local variable editing. Operands that have a local
variable reference, or are eligible to have one, can now be edited
directly from the instruction operand edit dialog.
Also, updated the code list double-click handler so that, if you
double-click on the opcode of an instruction that uses a local
variable reference, the selection and view will jump to the place
where that variable was defined.
Also, tweaked the way the References window refers to references
to an address that didn't use a symbol at that address. Updated
the explanation in the manual, which was a bit confusing.
Also, fixed some odds and ends in the manual.
Also, fixed a nasty infinite recursion bug (issue #47).
Rearrange the UI elements, and convert the code-behind to a more
XAML-style form. The basic stuff works, but the old "shortcut"
system is still in the process of being replaced.
This hits most of the edge cases, but doesn't exercise the two
duplicate name situations (var name same as user label, var name
same as project/platform symbol).
Also, fixed a bug in the EditDefSymbol uniqueness check where it
was comparing a symbol to itself.
Variables are now handled properly end-to-end, except for label
uniquification. So cc65 and ACME can't yet handle a file that
redefines a local variable.
This required a bunch of plumbing, but I think it came out okay.
We now generate FormatDescriptors with WeakSymbolRefs for direct
page references that match variable table entries.
LocalVariableTable got a rewrite. We need to be unique in both
name and address, but for the address we have to take the width into
account as well. We also want to sort the display by address
rather than name. (Some people might want it sorted by name, but
we can worry about that some other time.)
Updated the DefSymbol editor to require value uniqueness. Note
addresses and constants exist in separate namespaces.
The various symbols are added to the SymbolTable so that uniqueness
checks work correctly. This also allows the operand generation to
appear to work, but it doesn't yet handle redefinition of symbols.
Multi-line item, with one .eq line per variable definition. Add
one header line if "clear previous" is set.
Also, limit variable values to 0-255 in the editor. This is
somewhat arbitrary, but I think a focus on DP is useful.
This involved adding a list to the DisasmProject, creating a new
UndoableChange type, and writing the project file serialization
code. While doing the latter I realized that the new Width field
was redundant with the FormatDescriptor Length field, and removed it.
I added a placeholder line type, but we're not yet showing the
table in the display list. (To edit the tables you just have to
know where they are.)
The table editor is now editing the table, and the DefSymbol editor
now asks for the Width data when editing a local var.
This also moves EditDefSymbol closer to proper WPF style, with
bound properties for the input fields.
No changes yet to serialization or analysis.
Fixed a minor bug in GenerateLineList that would cause a blank line
to disappear under certain circumstances. Harmless, but odd.
Added a width property to DefSymbol.
Updated comments.
I didn't think it made sense, but I found something that used it,
so apparently it's a thing. This updates the operand editor to
let you choose PETSCII+DCI, and updates the assemblers to handle
it correctly (really just 64tass, since the others either don't
have a DCI directive or don't deal with PETSCII at all).
Changed the char-encoding sample from "bad dcI" to "pet dcI", and
updated the documentation.
String operands used to be simple -- each line had 62 characters
plus two hard-coded non-ASCII delimiters -- but now we're mixing
character and hex data, so we can't use simple math to tell where
the lines will break. We want to render them and keep the result
around until some dependency changes, e.g. different delimiters
or a change to the pseudo-op table.
Also, cleaned up LineListGen a little. It had some methods that
were declared static because they were expected to be shared, but
that never happened.
Also, fixed a bug in GatherEntityCounts where multi-line items were
being scanned multiple times.
The PseudoOpNames class is increasingly being used in situations
where mutability is undesirable. This change makes instances
immutable, eliminating the Copy() method and adding a constructor
that takes a Dictionary. The serialization code now operates on a
Dictionary instead of the class properties, but the JSON encoding is
identical, so this doesn't invalidate app settings file data.
Added an equality test to PseudoOpNames. In LineListGen, don't
reset the line list if the names haven't actually changed.
Use a table lookup for C64 character conversions. I figure that
should be faster than multiple conditionals on a modern x64 system.
Fixed a 64tass generator issue where we tried to query project
properties in a call that might not have a project available
(specifically, getting FormatConfig values out of the generator for
use in the "quick set" buttons for Display Format).
Fixed a regression test harness issue where, if the assembler reported
success but didn't actually generate output, an exception would be
thrown that halted the tests.
Increased the width of text entry fields on the Pseudo-Op tab of app
settings. The previous 8-character limit wasn't wide enough to hold
ACME's "!pseudopc". Also, use TrimEnd() to remove trailing spaces
(leading spaces are still allowed).
In the last couple of months, Win10 started stalling for a fraction
of a second when executing assemblers. It doesn't do this every
time; mostly it happens if it has been a while since the assembler
was run. My guess is this has to do with changes to the built-in
malware scanner. Whatever the case, we now change the mouse pointer
to a wait cursor while updating the assembler version cache.
Both dialogs got a couple extra radio buttons for selection of
single character operands. The data operand editor got a combo box
that lets you specify how it scans for viable strings.
Various string scanning methods were made more generic. This got a
little strange with auto-detection of low/high ASCII, but that was
mostly a matter of keeping the previous code around as a special
case.
Made C64 Screen Code DCI strings a thing that works.
A delimiter definition is four strings (prefix, open, close, suffix)
that are concatenated with the character or string data to form an
operand. A delimiter set is a collection of delimiter definitions,
with separate entries for each character encoding.
This is a convenient way to configure Formatter objects, import and
export data from the app settings file, and manage the UI needed to
allow the user to customize how things look.
The full set of options didn't fit on the first app settings tab, so
there's now a separate tab just for specifying character and string
delimiters. (This might be overkill, but there are various plausible
scenarios that make use of it.)
The delimiters for on-screen display of strings can now be
configured.