Commit graph

530 commits

Author SHA1 Message Date
Bart Trzynadlowski 07660be0df Fixed missing file detection (set_difference requires inputs sorted by desired key) and improved error reporting 2017-04-01 05:08:50 +00:00
Bart Trzynadlowski 68ebf35aac Removed TODO comment 2017-03-31 05:23:34 +00:00
Bart Trzynadlowski b0957e6459 Smarter game selection when a zip file contains multiple games (prefer child when parent is also present in zip) 2017-03-31 05:23:04 +00:00
Bart Trzynadlowski e40d268214 Warn about parent ROM sets having parent defined (not allowed) 2017-03-31 04:44:45 +00:00
Bart Trzynadlowski 47ce132292 Print missing files from games 2017-03-31 04:27:09 +00:00
Bart Trzynadlowski fd0f7ec6d1 Support loading of parent ROM sets (e.g., scudp will load scud) 2017-03-30 06:17:34 +00:00
Ian Curtis cd1a551e4b compile fixes 2017-03-28 22:28:46 +00:00
Ian Curtis 1a766843b5 MSYS2 compile fix (HarryTuttle) 2017-03-28 21:02:14 +00:00
Ian Curtis 69eac95846 Replace glsl 3 function. Apparently this doesn't work on OS X. 2017-03-28 20:24:44 +00:00
Ian Curtis 70259eec34 fix compile warnings 2017-03-28 19:33:16 +00:00
Bart Trzynadlowski 318f4cf6dc Sort games found in zip file by descending order of matching files so that game with the *most* matching files is picked 2017-03-28 04:03:38 +00:00
Ian Curtis ddbf08ac73 don't ask 2017-03-27 22:06:23 +00:00
Ian Curtis f320af2049 fix project files 2017-03-27 22:01:31 +00:00
Ian Curtis 3fefff36c2 fix multiple default constructors 2017-03-27 18:15:15 +00:00
Ian Curtis 5c15dac16f add missing include 2017-03-27 14:14:36 +00:00
Bart Trzynadlowski f34e25dfc7 Massive internal change: removed CConfig object and replaced it with a hierarchical config object system (Util::Config::Node). Games are now defined in an XML file. Hopefully I didn't break too many things :/ 2017-03-27 03:19:15 +00:00
Bart Trzynadlowski 26a4417a5f Cosmetic: renamed step to stepping 2017-03-27 03:13:34 +00:00
Bart Trzynadlowski 10befe4938 No need to enclose values in quotes when writing INI file. Print that file was saved to console and log. 2017-03-27 03:10:36 +00:00
Bart Trzynadlowski 35d9842dd8 Added a TODO list 2017-03-27 03:09:24 +00:00
Bart Trzynadlowski c4a63821c3 Encapsulated zip file handling and added a "parent" member to the Game struct 2017-03-27 02:02:22 +00:00
Bart Trzynadlowski ba3a0b5e2a Checking in GameLoader.cpp, GameLoader.h, and ROMSet.h (not currently used in build) because I need to make a substantial modification in my local tree 2017-03-26 16:38:55 +00:00
Ian Curtis ff624afb4d The mipmap data in some games seems to being sent behind the base textures, and when the base textures are bound and created the mipmap chain is not yet valid in memory. To fix this, we invalidate the base textures, when the mipmap chain is updated. 2017-03-25 00:06:24 +00:00
Ian Curtis 06c1cdcf94 Just use 1 hash map for the textures, instead of 1 for each format. Should greatly speed up texture invalidation. TODO invalidate texture mipmaps .. the h/w actually seems to stream the mipmap data separate from the base textures in some cases. 2017-03-24 20:54:12 +00:00
Ian Curtis 98d56ff011 cosmetic 2017-03-24 17:43:07 +00:00
Ian Curtis 82ac030dff calculate the correct number of mipmap textures 2017-03-24 16:51:52 +00:00
Ian Curtis 17f878421b Originally to do mipmapping, I just used the base texture and then let the h/w automatically generate the mipmap chain. I wasn't sure the real3d api even exposed to the programmer the ability to directly set the mipmap data. Anyway, as pointed out by HarryTuttle scud actually uses darker mipmaps for an effect on the water. This patch uses the uses the actual mipmap data from the real3d memory. Only tested scud, so hopefully I didn't cause any cataclysmic errors :) 2017-03-24 13:38:20 +00:00
Ian Curtis 17f7c2d9f6 use 32bit types 2017-03-23 17:18:33 +00:00
Bart Trzynadlowski 61159c07f8 Added 8- and 16-bit tilegen VRAM access handlers to fix missing columns in Star Wars Trilogy tilemaps. Thanks to Spindizzi for initial confirmation that this was the problem. 2017-03-23 04:22:25 +00:00
Ian Curtis 9fb6acc92d fix scissor code for native resolution (thanks HarryTuttle) 2017-03-22 20:38:44 +00:00
Ian Curtis 519cce34f5 remove debug code 2017-03-19 09:54:51 +00:00
Ian Curtis 9780f333b4 The model3 has this weird issue where the 2d and 3d planes are misaligned by 2 pixels. Originally I made a quick hack that shifted subviewports 2 pixels. But apparently that wasn't enough, as the issue effects everything. Thanks to HarryTuttle for pointing this out, and making a patch :) 2017-03-19 01:33:45 +00:00
Ian Curtis b19ceb0b6a Texture coordinates seem to be scaled relative to the fixed texture size of 256. Thanks to HarryTurtle for figuring this crazy logic out. The road in scud matches the arcade now almost perfectly. 2017-03-13 00:59:35 +00:00
Ian Curtis dcd018ab7e Change microtexture scaling values. Seem to much better match expected output. (thanks HarryTuttle) 2017-03-12 19:00:00 +00:00
Ian Curtis 732e3ef51f More fixes to microtexture coordinates. They go vertically up and down the texture sheet, and not horizontally as I had guessed. (Thanks HarryTurtle) 2017-03-11 12:55:47 +00:00
Ian Curtis 6636776f03 Fix microtexture texture coordinates (thanks HarryTuttle) 2017-03-11 01:18:43 +00:00
Ian Curtis 503c88df11 fix the bad projection matrix in dirt devils and lost world 2017-03-07 01:29:07 +00:00
Ian Curtis f173c3c3ce The hardware actually seems to treat the quad primitive as a triangle strip. The winding order can actually change between the first and second 'triangle' inside the quad, leading our code to incorrectly backface cull the 2nd triangle. So we must re-calculate the winding order for the 2nd triangle. This fixes a massive missing poly in the road in la machine guns, probably other games too. The hardware is unaffected by the winding order, as it doesn't calculate the poly normal from the vertices directly, instead it uses the provided normal in the poly header. 2017-02-21 23:35:40 +00:00
Ian Curtis 5b9741bd5d Support high priority polygons. They are treated as a separate overlay plane by the h/w. Fixes some missing fx in harley. 2017-02-20 17:22:32 +00:00
Ian Curtis 2ae2010ee4 Add high priority poly function. Used by harley. 2017-02-18 23:58:08 +00:00
Ian Curtis 4a116190b5 When the translator map?? bit is enabled the colour format seems to be 4-5bit. Max observed value is 16. Scaling these values up seems to produce the correct colours in harley and dirt devils. 2017-02-16 17:20:42 +00:00
Ian Curtis 7407d03036 Put a check in there, in case near values come out really close to zero. Fixes a slight corner case in lemans24. A check probably should have been there originally :) 2017-02-08 16:14:50 +00:00
Ian Curtis 24cbeed526 Dynamically calculate near/far frustum planes for each viewport priority layer by clipping the overlapping meshes with the 4 frustum planes. A bit brute forcy, but the results are great. 2017-02-07 14:05:03 +00:00
Ian Curtis 144125a62e mark the nodes without valid distances set 2017-02-05 15:36:05 +00:00
Ian Curtis c82dc55485 cosmetics 2016-12-22 22:11:19 +00:00
Ian Curtis 72dd0dbf98 only need to cull against 4 clipping planes 2016-12-22 22:09:13 +00:00
Ian Curtis 20a9514aa2 For scroll fog set the viewport to the entire area, allows fog to work in widescreen mode 2016-12-15 19:27:08 +00:00
Ian Curtis ca7046729e properly cache un-normalised texture coordinates, fixes a texturing regression in Daytona 2016-12-15 12:10:52 +00:00
Ian Curtis f355e2d062 fix microtexture colours 2016-12-15 00:45:32 +00:00
Ian Curtis 89e75a9803 Only check scroll fog value from the first viewport from each priority layer. Seems to fix problems with background fogging. 2016-12-14 19:57:05 +00:00
Ian Curtis 707e945db9 delete unused files 2016-12-09 14:15:11 +00:00
Ian Curtis 2c23268d88 Support microtexture relative scale. The exact scaling values are not known, but a 2x difference between each level seems highly likely. We know from visual inspection from scud that the first level is exactly 4. The SDK has a function that accepts a float input for scale and does this. lod = (1/scale) + 0.5. If lod>3 lod = 3. So this is our best guess. 2016-12-09 14:13:46 +00:00
Ian Curtis da8b63b44b The model3 shares vertices between polygons. But it also seems to do this for polygons with different textures. This means the texture coordinate for potentially different sizes textures is shared. Currently this was broken leading to some corrupted looking textures. The fix is to simply cache the old texture coordinates, and recalculate the normalised coordinates in the new texture coordinate space. 2016-12-06 14:39:46 +00:00
Ian Curtis 10a5d2c0e1 refactor 2016-12-06 12:25:34 +00:00
Ian Curtis eece2d75b4 tweak scroll fog logic 2016-12-04 22:37:49 +00:00
Ian Curtis adbebb0204 clean up 2016-12-04 22:37:22 +00:00
Ian Curtis a310e8e5cf minor optimisations 2016-11-28 17:32:25 +00:00
Ian Curtis abc8c24b69 Only check the geometry for culling with valid node distances. We will need this later. 2016-11-27 19:30:46 +00:00
Ian Curtis fe60d115d2 Revert changes .. if we clip against the real3d clipping planes, our wide screen hack won't work anymore. 2016-11-26 01:19:51 +00:00
Ian Curtis 665fa90425 Get clipping planes directly from the viewport data. Also no need to clip against a far plane 2016-11-26 01:12:08 +00:00
Ian Curtis 54c405709f Need to walk back in memory and check the previous texture tiles to see if they overlap with the current textures being invalidated. If they overlap they must be cleared too. Algorithm is a bit brute forcy and more expensive than I'd like but it fixes the bad textures in Spikeout. 2016-11-22 20:30:10 +00:00
Ian Curtis 84ae8f035c Skip processing the mipmap section of memory. The real3d doesn't create mipmaps down to 1x1 that is needed to do mipmapping properly on modern hardware anyway. 2016-11-21 09:04:56 +00:00
Ian Curtis 2ddc8a30e0 Clear queued texture uploads after processing them. Saves re-uploading the same textures whilst paused 2016-11-20 17:02:59 +00:00
Ian Curtis 10dd530cde More accurate 2D colours. White should map to 255 not 248 2016-11-15 12:44:47 +00:00
Ian Curtis 483ba2f398 Fix the shading in scud. When lighting is disabled the fixed shading intensities appear to be offset values added to the colour value. 2016-11-11 17:50:27 +00:00
Ian Curtis 0a7c0d0864 change throttle logic for smoother playback, we could get closer to 60fps if SDL timers weren't so lame 2016-10-21 00:04:12 +00:00
Ian Curtis 2f49012786 change scroll fog logic to parse the lower priority viewports first 2016-10-09 18:10:57 +00:00
Ian Curtis f0a15febd1 implement scroll fog, fixes a tonne of missing fx 2016-10-09 16:34:12 +00:00
Ian Curtis ef11990d19 Parse out scrollfog value used for blending over the 2d background. 2016-10-08 15:41:16 +00:00
Ian Curtis 33e795de9b Fix scenes with missing fog in ocean hunter. The game was passing negative fog densities. The sign seems to be ignored by the model 3. 2016-10-08 15:15:25 +00:00
Ian Curtis 9eeb81ac69 same fix for legacy engine 2016-10-08 12:10:47 +00:00
Ian Curtis 33cf6c89d1 our scratch mem must match correct max texture size 2016-10-08 11:59:25 +00:00
Ian Curtis c472d90fb9 Fix the sky in advanced stage in Dirt Devils. It uses a massive (for 1998 :p) 1024x256 texture. 2016-10-06 20:10:45 +00:00
Ian Curtis c3581c9fe8 Support multiple microTextures, fixes crazy texturing in sega ski champ. I'm assuming microtextures are always located on the other memory bank to the base texture. This logic seems to work for all our games anyway. 2016-10-06 01:37:29 +00:00
Bart Trzynadlowski e21ea93319 Added RGBA4 format to BMP file writer 2016-09-07 01:25:27 +00:00
Bart Trzynadlowski 3df3610361 Made parsing of hex values more robust 2016-08-25 04:54:08 +00:00
Bart Trzynadlowski 458684eb22 Fixed new 3D engine's fragment shader to work on some older GPUs by reducing the number of discard statements to one 2016-08-24 22:21:18 +00:00
Bart Trzynadlowski 4b184b05dc Updated game loader to make use of latest changes to config tree: generic value types and eliminated pointers 2016-08-24 04:13:23 +00:00
Bart Trzynadlowski c2f80cef6b Support for hex numbers in string to integer conversions (with '0x' prefix) and special keywords in string to bool conversions (true/false/on/off/yes/no) 2016-08-24 04:11:52 +00:00
Bart Trzynadlowski f08ad1584f Added Util::Stricmp() and small tweak to serialization of Util::Format 2016-08-24 04:10:20 +00:00
Bart Trzynadlowski 2efe18b525 Added support for multiple value types in config nodes.
Removed Ptr_t and ConstPtr_t from public interface, moved config tree builders into their own file, and made them pass by reference and value.
Exceptions can be thrown now on lookup failures.
Removed s_empty_node -- failed lookups in [] operator create a permanent "hidden" child.
Updated comment in NewConfig.cpp.
2016-08-21 22:22:45 +00:00
Bart Trzynadlowski 01a6ad1596 Added copy constructor and assignment operator using C++11 move semantics 2016-08-19 00:01:45 +00:00
Bart Trzynadlowski a9816467d8 Defined inputs 2016-08-18 04:19:36 +00:00
Bart Trzynadlowski fbeeb3c922 Support for deep copies via assignment operator. This will pave the way for elimination of Ptr_t and ConstPtr_t. 2016-08-18 04:14:36 +00:00
Bart Trzynadlowski 5652aab91f Added Write() method to write buffer to an ostream, and added an ostream operator overload 2016-08-18 04:13:50 +00:00
Bart Trzynadlowski 1dc360a8b0 Changes to game loader interface, added 32-bit word swapping utility function 2016-08-11 03:53:19 +00:00
Bart Trzynadlowski a2423a8b75 Initial check-in of game loader (not operational yet) 2016-08-10 03:28:40 +00:00
Bart Trzynadlowski 037bfc648d Byte swapping utility function 2016-08-10 03:27:59 +00:00
Bart Trzynadlowski 718c237063 Added ValueAsBool(), ValueAsBoolWithDefault(), and ValueAsUnsignedWithDefault() 2016-08-10 03:27:01 +00:00
Bart Trzynadlowski 52d6eac7e5 Added Util::Config::Node::ValueAsUnsigned() with support for base 10 and 16 ('0x' prefix) 2016-07-10 04:25:41 +00:00
Bart Trzynadlowski 331d7042f2 Added Util::ToLower() 2016-07-10 04:25:12 +00:00
Bart Trzynadlowski a84aacf80b Config::Node::Add() now supports nested keys (e.g., Add("foo/bar/baz", "0") will create three nested config nodes) 2016-07-09 15:19:17 +00:00
Bart Trzynadlowski 24c341120a Changed Config::Node::Create() to Add() and added a Set() method (for INI semantics). Turned Test_Config.cpp into a proper unit test reporting pass/fail for each test. 2016-07-09 14:45:48 +00:00
Bart Trzynadlowski 2e069af603 Adding tinyxml2 lib 2016-07-07 05:05:27 +00:00
Bart Trzynadlowski 724dc93294 XML parsing support for new config system 2016-07-07 04:59:10 +00:00
Bart Trzynadlowski bcc663d4eb Moved logging functions into OSD/Logger.cpp (eventually logging system will be reworked entirely) and added new config tree structure (not yet used). 2016-07-05 01:15:58 +00:00
Bart Trzynadlowski 0ab486645c Updated Fragment_NoSpotlight.glsl (fragment shader for legacy engine without spot light) 2016-07-04 01:00:24 +00:00
Ian Curtis 732bff2769 disable spot light if the extent is zero 2016-06-29 20:53:19 +00:00
Ian Curtis efa7776871 parse some unimplemented spot light values from viewport 2016-06-27 17:35:27 +00:00
Bart Trzynadlowski de043355bc Marked offset of code in CROM for scudp 2016-06-24 01:01:30 +00:00
Ian Curtis d058a29ac8 stencil translucent non textured polys 2016-06-19 23:33:06 +00:00