1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-03-10 23:22:19 +00:00

999 Commits

Author SHA1 Message Date
Andy McFadden
ba95a06155 Version 1.10.1 v1.10.1 2025-12-31 08:18:18 -08:00
Andy McFadden
5a983f8d5d For CRT format, do CBM80 check on all CHIPs
Some cartridges, such as Action Replay, have CBM80 vectors in
multiple CHIP packets.

Also, show the load address in the Notes, and put a CBM80 indicator
in the summary shown in the source header comment.
2025-12-31 08:11:42 -08:00
Andy McFadden
fd375fe65a Add comments to CRT header fields
Also, made some minor source code tweaks.
2025-12-31 07:39:28 -08:00
Andy McFadden
ac93d22eb2 Attempt to clarify generate vs. export
Also, updated NMS links.
2025-12-27 08:32:32 -08:00
Andy McFadden
f2e44c02df Version 1.10.1-dev5 v1.10.1-dev5 2025-12-25 16:20:51 -08:00
Andy McFadden
f059705fb4 Add pre-processing of VICE CRT files
This adds a new system definition that, when selected, causes some
pre-processing to be done on VICE CRT (cartridge) files.  These have
multiple chunks representing potentially overlapping ROM regions.

Also, pulled RawData.cs from CiderPress2, as it has some newer stuff
that we want.  (It would've been handy for the OMF code.)

Also, renamed SystemDefs.cs to SystemDef.cs to match the class name.

(issue #183)
2025-12-25 16:00:11 -08:00
Andy McFadden
fd4897a5df Fix typo 2025-12-24 15:15:15 -08:00
Andy McFadden
5b1d791b74 Add anchors for long comments
When a chunk of code is preceded by a block comment, it's nice to
provide an HTML link that goes to the start of the comment rather
than the start of the code.  Browsers like Chrome scroll the page
to position the anchor line at the very top, so it's not immediately
obvious that a comment is present.

We now generate anchors for the first line of long comments that
come before a code or data item with a label.

(issue #181)
2025-12-24 14:57:36 -08:00
Andy McFadden
c4c2c8d256 Add links to non-unique symbols in HTML output
We use the internal uniquified form of the symbol, but replace the \xA7
character with '!'.

(issue #180)
2025-12-24 14:04:44 -08:00
Andy McFadden
03ea2fc2c8 Version 1.10.1-dev4 v1.10.1-dev4 2025-11-30 16:04:04 -08:00
Andy McFadden
037b982d94 Allow scripts to handle COP and WDM inlines
The code that allows scripts to catch and handle BRK/JSR/JSL followed
by inline data now also handles COP and WDM.

(issue #177)
2025-11-30 14:59:39 -08:00
Andy McFadden
5a3d288707 Split 2018x-extension-scripts
Created the 20180-extension-scripts test by cutting out the handful
of 65816-specific items from 20182.  Removed some issue-specific stuff
from 20182 that didn't need to be duplicated.  Renamed some stale
references to test 2022.
2025-11-30 14:20:38 -08:00
Andy McFadden
da7548a24a Fix typo in C64 symbol defs
SPOX/SPOY -> SP0X/SP0Y

(issue #182)
2025-11-25 13:18:00 -08:00
Andy McFadden
7f80b0e5e1 Stop showing irrelevant cycle mods
We were showing (relevant) [irrelevant] cycle mods in the Notes panel,
but unless you're working with a 65816 you probably don't care about
things affected by the M/X flags and D register.

Also, made the rightmost column of the Notes and Symbols panels
auto-sized to fill the window.  We have to do this in the code because
we're constantly saving/restoring the column widths so that we can
record the values in the app setttings file.
2025-11-09 07:51:49 -08:00
Andy McFadden
d454e51ffa Version 1.10.1-dev3 v1.10.1-dev3 2025-10-24 11:04:22 -07:00
Andy McFadden
b22ca759f6 Update API target to .NET Framework 4.8.1
The project was targeting 4.6.2, which was the current version when
work first began.  This update should not cause any change in behavior.
The only real value in doing this is that it means people working on
the project won't have to install the older SDK components.

This may require performing a manual "clobber" in existing source trees:
close Visual Studio, then in each of the seven projects, manually
remove the "bin" and "obj" directories.  Using the VS "clean" feature
doesn't seem to clear out all of the dependencies, and you get weird
build complaints about missing System classes.

I'm not anticipating any compatibility issues with this switch.
Framework 4.8 shipped in April 2019, and the final version of .NET
Framework was released August 2022, so anybody who has Framework
installed should have a compatible version.

This change does not move the libraries from .NET Standard 2.0 to 2.1,
because 2.0 was the last version supported by Framework.

(At some point it might be useful to upgrade to the current .NET, but
that is a more significant change.)
2025-10-24 08:43:30 -07:00
Andy McFadden
417a9e55ad Version 1.10.1-dev2 v1.10.1-dev2 2025-09-22 10:21:10 -07:00
Andy McFadden
45fed396ab Make hex adjustment threshold configurable
We generate operand adjustments automatically, and output small
values as decimal (e.g. LDA FOO-1) and large values as hex (e.g.
LDA FOO+$1000).  This change adds a setting for the threshold
between small and large.

The default setting is 8.  The previous threshold was 255, which
felt a bit high.

(issue #176)
2025-09-22 09:06:00 -07:00
Andy McFadden
b71c2740db Change generated macro name
Change "bigendian" to "bword".  The former is more descriptive, but
it's long enough that it spoils the column alignment.

(issue #175)
2025-09-05 15:09:34 -07:00
Andy McFadden
573711d2e1 Version 1.10.1-dev1 v1.10.1-dev1 2025-09-04 11:33:31 -07:00
Andy McFadden
2c4fac9f76 Output big-endian macro for 64tass
If we see a big-endian value when generating code for 64tass, output
a macro and make use of it.

(issue #175)
2025-09-04 11:30:05 -07:00
Andy McFadden
5c21477cbe Improve MVN/MVP description 2025-08-20 16:34:59 -07:00
Andy McFadden
73f87f5060 Version 1.10.0 v1.10.0 2025-08-02 13:10:29 -07:00
Andy McFadden
a4b71e0c9b Update tutorial and manual
Fix some typos, clarify some things, and replace a slightly incorrect
pair of PNGs.

Some of the dialogs have gained additional options, but the changes
aren't meaningful enough to warrant taking lots of screen shots.
2025-08-01 13:36:32 -07:00
Andy McFadden
3e344281a2 Version 1.10.0-alpha1 v1.10.0-alpha1 2025-07-30 16:17:11 -07:00
Andy McFadden
cae1fa5173 Disregard operand address, part 2 (of 2)
Added assembler regression tests, for 6502 and 65816.

The "remove formatting" action now clears the flag.  It's a bit of a
stretch to call it "formatting" but this feels right.

Updated the documentation, adding a new section about embedded
instructions to the intro material.
2025-07-30 16:06:21 -07:00
Andy McFadden
ec50f48f95 Disregard operand address, part 1
SourceGen puts a lot of effort into connecting address operands to
internal offsets and external symbols.  Sometimes this is undesirable.
For example, a BIT or conditional branch instruction is sometimes used
as a dummy when there are multiple entry points that vary only in a
status flag or register value.  The address in the BIT or branch is
either irrelevant or never actually referenced, so auto-generating a
label for it is annoying.

Having a way to tell the disassembler to disregard an address operand,
so that it won't generate an auto-label or be included in the list of
cross-references, provides a simple solution to this.

The operand's file offset is determined during the code analysis
pass.  Setting it to -1 makes the operand look like an external address.
If we disable the project/platform symbol lookup for that instruction
as well, we can avoid label generation and cross-references.

We also need to prevent the 65816 data bank fixup code from restoring
it, and the relocation data code from doing its thing.

The flag is implemented as a new "misc flags" table, which holds a
set of bit flags for every file offset.  The "disregard operand address"
flag is set on the opcode byte of instructions.  The flags are expected
to be used infrequently, so they're currently output as a list of
(offset, integer) pairs.

The flag is set in the Edit Instruction Operand dialog, which has a
new checkbox.  The checkbox is disabled for immediate operands.

(issue #174)
2025-07-30 09:16:32 -07:00
Andy McFadden
c70d015b00 Fix 65816 operand formatting issues
Some 16-bit operands are tracked internally as 24-bit, appending the
B (data bank) or K (program bank) register to form the full address.
For some assemblers the K-bank instructions must be output as 24-bit
values, even for 16-bit JMP/JSR, but for most we want to strip the
bank byte off before outputting the operand as hex or decimal.

This expands 20032-labels-and-symbols with a mix of 24-bit, 16-bit+B,
and 16-bit+K instructions formatted in various ways.  No existing
tests were affected by this change.

(issue #172)
2025-07-19 13:39:12 -07:00
Andy McFadden
4846a26c9a Treat PEA operand as imm const16
We were treating PEA's operand as an absolute address and attempting to
extend it to 24 bits.  This wasn't very successful, and was
counter-productive when the argument was actually a constant, which is
common.  Worse, if the operand appeared to reference an internal address
outside bank 0, we would output a 24-bit value, breaking 64tass and cc65.

We now treat PEA as having an immediate operand.  (It was already
classified as an "extended immediate", but the operand-address
computation was still happening.)

This will have little to no effect on projects that use OMF relocation
data, because PEA arguments are explicitly identified as symbols or
constants.

New tests were added to 20032-labels-and-symbols to exercise the code
generation failures.  A few other tests that used PEA were affected.
20152-local-variables was fixed by adding a symbolic reference, the
others remained as-is and the expected output was revised.

(issue #172)
2025-07-18 13:25:29 -07:00
Andy McFadden
859a22fe60 Change signed decimal keyboard shortcut
It was re-using Alt+D in the instruction operand editor, which
interfered with selection of Decimal.  Alt+S was taken (for Symbol),
so it's using Alt+G.

There was no assignment in the data operand editor.  Alt+G was free
there as well.
2025-07-16 16:17:10 -07:00
Andy McFadden
15c5d53b0b Version 1.9.2-alpha2 v1.9.2-alpha2 2025-07-16 08:23:26 -07:00
Andy McFadden
8dba2c1de6 Allow formatting of 32-bit address tables
These are actually 24-bit address tables, with an extra byte to pad
each entry to an even number of bytes, so the GUI refers to them as
"24-bit + pad byte".  The extra byte is not included in the address
calculation, and is simply skipped over.

(issue #171)
2025-07-16 08:22:59 -07:00
Andy McFadden
65b217908b Version 1.9.2-alpha1 v1.9.2-alpha1 2025-07-15 13:41:54 -07:00
Andy McFadden
4ea4204ab7 Add signed-decimal operand formatting
This allows signed decimal operands to be formatted as such, e.g.
"LDA #$FE" becomes "LDA #-2".  This can be applied to immediate
operands and to numeric data pseudo-ops.

Not all assemblers support this in all situations.  The asm generators
will output unsigned decimal operands if so.

The 20020- and 20022-operand-formats tests have been updated.
2025-07-15 13:34:19 -07:00
Andy McFadden
10e48f15e8 Tweak verbiage 2025-07-15 11:27:17 -07:00
Andy McFadden
eda6748ee5 Version 1.9.2-dev5 v1.9.2-dev5 2025-07-11 07:56:25 -07:00
Andy McFadden
eb6999b1b0 Add jump table formatting
When asked to tag an absolute JMP instruction ($4C) as code, we now
scan forward to see if it's the start of a series of JMPs.  If we
find more than one, we offer the opportunity to tag the entire set
all at once.

A series of unformatted JMPs has been added to 20200-ui-edge-cases
for manual testing.

(issue #22)
2025-07-10 16:16:22 -07:00
Andy McFadden
213f7cc205 Tweak 20032 test
The existing workaround for broken Merlin 32 behavior is sufficient
to handle the new test cases.  This updates 20032-labels-and-symbols
to fully exercise all DP addressing modes with non-DP labels.

(issue #170)
2025-07-10 13:33:18 -07:00
Andy McFadden
459cde40c4 Fix Merlin 32 DP op generation
Most assemblers treat '<' and '>' as byte-select operators.  Merlin 32
treats them as shift operators, making '<' effectively a no-op.  A
mask is applied based on the length implied by the opcode or pseudo-op,
e.g. "DFB <FOO" will mask off the high bits.  This is problematic for
instructions like "LDA <FOO", where the choice between absolute and DP
addressing depends on the value of "<FOO".  If FOO is >= $100, the
lack of masking will cause it be treated as absolute.  There is
currently no other mechanism to force the use of a direct-page opcode.

The only recourse is to append "&$ff" to the operand, so the
assembler knows that it can be handled as a DP op.  The code generator
has been updated to add "&$ff" where needed, based on the label's
value.  Unfortunately the assembler doesn't accept this for certain
specific addressing modes; this appears to be a bug.

The relevant test cases (2003x-labels-and-symbols) have been updated
to exercise these situations.  The current test projects side-step the
failing assembler behavior by using a DP label instead.  These should
be changed to correctly exercise the full behavior, with the code
generator outputting the instructions as raw hex values to work
around bugs.

There are some deliberately broken things (like a duplicate label) in
the 20030 case that were copied into the 20032 case when it was
created.  For ease of editing these have been removed from 20032.

(issue #170)
2025-07-10 12:04:16 -07:00
Andy McFadden
9d01f9b205 Version 1.9.2-dev4 v1.9.2-dev4 2025-07-09 20:39:31 -07:00
Andy McFadden
108b71cfa7 Fix cc65 output
Fixed "HiAscii" macro used for cc65 output.  The macro name was being
forced to upper case at the point of use when the settings were
configured to generate upper-case pseudo-op names.

Also, added upper-casing config info to comment in HTML output.
2025-07-09 20:35:32 -07:00
Andy McFadden
4fe7257399 Fix crash when header line right-clicked 2025-07-09 20:34:13 -07:00
Andy McFadden
c873383c4d Expand goto dialog address resolution
The "goto" dialog (Ctrl+G) jumps to an offset, address, or label.  If
an address is specified, it is resolved relative to the first line of
the current selection, so that if the same address appears multiple
times we select the "best" one.

This turned out to be too restrictive, because if the region was marked
with "disallow outbound address resolution" we wouldn't look anywhere
except the current region.  While arguably correct, it was annoying
to have to move the cursor before being able to jump to a unique
address elsewhere in the file.

Now, if the address lookup fails to identify an offset, we repeat it
with "disallow outbound" flags ignored.
2025-07-09 12:57:23 -07:00
Andy McFadden
332477f4ab Work around edge case
The new GetOperandTargetOffset() function doesn't handle isolated
address regions quite right, because it uses a symbol table lookup
that doesn't know about them.  For now, we can work around it by
tweaking the behavior.
2025-07-09 08:04:59 -07:00
Andy McFadden
c0e3809938 Make notes panel text column fixed-width
The default width doesn't line up with the right edge of the panel,
so either you're not seeing as much text as you could, or it's
scrollable and will lurch over if you double-click in the text area.

Now the width is set to '*', which makes the column wide enough to
fill the panel, and automatically resizes as things shift.
2025-07-07 18:01:02 -07:00
Andy McFadden
7fdf459899 Version 1.9.2-dev3 v1.9.2-dev3 2025-06-27 15:11:28 -07:00
Andy McFadden
b6e6363234 Add "find all" feature
This uses the same (very weak) string search as the current Find
feature, but does it over the entire file.  Matches are added to a
table of results and displayed in the same dialog used by the
References panel "copy out" feature.

The reference table now jumps to a Location rather than just the
closest offset, so that we can jump to the middle of a multi-line
comment.
2025-06-27 15:00:38 -07:00
Andy McFadden
afd55d36e3 Add "always on top" checkbox to reference table
It's annoying to have to go digging for the dialog.  The default
setting is "true", and the value is remembered for the duration of
the current session.
2025-06-27 13:21:36 -07:00
Andy McFadden
10aa22c483 Tweak Edit Operand Target Label
If an instruction or data operand has been given an explicit symbol,
the user will expect to edit the label at that address rather than
the numeric address.  Same for project symbols.  If we detect that
a symbol has been set, edit that directly.  If the symbol doesn't
exist, or isn't a user label or project symbol (e.g. platform symbol
or address region pre-label), we open the full operand editor instead.
2025-06-27 13:07:38 -07:00
Andy McFadden
0d64e0a94f Handle LVT entries for operand target label edits
The "edit operand target label" feature now handles local variables.
The individual symbol is edited in the table, the same way it would
if the appropriate option were selected from the Edit Instruction
Operand dialog.

Also, show the address in the Edit Label dialog.  It feels
unobtrusive and is occasionally useful.
2025-06-26 09:59:54 -07:00