54 Commits

Author SHA1 Message Date
Filippos Karapetis
d95ed75789 Removed the wrong code for kGetTime case 1 in some SCI0 games - that case has always remained the same in all SCI versions. Added a warning in case we got some other case than 0 or 1 in SCI0 games
svn-id: r44855
2009-10-09 23:15:54 +00:00
Max Horn
42120ed626 Introduce a new struct TimeDate, replacing struct tm in client code. May lead to compilation issues in ports, which should be trivial to fix, though
svn-id: r44793
2009-10-08 19:41:38 +00:00
Filippos Karapetis
c17495d895 - Fixed kGetTime() again
- Removed the odd way of calculating elapsed time in SciGui(). We got _system->getMillis() for that purpose
- Replaced the code in SciGui::wait() with the one in SciGui32::wait (which works fine, and is correct). The code in SciGui() was not polling for events while waiting, either

svn-id: r44712
2009-10-06 17:45:57 +00:00
Max Horn
db8c6e3f6c SCI: Really remove sci/gui/gui.h include from engine/state.h
svn-id: r44644
2009-10-04 22:43:30 +00:00
Max Horn
6ad5840181 SCI: Rename EngineState::segMan to _segMan
svn-id: r44629
2009-10-04 18:38:18 +00:00
Willem Jan Palenstijn
b9cdb1abb7 SCI: Merge new GUI code written by m_kiewitz.
This is a major rewrite of the graphics code. A slightly adapted
version of the old code is still available and currently the default.
The new code is selectable in sci.cpp, but is not yet finished.

svn-id: r44565
2009-10-03 20:49:18 +00:00
Filippos Karapetis
30084d72a5 Added a new special reg_t, SIGNAL_REG, for signaling when an error occurs (usually), or to signal success in some special occasions
svn-id: r44505
2009-09-30 23:00:03 +00:00
Filippos Karapetis
f9296a6445 - 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
Willem Jan Palenstijn
d3c1916384 SCI: Major string handling update.
All string access to segments should now work with both raw and non-raw
(reg_t) segments, using the new utility functions in segMan.

There will likely be regressions.

svn-id: r44388
2009-09-27 01:50:26 +00:00
Filippos Karapetis
180b3f1247 Create a define for the special "signal" offset used throughout the engine, and fixed the arbitrary 0 values from commit #44294, set when some math functions do invalid calculations
svn-id: r44359
2009-09-25 16:15:57 +00:00
Max Horn
4221773f6a SCI: Pedantic cleanup
svn-id: r44356
2009-09-25 13:01:35 +00:00
Max Horn
5f440854b7 SCI: Add EngineState::_kernel member for convenience
svn-id: r44173
2009-09-17 17:00:36 +00:00
Max Horn
b2c386ed00 SCI: Move parts of struct ScriptState into a new struct DebugState
svn-id: r44151
2009-09-17 13:21:19 +00:00
Max Horn
10f898c90e SCI: Rename MemObject -> SegmentObj
svn-id: r44130
2009-09-17 00:45:12 +00:00
Max Horn
b26f744e23 SCI: cleanup
svn-id: r44128
2009-09-16 23:55:11 +00:00
Filippos Karapetis
e1de3d0f3f Removed some unused variables from the engine state
svn-id: r44099
2009-09-15 07:59:48 +00:00
Max Horn
bfe1538715 SCI: Misc cleanup
svn-id: r44093
2009-09-14 22:34:53 +00:00
Max Horn
8ac3db0801 SCI: Rename SegManager::kernelDeref*() methods to SegManager::deref*()
svn-id: r44083
2009-09-14 13:27:09 +00:00
Max Horn
0e834d0b87 SCI: kernelDeref*() functions are now seSegmentManager methods
svn-id: r44082
2009-09-14 13:13:20 +00:00
Filippos Karapetis
1bbab8f191 Some renaming:
getresourceManager -> getResourceManger
resourceManager -> resMan
segmentManager ->segMan

svn-id: r43908
2009-09-02 12:02:37 +00:00
Max Horn
b391f08b46 SCI: Renamed kernel_dereference_* to kernelDeref*, and added kernelDerefString
svn-id: r43907
2009-09-02 11:38:16 +00:00
Max Horn
0c7093e05c SCI:
* removed kNOP
* renamed k_Unknown to kUnknown
* added FIXME to kfunct_mappers table
* more cleanup

svn-id: r43906
2009-09-02 11:35:00 +00:00
Max Horn
6c44eafa97 SCI: funct_nr is not used in 99% of all opcodes -- hide it in those (to be removed eventually)
svn-id: r43905
2009-09-02 11:33:25 +00:00
Matthew Hoops
3687544fbb Adding support for AVI in SCI games (such as kq6) and implement kPlatform.
svn-id: r43834
2009-08-30 19:47:47 +00:00
Filippos Karapetis
ac025f4294 - Replaced more cases of EngineState parameters
- Made some version comparisons for old SCI0 versions easier to read
- Removed the GET_SEL32SV macro

svn-id: r43729
2009-08-25 15:14:29 +00:00
Filippos Karapetis
ed66cad677 - Simplified the parameters of some functions
- Replaced some EngineState parameters
- The SCI version is now obtained from the resource manager or the segment manager, thereby simplifying several functions
- Plugged 2 leaks in the fallback detector
- Renamed the segment manager and resource manager to "segmentManager" and "resourceManager" in all places, for consistency

