Commit Graph
100 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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 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 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
Andy McFadden 8ab6294c8f Version 1.9.2-dev2 2025-06-22 15:12:42 -07:00
Andy McFadden ab5818a204 Add "copy out" button to References window
The References window is handy for seeing everything that refers to
a particular address or symbol, but walking through the list is
annoying because the window gets reset every time you double-click
on an entry and the selection moves.

This adds a "copy out" button that copies the references to a
floating window.  References can be double-clicked as usual, but the
list doesn't update unless you click "copy out" again.

This might be better if it were somehow integrated into the main
window, e.g. as a tab in the Info panel, so that the focus isn't
bouncing between two independently Z-ordered windows.
2025-06-22 13:44:53 -07:00
Andy McFadden ab0a93112f Version 1.9.2-dev1 2025-06-21 17:35:12 -07:00
Andy McFadden 0eb417ac46 Add "edit operand target label" action
This adds a shortcut for editing the label at the address referenced
by an instruction operand or data address pseudo-op.  This can be
activated from the Actions menu, or with Ctrl+Shift+L.

For references inside the file, the Edit Label dialog is opened.  For
external addresses, the project symbol editor is opened.

Local variable table entries are currently not supported.

(issue #166)
2025-06-21 17:31:49 -07:00
Andy McFadden 898307eb73 Tweak instruction operand edit
The code that allowed easy editing of project symbol operands wasn't
handling overlapping multi-byte regions correctly.

This adds a new section to the 20200-ui-edge-cases test case that has
instructions with various kinds of address operands.
2025-06-19 09:23:37 -07:00
Andy McFadden bde4f2ed07 Tweak Merlin32 generator
Merlin32 v1.2 requires DSK and TYP directives.  We now add these if
version 1.2 is detected.  (Earlier versions of Merlin32 accept them,
so at some point we may just want to output them always.)

The version-parsing code has been updated to deal with pre-release
version strings.
2025-05-04 07:58:49 -07:00
Andy McFadden 913dfb5dd2 Version 1.9.1 2025-01-19 14:07:38 -08:00
Andy McFadden c7090c9c52 Update comment 2024-12-22 20:25:43 -08:00
Andy McFadden 83ed8ed5d9 Minor updates 2024-09-17 15:11:03 -07:00
Andy McFadden 5aaaf43bf9 trivial change to nudge github 2024-09-17 13:20:26 -07:00
Andy McFadden 89be1a5800 Version 1.9.1-dev1 2024-09-15 13:35:45 -07:00
Andy McFadden ec9017cbc3 Add "omit implicit acc operand" feature
By default, implicit acc operands are shown, e.g. "LSR A" rather
than just "LSR".  I like showing operands for instructions that
have multiple address modes.

Not everyone agrees, so now it's a setting.  They're shown by default,
but enabling the option will strip them on-screen, in generated
assembly, and in the instruction chart.

They are always omitted for ACME output, which doesn't allow them.

(issue #162)
2024-09-15 13:29:04 -07:00
Andy McFadden 6c2eee806b Update tool reference 2024-08-19 13:12:53 -07:00
Andy McFadden ba28d42536 Version 1.9.0 2024-08-19 13:08:15 -07:00
Andy McFadden eef1710d5d Update tutorial
Two main changes:
 - "Seek nearby targets" is no longer enabled by default.
 - The application asks the user to save new projects immediately.

Various minor edits were also made.

A couple of the images are slightly stale, showing ".org" rather than
".addrs", but they're in the advanced section and the difference
isn't notable.
2024-08-19 13:03:16 -07:00
Andy McFadden 5544014b71 Fix weird error message
When creating a new project, we now put up a "save as" dialog.  If
you cancel out of the dialog, and have auto-save enabled, we post a
strange message about being unable to create a file with an empty
filename string.
2024-08-09 20:26:46 -07:00
Andy McFadden 69d3cd1867 Version 1.9.0-alpha2 2024-08-09 20:17:26 -07:00
Andy McFadden 3a349b2761 Tweak 2024-08-09 20:15:13 -07:00
Andy McFadden fca742e890 Auto-save, part 3 (of 3)
Added the recovery file check when a project is opened, and the GUI
elements for choosing which file to use.

If a recovery file exists but can't be opened, presumably because it's
open by another process, offer to open the project read-only.  (This
is a generally good idea, but we don't hold the project file open
in normal usage, so it only works when auto-save is enabled.)

After making a choice, auto-save is disabled until the first manual
save.

One thing we don't do: if we find a recovery file, but auto-save is
disabled, the recovery file won't be deleted after the user makes a
choice.  This might be a feature.

Updated documentation.

(issue #161)
2024-08-09 13:42:12 -07:00
Andy McFadden 1b2353c259 Auto-save, part 2
Periodically save the project to the recovery file if changes have
been made and the project is "dirty".

We need to handle a couple of things specially.  If the user uses
"Save As" to change the project name, we need to recreate the recovery
file as well.  If auto-save is enabled or disabled in app settings, we
need to create or discard the recovery file, and possibly change the
timer interval.  If the project is modified, auto-saved, and then the
change is un-done, the project won't be dirty, but will have a stale
recovery file with a newer modification date; we handle this by simply
truncating the stale recovery file.

To reduce the amount of auto-saving, we don't do an initial write to
the recovery file, and we reset the timer every time the user does a
manual save.  A user who saves diligently will always have an empty
recovery file.
2024-08-07 17:55:54 -07:00
Andy McFadden 3d4250cbc4 Auto-save, part 1
Added configuration option to app settings.  It's in the "code view"
tab, which isn't quite right, but none of the others fit better.

Also, force a Save As when a new project is first created.
2024-08-02 13:47:39 -07:00
Andy McFadden ef13101923 Clarify some app settings
The pop-up that lets you choose which assembler to set configuration
options for looked like it let you choose an assembler generally.
Changed some wording and visuals for better clarity.
2024-08-01 15:08:43 -07:00
Andy McFadden c78f1c945e Disable "seek nearby targets" for new projects
It's really handy for certain types of programs, but it's a
distraction in many others.  I find myself turning it off for most
things.

Some changes will be needed in the tutorial, which makes use of
the feature.  (The "odds & ends" section discusses it in detail.)
I'm putting that off until other changes are in.
2024-08-01 09:08:18 -07:00
Andy McFadden ccead47529 Version 1.9.0-alpha1 2024-07-20 13:06:08 -07:00
Andy McFadden b6a5408fbc Fix MLC equality operator 2024-07-20 13:05:50 -07:00
Andy McFadden b946207e91 Tweak previous 2024-07-10 07:56:23 -07:00
Andy McFadden b913541da4 Fix handling of operand wrap len == 0
This was supposed to select the default wrap length, but was actually
returning zero, causing a crash when a project was opened if the
settings file didn't happen to have the value specified.
2024-07-09 16:10:00 -07:00
Andy McFadden ba9d6e7924 Version 1.9.0-dev3 2024-07-08 14:09:01 -07:00
Andy McFadden 5c6d1b5016 Project/platform syms for address table formatting
The address table formatter tries to map the calculated addresses
to offsets within the file.  When that fails, it currently just
gives up.

We now try to resolve external addresses to project/platform symbols.

(issue #160)
2024-07-08 10:09:38 -07:00
Andy McFadden 5a560aa9eb Fancy comments, part 5 (of 5)
Added a "format help" button to the long comment edit window.  This
brings up a quick summary of the format tags in a modal dialog.

Updated documentation and tutorial.
2024-07-07 18:12:29 -07:00
Andy McFadden 15d3d123a5 Fancy comments, part 4
Handle [box] and [url] tags.  Dropped [sym].
2024-07-07 16:04:35 -07:00
Andy McFadden 227cdaab30 Fancy comments, part 3
Handle [br], [hr], [hr char='x'], and [width=nn].
2024-07-07 08:48:58 -07:00
Andy McFadden 1c84357bbf Fancy comments, part 2
Started implementing the fancy formatter.  It currently doesn't do
anything fancy, just word-wrapping.

Moved the static DebugShowRuler field into Formatter, so that the
cached data is discarded when the setting changes.

Also, updated SourceNotes with instructions for publishing a release.
2024-07-06 15:01:24 -07:00
Andy McFadden 83da0d952c Fancy comments, part 1
Added a "fancy" flag to MultiLineComment.  If set, we will use
formatting commands embedded in the text itself.  The max width pop-up
and "boxed" flag will be ignored in favor of width and boxing
directives.  (See issue #111.)

The current "fancy" formatter is just a placeholder that folds lines
every 10 characters.

Removed FormattedMlcCache (added two changes back).  Caching the
rendered string list in the MLC itself is simpler and more efficient
than having a separate cache, and it works for Notes as well.

Added anchors for more comments in the 20090 test.
2024-07-04 17:25:21 -07:00
Andy McFadden 14cacb4274 Eliminate BoxLineCommentDelimiter
This was used to prefix boxed lines with a comment delimiter, but
in practice we just need to do this whenever the box character
doesn't match the full-line comment delimiter.

This has no effect on generated assembly output, but the on-screen
(and exported HTML) form will now reflect the current settings.
2024-07-04 10:32:24 -07:00
Andy McFadden 54d559ad50 Add formatted MLC cache
Multi-line comments (MLCs) can span multiple lines, and are formatted
with word-wrapping.  This isn't too expensive now, but languages
with immutable strings aren't ideal for this sort of thing.  Before
we introduce fancier formatting, we want to ensure that we're not
going to adversely affect rendering performance.

The cache entry for a given offset is tied to the MLC object and the
Formatter; if either are changed, the cached string list will not be
used.
2024-07-02 14:49:17 -07:00
Andy McFadden b1ca87e3c8 Fix Applesoft shape table visualizer
An edge case wasn't being handled correctly.
2024-06-28 13:45:57 -07:00
Andy McFadden 9784ad043e Use '*' for full-line Merlin comments
While it's okay to use ';', the classic Merlin editor will treat it
as an end-of-line comment and shove the entire thing off to the right
side of the screen.

This adds a configuration item to the app settings, with a default
value of ';'.
2024-06-26 10:54:46 -07:00
Andy McFadden 18674e6627 Rework Formatter.FormatConfig
It was defined as a struct with exposed fields.  Now it's a class
with simple properties.  Default values are set explicitly, and
the contents are copied with a copy constructor instead of using
the struct member assignment.

The only functional change should be that the DelimiterSet members
are now properly cloned.  The bulk of the changes are just refactoring
renames for the property names.

This also adds comments for all the properties.
2024-06-24 16:36:27 -07:00
Andy McFadden 967d468c58 Version 1.9.0-dev2 2024-06-01 13:52:08 -07:00
Andy McFadden c05b5b3a28 Fix sgmanual index 2024-06-01 13:40:34 -07:00
Andy McFadden 7ca11b0889 Use Merlin 32 "putbin" directive
I had missed the existence of Merlin 32's PUTBIN directive, which
provides the binary include feature.
2024-06-01 10:24:41 -07:00
Andy McFadden 4e5c34f457 Binary includes
This adds a new data format option, "binary include", that takes a
filename operand.  When assembly sources are generated, the section
of file is replaced with an appropriate pseudo-op, and binary files
are generated that hold the file contents.  This is a convenient way
to remove large binary blobs, such as music or sound samples, that
aren't useful to have in text form in the sources.

Partial pathnames are allowed, so you can output a sound blob to
"sounds/blather.bin".  For safety reasons, we don't allow the files
to be created above the project directory, and existing files will
only be overwritten if they have a matching length (so you don't
accidentally stomp on your project file).

The files are not currently shown in the GenAsm dialog, which lets
you see a preview of the generated sources.  The hex dump tool
can do this for the (presumably rare) situations where it's useful.

A new regression test, 20300-binary-include, has been added.  The
pseudo-op name can be overridden on-screen in the settings.

We don't currently do anything new for text/HTML exports.  It might
be useful to generate an optional appendix with a hex dump of the
excised sections.

(issue #144)
2024-05-31 14:22:39 -07:00
Andy McFadden fa5d9ba890 Version 1.9.0-dev1 2024-05-23 10:27:45 -07:00
Andy McFadden 3b20566b10 Minor tweaks
Note that address region isolation doesn't prevent explicit label
references from working (add update the test to prove it).

Added a note about pre-label xrefs.
2024-05-22 14:02:53 -07:00
Andy McFadden 7a7ff44d3a Address region isolation, part 3 (of 3)
If an address resolves to a user label in an isolated region, we
don't want to use it.  However, we still want to try to match it
to a project/platform symbol.

For example, suppose the isolated code wants to reference address
$1C00, which is a memory-mapped I/O location in one area, but a
regular bunch of code in the other.  We don't want it to map to
the regular code, but we do want it to resolve to our table of
platform I/O addresses.

We now handle this correctly.  The regression test has been updated
to check this.  The current implementation does a linear scan through
the symbol table, but I'm hoping this is not a common situation.

The reference manual has been updated to describe the new feature.
2024-05-21 14:14:32 -07:00
Andy McFadden e137db2b5c Address region isolation, part 2
Added an address-to-offset test in the GeneratePlatformSymbolRefs()
method, which sets the operand symbols for anything that lands outside
the scope of the file.  Because the region isolation code prevented
symbols from being associated with the operands in the initial code
scan, those operands were being examined here.  Without the additional
test, the inappropriate label associations were getting a second chance.

Added "[!in]" and "[!out]" to the comment field of .addrs lines.  This
is only for the on-screen display and text exports, not asm gen.

Bumped the project file CONTENT_VERSION.

Added a regression test (20290-region-isolation).

The test turned up an existing problem: pre-labels are emitted by the
asm generators on their own line, but the code that puts excessively
long labels on a separate line wasn't taking that into account.  This
has been fixed.  No changes to existing regression tests, which didn't
happen to use long labels.
2024-05-21 10:32:18 -07:00
Andy McFadden ea4ddc1071 Address region isolation, part 1
This adds a pair of flags to address regions that control how
address resolution is performed.

Generally, when we're trying to convert an address to a file offset,
we do a depth-first search through the hierarchy of address regions
to find a match.  For certain situations, such as multi-bank ROMs or
when code is executed in a separate subsystem, we don't want the
address resolver to specify an offset for something that's in a
different address space.

The search for a matching address starts from the region where the
address is referenced.  The flags will prevent the search from
progressing "outward" (to parent or sibling regions) or "inward"
(from parent or sibling regions).  Setting both flags effectively
makes the region an island.

Descending farther into the tree is not restricted by the "outward"
flag, i.e. addresses will still be found in child regions (assuming
they don't have the "disallow inward" flag set).

(issue #139)
2024-05-20 14:50:18 -07:00
Andy McFadden d6cfc83368 Disable "prefer 32 bit" build flag
The build flag causes the application to run as a 32-bit app on 64-bit
systems, which we don't want.  We're still using "Any CPU" as the
platform target, so it will continue to work on 32-bit x86 systems;
we just no longer force it to always be 32-bit.

This only affects the main .NET Framework application executable.
The setting is not relevant for the libraries.

(Note to future self: the way things work changed with .NET Core,
which requires different executables for different targets, specified
with the RID.  The older .NET Framework is Windows-only, which makes
it easier to have a single multi-target EXE.)
2024-05-09 10:03:08 -07:00
Andy McFadden 17bd80e39f Version 1.8.6 2024-05-05 15:23:47 -07:00
Andy McFadden ca38b7751c Tweak label file generation
Include an altered version of the uniquified local label, so that
VICE will keep the full set.

(issue #151)
2024-04-30 13:27:07 -07:00
Andy McFadden 948e4a2bf2 Update README.md
Mention Wine v9.
2024-04-22 17:50:15 -07:00
Andy McFadden aa05aa7a80 Version 1.8.6-dev1 2024-04-22 17:39:25 -07:00
Andy McFadden 47b11b6797 Document new label placement setting 2024-04-22 17:35:21 -07:00
Andy McFadden 9e82ff8b88 Make label files look more like cc65 output
The cc65 docs say VICE labels start with '.'.  Also, output local
labels prefixed with '@', per ca65 convention.  The default output
file is now "labels.lbl".

Added some minimal documentation.

(issue #151)
2024-04-22 15:09:23 -07:00
Andy McFadden 4322a0c231 Add option to put labels on separate lines
We currently have two options for assembly code output, selected by
a checkbox in the application settings: always put labels on the same
lines as the instruction or data operand, or split the labels onto
their own line if they were wider than the label text field.

This change adds a third option, which puts labels on their own line
whenever possible.  Assemblers don't generally allow this for variable
assignment pseudo-ops like "foo = $1000", but it's accepted for most
other situations.  This is a cosmetic change to the output, and will
not affect the generated code.

The old true/false app setting will be disregarded.  "Split if too
long" will be used by default.

Added test 20280-label-placement to exercise the "split whenever
allowed" behavior.

The "export" function has a similar option that has not been updated
(for no particular reason other than laziness).

Also, simplified the app settings GetEnum / SetEnum calls, which
can infer the enumerated type from the arguments.  This should not
impact behavior.
2024-04-21 16:26:42 -07:00
Andy McFadden e425237783 First cut at label file generation
Some debuggers allow you to import a list of labels for addresses.
This adds a command that generates a file full of labels in a
specific format.  Currently the VICE monitor format is supported.

(issue #151)
2024-04-20 16:37:08 -07:00
Andy McFadden da91d9fc0e Allow arbitrary code list font sizes
The point size must be between 3 and 64, inclusive, just to avoid
doing anything too weird.  Also, added 14 to the drop-down.
2024-04-19 14:46:17 -07:00
Andy McFadden 8532cfb433 Rename menu item
Changed "File > Assemble" to "File > Generate Assembly".

Also, correctly mark a read-only text field as such.
2024-04-19 14:16:30 -07:00
Andy McFadden 9e9b12564e Merge pull request #156 from c64cryptoboy/pr_c64_io_symbols
Added C64 IO symbols
2024-04-08 08:03:05 -07:00
Andy McFadden 110a9ae818 Change the way app settings Apply button works
We were passing a reference to MainController in, and calling a
method on it, which is a little convoluted.  Now the main controller
subscribes to a "settings applied" event, and handles the update with
an event handler.

No change in behavior.
2024-03-02 14:48:06 -08:00