Commit Graph

41 Commits

Author SHA1 Message Date
Torbjörn Andersson
4c3a68027f Use the same syntax for accessing script variables as BS1 does, i.e. now
it's Logic::_scriptVars[ID] instead of just ID. Apart from looking cool, it
makes it much easier to tell the difference between variables and constants
when looking at the code.

Of course, this sort of sweeping changes is jolly good for introducing
truly weird regressions, which is why I waited until after 0.6.0.

svn-id: r13331
2004-03-17 09:03:15 +00:00
Torbjörn Andersson
802a301a16 Removed some of the #includes from sword2.h
svn-id: r12739
2004-02-05 14:19:07 +00:00
Torbjörn Andersson
a7fe335c82 I forgot this in the previous cleanup.
svn-id: r12311
2004-01-10 21:56:59 +00:00
Torbjörn Andersson
1db3b65825 cleanup
svn-id: r12309
2004-01-10 21:21:20 +00:00
Torbjörn Andersson
065f2bb9eb It's a new year in BS2 land, too!
svn-id: r12181
2004-01-06 13:44:17 +00:00
Torbjörn Andersson
40419b1aee tiny cleanup
svn-id: r12017
2003-12-29 17:26:56 +00:00
Torbjörn Andersson
6ae8218d53 Hopefully the last big renaming. Now the datatypes have names like
"StandardHeader" instead of "_standardHeader".

svn-id: r11997
2003-12-28 15:08:12 +00:00
Nicolas Bacca
9e1dda1f68 Make VC6/EVC happier
svn-id: r11764
2003-12-20 01:17:02 +00:00
Torbjörn Andersson
8b12be81e5 cleanup
svn-id: r11704
2003-12-17 08:01:59 +00:00
Torbjörn Andersson
4420b15d9f Mostly cleanups, but I believe this also fixes an endian problem in the
"restart script" opcode. To actually verify this, though, I'd need to find
a case where any other script than script 0 at offset 0 is restarted...

svn-id: r11638
2003-12-14 16:33:27 +00:00
Torbjörn Andersson
67c75a35c6 Clarified comment about the elevator script bug and added a workaround for
the dreaded Pyramid Bug.

svn-id: r11427
2003-11-29 17:05:30 +00:00
Torbjörn Andersson
9fdaf04a21 Some formatting changes, and a few debug message corrections.
svn-id: r11384
2003-11-28 07:55:25 +00:00
Torbjörn Andersson
6f23e2c211 Mostly whitespace changes, but also a few modifications to the still
experimental resource dumping code.

svn-id: r11382
2003-11-27 07:34:19 +00:00
Torbjörn Andersson
3f115ba95d Removed some spurious semi-colons pointed out in patch #847464
svn-id: r11366
2003-11-25 17:08:46 +00:00
Torbjörn Andersson
1fc58a5ca0 Removed redundant information from the opcode list. I thought having the
number of parameters to a function would be useful for debugging, but that
information is already available in the script data itself.

svn-id: r11360
2003-11-24 07:34:07 +00:00
Torbjörn Andersson
509235e176 Added experimental (i.e. not tested) resource dumping code.
Added tentative workaround for the bug (a script bug, I think) that causes
the game to hang when examining the lift at the top of the pyramid.

And, of course, some misc. cleanup.

svn-id: r11359
2003-11-23 13:40:24 +00:00
Torbjörn Andersson
fa2b8ba8de More cleanup. I've eliminated all the temporary global variables I've added
over the past few weeks, except for g_sword2. (Of course, this doesn't
necessarily make the code any prettier, but we can work on that later.)

svn-id: r11309
2003-11-16 14:18:29 +00:00
Torbjörn Andersson
3d012651fd The script engine frequently needs to pass pointers to various structures
etc. to the different opcodes. Until now it has done so by casting the
pointer to an int32 (opcode parameters are represented as arrays of int32)
and then the opcode function casts it back to whatever pointer it needs.

At least in C there is no guarantee that a pointer can be represented as an
integer type (though apparently C99 may define such a type), so this has
struck me as unsafe ever since I first noticed it.

However, since all such pointers appear to point to the memory block owned
by the memory manager, we can easily convert them to integers by treating
them as offsets into the memory block. So that's what I have done. I hope I
caught all the occurences in the opcode functions, or we're going to have
some pretty interesting regressions on our hands...