svn-id: r43722
2009-08-25 08:38:14 +00:00
Walter van Niftrik
a7ab084ecf SCI: Fix for the "Memory fragmented" dialogs popping up in some games.
svn-id: r43572
2009-08-20 21:18:52 +00:00
Walter van Niftrik
867b1c2b4d SCI: Fix warnings.
svn-id: r43218
2009-08-10 18:43:15 +00:00
Filippos Karapetis
31a0c80905 Moved the kernel and the vocabulary outside of the engine state (they're static data, which never changes during a game)
svn-id: r42398
2009-07-11 23:45:54 +00:00
Filippos Karapetis
62499054a0 Some cleanup for the script debugger code:
- Renamed struct DebugState to ScriptState and r_amp_rest to restAdjust inside EngineState. Changed restAdjust to be a uint16 (actually it is a uint16, but it was being casted back and forth from an unsigned integer, so this clears up its type and size)
- Moved the script state variables from inside the run_vm() into the ScriptState struct, so that they can be accessed by the console commands and the script debugger all the time, and removed the weird isValid code

svn-id: r42260
2009-07-08 10:25:37 +00:00
Filippos Karapetis
87988c69ee Assigned several unimplemented/unused kernel functions as stubs, so that we know when they're used and how they're called
svn-id: r42170
2009-07-06 11:19:19 +00:00
Filippos Karapetis
522b161bec Replaced sciprintf() calls with printf, DebugPrintf, warning and error calls
svn-id: r42167
2009-07-06 10:39:22 +00:00
Filippos Karapetis
6fa8541aed - Pushed debugstate into debug.h
- When an error occurs, manipulate the execution stack before error() opens the console inside getDebugger(), like FreeSCI did. Added another method for obtaining the SCI console for use by the engine itself.

svn-id: r42062
2009-07-03 14:22:50 +00:00
Filippos Karapetis
c3403ac739 Moved some more debug state related variables in the DebugState struct
svn-id: r42044
2009-07-02 23:58:05 +00:00
Filippos Karapetis
3b687a7a04 Replaced KP_ALT, SKPV_OR_ALT and UKPV_OR_ALT
svn-id: r41340
2009-06-07 16:50:34 +00:00
Filippos Karapetis
744323ca33 Replaced/removed KP_UINT, KP_SINT, SKPV and UKPV as well as the VIEW_PRIORITY and PRIORITY_BAND_FIRST wrappers
svn-id: r41338
2009-06-07 15:53:30 +00:00
Max Horn
10c54394bd SCI: Renamed EngineState::flags and version to _flags and _version (following our conventions); also slightly changed the EngineState constructor to init _version & _flags, and used this to make them constant
svn-id: r41177
2009-06-04 21:44:39 +00:00
Max Horn
870db34cd1 SCI: Renamed _kfuncTable -> _kernelFuncs; and simplified/streamlined the kernel func map in kernel.cpp a bit
svn-id: r41176
2009-06-04 21:42:24 +00:00
Max Horn
382ebea3fa SCI: Renamed various debug related global variables to have a g_ prefix; and moved any 'extern' decls of them into a new header file
svn-id: r41163
2009-06-04 11:28:05 +00:00
Filippos Karapetis
98f64cfa2f Removed the gfxw_new_visual and gfxw_new_port wrappers, moved _kfuncTable inside the Kernel class and moved gfxw_find_port inside the GfxVisual struct
svn-id: r41125
2009-06-02 14:16:59 +00:00
Filippos Karapetis
99c6874630 Split the kernel functions away from the vocabulary functions (WIP, saving/loading is broken)
svn-id: r41101
2009-06-01 14:12:43 +00:00
Filippos Karapetis
e55388c787 Removed script_error_flag and script_debug_flag, which were used to error out if something went wrong and open the debugger console. Changed all the places where they were used to error() out instead, as ScummVM's debugger console can open on error()
svn-id: r41073
2009-05-31 15:34:23 +00:00
Filippos Karapetis
4441ca4b3e - Further objectification of the SCI vocabulary functions
- Rewrote the sci_opcodes enum so that it's easier to read
- Made the engine error out if data is sent to an invalid selector (which is a fatal condition)

svn-id: r41069
2009-05-31 14:55:32 +00:00
Filippos Karapetis
76406c35ec Started objectifying the vocabulary functions (WIP)
svn-id: r41051
2009-05-30 22:15:00 +00:00
Willem Jan Palenstijn
67fa1fb59c SCI: Fix potential dangling pointer more robustly,
by changing the executionStack implementation to a list.

svn-id: r40971
2009-05-28 22:42:18 +00:00
Max Horn
32975b25f4 SCI: cleanup
svn-id: r40959
2009-05-28 11:15:09 +00:00
Filippos Karapetis
e0a0593949 Fixed a typo, and added parentheses to clarify order
svn-id: r40938
2009-05-27 12:46:11 +00:00
Walter van Niftrik
e3178daf13 SCI: Cleanup.
svn-id: r40931
2009-05-27 00:24:32 +00:00
Filippos Karapetis
2590511c7d Turned some errors into warnings, as they occur in KQ5CD
svn-id: r40804
2009-05-23 10:22:27 +00:00
Max Horn
b431254070 SCI: Removed the 'save_dir' gui hack
svn-id: r40772
2009-05-21 21:50:11 +00:00