1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-07 07:28:57 +00:00
Commit Graph

144 Commits

Author SHA1 Message Date
Andy McFadden
d5b53a0795 Add combo box for default text scan mode
It's not quite the same as the character encoding -- sometimes we
want a mix of things -- so it gets its own enum.  The value is
saved to the project file, but not actually used yet.

Also, moved some combo box strings into XAML resources.
2019-08-12 18:01:29 -07:00
Andy McFadden
9a6d8d2e28 Minor cleanup
Remove left/right arrow PNGs.  Remove duplicate copies of icon.
Tweak some comments.  Set application icon.  Adjust padding on
group boxes in first tab of app settings.
2019-08-12 14:13:27 -07:00
Andy McFadden
f33cd7d8a6 Replace character operand output method
The previous code output a character in single-quotes if it was
standard ASCII, double-quotes if high ASCII, or hex if it was neither
of those.  If a flag was set, high ASCII would also be output as
hex.

The new system takes the character value and an encoding identifier.
The identifier selects the character converter and delimiter
pattern, and puts the two together to generate the operand.

While doing this I realized that I could trivially support high
ASCII character arguments in all assemblers by setting the delimiter
pattern to "'#' | $80".

In FormatDescriptor, I had previously renamed the "Ascii" sub-type
"LowAscii" so it wouldn't be confused, but I dislike filling the
project file with "LowAscii" when "Ascii" is more accurate and less
confusing.  So I switched it back, and we now check the project
file version number when deciding what to do with an ASCII item.
The CharEncoding tests/converters were also renamed.

Moved the default delimiter patterns to the string table.

Widened the delimiter pattern input fields slightly.  Added a read-
only TextBox with assorted non-typewriter quotes and things so
people have something to copy text from.
2019-08-11 22:11:00 -07:00
Andy McFadden
068b3a44c7 Remove "high" versions of string pseudo-ops
High ASCII and other encodings will be noted in the operand field,
not the opcode, so we no longer need these.

This removes the six input fields from the Pseudo-Op tab of app
settings.  Values were stored as a serialized class in settings,
which generally works correctly as far as forward/backward
compatibility goes, so no worries there.

This also adds four "delimiter pattern" fields to the Code View tab,
allowing the user to customize how encoded strings are marked up
for the code list.  The values aren't actually used yet.

Also, fixed an issue where changes to text fields on the Pseudo-Op
tab weren't raising the dirty flag.
2019-08-11 16:44:22 -07:00
Andy McFadden
bc633288ad Prep work for multi-encoding support
Wrote down research into C64 encodings.

Added source for a first cut at 2016-char-encoding test.
2019-08-11 11:27:09 -07:00
Andy McFadden
15d26c9ebd Don't do plugin interface checks during code analysis
The plugin objects are MarshalByRefObject stubs, which means they
don't actually implement the interfaces we're checking for.  There's
some additional overhead to do the interface check.  We can avoid
it by doing the interface queries during initialization, and just
checking some bit flags later on.

Also, in the extension script info window, show a list of
implemented interfaces.
2019-08-10 17:16:39 -07:00
Andy McFadden
975b62db6b Treat low and high ASCII as two distinct formats
We've been treating ASCII strings and instruction/data operands as
ambiguous, resolving low vs. high when generating output for the
display or assembler.  This change splits it into two separate
formats, simplifying output generation.

The UI will continue to treat low/high ASCII as as single thing,
selecting the format appropriately based on the data.  There's no
reason to have two radio buttons that are never both enabled.

The data operand string functions need some additional work, but
that overlaps substantially with the upcoming PETSCII changes, so
for now all strings set by the data operand editor are low ASCII.

The file format has changed again, but since there hasn't been a
release since the previous change, I'm leaving the file format
at v2.  Code has been added to resolve the ASCII mode when loading
a v1 project file.

