Commit Graph

377 Commits

Author SHA1 Message Date
Max Horn
8d77d8cf1c DS: Remove dead code 2011-06-06 16:55:18 +02:00
Max Horn
b0b5a1d802 DS: Add custom logMessage() implementation 2011-06-06 15:36:28 +02:00
Joost Peters
265e03c975 IRIX: Fix compilation 2011-06-04 16:55:58 +02:00
Max Horn
39076ef972 BUILD: Rename UNIX #define to POSIX 2011-05-25 13:23:03 +02:00
Max Horn
6f6051a9e1 COMMON: Mark more symbols as forbidden 2011-05-23 19:12:26 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
dhewg
b85fc8f190 WII: Fix compilation 2011-05-03 18:27:50 +02:00
Max Horn
7a0c64631d MACOSX: Try to fix compile errors triggered with certain Mac OS X SDK versions 2011-05-03 18:25:30 +02:00
Max Horn
b449b73f59 N64: Fix FS code regression 2011-05-03 15:33:37 +02:00
Max Horn
2fa63ca015 COMMON: Forbid use of getcwd&getwd; add macro to enable unistd.h compatibility 2011-05-03 14:30:25 +02:00
Max Horn
ff6533e1b3 PSP: Fix more forbidden symbol clashes 2011-05-03 14:14:21 +02:00
Max Horn
91141dae40 WII: Fix fs code compile regressions 2011-05-03 13:32:20 +02:00
Max Horn
f62fd4f25f BACKENDS: Avoid #including .cpp files
So far, the various *-fs-factory.cpp files were #including the
corresponding *-fs.cpp files. This is surprising and hence could lead to
all kinds of problems). To fix this, provide proper headers for the
*-fs.cpp files.
This also makes code reuse via subclassing possible.

Since not all ports were tested, this will likely lead to a few
easy to fix compile regressions.
2011-05-03 13:22:00 +02:00
Max Horn
59e77ed667 ALL: Mark printf and various other symbols as forbidden
Right now, a few places in the frontend code still use printf and
consorts. We mark the affected files with a FIXME for now, and
add a dedicated exception for each. To be fixed!

Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always
enforce a compiler error
2011-05-02 16:31:31 +02:00
Max Horn
4bed2b3ff5 SDL: Trying to cleanup the FORBIDDEN_SYMBOL situation
svn-id: r54575
2010-11-29 16:35:29 +00:00
Max Horn
4d09420ba4 DS: Remove redundant code
svn-id: r54556
2010-11-28 22:25:00 +00:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
9fb1e2b17e COMMON: Change wrapBufferedWriteStream() to always disposes wrapped stream
This is the only we need right now, and it saves a few bytes per
instance. The template approach I used before has the drawback that it
increases the binary size, which negates the benefit. Thanks to LordHoto
for pointing this out.

svn-id: r54344
2010-11-18 20:27:15 +00:00
Max Horn
7444a06c61 DS: cleanup
svn-id: r54334
2010-11-18 17:42:28 +00:00
Max Horn
b8995eadfc DS: Remove write buffering in DSFileStream, use wrapBufferedWriteStream instead
svn-id: r54331
2010-11-18 17:30:00 +00:00
Max Horn
24f4d97901 DS: Avoid needlessly allocating temporary Common::String instances
svn-id: r54329
2010-11-18 17:15:35 +00:00
Max Horn
152e52d015 COMMON: Make implementation of Buffered*Stream classes internal
svn-id: r54326
2010-11-18 17:02:51 +00:00
Max Horn
bac018a3aa DS: Two more 'FILE' related fixes/workarounds
svn-id: r54321
2010-11-18 15:42:52 +00:00
Max Horn
51a954c1dd DS: Add some FIXME/TODO comments on changes that need to be applied to the DS backend
svn-id: r54318
2010-11-18 13:17:25 +00:00
Max Horn
abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
Fabio Battaglia
77a636aaec N64: correct wrong check in romfs stream code
my implementation of romfs_seek is based on lseek, not on fseek,
so it returns the offset on successful completion, not 0, corrected
the check in RomfsStream::seek().

svn-id: r54151
2010-11-09 11:00:56 +00:00
Max Horn
ae829727da PS2: Enable another use of forbidden symbols
svn-id: r53977
2010-10-31 17:01:47 +00:00
Max Horn
917c4b00cb WINDOWS: Enable use of forbidden symbols
svn-id: r53972
2010-10-31 00:14:59 +00:00
Max Horn
44393b2dc8 ALL: Add code to help stop people from accidentally using "bad" APIs
A new header file common/forbidden.h is included by scummsys.h and it
re-#defines numerous symbols like fopen(), fread(), system(), etc. with
garbage, in order to provoke compile errors in any code using them.

