1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-12 08:29:29 +00:00
Commit Graph

846 Commits

Author SHA1 Message Date
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
Andy McFadden
75a86fbbc3 Fix crash
The code that sets and removes analyzer tags allows you to select a
mix of lines.  If the mix included the header comment, the negative
file offset would cause a crash.
2021-11-13 15:45:49 -08:00
Andy McFadden
d597c386c7 Version 1.8.0-beta1 2021-11-04 16:32:14 -07:00
Andy McFadden
fdf2a0777c Fix trailing backslash issue
If an end-of-line comment ended with '\', the code that "prettifies"
the JSON output would get confused, and would start inserting \r\n
after commas inside comment strings.  This didn't corrupt the project
files, but it did make them look funny, and required manual cleanup.

Added a sample.  This won't catch regressions of this particular
problem because it only happens when you save the file, but if
nothing else it'll act as documentation.
2021-11-04 15:11:59 -07:00
Andy McFadden
3ea07f3eb7 Tweak comment entry UI
End-of-line comments have a couple of guidelines: keep it short, and
don't use non-ASCII characters.  Violating these isn't an error, so
we should be making the text blue rather than red.
2021-11-03 20:23:27 -07:00
Andy McFadden
e622afd929 Tweak DVG visualizer
Adopted the naming conventions from the "Hitch-Hacker's Guide" doc.
Updated some comments.  No change in behavior.
2021-11-03 08:58:17 -07:00
Andy McFadden
d48ab7582f Add Atari DVG visualizer
The DVG format, used for vector games like Asteroids, is the
predecessor to the AVG graphics used in games like Battlezone.

Also, added some extended error checks on wireframe vertices.

Also, minor edits to the README and daily tips.
2021-11-02 08:54:07 -07:00
Andy McFadden
07f5396eee Ignore project/platform symbols in StdInline
External symbols don't have a file offset, so a JSR to an external
address can't reliably be matched to a label.
2021-10-27 20:23:34 -07:00
Andy McFadden
fa04c98dac Correct StdInline behavior for overlapping addresses
The implementation was mapping labels to addresses, then formatting
inline data at the matching address.  This may be incorrect when there
are multiple sections of the file mapped to the same address.  The
correct approach is to record the offsets of the matching labels, and
then do an address-to-offset translation for each JSR.

Also, show a note in the Info window when a JSR has been marked
no-continue by an extension script.

Also, updated Daily Tips.
2021-10-27 16:48:25 -07:00
Andy McFadden
a04557762d Fix keyboard nav after selection jump
If you change the selection by double-clicking in one of the side
windows (References, Notes, Symbols, Messages) and then attempt
to navigate with the arrow keys, the program will appear to hang
briefly, then jump to the start or end of the project and shift the
window focus to something else (like the Help menu in the menu bar).

For reasons I don't fully understand, the behavior is fixed by
removing unnecessary calls to codeListView.Focus().  The calls were
intended to shift input focus to the main ListView, but they're no
longer necessary, and appear to upset WPF.

(issue #113)
2021-10-25 15:45:42 -07:00
Andy McFadden
c59ad5b426 Fix MULTI_MASK pattern for NES PPU flags 2021-10-24 21:22:28 -07:00
Andy McFadden
236cf1d4a3 Allow leading whitespace in .sym65 comments
We allow empty lines and lines that begin with ';' in .sym65.  Lines
with nothing but whitespace, or comments with leading whitespace,
caused a warning.  It can be aesthetically nice to line up the start
of comments, and lines with pointless whitespace aren't problematic,
so we now allow these without complaint.

Added some samples to the 20170-external-symbols data file.  No
change to the test output.
2021-10-24 14:12:45 -07:00
Andy McFadden
6e9ff395d2 Add offset to PlSymbol
It's useful for extension scripts to be able to get the file offset
of symbols in non-addressable regions.  One example of this is CHR
ROM data for an NES cartridge.  However, we were getting the offset
by doing an address-to-offset mapping on the plugin side, which by
definition doesn't work for non-addressable memory.

So we now add the offset to PlSymbol objects for user labels and
address region pre-labels.  The NES visualizer has been updated to
use the new field.

Also, fixed a bogus complaint about bank overruns for non-addressable
regions.
2021-10-23 21:35:30 -07:00
Andy McFadden
1258dd89cb Version 1.8.0-alpha1 2021-10-23 10:57:56 -07:00
Andy McFadden
fa0d88c069 Fix Merlin code gen issue with '{'
Merlin 1.0 chokes on "LDA #'{'".
2021-10-23 10:56:21 -07:00
Andy McFadden
cd937709fa Tweak address region edit dialog
Altered the address region edit UI a little to improve clarity.

Also, close the hex dump viewer window when Escape is hit.  (The
tool windows don't have "cancel" buttons, so the key has to be
handled explicitly.)
2021-10-20 09:06:53 -07:00
Andy McFadden
22c47e1d0b Update reference manual formatting
Switched from XHTML to HTML5.  Added formatting for menu items and
keyboard shortcuts.

Made various minor edits to the text.
2021-10-18 17:56:08 -07:00
Andy McFadden
55f0230e6f Don't use "not" as a label in ACME output
The ACME assembler gets upset if you use "not" as a label.  We now
avoid doing so, using a generalized implementation of the opcode
mnemonic rename code.  (Issue #112.)

Renamed a label to "not" in the 20081-label-localizer test.
2021-10-18 13:04:10 -07:00
Andy McFadden
0fb0b4cca8 Fix some address region issues
Fixed a crash when the listing is refreshed while a .adrend line is
the only thing selected.

Fixed .adrend lines being spammed if the last thing before it is a
multi-byte item, and you edit a comment / note / label on that line.
Harmless, but weird.

Also, added keyboard shortcuts in DefSymbol editor, so you can change
from address to constant with Alt+C.
2021-10-17 18:02:29 -07:00
Andy McFadden
e30c60cb14 Version 1.8.0-dev2 2021-10-16 14:49:51 -07:00
Andy McFadden
d7dbd8d012 Minor tweak to instruction operand editor
If you put a value in the "symbol" field of an instruction with an
address operand, you're establishing a symbolic reference to a label
that may be at a different address than the numeric value of the
operand.  But if you then hit the "edit label" button, you'll edit
the label at the *numeric* reference address, which can be confusing.
We now disable the create/edit label button when the format has been
set to "symbol".

The button is just a short-cut, so disabling it doesn't prevent the
user from doing anything.
2021-10-16 14:46:13 -07:00
Andy McFadden
5ee01ee8a4 Add "StdInline" extension script
Inline strings and 16-bit addresses are sufficiently common that a
general-purpose extension script is useful.
2021-10-16 13:19:21 -07:00
Andy McFadden
adf5726f62 Add daily tips to start screen
The initial screen is largely blank, with just the four large buttons
for new/open/recent1/recent2.  It now also has a "tip of the day" box,
with text and an optional image.

The tips and images are kept in the RuntimeData directory.  They're
small enough that they could have been baked into the binary, but
there's enough other stuff going on there that it didn't seem
necessary.  Also, if the tips annoy you, removing the tips file will
hide the tip UI.

The index of the tip shown is based on the day of the year, modulo
the number of defined tips.  So it will be different every day (with
a bit of hand-waving at the end of the year).
2021-10-16 09:15:28 -07: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
09eba228dd Add "remove formatting" action
This action removes operand formatting from all code and data in the
selected range.  In most cases this is equivalent to simply editing
the various items and clicking the "default" format radio button,
but the feature can be used to remove data formats that end up inside
multi-byte instructions.  Instructions with such formats cause warnings
and were tricky to fix.

Labels embedded in multi-byte items are also tricky to remove, so this
clears those as well.  It does not remove visible labels.  This is
done in a single pass, which means that labels that would become visible
after the formatting is cleared will still be removed.

Also, fix inclusion of address range end lines when restoring the
selection.  Their peculiar nature -- being associated with the offset
of the last byte of multi-byte items -- was interfering with the
selection save code.  This does not add them to the selection when
an address region deletion is undone, since technically they weren't
part of the selection.

Also, moved Edit Note higher in the Actions menu.
2021-10-12 13:04:34 -07:00
Andy McFadden
6df29e562f Various tweaks
Changed the code that generates cross-references for pre-labels to
ignore labels in regions with non-addressable parents.  Also, changed
the code that complains about references to labels in non-addressable
areas to ignore pre-labels, because it was complaining about references
to pre-labels on region starts that were followed by a non-addressable
region start.

In the address region edit dialog, split up the descriptive text for
the "resize" option to make it easier to see the new end offset and
length.  It doesn't look quite right because it's not using the mono
font like the text near the top, but it'll do.

When multiple lines are selected, the Info window now shows the first
line/offset, last line/offset, and bytes spanned by the selection.
This is helpful if you're trying to figure out how big something is.
2021-10-11 14:44:44 -07:00
Andy McFadden
387b50d827 Implement IsRelative for cc65/merlin32
Added support for "relative" address regions to the Merlin 32 and cc65
code generators.  These generate "flat" address directives, and so
were a little more complicated.

Suppressed generation of relative operands for non-addressable regions.

Also, tweaked the 20250-nested-regions test to include a negative
relative region offset.
2021-10-09 10:08:14 -07:00
Andy McFadden
f56e4f2bec Version 1.8.0-dev1 2021-10-08 12:33:32 -07:00