diff --git a/stella/Debugger.txt b/stella/Debugger.txt index 0dbdcff6a..7386fbbeb 100644 --- a/stella/Debugger.txt +++ b/stella/Debugger.txt @@ -31,7 +31,10 @@ What the debugger can do: - Save CLI session to a text file. - Supports hex, decimal, and binary input and output almost everywhere. (disassembly is still hex) -- (partial) Support for bank switching. Only F8 cart type works for now. +- Support for bank switching. You can see how many banks a cart has, + and switch banks. There's still more to be done here though. +- Patching ROM in-place. Currently there's no way to save the patched + ROM though. Planned features for Stella 2.0 release: - Better TIA state display, with register names and GUI buttons for @@ -44,15 +47,16 @@ Planned features for Stella 2.0 release: - TIA display should be updated during step/trace, so we can see our scanlines being drawn as it happens. The emulation core wasn't designed with this in mind, so it'll take a lot of work -- Bankswitch support in the debugger for the remaining 20-odd cart - types. Each one has to be added individually. +- Bankswitch support in the debugger for the few remaining cart types + that aren't supported. +- Patch ROM support for a few cart types doesn't work. Future plans (post 2.0): - Advanced breakpoint support (e.g. Break when carry flag changes, or break when player 0 collides with player 1, etc). This will implemented as a scripting language for the CLI. -- Ability to patch ROM in-place, possibly including a mini-assembler +- Possibly a mini-assembler - Support for extra RAM in Supercharger and other cart types. - Possibly support for recording and playing back input files, like MAME. This isn't a debugger feature per se, but it'll make it easier diff --git a/stella/Makefile b/stella/Makefile index c0c2939d7..54f5300c1 100644 --- a/stella/Makefile +++ b/stella/Makefile @@ -1,4 +1,4 @@ -# $Header: /home/stephena/STELLA_CVS-to-SVN/stella/Makefile,v 1.2 2005-06-28 23:17:58 stephena Exp $ +# $Header: /home/stephena/STELLA_CVS-to-SVN/stella/Makefile,v 1.3 2005-06-29 00:31:48 urchlay Exp $ ####################################################################### # Default compilation parameters. Normally don't edit these # @@ -22,7 +22,7 @@ include config.mak # CXXFLAGS+= -Werror CXXFLAGS:= $(CXXFLAGS) -CXXFLAGS+= -Wall -Wuninitialized -Wno-multichar -Wunused +CXXFLAGS+= -O2 -Wall -Wuninitialized -Wno-multichar -Wunused # Even more warnings... #CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion #CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index b0189218f..1c0c41a0b 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.cxx,v 1.38 2005-06-28 03:34:40 urchlay Exp $ +// $Id: Debugger.cxx,v 1.39 2005-06-29 00:31:48 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -729,8 +729,3 @@ bool Debugger::patchROM(int addr, int value) { return myConsole->cartridge().patch(addr, value); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Debugger::fry() { - for (int ZPmem=0; ZPmem<255; ZPmem += rand() % 4) - mySystem->poke(ZPmem, mySystem->peek(ZPmem) & (uInt8)rand() % 256); -} diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 1d0fb1fcf..4a78a757f 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.hxx,v 1.35 2005-06-28 03:34:40 urchlay Exp $ +// $Id: Debugger.hxx,v 1.36 2005-06-29 00:31:48 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -51,7 +51,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.35 2005-06-28 03:34:40 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.36 2005-06-29 00:31:48 urchlay Exp $ */ class Debugger : public DialogContainer { @@ -237,7 +237,6 @@ class Debugger : public DialogContainer bool patchROM(int addr, int value); void saveState(int state); void loadState(int state); - void fry(); protected: Console* myConsole; diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index eee8fdb7f..b42000e68 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.cxx,v 1.41 2005-06-28 03:34:40 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.42 2005-06-29 00:31:48 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -137,14 +137,6 @@ Command DebuggerParser::commands[] = { &DebuggerParser::executeFrame }, - { - "fry", - "\"Fry\" console (randomly corrupt memory)", - false, - { kARG_END_ARGS }, - &DebuggerParser::executeFry - }, - // TODO: height command { @@ -1080,11 +1072,6 @@ void DebuggerParser::executeFrame() { if(count != 1) commandResult += "s"; } -// "fry" -void DebuggerParser::executeFry() { - debugger->fry(); -} - // "listbreaks" void DebuggerParser::executeListbreaks() { commandResult = listBreaks(); diff --git a/stella/src/debugger/DebuggerParser.hxx b/stella/src/debugger/DebuggerParser.hxx index 0e4cc0d9c..b4969a8e1 100644 --- a/stella/src/debugger/DebuggerParser.hxx +++ b/stella/src/debugger/DebuggerParser.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.hxx,v 1.22 2005-06-28 03:34:40 urchlay Exp $ +// $Id: DebuggerParser.hxx,v 1.23 2005-06-29 00:31:48 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_PARSER_HXX @@ -100,7 +100,6 @@ class DebuggerParser void executeDisasm(); void executeDump(); void executeFrame(); - void executeFry(); void executeHelp(); void executeListbreaks(); void executeListtraps(); diff --git a/stella/src/emucore/Console.cxx b/stella/src/emucore/Console.cxx index fd474a963..331185a61 100644 --- a/stella/src/emucore/Console.cxx +++ b/stella/src/emucore/Console.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Console.cxx,v 1.61 2005-06-27 04:45:52 urchlay Exp $ +// $Id: Console.cxx,v 1.62 2005-06-29 00:31:49 urchlay Exp $ //============================================================================ #include @@ -350,6 +350,13 @@ void Console::setPalette() myOSystem->frameBuffer().setPalette(myMediaSource->palette()); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Console::fry() +{ + for (int ZPmem=0; ZPmem<255; ZPmem += rand() % 4) + mySystem->poke(ZPmem, mySystem->peek(ZPmem) & (uInt8)rand() % 256); +} + #ifdef DEVELOPER_SUPPORT // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Console::changeXStart(const uInt32 direction) diff --git a/stella/src/emucore/Console.hxx b/stella/src/emucore/Console.hxx index 3a28c91b6..9e170be3e 100644 --- a/stella/src/emucore/Console.hxx +++ b/stella/src/emucore/Console.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Console.hxx,v 1.34 2005-06-27 04:45:52 urchlay Exp $ +// $Id: Console.hxx,v 1.35 2005-06-29 00:31:49 urchlay Exp $ //============================================================================ #ifndef CONSOLE_HXX @@ -37,7 +37,7 @@ class System; This class represents the entire game console. @author Bradford W. Mott - @version $Id: Console.hxx,v 1.34 2005-06-27 04:45:52 urchlay Exp $ + @version $Id: Console.hxx,v 1.35 2005-06-29 00:31:49 urchlay Exp $ */ class Console { @@ -155,6 +155,11 @@ class Console */ void setPalette(); + /** + "Fry" the Atari (mangle memory/TIA contents) + */ + void fry(); + TIADebug *tiaDebugger() { return myTIAdebugger; } #ifdef DEVELOPER_SUPPORT diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 133d2cd4b..5f9c8a9c7 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.77 2005-06-28 03:34:41 urchlay Exp $ +// $Id: EventHandler.cxx,v 1.78 2005-06-29 00:31:49 urchlay Exp $ //============================================================================ #include @@ -92,6 +92,8 @@ EventHandler::EventHandler(OSystem* osystem) setActionMappings(); myGrabMouseFlag = myOSystem->settings().getBool("grabmouse"); + + myFryingFlag = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -633,6 +635,10 @@ void EventHandler::handleKeyEvent(int unicode, SDLKey key, SDLMod mod, uInt8 sta enterDebugMode(); return; } + else if(myKeyTable[key] == Event::Fry) + { + myFryingFlag = bool(state); + } else handleEvent(myKeyTable[key], state); @@ -842,10 +848,6 @@ void EventHandler::handleEvent(Event::Type event, Int32 state) return; } } - else if(myState == S_EMULATE && event == Event::Fry) - { - myOSystem->debugger().fry(); - } else if(event == Event::Quit) { myQuitFlag = true; diff --git a/stella/src/emucore/EventHandler.hxx b/stella/src/emucore/EventHandler.hxx index e48674cae..538f2afc8 100644 --- a/stella/src/emucore/EventHandler.hxx +++ b/stella/src/emucore/EventHandler.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.hxx,v 1.42 2005-06-28 04:40:21 urchlay Exp $ +// $Id: EventHandler.hxx,v 1.43 2005-06-29 00:31:49 urchlay Exp $ //============================================================================ #ifndef EVENTHANDLER_HXX @@ -74,7 +74,7 @@ struct Stella_Joystick { mapping can take place. @author Stephen Anthony - @version $Id: EventHandler.hxx,v 1.42 2005-06-28 04:40:21 urchlay Exp $ + @version $Id: EventHandler.hxx,v 1.43 2005-06-29 00:31:49 urchlay Exp $ */ class EventHandler { @@ -240,6 +240,8 @@ class EventHandler */ void handleEvent(Event::Type type, Int32 value); + bool frying() { return myFryingFlag; } + private: /** Send a keyboard event to the handler. @@ -332,6 +334,9 @@ class EventHandler // Indicates whether to use launcher mode when exiting a game bool myUseLauncherFlag; + // Indicates whether or not we're in frying mode + bool myFryingFlag; + // Indicates which paddle the mouse currently emulates Int8 myPaddleMode; diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index 18ff937c0..450c516f3 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx,v 1.48 2005-06-25 16:35:36 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.49 2005-06-29 00:31:49 urchlay Exp $ //============================================================================ #include @@ -168,7 +168,11 @@ void FrameBuffer::update() { // Draw changes to the mediasource if(!myPauseStatus) + { myOSystem->console().mediaSource().update(); + if(myOSystem->eventHandler().frying()) + myOSystem->console().fry(); + } // We always draw the screen, even if the core is paused drawMediaSource();