Commit Graph

414 Commits

Author SHA1 Message Date
notaz
52c178718c fix SoundMixer asm
SoundMixer386.asm forgot to save some callee-save registers too
2016-04-22 02:29:47 +03:00
notaz
b1837c2e58 fix Graphics asm
same stuff as in previous commit
2016-04-22 02:29:30 +03:00
notaz
a1b84b3ba0 Revert "fix build on gcc 4.8"
This reverts commit 8bbe4c1d5e.
Going to fix it properly.
2016-04-22 02:29:30 +03:00
notaz
fd045e5025 fix LayerMixer asm
- clobber the whole x87 state for mmx (emms alone requires this)
- add all modified registers to clobber list
  (in some cases use dummy output vars instead)
- use symbolic names
- use more relaxed constraints where possible
- allow gcc to allocate ebx replacement reg
2016-04-22 02:28:42 +03:00
notaz
cb69bd3cdd add some asm helpers 2016-04-22 02:28:41 +03:00
Ryan C. Gordon
fd52a044d4 Merge pull request #36 from DrItanium/abstraction-layer
Abstraction layer
2016-04-21 12:40:44 -04:00
Ryan C. Gordon
e64199441a Merge pull request #31 from DanielGibson/more-64bit-fixes
More 64bit fixes
2016-04-21 12:31:05 -04:00
Daniel Gibson
a28a7bb00f now TFE builds on OSX, too 2016-04-21 17:46:44 +02:00
Daniel Gibson
2a58209487 Some cmake fixes, fixing OSX build (incl 64bit) + disable i386ASM by default
OSX build was a bit broken, it needs to be linked against zlib.
Furthermore it now uses the systems libSDL2 framework, unless you use
-DUSE_SYSTEM_SDL2=FALSE

i386 ASM is now disabled by default, we have plain C fallbacks for
everything that seems to work well enough (and if not they need more
testing which is likely to happen this way)
2016-04-21 17:40:42 +02:00
Daniel Gibson
64e6b915b7 Fix out of bounds access of afStarsPositions in TFE Particles.cpp
same as before for EntitiesMP/Common/Particles.cpp, this time for
the first encounter.
2016-04-21 16:21:47 +02:00
Daniel Gibson
72bd84edb8 Fix 64-bit build of Entities/Player.es (of First Encounter) 2016-04-21 16:21:47 +02:00
Daniel Gibson
430e0c8a95 Remove "64-bit issue" STUBBED() in Model.cpp, as it only looks fishy
.. but is really fine (most probably).

I added comments instead; see them for explanation why it's fine ;-)
2016-04-21 16:21:47 +02:00
Daniel Gibson
d228b6a7a7 make all BSP-related tags size_t so they can store pointers
The tags are often initially assigned from pointers and then copied
around, even from one tag type to the other.
As BSPTree::MoveSubTreeToArray() uses them to get the original pointer,
we need the pointers anyway, so just CRC-ing the pointers doesn't seem
like a good option. As the tags are assigned from other tag-types
sometimes, I probably would have needed to add Pointers for the same
values in addition to the ULONG tags, that are also copied around along
the tags, to keep the tags ULONG - that seemed like a worse alternative.

However, when writing (via BSPTree::Write_t()) the bn_ulPlaneTag tag
needs to be ULONG, so there I actually use CRC for 64bit pointers (via
IntPtrToID()) - when restoring (in Read_t()), the pointers aren't valid
anymore anyway, so that all should somehow be fine.
I assume that Write_t() is only used by the Editor, anyway, so I fear I
won't be able to test that part of the code on Linux anytime soon.
2016-04-21 16:21:47 +02:00
Daniel Gibson
b437abf10d Use PointerToID() for sound-event ID in CSoundObject::Play()/Stop()
so that code should be 64bit-clean now.
2016-04-21 16:21:47 +02:00
Daniel Gibson
23b6374e9a Add ULONG PointerToID(void*) and IntPtrToID(size_t) that CRC 64bit pointers
Sometimes pointers are casted to ULONG just to get an ID or tag - this
is fine for 32bit pointers, but 64bit pointers will truncate which might
result in not being so unique after all.
CRC-ing the pointer should yield a more likely to be unique 32bit value.
NULL is a special case that yields 0 instead of the CRC, so code that
handles IDs/Tags with value 0 differently will continue to work.
For 32bit builds, it just returns the pointer as ULONG.
2016-04-21 16:21:47 +02:00
Daniel Gibson
e642cbcd20 Change PLATFORM_32/64BIT detection
turns out that using UINTPTR_MAX is a pain on several systems like
FreeBSD or even older Linux/glibc systems, so maybe let's not do that
anymore.
Now I check for known CPU-architectures instead.

I also added some sanity checks to make sure the detection was
correct.
2016-04-21 16:21:47 +02:00
Joshua Scoggins
7f682180f3 Use SERIOUS_MHZ envvar for the time being 2016-04-20 19:24:51 -07:00
Joshua Scoggins
dbd896b58d Use the platform independent version of ReadTSC
- If I use the gnu inline version, the game runs way too fast on my cpu due to
  frequency scaling (I think).
