1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-05-31 22:41:37 +00:00
Commit Graph

29 Commits

Author SHA1 Message Date
Andy McFadden
c637d6549c Minor updates 2024-03-02 11:17:52 -08:00
Andy McFadden
ca50730611 Update comments 2023-04-14 13:46:40 -07:00
Andy McFadden
50a954cf4d Change default for "comma-separated bulk data"
The setting determines whether bulk data is displayed as an unbroken
string of hex digits, or as "$xx,$xx,...".  The latter is easier to
read and should be the default.

One place in the code did consider it to be the default, so if the
config file didn't have a value for the setting, the settings UI would
incorrectly show it as enabled.
2022-01-12 13:33:45 -08:00
Andy McFadden
2008558870 Add "quick set" menu to delimiter settings tab
Added a pop-up menu with three options: default (curly quotes),
straight, and Merlin.  Removed the "reset to defaults" buttons.

Also, slightly rearranged the Display Format tab so that the quick
set pop-up is on the left, near the items it affects.  Moved the
"use comma-separated format for bulk data" checkbox over as well,
since it's part of the set.
2021-10-15 10:01:14 -07:00
Andy McFadden
cb114be0f6 Add "uninitialized data" format type
This allows regions that hold variable storage to be marked as data
that is initialized by the program before it is used.  Previously
the choices were to treat it as bulk data (initialized) or junk
(totally unused), neither of which are correct.

