1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-30 15:29:01 +00:00
Commit Graph

462 Commits

Author SHA1 Message Date
Andy McFadden
226ba7c9a3 Serialize animations to project file
We now store Visualizations, VisualizationAnimations, and
VisualizationSets as three separate lists linked by tag strings.

WARNING: this breaks existing projects with visualizations.  The
test projects have been updated.
2019-12-22 16:56:57 -08:00
Andy McFadden
4b19a029a9 Allow visualizations to be repeated in an animation
The UI was moving items from the source list to the animation list,
but there's no reason why the same thing can't appear more than once.

You can no longer hit "Add" repeatedly to add multiple consecutive
items, but you can now multi-select in the source list to add several
things at once.
2019-12-22 14:43:07 -08:00
Andy McFadden
4e645d911c Render the animation overlay image instead of loading from a file
Mostly because I'm a lousy artist, and if I do it in code it's easy
to make it symmetric and tweak the colors.
2019-12-22 14:02:39 -08:00
Andy McFadden
12293d3cf8 More progress on animated visualizations
Bitmap animations are composed of a sequence of other visualizations.
This is all well and good until a visualization is deleted, at which
point all animations in all sets in the entire project have to be
checked and potentially changed, and perhaps even removed (if all of
the animation's members have been removed).  This turns out to be
kind of annoying to deal with, but it's better to deal with it in
code than force the user to manually update broken animations.

This change adds thumbnails for the animations, currently generated
by offscreen composition.  This approach doesn't work quite right.
2019-12-21 18:13:36 -08:00
Andy McFadden
fef7668b63 Progress on animated visualizations
Visualization editor dialog is fully functional.  Add/remove,
up/down, tag/interval timer editing, and animated preview are now
working.
2019-12-20 15:09:57 -08:00
Andy McFadden
9f9e518afc Groundwork for animated Visualizations
This adds a new class and a rough GUI for the editor.  Animated
visualizations take a collection of bitmaps and display them in
sequence.  (This will eventually become an animated GIF.)

Fixed the issue where changes to tags in the set currently being
edited weren't visible to the tag uniqueness check when editing other
items in the same set.
2019-12-17 17:43:56 -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
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
8b20021c4d Show visualization bitmap dimensions
The preview window scales freely, so it's hard to know how big the
actual pixels are.
2019-12-11 22:12:20 -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
13f7ae4b70 Minor UI tweaks
- Show the full path in the tooltip for the two "recent project"
  buttons shown on the launch panel.
- Reset the app title bar and status bar contents when the project
  is closed.
2019-12-07 13:55:11 -08:00
Andy McFadden
b8e092cede Version 1.5.0-dev2 2019-12-07 13:08:00 -08:00
Andy McFadden
e82678126f Various minor tweaks
Added comments, renamed files, removed cruft.

Stop showing the visualization tag name in the code list.  It's
often redundant with the code label, and it's distracting.  (We may
want to make this an option so you can Ctrl+F to find a tag.)
2019-12-07 11:42:26 -08:00
Andy McFadden
ed66e129cd Add C64 sprite visualization generator
Handles high-resolution and multi-color sprites.  The visualization
can be doubled in height and/or width.

I created some test sprites with SpritePad.
2019-12-06 21:25:31 -08:00
Andy McFadden
3c541089a7 Tweak Atari 2600 visualizer
Changed "row duplication" to a straight "row thickness".  Feels more
intuitive.
2019-12-06 17:54:18 -08:00
Andy McFadden
5635a1e33a Add Atari 2600 sprite/playfield visualizer
First swing at a visualizer for Atari 2600 sprites and playfields.
Won't necessarily present an accurate view of what is displayed on
screen, but should provide a reasonable shape for data stored in
the obvious way.

The Adventure playfields looked squashed, so I added a simple row
duplication value.

Also, minor improvements to visualizers generally:
- Throw an exception, rather than an Assert, in VisBitmap8 when the
  arguments are bad.
- Show the exception in the Visualization Edit dialog.
- If generation fails and we don't have an error message, show a
  generic "stuff be broke" string.
- Set focus on OK button in Visualization Set Edit after editing,
  so you can hit Enter twice after renaming a tag.
2019-12-06 17:33:29 -08:00
Andy McFadden
1cdb31de32 Visualizer improvements
Various changes:
- Generally treat visualization sets like long comments and notes
  when it comes to defining data region boundaries.  (We were doing
  this for selections; now we're also doing it for format-as-word
  and in the data analyzer when scanning for strings/fill.)
- Clear the visualization cache when the address map is altered.
  This is necessary for visualizers that dereference addresses.
- Read the Apple II screen image from a series of addresses rather
  than a series of offsets.  This allows it to work when the image
  is contiguous in memory but split into chunks in the file.
- Put 1 pixel of padding around the images in the main code list,
  so they don't blend into the background.
- Remember the last visualizer used, so we can re-use it the next
  time the user selects "new".
- Move min-size hack from Loaded to ContentRendered, as it apparently
  spoils CenterOwner placement.
2019-12-06 15:05:49 -08:00
Andy McFadden
af4ec49c9b Document visualizations 2019-12-06 13:41:17 -08:00
Andy McFadden
4696132dfa Make visualization edit window resizable
The preview window changes size to match, providing an easy way to
get a "zoomed in" view of the image.
2019-12-05 21:52:50 -08:00
Andy McFadden
b56bdb7743 Split operand selection set at visualizations
Also, added a colStride/rowStride test to Apple II bitmap test.
Removed ClunkyColor.  Made color conversion mode selectable for
debugging.
2019-12-05 14:04:38 -08:00
Andy McFadden
4bf1ab2799 Tweak visualizer interface
Report visualization generation errors through an explicit
IApplication interface, instead of pulling messages out of the
DebugLog stream.

Declare that GetVisGenDescrs() is only called when the plugin is in
the "prepared" state, so that plugins can taylor the set based on
the contents of the file.  (This could be used to set min/max on
the "offset" entries, but I want special handling for offsets, so
we might as well set it later.)
2019-12-05 10:29:00 -08:00
Andy McFadden
4ef1d7e7c7 Implement Apple II hi-res bitmap font and screen image visualizers
Bitmap fonts are a series of (usually) 1x8 bitmaps, which we arrange
into a grid of cells.

