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

32 Commits

Author SHA1 Message Date
Andy McFadden
4322a0c231 Add option to put labels on separate lines
We currently have two options for assembly code output, selected by
a checkbox in the application settings: always put labels on the same
lines as the instruction or data operand, or split the labels onto
their own line if they were wider than the label text field.

This change adds a third option, which puts labels on their own line
whenever possible.  Assemblers don't generally allow this for variable
assignment pseudo-ops like "foo = $1000", but it's accepted for most
other situations.  This is a cosmetic change to the output, and will
not affect the generated code.

The old true/false app setting will be disregarded.  "Split if too
long" will be used by default.

Added test 20280-label-placement to exercise the "split whenever
allowed" behavior.

The "export" function has a similar option that has not been updated
(for no particular reason other than laziness).

Also, simplified the app settings GetEnum / SetEnum calls, which
can infer the enumerated type from the arguments.  This should not
impact behavior.
2024-04-21 16:26:42 -07:00
Andy McFadden
e425237783 First cut at label file generation
Some debuggers allow you to import a list of labels for addresses.
This adds a command that generates a file full of labels in a
specific format.  Currently the VICE monitor format is supported.

(issue #151)
2024-04-20 16:37:08 -07:00
Andy McFadden
72d8498fe0 Minor tweaks 2023-04-17 09:48:01 -07:00
Andy McFadden
ca50730611 Update comments 2023-04-14 13:46:40 -07:00
Andy McFadden
d2326c389f ORG rework, part 8
Implemented address region pre-labels.  These are useful if the code is
relocating a block from address A to address B, because the code that
does the copying refers to both the "before" address and the "after"
address.  Previously you'd give the block the "after" address and the
"before" would just appears as hex, because it's effectively an
external address.

Pre-labels are shown on screen with their address, but no other fields.
Showing the address makes it easy to see the label's value, which isn't
always obvious right before a .arstart.  The labels are suppressed if the
address value evaluates to non-addressable.

This defines a new type of symbol, which is external and always global
in scope.  Pre-labels affect label localization and must go through
the usual remapping to handle clashes with opcode mnemonics and the
use of leading underscores.  Cross-references are computed, but are
associated with the file offset rather than the label line itself.

Added a new filter to the Symbols window ("PreL").

Implemented label input and checking in the address editor.  Generally
added highlighting of relevant error labels.
2021-10-04 20:41:19 -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
2dfdb3234b Add Apple II screen memory chart
Show mapping between lines on the text and hi-res screens and
locations in memory.
2020-08-20 17:24:28 -07:00
Andy McFadden
6892040ea8 Add two options to OMF converter
First, make the per-segment comments and notes optional.

Second, add an "offset segment by $0100" feature that tries to shift
each segment forward 256 bytes.  Doing so avoids potential ambiguity
with direct page locations.

The 20212-reloc-data test no longer has the per-segment comments.
2020-07-20 13:50:49 -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
0ab76ea1f7 Improve CPU instruction chart
Added "show undocumented opcodes" checkbox, so you can choose
whether or not to see them at all.  (Issue #60)

Added formatter call for the instruction mnemonics so they get
capitalized when the app is configured for upper-case opcodes.
(Issue #59)

Fix a bug where the instruction chart and ASCII chart were writing
their modes to the same setting, stomping each other.

Also, pluralized a button in the file concatenator.
2020-02-18 13:25:20 -08:00
Andy McFadden
5d9b9753e8 Add visualization sets to exported HTML
We now generate GIF images for visualizations and add inline
references to them in the HTML output.

Images are scaled using the HTML img properties.  This works well
on some browsers, but others insist on "smooth" scaling that blurs
out the pixels.  This may require a workaround.

An extra blank line is now added above visualizations.  This helps
keep the image and data visually grouped.

The Apple II bitmap test project was updated to have a visualization
set with multiple images at the top of the file.
2019-12-13 17:15:38 -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
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
8273631917 Label rework, part 3
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.
2019-11-16 11:12:32 -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
bcac8bc6a0 Add instruction chart
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.
2019-10-21 15:15:09 -07:00
Andy McFadden
a4f1de1238 Add message list, part 2 (of 2)
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.
2019-10-20 18:02:23 -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
5dacbcd9b5 Make "long labels on new line" configurable in export dialog
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.
2019-09-18 11:14:20 -07:00
Andy McFadden
be2b1e7bba Add Export feature to documentation
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.
2019-09-13 18:22:34 -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
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
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
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
c64f72d147 Move WPF code from SourceGenWPF to SourceGen 2019-07-20 13:28:37 -07:00
Andy McFadden
e3906e021b Move WinForms code to SourceGenWF 2019-07-20 13:02:54 -07:00
Andy McFadden
97a372a884 Add selectable auto-label styles
SourceGen creates "auto" labels when it finds a reference to an
address that doesn't have a label associated with it.  The label for
address $1234 would be "L1234".  This change allows the project to
specify alternative label naming conventions, annotating them with
information from the cross-reference data.  For example, a subroutine
entry point (i.e. the target of a JSR) would be "S_1234".  (The
underscore was added to avoid confusion when an annotation letter
is the same as a hex digit.)

Also, tweaked the way the preferred clipboard line format is stored
in the settings file (was an integer, now an enumeration string).
2019-04-15 15:14:04 -07:00
Andy McFadden
96ee33ae8c Optionally add spaces in the "bytes" column
Affects the display list and copy/paste text.  Makes the column
three spaces wider, but makes it easier to read.
2018-10-21 21:08:48 -07:00
Andy McFadden
4f9af30455 Progress toward new assembler configuration
Rather than have each assembler get its own app config string for
the cross-assembler executable, we now have a collection of per-
assembler config items, of which the executable path name is one
member.  The Asm Config tab has an auto-generated pop-up to select
the assembler.

The per-assembler settings block is serialized with the rather
unpleasant JSON-in-JSON approach, but nobody should have to look
at it.

This also adds assembler-specific column widths to the settings
dialog, though they aren't actually used yet.
2018-10-20 20:35:32 -07:00
Andy McFadden
78906dcf58 Record main window location as well as size
If the main window was maximized before, maximize it when we
restart.

Changed the preferences to record the width of the right panels,
rather than the splitter distance, which is actually the width of
the middle of the screen.

Seems to work correctly on my non-uniform multi-monitor setup.  I
added a check to confirm that the middle of the title bar falls in
the working area of the screen that WinForms thinks we're in, so it
shouldn't be possible to "lose" a window off the edge by dragging
it or by changing screen resolutions.
2018-10-01 15:04:23 -07:00
Andy McFadden
2c6212404d Initial file commit 2018-09-28 10:05:11 -07:00