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

182 Commits

Author SHA1 Message Date
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
6da3e73e63 Document wireframe visualizations 2020-03-09 14:12:54 -07:00
Andy McFadden
07d477fc70 Improve Apple II hi-res visualizer
Added a new category "sprite sheet", which is essentially a more
generalized version of the bitmap font renderer.  It has the full
set of options for col/row/cell stride and colors.  (Issue #74,
issue #75)

Added a flag that flips the high bits on bitmaps.  Sometimes data
is stored with the high bit clear, but the high bit is set as it's
rendered.  (Issue #76)

Also, fixed the keyboard shortcuts in the Edit Visualization Set
window, which were 'N' for both "New ___" items.  (Issue #57)
2020-02-18 16:42:46 -08:00
Andy McFadden
0ab76ea1f7 Improve CPU instruction chart
Added "show undocumented opcodes" checkbox, so you can choose
whether or not to see them at all.  (Issue #60)

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

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

Also, pluralized a button in the file concatenator.
2020-02-18 13:25:20 -08:00
Andy McFadden
ecbb01db1f Add Disk ][ I/O locations
Not perfect, but I'm not sure how to do better.
2020-02-18 13:11:13 -08:00
Andy McFadden
5b75ae35fc Fix ANDImm flag updater
For nonzero values we were leaving Z=prev, which is wrong when Z=0
because the AND result might be zero.  Now if Z=1 we leave it alone,
but if Z=0 we now set it to Z=?.

Test 1003-flags-and-branches was testing for the (incorrect)
behavior, so we're now running into a BRK.  This is fine.
2020-02-01 16:41:44 -08:00
Andy McFadden
f51b583d3b Fix tutorial
The scripts for tutorial #4 were suffering from bit rot.

Did some word-smithing on the tutorials.
2020-01-27 13:23:05 -08:00
Andy McFadden
44568f71ef Add Apple II shape table visualizer 2020-01-24 15:46:45 -08:00
Andy McFadden
14ce56ec9a Add more symbols for Applesoft and DOS 3.3 2020-01-21 22:15:36 -08:00
Andy McFadden
5deba9a898 Add a few Apple II symbols
Added monitor BASL/BASH, and DOS $03ea (for which I can't find an
official name).  Fixed a typo.
2020-01-19 16:49:02 -08:00
Andy McFadden
e2996d9b38 Don't output HTML anchors for non-unique labels
We're generating names that nothing links to.  The names aren't
guaranteed unique, so they're of dubious value anyway.

Also, fixed the Atari 2600 visualizer script filename in sys defs.
2020-01-16 21:37:49 -08:00
Andy McFadden
6c27b032bc
Updated the RuntimeData README 2020-01-01 18:06:59 -08:00
Andy McFadden
676ab2554d Fix Atari 2600 sprite visualizer
Should be solid/transparent not white/black.  Added a blue color
to the palette to use for sprites, as white + transparent disappears
completely on web pages with a white background.

Black + white + grey seems fine for playfields.
2019-12-29 18:15:40 -08:00
Andy McFadden
1373ffd8e3 Add file slicer tool
The tool allows you to cut a piece out of a file by specifying an
offset and a length.  A pair of hex dumps helps you verify that the
positions are correct.

Also, minor cleanups elsewhere.
2019-12-29 17:59:35 -08:00
Andy McFadden
89413d11e4 Add file concatenation tool
Select a list of files and save it.  File lengths and CRCs are
shown for reference.
2019-12-28 17:22:19 -08:00
Andy McFadden
1759317c8c Add visualization tutorial
Defined a simple monochrome bitmap format, and created some pieces
for a Tic-Tac-Toe game.  Wrote a tutorial that explains how to
visualize them.

Also, updated some comments.
2019-12-28 13:19:40 -08:00
Andy McFadden
9a6e87f496 Minor wordsmithing 2019-12-25 19:00:57 -08:00
Andy McFadden
091955b9c2 Allow setting the start/end address for a block
If you have a single line selected, Set Address adds a .ORG directive
that changes the addresses of all following data, until the next .ORG
directive is reached.  Sometimes code will relocate part of itself,
and it's useful to be able to set the address at the end of the block
to what it would have been before the .ORG change.

If you have multiple lines selected, we now add the second .ORG to
the offset that follows the last selected line.

Also, fixed a bug in the Symbol value updater that wasn't handling
non-unique labels correctly.
2019-12-25 18:17:50 -08:00
Andy McFadden
f11ef0dce4 Output human-readable generation parameters to HTML
Makes it easier to regenerate a file when you can see what the
column widths are supposed to be.
2019-12-25 10:59:40 -08:00
Andy McFadden
5a88a805d0 Fix proportions for animated GIFs
As with still images, animations are rendered at original size and
then scaled with HTML properties.

Also, fixed the blurry scaling on animation thumbnails.  I couldn't
find a way to do nearest-neighbor scaling in the code-behind without
resorting to System.Drawing (WinForms), so I added an overlay image
to the various grids.
2019-12-25 10:28:40 -08:00
Andy McFadden
6913558f4a Add animated GIF generation to HTML export
Visualization animations are now exported as animated GIFs.  The
Windows stuff is a bit lame so I threw together some code that
stitches a bunch of GIFs together.

The GIF doesn't quite match the preview, because the preview scales
the individual frames, while the animated GIF uses the largest frame
as the size and is then scaled based on that.  Animating frames of
differing sizes together is bound to be trouble anyway, so I'm not
sure how much to fret over this.
2019-12-24 18:15:03 -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
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
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
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
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
1136759c98 Tweak the tutorial 2019-10-30 15:40:03 -07:00