svn-id: r11241
2003-11-10 07:52:15 +00:00
Max Horn
2fef2dcb84 bs2 -> sword2
svn-id: r10997
2003-10-28 19:51:30 +00:00
Torbjörn Andersson
7c4cc25cec Enable the debug console. Actually, what I've done is to adapt the debug
console from the SCUMM engine. I decided that would be easier than to clean
up the original console code.

Unfortunately there's a bunch of code that I just copied - a pretty lousy
form of code-reusal. It'd be nice if the console could be made part of the
Engine class, or something like that.

Most of the debug commands seem to be working. Some aren't relevant for
ScummVM, and some are a bit obscure so I'm not quite sure what they're
supposed to be doing.

svn-id: r10978
2003-10-26 15:42:49 +00:00
Torbjörn Andersson
320b0a405a Corrected/clarified some debug messages/comments
svn-id: r10945
2003-10-23 07:08:09 +00:00
Torbjörn Andersson
59b72f2b38 Moved a few remaining pieces of the script interpreter into the Logic class
svn-id: r10939
2003-10-22 06:51:57 +00:00
Torbjörn Andersson
3be2f0f1e0 Moved some more stuff into the Logic class.
svn-id: r10923
2003-10-21 08:54:50 +00:00
Torbjörn Andersson
64aaaa0b25 Small cleanup, and added FIXME comment.
svn-id: r10907
2003-10-19 18:01:05 +00:00
Torbjörn Andersson
3a43829b88 Moved the opcode functions into the Logic class.
svn-id: r10885
2003-10-18 08:11:50 +00:00
Torbjörn Andersson
4fad04846a Changed to use #include "bs2/..." and removed the inclusion of standard C
headers. Most (all?) of the ones we need should probably come from stdafx.h
instead.

svn-id: r10588
2003-10-04 08:07:03 +00:00
Max Horn
5a074e6137 added namespace Sword2
svn-id: r10581
2003-10-04 00:52:27 +00:00
Torbjörn Andersson
8ad28e3a7e More cleanup, and I've replaced most - not quite all - of BS2's debug
message functions with our own.

We still need to go through them and assign sensible debug levels to them.

svn-id: r10422
2003-09-27 11:02:58 +00:00
Torbjörn Andersson
09a01e4cbe Replaced abs() with ABS and BOOL with bool, plus some minor cleanups.
svn-id: r10391
2003-09-24 06:40:23 +00:00
Torbjörn Andersson
3c7c60196f ScummVM code formatting conventions
svn-id: r10350
2003-09-21 16:11:26 +00:00
Torbjörn Andersson
b03c634390 Clarified comment
svn-id: r10334
2003-09-20 12:51:55 +00:00
Torbjörn Andersson
6539b8a0e6 cleanup
svn-id: r10333
2003-09-20 12:43:52 +00:00
Max Horn
f9c28dca49 cleanup
svn-id: r10218
2003-09-13 12:08:17 +00:00
Max Horn
41a17b9da6 let the interpreter use native endianess for variables -> this allows us to get rid of various endian conversions, and also fixs lots of other problems on BE systems. Beware, though, this may impair save game exchange between LE/BE: we'll have to adjust save_rest.cpp to convert to/from LE upon save/load
svn-id: r10216
2003-09-13 12:03:29 +00:00
Max Horn
78476c6bd6 more endian fixes
svn-id: r10058
2003-09-07 03:18:27 +00:00
Max Horn
2fb59884f1 some endian fixes
svn-id: r10056
2003-09-07 01:51:15 +00:00
Max Horn
43cd0cac87 fixed const errors
svn-id: r9243
2003-07-28 11:54:26 +00:00
Jonathan Gray
a05c4bda0f -Werror cleanup
svn-id: r9230
2003-07-28 07:22:40 +00:00
Travis Howell
ccc40eecc9 Compiles on mingw now
svn-id: r9222
2003-07-28 03:12:49 +00:00
Max Horn
d4933386a9 big FIXME
svn-id: r9221
2003-07-28 02:39:40 +00:00
Jonathan Gray
f020d28b5e bs2
svn-id: r9211
2003-07-28 01:44:38 +00:00