This removes some complexity from the assembly code generators.
2019-08-10 14:59:24 -07:00
Andy McFadden
a4f5d19295 Improve 64tass output
DCI is handled with the ".shift" pseudo-op.  The .null, .ptext,
and .shift operators all work correctly with escaped characters,
so we no longer redo those.
2019-08-09 19:13:58 -07:00
Andy McFadden
dae76d9b45 Rework string operand formatting
This generalizes the string pseudo-operand formatter, moving it into
the Asm65 library.  The assembly source generators have been updated
to use it.  This makes the individual generators simpler, and by
virtue of avoiding "test runs" should make them slightly faster.

This also introduces byte-to-character converters, though we're
currently still only supporting low/high ASCII.

Regression test output is unchanged.
2019-08-09 17:46:33 -07:00
Andy McFadden
7a40d7f9bf Update expected output for test 2005-string-types
This was the result of the earlier change to eliminate "reverse DCI"
strings.  On further examination, it doesn't seem like we can do
much better than a hex dump without more work than the situation
merits.  So hex dump it is.
2019-08-09 16:41:05 -07:00
Andy McFadden
835c1c7fe2 Reverse position on '#' in block move operands
During a discussion with the cc65 developers, I became convinced that
generating "MVN $01,$02" is wrong, and "MVN #$01,#$02" is correct.
64tass, cc65, and Merlin 32 all accept this syntax; only ACME does
not.  Operands without a leading '#' should be treated as 24-bit
values, and have the bank byte extracted.

