Commit Graph
100 Commits
Author SHA1 Message Date
Andy McFadden ef13101923 Clarify some app settings
The pop-up that lets you choose which assembler to set configuration
options for looked like it let you choose an assembler generally.
Changed some wording and visuals for better clarity.
2024-08-01 15:08:43 -07:00
Andy McFadden c78f1c945e Disable "seek nearby targets" for new projects
It's really handy for certain types of programs, but it's a
distraction in many others.  I find myself turning it off for most
things.

Some changes will be needed in the tutorial, which makes use of
the feature.  (The "odds & ends" section discusses it in detail.)
I'm putting that off until other changes are in.
2024-08-01 09:08:18 -07:00
Andy McFadden ccead47529 Version 1.9.0-alpha1 2024-07-20 13:06:08 -07:00
Andy McFadden b6a5408fbc Fix MLC equality operator 2024-07-20 13:05:50 -07:00
Andy McFadden b946207e91 Tweak previous 2024-07-10 07:56:23 -07:00
Andy McFadden b913541da4 Fix handling of operand wrap len == 0
This was supposed to select the default wrap length, but was actually
returning zero, causing a crash when a project was opened if the
settings file didn't happen to have the value specified.
2024-07-09 16:10:00 -07:00
Andy McFadden ba9d6e7924 Version 1.9.0-dev3 2024-07-08 14:09:01 -07:00
Andy McFadden 5c6d1b5016 Project/platform syms for address table formatting
The address table formatter tries to map the calculated addresses
to offsets within the file.  When that fails, it currently just
gives up.

We now try to resolve external addresses to project/platform symbols.

