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

777 Commits

Author SHA1 Message Date
Andy McFadden
fc5f36885a Fix crash when window panel sizes are off
The code could attempt to set a negative height for the windows in
the side panels.

(issue #108)
2021-08-21 07:45:11 -07:00
Andy McFadden
f4bee76023 Update junk counter
The bottom of the main window shows the total bytes in the project
along with how many are code, data, and junk.  The junk figure wasn't
updating if you changed a data item to junk or vice-versa, because a
simple format change doesn't require reanalyzing the file.

To make the counter "live", we need to tell the updater to refresh the
values whenever a format changes to or from "junk".
2021-08-19 14:40:27 -07:00
Andy McFadden
df2154564f Version 1.7.5 2021-08-16 12:38:58 -07:00
Andy McFadden
b23eefaa1a Improve handling of vanishing selection
If you select a note or long comment and delete it, the selection is
lost, because the selected item no longer exists.  This is inconvenient
if you're working with the keyboard, because it moves the keyboard
position to the top of the file.

If the previous selection was non-empty, and the new selection is
empty, we want to select the line that would have appeared below the
item that was deleted.  Making this work exactly right is a bunch of
work, but we can make it work mostly right by selecting the first line
associated with the offset of the previous selection.
2021-08-15 14:31:11 -07:00
Andy McFadden
992e008e7d Add multi-inline extension script to tutorial
It's useful to have an example of an extension script that handles
multiple types of things.  It's also good to show that scripts can
handle data types other than strings, and can chase an address to
format data items elsewhere in the code.

This required updating the tutorial binary, adding the new script,
and updating the tutorial text and associated screen shots.
2021-08-15 10:00:00 -07:00
Andy McFadden
ec2ad529c8 Remove a couple of faulty assertions
One asserted unnecessarily, one should have been an if/then.  Both
were concerned with instruction operands being formatted with
type "address".
2021-08-11 16:25:24 -07:00
Andy McFadden
635084db9d Fix DCI string edge case
If a DCI string ended with a string delimiter or non-ASCII character
(e.g. a PETSCII char with no ASCII equivalent), the code generator
output the last byte as a hex value.  This caused an error because it
was outputting the raw hex value, with the high bit already set, which
the assembler did not expect.

This change corrects the behavior for code generation and on-screen
display, and adds a few samples to the regression test suite.

(see issue #102)
2021-08-10 14:08:39 -07:00
Andy McFadden
fa1b0af932 Clarify 2021-08-09 16:22:17 -07:00
Andy McFadden
7f82362985 Version 1.7.5-dev4 2021-08-09 15:01:46 -07:00
Andy McFadden
3a02132694 Update 64tass code gen
64tass v1.55.2176 added a missing undocumented op, so we can remove
the workaround unless we're configured for an older version.
2021-08-09 14:26:25 -07:00
Andy McFadden
478afa542e Fix 64tass code gen corner case
On the 65816, if you say "JSR foo" from bank $12, but "foo" is an
address in bank 0, most assemblers will conclude that you're forming
a 16-bit argument with a 16-bit address and assemble happily.  64tass
halts with an error.  Up until v1.55 or so, you could fake it out
by supplying a large offset.

This no longer works.  The preferred way to say "no really I mean to
do this" is to append ",k" to the operand.  We now do that as needed.

I didn't want to define a new ExpressionMode for 64tass just to
support an operand modifier that should probably never actually get
generated (you can't call across banks with JSR!), so this is
implemented with a quirk and an op flag.

64tass v1.56.2625 is now the default.

(issue #104)
2021-08-09 14:11:15 -07:00
Andy McFadden
19ba34760b Rework ItemContainerGenerator StatusChanged hack
This is another attempt to fix the ListView keyboard position
behavior.  Basic problem: if you change something in the ListView,
the keyboard position is lost, and WPF doesn't expose a nice way to
save and restore it.  It appears the way to set the position is by
calling Focus() on the specific item you want to have as the "current"
keyboard position, but you can only do that at certain times.

This attempt removes the grid-splitter resize hack, in favor of just
setting a "needs refocus" flag when we restore the selection set.
This causes Focus() to be called from the StatusChanged callback on
the next event with status="containers generated".

During testing I noticed some other odd behavior: if you used "goto"
to jump to an address, up/down arrows would change focus to a
different control (menu items, grid splitters, etc).  The problem
there was that we were setting focus to the ListView control rather
than to a ListViewItem, so arrow keys were in control-traversal mode
rather than list-walk mode.  That is also fixed.

(Issue #105)
2021-08-08 17:39:21 -07:00
Andy McFadden
3368182e14 Allow single-character DCI strings
The DCI string format uses character values where the high bit of the
last byte differs from the rest of the string.  Usually all the high
bits are clear except on the last byte, but SourceGen generally allows
either polarity.

This gets a little uncertain with single-character strings, because
SourceGen can't auto-detect DCI very effectively.  A series of bytes
with the high bit set could be a single high-ASCII string or a series
of single-byte DCI strings.

The motivation for allowing them is C64 PETSCII.  While ASCII allows
"high ASCII" as an escape hatch, PETSCII doesn't have that option, so
there's no way to mark the data as a character or a string.  We still
want to do a bit of screening, but if the user specifies a non-ASCII
character set and the selected bytes have their high bits set, we
want to just treat the whole set as 1-byte DCI.

Some minor adjustments were needed for a couple of validity checks
that expected longer strings.

This adds some short DCI strings in different character sets to the
char-encoding regression tests.

(for issue #102)
2021-08-08 15:38:39 -07:00
Andy McFadden
b58fdedfcd Add "suggestions" page to tutorial 2021-08-03 15:09:23 -07:00
Andy McFadden
3b37f9a449 Version 1.7.5-dev3 2021-08-01 20:06:01 -07:00
Andy McFadden
44b483c8d8 Fix table formatting for embedded destinations
The code for formatting an address table allows you to specify that
code start tags should be placed on all targets.  However, unnecessary
tags are undesirable, and it's not necessary to add a tag if the
target is already treated as executable code.  So the implementation
tested to see if the target address was already an instruction.

The code was incorrectly testing for "is instruction", rather than "is
instruction start", which meant that if the table entry pointed at an
instruction embedded inside another instruction we would conclude that
the tag wasn't necessary, when in fact it was.  Not only weren't we
getting a useful table entry, we were adding a symbolic reference to a
hidden label.

(issue #103)
2021-08-01 18:15:44 -07:00
Andy McFadden
d65ab59461 Don't reject strings with "invalid" characters
When formatting one or more strings with the Edit Data Operand dialog,
the code must determine which options to present.  If the selected
bytes appear to represent one or more null-terminated strings, that
option is enabled in the UI.

The "format recognizers" enforce some strict rules, e.g. null-
terminated strings must end in $00, and also try to confirm that the
data looks like a printable string.  The algorithm rejects strings
with "illegal" characters in them.  This is simpler on some systems
than others.  For example, C64 PETSCII defines quite a few control
characters in ways that make them useful for embedding in printable
strings.

The "recognizers" are only used by the operand edit feature, not as
part of an automated string detector, so there's no real upside in
overriding the user's desire to form a string with arbitrary bytes.

This removes the quick rejection from the four recognizers (null-term,
len8, len16, dci).  It does not alter the high-level code, which
still insists on a certain percentage of the string being printable;
that may be worth revisiting as well.

(issue #100)
2021-08-01 17:50:32 -07:00
Andy McFadden
8db554c1cd Fix 64tass output for non-loadable files
64tass wants to place its output into a 64KB region of memory,
starting at the address "*" is set to, and continuing without
wrapping around the end of the bank.  Some files aren't meant to be
handled that way, so we need to generate the output differently.

If the file's output fits nicely, it's considered "loadable", and
is generated in the usual way.  If it doesn't, it's treated as
"streamable", and the initial "* = addr" directive is omitted
(leaving "*" at zero), and we go straight to ".logical" directives.

65816 code with an initial address outside bank 0 is treated as
"streamable" whether or not the contents fit nicely in the designated
64K area.  This caused a minor change to a few of the 65816 tests.

A new test, 20240-large-overlay, exercises "streamable" by creating
a file with eight overlapping 8KB segments that load at $8000.
While the file as a whole fits in 64KB, it wouldn't if loaded at
the desired start address.

Also, updated the regression test harness to report assembler
failure independently of overall test failure.  This makes it easier
to confirm that (say) ACME v0.96.4 still works with the code we
generate, even though it doesn't match the expected output (which
was generated for v0.97).

(problem was raised in issue #98)
2021-08-01 17:21:20 -07:00
Andy McFadden
752fa06ef5 Tweak backslash escaping
The initial implementation was testing the byte value rather than
the converted value, so backslashes were getting through in high
ASCII strings.  PETSCII and C64 screen codes don't really have a
backslash so it's not really an issue there.

The new implementation handles high ASCII correctly.  The various
201n0-char-encoding-x regression tests have been updated to verify
this.
2021-07-31 20:22:21 -07:00
Andy McFadden
8fc38d5d90 Update ACME version in docs
Added v0.97 to list of successfully-tested versions.

Noted that regression tests are now run against v0.97.
2021-07-31 15:15:21 -07:00
Andy McFadden
a1130ddc2b Fix the "target assembler" comment
The code generator outputs an optional comment specifying which
version of which assembler the code was generated for.  This was
handled inconsistently and, for the most part, incorrectly.  We now
report the correct version.
2021-07-31 14:56:17 -07:00
Andy McFadden
8c053c29f2 Update ACME generator for v0.97
Two things changed: (1) string literals can now hold backslash
escapes like "\n"; (2) MVN/MVP operands can now be prefixed with '#'.
The former was a breaking change because any string with "\" must
be changed to "\\".  This is now handled by the string operand
formatter.

Also, improved test harness output.  Show the assembler versions at
the end, and include assembler failure messages in the collected
output.
2021-07-31 14:42:36 -07:00
Andy McFadden
c16e646701 Add a line to 20052-branches-and-banks
Throw a non-bank-zero JSR <hexaddr> into the mix.
2021-07-31 13:51:35 -07:00
Andy McFadden
38bc7721a4 Fix "goto address" for overlapping segments
If you have multiple overlapping segments (say, four 8KB chunks
that all load at $8000), and you use the "goto" command to jump
to address $8100, it should try to jump to that address within
whichever segment you happen to be working (based on the current
line selection).  If that address doesn't exist in the current
segment, it's okay to punt and jump to the first occurrence of that
address in the file.

The existing code was always jumping to the first instance.

(related to issue #98)
2021-07-30 14:40:17 -07:00
Andy McFadden
b75c37a9b9
Merge pull request #97 from absindx/symbol-snes
Added SNES symbols
2021-07-29 09:17:25 -07:00
absindx
f8673d81b0 Change entry flags to native mode 2021-07-30 01:02:08 +09:00
absindx
64c7ce28f9 Fixes that reflect feedback.
* Remove excess MULTI_MASK
* Delete placeholder message
2021-07-29 23:46:05 +09:00
absindx
363c2eef76 Added SNES symbol 2021-07-29 22:51:41 +09:00
Andy McFadden
eeac6db441 Update 8x8 font used by visualizers
Added 'G' through 'Z'.  Rounded 'D' a bit.
2021-07-27 14:22:34 -07:00
Andy McFadden
594c22a6fd Merge branch 'master' of https://github.com/fadden/6502bench 2021-07-20 13:20:52 -07:00
Andy McFadden
8487508740 Version 1.7.5-dev2 2021-07-20 13:20:32 -07:00
Andy McFadden
03a0fc13fd Expand max local variable width to 257
Code generated by one of the C compilers sets up the stack frame and
then maps the direct page on top of it.  If the value at the top of
the stack is 16 bits, it will be referenced via address $ff.  The
local variable editor was regarding this as illegal, because lvars are
currently only defined for direct page data, and the value doesn't
entirely fit there (unless you're doing an indirect JMP on an NMOS
6502, in which case it wraps around to $00... but let's ignore that).

The actual max width of a local variable is 257 because of the
possibility of a 16-bit access at $ff.

Older versions of SourceGen don't seem to have an issue when they
encounter this situation, as worrying about (start+width) is really
just an editor affectation.  The access itself is still a direct-page
operation.  You won't be able to edit the entry without reducing the
length, but otherwise everything works.  I don't think there's a need
to bump the file version.
2021-07-20 13:08:19 -07:00
Andy McFadden
bc7a225080 Expand 20152-local-variables test
Added a compiled C implementation of strlen().  The most interesting
part about this is that it references a 16-bit value via direct-page
address $ff, which means you'd want a local variable with
address=$ff and width=2.  The current UI prevents this.
2021-07-20 11:28:26 -07:00
Andy McFadden
909bdb1fa4 Tweak web page include structure
Renamed from "*-incl.html" to "incl-*.html" so they sort together.

Moved <div> for all but incl-head inside include file.

Overall this shouldn't do anything but move the magic comments around
inside the HTML files.
2021-07-10 18:48:42 -07:00
Andy McFadden
e42bb2d262 Version 1.7.5-dev1 2021-07-04 09:40:47 -07:00
Andy McFadden
05833b12b1
Merge pull request #95 from club-europe-oric/master
Adding Oric system
2021-07-03 14:47:18 -07:00
Didier
fc1b328fb4
Merge branch 'fadden:master' into master 2021-07-03 23:00:26 +02:00
dma-coco-pc
ee25373a43 Modifying errors after feedback
Compiling errors corrected
2021-07-03 22:57:33 +02:00
Andy McFadden
1472609d15 Improve label validation for platform symbol files
We were using a very simple regex pattern for the label part, and
not performing additional validation checks later.  This allowed
a symbol that started with a number (e.g. "4ALL") to get much farther
than it should have.

This change modifies the regex pattern to match only valid label
syntax.
2021-07-03 12:32:02 -07:00
dma-coco-pc
4ae22e1752 Adding Oric system
SystemDefs modified, and Oric system files added
2021-07-03 08:02:55 +02:00
Andy McFadden
210723221d Merge branch 'master' of https://github.com/fadden/6502bench 2021-06-28 13:42:38 -07:00
Andy McFadden
bc4326c5a4 Add ${ROOT} substitution
Doesn't really affect the pages on the web, but it's easier to
preview them in the filesystem when linked to "../main.css" rather
than "/main.css".

The common portion of the <head> section is now in a separate
"include" file.

Added some indentation to masthead/topnav/sidenav so it looks nicer
in the merged source listing.
2021-06-28 13:39:41 -07:00
Andy McFadden
7fc323cdef Don't strip topnav on narrow devices
The idea is to remove everything but the "HOME" link from the topnav
bar on very narrow devices, so that it doesn't look cramped.  Right
now we don't have a ton of stuff in topnav, and losing the tutorial
link is annoying.

If we want to restore this feature, we should also add a link to the
tutorial in the body of the page.
2021-06-23 13:32:04 -07:00
Andy McFadden
78eafa6100 Improve OMF feature docs 2021-06-15 08:57:00 -07:00
Andy McFadden
f451296c5b Fix sidenav highlighting
Some of these files are only having their end-of-line character
changed.
2021-06-11 15:17:05 -07:00
Andy McFadden
27624668db Merge branch 'master' of https://github.com/fadden/6502bench 2021-06-08 14:21:05 -07:00
Andy McFadden
7c5a0dfdb8 Fix web site menu button
A bit of Javascript was used to remove the hamburger icon when a
page doesn't have a #sidenav.  This worked when sidenav-incl was
being loaded with jQuery load(), because that mechanism works
asynchronously, and #sidenav was part of the DOM before it ran.
Once we started merging HTML fragments directly into the pages, the
script got called before #sidenav was defined, so the icon was
always being removed.

One solution would be to move the script to footer-incl.html, to
follow the preferred practice of placing scripts at the bottom of
the <body>.  The better solution was to move the "no-sidenav" class
from #main to <body>, so that all components can see it.  This lets
us use CSS rules to hide the icon.
2021-06-08 14:15:39 -07:00
Andy McFadden
ab8853219b Version 1.7.4 2021-06-08 13:15:19 -07:00
Andy McFadden
8df81296cb Merge branch 'master' of https://github.com/fadden/6502bench 2021-06-08 13:14:24 -07:00
Andy McFadden
fd74f1f16a Update README 2021-06-08 13:14:14 -07:00