1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-05 06:04:36 +00:00
Commit Graph

248 Commits

Author SHA1 Message Date
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
ea92edd9d1 Include cc65 .cfg files when copying regression tests 2019-08-02 12:54:26 -07:00
Andy McFadden
1219755e85 Remove WinForms code 2019-08-02 12:48:12 -07:00
Andy McFadden
2a901cc373 Update README 2019-07-29 14:16:32 -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
b617d72b70 Rename MakeDistWPF to MakeDist 2019-07-19 17:55:27 -07:00
Andy McFadden
827d6108e2 Rename MakeDist to MakeDistWF 2019-07-19 17:50:22 -07:00
Andy McFadden
38b5027af1 Port MakeDist to WPF
The only tricky part is the RichTextBox, but that's mostly copy and
paste from the regression test harness.
2019-07-19 17:40:35 -07:00
Andy McFadden
b6132b029a Move WorkProgress dialog into CommonWPF library 2019-07-19 16:37:51 -07:00
Andy McFadden
be0e6bead1 Minor reshuffling
This was an attempt to add a "loading..." dialog during the initial
open of the project.  This can have some lag because we create a
sandbox (which is currently taking about 300ms) and do a full project
refresh (which can take more than a second on a large 65816 project).

The trick is that we need to do these things on a background thread
while the main thread manages the UI.  We can't manipulate the UI
from the background thread.  For the most part this works, as the
project refresh stuff isn't tied to the UI, but we run into trouble
when generating the line list.  As currently implemented, the line
generator interacts directly with DisplayList, which is acting as an
ItemsSource for the main ListView.

To make this work correctly we'd need to dissociate DisplayList from
LineListGen, e.g. by having DisplayList record but defer changes
until a "go" method is called on the main thread.

The speed is only an issue for large programs, which aren't really
supported yet -- the UI is awkward to use with large files -- so I'm
not going to pursue this further for now.

Also, an unrelated fix: there was an issue where the current ListView
scroll position would be retained if you opened a project while one
was already open.  Harmless but weird.  We now scroll to the top.
2019-07-19 15:24:51 -07:00
Andy McFadden
84f4075ad4 Show a wait cursor when refreshing larger projects
Fiddled with the status bar, but that'll probably require async.
2019-07-19 11:41:18 -07:00
Andy McFadden
1044b9d479 Improve restoration of top position
The ListView control provides a ScrollIntoView() method that ensures
the specified item is on screen, scrolling the ListView if needed.
Unfortunately this method is very slow (50-100 ms) and sometimes
fails entirely on larger lists.  (Yay WPF.)

Because the ListView is scrolling by fixed-height item, it's possible
to use the underlying ScrollViewer to move the list instantaneously
and reliably.  So now we do that.

Also, fixed a bug with select-all, where we weren't clearing the
previous selection before calling SelectAll(), leading to a mismatch
with the secondary data structure that we maintain because WPF
ListViews can't deal with large selections efficiently.  (Yay WPF.)

There's still some weird behavior, e.g. sometimes hitting F5 clears
the current selection and sometimes it doesn't.  I think it's related
to which item has focus and the fact you're hitting a key; using the
debug menu item doesn't cause the behavior.

Also, increased MAX_SEL_COUNT from 2000 to 5000.  That takes about
200ms to restore to a ListView on my 5-year-old system.
2019-07-17 17:59:24 -07:00
Andy McFadden
a0dca6a5be Improve save & restore of top line
Whenever the display list gets regenerated, we need to restore the
code list view scroll position to the previous location in the file.
This gets tricky when multiple lines are appearing or disappearing.
We were saving the file offset of the line, but that works poorly
when there's a multi-line comment associated with that offset,
because we end up scrolling to the top of the comment whenever any
part of the comment is at the top of the screen.

We now track the file offset and the number of lines we were from
the top of that offset's content.  This works well unless we remove
a lot of lines.  If the adjusted line index would put us into a
different file offset, we punt and just scroll to the top of the item.

Also, fix a crasher in Edit Note.

Also, fix behavior when the list shrinks while a line near the end
of the file is selected.

Also, change a few instances of "Color.FromArgb(0,0,0,0)" to use a
common constant.
2019-07-17 14:08:53 -07:00
Andy McFadden
0ff2ebefdf Implement the "configure" button in the asm/gen dialog 2019-07-16 17:16:47 -07:00
Andy McFadden
310ed7649b Save & restore symbols list filter options 2019-07-16 14:52:08 -07:00
Andy McFadden
b42aa80cff Set main window title 2019-07-16 14:36:09 -07:00
Andy McFadden
b93def6560 Implement debug info windows
Show analysis timers, show analyzer output, and show undo/redo
history.

