Commit Graph

683 Commits

Author SHA1 Message Date
urchlay c768b9256a Fixed segfaults when using commands that take a filename.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@692 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-23 21:16:57 +00:00
urchlay d1a7f5f75d Added "save" command, to save the current debugger watches, breaks, etc.
In the process, I've discovered a bug in the argument processing: any of
the commands that use kARG_FILE as their first argument will work *only*
if they're the first command issued after starting Stella, otherwise
they segfault. Am investigating this now


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@691 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-23 19:07:15 +00:00
urchlay f088765c01 Many TIADebug methods for the TIA tab to use.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@690 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-23 15:55:21 +00:00
stephena 042977d4cf First pass at TiaInfoWidget, which uses the area to the right of
the TIA image to show frame/scanline related info.  In the future,
this area will also show a zoomed region of the current TIA image,
as well as a small message window.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@689 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-21 19:30:17 +00:00
stephena a9e007ca24 Fixed bug whereby debugger wasn't being drawn in software mode when
entering on a breakpoint.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@688 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-21 12:56:26 +00:00
urchlay b9c7b34505 Added color clock, CPU cycle, and pixel counters for the current scanline.
Currently they only show up in the prompt, but the TIA and TIADebug
have support for getting the current pixel clock (clocksThisLine()). The
pixel and CPU cyc are derived from the pixel clock.

Actually it's acting a bit funny, I need to find out why...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@687 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-21 04:10:16 +00:00
urchlay 59fda8dd1f Added function support (without arguments) to debugger and parser. Usage:
> function joy0right { !(*SWCHA & $80) }
> breakif joy0right

After deleting the breakif, joy0right is still defined, so you can use it
again...

