1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-13 14:29:23 +00:00
Commit Graph

188 Commits

Author SHA1 Message Date
Andy McFadden
5fb1fb3240 Set owner of status flags edit window
The XAML code specified it to be placed centered on the owner's window,
but we weren't actually setting the owner.
2021-06-03 17:16:07 -07:00
Andy McFadden
011181d848 Work around minor column width update issue
If you changed the width of a column, and then clicked the "toggle
display of cycle counts" button in the toolbar, the column width
would revert.  The problem appears unique to that toolbar button,
so for now the fix is localized there.  The more general fix is to
ensure that column width changes don't get stomped, but that's a
larger change.
2021-06-03 15:03:22 -07:00
Andy McFadden
49f4017410 Rename "hints" to "analyzer tags"
Variables, types, and comments have been updated to reflect the new
naming scheme.

The project file serialization code is untouched, because the data
is output as serialized enumerated values.  Adding a string conversion
layer didn't seem worthwhile.

No changes in behavior.

(issue #89)
2020-10-15 16:55:29 -07:00
Andy McFadden
908a1c9900 Rename "hint" in UI and documentation
Before:
 Hint As Code Entry Point
 Hint As Data Start
 Hint As Inline Data
 Remove Hints

After:
 Tag Address As Code Start Point
 Tag Address As Code Stop Point
 Tag Bytes As Inline Data
 Remove Analyzer Tags

The goal is to reduce confusion.  The old nomenclature was causing
problems because it's inaccurate -- they're directives, not hints --
and made it look like you need to mark data items explicitly.  The
new action names emphasize the idea that you should be tagging a
single address for start/stop, not blanketing a region.

This change updates the user interface, manual, and tutorials, but
does not change how the items are referred to in code, and does not
change how the program works.

(issue #89)
2020-10-14 15:02:53 -07:00
Andy McFadden
34ba47e71d Add W65C02S support, part 3
Modified the asm source generators and on-screen display to show the
DP arg for BBR/BBS as hex.  The instructions are otherwise treated
as relative branches, e.g. the DP arg doesn't get factored into the
cross-reference table.

ACME/cc65 put the bit number in the mnemonic, 64tass wants it to be
in the first argument, and Merlin32 wants nothing to do with any of
this because it's incompatible with the 65816.

Added an "all ops" test for W65C02.
2020-10-11 14:35:17 -07:00
Andy McFadden
b60dc4fee4 Add W65C02S support, part 1
We were claiming W65C02S, but it turns out that CPU has the Rockwell
extensions and the STP/WAI instructions.  We need to change existing
references to be "WDC 65C02", and add a new CPU definition for the
actual W65C02S chip.

This adds the new CPU definition, the instruction definitions for
the Rockwell extensions, and updates the selectors in project properties
and the instruction chart tool.

This change shouldn't affect any existing projects.  Still more to do
before W65C02 works though, mostly because the Rockwell instructions
introduced a new two-argument address mode that has to be handled in
various places.
2020-10-10 15:46:34 -07:00
Andy McFadden
b962d8715d Add toolbar button for "show cycle counts"
Sometimes you just want to turn cycle counts on for a bit, and going
through app settings is tiresome.  Now there's a toolbar checkbox
for it.  The icon isn't ideal, but it'll do.
2020-09-04 17:49:28 -07:00
Andy McFadden
7c506dceb6 Add Ctrl+Enter as a way to close the LVTable edit dialog
When editing local variables, the data grid generally has the input
focus, so hitting Enter doesn't close the dialog.  Rather than play
games with the focus, just take Ctrl+Enter as a shortcut to close
the dialog (same as notes and long comments).

(I found myself hitting Ctrl+Enter automatically, and being annoyed
when it didn't work, so I figured I'd make it official.)
2020-08-27 17:09:18 -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
94d7a30a09 Expand "apply platform symbols" feature
This experimental feature applied platform symbols to the project,
setting labels where the platform symbol's address matched an internal
address.  The feature now applies project symbols as well, and has
been renamed to "apply external symbols".

We now report the number of labels set.
2020-07-28 10:56:07 -07:00
Andy McFadden
c380b001b7 Put focus on code list after opening project
Setting the focus allows certain key commands (like up/down arrows)
to work without having to click in the code list first.
2020-07-25 11:35:27 -07:00
Andy McFadden
1e7a6620e0 Make project properties window resizable
Useful for the project symbols tab.  The size is retained for the
current session, but resets when the program exits.
2020-07-24 17:14:15 -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
a3c7cd0cf9 Add File > Reload External Files
The new menu item reloads platform symbol files and extension scripts,
which is very handy when making edits to project files.
2020-07-19 16:59:41 -07:00
Andy McFadden
195c93a94a Reboot sandbox when required
Another chapter in the never-ending AppDomain security saga.

If a computer goes to sleep while SourceGen is running with a project
open, life gets confusing when the system wakes up.  The keep-alive
timer fires and a ping is sent to the remote AppDomain, successfully.
At the same time, the lease expires on the remote side, and the objects
are discarded (apparently without bothering to query the ILease object).
This failure mode is 100% repeatable.

Since we can't prevent sandbox objects from disappearing, we have to
detect and recover from the problem.  Fortunately we don't keep any
necessary state on the plugin side, so we can just tear the whole
thing down and recreate it.

The various methods in ScriptManager now do a "health check" before
making calls into the plugin AppDomain.  If the ping attempt fails,
the AppDomain is "rebooted" by destroying it and creating a new one,
reloading all plugins that were in there before.  The plugin binaries
*should* still be in the PluginDllCache directory since the ping failure
was due to objects being discarded, not AppDomain shutdown, and Windows
doesn't let you mess with files that hold executable code.

A new "reboot security sandbox" option has been added to the DEBUG
menu to facilitate testing.

The PluginManager's Ping() method gets called more often, but not to
the extent that performance will be affected.

This change also adds a finalizer to DisasmProject, since we're relying
on it to shut down the ScriptManager, and it's relying on callers to
invoke its cleanup function.  The finalizer throws an assertion if the
cleanup function doesn't get called.

(Issue #82)
2020-07-19 13:20:18 -07:00
Andy McFadden
4928dfd872 Tweak security menu items
Changed "Use Keep-Alive Hack" to "Disable Keep-Alive Hack" to emphasize
that it defaults to enabled.  Added a menu item for "Disable Security
Sandbox".  Added a warning to both that tells the user that they must
reopen the current project for the change to take effect.

Note neither of these is persisted in app settings.
2020-07-18 13:47:01 -07:00
Andy McFadden
ad02494f0f Default to source bank in Format Address Table
When formatting a table of 16-bit addresses in 65816 code, the bank
byte was always being set to zero.  However, for "JMP (addr,X)", the
program bank is used.  We now default to that behavior.

The choice can be overridden as before (select 24-bit addresses with a
constant value for the bank byte).
2020-07-16 13:26:13 -07:00
Andy McFadden
eecace8988 Tweak column widths for clipboard and Export default
The old values were pretty optimistic in terms of the length of labels.
Short labels in all caps are very retro but sort of annoying to read,
so most disassemblies use longer ones.  The new defaults are more
accommodating for the way labels are actually used.
2020-07-16 10:48:03 -07:00
Andy McFadden
c5d764d11f SGEC update, part 1
This is still an "experimental" feature, but it's getting expanded
a bit.  The implementation now lives in its own class.  An "export"
feature that generates SGEC data has been added.  The file extension
has been changed from ".sgec" to ".txt" to make it simpler to edit
under Windows.
2020-07-15 16:18:02 -07:00
Andy McFadden
2a2aadffec Data Bank Register management, part 5
Update documentation.  Add some information about OMF relocation
data as well.

Fix bug in B=K handling.
2020-07-10 13:29:36 -07:00
Andy McFadden
0929077fda Data Bank Register management, part 4
Implemented "smart" PLB handling.  If we see PHK/PLB, or 8-bit
LDA imm/PHA/PLB, we create a data bank change item.  The feature
can be disabled with a project property.
2020-07-09 19:42:31 -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
973d162edb Data Bank Register management, part 2
Changed basic data item from an "extended enum" to a class, so we can
keep track of where things come from (useful for the display list).

Finished edit dialog.  Added serialization to project file.
2020-07-09 11:14:55 -07:00
Andy McFadden
18e6951f17 Add Data Bank Register management, part 1
On the 65816, 16-bit data access instructions (e.g. LDA abs) are
expanded to 24 bits by merging in the Data Bank Register (B).  The
value of the register is difficult to determine via static analysis,
so we need a way to annotate the disassembly with the correct value.
Without this, the mapping of address to file offset will sometimes
be incorrect.

This change adds the basic data structures and "fixup" function, a
functional but incomplete editor, and source for a new test case.
2020-07-08 17:56:27 -07:00
Andy McFadden
d58b747571 Use relocation data to format instruction operands
This was a relatively lightweight change to confirm the usefulness
of relocation data.  The results were very positive.

The relatively superficial integration of the data into the data
analysis process causes some problems, e.g. the cross-reference table
entries show an offset because the code analyzer's computed operand
offset doesn't match the value of the label.  The feature should be
considered experimental

The feature can be enabled or disabled with a project property.  The
results were sufficiently useful and non-annoying to make the setting
enabled by default.
2020-07-03 17:58:41 -07:00
Andy McFadden
d979571880 Remove "Atari Arcade Cabinet" system definition
The handful of 6502-based Atari coin-op systems were very different
from each other, so having a dedicated entry doesn't make sense.

Also, enable word-wrap in the New Project text box that holds the
system description.
2020-07-01 11:06: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
5026fd6569 First step toward Apple IIgs OMF file handling
This lays a bit of groundwork for an OMF file analyzer / viewer.
2020-06-23 17:21:18 -07:00
Andy McFadden
c47beffcee Add Export feature to visualization editor
It's nice to be able to save images from the visualization editor
for display elsewhere.  This can be done during HTML export, but
that's inconvenient when you just want one image, and doesn't allow
the output size to be specified.

This change adds an Export button to the Edit Visualization dialog.
The current bitmap, wireframe, or wireframe animation can be saved
to a GIF image.  A handful of sizes can be selected from a pop-up
menu.
2020-06-20 17:32:57 -07:00
Andy McFadden
bb830a29db Add Navigate > Jump to Operand
If you double-click on the opcode of an instruction whose operand is
an address or equate, the selection jumps to that address.  This
feature is now available in the Navigate menu, with the keyboard
shortcut Ctrl+J.

While testing the feature I noticed that the keyboard focus wasn't
following the selection, so if you jumped to an address and then
used the up/down arrows, you jumped back to the previous location.
(This was true when double-clicking an opcode to jump; it was just
less noticeable since the next action was likely mouse-based.)  This
has been fixed by updating the ListView item focus when we jump to a
new location.

See also issue #63 and issue #72.
2020-06-07 16:37:41 -07:00
Andy McFadden
71af8bf117 Change PETSCII keyboard shortcut
Alt+P was clashing in Edit Instruction Operand, so use Alt+T instead.
2020-05-05 21:40:42 -07:00
Andy McFadden
ea379fce18 Consolidate wireframe data validation
Some tests were duplicated between VisWireframe and the code that
consumed the data.  We now expose the Validate function as a public
interface, and invoke it from WireframeObject.  Failed validation
results in a null object being returned, which was previously allowed
but not actually checked for.
2020-04-23 11:25:45 -07:00
Andy McFadden
3820bfee8b Set initial focus to appropriate field for project properties
If you double-click a project symbol declaration, the symbol editor
opens.  I found that I was double-clicking on the comment field and
typing with the expectation that the comment would be updated, but
it was actually setting the initial focus to the label field.

With this change the symbol editor will focus the label, value, or
comment field based on which column was double-clicked.

The behavior for Actions > Edit Project Symbol and other paths to the
symbol editor are unchanged.

Also, disabled a wayward assert.
2020-04-23 11:01:07 -07:00
Andy McFadden
6d582c80d3 Add simple SGEC reader
SourceGen Edit Commands is a feature that allows you to generate
commands into a file and have SourceGen apply them to the current
project.  I'm not expecting this to be used by anyone but me, so
for now I'm just adding an entry to the debug menu that can read
comments out of a file.

Also, fixed a bug in the re-centering min/max code that prevented
it from working on trivial shapes.

Also, renamed the atari-avg visualizer to atari-avg-bz, with the
expectation that one day somebody might want to create a variant
for newer games.
2020-04-13 17:33:34 -07:00
Andy McFadden
356492d6da Add Atari AVG visualizer
This converts AVG commands to wireframes.  We don't try to track
color or intensity.  (This is a disassembler, not a graphics
converter; perfection is not required.)  The various rotation and
animation options are still enabled, though they're not terribly
useful for this.

Commands that are meant to be used in series, such as font glyphs,
tend to use (0,0) as their left edge and baseline.  This puts the
shape in the upper-right corner of the thumbnail, which makes
everything smaller.  The change adds a "re-center" option to the
wireframe renderer that computes the visible bounds and adjusts
the coordinates so that the center of the object is at (0,0) for
display.
2020-04-11 17:24:21 -07:00
Andy McFadden
5010fbae37 Various minor changes
- Freeze Note brushes, so HTML export doesn't blow up when it tries
  to access them.
- Add Ctrl+Shift+E as keyboard shortcut for File > Export.
- For code/data percentage, count inline data as data.
- Tweak code/data percentage text.
- Document Merlin32 '{' bug.
- Tweak tutorial text.
2020-03-30 16:50:52 -07:00
Andy McFadden
c0de0a8844 Allow custom colors in Notes
The data structure and project file have always supported arbitrary
ARGB colors.  Now the editor does as well.
2020-03-13 13:58:52 -07:00
Andy McFadden
58ba6008a5 Bump a couple of copyright dates
Not really necessary, but they were on the same screen and didn't
agree with each other, which felt weird.
2020-03-11 17:02:37 -07:00
Andy McFadden
4221602e12 Minor tweaks to wireframe viewer
Experimented with different orders of rotation for wireframe viewer.
Made perspective projection the default behavior.  Removed animation
parameters from the stored Visualization when it's not animated.
2020-03-11 16:23:52 -07:00
Andy McFadden
ecb22ef9a4 Use previous edit values as default
The visualization editor uses the parameters from the most recent
edit as the defaults when creating a new visualization.  This change
extends the behavior to the view controls for wireframes.
2020-03-11 10:12:39 -07:00
Andy McFadden
01d64f79b7 Relocate Matrix/Vector code to lib where plugins can use it
Also, tweak the perspective projection scaling to fill out the area
a bit more, and change the visualization editor to use the grid's
size when setting the path dimensions.

Also, note gimbal lock.
2020-03-10 17:20:54 -07:00
Andy McFadden
971301d5b8 Fix object timeout
Remember how object references from plugins are proxy objects that
time out if you don't access them for a while?  I didn't either.

This reshuffles the code to keep WireframeObject references rather
than IVisualizationWireframe.
2020-03-10 11:23:18 -07:00
Andy McFadden
8c01f383e5 Implement wireframe animation
You can view the animated wireframe with the "test" button in the
visualization editor, and export it as an animated GIF.
2020-03-09 13:56:20 -07:00
Andy McFadden
b68e39ab6b Progress toward wireframe animations
Handle the remaining visualization editor UI controls, except for
the "test" button.  Save/restore wireframe animations in the
project file.  Changed the preview from a 1-pixel-wide line drawn
by a path half the window size to a 2-pixel-wide line drawn by a
path the exact window size.
2020-03-08 17:05:08 -07:00
Andy McFadden
7e92a86ffa Progress toward wireframe animations
Moved X/Y/Z rotation out of the plugin, since it has nothing to do
with the plugin at all.  (Backface removal and perspective projection
are somewhat based on the data contents, as is the choice for
whether or not they should be options.)

Added sliders for X/Y/Z rotation.  Much more fun that way.

Renamed VisualizationAnimation to VisBitmapAnimation, as we're not
going to use it for wireframe animation.  Created a new class to
hold wireframe animation data, which is really just a reference to
the IVisualizationWireframe so we can generate an animated GIF
without having to pry open the plugin again.

Renamed the "frame-delay-msec" parameter, which should start with
an underscore to ensure it doesn't clash with plugin parameters.
If we don't find it with an underscore we check again without for
backward compatibility.
2020-03-07 17:05:08 -08:00
Andy McFadden
b686d2d208 Add rotation and backface culling
Also, correctly update the thumbnail when leaving the visualization
editor.
2020-03-06 16:51:47 -08:00
Andy McFadden
eec847d5f1 Implement basic wireframe rendering
We extract the data from the wireframe visualization, perform a
trivial transform, and display it.  The perspective vs.
orthographic flag in the parameters is respected.  (No rotation or
backface removal yet.)

Also, increased the thumbnail sizes in the visualization set editor
list from 48x48 to 64x64, because the nearest-pixel-scaled 48x48
looks nasty when used for wireframes.
2020-03-03 19:37:51 -08:00
Andy McFadden
bd0b20dc2f Add wireframe thumbnail generation
I did a bunch of experiments to characterize line drawing.  Long
story short: end points are inclusive, and coordinates should be
offset by +0.5 to avoid anti-aliasing effects.
2020-03-03 16:20:55 -08:00
Andy McFadden
38ca9005c4 Progress on wireframe visualization
Added some more plumbing.  Updated visualization set edit dialog,
which now does word-wrapping correctly in the buttons.  Added Alt+V
as the hotkey for Create/Edit Visualization Set, which allows you
to double-tap it to leap into the visualization editor.

Experimented with Path drawing, which looks like it could do just
what we need.

Also, show the file size in KB in the code/data/junk breakdown at the
bottom of the window.  (Technically it's KiB, but that looked funny.)
2020-03-01 18:34:34 -08:00