If a .cpp file really *must* use any of these (e.g. because it is a
backend file), then these redefinitions can be disabled by #defining
FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever
this is done, an explanatory comment should be added.

Note that this system cannot catch all "bad" usages (notably the Lua
code in the sword25 engine), as it can only work if scummsys.h is
included.

svn-id: r53961
2010-10-30 21:27:42 +00:00
Jordi Vilalta Prat
8388e0dfea JANITORAL: Clean trailing whitespaces.
svn-id: r53160
2010-10-12 02:18:11 +00:00
Yotam Barnoy
a1b16661de PSP: remove virtual inheritance of BufferedWriteStream and BufferedSeekableReadStream
As Max pointed out to me, one can't really use virtual functions called from constructors/destructors.

svn-id: r52722
2010-09-14 14:00:15 +00:00
Andre Heider
7248efb178 DS: Enable stdout/err via nocash when DISABLE_COMMAND_LINE in not set.
svn-id: r52533
2010-09-04 22:19:20 +00:00
Yotam Barnoy
89b34faa5a PSP: fixed flag to open()
I was missing a flag (PSP_O_TRUNC) causing the config file to be opened on top of the old file, causing file corruption.

svn-id: r52387
2010-08-25 13:26:30 +00:00
Yotam Barnoy
b88f341b80 PSP: switched to using BufferedSeekableReadStream and BufferedWriteStream
The last PSP optimization made reading much faster, but writing isn't buffered so saving the config file was VERY slow.
I decided the cleanest way to do this would be to add BWS and use BSRS.

svn-id: r52327
2010-08-24 11:24:34 +00:00
Yotam Barnoy
a503f9223a PSP: switched from stdio to psp functions -- dramatic speed improvement
Turns out that stdio is about 30x(!) slower than using the PSP's functions. Very significant optimization.

svn-id: r52271
2010-08-22 10:48:13 +00:00
Andre Heider
af3dd70938 WII: Fix compilation of the GameCube port.
svn-id: r52089
2010-08-14 11:01:00 +00:00
Andre Heider
c58e2707ff WII: Update port for the current versions of the base libraries. Enable DVD access for the GameCube port.
svn-id: r52074
2010-08-14 00:56:12 +00:00
Max Horn
0b48a71c99 Remove PalmOS port
svn-id: r50964
2010-07-17 18:41:38 +00:00
Max Horn
fe72d5dd78 DS: Fix some quirks in the NDS build system, remove some dead code
* remove (S)RAM save code (it has not been in use for quite some time)
* remove the lz compressor (was only used by ram save code)
* OPT_SPEED was set incorrectly
* dsmain.cpp was misspelled as ds_main.cpp
* remove unsed arm9 libcartreset (the copy in the arm7 directory
  still is around, though)

svn-id: r50741
2010-07-07 23:22:53 +00:00
Max Horn
68d620ccab DS: Fix warnings, make some vars static, cleanup
svn-id: r50701
2010-07-05 19:10:20 +00:00
Max Horn
75529dc402 DS: Fix various warnings and errors in the DS FS code
* Do not modify the strings passed to std_fopen anymore
* Correct signature of std_fread
* Do not cast away constness, nor perform unnecessary casts

svn-id: r50693
2010-07-05 16:12:31 +00:00
Max Horn
edb5210d38 DS: Fix error in std_fopen (warnings are great :)
svn-id: r50692
2010-07-05 16:12:10 +00:00
Max Horn
3d44870c8a NDS: Update GPL/copyright headers; add namespace DS closing comments
svn-id: r50689
2010-07-05 16:11:11 +00:00
Max Horn
e4ec2e6403 DS: Code formatting: "char* foo" -> "char *foo"
svn-id: r50688
2010-07-05 16:10:22 +00:00
Max Horn
d5c78f78c5 DS: Fix warnings, cleanup
svn-id: r50687
2010-07-05 16:09:27 +00:00
Yotam Barnoy
a21b9c7b96 PSP: fixed up PowerManager and removed dependency on SDL
svn-id: r49852
2010-06-15 13:10:00 +00:00
Max Horn
651e2760a3 Fix spelling, cleanup
svn-id: r49843
2010-06-15 12:33:20 +00:00
Yotam Barnoy
857f3ab550 PSP: faster way of getting file size
svn-id: r49457
2010-06-06 14:17:37 +00:00
Yotam Barnoy
f7ba7b4684 PSP: fixed issue with handling of EOS. Caused crashes.
svn-id: r49257
2010-05-27 06:11:50 +00:00
Yotam Barnoy
8b54efd8a6 PSP: implemented basic file cache. Turns out the PSP reads 1 byte as fast as it reads 1 KB.
svn-id: r49243
2010-05-26 14:43:25 +00:00