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(void,glMultiTexCoord2f,(GLenum, GLfloat, GLfloat));
|
||||||
OGL_INIT(GLenum,glGetError,(void));
|
OGL_INIT(GLenum,glGetError,(void));
|
||||||
break; // kGLShader
|
break; // kGLShader
|
||||||
|
|
||||||
case kGL_FBO:
|
|
||||||
// TODO - add support for frame buffer objects / render-to-texture
|
|
||||||
return false;
|
|
||||||
break; // kGL_FBO
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -181,7 +181,7 @@ class FrameBufferGL : public FrameBuffer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum GLFunctionality {
|
enum GLFunctionality {
|
||||||
kGL_BASIC, kGL_SHADER, kGL_FBO
|
kGL_BASIC, kGL_SHADER
|
||||||
};
|
};
|
||||||
bool loadFuncs(GLFunctionality functionality);
|
bool loadFuncs(GLFunctionality functionality);
|
||||||
|
|
||||||
|
|
|
@ -233,27 +233,26 @@ void Debugger::quit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Debugger::autoExec()
|
string Debugger::autoExec()
|
||||||
{
|
{
|
||||||
|
ostringstream buf;
|
||||||
|
|
||||||
// autoexec.stella is always run
|
// autoexec.stella is always run
|
||||||
const string& autoexec = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
FilesystemNode autoexec(myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
||||||
"autoexec.stella";
|
"autoexec.stella");
|
||||||
FilesystemNode autoexec_node(autoexec);
|
buf << "autoExec():" << endl
|
||||||
if(autoexec_node.exists())
|
<< myParser->exec(autoexec) << endl;
|
||||||
myPrompt->print("autoExec():\n" + myParser->exec(autoexec) + "\n");
|
|
||||||
|
|
||||||
// Also, "romname.stella" if present
|
// Also, "romname.stella" if present
|
||||||
string file = myOSystem->romFile();
|
string file = myOSystem->romFile();
|
||||||
|
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
if( (pos = file.find_last_of('.')) != string::npos )
|
if( (pos = file.find_last_of('.')) != string::npos )
|
||||||
file.replace(pos, file.size(), ".stella");
|
file.replace(pos, file.size(), ".stella");
|
||||||
else
|
else
|
||||||
file += ".stella";
|
file += ".stella";
|
||||||
|
|
||||||
FilesystemNode romname_node(file);
|
FilesystemNode romname(file);
|
||||||
if(romname_node.exists())
|
buf << myParser->exec(romname) << endl;
|
||||||
myPrompt->print("autoExec():\n" + myParser->exec(file) + "\n");
|
|
||||||
|
|
||||||
// Init builtins
|
// Init builtins
|
||||||
for(int i = 0; builtin_functions[i][0] != ""; i++)
|
for(int i = 0; builtin_functions[i][0] != ""; i++)
|
||||||
|
@ -264,6 +263,7 @@ void Debugger::autoExec()
|
||||||
Expression* exp = YaccParser::getResult();
|
Expression* exp = YaccParser::getResult();
|
||||||
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
|
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
|
||||||
}
|
}
|
||||||
|
return buf.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -171,7 +171,7 @@ class Debugger : public DialogContainer
|
||||||
*/
|
*/
|
||||||
int cycles();
|
int cycles();
|
||||||
|
|
||||||
void autoExec();
|
string autoExec();
|
||||||
|
|
||||||
string showWatches();
|
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;
|
if(file.exists())
|
||||||
int count = 0;
|
{
|
||||||
char buffer[256]; // FIXME: static buffers suck
|
ifstream in(file.getPath().c_str());
|
||||||
|
|
||||||
FilesystemNode node(file);
|
|
||||||
ifstream in(node.getPath().c_str());
|
|
||||||
if(!in.is_open())
|
if(!in.is_open())
|
||||||
return red("file \'" + node.getRelativePath() + "\' not found.");
|
return red("file \'" + file.getRelativePath() + "\' not found.");
|
||||||
|
|
||||||
while( !in.eof() ) {
|
ostringstream buf;
|
||||||
|
int count = 0;
|
||||||
|
char buffer[256];
|
||||||
|
while( !in.eof() )
|
||||||
|
{
|
||||||
if(!in.getline(buffer, 255))
|
if(!in.getline(buffer, 255))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
if(verbose) {
|
|
||||||
ret += "exec> ";
|
|
||||||
ret += buffer;
|
|
||||||
ret += "\n";
|
|
||||||
ret += run(buffer);
|
|
||||||
ret += "\n";
|
|
||||||
}
|
}
|
||||||
|
buf << "Executed " << debugger->valueToString(count) << " commands from \""
|
||||||
|
<< file.getRelativePath() << "\"";
|
||||||
|
|
||||||
|
return buf.str();
|
||||||
}
|
}
|
||||||
ret += "Executed ";
|
else
|
||||||
ret += debugger->valueToString(count);
|
return red("file \'" + file.getRelativePath() + "\' not found.");
|
||||||
ret += " commands from \"";
|
|
||||||
ret += file;
|
|
||||||
ret += "\"\n";
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -866,7 +861,8 @@ void DebuggerParser::executeDump()
|
||||||
// "exec"
|
// "exec"
|
||||||
void DebuggerParser::executeExec()
|
void DebuggerParser::executeExec()
|
||||||
{
|
{
|
||||||
commandResult << exec(argStrings[0]);
|
FilesystemNode file(argStrings[0]);
|
||||||
|
commandResult << exec(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -28,6 +28,7 @@ struct Command;
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
#include "Array.hxx"
|
#include "Array.hxx"
|
||||||
#include "FrameBuffer.hxx"
|
#include "FrameBuffer.hxx"
|
||||||
|
#include "FSNode.hxx"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kBASE_16,
|
kBASE_16,
|
||||||
|
@ -47,7 +48,7 @@ class DebuggerParser
|
||||||
string run(const string& command);
|
string run(const string& command);
|
||||||
|
|
||||||
/** Execute parser commands given in 'file' */
|
/** 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
|
/** Given a substring, determine matching substrings from the list
|
||||||
of available commands. Used in the debugger prompt for tab-completion */
|
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";
|
string version = string("Stella ") + STELLA_VERSION + "\n";
|
||||||
print(version.c_str());
|
print(version.c_str());
|
||||||
print(PROMPT);
|
print(PROMPT);
|
||||||
_promptStartPos = _promptEndPos = _currentPos;
|
|
||||||
|
|
||||||
_firstTime = false;
|
|
||||||
_exitedEarly = false;
|
|
||||||
|
|
||||||
// Take care of one-time debugger stuff
|
// 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)
|
else if(_exitedEarly)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1003,12 +1003,12 @@ bool OSystem::queryVideoHardware()
|
||||||
/*
|
/*
|
||||||
Palette is defined as follows:
|
Palette is defined as follows:
|
||||||
// Base colors
|
// Base colors
|
||||||
kColor TODO
|
kColor Normal foreground color (non-text)
|
||||||
kBGColor TODO
|
kBGColor Normal background color (non-text)
|
||||||
kShadowColor Item is disabled
|
kShadowColor Item is disabled
|
||||||
kTextColor Normal text color
|
kTextColor Normal text color
|
||||||
kTextColorHi Highlighted text color
|
kTextColorHi Highlighted text color
|
||||||
kTextColorEm TODO
|
kTextColorEm Emphasized text color
|
||||||
|
|
||||||
// UI elements (dialog and widgets)
|
// UI elements (dialog and widgets)
|
||||||
kDlgColor Dialog background
|
kDlgColor Dialog background
|
||||||
|
|
Loading…
Reference in New Issue