This is functionally equivalent to "junk" as far as source code
generation is concerned (though it doesn't have to be).

For the code/data/junk counter, uninitialized data is counted as
junk, because it technically does not need to be part of the binary.
2021-10-13 15:05:07 -07:00
Andy McFadden
5f472b60cf ORG rework, part 3
Split ".org" into ".arstart" and ".arend" (address range start/end).
Address range ends are now shown in the code list view, and the
pseudo-op can be edited in app settings.  Address range starts are
now shown after notes and long comments, rather than before, which
brings the on-screen display in sync with generated code.

Reworked the address range editor UI to include the new features.
The implementation is fully broken.

More changes to the AddressMap API, putting the resolved region length
into a separate ActualLength field.  Added FindRegion().  Renamed
some things.

Code generation changed slightly: the blank line before a region-end
line now comes after it, and ACME's "} ;!pseudopc" is now just "}".
This required minor updates to some of the regression test results.
2021-09-22 15:28:11 -07:00
Andy McFadden
69a9e98a43 Split "show cycle counts" in two
The "show cycle counts in comments" setting is the only one that
affects both the on-screen display and generated source code.  This
felt a little weird, so it's now two independent settings.  This
also provided an opportunity to move it to the initial tab, so it's
easier to toggle on and off.  Overall it feels less confusing to have
two settings for essentially the same thing, because code generation
is distinct from everything else.

The "spaces between bytes" setting was moved to the Display Format
tab, which seems a better fit.

Documentation and tutorial have been updated.

Also did a little bit of cleanup in EditAppSettings.
2020-08-27 13:59:53 -07:00
Andy McFadden
cb6ceafd73 Make operand wrap length configurable
Long operands, such as strings and bulk data, can span multiple lines.
SourceGen wraps them at 64 characters, which is fine for assembly
output but occasionally annoying on screen: if the operand column is
wide enough to show the entire value, the comment column is pushed
pretty far to the right.

This change makes the width configurable, as 32/48/64 characters,
with a pop-up in app settings.

The assemblers are all wired to 64 characters, though we could make
this configurable as well with an assembler-specific setting.

Some things have moved around a bit in app settings.  The Asm Config
tab now comes last.  Having it sandwiched in the middle of tabs that
altered the on-screen display didn't make much sense.  The Display
Format is now explicitly for opcodes and operands, and is split into
two columns.  The left column is managed by the "quick set" feature,
the right column is independent.
2020-07-19 18:39:27 -07:00
Andy McFadden
ee58d9e803 Data Bank Register management, part 3
Added a "fake" assembler pseudo-op for DBR changes.  Display entries
in line list.

Added entry to double-click handler so that you can double-click on
a PLB instruction operand to open the data bank editor.
2020-07-09 16:52:23 -07:00
Andy McFadden
86ead987d5 Tweak OMF converter
Changed bank-start comments to notes, added a summary to the top-of-file
comment.

Also, fixed a bug where the app settings dialog wasn't identifying
display settings as a preset for 64tass and cc65.
2020-06-30 11:48:11 -07:00
Andy McFadden
0b0944e0fc Add F6 as a shortcut for the Project Symbols editor
Goes directly to the second tab of Edit Project Properties.  This is
not represented in the menu system.
2019-12-13 13:05:29 -08:00
Andy McFadden
071adb8e95 Two changes to "dense hex" bulk data formatting
(1) Added an option to limit the number of bytes per line.  This is
handy for things like bitmaps, where you might want to put (say) 3
or 8 bytes per line to reflect the structure.

(2) Added an application setting that determines whether the screen
listing shows Merlin/ACME dense hex (20edfd) or 64tass/cc65 hex bytes
($20,$ed,$fd).  Made the setting part of the assembler-driven display
definitions.  Updated 64tass+cc65 to use ".byte" as their dense hex
pseudo-op, and to use the updated formatter code.  No changes to
regression test output.

(Changes were requested in issue #42.)

Also, added a resize gripper to the bottom-right corner of the main
window.  (These seem to have generally fallen out of favor, but I
like having it there.)
2019-12-10 17:41:00 -08:00
Andy McFadden
e7fccfda03 More progress on visualization
Got parameter in/out working in EditVisualization dialog.  Did some
rearranging in PluginCommon interfaces and data structures.  Still
doesn't do anything useful.
2019-11-26 18:54:42 -08:00
Andy McFadden
4e08810278 Finish removal of "disable label localizer" feature
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.
2019-11-16 17:15:03 -08:00
Andy McFadden
5dd7576529 Label rework, part 2
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.
2019-11-12 17:44:51 -08:00
Andy McFadden
cd23580cc5 Add junk/align directives
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.
2019-10-18 21:00:28 -07:00
Andy McFadden
df2f3803f4 SourceGen After Dark
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.
2019-10-12 17:23:32 -07:00
Andy McFadden
d8604294bb Change how the "quick set" settings work
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.
2019-10-11 17:39:52 -07:00
Andy McFadden
81157b6b47 Implement text export
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.
2019-09-12 13:57:52 -07:00
Andy McFadden
e5104dc2e7 Add first pass at source export dialog
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.
2019-09-10 17:43:31 -07:00
Andy McFadden
b65f75437d Make local variable prefix configurable for display
It's kind of handy to have variable labels tagged.  This makes it
configurable.  The quick-set for Merlin sets it to "]", all others
leave it blank.
2019-08-31 15:00:45 -07:00
Andy McFadden
e82339573f Add VarDirective to PseudoOpNames
Also, rearranged the pseudo-op app settings XAML to be a bit easier
to maintain.
2019-08-29 12:14:47 -07:00
Andy McFadden
4902b89cf8 Various improvements
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.
2019-08-17 11:30:42 -07:00
Andy McFadden
7bbe5692bd Add C64 encodings to instruction and data operand editors
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.
2019-08-15 17:53:12 -07:00
Andy McFadden
beb1024550 Define and use "delimiter sets"
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.
2019-08-14 16:10:04 -07:00
Andy McFadden
f33cd7d8a6 Replace character operand output method
The previous code output a character in single-quotes if it was
standard ASCII, double-quotes if high ASCII, or hex if it was neither
of those.  If a flag was set, high ASCII would also be output as
hex.

The new system takes the character value and an encoding identifier.
The identifier selects the character converter and delimiter
pattern, and puts the two together to generate the operand.

While doing this I realized that I could trivially support high
ASCII character arguments in all assemblers by setting the delimiter
pattern to "'#' | $80".

In FormatDescriptor, I had previously renamed the "Ascii" sub-type
"LowAscii" so it wouldn't be confused, but I dislike filling the
project file with "LowAscii" when "Ascii" is more accurate and less
confusing.  So I switched it back, and we now check the project
file version number when deciding what to do with an ASCII item.
The CharEncoding tests/converters were also renamed.

Moved the default delimiter patterns to the string table.

Widened the delimiter pattern input fields slightly.  Added a read-
only TextBox with assorted non-typewriter quotes and things so
people have something to copy text from.
2019-08-11 22:11:00 -07:00
Andy McFadden
068b3a44c7 Remove "high" versions of string pseudo-ops
High ASCII and other encodings will be noted in the operand field,
not the opcode, so we no longer need these.

This removes the six input fields from the Pseudo-Op tab of app
settings.  Values were stored as a serialized class in settings,
which generally works correctly as far as forward/backward
compatibility goes, so no worries there.

This also adds four "delimiter pattern" fields to the Code View tab,
allowing the user to customize how encoded strings are marked up
for the code list.  The values aren't actually used yet.

Also, fixed an issue where changes to text fields on the Pseudo-Op
tab weren't raising the dirty flag.
2019-08-11 16:44:22 -07:00
Andy McFadden
71badf2359 Update for cc65 v2.18
WDM <arg> now works.  MVN/MVP are still broken.  Correct code is
generated for whichever version of the assembler is configured.
Regression tests updated for new version.

Also, fixed a UI bug where manual edits to the assembler path were
being ignored.
2019-08-04 13:38:25 -07:00
Andy McFadden
c64f72d147 Move WPF code from SourceGenWPF to SourceGen 2019-07-20 13:28:37 -07:00