2016-04-20 19:06:02 -07:00
Joshua Scoggins
1b873d3ab4 Bool's must be 32-bits wide 2016-04-20 18:50:36 -07:00
Ryan C. Gordon
83b3e2fee3 Merge pull request #34 from rohit-n/reorder
Silence -Wreorder warnings.
2016-04-20 15:02:29 -04:00
Rohit Nirmal
e166958881 Silence -Wreorder warnings. 2016-04-20 13:31:49 -05:00
Ryan C. Gordon
3e84eafe15 Merge pull request #28 from salamanderrake/icculus-master-cmake-bms
CMakeLists.txt changes plus install.
2016-04-19 22:53:41 -04:00
Salamanderrake
9477af7bfa CMakeLists.txt: Applied some changes Ryan wanted with the c/cxx flags. 2016-04-19 18:16:45 -04:00
ptitSeb
88d553c8f4 Merge branch 'master' of https://github.com/ptitSeb/Serious-Engine 2016-04-19 23:47:30 +02:00
ptitSeb
c8291e6d37 More macro for UNIPTR_MAX 2016-04-19 22:00:29 +02:00
ptitSeb
e077fd664d Need __STDC_LIMIT_MACROS macro here too 2016-04-19 22:00:28 +02:00
ptitSeb
4b47c278bb Nedd __STDC_LIMIT_MACROS for *_MAX constant to be defined 2016-04-19 22:00:27 +02:00
ptitSeb
b9bb24e608 Don't regulate Framerate on Pandora 2016-04-19 22:00:27 +02:00
ptitSeb
484d49434b Restrict the Eps precision change only to Pandora platform 2016-04-19 21:54:46 +02:00
ptitSeb
9288c42268 fix Inverted Right and Middle button on certain case with SDL 2016-04-19 21:54:43 +02:00
ptitSeb
7c1cc68d6f Lower Epsilonon Pandora 2016-04-19 21:54:43 +02:00
Ryan C. Gordon
26b4941010 Merge pull request #30 from Yamagi/bswap32
bswap_32() is a linuxism, use inline code instead.
2016-04-19 13:11:33 -04:00
Yamagi Burmeister
794180c598 bswap_32() is a linuxism, use inline code instead.
bswap_32() is a function specific to Linux, unavailable on FreeBSD and
OS X. Instead of messing with other platform specific functions, #ifdef
and so on provide a fast inline implementation.
2016-04-19 19:09:20 +02:00
Ryan C. Gordon
fd1ba82bc8 Merge pull request #29 from DanielGibson/fix-textures-crash
Textures.cpp: improved td_pulObjects/td_ulObject fix
2016-04-19 08:59:59 -04:00
Daniel Gibson
8de421dc9d Textures.cpp: improved td_pulObjects/td_ulObject fix
* td_pulObjects is explicitly set to NULL in the constructor - before
  only td_ulObject was set to NONE (0), so on 64bit half of
  td_pulObjects bytes would remain garbage
* only check td_ulObject for NONE if td_ctFrames <= 1 (until now it
  would frequently check it for NONE even if td_ctFrames > 1, if
  td_pulObjects was != NULL)
2016-04-19 14:38:25 +02:00
Salamanderrake
380bade7c0 CMakeLists.txt: BMS, Added a small explanation about the default CMAKE_INSTALL_PREFIX 2016-04-19 04:43:59 -04:00
Salamanderrake
895921d8c1 ModExt.txt: Created a link(don't know if this will work) to ModEXT.txt since the linux
version looks for ModExt.txt and not ModEXT.txt
2016-04-19 04:41:55 -04:00
Salamanderrake
90a614b03c CMakeLists.txt: Added an install section and fixed permissions issues with libraries. 2016-04-19 04:41:55 -04:00
Salamanderrake
b7c49d4e51 CMakeLists.txt: Some cleanup and removing redundent lines from the CMakeLists.txt file. 2016-04-19 04:41:55 -04:00
Salamanderrake
ec1448c4d4 build-linux32.sh: Renamed build-linux.sh build script to show which arch it is compiling
build-linux64.sh: for use build native 64bit linux binaries.
2016-04-19 04:41:55 -04:00
Salamanderrake
86b487df9e CMakelists.txt: Removed my attempt at making Engine a static lib again. plus other small cmake fixes 2016-04-19 04:41:55 -04:00
Salamanderrake
836a4abc43 CMakeLists.txt: Redid the section on c/cxx flags to sepereate them
so you can have c++ only flags along with c only flags
	fore their respective .c/.cpp builds without conflict.
2016-04-19 04:38:55 -04:00
ptitSeb
4bbe57bccb Need __STDC_LIMIT_MACROS macro here too 2016-04-19 08:24:43 +02:00
ptitSeb
b9e4fb49c9 Merge branch 'master' of https://github.com/ptitSeb/Serious-Engine 2016-04-19 07:31:06 +02:00
ptitSeb
f5d397ebc6 Nedd __STDC_LIMIT_MACROS for *_MAX constant to be defined 2016-04-19 07:30:43 +02:00
ptitSeb
c5148824b2 Don't regulate Framerate on Pandora 2016-04-19 07:20:52 +02:00
ptitSeb
0d4437a1ac Restrict the Eps precision change only to Pandora platform 2016-04-19 07:20:52 +02:00
ptitSeb
031223de35 fix Inverted Right and Middle button on certain case with SDL 2016-04-19 07:20:49 +02:00
ptitSeb
2dc1c2502a Lower Epsilonon Pandora 2016-04-19 07:20:49 +02:00
Ryan C. Gordon
1f7bb24a4d Merge pull request #26 from DanielGibson/64bit-stuff
Some 64bit improvements, lots of 64bit TODOs/STUBBED()
2016-04-18 22:33:58 -04:00