2009-02-17 15:02:16 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-05-13 16:52:41 +00:00
|
|
|
#include "sci/sci.h"
|
2009-05-15 14:07:45 +00:00
|
|
|
#include "sci/resource.h"
|
2009-02-27 02:23:40 +00:00
|
|
|
#include "sci/engine/state.h"
|
2009-03-07 19:23:47 +00:00
|
|
|
#include "sci/engine/kernel.h"
|
2010-01-05 01:22:16 +00:00
|
|
|
#include "sci/graphics/gui.h"
|
2010-01-05 01:37:57 +00:00
|
|
|
#include "sci/graphics/cursor.h"
|
2010-02-01 09:53:42 +00:00
|
|
|
#include "sci/graphics/menu.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
namespace Sci {
|
2009-02-15 06:10:59 +00:00
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kAddMenu(EngineState *s, int argc, reg_t *argv) {
|
2009-12-21 14:05:36 +00:00
|
|
|
Common::String title = s->strSplit(s->_segMan->getString(argv[0]).c_str());
|
2009-11-02 17:59:19 +00:00
|
|
|
Common::String content = s->_segMan->getString(argv[1]);
|
2009-10-28 23:04:56 +00:00
|
|
|
|
2010-02-01 09:53:42 +00:00
|
|
|
s->_gfxMenu->kernelAddEntry(title, content, argv[1]);
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kSetMenu(EngineState *s, int argc, reg_t *argv) {
|
2009-11-03 19:33:31 +00:00
|
|
|
uint16 menuId = argv[0].toUint16() >> 8;
|
|
|
|
uint16 itemId = argv[0].toUint16() & 0xFF;
|
|
|
|
uint16 attributeId;
|
|
|
|
int argPos = 1;
|
|
|
|
|
|
|
|
while (argPos < argc) {
|
|
|
|
attributeId = argv[argPos].toUint16();
|
|
|
|
if ((argPos + 1) >= argc)
|
|
|
|
error("Too few parameters for kSetMenu");
|
2010-02-01 09:53:42 +00:00
|
|
|
s->_gfxMenu->kernelSetAttribute(menuId, itemId, attributeId, argv[argPos + 1]);
|
2009-11-03 19:33:31 +00:00
|
|
|
argPos += 2;
|
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kGetMenu(EngineState *s, int argc, reg_t *argv) {
|
2009-11-02 17:59:19 +00:00
|
|
|
uint16 menuId = argv[0].toUint16() >> 8;
|
|
|
|
uint16 itemId = argv[0].toUint16() & 0xFF;
|
|
|
|
uint16 attributeId = argv[1].toUint16();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-02-01 09:53:42 +00:00
|
|
|
return s->_gfxMenu->kernelGetAttribute(menuId, itemId, attributeId);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
|
2009-10-05 19:20:52 +00:00
|
|
|
reg_t textReference = argv[0];
|
2009-10-05 19:46:38 +00:00
|
|
|
Common::String text;
|
2009-10-30 14:39:26 +00:00
|
|
|
int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0;
|
|
|
|
int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-10-05 19:39:47 +00:00
|
|
|
if (!textReference.isNull()) {
|
2009-10-05 19:46:38 +00:00
|
|
|
// Sometimes this is called without giving text, if thats the case dont process it
|
|
|
|
text = s->_segMan->getString(textReference);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-02-05 20:48:06 +00:00
|
|
|
s->_gfxMenu->kernelDrawStatus(s->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack);
|
2009-10-05 19:46:38 +00:00
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDrawMenuBar(EngineState *s, int argc, reg_t *argv) {
|
2009-11-02 17:59:19 +00:00
|
|
|
bool clear = argv[0].isNull() ? true : false;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-02-05 20:48:06 +00:00
|
|
|
s->_gfxMenu->kernelDrawMenuBar(clear);
|
2009-11-02 17:59:19 +00:00
|
|
|
return s->r_acc;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
|
2009-11-02 17:59:19 +00:00
|
|
|
reg_t eventObject = argv[0];
|
2009-11-02 20:33:34 +00:00
|
|
|
//bool pauseSound = argc > 1 ? (argv[1].isNull() ? false : true) : false;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-11-02 17:59:19 +00:00
|
|
|
// TODO: pauseSound implementation
|
2010-02-01 09:53:42 +00:00
|
|
|
return s->_gfxMenu->kernelSelect(eventObject);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
2009-02-21 10:23:36 +00:00
|
|
|
|
|
|
|
} // End of namespace Sci
|