Commit graph

885 commits

Author SHA1 Message Date
Ian Curtis 4b9221ecd6 Add some async network methods. Async send copies to an internal buffer and sends in another thread so doesn't block at all. Added CheckDataAvailable method to the TCPReceive class. Can check or wait for data without blocking. 2021-03-15 15:55:39 +00:00
SpinDizzy 020e2d1b32 DSB2 clock speed from 4MHz to 11MHz. 2021-03-13 08:17:11 +00:00
SpinDizzy de470aaf52 Fixed cycle counting overflow that was causing DSB2 to halt execution. 2021-03-07 10:12:37 +00:00
Ian Curtis 6cf9974102 missing header 2021-03-03 20:31:57 +00:00
SpinDizzy 46b1de2238 DSB2 IRQ 2 now fires at 1KHz rather than once per frame, improving
music timing in Daytona USA 2 and Sega Rally 2. DSB1 CPU timing 
increased from 1MHz to 4MHz, improving music fade timing in Scud Race. 
Thanks to gm_matthew for these discoveries.
2021-03-03 15:30:19 +00:00
Ian Curtis e3374256ff Just a few compile warnings 2021-02-20 22:19:16 +00:00
Ian Curtis 0bfc2aea31 Fix project file 2021-02-19 11:03:48 +00:00
SpinDizzy e4998f57fd Skichamp Driveboard error fix. 2021-02-18 10:35:38 +00:00
SpinDizzy 08d4735ee8 Huge refactor of the Driveboard:
-Separate each possible boards (wheel, joystick, skipad, billboard).
-Defined a Driveboard type in Games.xml for each games.
-Due to the refactoring, Driveboard Savestates have changed (a common base data + a specific board data are saved).
-Backwards compatibility with previous save states is maintained.
-Driveboard rom section is no longer required anymore. This disables Driveboard emulation in case the rom is not found.
-Added Billboard emulation (vf3, vs2, fvipers2, von2). 7 segments and lamps Outputs are redirected to Supermodel outputs.
-Changes project to C++ 17 standard.
2021-02-18 10:29:15 +00:00
SpinDizzy ab367774d3 Introduce new config keywords.
In xinput mode, lets the choice to have left and right gamepad motors vibrate together.
XInputStereoVibration = 1 (both motors) [default]
XInputStereoVibration = 0 (separate motors)