Screen images are useful for embedded screens, or for people who want
to display stand-alone image files as disassembly projects.
2019-12-04 18:05:17 -08:00
Andy McFadden
df04de61e6 Improve visualization
Various improvements:
- Switched to ReadOnlyDictionary in Visualization to make it clear
  that the parameter dictionary should not be modified.
- Added a warning to the Visualization Set editor that appears when
  there are no plugins that implement a visualizer.
- Make sure an item is selected in the set editor after edit/remove.
- Replaced the checkerboard background with one that's a little bit
  more grey, so it's more distinct from white pixel data.
- Added a new Apple II hi-res color converter whose output more
  closely matches KEGS and AppleWin RGB.
- Added VisHiRes.cs to some Apple II system definitions.
- Added some test bitmaps for Apple II hi-res to the test directory.
  (These are not part of an automated test.)
2019-12-04 15:59:37 -08:00
Andy McFadden
2f56c56e5c Add visualization thumbnails
Thumbnails are now visible in the main list and in the visualization
set editor.  They're generated on first need, and regenerated when
the set of plugins changes.

Added a checkerboard background for the visualization editor bitmap
preview.  (It looks all official now.)
2019-12-03 16:11:21 -08:00
Andy McFadden
125080dbda Finish basic visualization editor implementation
The Visualization and Visualization Set editors are now fully
functional.  You can create, edit, and rearrange sets, and they're
now stored in the project file.
2019-12-02 16:38:32 -08:00
Andy McFadden
365864ccdf More progress on visualization
Implemented Apple II hi-res bitmap conversion.  Supports B&W and
color.  Uses essentially the same algorithm as CiderPress.

Experimented with displaying non-text items in ListView.  I assumed
it would work, since it's the sort of thing WPF is designed to do,
but it's always wise to approach with caution.  Visualization Sets
now show a 64x64 button as a placeholder for the eventual thumbnail.

Some things were being flaky, which turned out to be because I
wasn't Prepare()ing the plugins before using them from Edit
Visualization.  To make this a deterministic failure I added an
Unprepare() call that tells the plugin that we're all done.

NOTE: this breaks all existing plugins.
2019-11-30 18:02:03 -08:00
Andy McFadden
9244ceda7c More progress on visualization
Added some rudimentary bitmap creation code.  Got a test pattern
generated by the plugin to display in the app.  (Most of the time
required for this was spent figuring out how bitmaps are handled
in WPF.)
2019-11-27 17:17:30 -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
836626bdc3 Work in progress on visualization
Basic infrastructure for taking a list of parameters from a plugin
and turning it into a collection of UI controls, merging in values
from a Visualization object.  Doesn't yet do anything useful.

WPF makes the hard things easy and the easy things hard.  This was
a hard thing, so it was easy to do (with some helpful sample code).
Yay WPF?
2019-11-25 14:27:38 -08:00
Andy McFadden
bef664ae7e Don't do nearby SYM-1 for zero-page values
It's pretty common for code to access BUFFER-1,X, but it's rare for
the buffer to live on zero page memory.  More often than not we're
auto-formatting zero-page operands with a nearby symbol when they're
just simple variables.  It's more confusing than useful, so we don't
do that anymore.
2019-11-23 16:27:06 -08:00
Andy McFadden
ac30512ed3 Groundwork for visualization sets
Placeholder data structure plus menu command, undoable change, etc.
2019-11-22 20:45:57 -08:00
Andy McFadden
d8170c50d3 Show code/data/junk percentages in status bar
Not necessarily useful, but sort of interesting.
2019-11-19 18:18:41 -08:00
Andy McFadden
e43b7233d9 Version 1.5.0-dev1 2019-11-19 14:03:16 -08:00
Andy McFadden
ade3403b9f Tweak documentation 2019-11-19 13:43:42 -08:00
Andy McFadden
ff68409398 Add Apply Platform Symbols experimental feature
This turns platform symbols into address labels.  Useful for things
like system ROM images that have an established set of entry points.
2019-11-19 13:31:04 -08:00
Andy McFadden
97a5623599 Label rework, part 7 (of 7)
Updated documentation for non-unique label changes.  Added a new
section to tutorial #1.

Updated examples to use non-unique labels and variable tables.

Tweaked the EditLabel radio button names.
2019-11-18 17:45:41 -08:00
Andy McFadden
d3670c48e8 Label rework, part 6
Correct handling of local variables.  We now correctly uniquify them
with regard to non-unique labels.  Because local vars can effectively
have global scope we mostly want to treat them as global, but they're
uniquified relative to other globals very late in the process, so we
can't just throw them in the symbol table and be done.  Fortunately
local variables exist in a separate namespace, so we just need to
uniquify the variables relative to the post-localization symbol table.
In other words, we take the symbol table, apply the label map, and
rename any variable that clashes.

This also fixes an older problem where we weren't masking the
leading '_' on variable labels when generating 64tass output.

The code list now makes non-unique labels obvious, but you can't tell
the difference between unique global and unique local.  What's more,
the default type value in Edit Label is now adjusted to Global for
unique locals that were auto-generated.  To make it a bit easier to
figure out what's what, the Info panel now has a "label type" line
that reports the type.

