Fixed some memory leaks in EquateList, and moved to using a dynamic array.
This greatly simplifies the code and abstracts away all new/delete
operations. More cleanup can still be done, since the symfile no longer has
to be scanned for # of lines. Still TODO is similar code for the watchlist
stuff, so all memleaks can be eliminated.
Changed launcher so that if Stella is started with no romdir specified
(maybe first time it's been used), the launcher options are shown so
you can select the romdir. Thanks to Brad for the advice.
Updated LauncherOptionsDialog to send a signal when a romdir has been
set. When that happens, the launcher automatically reloads the rom listing.
Again, thanks to Brad for the advice.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@539 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Unfortunately, there's no way to trap a memory access before it happens.
Unlike breakpoints, traps can occur in mid-instruction. We can't stop
the 6502 in mid-instruction, and wouldn't want to if we could (for one
thing there's no way to continue from that point). This means that, when
you hit a trap, the current instruction is the one *after* the one that
triggered the trap. (This is different from a breakpoint: when you hit
a breakpoint, the current instruction will be the one at the breakpoint,
which hasn't executed yet).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@538 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
trap, the PC keeps getting reset to the start of the frame. FYI,
traps are like breakpoints, only they trigger on any access of the
trap location (e.g. loading data from it, rather than executing it
as a breakpoint).
Fixed two nasty bugs:
1. Debugger::disassemble() was printing hex bytes from the wrong address.
This is because I used readRAM(), which wants a parameter of 0-127, and
reads only from RAM. I *should* have been using peek(), which takes a
16-bit address. In fact, readRAM() is only for the GUI.
2. D6502::disassemble() was printing wrong operands in zero,x and
zero,y addressing modes, due to me passing a wrong number of places
(and thus creating a wrong format string).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@537 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
evaluated and printed before each prompt. Since they're evaluated at
print-time, you can say e.g. "watch a" or "watch *myCounter" and it'll
do what you want.
Added "dump" command. This dumps any address you give it, not just RAM,
and it respects the current base setting (bin, dec, hex). Actually I may
rename the "ram" command to "mem" and allow it to work on non-RAM, and
merge the "dump" command with that.
The debugger state() now respects the default base (the registers are
printed in whatever base the user has selected with the "base" command).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@535 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Added PC, SP, A, X, Y registers to the CpuWidget. These registers
can now be changed and viewed while stepping/tracing.
Still TODO is add a ToggleBitWidget to enable toggling of the
individual bits in the Processor Flag register.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@534 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Renamed ByteGridWidget to DataGridWidget, because it can be used to accept data
other than bytes (also words).
Further work on making the GUI use whichever base you set as default. This
one seems to be a hard nut to crack.
Changed behaviour of '-debugheight' to specify the number of lines to use
for the debugging area, vs the absolute pixels to use. So '-debugheight 20'
would make the debugger be 20 lines tall (in the PromptWidget). The minimum
height is now 15 lines, and all GUI elements will be drawn according to this.
Still TODO is get the 'height' command to work in the debugger.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@533 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
which defaults to kBASE_DEFAULT (which means to use the DebuggerParser's
current input base, set with the "base" command).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@532 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Added -debugheight command line option. The height may not be set to
anything below 383 (which is the default).
Attempted to implement a "height" command in the prompt, but either I'm
doing something wrong (most likely), or the debugger can't be resized
after it's started.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@531 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
another class. Also added decimal support, plus default base support. As
a side benefit, there's much better syntax checking.
Also you can now do a word-pointer dereference with "@address". This
works just like "*address" except that it returns a 16-bit value.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@529 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
They work just like the ones in DASM: "<1234" is "34" and ">1234" is "12".
They can of course be used with labels, and they can be prefixed with "*"
for dereference.
Implemented binary input in CLI. Like DASM: prefix with "%" to treat
your argument as binary. "%10101010" means hex "ff". Can be stacked with
other prefixes.
Stacking order of prefixes is important. "*" must come first, if present.
Then ">" or "<" if present (but not both!). Then "%" if present. Currently
there's no real error checking for this.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@528 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
location 80 to the contents of the X register by saying "ram 80 x". This
also means that there's a small conflict: if you're inputting the value
0x0a (decimal 10), you need to either say "0a" or "A". Otherwise the
parser thinks you're talking about the "a" register instead of the hex
number "a".
Added dereference operator to arg processing. This works the same way as
in C: you prefix a "*" to an argument. So "80" means a literal hex 80,
as before, but you can say "*80" to mean "the memory location pointed to
by location 80"... this also works with the registers. Example: if the X
register holds the value ff, you can say "*x" and it will be treated as
the value ff. Unlike C, multiple levels of dereference are not supported.
Also, the result of a dereference is always a byte for now.
Added "eval" command to debugger prompt. This evaluates one or more
arguments (which may hex values or a labels, and may have a * in front)
and prints the results in hex, binary, and decimal, along with the label
that has that value, if any.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@527 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
out the M6502's breakPoints, so any speed decrease caused by breakpoint
checking logic should go away after breakpoints are cleared.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@526 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
in RAM tab from "~" to "Neg". ~ is the invert/complement operator in C,
not negation. I thought about using a minus sign, but it's visually too
similar to the -- for decrement...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@523 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
is currently somewhat broken, and I'm thinking this may be related to the
mysterious OpenGL Linux problems as well.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@522 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
code than the current line.
On ROM load, we replace the file extension with .sym and attempt to load
that as a symbol file for the debugger. No harm is done if the file is
missing.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@521 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
buttons to the RamWidget. They operate on the currently selected memory
location.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@520 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
the frame by 1 can be very useful, in that you can change a memory location,
do a frame advance, and then see any results graphically.
Eventually the trace and step will work the same way, and show changes
to the scanline as it's being drawn.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@518 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
of Stella. It defaults to true/on, so if you don't want centering, use
'-center false' on the commandline at least once (or edit the config file).
Some more work on the RamWidget and ByteGridWidget. Entering values in hex
now works correctly, and 128 byte RAM area is now updated.
More work on the automatic updating of the tabs. Tabs are now updated when
debugging mode is entered, or when a new tab is selected.
Shortened the width of the debugging tab area and added an area for commonly
use actions/buttons on the right. Currently it contains 'Step' and 'Trace'
buttons.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@517 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
now: set/clear a breakpoint, clear all breakpoints, list breakpoints
(including labels in the output!). The 6502 no longer gets "stuck" on a
breakpoint if you quit the debugger while the current PC is a breakpoint.
Some work on the prompt console. The CPU state information shouldn't be
stale any more.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@516 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
may not be able to add column labels because we need the vertical space
for buttons. Also, the ByteGrid is now drawn correctly.
Added initial infrastructure for a tab to reload itself, either on command
or when a new tab is selected.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@515 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
rather than the result of each command. This makes breakpoints a little
nicer (you see the state as soon as you hit the breakpoint).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@511 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
directly.
Updated M6502 classes to call Debugger::start when a breakpoint is hit.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@510 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
clears breakpoints, and the 6502 core emits a "hit breakpoint" message
to standard error when it sees a breakpoint. Still TODO is to figure out
how to enter the debugger from within the 6502 core! (Stephen?)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@509 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
color; this will have to change. This makes it much easier to navigate
with the keyboard, since it's now easy to see which widget you've tabbed to.
Added some copyright stuff to the debugger classes.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@506 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Debugger, which gets used by both DebuggerParser and D6502, but
neither one keeps a pointer to it permanently.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@505 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
Still TODO is somehow draw around the currently active widget,
to show which widget is actually active.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@504 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
CVS). This means you can now edit the contents of a ListWidget, and
do something with those new contents based on the signal that's emitted.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@499 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
is working except for changing values (but you can still use the RAM tab
to do that).
Basically, the rules are as follows:
1) Only works on decimal input for now.
2) Search with empty input returns all addresses (128 bytes).
3) Comparing a value after a search inspects the current result set
for the given value.
4) Compare can make use of 'comparitive' operators '+' and '-'. If
specified at the start of input, they search by offset.
Typical uses are as follows:
1) Search for a '3', then compare to a '2'. This finds the memory location
that at first contained 3, then later changed to 2 (maybe you lost a life or
something).
2) Search for all values (leave input blank), then compare to '-1'. This
finds all memory locations that have decreased by 1 (useful when you don't
know where to start).
I guess after this, Stella will officially be banned from hi-score contests :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@497 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
the 'Tab' key, though.
Fixed Unicode issues whereby modifier keys couldn't be used as gaming keys.
Made the 'Left Control' key be one of the defaults for 'Player 1 Fire'. The
other two are 'Joystick 0, button 0' and 'Space' key.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@496 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
case-insensitively!
We look for labels *first*, so if there were a label "aa", it'd
be impossible to input the hex value "aa" (the label would take
precedence). This doesn't matter for now, since the labels are hard-coded
and none of them conflict with anything, but in the future we'll be
loading symbol files... even then, I don't think anyone's dumb enough
to create a label that looks like a hex value, but it could happen...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@495 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba