Commit Graph
202 Commits
Author SHA1 Message Date
Colin Snover 856f3ae648 SCI32: More correctly fix kStringCopy overflow
This entire kString code needs to be reviewed/refactored, but
at least this fix is more complete than the last one.

Thanks to @lordhoto and @wjp for their assistance.
2016-03-18 11:10:49 -05:00
Colin Snover b7d5dd9187 SCI32: Fix heap overflow (read) in kStringCopy 2016-03-18 10:28:51 -05:00
Colin Snover 3e5adc33a8 SCI32: Non-titled text bitmap implementation
This implementation is not 100% engine accurate, but it is
more accurate than what was there, and hopefully the differences
between this and the engine code are merely cosmetic.

The known (intentional) differences are:

1. Uses ScummVM rects inside the engine code, converting to/from
   SCI rects on the kernel edges and when scaling
2. Fewer side effects when performing operations that *should*
   have been pure from the start (like text dimension calculation).
   Still not side-effect-free, but at least things like colours
   and alignment do not need to be reset every time a measurement
   is taken, unlike in the actual engine.

Editor controls and some other kBitmap code are temporarily
disabled as a result of changes to GfxText32 until they can be
updated to be engine-accurate.
2016-02-28 21:48:56 -06:00
Filippos Karapetis 2a4b04f3b2 SCI: Add an initial implementation of kStringTrim
Thanks to lskovlun for his help
2016-01-15 03:25:40 +02:00
Martin Kiewitz 0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
2015-12-29 01:44:11 +01:00
Martin Kiewitz ad8dbd3642 SCI: kStrCat does language-splitting for QfG1 too 2014-11-04 19:46:44 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Sven Hesse 989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Matthew Hoops 829847cb88 SCI: Fix kMessage REF subop ordering
Thanks to waltervn for testing values from running in DOSBox.

Fixes bug #3034704
2013-04-23 22:34:37 -04:00
Willem Jan Palenstijn f5e43484a0 SCI: Fix kReadNumber sign/hex behaviour
Negative numbers now work, and hex overflow is handled like SSCI.
Thanks to waltervn for testing.
2013-01-25 00:57:50 +01:00
Willem Jan Palenstijn 498fe75dc5 SCI: Fix shadow warning 2013-01-24 22:12:15 +01:00
Filippos Karapetis 0143a5d938 SCI: Bugfix for commit 0968acc: only filter out missing messages for the jar
This is to properly fix bug #3601090 without removing any functionality.
The additional check ensures that the look and hand icons work with the
jar. Many thanks to lskovlun for debugging this and providing a fix
2013-01-23 21:31:26 +02:00
Filippos Karapetis 0968acccfd SCI: Fix script bug #3601090 - "SCI: Pepper's Adventures in Time: Game becomes unsolvable"
Many thanks to lskovlun for debugging this problem and finding the
offending script code that caused it.
2013-01-23 03:17:10 +02:00
Filippos Karapetis b1ff5ba247 SCI: Slight cleanup in kMessage() 2013-01-23 03:17:10 +02:00
Willem Jan Palenstijn ba1307b0ce SCI: Add kReadNumber fixme
Thanks to Walter for noticing this.
2012-10-05 16:41:02 +02:00
Filippos Karapetis 99b1c73639 SCI: Fix silly typo
Thanks to digitall for spotting this
2012-06-21 22:57:00 +03:00
Filippos Karapetis 76f3f1b136 SCI: Fix warnings 2012-06-21 22:24:22 +03:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
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