At some point I plan to create a standard startup script full of useful
functions like joy0right. Also at some point functions will support
arguments...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@686 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-21 03:26:59 +00:00
stephena b9011a68f8 OK, this is the absolute last FrameBuffer optimization thing for
today (I was supposed to be working on the TIA stuff and I
haven't even touched it yet).  I think we have to accept that
software mode in Windows just isn't as fast as Linux (yay!),
and suggest not to use high resolutions in software mode.
Normal resolutions of 800x600 or below are fine; it's just
1024x768 and above that causes problems.

The good news is that OpenGL mode in Windows works better than
it ever did.  Hopefully this will take care of that other weird
OpenGL problem that I could never track down ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@685 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-20 18:44:38 +00:00
stephena a7744a466c More Win32 issues (have I ever mentioned I really hate Windows).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@684 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-20 17:49:26 +00:00
stephena a61598a33b Second pass at optimizing the FrameBuffer classes. I think I've
finally got it this time.  And as a nice side effect, it seems
that switching between debugger/emulation/launcher is working
in fullscreen Windows mode.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@683 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-20 17:33:03 +00:00
stephena d15978825a Minor refactoring of the FrameBuffer classes. OpenGL mode is now
quite fast, and is approaching software rendering speed for lower
resolutions.  In higher resolutions, OpenGL always beats software
mode.

Screen redraws are now done as rarely as possible.  For example,
when switching to menu/debugger mode or pausing emulation, CPU
usage normally drops to almost nothing.

This hasn't been tested in Windows yet, so I'm sure there'll be
some issues (there always are ...)


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@682 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-20 15:52:58 +00:00
urchlay 1694cff72d DASM listfile loading. The listing is produced by DASM's -l option,
and contains the entire asm source, plus line number/file and address
for each line.

Currently, you can either "loadlist file.lst" or else name your listing
file "romname.lst" (e.g. "dasm foo.asm -ofoo.bin -sfoo.sym -lfoo.lst").

Once loaded, you can say "list myAddress" and see that address's source
plus a few lines before & after for context.

This is a long way from true source-level debugging, but it's a start.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@681 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-20 04:28:13 +00:00
urchlay 98b1d0be24 Removed configure-cross from repository, since it's hacked up and
pretty much only works for my specific setup, I think. In the future,
the regular configure script will support cross-compiling.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@680 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 20:48:22 +00:00
stephena 6528e5d75a Some experimentation with mouse tracking in the TIA widget.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@679 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 18:21:28 +00:00
stephena 570d8735ed Totally revamped DebuggerDialog. The dialog now takes up the whole
screen, which means that the area right of the TIA image can be used
for widgets (that's the next thing I'll be doing).

Created TiaOutputWidget, which is contained in the DebuggerDialog
and handles all drawing/updating of the TIA image while in
debugger mode.  Some advantages of this are a greatly simplified
FrameBuffer::update() wrt debugger mode and instant updates for frame
and scanline advance.  Another big advantage is that the TIA image
is now a widget, which means it can receive key/mouse events.  These
events can trigger updates in other parts of the interface (imagine
clicking on a certain line and having scanlines filled to that
area, etc).  The biggest disadvantage right now is that the TIA is
redrawn each time the dialog changes (ie, when a key is pressed).
This needs to be optimized.

Fixed bug whereby toggling video modes while in the debugger
sometimes screwed up the palette.

Removed some FIXME's, since the functionality has been provided.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 17:59:59 +00:00
urchlay 8f81b56384 Fixed "sticky breakif/trap syndrome" that caused the CPU to get stuck
when we hit a trap or a breakif. This fix is kind of hackish, I've got
to come up with a better way to do it.

Improved behaviour of greying-out frame in updateScanline(). It's still
not quite right.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@677 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 02:24:13 +00:00
urchlay b1ecc27806 Added [] operator to expression syntax. foo[bar] is exactly equivalent
to *(foo+bar), just like it is in C.

Added _bank special "variable" to expression syntax. It returns the current
bank, so you can set bankswitching breakpoints:

	breakif {_bank==1 && pc==whatever}

It looks like I'm going to be using _ as a prefix that means "special
meaning; reserved; don't use in your program", just like C does. Some
existing games might need to be rewritten if they use _bank or _scan as
a label... but it'll be well worth the price, to the game author.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@676 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 01:31:37 +00:00
urchlay da7801c61b Added TiaMethodExpression. Currently all it's good for is
"breakif _scan==whatever" (break on given scanline). Eventually it'll
let us get at a lot of internal TIA state.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@675 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-19 00:05:23 +00:00
urchlay 8e1b13a136 Renamed IntMethodExpression to CpuMethodExpression, preparatory to adding
TiaMethodExpression, RiotMethodExpression, etc classes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@674 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 23:50:28 +00:00
urchlay fec77cf261 "breakif" command now tells you which breakif number you've just set. You
need the numbers so you can refer to them (e.g. delete them).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@673 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 23:00:18 +00:00
urchlay 00785163f6 Working on cross compilation.
configure-cross is my temporary work-in-progress of the configure
script, I don't want to replace the real configure script yet because
configure-cross is probably broken :(


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@672 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 21:23:04 +00:00
urchlay 0bc1dc961a Added --enable-static option to ./configure script. Note that you
must have static versions of all the libraries (like libSDL.a, libz.a,
libpng.a), or else you'll end up with the dynamic version(s) of them... so
you'd have a stella binary that's almost-static.

Also, the only way I could get things to link properly was to include
-lz in the LIBS twice: once before and once after -lpng. Removing either
one causes the link to fail on my Linux box. This could cause issues
for other systems though, am not sure...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@671 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 16:10:52 +00:00
urchlay 6ae668f236 Got rid of useless #include <vector> in YaccParser.cxx
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@670 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 02:13:57 +00:00
urchlay c90245bf9a Added "exec" command, for running script/batch files. If there's a
file named "romfile.stella" in the current directory, it will be run
at startup.

Fixed memory leakage in YaccParser, when there was a parse error.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@669 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-18 02:03:41 +00:00
stephena e6b20266be Sync Visual C++ .Net project to the latest codebase changes.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@668 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-17 16:57:22 +00:00
urchlay 2a3a2fb553 Updated debugger docs a bit
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@667 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-17 16:12:26 +00:00
urchlay 660bd1765c Conditional breaks now show up in "listbreaks", and you can delete one
with "delbreakif".


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@666 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-17 15:50:37 +00:00
urchlay 14d08d4302 We've done it!
Ladies and gentlemen, we have working conditional breakpoints! And they're
*fast*!

The command to use is "breakif". It takes one argument, the condition.
You can use curly braces if you want to include spaces in your arguments
(they don't do anything except help readability).

On the Athlon 2100, I was able to run the emulator at full speed, using
100% of the CPU, with *20* expressions of the form:

	breakif a==101||a==102||a==103||a==104||a==105

Around 25 expressions, the game started getting noticeably jerky, but was
still playable. With 1 to 5 expressions, there was *no* noticeable increase
in CPU usage!

Actually, this can probably be improved on: I used gcc 3.2.2 for
this. With 3.3.x or 4.0.x, it should be even faster.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@665 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-17 02:26:50 +00:00
stephena c592a1e47b Added 'scanline' command to parser. Has similar function to 'frame'
command; no argument advances one scanline, else advances given #
of scanlines.

Made some methods in TIA inline.  Don't know if this will have any
effect, but we'll try to be as efficient as possible.

Bumped version for the next pending alpha release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@664 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-17 00:04:00 +00:00
urchlay 1861c790a6 DebuggerParser now uses YaccParser for all argument processing.
Added rudimentary error-checking to parser and lexer: we no longer accept
invalid digits. Also fixed bug that kept YaccParser from handling hex
constants correctly.

Still TODO is to provide more friendly error messages.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@663 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 23:46:37 +00:00
urchlay f80c061d85 Grey-out old frame contents when stepping by scanline
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@662 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 23:04:15 +00:00
urchlay fbd0744474 Scan+1 button + partial scanline updates are working almost perfectly!
The only slight weirdness is: if you're on frame X, and you hit Frame+1,
the prompt will tell you you're on scanline 262 of frame X. It actually
should probably say you're on scanline 0 of frame X+1. If you do a Scan+1
from that point, it'll say you're on scanline 1 of frame X (still X,
not X+1).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@661 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 22:35:23 +00:00
stephena 2824c317a3 Fixed some 'dirty rectangle' issues when switching between scanline
advance and frame advance.  There are still some issues though.
Specifically, scanline advancing past the end of the frame shouldn't
be allowed, and this is partially causing the problems with frame
'jumping' when doing a scanline advance after a frame advance.

Still TODO is add some visual cue to indicate which scanline is
being drawn, and which onscreen data is 'old' data.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@660 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 21:29:46 +00:00
urchlay 3a49da3b6c Per-scanline update *almost* works correctly! Actually it's working,
except it lets you keep advancing past the end of the frame.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@659 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 18:25:54 +00:00
urchlay 55d57ed1ea Partial TIA updates are, well, partially supported :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@658 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-16 16:09:38 +00:00
stephena 453c7fff22 Second pass at scanline advance. It's still not working, but it's
getting closer.  I can change a color in the TiwWidget, advance a few
scanlines, then do a frame advance.  The color changes show up only
after advancing the frame, so obviously TIA::update() is doing
something that TIA::updateScanline() isn't.  Brian, any advice on
this one; it seems I don't know as much about the TIA as I
thought :(


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@657 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 18:19:29 +00:00
stephena dd5fa1d773 Added rudimentary first pass at advancing the TIA one scanline
at a time.  Of course, it doesn't actually do anything yet.

Logically, the algorithm is very simple (or at least I think it is).
I just have to figure out how to execute the 6502 until a scanline
is done.  In the process, the internal buffers (and hence the
external FrameBuffer) will be filled with data, and we just do
a FrameBuffer::refreshTIA() to 'see' the changes.  The first part
of this is the problem.  Any advice Brian??


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@656 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 15:27:29 +00:00
urchlay c271912023 OK, we no longer segfault on parse error.
However, we do leak memory: yyparse() happily allocates Expressions as
it parses, but when it hits a parse error, it doesn't return a valid
pointer to the top of the Expression tree. From what I can tell, the
so-called Expression* result is the int value of the last lexer token
cast to an Expression* (due to yacc's use of a union).

I know how to avoid the leak: we need to keep a vector of Expression
pointers in YaccParser. If there's a parse error, yyerror() can delete
all the Expressions using the vector. If not, we clear the vector (er,
calling .clear() on a vector doesn't delete all its elements, too,
does it?).  Every time yacc says "$$ = new WhateverExpression", it also
should vector.push_back($$).

Will implement this tomorrow; am getting tired & flaky.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@655 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 03:47:26 +00:00
urchlay 58925d3c92 getArgs() now accepts curly braces as arg delimiters, which allows us
to include spaces in arguments. "print 80" and "print {80}" are equivalent,
but "print 80 + 1" and "print {80 + 1}" are not (the former counts as 3
arguments, the latter only one).

Actually, I haven't tied the YaccParser to getArgs() yet, so both would
still be errors. I still need to fix the segfaults on parse error.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@654 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 03:27:04 +00:00
urchlay 8260b7b495 Added expression support for all the CPU registers.
Semi-fixed a bug: formatFlags was capitalizing the wrong flags. I'm
pretty sure it's because they were being pushed into the BoolArray in
reverse order. I "fixed" formatFlags by having it ignore the BoolArray,
and call my new CpuDebug methods to get the flag states directly.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@653 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 02:59:00 +00:00
urchlay 31e17b4627 Was going to have a WordMethodExpression, to match ByteMethodExpression,
but decided we'd be better off with just one IntMethodExpression class.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@652 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 02:30:47 +00:00
urchlay 09dd155287 Method pointer expressions. "expr a" gives current accumulator value. Try
it, then try changing the A register, then "expr". It should return the
changed value.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@651 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 02:19:07 +00:00
urchlay 1c7cb335d6 Added < and > (low byte and hi byte) operators. These are really just
a convenience: <foo is equivalent to foo&$ff (or foo%$100), and >foo is
equivalent to foo/$100, assuming foo is a 16-bit quantity.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@650 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 01:40:34 +00:00
urchlay 460c7b5254 Work in progress on expression parser. * and @ dereferences work.
Changed the % prefix for binary input to \ (backslash). It simplifies
the lexer/parser syntax *greatly*. Might change back at some point.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@649 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-15 01:20:11 +00:00
stephena 65e166cf9c Added ColorWidget, which currently only shows a color. This will
be expanded to pop up a palette when double-clicking on a color,
to visually choose a new one.

Added ColorWidgets for the 4 TIA color registers to TiaWidget.
Since these are tied to a DataGridWidget, a nice side-effect is
being able to press '+' and have all the colors cycle.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@648 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 23:47:17 +00:00
stephena 0f4b93acf3 Added non-edit mode to DataGridWidget.
Some work on TIADebug.  Change tracking now works for the color
registers.  Getting/setting the color registers works (sort of,
since the change doesn't seem to be registering in TIA).

Some work on TiaWidget.  Color registers and scanline count are
shown.  VSync and VBlank are shown, but can't be changed.

Made CheckboxWidget only emit a signal when interactively
clicking on the checkbox (changing state programmatically no
longer emits the signal).  TODO: maybe two signals should be used??


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@647 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 18:28:36 +00:00
urchlay 10298d8ba2 Fix EquateList so labels can correctly be redefined.
At this point, you should be able to do this:

> define foo 1
> expr foo+1
result: 2
> define foo 2
> expr
result: 3
> undef foo
> expr
result: 0   <-- because undefined labels are treated as -1. Bug?


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@646 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 15:28:51 +00:00
urchlay 8476dcd6d1 YaccParser now supports EquateExpressions
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@645 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 15:13:58 +00:00
stephena 59524329ef Some more changes for the 'height' command, cleaning up some
crufty code.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@644 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 15:13:14 +00:00
stephena c0924eaf4f Fixed divide by 0 problem. This will slow down the division expression
slighly, but better slower than crashing the program.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@643 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-07-14 12:28:53 +00:00