Commit graph

184 commits

Author SHA1 Message Date
Matthew Hoops
ef8239df48 SCI: Fix comment in kString(at) 2012-06-11 20:10:49 -04:00
Filippos Karapetis
b812ed50c8 SCI: Bugfix for negative numbers in kString(at)
Fixes one of the bugs in the savegame selection screen in Phantasmagoria
2012-06-11 11:54:11 +03:00
Max Horn
4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00
Max Horn
658080deed ALL: Avoid using is* macros from ctype.h
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
2012-02-15 16:51:37 +01:00
Willem Jan Palenstijn
c60394eb3f SCI: Remove outdated comment 2012-01-16 16:07:48 +01:00
Filippos Karapetis
7560007ba9 SCI: Simplify kString(Dup) using the overloaded = operator
Thanks to wjp for his suggestion
2012-01-15 21:42:09 +02:00
Filippos Karapetis
cbe7527805 SCI: Use fromString() in kString(Dup) to simplify code 2012-01-15 21:05:10 +02:00
Filippos Karapetis
34b297748c SCI: Fix a nasty bug in kString(Dup)
The rawString variable is no longer pointing to invalidated data. This
fixes cases where strings are manipulated by game scripts, such as the
graveyard and rada drum puzzles in GK1
2012-01-15 20:11:30 +02:00
Lars Skovlund
40e22d9e33 SCI32: kString: Move variable declaration to prevent problems
with object lifetimes.
2011-10-30 13:56:37 +01:00
Filippos Karapetis
ecddcc12b7 SCI2: kString(Format) uses %d for unsigned integers. Some cleanup 2011-09-25 23:55:44 +03:00
Filippos Karapetis
d570b41561 SCI: Fixed bug #3396887 - "SCI: pq2-pc98-jp - Listing of items / Inventory not working"
Thanks to wjp for his valuable help on this
2011-08-26 01:25:41 +03:00
Willem Jan Palenstijn
85a056f382 SCI: Fix kFormat's handling of %c with a 0 argument
SSCI used a sprintf to handle %c, appending the result to the output,
which is effectively a nop for a zero argument.

This is bug #3368821. Thanks to digitall for tracing it to KFormat
and testing this patch.
2011-07-18 23:36:56 +02:00
Filippos Karapetis
72da8ef5ad SCI: Applied patch #3357096 with minor modifications
This prevents a string pointer from getting invalidated under some
circumstances in kString(Dup).
Thanks to lephilousophe for the patch.
2011-07-07 03:43:06 +03:00
Littleboy
b694a78f62 ANALYSIS: Add static casts to is* functions
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results.
See http://msdn.microsoft.com/en-us/library/ms245348.aspx
2011-06-23 08:52:52 -04:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
md5
1ea96002b8 SCI: Added a more generalized fix for bug #3306417 2011-05-29 21:12:37 +03:00
md5
a010884c9b SCI: Fixed bug #3306417 - "LAURA BOW 2: segmentation fault while talking to Dr. Myklos" 2011-05-27 02:32:22 +03:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
2e095e25f2 ALL: centre -> center 2011-04-14 14:34:28 +02:00
Matthew Hoops
0b9e6675ef SCI: Add workaround for a QFG1 VGA Mac kFormat bug
Also, fix the kernel signature for kFormat to require two parameters
2011-03-13 22:01:41 -04:00
Walter van Niftrik
f96e93047a SCI: Use BE string handling for Mac games. 2011-03-04 21:12:00 +01:00
md5
18c0dae5fc SCI: Removed warning from kReadNumber 2011-03-04 01:42:09 +02:00
Filippos Karapetis
1796e7afdd SCI2.1: Kernel function changes (after looking through all of the SCI2.1 games)
- Replaced the stub kWinDLL (unused), as well as the not fully implemented kPrintDebug
functions with empty function calls
- Marked several unused or debug kernel functions as stub
- Added some games where the rest of the unimplemented SCI2.1 kernel functions are used

svn-id: r55138
2011-01-07 00:12:18 +00:00
Filippos Karapetis
32d7e687ee SCI: debugC calls no longer require a debug level of 2 to show output
svn-id: r55086
2011-01-01 12:48:12 +00:00
Filippos Karapetis
de2ef2edc0 SCI: Removed the system strings code and replaced it with a much more simplified version, thus greatly simplifying handling of system strings
svn-id: r54805
2010-12-07 00:47:05 +00:00
Filippos Karapetis
0b5f6d4c97 SCI: Fixed bug #3034471 - "SCI, Castlebrain/Amiga: Invisible text in word search"
Fixed some endianness issues in Amiga versions, thanks to wjp. Amiga
versions expect a BE VM, thus we adjust accordingly in the places
where memory is accessed directly (i.e. kStrAt, kMemory and all places
that set/get characters from memory)

