Commit graph

682 commits

Author SHA1 Message Date
Ian Curtis 78ae00faf1 Add basic networking files to supermodel. Currently these are win32 specific but can port to SDL or whatever later. 2017-12-29 11:42:03 +00:00
Ian Curtis 080acd08c2 Fix the smallest texture lods (Harry Tuttle) 2017-12-21 11:14:06 +00:00
Ian Curtis a772dd32fc fix array out of bounds 2017-12-20 18:47:17 +00:00
Ian Curtis 4702fef33e remove debug code 2017-12-19 11:43:17 +00:00
Ian Curtis 429d6cbb02 mark as static 2017-12-17 23:02:25 +00:00
Ian Curtis cc28d5f00e Implement sub 8x8 tile encoding. Fixes incomplete mipmap chains which previously only went down to 8x8 pixels before. It wasn't known these textures existed before. (Harry Tuttle) 2017-12-17 22:25:50 +00:00
Ian Curtis cede67468c Fix some bad/missing textures in fighting vipers. The game is referencing totally illegal texture sizes. The real h/w was just handling it somehow, whilst we were returning null for the textures. This might produce junk textures for the lower mipmaps, but this can be clamped in a later update. 2017-12-13 01:21:25 +00:00
Ian Curtis 62d9584b0d Shift fog maths to fragment shader to fix bug in virtua on. 2017-11-23 17:51:51 +00:00
Ian Curtis bddc86aba9 The vertex shader is run before clipping is done. If fogging values are calculated and clamped in the vertex shader it can interpolate bad values, since the range has been truncated. This happens if the polys overlap the near plane. The solution to clamp the values in the fragment shader. This fixes a bunch of fogging errors I long thought were transparency related errors in the ocean hunter. 2017-11-20 22:21:15 +00:00
Ian Curtis bc7f1e9fac Fixed shading also works with untextured polys. Fixes some shading issues in La machineguns. (Harry Tuttle) 2017-11-07 00:15:57 +00:00
Ian Curtis df44ad458b Update step 1.5 luminous logic with Harry's findings. Fixes various shading issues. 2017-11-05 13:25:33 +00:00
Ian Curtis 8e13c3bbb9 Finish the hash function (Harry Tuttle) 2017-10-19 20:48:53 +00:00
Ian Curtis 7f6df0cc84 Remove fixed shading check from specular. 2017-10-07 12:39:30 +00:00
Bart Trzynadlowski 4d685e0750 Makefile fixes: Moved Windows-specific source files out of Makefile.inc, using 'bin' and 'obj' when bits are not explicitly set, and changed output file to Supermodel rather than Supermodel.exe, which works on all platforms. 2017-10-06 01:04:49 +00:00
Ian Curtis eb798ed15e Star wars is the only game to pass unsigned fixed shaded values (per vertex brightness) to the renderer. Originally we thought that the specular flag would turn on unsigned values since it's the only game to set specular with these polys, but this logic turned out to be incorrect. The JTAG interface seems to config the GPU to turn on this functionality. (Harry Tuttle) 2017-10-05 19:15:00 +00:00
Ian Curtis 7c84bc6aeb update visual studio project 2017-10-05 18:54:36 +00:00
Ian Curtis 43cf6b3bbf update spotlight code (Harry Tuttle) 2017-10-05 18:49:08 +00:00
Bart Trzynadlowski cee468b2bc Harry's patch: add dirtdvlsj and change "Star Wars Trilogy" to "Star Wars Trilogy Arcade" 2017-10-05 02:17:48 +00:00
Bart Trzynadlowski 2397b8225a New, saner Makefiles. They still require some customization but share a core Makefile include with auto-generation of dependencies. Multi-threaded building (e.g., make -j6) is supported now. 2017-10-05 02:14:02 +00:00
Ian Curtis 9bac7836ed add missing header 2017-09-30 19:05:04 +00:00
Bart Trzynadlowski 3ca37089ca Get rid of unused variable warning 2017-09-27 13:20:09 +00:00
Ian Curtis 0afd9026dc Fix the sky in one of the levels in virtua on. The problem was caused by the fact we didn't split the mesh by the fog % burn through, so all the polys had the same value. We could use a vertex attrib, but % burn through fog is so rarely used and when it is, normally every poly in the mesh has the same value. 2017-09-26 00:30:08 +00:00
Bart Trzynadlowski 1eac755bc3 Fix tiny memory leak 2017-09-25 00:05:10 +00:00
Ian Curtis 18f460db6f 2017-09-24 22:49:20 +00:00
Ian Curtis da1342b5d9 update project files 2017-09-24 22:39:53 +00:00
Ian Curtis 0376f74192 work around for visual studio bug 2017-09-24 22:36:12 +00:00
Ian Curtis adecec77de fix missing header 2017-09-24 22:14:39 +00:00
Ian Curtis 7590f50350 cannot specify explicit initializer for arrays - fix for visual studio 2017-09-24 22:03:31 +00:00
Bart Trzynadlowski 55bb02d4e5 - New work-in-progress frame timing code (disabled by default, compile with NEW_FRAME_TIMING defined to activate it)
- New JTAG emulation, moved into its own class, CJTAG
- Removed game-specific sun clamp hacks from CNew3D (JTAG and Real3D emulation will call the appropriate method to configure this at run-time)
- Removed JTAG from Real3D save state data and reused some of that space for new state variables having to do with the internal JTAG-based config as well as new frame timing state variables
2017-09-24 20:52:48 +00:00
Bart Trzynadlowski c4f8471d7a Added functions to safely read and write bools 2017-09-24 20:49:31 +00:00
Bart Trzynadlowski 1db2f6bb84 Added functions to extract bits as integer values and updated comment about bit vector layout 2017-09-24 18:40:58 +00:00
Bart Trzynadlowski 3041ca1922 Added SetOnes() and SetZeros() 2017-09-23 16:08:27 +00:00
Bart Trzynadlowski c3eef706e8 Safe guard against shifting empty register. 2017-09-23 15:40:20 +00:00
Bart Trzynadlowski 98b0354dd6 Hex formatting support extended to 64 bits. 2017-09-23 15:33:26 +00:00
Bart Trzynadlowski 61a0517bd9 Added ShiftOutLeft() and ShiftOutRight() 2017-09-23 15:03:06 +00:00
Bart Trzynadlowski 7a2e6b393a Renamed shift in/out functions to add/remove to be less ambiguous about their functionality 2017-09-23 14:42:05 +00:00
Bart Trzynadlowski 86631695d7 Added ToHexString() and made ostream serialization use this 2017-09-19 19:43:06 +00:00
Bart Trzynadlowski e12a945ddd Fix for VS2015 and newer by MetalliC 2017-09-18 04:24:23 +00:00
Bart Trzynadlowski f2030ac125 Added BitRegister class (for use in upcoming JTAG refactor): an inefficient but flexible container for manipulating a dynamic bit stream. 2017-09-07 19:33:25 +00:00
Ian Curtis a3e2fb7906 Calculating the length of the vertex results in quite broken values for fogging when the vertices are traversing the view frustum. The hardware also wouldn't have been doing a square root per vertex for fogging. Simply using the z values is enough. Todo check clamping of values for the near/far planes. 2017-09-06 13:07:39 +00:00
Ian Curtis 2786d95795 add interface for sun clamp 2017-09-02 14:54:16 +00:00
Ian Curtis 266c911133 Optimise vertex data to cut down on unnecessary copying 2017-08-30 21:45:25 +00:00
Ian Curtis 165926aa06 Modern hardware does backface culling in window space by calculating the face normal for the polygon, then doing a dot product against the view vector. The real3d pro-1000 on the other hand passes a pre-calculated face normal for each polygon which is used for culling. We were using this face normal to rewind the polygons so that regular backface culling would work. This worked 99.9% of the time. However this was failing on some models in Virtua Striker. The reason was because the pre-calculated face normals being passed were actually completely different to the actual face normals for the poly (not just inverted like you would expect). This broke our code. The solution was to emulate face culling directly in the vertex shader using the pre-calculated face normals directly. Only minimally tested this but hopefully there are no obvious regressions. 2017-08-29 10:27:29 +00:00
Bart Trzynadlowski f04a285727 DMA and register space access for Real3D have been unified and CReal3D::ReadRegister() returns little endian data now that the PowerPC handler byte-swaps back, to be consistent with how DMA registers work. 2017-08-29 01:28:21 +00:00
Ian Curtis 50d1f95648 Changed fixed shaded logic for step 1.5 hw based upon Harry's findings 2017-08-25 22:40:39 +00:00
Ian Curtis b21ed49512 cosmetic 2017-08-21 23:00:29 +00:00
Ian Curtis cd5978773a Harry made some important discoveries with regards to fixed shading on the model 3 (per vertex poly brightness values). Firstly values are allowed to be negative, and they are used as a drop in replacement in the standard lighting equation for the normal dot light vector. This quite radically changes the brightness in LA Machine guns, but now correctly matches the arcade. 2017-08-19 20:06:31 +00:00
Bart Trzynadlowski 94e6f9a156 Patched Sega Rally 2 DX to boot up. Enjoy Sega Rall 2 without MPEG music at 50% speed ;) 2017-08-19 19:29:05 +00:00
Bart Trzynadlowski 507990a350 Fixed up memory region dumping code to use the new Util::FlipEndian functions 2017-08-19 19:27:58 +00:00
Bart Trzynadlowski 21f813ad3e Fixed a bug in MCRFS instruction related to the VXSOFT, VXSQRT, and VXCVI bits. Thanks to Spindizzi. 2017-08-16 00:58:39 +00:00