mirror of https://github.com/stella-emu/stella.git
Cleaned up some more FIXME and TODO:
1) Removed all references to FBO in OpenGL. I won't be taking this path, and will wait until SDL 2.0 integrates it directly. In fact, most of the OpenGL TV filters will disappear in the next release, to be replaced with Blargg NTSC filtering. 2) Defined the remaining color constants in OSystem. Re-added showing the results of parsing debugger script commands in the prompt. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2003 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
b3a16fc0a5
commit
a2ca2730c1
|
@ -190,11 +190,6 @@ bool FrameBufferGL::loadFuncs(GLFunctionality functionality)
|
|||
OGL_INIT(void,glMultiTexCoord2f,(GLenum, GLfloat, GLfloat));
|
||||
OGL_INIT(GLenum,glGetError,(void));
|
||||
break; // kGLShader
|
||||
|
||||
case kGL_FBO:
|
||||
// TODO - add support for frame buffer objects / render-to-texture
|
||||
return false;
|
||||
break; // kGL_FBO
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -181,7 +181,7 @@ class FrameBufferGL : public FrameBuffer
|
|||
|
||||
private:
|
||||
enum GLFunctionality {
|
||||
kGL_BASIC, kGL_SHADER, kGL_FBO
|
||||
kGL_BASIC, kGL_SHADER
|
||||
};
|
||||
bool loadFuncs(GLFunctionality functionality);
|
||||
|
||||
|
|
|
@ -233,27 +233,26 @@ void Debugger::quit()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Debugger::autoExec()
|
||||
string Debugger::autoExec()
|
||||
{
|
||||
ostringstream buf;
|
||||
|
||||
// autoexec.stella is always run
|
||||
const string& autoexec = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
||||
"autoexec.stella";
|
||||
FilesystemNode autoexec_node(autoexec);
|
||||
if(autoexec_node.exists())
|
||||
myPrompt->print("autoExec():\n" + myParser->exec(autoexec) + "\n");
|
||||
FilesystemNode autoexec(myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
||||
"autoexec.stella");
|
||||
buf << "autoExec():" << endl
|
||||
<< myParser->exec(autoexec) << endl;
|
||||
|
||||
// Also, "romname.stella" if present
|
||||
string file = myOSystem->romFile();
|
||||
|
||||
string::size_type pos;
|
||||
if( (pos = file.find_last_of('.')) != string::npos )
|
||||
file.replace(pos, file.size(), ".stella");
|
||||
else
|
||||
file += ".stella";
|
||||
|
||||
FilesystemNode romname_node(file);
|
||||
if(romname_node.exists())
|
||||
myPrompt->print("autoExec():\n" + myParser->exec(file) + "\n");
|
||||
FilesystemNode romname(file);
|
||||
buf << myParser->exec(romname) << endl;
|
||||
|
||||
// Init builtins
|
||||
for(int i = 0; builtin_functions[i][0] != ""; i++)
|
||||
|
@ -264,6 +263,7 @@ void Debugger::autoExec()
|
|||
Expression* exp = YaccParser::getResult();
|
||||
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
|
||||
}
|
||||
return buf.str();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -171,7 +171,7 @@ class Debugger : public DialogContainer
|
|||
*/
|
||||
int cycles();
|
||||
|
||||
void autoExec();
|
||||
string autoExec();
|
||||
|
||||
string showWatches();
|
||||
|
||||
|
|
|
@ -123,36 +123,31 @@ string DebuggerParser::run(const string& command)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string DebuggerParser::exec(const string& file, bool verbose)
|
||||
string DebuggerParser::exec(const FilesystemNode& file)
|
||||
{
|
||||
string ret;
|
||||
int count = 0;
|
||||
char buffer[256]; // FIXME: static buffers suck
|
||||
if(file.exists())
|
||||
{
|
||||
ifstream in(file.getPath().c_str());
|
||||
if(!in.is_open())
|
||||
return red("file \'" + file.getRelativePath() + "\' not found.");
|
||||
|
||||
FilesystemNode node(file);
|
||||
ifstream in(node.getPath().c_str());
|
||||
if(!in.is_open())
|
||||
return red("file \'" + node.getRelativePath() + "\' not found.");
|
||||
ostringstream buf;
|
||||
int count = 0;
|
||||
char buffer[256];
|
||||
while( !in.eof() )
|
||||
{
|
||||
if(!in.getline(buffer, 255))
|
||||
break;
|
||||
|
||||
while( !in.eof() ) {
|
||||
if(!in.getline(buffer, 255))
|
||||
break;
|
||||
|
||||
count++;
|
||||
if(verbose) {
|
||||
ret += "exec> ";
|
||||
ret += buffer;
|
||||
ret += "\n";
|
||||
ret += run(buffer);
|
||||
ret += "\n";
|
||||
count++;
|
||||
}
|
||||
buf << "Executed " << debugger->valueToString(count) << " commands from \""
|
||||
<< file.getRelativePath() << "\"";
|
||||
|
||||
return buf.str();
|
||||
}
|
||||
ret += "Executed ";
|
||||
ret += debugger->valueToString(count);
|
||||
ret += " commands from \"";
|
||||
ret += file;
|
||||
ret += "\"\n";
|
||||
return ret;
|
||||
else
|
||||
return red("file \'" + file.getRelativePath() + "\' not found.");
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -866,7 +861,8 @@ void DebuggerParser::executeDump()
|
|||
// "exec"
|
||||
void DebuggerParser::executeExec()
|
||||
{
|
||||
commandResult << exec(argStrings[0]);
|
||||
FilesystemNode file(argStrings[0]);
|
||||
commandResult << exec(file);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -28,6 +28,7 @@ struct Command;
|
|||
#include "bspf.hxx"
|
||||
#include "Array.hxx"
|
||||
#include "FrameBuffer.hxx"
|
||||
#include "FSNode.hxx"
|
||||
|
||||
typedef enum {
|
||||
kBASE_16,
|
||||
|
@ -47,7 +48,7 @@ class DebuggerParser
|
|||
string run(const string& command);
|
||||
|
||||
/** Execute parser commands given in 'file' */
|
||||
string exec(const string& file, bool verbose = true);
|
||||
string exec(const FilesystemNode& file);
|
||||
|
||||
/** Given a substring, determine matching substrings from the list
|
||||
of available commands. Used in the debugger prompt for tab-completion */
|
||||
|
|
|
@ -494,13 +494,14 @@ void PromptWidget::loadConfig()
|
|||
string version = string("Stella ") + STELLA_VERSION + "\n";
|
||||
print(version.c_str());
|
||||
print(PROMPT);
|
||||
_promptStartPos = _promptEndPos = _currentPos;
|
||||
|
||||
_firstTime = false;
|
||||
_exitedEarly = false;
|
||||
|
||||
// Take care of one-time debugger stuff
|
||||
instance().debugger().autoExec();
|
||||
print(instance().debugger().autoExec().c_str());
|
||||
print(PROMPT);
|
||||
|
||||
_promptStartPos = _promptEndPos = _currentPos;
|
||||
_firstTime = false;
|
||||
_exitedEarly = false;
|
||||
}
|
||||
else if(_exitedEarly)
|
||||
{
|
||||
|
|
|
@ -1003,12 +1003,12 @@ bool OSystem::queryVideoHardware()
|
|||
/*
|
||||
Palette is defined as follows:
|
||||
// Base colors
|
||||
kColor TODO
|
||||
kBGColor TODO
|
||||
kColor Normal foreground color (non-text)
|
||||
kBGColor Normal background color (non-text)
|
||||
kShadowColor Item is disabled
|
||||
kTextColor Normal text color
|
||||
kTextColorHi Highlighted text color
|
||||
kTextColorEm TODO
|
||||
kTextColorEm Emphasized text color
|
||||
|
||||
// UI elements (dialog and widgets)
|
||||
kDlgColor Dialog background
|
||||
|
|
Loading…
Reference in New Issue