(issue #160)
2024-07-08 10:09:38 -07:00
Andy McFadden 5a560aa9eb Fancy comments, part 5 (of 5)
Added a "format help" button to the long comment edit window.  This
brings up a quick summary of the format tags in a modal dialog.

Updated documentation and tutorial.
2024-07-07 18:12:29 -07:00
Andy McFadden 15d3d123a5 Fancy comments, part 4
Handle [box] and [url] tags.  Dropped [sym].
2024-07-07 16:04:35 -07:00
Andy McFadden 227cdaab30 Fancy comments, part 3
Handle [br], [hr], [hr char='x'], and [width=nn].
2024-07-07 08:48:58 -07:00
Andy McFadden 1c84357bbf Fancy comments, part 2
Started implementing the fancy formatter.  It currently doesn't do
anything fancy, just word-wrapping.

Moved the static DebugShowRuler field into Formatter, so that the
cached data is discarded when the setting changes.

Also, updated SourceNotes with instructions for publishing a release.
2024-07-06 15:01:24 -07:00
Andy McFadden 83da0d952c Fancy comments, part 1
Added a "fancy" flag to MultiLineComment.  If set, we will use
formatting commands embedded in the text itself.  The max width pop-up
and "boxed" flag will be ignored in favor of width and boxing
directives.  (See issue #111.)

The current "fancy" formatter is just a placeholder that folds lines
every 10 characters.

Removed FormattedMlcCache (added two changes back).  Caching the
rendered string list in the MLC itself is simpler and more efficient
than having a separate cache, and it works for Notes as well.

Added anchors for more comments in the 20090 test.
2024-07-04 17:25:21 -07:00
Andy McFadden 14cacb4274 Eliminate BoxLineCommentDelimiter
This was used to prefix boxed lines with a comment delimiter, but
in practice we just need to do this whenever the box character
doesn't match the full-line comment delimiter.

This has no effect on generated assembly output, but the on-screen
(and exported HTML) form will now reflect the current settings.
2024-07-04 10:32:24 -07:00
Andy McFadden 54d559ad50 Add formatted MLC cache
Multi-line comments (MLCs) can span multiple lines, and are formatted
with word-wrapping.  This isn't too expensive now, but languages
with immutable strings aren't ideal for this sort of thing.  Before
we introduce fancier formatting, we want to ensure that we're not
going to adversely affect rendering performance.

The cache entry for a given offset is tied to the MLC object and the
Formatter; if either are changed, the cached string list will not be
used.
2024-07-02 14:49:17 -07:00
Andy McFadden b1ca87e3c8 Fix Applesoft shape table visualizer
An edge case wasn't being handled correctly.
2024-06-28 13:45:57 -07:00
Andy McFadden 9784ad043e Use '*' for full-line Merlin comments
While it's okay to use ';', the classic Merlin editor will treat it
as an end-of-line comment and shove the entire thing off to the right
side of the screen.

This adds a configuration item to the app settings, with a default
value of ';'.
2024-06-26 10:54:46 -07:00
Andy McFadden 18674e6627 Rework Formatter.FormatConfig
It was defined as a struct with exposed fields.  Now it's a class
with simple properties.  Default values are set explicitly, and
the contents are copied with a copy constructor instead of using
the struct member assignment.

The only functional change should be that the DelimiterSet members
are now properly cloned.  The bulk of the changes are just refactoring
renames for the property names.

This also adds comments for all the properties.
2024-06-24 16:36:27 -07:00
Andy McFadden 967d468c58 Version 1.9.0-dev2 2024-06-01 13:52:08 -07:00
Andy McFadden c05b5b3a28 Fix sgmanual index 2024-06-01 13:40:34 -07:00
Andy McFadden 7ca11b0889 Use Merlin 32 "putbin" directive
I had missed the existence of Merlin 32's PUTBIN directive, which
provides the binary include feature.
2024-06-01 10:24:41 -07:00
Andy McFadden 4e5c34f457 Binary includes
This adds a new data format option, "binary include", that takes a
filename operand.  When assembly sources are generated, the section
of file is replaced with an appropriate pseudo-op, and binary files
are generated that hold the file contents.  This is a convenient way
to remove large binary blobs, such as music or sound samples, that
aren't useful to have in text form in the sources.

Partial pathnames are allowed, so you can output a sound blob to
"sounds/blather.bin".  For safety reasons, we don't allow the files
to be created above the project directory, and existing files will
only be overwritten if they have a matching length (so you don't
accidentally stomp on your project file).

The files are not currently shown in the GenAsm dialog, which lets
you see a preview of the generated sources.  The hex dump tool
can do this for the (presumably rare) situations where it's useful.

A new regression test, 20300-binary-include, has been added.  The
pseudo-op name can be overridden on-screen in the settings.

We don't currently do anything new for text/HTML exports.  It might
be useful to generate an optional appendix with a hex dump of the
excised sections.

(issue #144)
2024-05-31 14:22:39 -07:00
Andy McFadden fa5d9ba890 Version 1.9.0-dev1 2024-05-23 10:27:45 -07:00
Andy McFadden 3b20566b10 Minor tweaks
Note that address region isolation doesn't prevent explicit label
references from working (add update the test to prove it).

Added a note about pre-label xrefs.
2024-05-22 14:02:53 -07:00
Andy McFadden 7a7ff44d3a Address region isolation, part 3 (of 3)
If an address resolves to a user label in an isolated region, we
don't want to use it.  However, we still want to try to match it
to a project/platform symbol.

For example, suppose the isolated code wants to reference address
$1C00, which is a memory-mapped I/O location in one area, but a
regular bunch of code in the other.  We don't want it to map to
the regular code, but we do want it to resolve to our table of
platform I/O addresses.

We now handle this correctly.  The regression test has been updated
to check this.  The current implementation does a linear scan through
the symbol table, but I'm hoping this is not a common situation.

The reference manual has been updated to describe the new feature.
2024-05-21 14:14:32 -07:00
Andy McFadden e137db2b5c Address region isolation, part 2
Added an address-to-offset test in the GeneratePlatformSymbolRefs()
method, which sets the operand symbols for anything that lands outside
the scope of the file.  Because the region isolation code prevented
symbols from being associated with the operands in the initial code
scan, those operands were being examined here.  Without the additional
test, the inappropriate label associations were getting a second chance.

Added "[!in]" and "[!out]" to the comment field of .addrs lines.  This
is only for the on-screen display and text exports, not asm gen.

Bumped the project file CONTENT_VERSION.

Added a regression test (20290-region-isolation).

The test turned up an existing problem: pre-labels are emitted by the
asm generators on their own line, but the code that puts excessively
long labels on a separate line wasn't taking that into account.  This
has been fixed.  No changes to existing regression tests, which didn't
happen to use long labels.
2024-05-21 10:32:18 -07:00
Andy McFadden ea4ddc1071 Address region isolation, part 1
This adds a pair of flags to address regions that control how
address resolution is performed.

Generally, when we're trying to convert an address to a file offset,
we do a depth-first search through the hierarchy of address regions
to find a match.  For certain situations, such as multi-bank ROMs or
when code is executed in a separate subsystem, we don't want the
address resolver to specify an offset for something that's in a
different address space.

The search for a matching address starts from the region where the
address is referenced.  The flags will prevent the search from
progressing "outward" (to parent or sibling regions) or "inward"
(from parent or sibling regions).  Setting both flags effectively
makes the region an island.

Descending farther into the tree is not restricted by the "outward"
flag, i.e. addresses will still be found in child regions (assuming
they don't have the "disallow inward" flag set).

(issue #139)
2024-05-20 14:50:18 -07:00
Andy McFadden d6cfc83368 Disable "prefer 32 bit" build flag
The build flag causes the application to run as a 32-bit app on 64-bit
systems, which we don't want.  We're still using "Any CPU" as the
platform target, so it will continue to work on 32-bit x86 systems;
we just no longer force it to always be 32-bit.

This only affects the main .NET Framework application executable.
The setting is not relevant for the libraries.

(Note to future self: the way things work changed with .NET Core,
which requires different executables for different targets, specified
with the RID.  The older .NET Framework is Windows-only, which makes
it easier to have a single multi-target EXE.)
2024-05-09 10:03:08 -07:00
Andy McFadden 17bd80e39f Version 1.8.6 2024-05-05 15:23:47 -07:00
Andy McFadden ca38b7751c Tweak label file generation
Include an altered version of the uniquified local label, so that
VICE will keep the full set.

(issue #151)
2024-04-30 13:27:07 -07:00
Andy McFadden 948e4a2bf2 Update README.md
Mention Wine v9.
2024-04-22 17:50:15 -07:00
Andy McFadden aa05aa7a80 Version 1.8.6-dev1 2024-04-22 17:39:25 -07:00
Andy McFadden 47b11b6797 Document new label placement setting 2024-04-22 17:35:21 -07:00
Andy McFadden 9e82ff8b88 Make label files look more like cc65 output
The cc65 docs say VICE labels start with '.'.  Also, output local
labels prefixed with '@', per ca65 convention.  The default output
file is now "labels.lbl".

Added some minimal documentation.

(issue #151)
2024-04-22 15:09:23 -07:00
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 da91d9fc0e Allow arbitrary code list font sizes
The point size must be between 3 and 64, inclusive, just to avoid
doing anything too weird.  Also, added 14 to the drop-down.
2024-04-19 14:46:17 -07:00
Andy McFadden 8532cfb433 Rename menu item
Changed "File > Assemble" to "File > Generate Assembly".

Also, correctly mark a read-only text field as such.
2024-04-19 14:16:30 -07:00
Andy McFadden 9e9b12564e Merge pull request #156 from c64cryptoboy/pr_c64_io_symbols
Added C64 IO symbols
2024-04-08 08:03:05 -07:00
Andy McFadden 110a9ae818 Change the way app settings Apply button works
We were passing a reference to MainController in, and calling a
method on it, which is a little convoluted.  Now the main controller
subscribes to a "settings applied" event, and handles the update with
an event handler.

No change in behavior.
2024-03-02 14:48:06 -08:00
Andy McFadden c637d6549c Minor updates 2024-03-02 11:17:52 -08:00
Andy McFadden 1c79cddb47 Added note about wine-mono 2023-05-24 10:52:29 -07:00
Andy McFadden cee8fa3cbf Version 1.8.5 2023-05-12 15:56:43 -07:00
Andy McFadden a8aa871109 Version 1.8.5-dev2 2023-05-10 10:08:30 -07:00
Andy McFadden 2f603b69c3 Fix format overwrite test
A SOS binary had situation were an instruction was being reformatted
as inline data by an extension script.  The code that was supposed
to detect and prevent this had a bug that caused it to only look at
the first byte.  The resulting confusion caused the program to crash.

(issue #150)
2023-05-10 10:07:15 -07:00
Andy McFadden 7ebf976279 Fix display of Rockwell long op descrs 2023-05-04 17:29:57 -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 08243bf19c Remove unused PNG from project manifest 2023-03-30 17:25:19 -07:00
Andy McFadden 74cc55de29 Tweak grid border 2023-02-15 20:48:57 -08:00
Andy McFadden f46d8f4920 Merge branch 'master' of https://github.com/fadden/6502bench 2023-02-14 14:04:52 -08:00
Andy McFadden d22d35c4df Version 1.8.5-dev1 2023-02-14 14:04:30 -08:00
Andy McFadden 31d4bf8bfa Fix transparency in C64 visualizer
GIF only allows for one transparent palette entry.

(issue #145)
2023-02-14 14:03:38 -08:00
Andy McFadden 3ffca60066 Update README.md 2023-01-30 16:20:50 -08:00
Andy McFadden edc92cf5d6 Version 1.8.4 2023-01-09 09:14:28 -08:00
Andy McFadden a83b0e73da Version 1.8.4-dev2 2023-01-05 08:57:51 -08:00
Andy McFadden 7adec9f725 Increase JSON size limit for project files
The JavaScriptSerializer class throws an exception if the JSON data
exceeds a certain size.  The default limit is 2MB, which is relatively
easy to hit because of the verbosity of the serialized data.

Super Mario Bros needs about 1MB of JSON for a binary with 32KB + gfx.
Using that as a guide, we need 32x the source file size for a
thoroughly-documented project.  We currently limit the max binary size
to 1MB for practical reasons, so a cap of 32MB should cover us.

This change raises the limit to 64MB, with a slightly higher limit on
the deserialization side because we add newlines for readability.

This is more of a workaround than a fix, but it should do for now.

(issue #137)
2023-01-05 08:45:26 -08:00
Andy McFadden 58d794f535 Increase C64 font char count limit to 512 2023-01-04 10:09:28 -08:00
Andy McFadden 4f64a936ed Add URL to NOTICE file 2022-12-31 16:04:54 -08:00
Andy McFadden 426db27b5a Version 1.8.4-dev1 2022-07-31 09:44:35 -07:00
Andy McFadden 5d7503686c Minor regression test fix 2022-07-31 09:41:37 -07:00
Andy McFadden c1a8ce519e Merge pull request #133 from absindx/symbol-snes-coprocessor
Added SNES coprocessor symbol file
2022-07-09 11:04:24 -07:00
Andy McFadden dcab984f3b Fix formatting 2022-05-23 15:45:25 -07:00
Andy McFadden 072c66bc8c Update README.md 2022-05-22 13:13:42 -07:00
Andy McFadden 80ffd5f534 Update README.md 2022-05-22 12:59:04 -07:00
Andy McFadden 4c60f329c7 Tweak SourceNotes 2022-05-22 12:48:41 -07:00
Andy McFadden ce1a6d0109 Version 1.8.3 2022-05-18 08:23:32 -07:00
Andy McFadden b8314b7f30 Version 1.8.3-dev3 2022-05-01 11:10:37 -07:00
Andy McFadden 8b1e70fa58 Expand C64 sprite visualizer
Added fonts and sprite sheets.  Updated documentation.
2022-05-01 11:09:41 -07:00
Andy McFadden 663a3d0230 Version 1.8.3-dev2 2022-05-01 09:03:46 -07:00
Andy McFadden 0878854759 Fix crash in font picker
It's possible to have multiple fonts with the same font family.
Don't use the list add method that throws an exception when it
finds a duplicate key.
2022-04-29 09:00:01 -07:00
Andy McFadden 6e52f9986c Version 1.8.3-dev1 2022-04-06 14:24:53 -07:00
Andy McFadden d9fe0b5471 Fix crash in OMF converter tool
The OMF converter calls some of the project update routines at a
point where the data file hasn't been fully formed, making it a bit
fragile.
2022-04-06 14:20:11 -07:00
Andy McFadden 0ad30521ec Version 1.8.2 2022-03-07 14:57:28 -08:00
Andy McFadden 42fe037b55 Update copyright date in "about" 2022-03-02 09:37:18 -08:00
Andy McFadden 13dca8b78c More tweaks to def sym editing
If you edit an existing symbol, the "is the label unique" test will
always false-positive match itself, so we have to explicitly handle
that case.  Dialogs like Edit Instruction Operand make things a bit
more complicated because they don't flush results to the symbol
table immediately, which means the symbol we pass into the Edit Def
Symbol dialog to edit isn't necessarily the one we need to exclude
from the label uniqueness test.

The dialog was using the initial value as both "original" and
"initial", which caused some issues.  We now pass both values in.

Also, removed some dead code identified by VS.
2022-03-02 08:13:46 -08:00
Andy McFadden 1e8205159e Version 1.8.2-dev1 2022-02-28 15:12:50 -08:00
Andy McFadden ca3b6a9adb Fix crash when editing project symbol
The recent tweaks to improve operand editing broke a common case
when creating a project symbol.

Also, tweaked the operand edit case a little more, for the case where
the operand's symbol was entered manually.
2022-02-28 15:03:09 -08:00
Andy McFadden ef6173fba6 Migrate to Visual Studio Community 2022
Minor change to solution.  Removed CodeLab project stub, which was
still targeting .NET Framework 4.6.1.

The other projects with WPF code target 4.6.2, and I haven't updated
them to 4.8 out of a fear that it might make 6502bench harder to
install on older systems.  The down side is that it requires an
extra "dev pack" download to build the source code.  4.8 is the end
of the line for .NET Framework, so at some point we should make that
the official target.
2022-02-27 10:42:43 -08:00
Andy McFadden 16cbe5b108 Version 1.8.1 2022-01-22 20:43:00 -08:00
Andy McFadden 740eeff843 Fix display of non-addressable symbols in HTML export
If a symbol is marked as "exported", it is added to the symbol table
generated at the end of the HTML output.  If the symbol identifies a
non-addressable location, we need to show that.

Also, added a header row.
2022-01-12 15:44:29 -08:00
Andy McFadden 55c80fb642 Improve double-click handling in symbols window
Double-clicking on an entry in the symbols window is supposed to take
you to the place where that symbol is defined.  This worked for code
labels but not for project/platform symbols.  We now jump to the
appropriate EQU statement, if one exists.
2022-01-12 15:28:59 -08:00
Andy McFadden 60b024d24e Improve instruction operand edit edge case
The instruction operand editor has a shortcut button for editing a
project symbol.  Attempting to change the comment field twice
without closing the operand editor in between would result in a
complaint about duplicate symbol names.
2022-01-12 14:17:28 -08: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 75ccffe393 Update visualization bitmap API
The existing API was better suited to direct color than indexed
color.  The NES visualizer was using a slightly silly hack to avoid
duplicate colors; this has been removed.
2022-01-12 11:48:20 -08:00
Andy McFadden 92f304a030 Minor fixes
Escape '_' in filenames for the recents menu.

Fix status flag update for ROL.
2021-12-23 11:29:29 -08:00
Andy McFadden 27b47b9783 Version 1.8.1-dev1 2021-12-02 11:22:00 -08:00
Andy McFadden 865a5e58f7 Highlight local variable uses
When a single line is selected in a local variable table, highlight
the operands of every instruction that references that variable.
2021-11-25 13:53:25 -08:00
Andy McFadden b942c24ef2 Tweak web site 2021-11-21 11:23:24 -08:00
Andy McFadden 4ac8d32b7c Update README.md 2021-11-21 11:22:08 -08:00
Andy McFadden 2513a017c5 Add 6502disassembly.com to the README 2021-11-21 11:20:07 -08:00
Andy McFadden cf4086ae26 Add GetPixelIndex() to VisBitmap8 2021-11-17 21:37:41 -08:00
Andy McFadden 5a400ab738 Change highlight region
The ListView style was using "Stretch" for TextBoxes in the code list,
which caused the background of the entire address / label / operand
field to be drawn in the highlight color, rather than just the area
covered by the text.  This is fine for address and label, but it just
felt weird for the operand field because that tends to be very wide
(to accommodate strings, bulk hex data, etc).

There doesn't seem to be a way to specify HorizontalContentAlignment
per-column in WPF.  (Note this is different from HorizontalAlignment,
which *is* is a per-column property.)

This changes the style to use HorizontalContentAlignment=Left, so
the highlight just covers the text.  The only time this causes a
functional change is when you highlight an operand for a line that
doesn't have a label, because instead of highlighting an empty
rectangle you now see nothing at all.  (The address field is still
highlighted though.)
2021-11-17 11:40:36 -08:00
Andy McFadden 33aa0ff004 Add operand highlighting
When a code or data line is selected in the code list, if the operand
is an address inside the file, we highlight the address and label.
It's also useful to highlight the other way: when a code or data line
is selected, find all lines whose operands reference it, and highlight
the operand field.

This is a little trickier because there can be multiple references,
but all of the information we need is in the cross-reference table.
2021-11-17 11:18:23 -08:00
Andy McFadden 8c5509d69d Update "digging deeper" tutorial
The tutorial was creating a new address region at +000002 without
removing the previous one, which leaves the 16-bit file load address
sitting at $1000 when it should be non-addressable.  The text now
shows the correct procedure.  Some screen shots had to be recaptured
to show the greyed-out address field.

This doesn't change anything meaningful about the disassembly -- the
PRG optimization hides the region start/end markers either way -- but
it's more correct this way, and it's an opportunity to introduce
the use of non-addressable regions for file headers.
2021-11-14 11:20:48 -08:00
Andy McFadden 399d799ce8 Version 1.8.0 2021-11-14 09:24:40 -08:00
Andy McFadden 399a54efa7 Fix bit rot in sample
Also, use the "uninitialized data" feature in the amper-fdraw
project.
2021-11-14 09:21:15 -08:00
Andy McFadden 4537f24958 Rework tutorial for changes in v1.8
Biggest changes were to the address region handling in Tutorial1
and the use of StdInline.cs for the inline strings in Tutorial4.

Also, fixed the off-by-one error in Tutorial1.
2021-11-14 09:02:53 -08:00
Andy McFadden 713bb74cc0 Update Apple II ROM symbols 2021-11-14 08:24:55 -08:00
Andy McFadden 8d9a27ae0c Minor word-smithing on Tips
Also, tweaked the HTML templates.
2021-11-13 15:46:59 -08:00