This change updates the on-screen display and assembled output to
include the '#'.  The ACME generator uses a Quirk to suppress the
hash mark.  (It doesn't currently accept values larger than 8 bits,
so there's no ambiguity.)
2019-08-08 13:02:01 -07:00
Andy McFadden
0d0854bda7 Change the way string formats are defined
We used to use type="String", with the sub-type indicating whether
the string was null-terminated, prefixed with a length, or whatever.
This didn't leave much room for specifying a character encoding,
which is orthogonal to the sub-type.

What we actually want is to have the type specify the string type,
and then have the sub-type determine the character encoding.  These
sub-types can also be used with the Numeric type to specify the
encoding of character operands.

This change updates the enum definitions and the various bits of
code that use them, but does not add any code for working with
non-ASCII character encodings.

The project file version number was incremented to 2, since the new
FormatDescriptor serialization is mildly incompatible with the old.
(Won't explode, but it'll post a complaint and ignore the stuff
it doesn't recognize.)

While I was at it, I finished removing DciReverse.  It's still part
of the 2005-string-types regression test, which currently fails
because the generated source doesn't match.
2019-08-07 16:19:13 -07:00
Andy McFadden
89288c4d8c Updated assembler bugs & quirks
Notably, updated remarks regarding cc65's handling of block move
operands, which are apparently "broken as intended".
2019-08-06 08:52:59 -07:00
Andy McFadden
a4e90bffd1 Add 2015-64k-nops test
The test file is just 65536 NOPs.
2019-08-04 16:54:01 -07:00
Andy McFadden
212c20e02c Version 1.3.0-dev2 2019-08-04 15:00:36 -07:00
Andy McFadden
d80132e941 Finish ACME v0.96.4 support
There's no easy way to make non-zero-bank 65816 code work, so I'm
punting and just generating a whole-file hex dump for those.  This
renders tests 2007 and 2009 useless, so I'm hesitant to claim that
ACME support is fully functional.
2019-08-04 14:48:42 -07:00
Andy McFadden
71badf2359 Update for cc65 v2.18
WDM <arg> now works.  MVN/MVP are still broken.  Correct code is
generated for whichever version of the assembler is configured.
Regression tests updated for new version.

Also, fixed a UI bug where manual edits to the assembler path were
being ignored.
2019-08-04 13:38:25 -07:00
Andy McFadden
1ad9caa783 First pass at ACME support
I managed to work around most of the quirks, but there's still an
issue with 65816 code.

Also, enabled word wrapping in the AsmGen text boxes.
2019-08-03 20:54:07 -07:00
Andy McFadden
d97d715ae3 Version 1.3.0-dev1 2019-08-02 17:25:55 -07:00
Andy McFadden
98914e9f80 Treat BRK as a 1-byte instruction
The 65816 definition makes it a two-byte instruction, like COP.  On
the 6502 it acted like a two-byte instruction, but in practice very
few assemblers treat it that way.  Very few humans, for that matter.
So it's now treated as a single byte instruction, with the following
byte encoded as a data value.
2019-08-02 17:21:50 -07:00
Andy McFadden
0616e4e4a4 Define interfaces for inline call handlers and BRK
Instead of providing no-op CheckJsr/CheckJsl, plugins now declare
which calls they support by defining interfaces on the plugin class.

I added a CheckBrk call for code like Apple /// SOS calls, which
use BRK as an OS call mechanism.  The formatting doesn't work quite
right yet because I've been treating BRK as a two-byte instruction.
Hardly anything else does, and I think it's time I stopped (but not
in this commit).

Note: THIS BREAKS ALL PLUGINS that use the inline JSR/JSL feature,
which is pretty much all of them.
2019-08-02 16:06:27 -07:00
Andy McFadden
d41266442d Make the "continue" button actually do something 2019-08-02 16:00:58 -07:00
Andy McFadden
1219755e85 Remove WinForms code 2019-08-02 12:48:12 -07:00
Andy McFadden
be47b8912b Version 1.2.0 2019-07-29 14:00:13 -07:00
Andy McFadden
4aee3af089 Various doc fixes 2019-07-29 13:20:03 -07:00
Andy McFadden
330b4a238a Version 1.2.0-beta1 2019-07-21 16:56:25 -07:00
Andy McFadden
4f74430757 Minor fixes
- Updated the tutorial to track changes to WPF, and to clarify
  existing content.
- Fixed Ctrl+H Ctrl+C, which was getting masked by the Copy command
  handler.
- Fixed initial selection of address in Set Address.
2019-07-21 15:24:39 -07:00
Andy McFadden
02f6e884d7 Fix startup issues
- MakeDist now copies CommonWPF.dll.
- Spent a bunch of time tracking down a null-pointer deref that only
  happened when you didn't start with a config file.  Fixed.
- The NPE was causing the program to exit without any sort of useful
  diagnostic, so I added an uncaught exception handler that writes
  the crash to a text file in the current directory.
- Added a trace listener definition to App.config that writes log
  messages to a file, but it can't generally be enabled at runtime
  because you can't write files from inside the sandbox.  So it's
  there but commented out.
- Made the initial size of the main window a little wider.
2019-07-20 17:36:12 -07:00
Andy McFadden
06e28f89d1 Tweak window size 2019-07-20 13:30:30 -07:00
Andy McFadden
c64f72d147 Move WPF code from SourceGenWPF to SourceGen 2019-07-20 13:28:37 -07:00
Andy McFadden
e3906e021b Move WinForms code to SourceGenWF 2019-07-20 13:02:54 -07:00
Andy McFadden
e49ee6f20b Finish split-address table formatter
A lot of things react to other things in this dialog.  I think I
got everything behaving correctly.
2019-07-13 15:55:32 -07:00
Andy McFadden
9aa8b5c9a7 Minor documentation updates
Also, placate consistency hobgoblins.
2019-07-06 10:58:24 -07:00
Andy McFadden
9e525d1428 Populate symbol table, with filtering and sorting
The filtering uses the DataGrid View filtering mechanism.  The
built-in sorting only operates on a single column, and we really
want a secondary sort on label when the type is used as the key,
so we provide a custom sort method.
2019-06-12 15:14:21 -07:00
Andy McFadden
da825d3114 Make ResetList() 1000x faster
Rather than sending 540,000 "item has changed" events, send a
single "collection reset" message.
2019-05-30 16:30:59 -07:00
Andy McFadden
823aa072fb Update comments 2019-04-29 13:07:52 -07:00
Andy McFadden
ab590c5a2a Version 1.1.0 2019-04-19 14:54:10 -07:00
Andy McFadden
6185b85f7b Fix crash on asm gen when no settings file exists 2019-04-19 14:43:33 -07:00
Andy McFadden
6998eb4021 Minor doc edits
Added Ctrl+W to the tutorial.  Named the 64tass executable.
Performed various acts of word-smithing.
2019-04-19 14:10:48 -07:00
Andy McFadden
8d0ce87ec7 Experiment on uncategorized data analysis
Tried something to speed it up.  Didn't help.  Cleaned up the code
a bit though.
2019-04-18 15:58:43 -07:00
Andy McFadden
61d6cd597a Document the auto-label style setting 2019-04-15 16:04:11 -07:00
Andy McFadden
ba44774810 Version 1.1.0-dev3 2019-04-15 15:35:49 -07:00
Andy McFadden
97a372a884 Add selectable auto-label styles
SourceGen creates "auto" labels when it finds a reference to an
address that doesn't have a label associated with it.  The label for
address $1234 would be "L1234".  This change allows the project to
specify alternative label naming conventions, annotating them with
information from the cross-reference data.  For example, a subroutine
entry point (i.e. the target of a JSR) would be "S_1234".  (The
underscore was added to avoid confusion when an annotation letter
is the same as a hex digit.)

Also, tweaked the way the preferred clipboard line format is stored
in the settings file (was an integer, now an enumeration string).
2019-04-15 15:14:04 -07:00
Andy McFadden
47b1363738 Add more detail to cross references
In the cross-reference table we now indicate whether the reference
source is doing a read, write, read-modify-write, branch, subroutine
call, is just referencing the address, or is part of the data.
2019-04-11 16:23:02 -07:00
Andy McFadden
84eceee085 Note removal of cc65 limitation 2018-11-18 15:20:12 -08:00
Andy McFadden
2065f4ef9e Attempt to generate segment names for cc65
This worked, sort of.  The problem is that SourceGen will revert to
hex output in certain situations, such as a broken symbolic
reference.  There happens to be one in the ZIPPY example, and it's
on a relative branch.

The goal with the segment stuff is to allow cc65 to treat the
source as relocatable code.  In that context, a relative branch to
an absolute address doesn't make any sense, so the assembler reports
a range error.

We don't currently have a mechanism that guarantees no references
are broken (and no affordance for finding them), so we can't make
this mode the default yet.

Instead, we continue to use the generic config, but generate the
correct set of lines as comments.

(issue #39)
2018-11-18 15:11:29 -08:00
Andy McFadden
17f0faa845 Add linker config scripts to cc65 generator output
The system configuration you get with "-t none" works for smaller
files but fails for larger ones.  This updates the generator to
produce a source file and linker script pair.  (I kinda saw this
one coming -- it's why the gen/asm dialog has a combo box for the
file preview -- so it didn't require that much work.)

This currently generates a fixed script for a generic system with
64KiB of RAM, using .ORGs to set the addresses as before.

With this change, assembling a file with 65536 NOPs succeeds.

(issue #39)
2018-11-18 14:28:44 -08:00
Andy McFadden
47acf92c2c Version 1.1.0-dev2 2018-11-12 10:12:27 -08:00
Andy McFadden
0e1530fe0f Add Actions > Format As Word (Ctrl+W)
Formats a pair of bytes into a 16-bit word.  As a special case,
attempts to grab the next byte if only one byte is selected.

(issue #29)
2018-11-11 17:25:02 -08:00
Andy McFadden
f5b36afd2e Add a bit to the tutorial
In the data operand edit section, walk through selecting a single
byte vs. multiple bytes when you want to set a multi-byte format.

(inspired by issue #41)
2018-11-08 11:54:33 -08:00