With this change, all main menu items have been ported to WPF.
2019-07-15 17:18:28 -07:00
Andy McFadden
2afdaf4ad3 Implement Extension Script Info debug feature 2019-07-15 16:50:54 -07:00
Andy McFadden
ef4fe35813 Implement simple DEBUG menu items
Refresh, comment ruler toggle, keep-alive toggle.
2019-07-15 15:32:27 -07:00
Andy McFadden
8a483f06c2 Implement Toggle ASCII Chart
While I was at it, I noticed that the ASCII chart and hex dump
viewer windows were always in front of the main app window.  It looks
like child windows are always in front.  The easy fix is to not
set an owner.

This causes a new problem: the windows don't get closed automatically
when the parent window closes, and the app won't exit until all
windows are closed.  So we now explicitly close the hex dump and
ASCII chart windows when the main window is closed, and we now keep
track of all the external-file hex dump windows.  (It always sort of
bothered me that we were creating hex dump windows and not keeping
track of them.  Itch has now been scratched.)

Also, changed the ascch-mode setting to be an enum rather than an
integer.  Renamed the setting to ascch-mode1.
2019-07-14 18:12:03 -07:00
Andy McFadden
93dd5b41c6 Tweak two app setting names
The contents of cdlv-col-widths and hexd-char-conv have changed.  The
app correctly ignores things it doesn't understand when going either
forward or backward (between SourceGen and SourceGenWPF), but it's
nicer to just not have the settings get clobbered.
2019-07-14 16:28:54 -07:00
Andy McFadden
c3d03b29ad Set background color on Notes in the code list 2019-07-14 15:39:27 -07:00
Andy McFadden
131d1a7a63 Fix obscure list traversal issue
If you select a note, delete it, select some nearby lines, and hit
undo, then the next time you hit up/down arrow the list will jump
back to the first line.  The workaround for this appears to be to
set the focus on a selected ListViewItem from an obscure event.

Maybe there's a simpler way that I just missed?  This is absurd.
(Yay WPF.)
2019-07-14 15:11:27 -07:00
Andy McFadden
380c56a4ef Recalculate list indices after adding or removing lines
Minor display list bug that presented itself when a 3-line note
was deleted.
2019-07-14 14:41:46 -07:00
Andy McFadden
12874d32ba Implement three shortcut commands
Added:
  Toggle Single-BYte Format (Ctrl+B)
  Format As Word (Ctrl+W)
  Delete Note/Long Comment (Del)
2019-07-14 13:50:15 -07:00
Andy McFadden
2dd21d433d Implement Edit Project Symbol 2019-07-14 13:18:10 -07:00
Andy McFadden
f8b1fa3d66 Implement Edit Note 2019-07-13 17:04:47 -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
c6b63afb3e Layout and basic integration of Format Split Address Table 2019-07-13 13:31:51 -07:00
Andy McFadden
0d75282756 Minor tweaks 2019-07-13 11:29:05 -07:00
Andy McFadden
ea3108c564 Implement Tools > Hex Dump 2019-07-12 17:46:37 -07:00
Andy McFadden
acfbfcb642 Implement Show Hex Dump
Because of the way data virtualization works (or doesn't) in WPF,
this was a whole lot different from WinForms.  What I'm doing is
pretty simple, so I avoided the complexity (and quirks) inherent
to more complete data virtualization solutions.  (All I really want
is to not render the entire thing up front.)
2019-07-12 17:08:54 -07:00
Andy McFadden
b1f84864d6 Implement Edit Comment
I still don't know why Windows wants to refer to semicolon as
"Oem1".  Happily it's possible to override the tip string.
2019-07-11 15:55:43 -07:00
Andy McFadden
e97672697c Finish Edit Data Operand dialog
I looked at doing this in full WPF fashion, binding context object
properties to radio button IsChecked properties, but there's a lot
of conditional logic behind the scenes.  I also wanted to do the
various formatted strings with a StringFormat binding, but that only
takes one argument, and some of them need two.

On the plus side, the format strings are now in Window.Resources,
rather than the global string table or the buttons themselves.
(The latter always felt a little sleazy, but it seemed like the
least annoying way to do it in WinForms.)
2019-07-11 13:56:16 -07:00