In sdl input mode, new control option to set minimum strength above which a Model 3 constant force command will be simulated on an sdl gamepad device.
SDLConstForceThreshold = 30 [default]
note : the vibration strength can be mod with SDLConstForceMax = [val]
2021-01-30 09:54:03 +00:00
SpinDizzy 6627b1e95f The controls of bass/getbass games were no longer good, following recent rom set name changes in Games.xml. 2021-01-05 14:24:57 +00:00
SpinDizzy 6626afc8bb Added rumble skipad in Ski Champ game.
This is only a simulation (cmd are interpreted), not an emulation because we lack informations on the game itself and its driveboard (does it have dedicated cpu/rom ?).
2020-12-30 17:14:14 +00:00
SpinDizzy 34c24c0104 - Suppressed net board console output (using debug logging now)
- Added GPL headers to net board source files
2020-12-28 16:22:12 +00:00
SpinDizzy 53185c3eff Introducing a special release build target with SVN version stamping. 2020-12-24 10:20:26 +00:00
SpinDizzy 1f50519905 Magical Truck Adventure rom patch to unlock region. (enter service menu, then Start P1, Start P1, Service, Start P1, Service, Test) 2020-12-21 15:39:15 +00:00
Ian Curtis 72c0c60c98 -wide-bg option to stretch the background tile layer when wide-screen mode is enabled - Daro Land 2020-12-20 18:17:34 +00:00
SpinDizzy 7d2b21a6dc Change the duration of constant force effect in SDL2 to correct daytona games 2020-12-01 07:35:52 +00:00
SpinDizzy 5143669cb9 Star Wars Trilogy lever feedback activated 2020-10-24 09:12:54 +00:00
SpinDizzy 402baf87b8 Force Feeback for Linux 2020-10-21 08:19:51 +00:00
Ian Curtis db013491b4 hopefully fix building on linux 2020-09-19 14:45:51 +00:00
SpinDizzy 981cdc33f5 Added Screenshot feature (ALT+S). 2020-09-19 07:54:26 +00:00
SpinDizzy ca57659fcb Remove using namespace from headers. 2020-09-16 07:03:03 +00:00
Ian Curtis c0729c1048 fix compiling with visual studio 2020-09-15 08:51:23 +00:00
Ian Curtis 75f8ee61a3 fix missing polys with quad renderer 2020-09-14 20:01:52 +00:00
SpinDizzy 309537d64e Balance initial value set to "0" rather than "false". "False" is interpreted as 0 when decoded as a float, so there will be no effect here, but this expresses the intended logic better. 2020-09-14 07:01:54 +00:00
SpinDizzy 72b2c0eb28 Fixed a longstanding bug that caused stereo channels to be flipped incorrectly.
This was due to the initial audio buffer write position being aligned to the middle of a 4 byte (2 byte left, 2 byte right) audio sample.
In multi-threaded mode, some sort of race condition caused this alignment to be fixed until audio playback was temporarily paused (via pausing, loading a state, etc.)
Audio playback should now be fixed and work consistently in all cases.
2020-09-14 06:59:38 +00:00
Ian Curtis 38c3ff61f9 Clip scroll fog to viewport, instead of filling entire screen. Fixes fog bug in Daytona credits. 2020-09-08 09:10:24 +00:00
Ian Curtis aaa26f678c Update scroll fog logic. Should fix the credits in virtua fighter and daytona that have fogging applied to the background layer and shouldn't. 2020-09-07 16:25:18 +00:00
SpinDizzy 60c923f45f - Reworked logging system to support output to multiple outputs: files, stdout, stderr, and syslog (OutputDebugString on Windows, syslog on other systems).
- Added ordinal logging level: all, debug, info, error. Compiling with DEBUG defined is no longer necessary for debug logging. Be careful when logging debug level because it produces copious output.
- Fixed -enter-debugger options when compiled with SUPERMODEL_DEBUGGER.
- Command line parse errors no longer ignored; Supermodel will now exit.
2020-08-31 09:28:35 +00:00
SpinDizzy 6491ed46a7 Rename command line SCSP option to -legacy-scsp and -new-scsp 2020-08-26 16:14:54 +00:00
SpinDizzy d3955062e4 Correct the returned value from previous getbass patch
There was a strange side effect on Ocean Hunter game
2020-08-26 16:05:23 +00:00
SpinDizzy 9e8e993026 Getbass related
Game now boots in game
Add missing analog input and buttons
2020-08-25 08:48:25 +00:00
SpinDizzy 97d61a970c Small oversight in the new SCSP code 2020-08-24 10:09:01 +00:00
Ian Curtis 816d541b98 Various SCSP improvements and code cleanup:
- Ported MAME's implementation
- Corrected FM sound for songs in VF3 that use it 
- Music tempo now closer to real hardware thanks to emulating two SCSP chips.
- Add LegacySoundDSP config option for games with SCSP DSP glitches (ex. engine noises in Sega Rally 2, and loud garbage on Bahn's stage in Fighting Vipers 2)
- Renamed SysFPS to "SoundClock" (since raising this appears to adjust the sound frequency).

(Submitted by Paul Prosser)
2020-08-22 20:41:47 +00:00
SpinDizzy 27cda80abb Low level z80 core bug
Discovered when looking at lemans ffb board (real Model3 rom, not Model2 stcc one)
This could affect other ffb board and/or scud race DSB1 sound board
However I didn't notice any bad things
2020-08-22 09:00:13 +00:00
Ian Curtis d77433b525 Remove some debug code 2020-08-01 09:02:04 +00:00
Ian Curtis ba917aca6d Update glew version 2020-07-31 19:18:51 +00:00
Ian Curtis 5e434e2644 build fixes for mac 2020-07-27 10:28:48 +00:00
SpinDizzy 6af882548f Linux build compatibility changes 2020-07-03 09:15:08 +00:00
Ian Curtis f7d75b783d silence a few casting warnings 2020-07-01 17:51:21 +00:00
SpinDizzy a73a06d546 Netboard related : Define a new hardware line in games.xml 2020-07-01 15:56:21 +00:00
SpinDizzy 345310fbee _rotl() replacement 2020-06-17 16:31:22 +00:00
Ian Curtis 9a651bdb61 Only try and make a connection if we have enabled EmulateNet 2020-06-17 15:11:58 +00:00
Ian Curtis 1a3407bec8 Fix corrupted memory in network mode 2020-06-17 11:41:41 +00:00
Ian Curtis 597ea93749 remove old files 2020-06-16 12:01:13 +00:00
Ian Curtis daef27be37 Replace network code with new tcp implementation 2020-06-16 11:55:38 +00:00
Ian Curtis 8071efbf79 Add SDLnetworking + some basic tcp classes 2020-06-13 19:46:12 +00:00
Ian Curtis d688fdd3d5 cache variable, without it is unusably slow in debug mode 2020-06-12 17:33:21 +00:00
Ian Curtis f69d7c7006 fix output values 2020-06-08 10:14:03 +00:00
Ian Curtis 6f6c98c671 The translator map seems to work with paletted colour values too, and the result is not clamped. Colours are passed to the GPU as unsigned bytes to multiplying by 16 will overflow, so we do the logic in the shader. If we passed floats we could skip the shader logic. 2020-05-11 09:05:46 +00:00
Ian Curtis e2ad593e88 When the translator map is enabled the colour values seem to use 4 bits, 0-16. Why not 0-31 I don't know. Anyway virtua on is overflowing these values for some of the smoke effects. For us the numbers were wrapping around. Clamping is enough to fix this. (Thanks model123) 2020-05-07 19:34:22 +00:00
SpinDizzy 5b406059ce custom resolution bug fix 2020-04-24 07:04:41 +00:00
SpinDizzy 4f347ff3f1 SDL1 to SDL2 internal changes 2020-04-19 08:34:58 +00:00
Ian Curtis 5ace960f14 tweak value so the map indicator still works at the start of spikeout 2020-01-04 18:15:30 +00:00
Ian Curtis 6b8a29105a Sutherland-Hodgeman clipping only works for planar primitives. Scud is rendering non planar quads and this breaks our algorithm a little when using the quad renderer. Stretching the near plane a few % is enough to fix it. 2020-01-04 13:48:14 +00:00
Ian Curtis d711afade1 Only need to clip against 4 planes for poly culling 2020-01-04 13:45:55 +00:00
Ian Curtis 605dad2c02 Fix the sky in harley in first person mode where pixels in the sky are culled when they shouldn't be with the quad renderer. Basically we were running out of precision in a rare corner case. Doing the maths with double precision and casting back to float was enough to fix the issue. 2019-12-27 21:36:46 +00:00
Ian Curtis a5858e635d To calculate the mipmap value the opengl needs to calculate the difference in the texture coordinates between adjacent pixels. If there are no adjacent pixels the hw may need to spawn invisible fragments outside of the visible polygon. Our algorithm was culling these out so the mipamp calculation failed for edge pixels. Anyway this fixes quad rendering looking broken with the latest nvidia drivers. 2019-12-10 11:40:39 +00:00
Ian Curtis 06688de5fc Really should cull against 5 frustum planes. 2019-11-15 20:00:25 +00:00
Ian Curtis e1827cfd13 Stretch the time the ping_pong bit flips a bit to bump writes into correct frame. Otherwise they end up getting written at like 99.8% of the frame and overlapping with the next. 2019-11-08 20:36:11 +00:00
Ian Curtis 2e6968fe9d Thanks to our anonymous contributor who managed to patch a model 3 game and run it on real h/w, we were able to obtain some timing values we had been long been missing for correct emulation. The h/w polls something called the ping_pong bit at start-up to sync the GPU with the CPU. Unfortunately we didn't have the correct values and just manually used some per game hacks to get games to run. This mostly worked, but some games were writing more or less frames than they should have been for a given time period. When the ping_pong bit flips at 66% of the frame time, games were writing data for a new frame, which meant writes were often straddling 2 separate frames. We aren't 100% sure if IRQ2 or the ping_pong bit is vblank. 2019-11-07 20:29:17 +00:00
Ian Curtis 06b43c45b3 Ocean hunter in the middle of the game is passing a few matrices with FLT_MAX inside them, which blows apart our near/far calculation. The hardware must have some method to sanitize the near/far for instance if you render something extremely close to the origin you will also blow apart any near/far calc. 2019-11-02 20:11:48 +00:00
Ian Curtis 714f6a123a skip invalid culling nodes 2019-07-28 12:14:13 +00:00
Ian Curtis 17f4103123 A culling node must follow immediately after a viewport. 2019-07-26 16:39:58 +00:00
Ian Curtis cc830003f5 Fix possible negative pointer arithmetic which was causing the music to wrap around. 2019-02-22 01:00:41 +00:00
Ian Curtis 8aa476aeeb Previous mpeg audio code worked for me in debug mode, but the release build had some serious corruption issues when being built in visual studio. Replaced the old spaghetti code with a more modern implementation. 2019-02-21 14:56:25 +00:00
SpinDizzy c86dab0fe9 - Disabled Alt-O (dump timings) and Alt-U (dump input state) when
SUPERMODEL_DEBUGGER not defined
- Option '-print-inputs' works again if no ROM set specified
2019-02-19 09:24:31 +00:00
SpinDizzy 6fe878b1d3 Restore Sega Rally 2 music in some practice stages 2019-02-07 06:32:46 +00:00
SpinDizzy 383e6ac85c Fixed MPEG music looping glitch. 2019-02-05 10:30:50 +00:00
SpinDizzy bb89bc8e54 Refactor code from previous svn768 (Note : break old savestate compatibility) 2019-02-05 10:03:50 +00:00
Ian Curtis 90faeafbc4 Fix the audio in sega rally2. The game has packed separate tracks into the left and right audio channels. Selecting the correct track fixes the garbled mess. (Spindizzi) 2019-02-01 21:02:02 +00:00
Ian Curtis f634d19fdc Fix shader. Why this worked on my nvidia card .. I'm not sure. 2019-01-24 19:11:26 +00:00
Ian Curtis 8094c2e2b7 Composite the alpha layers at the end of rendering. To do this we need to mask the alpha pixels with the opaque pixels from the next priority layer. Fixes some overlapping shadows in vf3tb that have different priority layers. I assume that was a game bug, but it works on the real h/w. 2019-01-21 14:30:42 +00:00
SpinDizzy c171356f7d -Added support for specifying multiple sections simultaneously in INI
files, e.g., [ daytona2, dayto2pe ]
-Forgetfulness in 763
2019-01-20 08:02:01 +00:00
Ian Curtis 864bb36b5a Technically backface culling should cull polys when the dot product = 0, since when it equals 0 the polys is perpendicular to the camera and thus invisible. When you complete sega rally2 (if you can get that far lol) the champagne is invisible. The reason is because all the face normals are 0. So when multiplied by the model matrix they are still 0 and get culled. Tweaking the condition to only cull polys when greater than 0 fixes this, and allows these 'bad' polys to render as they do on the model3. 2019-01-16 01:07:56 +00:00
SpinDizzy 98106df68b Inputs can now be configured on a per-game basis 2019-01-13 16:20:19 +00:00
SpinDizzy b0813ef7a0 - PCI bridge can be specified in Games.xml for games that use a different version than expected based on stepping. No more hard-coded exceptions.
- Real3D PCI ID can be specified in Games.xml for exceptions that require it.
- Real3D status bit timing specified in Games.xml for exceptions that require it.
2019-01-13 16:00:37 +00:00
Ian Curtis d8f736e7a8 timing fix for srally2x (Spindizzi) 2019-01-06 23:48:34 +00:00
Ian Curtis 0f49e0b1e9 remove commands that do nothing 2018-12-08 20:01:37 +00:00
Ian Curtis 08eeb20033 clear scissored out areas 2018-12-08 19:55:26 +00:00
Ian Curtis 6075352868 Optimise depth calculation for quad shader. 2018-11-27 20:43:27 +00:00
Ian Curtis 78039e91a8 2018-10-28 18:30:04 +00:00
Ian Curtis 538a714086 Fade out microtextures with higher textures LODs. Fixes incorrectly applied microtextures in LA machineguns. 2018-10-23 00:16:23 +00:00
Ian Curtis b8da2d6064 debug code should be disabled 2018-10-22 21:59:01 +00:00
Ian Curtis bf4d725970 Smooth texture repeat makes no sense for alpha/contour textures with pixel dilate. HW seems to treat them as non smooth anyway. Also implement some line of sight stuff, used by Scud. Really need to check the threading/synchronisation of the register reads but it basically works. 2018-10-19 20:59:46 +00:00
Ian Curtis df02d6a753 return correct PCI ID 2018-10-18 09:42:51 +00:00
Ian Curtis 3dc69f89b8 fix debugging code 2018-10-17 22:36:33 +00:00
Ian Curtis 42eaa7f3d8 fix copy paste error :] 2018-10-14 10:05:24 +00:00
Ian Curtis 3eeec35e7c Correctly emulate the real3d pro-1000 texture modes in our shader. 2018-10-13 13:29:45 +00:00
Ian Curtis 7bcc70a170 Update makefile 2018-10-01 17:42:45 +00:00
Ian Curtis 3dbfa73734 Both lemans24 and dirt devils are rendering some totally transparent objects as the first model in each viewport. The HW seems to skip these entirely, and including them breaks our near/far plane calculations leading to Z fighting. 2018-09-19 20:43:41 +00:00
Ian Curtis e3255e45f3 Tweak the ratio for the near plane. Fixes missing text on the map indicator at the start of spikeout. The vertices are 0.003 units apart so a tonne of precision is required at the near plane to not depth test out. 2018-09-18 21:46:38 +00:00
Ian Curtis c5b156d95d remove debug code 2018-09-18 21:20:15 +00:00
Ian Curtis 5dab9910e2 avoid double matrix load 2018-09-16 08:43:13 +00:00
Ian Curtis a7e851d578 updated command line help 2018-09-14 20:31:34 +00:00
Ian Curtis b5f9ad9651 Quad rendering engine. Set QuadRendering = 1 in the ini file to use, or -quad-rendering at the end of the command line to use. 2018-09-13 12:50:34 +00:00
Ian Curtis e4f5f0bcaf Sega bass fishing is starting some off the meshes with a shared vertex. Without having a previous vertex to share with, the values were just uninitialised and junk. The hardware itself seems to hold the value from the previous mesh, and sega bass fishing relies on this undefined behaviour to function correctly. Storing the cached vertices as member variables instead of locally to the function means it holds the values from the last mesh, and uses those values instead of random garbage. 2018-09-02 21:36:24 +00:00
Ian Curtis c1c2dedcfa remove dead variable 2018-08-09 21:57:51 +00:00
Ian Curtis 9f5a19a04a Use correct PCI IDs (Harry Tuttle) 2018-07-09 08:06:06 +00:00
Ian Curtis 80cf1f9b52 add crosshair effect (Harry Tuttle) 2018-07-04 22:15:44 +00:00
Ian Curtis 73ff32a10d fix cast, and remove extra ; that had snuck into the shaders 2018-06-18 10:24:46 +00:00
Ian Curtis f9be1259c0 Opaque polys definitely depth test with less than or equal. Virtua striker is drawing co-planar polys for the bar gfx 2018-06-17 11:30:01 +00:00
Ian Curtis c7ffd0a808 Draw transparent polys to separate layers and composite at the end. This solves a tonne of transparency errors we had been battling with for a long time. The model3 is strange in the fact it only supports a max of two translucent overlapped polys. They are not blended into the frame normally. Doing this means the topmost translucent polys only are visible in the scene, the equivalent of doing a depth pass first, but without the added cost. 2018-06-16 21:31:29 +00:00
Ian Curtis 7497e3f1a6 forgot parentheses 2018-05-29 14:54:23 +00:00
Ian Curtis f9f43ca66b 2018-05-28 12:55:13 +00:00
Ian Curtis c1e0e3728b optimise hash function and parse out transparency layer select bit 2018-05-28 11:59:48 +00:00
Ian Curtis 2af58f4352 select correct bit .. 2018-05-24 20:19:54 +00:00
Ian Curtis 8452d4c0ef Parse out TranslucencyPatternSelect 2018-05-24 20:13:15 +00:00
Ian Curtis 4d275ba49e Parse siblings after children. It's the only way to get Daytona water fall to look correct without h/w poly sorting. 2018-05-03 18:37:49 +00:00
Bart Trzynadlowski 3f9b1b76e5 Added a stretch mode (-stretch) and modified new renderer's viewport code (hopefully correctly) to handle aspect ratio correction and widening the way the legacy one does. 2018-05-03 03:46:44 +00:00
Ian Curtis c6b86c0812 Render the opaque part of texture transparency in the first pass. Fixes numerous transparency related issues in lemans24 and some in ocean hunter. I don't really know if this is the 'correct' way of solving this because the real3d pro-1000 is a complete black box. There is still a lot we don't understand about how it handles transparency. 2018-05-02 20:10:02 +00:00
Ian Curtis 11a3cdbfd1 remove unnecessary copies 2018-04-24 13:51:53 +00:00
Ian Curtis b39de6e4df Fix controller inputs (Spindizzi) 2018-03-30 12:04:27 +00:00
Bart Trzynadlowski 934941423a Inconsequential typo 2018-03-26 23:02:30 +00:00
Bart Trzynadlowski b5f1b7a2fd Reverted version to 0.3a-WIP. Release version will be updated to 0.4a. 2018-03-26 23:01:18 +00:00
Bart Trzynadlowski f0ea6b45a8 Added ability to load save state at startup using -load-state or InitStateFile (in config file) 2018-03-26 22:59:06 +00:00
Ian Curtis d21e71dced work around for non working jtag code in star wars 2018-03-21 10:26:05 +00:00
Ian Curtis b184ca3e1b Clamping must be applied before the spotlight is applied on step 1.0 h/w. 2018-03-10 09:13:28 +00:00
Ian Curtis 609d1ba19f Fix step 1.0 games with NET_BOARD defined (Spindizzi) 2018-03-08 14:27:28 +00:00
Ian Curtis d8572a923a Update network code (Spindizzi) 2018-02-24 15:53:18 +00:00
Ian Curtis 995cf6adb0 white space 2018-01-29 19:33:29 +00:00
Ian Curtis 10cefb7c61 Support both types of lightgun in lost world. 2nd type fixes some missing fx. Thanks to Any for pointing this out. To use the old type change analog_gun1 to gun1 in the xml file. 2018-01-29 19:31:23 +00:00
Ian Curtis 6bc4224154 fix a few compile warnings 2018-01-25 21:07:22 +00:00
Ian Curtis 820f27cea1 A hack to get spikeout to work (uncomment to enable) (Spindizzi) 2018-01-25 20:40:05 +00:00
Ian Curtis 964f08c894 Disable the netboard if EmulateNet=0 (Spindizzi) 2018-01-25 20:38:31 +00:00
Ian Curtis 85a638bc06 remove extra qualifier 2018-01-22 21:10:20 +00:00
Ian Curtis 04758e38b6 Update make files and fix build for the various options (Harry Tuttle) 2018-01-22 21:01:35 +00:00
Ian Curtis b5bbda67d0 fix header files 2018-01-22 18:27:51 +00:00
Ian Curtis 571d1060ee Remove using namespace std from the header files .. 2018-01-21 15:09:11 +00:00
Ian Curtis 8266eecabb Parse out line of sight position. Only known to be used by scud. 2018-01-15 21:27:21 +00:00
Ian Curtis 99b5b9ba1b make the logic a bit clearer 2018-01-15 14:40:59 +00:00
Ian Curtis 22a6166b82 fix Ian's bad maths :) 2018-01-15 13:08:39 +00:00
Ian Curtis a1350d95a2 Update microtexture coordinate logic (Harry Tuttle) 2018-01-14 12:56:24 +00:00
Ian Curtis 863ea95013 simplify maths 2018-01-10 20:37:21 +00:00
Ian Curtis adb5196625 comment out unneeded code 2018-01-10 16:12:33 +00:00
Ian Curtis d708ce9ba2 top/bottom were swapped for off axis projection 2018-01-10 16:08:02 +00:00
Ian Curtis 6efa03112e Rewrite projection maths based upon previously unknown viewport values. The previous values used roughly worked as the normals for frustum planes. Perhaps they were only used for culling and not actually rendering, as sometimes the values don't work correctly. 2018-01-08 18:35:42 +00:00
Ian Curtis cf7850602b fix build 2018-01-08 00:13:23 +00:00
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