Ian Curtis
0b6da91cc0
add the rest of the network board code (Spindizzi)
2018-01-07 14:07:59 +00:00
Ian Curtis
dc3048df24
use the correct c++ deleters
2018-01-06 11:19:04 +00:00
Ian Curtis
19e6aab1fa
use a few macros to make debugging less painful
2018-01-06 01:18:14 +00:00
Ian Curtis
314279ed25
Add network board emulation. Currently not linked with the rest of the project.
2018-01-04 19:14:12 +00:00
Ian Curtis
f7678d918e
remove using namespace from headers ..
2018-01-03 17:51:24 +00:00
Ian Curtis
53c98283aa
rename to avoid clash with a #define
2018-01-03 16:19:10 +00:00
Ian Curtis
3ab93cf6ee
add asynchronous sending functions
2018-01-02 18:54:34 +00:00
Ian Curtis
58dc18cd11
remove dead variable
2017-12-29 11:46:38 +00:00
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
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
43cf6b3bbf
update spotlight code (Harry Tuttle)
2017-10-05 18:49:08 +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
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
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
Ian Curtis
0efd4dac39
Finish fixed shading for 2.0 hardware. I'm pretty sure it actually works identically to step 1.5 hardware. The oddball is LA machine guns where the viewport ambient doesn't seem to effect the brightness. But the ambient works differently in this game because it uses the unclamped light model. Still need to investigate if the diffuse factor effects fixed shading.
2017-08-15 23:21:57 +00:00
Ian Curtis
b1cc9a615d
With fixed shading, when lighting is disabled, fixed shading appears to be a flat shaded version based upon the poly colour, instead of per vertex attributes.
2017-08-15 20:50:36 +00:00
Ian Curtis
2422caadc6
Pad struct and align on 4 byte boundary.
2017-08-15 20:45:08 +00:00
Ian Curtis
eac76f0908
simplify
2017-08-14 23:30:34 +00:00
Ian Curtis
81188bee07
fixed shading doesn't effect the alpha channel
2017-08-14 16:10:26 +00:00
Ian Curtis
c12e4c3215
Fixed shading (per vertex poly colours) on step 1.5 hardware have the viewport ambient value added to them. This fixes various shading on scud. To do this had to switch the maths to the vertex shader.
2017-08-14 09:14:06 +00:00
Ian Curtis
8f622714a7
Fix attribute locations. glBindAttribLocation must be called linking
2017-08-11 11:59:41 +00:00
Bart Trzynadlowski
a315627401
Added support for loading shaders from files for new engine and tile renderer. Changed help text to reflect new engine being default.
2017-08-11 00:41:10 +00:00
Ian Curtis
7dc1eac614
make the new3d engine default :] Legacy engine can still be selected using -legacy3d in the command line
2017-08-10 15:59:16 +00:00
Ian Curtis
d7403afda6
use generic vertex attributes
2017-08-10 15:43:03 +00:00
Ian Curtis
57d0a513fd
Technically matrix casts are only allowed in glsl 1.2 and later
2017-08-09 23:25:01 +00:00
Ian Curtis
063b7d3ea4
Remove debug code
2017-08-09 21:40:48 +00:00
Ian Curtis
5709ee2659
Sometime ago I managed to work out that specular on the model3 is not real specular, and really is just an extension of diffuse lighting. But attempts were derailed by corner cases and the fact we were not handling the normals correctly. Anyway Harry managed to successfully come up with an algorithm, and coefficients that give an almost perfect match to specular on the model3, based soley on observations from video footage! He also worked out that the lighting on hardware 1.5 onwards appears to be unclamped (ie greater than 1). This quite radically changes the brightness of some of the games, but much better matches the original hardware.
2017-08-09 16:56:56 +00:00
Ian Curtis
1d338877fc
cosmetic
2017-08-03 11:05:04 +00:00
Ian Curtis
3fc28159eb
Add the unclamped light model we know exists to the shaders.
2017-08-03 10:41:18 +00:00
Ian Curtis
b1bd877b82
Ski champ for some reason is passing denormalised numbers for the modelscale. This is causing a NaN in our shader killing the lighting for these models, so we simply skip these, since they are essentially zero anyway. Thanks to Harry for finding this bug :)
2017-08-01 23:48:53 +00:00
Ian Curtis
9aa3f13777
We were force normalising the result of matrix * normal, which looked correct in most cases. But this didn't preserve the scaling of the matrix, or the scaling of the model normals which resulted in many over bright areas. On it's own this generally worked, but games like Star Wars looked quite broken. Harry correctly figured out if you scale these normals by the scaling value that is sometimes present in the culling nodes the lighting looks correct. Still more work to do to correctly figure out the model3's lighting model.
2017-07-29 16:30:30 +00:00
Ian Curtis
a9b49c1676
Implement unclamped light model based upon Harry's findings. Unknown how this is turned on/off.
2017-07-22 17:15:14 +00:00
Ian Curtis
2335f3173b
Use c++11 raw string literals
2017-07-08 10:55:14 +00:00
Ian Curtis
3efb055344
Clamp the ambient light to a max of 0.75. LA Machine guns seems to use an ambient value of 1, which is full bright for everything. But for some reason the hardware seems to treat this as ~ 0.75. This fixes various missing shading in the game. This doesn't seem to have any negative effects on other games I have tested. Clamping in the shader as we might need the full range of values for fixed shading.
2017-06-29 19:05:30 +00:00
Ian Curtis
9e9a549283
remove WIP code
2017-06-25 20:09:45 +00:00
Ian Curtis
ec3872d108
convert sun angle coordinate system outside of the shader
2017-06-25 19:50:02 +00:00
Ian Curtis
97781108e8
A second go at fixing the fixed lighting in star wars .. Fixed shading is per vertex poly colours. For some reason in star wars they are treated as unsigned values instead of signed, like in every other game. These polys are all marked with specular enabled, where as in the rest of the games they are missing this flag. That's the only difference I can find.
2017-06-21 17:04:53 +00:00
Ian Curtis
1532168af7
fix double offset
2017-06-20 21:44:58 +00:00
Ian Curtis
b00315b072
Revert previous fixed shading changes. Implement new logic for fixed shading on step 1.5 hardware based upon Harry's findings.
2017-06-20 20:13:42 +00:00
Ian Curtis
bb3c538808
remove debug code
2017-06-20 19:46:06 +00:00
Ian Curtis
260daa1b91
Fix the fix shading in star wars. Fixed shading still needs some work for mag truck and dirt devils to match the arcade.
2017-06-17 16:05:54 +00:00
Ian Curtis
73a7d2760d
cosmetic
2017-06-07 23:16:22 +00:00
Ian Curtis
1193069709
Tweak scroll fog logic again .. should fix missing 2d fogging in Spikeout.
2017-06-07 23:14:01 +00:00
Ian Curtis
45741b24d2
rewrite scroll fog logic
2017-05-06 16:47:31 +00:00
Ian Curtis
80004b0dad
Remove debug code
2017-04-25 00:31:39 +00:00
Ian Curtis
7694e4eb0c
minor culling node optimisations
2017-04-25 00:10:55 +00:00
Ian Curtis
ff936c588b
don't need cast, conversion is implicit
2017-04-20 19:46:40 +00:00
Ian Curtis
912bb0e7cf
better state handling
2017-04-20 19:43:41 +00:00
Ian Curtis
9b226ed478
parse out some culling node values
2017-04-17 10:40:07 +00:00
Ian Curtis
3c78571615
There are 2 bits in the polyheader labelled discard. When both are set ie in sega rally, the polygons are totally discarded. Scud seems to set bit 1 which seems halve the opacity.
2017-04-15 19:00:46 +00:00
Ian Curtis
21836c088c
The real3d has a flag that allows the hw to skip polygons so that they aren't rendered. Sega rally2 uses this for the dust effects. Triangles or quads that have this flag are junk, and look like random corruption if you try to draw them. We assumed polys that shared vertices with these bad polygons were also bad. It turns out the last few shared vertices in these polys were in fact valid, and thus the entire quad/triangle strip should be drawn and not discarded.
2017-04-14 23:41:11 +00:00
Ian Curtis
fc50bdee98
light parameters must be clamped (HarryTuttle)
2017-04-14 00:08:17 +00:00
Ian Curtis
391aafd4c1
Virtua fighter has a few massive polys that shouldn't be visible. It looks like these polys have a bad matrix, but the node distances are all zero. This means the bounding box that encapsulates them is of size zero. Skipping over these entirely seems to fix the issue.
2017-04-12 15:47:57 +00:00
Bart Trzynadlowski
4a70d5ec9a
Updated Util::Config::Node unit tests with multiple leaf node test
2017-04-12 02:41:02 +00:00
Ian Curtis
e462fbeda0
remove unused variable
2017-04-11 11:11:45 +00:00
Bart Trzynadlowski
76817790d4
Extended -gfx-state to produce culling node analysis
2017-04-11 07:03:47 +00:00
Bart Trzynadlowski
9dd2b24729
Fixed behavior of Util::Config::Node when adding nested nodes (only leaf level can be duplicated; e.g., foo/bar and foo/bar will create one foo with two bar children, rather than two foo each with one bar).
2017-04-11 07:03:10 +00:00
Bart Trzynadlowski
901b8c3fa4
Spindizzi's SCSP DSP fix for the VF3TB cave stage
2017-04-09 15:27:43 +00:00
Bart Trzynadlowski
9989eae8aa
Hooked up the command line help options (thanks, Spindizzi!) and updated copyright info
2017-04-09 15:08:02 +00:00
Ian Curtis
06cb5708e3
add missing include
2017-04-08 21:01:11 +00:00
Bart Trzynadlowski
a649a0d36b
Removed patches from source code and moved them into game XML file. Created ROMSet.cpp. Print a more descriptive error when game XML file fails to load.
2017-04-08 18:30:29 +00:00
Bart Trzynadlowski
86ffda66d8
Updated help text to include -game-xml-file option
2017-04-08 18:28:49 +00:00
Ian Curtis
788a480ff3
add missing include
2017-04-07 15:47:36 +00:00
Bart Trzynadlowski
006260be47
Harry Tuttle's fixes to fishing controls: invert fishing rod y and fishing stick y axis values so setting a negative axis is not necessary. Also changed reel to an analog input (similar to a pedal), whose neutral position is 0.
2017-04-07 04:42:04 +00:00
Bart Trzynadlowski
4ca7d5ef0e
Harry Tuttle's change to Harley gear shift to use a single bit instead of two (no detectable difference in behavior, though)
2017-04-07 04:30:27 +00:00
Bart Trzynadlowski
205282a758
Removed unused file: Game.cpp
2017-04-06 03:23:32 +00:00
Ian Curtis
101e43213e
cosmetic
2017-04-05 19:32:01 +00:00
Ian Curtis
edfb521a9b
Daytona seems to use this completely undocumented feature of the real3d pro-1000, the ability to invert texture colours. This patch fixes the colours on the cars, and the signs which should flash by alternating their colours.
2017-04-05 17:57:38 +00:00
Bart Trzynadlowski
cc32e0bf8e
Removed last vestiges of CINIFile from input system and removed Games.cpp, INIFile.cpp, and ROMLoad.cpp
2017-04-05 16:19:08 +00:00
Bart Trzynadlowski
df283d9aa3
Using Game::INPUT_* instead of obsolete GAME_INPUT_*
2017-04-05 16:17:57 +00:00
Bart Trzynadlowski
c013eab711
Changes by Harry Tuttle: game list more accurately reflects MAME's, added a root level XML "games" node, print ROM version along with title
2017-04-05 05:35:45 +00:00
Bart Trzynadlowski
f6707ecfba
Fixed graphics state analyzer
2017-04-04 23:28:06 +00:00
Bart Trzynadlowski
c4bf565a1a
Added cstring
2017-04-04 23:27:39 +00:00
Ian Curtis
4ebcf5865a
more whitespace ..
2017-04-03 12:02:49 +00:00
Ian Curtis
a141635be6
white space ..
2017-04-03 12:01:37 +00:00
Ian Curtis
c617a453fa
Cache dereferenced values. Cuts loading time from 15 to 5 seconds in debug mode :)
2017-04-03 12:00:25 +00:00
Bart Trzynadlowski
5aafbbf936
Included cstring for memcpy
2017-04-03 05:34:23 +00:00
Bart Trzynadlowski
2aa9dc7967
Rewrote large parts of ROM loading code to more gracefully handle merged sets where overwritten parent ROMs are not present. Better handling of multiple zip files. Optimized ROM loading when stride and chunk size are equal and got rid of safety checks that I don't believe are necessary any longer.
2017-04-03 01:03:38 +00:00
Ian Curtis
f0e00c5dc7
Rewrite the spot light code, and implement the missing fog logic. (HarryTuttle)
2017-04-02 21:03:59 +00:00
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
Ian Curtis
85c4d85562
refactor
2016-06-19 21:43:09 +00:00
Ian Curtis
c2b1db11f8
Cull geometry based on the culling distances in the nodes. Should give some sort of speedup on lower end pcs where the CPU is predominantly the bottle neck.
2016-06-16 20:05:29 +00:00
Bart Trzynadlowski
f31f06b42e
Fix compilation when SUPERMODEL_DEBUGGER enabled
2016-06-13 00:53:39 +00:00
Ian Curtis
d799c63b1a
cache bound texture
2016-06-10 11:29:20 +00:00
Ian Curtis
48a79a8f14
cleaning
2016-06-10 10:18:47 +00:00
Bart Trzynadlowski
b0911afd1f
Added drive board and lamp raw outputs (submitted by SailorSat)
2016-06-07 01:51:16 +00:00
Ian Curtis
8440bc7f03
support negative exponent
2016-06-03 09:33:46 +00:00
Ian Curtis
5081ee99dc
Add code to convert the 16bit float format used by the hardware back into float 754 format. 16bit floats are used for the culling radiuses in the nodes.
2016-06-03 00:01:34 +00:00
Bart Trzynadlowski
6dc5845d47
Added -vsync and -no-vsync option descriptions to command line help
2016-06-02 23:51:43 +00:00
Ian Curtis
9bc1fbf0cb
remove dead code
2016-06-02 21:26:50 +00:00
Bart Trzynadlowski
968652bcfb
Added a Split() function to Util::Format.
2016-06-02 03:14:46 +00:00
Bart Trzynadlowski
d1330d310c
XInput fix: search for all three possible XInput DLLs (xinput1_4.dll, xinput1_3.dll, and xinput9_1_0.dll). I have not tested 32-bit builds.
2016-06-02 00:13:42 +00:00
Ian Curtis
ff8e9d6aad
Check for overflow. Fixes some fade effects
2016-05-30 23:10:56 +00:00
Bart Trzynadlowski
9a49fefe12
Legacy engine: fixed texture offsets (VON2 was broken by last commit). Texture coordinates are wrapped within the bank first and then the bank can be swapped. This also allows the full range of texture coordinate bits to be used as specified in the Pro-1000 SDK.
2016-05-30 19:18:11 +00:00
Ian Curtis
36074d9fd5
Y texture offsets are just 5 bits. Texture coordinate wrap around happens in the same texture sheet, not into the next one. Fixes various texturing bugs in sega rally.
2016-05-30 13:25:00 +00:00
Bart Trzynadlowski
d1f49675b1
Legacy engine: Culling node texture Y offset is only 5 bits (fixes Sega Rally 2 initials decal)
2016-05-29 20:49:28 +00:00
Bart Trzynadlowski
2ee0d9018e
New engine: modf -> std::modf (fixes compilation on gcc)
2016-05-28 20:54:25 +00:00
Bart Trzynadlowski
1a908dd414
Legacy engine: expanded color index to 12 bits from 11. Does this affect any games?
2016-05-28 20:50:05 +00:00
Bart Trzynadlowski
5c1a240565
New engine: expanded color indices to 12 bits from 11. Added PolygonHeader::ColorIndex and SensorColorIndex methods.
2016-05-28 20:49:10 +00:00
Bart Trzynadlowski
2ef5203839
Forgot to describe one polygon header field in Model.cpp
2016-05-28 20:40:45 +00:00
Bart Trzynadlowski
e4a5c341dd
Updated polygon header descriptions
2016-05-28 20:33:10 +00:00
Bart Trzynadlowski
0ebb8d5d47
Legacy engine: Added stencil buffering for layered models and shadows. Not as accurate as new engine because stencil buffering is applied per-model rather than per-polygon, so the entire model must consist of stencil-tested polygons. In practice, though, this seems to work fine.
2016-05-28 19:52:30 +00:00
Ian Curtis
ce03c13847
Optimise non smooth texture repeat to only effect texture boundaries, rather than poly boundaries. Fixes a few ugly artefacts
2016-05-28 13:21:35 +00:00
Ian Curtis
661f19be19
fix transparency values, values are from 0-32, not 0-16 where the top bit disables
2016-05-27 22:20:57 +00:00
Ian Curtis
2086b1c9af
Stencil layered polys, fixes shadow z fighting in some of the games. Other games maybe using stipple alpha (yuck), not sure yet.
2016-05-27 19:30:40 +00:00
Ian Curtis
8979246642
remove bad rom patches
2016-05-26 16:21:42 +00:00
Ian Curtis
3f9936d664
don't clamp after spot light code, looks much closer to h/w
2016-05-26 09:06:09 +00:00
Bart Trzynadlowski
8ba8d7290e
Hooked up Sega Bass Fishing / Get Bass controls
2016-05-26 04:13:22 +00:00
Ian Curtis
89c987fae1
basic spotlight code
2016-05-26 00:08:12 +00:00
Bart Trzynadlowski
a0910f96fb
Fixed fog in legacy 3D engine. Now computed same as new engine, with 4-bit light modifier and corrected fog mixing in shaders.
2016-05-25 04:00:02 +00:00
Bart Trzynadlowski
6dc35f9563
Updated legacy engine vertex shader to use specular shininess and coefficient along with old equation. Still not correct (too strong compared to the old method).
2016-05-25 03:10:36 +00:00
Ian Curtis
c5ce2b9679
fix alpha testing for texture format 7
2016-05-22 19:17:15 +00:00
Ian Curtis
65d6342947
remove dead code
2016-05-21 16:26:00 +00:00