The 2023-non-unique-labels test had some additional tests added to
exercise conflicts with local variables.  The 2019-local-variables
test output changed slightly because the de-duplicated variable
naming convention was simplified.
2019-11-18 13:36:53 -08:00
Andy McFadden
88c56616f7 Label rework, part 5
Implemented assembly source generation of non-unique local labels.
The new 2023-non-unique-labels test exercises various edge cases
(though we're still missing local variable interaction).

The format of uniquified labels changed slightly, so the expected
output of 2012-label-localizer needed to be updated.

This changes the "no opcode mnemonics" and "mask leading underscores"
functions into integrated parts of the label localization process.
2019-11-17 16:05:51 -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
68c324bbe8 Label rework, part 4
Update the symbol lookup in EditInstructionOperand, EditDataOperand,
and GotoBox to correctly deal with non-unique labels.

This is a little awkward because we're doing lookups by name on
a non-unique symbol, and must resolve the ambiguity.  In the case of
an instruction operand that refers to an address this is pretty
straightforward.  For partial bytes (LDA #>:foo) or data directives
(.DD1 :foo) we have to take a guess.  We can probably make a more
informed guess than we currently are, e.g. the LDA case could find
the label that minimizes the adjustment, but I don't want to sink a
lot of time into this until I'm sure it'll be useful.

Data operands with multiple regions are something of a challenge,
but I'm not sure specifying a single symbol for multiple locations
is important.

The "goto" box just finds the match that's closest to the selection.
Unlike "find", it always grabs the closest, not the next one forward.
(Not sure if this is useful or confusing.)
2019-11-16 16:44:08 -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
be65f280a3 Minor tweaks
- Renamed "strip label prefix/suffix" to "omit label prefix/suffix".

- Changed a Merlin operand workaround so it doesn't apply to code
  that is explicitly not in bank zero.

- Changed {addr}/{const} annotations on project/platform symbol
  equates so they line up a little better on screen and in exported
  sources.
2019-11-15 16:24:07 -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
4d079c8d14 Label rework, part 1
This adds the concept of label annotations.  The primary driver of
the feature is the desire to note that sometimes you know what a
thing is, but sometimes you're just taking an educated guess.
Instead of writing "high_score_maybe", you can now write "high_score?",
which is more compact and consistent.  The annotations are stripped
off when generating source code, making them similar to Notes.

I also created a "Generated" annotation for the labels that are
synthesized by the address table formatter, but don't modify the
label for them, because there's not much need to remind the user
that "T1234" was generated by algorithm.

This also lays some of the groundwork for non-unique labels.
2019-11-08 21:02:15 -08:00
Andy McFadden
b4519b2aa2 Update NES symbols
The PPU registers are mirrored from $2000-3FFF.
2019-11-08 07:53:28 -08:00
Andy McFadden
ceb07c809e Check for bank overrun
If an address map entry wraps around the end of a bank, add a note
to the message log.  This is Error level, since some assemblers
will refuse to handle it.
2019-11-05 13:29:51 -08:00
Andy McFadden
6a8d6950e5 Add change discard confirmation to project properties editor
It's too easy to hit Escape after making a bunch of changes, so
now we ask for confirmation.

(Might make sense to make this strictly an Esc guard, and not
pester the user if they actually hit the Cancel button or close
box.  I'm not convinced though; Esc+Enter isn't terrible.)
2019-11-04 17:41:33 -08:00
Andy McFadden
6411df7ff9 Add toolbar button for "Go to Last Change"
Also, updated a couple of comments.
2019-11-04 15:22:56 -08:00
Andy McFadden
0a0208409a Tweak line folding code
Some style guides say you should only put one space between
sentences, but I and many others still put two.  The line-folding
code was only eating one of them when they straddled the end of the
line, which looked a little funny because the following line was
indented by one space.

This tweaks the code to eat both spaces.  Regression test updated.

Also, nudge some UI elements so they line up.
2019-11-01 19:47:56 -07:00
Andy McFadden
b4213de4c0 Add "Go to Last Change" feature
Jumps to the first offset associated with the change at the top of
the Undo stack.  We generally jump to the code/data offset, not the
specific line affected.  It's possible to do better (and we do, for
Notes), but probably not worthwhile.
2019-11-01 19:11:48 -07:00
Andy McFadden
2ddd3b400d Workaround for GridSplitter lockup
As noted in issue #52, the side panels can't be resized once the
ListView gets focus.  The root of the problem is a workaround for a
selection problem that involves catching the Item Container
Generator's Status Changed event, and setting an item's focus.  It
appears that changing the size of the ListView causes the
StatusChanged event to fire, which cause the handler to grab the
focus, which causes the splitters to stop moving after one step.

This change adds a workaround that prevents the original workaround
from doing anything while a splitter is in the process of being
dragged.  It doesn't solve all problems -- you can't move the
splitters more than one step with the keyboard -- but it allows them
to be dragged around with the mouse.

There's got to be a better way to deal with this.
2019-11-01 11:14:49 -07:00
Andy McFadden
0c02b3ebe3 Version 1.4.0 2019-10-30 15:50:09 -07:00
Andy McFadden
1136759c98 Tweak the tutorial 2019-10-30 15:40:03 -07:00
Andy McFadden
f61f1022e1 Collapse the "offset" line in the info window for non-DEBUG 2019-10-30 14:30:03 -07:00
Andy McFadden
4b46b78e34 Rearrange the tutorial files
Copied the extension script tutorial files out of the Scripts
directory and into the Tutorial directory.  This makes more sense,
and makes it possible to expand the script sample without altering
the tutorial.

Reverted the Scripts sample to be an actual sample, rather than a
tutorial.

Renumbered the last two tutorials and added them to the ToC.  This
gives them actual numbers rather than treating them as add-ons to
the advanced tutorial.

Moved the source files for the tutorial binaries into a subdirectory
to reduce clutter.

This does mean we have two separate copies of the inline string
sample plugins, but that's an artifact of our attempts at security.
2019-10-30 09:49:11 -07:00
Andy McFadden
51081c5db0 Tweak "nearby" label finder
The code that found a nearby data target for an instruction operand
was searching backward but not forward.  We now take one step
forward, so that "LDA TABLE-1,Y" fills in automatically.

This altered 2008-address-changes, which had just this situation.
It didn't alter 2010-target-adjustment, but the existing tests were
insufficient and have been improved.
2019-10-29 18:12:22 -07:00
Andy McFadden
7000a5094e Fix crashing bug in selection management
The fix for Shift+F3 required briefly switching the code list view
to single-select mode.  Unfortunately, while in that mode the
control throws an exception if you touch SelectedItems (plural)
rather than SelectedItem (singular), and in an unusual case the
selection-changed event handler was doing just that.
2019-10-29 18:09:01 -07:00
Andy McFadden
14ecad0849 Improve handling of hidden LV tables
If a local variable table gets buried, it won't appear in the code
list, so most things ignore it.  Unfortunately, the code that adds
new entries and edits tables was finding them, which was causing
variable definitions to appear to fall into a black hole.

This is addressed in two ways.  First, we now add a message to the
log when a hidden table is noticed.  Second, the code that finds
the nearest prior table now keeps track of hidden vs. not hidden.
If a non-hidden table is available, that is returned.  If the only
option is a hidden table, we will return that, because the callers
have already assumed that a table exists by virtue of its presence
in the LvTable list.
2019-10-28 16:54:01 -07:00
Andy McFadden
73f04ef2d2 Update comments, remove unused var 2019-10-27 21:29:44 -07:00
Andy McFadden
b508fa6b4a Version 1.4.0-beta1 2019-10-27 21:17:54 -07:00
Andy McFadden
99d088e800 Mention the message log in the tutorial 2019-10-27 21:17:28 -07:00
Andy McFadden
70353c82e1 Limit value range of project address symbols
Project symbol address values are now limited to positive 24-bit
integers, just as they are for platform symbols.  Constants may
still be 32-bit values.
2019-10-27 15:36:47 -07:00
Andy McFadden
819a363178 Move SPEEDZ from F8-ROM to Applesoft
It's an Applesoft thing.
2019-10-27 11:12:22 -07:00
Andy McFadden
0fc121c9cb Add ability to "erase" previously-defined platform symbols
While disassembling some code I found that I wanted the ROM entry
points, but the zero page usage was significantly different and the
ROM labels were distracting.  Splitting the symbol file in two was
a possibility, but I'm afraid this will lead to a very large
collection of very small files, and we'll lose any sense of relation
between the ROM entry points and the ZP addresses used to pass
arguments.

Platform symbols have the lowest priority when resolving by address,
but using that to hide the unwanted labels requires creating project
symbols or local variables for things that you might not know what
they do yet.  It's possible to hide a platform symbol by adding
another symbol with the same label and an invalid value.

This change formalizes and extends the "hiding" of platform symbols
to full erasure, so that they don't clutter up the symbol table.
This also tightens up the platform symbol parser to only accept
values in the range 0 <= value <= 0x00ffffff (24-bit positive
integers).

An "F8-ROM-nozp" symbol file is now part of the standard set.  A
project can include that to erase the zero-page definitions.

(I'm not entirely convinced this is the right approach, so I'm not
doing this treatment on other symbol files... consider this an
experiment.  Another approach would be some sort of conditional
inclusion, or perhaps erase-by-tag, but that requires some UI work
in the app to define what you want included or excluded.)
2019-10-27 11:09:16 -07:00
Andy McFadden
0709ff94de Fix visibility binding 2019-10-27 10:38:29 -07:00
Andy McFadden
c49888331a Minor tweaks
- Allow user to "unnecessarily" set an address override.  This is
  a handy thing to do when dealing with code that does a lot of
  relocations.

- Moved "save needed" text to the end of the title string.

- Updated F8-ROM syms.

- Added ProDOS 8 error code constants
2019-10-26 23:34:51 -07:00
Andy McFadden
d99eec0d4f Open damaged projects in read-only mode
If we detect a problem that requires intervention during loading,
e.g. we find unknown elements because we're loading a file created
by a newer version, default to read-only mode.

Read only mode (1) refuses to apply changes, (2) refuses to add
changes to the undo/redo list, and (3) disables Save/SaveAs.  The
mode is indicated in the title bar.

Also, flipped the order of items in the title bar so that "6502bench
SourceGen" comes last.  This allows you to read the project name in
short window title snippets.  (Visual Studio, Notepad, and others
do it this way as well.)
2019-10-26 13:20:54 -07:00
Andy McFadden
6344ea59bb Add Apple-1 symbols
From a post on comp.sys.apple2:
https://groups.google.com/d/msg/comp.sys.apple2/SBBdH1ChMwQ/mnygA3WVEAAJ
2019-10-26 08:28:49 -07:00
Andy McFadden
2466090efe Version 1.4.0-alpha1 2019-10-25 18:17:25 -07:00
Andy McFadden
00612097f6 Minor updates
Add a link to the web site in the About box.

Add an up-link to the HTML export template.

Escape '<', '>', and '&' in the Applesoft to HTML converter.
2019-10-25 18:16:09 -07:00
Andy McFadden
8505a5cdd4 Add an Applesoft to HTML converter
This is not an official thing, so I'm hiding it in the DEBUG menu
for now.
2019-10-23 17:49:59 -07:00
Andy McFadden
eb99a716f1 Add scripts and inline data to tutorials
Added an inline data formatting section to Tutorial2.

Added a new section on extension scripts, using Scripts/Sample as
the code.
2019-10-23 14:52:52 -07:00
Andy McFadden
1844fcb8b7 Fix junk alignment check
While adding a message log entry for failing alignment directives,
I noticed that the assembler source generator's test for valid
alignment was allowing some bad alignment values through.

I'm holding off on reporting the message to the log because not all
format changes cause a data-reanalysis, which means the log entry
doesn't always appear and disappear when it should.  If we decide
this is an important message we can add a scan for "softer" errors.
2019-10-23 13:25:50 -07:00
Andy McFadden
4ed2558f9f Experiment with showing character value next to default data
Doesn't seem useful in practice.  If I find a good use case it might
be worth making it an option.
2019-10-23 13:02:31 -07:00
Andy McFadden
9d5f8f8049 Add a blank line between constants and addresses
In the assembler output, add a blank line between the constants
and addresses in the long list of equates.

The earlier change that corrected the BIT instruction caused test
2009-branches-and-banks to fail, because it was relying on the idea
that BIT made the carry flag indeterminate.  Changing a BCC to a
BVS restored the desired behavior.
2019-10-22 22:45:13 -07:00
Andy McFadden
4c43b4063a Tweaks 2019-10-22 22:23:22 -07:00
Andy McFadden
630f7f0f87 Improve the "info" panel
Not a huge improvement, but things are slightly more organized, and
there's a splash of color in the form of a border around the text
describing the format of code and data lines.

Added an "IsConstant" property to Symbol.
2019-10-22 21:27:49 -07:00
Andy McFadden
463fbff368 Show load address in Edit Address dialog
Sometimes code relocates a few bits of itself but not others.  We
don't currently have a way to say, "go back to where we would have
been".  As a cheap alternative, we now show the "load address", i.e.
where we'd be if there were no address map entries after the first.
2019-10-22 13:58:32 -07:00
Andy McFadden
1b0ee7de21 Fix display of instruction attributes
The "affected flags" constants were incorrect for BIT, BRK, COP,
RTI, XCE, and the undocmented instructions ANE, DCP, and SAX.  The
constants are used for the changed-flag summary shown in the info
window and the instruction chart.

Of greater import: the status flag updater for BIT was incorrectly
marking N/V/C as indeterminate instead of N/V/Z.  The undocmented
instructions ANE, DCP, and SAX were also incorrect.

The cycle counts shown in line comments are computed correctly, but
the counts shown in the info window and instruction chart were
displaying the full set of modifiers, ignoring the CPU type.  That's
okay for the info window, which spells the modifiers out, though
it'd be better if the bits were explicitly marked as being applicable
to the current CPU or a different one.
2019-10-22 10:48:02 -07:00
Andy McFadden
7bbccaf71f Minor tweaks
Mark the "info" window as read-only.

When the project closes, clear the contents of the Symbols and
Notes windows.

Clarify some Apple II I/O definitions.
2019-10-21 17:43:40 -07: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
81dbab04ba Add message list, part 1
This converts the "problem list viewer" tool to a grid that appears
below the code list view when non-empty.  Not all messages are
problems, so it's being renamed to "message list".
2019-10-20 14:40:32 -07:00
Andy McFadden
3cc6f32c6f Put some stuff in a "Navigate" menu
Created a Navigate menu, and put the menu items for Find and Go To
in it.  Added menu items for nav-forward and nav-backward, which
until now were only available as toolbar buttons.
2019-10-19 17:46:40 -07:00
Andy McFadden
b6e571afc2 Correctly handle embedded instruction edge case
This began with a change to support "BRK <operand>" in cc65.  The
assembler only supports this for 65816 projects, so we detect that
and enable it when available.

While fiddling with some test code an assertion fired.  This
revealed a minor issue in the code analyzer: when overwriting inline
data with instructions, we weren't resetting the format descriptor.

The code that exercises it, which requires two-byte BRKs and an
inline BRK handler in an extension script, has been added to test
2022-extension-scripts.

The new regression test revealed a flaw in the 64tass code
generator's character encoding scanner that caused it to hang.
Fixed.
2019-10-19 17:28:45 -07:00
Andy McFadden
e5da5ced95 Version 1.4.0-dev2 2019-10-19 11:17:09 -07:00
Andy McFadden
a902f69aea Update A2-Zippy example
The ZipChip GS register definitions can take advantage of the new
I/O direction feature.  Pulling them out into a .sym65 makes sense.
2019-10-19 10:16:02 -07: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
f31b7f5822 Fix constants declared with MULTI_MASK
The masks should only be applied to address symbols.  We were
rejecting constants that didn't match the pattern.
2019-10-18 16:19:42 -07:00
Andy McFadden
716dce5f28 Pass operand to extension script JSR/JSL handlers
Sort of silly to have every handler immediately pull the operand out
of the file data.  (This is arguably less efficient, since we now
have to serialize the argument across the AppDomain boundary, but
we should be okay spending a few extra nanoseconds here.)
2019-10-17 13:15:25 -07:00
Andy McFadden
c8dfa94ce2 Change find-previous hotkey to Shift+F3
The range-select behavior that was giving us problems can be worked
around by switching the control to single-select mode when changing
the selection.
2019-10-17 12:51:45 -07:00
Andy McFadden
bd11aea4a4 External symbol I/O direction and address mask, part 3 (of 3)
Added regression tests.  Improved error messages.  Updated
documentation.
2019-10-16 17:32:30 -07:00
Andy McFadden
4d8ee3fd07 External symbol I/O direction and address mask, part 2
First cut at lookup-by-address implementation.  Seems to work, but
needs full tests.
2019-10-16 14:55:10 -07:00
Andy McFadden
9c3422623d External symbol I/O direction and address mask, part 1
Memory-mapped I/O locations can have different behavior when read
vs. written.  This is part 1 of a change to allow two different
symbols to represent the same address, based on I/O direction.

This also adds a set of address masks for systems like the Atari
2600 that map hardware addresses to multiple locations.

This change updates the data structures, .sym65 file reader,
project serialization, and DefSymbol editor.
2019-10-15 19:12:57 -07:00
Andy McFadden
fac2d6a51f Invoke extension scripts when labels they care about change
We were failing to update properly when a label changed if the label
was one that a plugin cared about.  The problem is that a label
add/remove operation skips the code analysis, and a label edit skips
everything but the display update.  Plugins only run during the code
analysis pass, so changes weren't being reflected in the display
list until something caused it to refresh.

The solution is to ask the plugin if the label being changed is one
that it cares about.  This allows the plugin to use the same
wildcard-match logic that it uses elsewhere.

For efficiency, and to reduce clutter in plugins that don't care
about symbols, a new interface class has been created to handle the
"here are the symbols" call and the "do you care about this label"
call.

The program in Examples/Scripts has been updated to show a very
simple single-call plugin and a slightly more complex multi-call
plugin.
2019-10-13 18:32:53 -07:00
Andy McFadden
3702448780 Correctly handle a label update edge case
Test case:
 1. create a label FOO
   (can be referenced or unreferenced)
 2. add a platform symbol file that also defines FOO
   (the platform symbol will be masked by the user label)
 3. rename FOO to BAR
   (platform symbol should appear)
 4. hit "undo"
   (platform symbol should disappear)
 5. delete label FOO
   (platform symbol should appear)
 6. hit "undo"
   (platform symbol should disappear)

This will fail to update the display list properly, and/or crash
when we try to add FOO to a symbol table that already has a
symbol with that label.

The problem is the optimization that tries to avoid running the
data analysis pass if we're just renaming a user label.  We need to
check to see if the rename overlaps with project/platform symbols,
because we need to update the active def symbol set in that case.

To avoid the crash, we just need to use table[key]=value syntax
instead of table.Add(key,value).
2019-10-13 15:53:46 -07:00
Andy McFadden
76efbcfcbe Rename button text 2019-10-13 15:21:05 -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
547ecd2173 Update comments 2019-10-12 17:18:04 -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
94a7f2e8fb Replace '#' with '_' in .html filename
If you link to the file without escaping the '#', the browser will
think it's an anchor inside the page.  Easier on everyone to just
alter the filename.
2019-10-10 14:00:52 -07:00
Andy McFadden
6d886ecc3a Change some EQU handling
Changed the sort order on EQU lines so that constants come before
address definitions.  This caused trivial changes to three of the
regression tests.

Added the ability to jump directly to an EQU line when an opcode
is double-clicked on.
2019-10-10 13:49:21 -07:00
Andy McFadden
475c31b886 Tweak navigation
If you select a local variable, double-click on a reference entry,
and then hit "back", you aren't taken back to the correct place in
the local variable table.  This is annoying if you're trying to
explore how a local variable is used.

The NavStack Location object now has a "line delta" that can be
applied to position the selection correctly.  This isn't stable
across undo/redo, but it solves the common cases.

This makes LineListGen's "Top" class redundant, so uses of that have
been replaced with Location.
2019-10-10 11:57:36 -07:00
Andy McFadden
3a67c14247 Add "find previous"
The Find box now has forward/backward radio buttons.  Find Next
searches forward, and Find Previous searches backward, regardless
of the direction of the initial search.

The standard key sequence for "find previous" is Shift+F3.  The WPF
ListView has some weird logic that does something like: if you hit
a key, and the selection changes, and the shift key was held down,
then you must have meant to select a range.  So Shift+F3 often (but
not always) selects a range.  I think this might be fixable if I can
figure out how ListView keeps track of the current keyboard
navigation position (which is not the same as the selection).  For
now I'm working around the problem by using Ctrl+F3 to search.
Yay WPF.
2019-10-09 17:47:07 -07:00
Andy McFadden
dfd5bcab1b Optionally treat BRKs as two-byte instructions
Early data sheets listed BRK as one byte, but RTI after a BRK skips
the following byte, effectively making BRK a 2-byte instruction.
Sometimes, such as when diassembling Apple /// SOS code, it's handy
to treat it that way explicitly.

This change makes two-byte BRKs optional, controlled by a checkbox
in the project settings.  In the system definitions it defaults to
true for Apple ///, false for all others.

ACME doesn't allow BRK to have an arg, and cc65 only allows it for
65816 code (?), so it's emitted as a hex blob for those assemblers.
Anyone wishing to target those assemblers should stick to 1-byte mode.

Extension scripts have to switch between formatting one byte of
inline data and formatting an instruction with a one-byte operand.
A helper function has been added to the plugin Util class.

To get some regression test coverage, 2022-extension-scripts has
been configured to use two-byte BRK.

Also, added/corrected some SOS constants.

See also issue #44.
2019-10-09 14:55:56 -07:00
Andy McFadden
b8e11215fa Add separate button for adding symbols+scripts from project
The "add platform symbol file" and "add extension script" buttons
create a file dialog with the initial directory set to the
RuntimeData directory inside the SourceGen installation directory.
This is great if you're trying to add a file from the platform
definitions, but annoying if you're trying to add it from the
project directory.

It's really convenient to not have to hunt around though, so now
there are two buttons: one for platform, one for project.  The
latter is disabled if the project is new and hasn't been saved yet.
2019-10-09 13:24:09 -07:00
Andy McFadden
e1a9100a8f Fully style the code list view
We were changing the control template for lines with long comments
and notes, matching the default Win10 style.  This got ugly when a
non-default theme was being used, particularly "dark" themes,
because the long-comment lines looked significantly different from
everything else.

We now fully specify the style for the ListView and ListViewItems,
which means everybody's main window now looks like the default Win10
style.  Which is unfortunate, but significantly easier than creating
a full set of theme-specific styles.

We now specify black text for highlighted address/label fields,
because they otherwise become illegible when we apply our background
highlight color.  In the Notes window, we set the background of
un-highlighted entries to white, so that we can always read it with
black text.

Addresses issue #50.
2019-10-09 11:50:33 -07:00
Andy McFadden
98ebf449ef Tweak comments
Useful comments need to be on each line, so that they appear in the
disassembly listing.
2019-10-08 17:46:00 -07:00
Andy McFadden
c519a58962 Version 1.4.0-dev1 2019-10-08 13:32:14 -07:00
Andy McFadden
b5d1881cf0 Add inline string script sample
Also, updated LZ4FH sample, which needed to have explicit widths on
a couple of zero-page pointers.

Also, updated Zippy sample, which had a ton of unnecessary format
entries for a couple of pointers.
2019-10-08 10:44:49 -07:00
Andy McFadden
86c4331cce Add issues & limitations for scripts to manual
Also, note in the code where we're discarding the compiler error
messages.
2019-10-07 17:56:35 -07:00
Andy McFadden
57d8514faa Format ProDOS 8 parameter blocks
If it's a known function, apply basic numeric formatting to the
various fields.  Primarily of value for the pathname and buffer
parameters, which are formatted as addresses.

Also, enable horizontal scrolling in the generic show-text dialog.
2019-10-07 15:42:40 -07:00
Andy McFadden
dc8e49e4d8 Exercise address-to-offset function in plugin
Also exercise various formatting options.

Also, fix a bug where the code that applies project/platform symbols
to numeric references was ignoring inline data items.
2019-10-07 14:21:26 -07:00
Andy McFadden
245e0bd9f3 Make address translation available to extension scripts
The current AddressMap is now passed into the plugin manager, which
wraps it in an AddressTranslate object and passes that to the
plugins at Prepare() time.  This allows plugins to convert addresses
to offsets, making it possible to format complex structures.

This breaks existing plugins.
2019-10-06 18:13:39 -07:00
Andy McFadden
997242361a Relocate AddressMap to CommonUtil
This allows us to use it in plugins.
2019-10-06 17:32:20 -07:00
Andy McFadden
8c87ce3004 Check formatted string structure at load time
If we have a bug, or somebody edits the project file manually, we
can end up with a very wrong string, such as a null-terminated
string that isn't, or a DCI string that has a mix of high and low
ASCII from start to finish.  We now check all incoming strings for
validity, and discard any that fail the test.  The verification
code is shared with the extension script inline data formatter.

Also, added a comment to an F8-ROM symbol I stumbled over.
2019-10-06 17:07:07 -07:00
Andy McFadden
c4fe759efc Merge branch 'hotfix/1.3.2' 2019-10-06 15:31:37 -07:00
Andy McFadden
bfe2abd173 Version 1.3.2 2019-10-06 15:30:33 -07:00
Andy McFadden
710a8dc679 Init all FormattedParts strings fields to an empty string
Fixes issue #51.
2019-10-06 15:24:22 -07:00
Andy McFadden
1980a475ca Init all FormattedParts strings fields to an empty string
Fixes issue #51.
2019-10-06 14:38:49 -07:00
Andy McFadden
1908dab360 Recompile extension scripts when dependencies are updated
All plugins depend on PluginCommon.dll and CommonUtil.dll.  If
either of those is newer than the plugin DLL, we need to recompile.
2019-10-05 21:27:34 -07:00
Andy McFadden
28eafef27c Expand the set of things SetInlineDataFormat accepts
Extension scripts (a/k/a "plugins") can now apply any data format
supported by FormatDescriptor to inline data.  In particular, it can
now handle variable-length inline strings.  The code analyzer
verifies the string structure (e.g. null-terminated strings have
exactly one null byte, at the very end).

Added PluginException to carry an exception back to the plugin code,
for occasions when they're doing something so wrong that we just
want to smack them.

Added test 2022-extension-scripts to exercise the feature.
2019-10-05 19:51:34 -07:00
Andy McFadden
9a11ffea49 Missed a spot 2019-10-04 17:55:48 -07:00
Andy McFadden
3c3209b67f Expand set of symbols available to plugins
We were providing platform symbols to plugins through the PlatSym
list, which allowed them to find constants and well-known addresses.
We now pass all project symbols and user labels in as well.  The
name "PlatSym" is no longer accurate, so the class has been renamed.

Also, added a bunch of things to the problem list viewer, and
added some more info to the Info panel.

Also, added a minor test to 2011-hinting that does not affect the
output (which is the point).
2019-10-04 16:57:57 -07:00
Andy McFadden
3172ea0b70 Update Apple II data files
Added symbols for the ProDOS 8 global page, as well as some notes
about screen holes.

Also, if a platform symbol has a tag, show it in the Info panel.
2019-10-03 15:18:59 -07:00
Andy McFadden
b1d11480f3 Fix errors in manual 2019-10-03 10:53:56 -07:00
Andy McFadden
37855c8f8e Allow explicit widths in project/platform symbols, part 4 (of 4)
Handle situation where a symbol wraps around a bank.  Updated
2021-external-symbols for that, and to test the behavior when file
data and an external symbol overlap.

The bank-wrap test turned up a bug in Merlin 32.  A workaround has
been added.

Updated documentation to explain widths.
2019-10-03 10:32:54 -07:00
Andy McFadden
0d9814d993 Allow explicit widths in project/platform symbols, part 3
Implement multi-byte project/platform symbols by filling out a table
of addresses.  Each symbol is "painted" into the table, replacing
an existing entry if the new entry has higher priority.  This allows
us to handle overlapping entries, giving boosted priority to platform
symbols that are defined in .sym65 files loaded later.

The bounds on project/platform symbols are now rigidly defined.  If
the "nearby" feature is enabled, references to SYM-1 will be picked
up, but we won't go hunting for SYM+1 unless the symbol is at least
two bytes wide.

The cost of adding a symbol to the symbol table is about the same,
but we don't have a quick way to remove a symbol.

Previously, if two platform symbols had the same value, the symbol
with the alphabetically lowest label would win.  Now, the symbol
defined in the most-recently-loaded file wins.  (If you define two
symbols with the same value in the same file, it's still resolved
alphabetically.)  This allows the user to pick the winner by
arranging the load order of the platform symbol files.

Platform symbols now keep a reference to the file ident of the
symbol file that defined them, so we can show the symbols's source
in the Info panel.

These changes altered the behavior of test 2008-address-changes,
which includes some tests on external addresses that are close to
labeled internal addresses.  The previous behavior essentially
treated user labels as being 3 bytes wide and extending outside the
file bounds, which was mildly convenient on occasion but felt a
little skanky.  (We could do with a way to define external symbols
relative to internal symbols, for things like the source address of
code that gets relocated.)

Also, re-enabled some unit tests.

Also, added a bit of identifying stuff to CrashLog.txt.
2019-10-02 16:50:15 -07:00
Andy McFadden
6c9b8fd0e6 Merge branch 'hotfix/1.3.1' 2019-10-01 21:00:38 -07:00
Andy McFadden
abc2df5c04 Version 1.3.1 2019-10-01 21:00:08 -07:00
Andy McFadden
6c102919f5 Fix Actions menu crash
If you open the Actions menu when nothing is selected, the "can I
create a local variable table here" method crashes with a bad index
reference.

Issue #48.
2019-10-01 20:55:17 -07:00
Andy McFadden
e2b5b12e13 Fix Actions menu crash
If you open the Actions menu when nothing is selected, the "can I
create a local variable table here" method crashes with a bad index
reference.

Issue #48.
2019-10-01 19:13:15 -07:00
Andy McFadden
14150af004 Allow explicit widths in project/platform symbols, part 2
Added a Width column to the list in the project symbol editor.

Changed the local variable table editor and the project symbol editor
to use DataGrid instead of ListView.  This gets us easy sorting on
arbitrary columns.  The previous code was reloading the display list
after every change; now we just add/edit/remove individual items,
which helps keep the list position and selection stable.
2019-10-01 19:11:54 -07:00
Andy McFadden
2a41d70e04 Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.

The first step is to allow widths to be specified in platform files,
and set with the project symbol editor.  The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants.  (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)

We also now show the symbol's type (address or constant) and width
in the listing.  This gets really distracting when overused, so we
only show it when the width is explicitly set.  The default width
is 1, which most things will be, so users can make an aesthetic
choice there.  (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)

The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page.  The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.

The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.

Widths have been added to a handful of Apple II platform defs.
2019-10-01 16:00:08 -07:00
Andy McFadden
7ddde3aad7 Version 1.3.0 2019-09-27 13:52:25 -07:00
Andy McFadden
e898ef9568 Minor fixes
Change + save + undo + change was being treated as non-dirty.

Added link to "export" feature to documentation TOC.

Added keyboard shortcut for high part in data operand editor.

Corrected various things in the tutorial.
2019-09-27 13:43:58 -07:00
Andy McFadden
7739f640f5 Minor tweaks
Added a blank line after local variable tables.  Otherwise they
just sort of blend in with the stuff around them.

Put prefixes before the DOS 3.3 platform symbols.

Added a BAS_HBASH entry.  We were getting BAS_HBASL and MON_GBASH
paired up, which looks weird.

Apply a very light tint to the preview section of the Edit Long
Comment dialog, to hint that the window is read-only.
2019-09-26 13:00:14 -07:00
Andy McFadden
0877857e7e Make links less distracting in HTML output
Having underlined blue text everywhere was too noisy.  This changes
the CSS style for internal links to be plain black text that gets
blue and underliney when you hover the mouse over it.

Also, added the current date and time to the set of template
substitutions.
2019-09-22 16:45:08 -07:00
Andy McFadden
488df3e68e Minor fixes
HTML output should have had double quotes around internal anchors.
(Chrome and Edge didn't complain, but the w3c validator wasn't
happy.)

Made the text areas in the load-time problem report dialogs
scrollable.

Updated the manual.
2019-09-21 18:49:03 -07:00
Andy McFadden
7fcd5c2800 Version 1.3.0-alpha1 2019-09-21 13:46:08 -07:00
Andy McFadden
41cd30a8c6 Add Problem List Viewer to debug menu
The analyzer sometimes runs into things that don't seem right, like
hidden labels or references to non-existent symbols, but has no way
to report them.  This adds a problem viewer.

I'm not quite ready to turn this into a real feature, so for now it's
a free-floating window accessed from the debug menu.

Also, updated some documentation.
2019-09-21 13:43:01 -07:00
Andy McFadden
c05c42bf21 Add a few things to Apple II platform symbol lists 2019-09-20 19:04:10 -07:00
Andy McFadden
824add17e8 Remap labels that use opcode mnemonics
In a recent survey, three out of four cross assemblers surveyed
recommended not using opcode mnemonics to their patients who use
labels.  We now remap labels like "AND" and "jmp", using the label
map that's part of the label localizer.

We skip the step for Merlin 32, which is perfectly happy to assemble
"JMP JMP JMP".

Also, fixed a bug in MaskLeadingUnderscores that could hang the
source generator thread.
2019-09-20 15:29:34 -07:00
Andy McFadden
b74630dd5b Work around two assembler issues
Most assemblers end local label scope when a global label is
encountered.  cc65 takes this one step further by ending local label
scope when constants or variables are defined.  So, if we have a
variable table with a nonzero number of entries, we want to create
a fake global label at that point to end the scope.

Merlin 32 won't let you write " LDA #',' ".  For some reason the
comma causes an error.  IGenerator now has a "tweak operand format"
interface that lets us fix that.
2019-09-20 14:05:17 -07:00
Andy McFadden
6df874c559 Minor changes to local variable tables
Split "edit local variable table" into "create" and "edit prior".
The motivation is to allow the user to make changes to the most
recently defined table without having to go search for it.  Having
table creation be an explicit action, rather than something that
just happens if you edit a table that isn't there, feels reasonable.

Show table offset in LV table edit dialog, so if you really want
to go find it there's a (clumsy) way to do so.

Increased the maximum width of a variable from 4 to 8.  (This is
entirely arbitrary.)
2019-09-19 16:37:59 -07:00
Andy McFadden
6bc491885a Minor UI tweaks
Typing a long comment in the project symbol editor caused the
window to expand, which wasn't intended.  Use the mono font in
the comment editor.  Set the focus to the OK button after creating
or editing a project property.  Show constant vs. address in the
info panel when an EQU directive is selected.
2019-09-18 18:11:48 -07:00
Andy McFadden
6f61e37a81 Fix assert failure in data operand editor
Changing an ASCII character operand back to default was going
through a path that tried to resolve low vs. high ASCII, which
isn't useful when you're removing the item.  The root of the problem
was that the "default" button wasn't properly resetting the UI.

Also, updated keyboard shortcuts to be in sync with the instruction
operand editor.
2019-09-18 11:35:45 -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
ab755f1bc1 Tweak HTML output
Changed the HTML template to make the SourceGen version visible,
and added the expression style.
2019-09-17 22:14:10 -07:00
Andy McFadden
3353819a62 Change the way the "add padded string" functions work
The functions started by trying to pad a column out to a width,
then changed to pad things to a certain length.  What they really
should be doing is padding the start of an entry to a specified
column.  This is much more natural and avoids a trim operation.

The only change to the output is to ORG statements from the HTML
exporter, which are now formatted correctly.
2019-09-17 22:02:05 -07:00