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

18 Commits

Author SHA1 Message Date
Andy McFadden
b3dacc2613 Switch to left-handed coordinate system
There's no "standard" coordinate system, so the choice is arbitrary.
However, an examination of the Transporter mesh in Elite revealed
that the mesh was designed for a left-handed coordinate system.  We
can compensate for that trivially in the Elite visualizer, but we
might as well match what they're doing.  (The only change required
in the code is a couple of sign changes on the Z coordinate, and an
update to the rotation matrix.)

This also downsizes Matrix44 to Matrix33, exposes the rotation mode
enum, and adds a left-handed ZYX rotation mode.

This does mean that meshes that put the front at +Z will show their
backsides initially, since we're now oriented as if we're flying
the ships rather than facing them.  I considered adding a 180-degree
Y rotation (with a tweak to the rotation matrix handedness to correct
the first rotation axis) to have them facing by default, but figured
that might be confusing since +Z is supposed to be away.

Anybody who really wants it to be the other way can trivially flip
the coordinates in their visualizer (negate xc/zc).

The Z coordinates in the visualization test project were flipped so
that the design is still facing the viewer at rotation (0,0,0).
2020-03-14 13:59:08 -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
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
Andy McFadden
e8870c30e8 Checkpoint work on wireframe visualization
Defined interfaces and added a test case.
2020-02-29 18:30:19 -08:00
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
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
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
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
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