svn-id: r54521
2010-11-28 14:57:56 +00:00
Filippos Karapetis
57d9de00f8 SCI: Removed the correct subops from kString in late SCI2.1/SCI3 games (thanks to waltervn)
svn-id: r54403
2010-11-21 02:07:55 +00:00
Filippos Karapetis
cd69472be9 SCI: Adapted kArray/kString to use the new heuristic for late SCI2.1/SCI3 games, and updated their subops accordingly
svn-id: r54399
2010-11-21 00:47:56 +00:00
Lars Skovlund
5ecac66c6a Some subfunctions changed positions in SCI3 kString. WIP.
And with this, LSL7 starts up. Yeah, baby!

svn-id: r54374
2010-11-19 12:52:17 +00:00
Filippos Karapetis
34272e2529 SCI: Added a stub for a new subop in kString, and disabled trackOriginAndFindWorkaround() for SCI3 games for now
svn-id: r54352
2010-11-18 22:46:29 +00:00
Lars Skovlund
b2be003722 SCI: In kFormat, handle arguments pointing to text resource 0 correctly.
Fixes Colonel's Bequest inventory formatting.

svn-id: r52676
2010-09-11 13:30:42 +00:00
Filippos Karapetis
f446dbc8d5 SCI: Implemented the kPrintDebug SCI2.1 kernel function, used in Shivers (demo)
svn-id: r52665
2010-09-09 20:09:32 +00:00
Lars Skovlund
065e19092a SCI: Support push and pop subfunctions in kMessage()
Glossary seems to work now.

svn-id: r52654
2010-09-09 12:44:34 +00:00
Filippos Karapetis
c40b9801df SCI: Silenced warning when exiting in LSL6 (bug report #3035533), and commented out a related unused variable in kSetQuitStr
svn-id: r51456
2010-07-29 07:58:48 +00:00
Matthew Hoops
828434456f SCI: Better fix for bug #3035058 - ECOQUEST demo: Missing subtitles
The demo really uses kGetMessage and not kMessage. We now detect which version of the message function is used. Thanks to Walter for pointing this out.

svn-id: r51384
2010-07-27 19:07:39 +00:00
Matthew Hoops
cf26b88e54 SCI: Fix bug #3035058 - ECOQUEST demo: Missing subtitles
The demo uses a special version of kMessage to get its messages.

svn-id: r51376
2010-07-27 15:45:21 +00:00
Filippos Karapetis
9862f3fe24 SCI: Moved the SCI32 kernel functions out of kernel32.cpp and into their respective files
svn-id: r51108
2010-07-21 21:18:21 +00:00
Willem Jan Palenstijn
a03afd1898 SCI: Make kStrAt clear segment when writing characters
This is necessary since the uninitialized value detection from r50211,
and is analogous to seg_manager.cpp's setChar.
(Triggered in LSL3 age verification.)

svn-id: r50234
2010-06-24 21:09:38 +00:00
Martin Kiewitz
05e2bbcc33 SCI: dont display string set by kSetQuitStr
svn-id: r50090
2010-06-20 18:22:49 +00:00
Max Horn
bb528d894c SCI: Rewrap some overlong comments
svn-id: r50012
2010-06-18 09:37:06 +00:00
Martin Kiewitz
753fdd6c12 SCI: break on anything, warn on anything but spaces in kReadNumber
svn-id: r49355
2010-05-31 13:52:07 +00:00
Martin Kiewitz
a963917e89 SCI: added TODO at kReadNumber space code
svn-id: r49348
2010-05-31 12:11:42 +00:00
Martin Kiewitz
9d50dac101 SCI: skip spaces in kReadNumber - this happens in lsl3 intro
svn-id: r49345
2010-05-31 09:31:05 +00:00
Martin Kiewitz
7001d3e615 SCI: when getting invalid chars in kReadNumber don't error() out, but create a warning - we get invalid chars in the intro of lsl5, cause currently unknown
svn-id: r49344
2010-05-31 09:21:15 +00:00
Filippos Karapetis
67de5b1bd3 Mass renaming of selector-related functions, and removed some defines which were just cloaking functions with a different name
- GET_SEL32 -> readSelector
- GET_SEL32V -> readSelectorValue
- PUT_SEL32 -> writeSelector
- PUT_SEL32V -> writeSelectorValue
Also, changed some selector-related function names and variables to CamelCase

svn-id: r49317
2010-05-29 23:37:15 +00:00
Martin Kiewitz
d35121fc61 SCI: fixing kReadNumber to behave like in sierra sci (non standard atoi implementation) - fixes big door not unlocking in sq4
svn-id: r49250
2010-05-26 20:48:08 +00:00
Filippos Karapetis
46af5a5162 - Moved kernel_lookup_text inside the Kernel class
- Added a pointer to the segment manager from within the Kernel class, thus simplifying the calls to it

svn-id: r49076
2010-05-18 12:16:48 +00:00
Max Horn
92c896d883 Patch #2973290: Semicolon cleanup
svn-id: r48359
2010-03-22 20:28:08 +00:00
Matthew Hoops
cf005b6238 SCI32 reorders the REF* subops in kMessage; fixes GK1 conversations.
svn-id: r48066
2010-02-15 17:10:40 +00:00
Max Horn
b9a11ddb0b SCI: Move language related code from EngineState to SciEngine
svn-id: r48052
2010-02-13 17:46:44 +00:00