r775Fix possible negative pointer arithmetic which was causing the music to wrap around. ---------------------r774Update makefiles---------------------r773Previous 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.---------------------r772- Disabled Alt-O (dump timings) and Alt-U (dump input state) when ---------------------r771Restore Sega Rally 2 music in some practice stages ---------------------r770Fixed MPEG music looping glitch. ---------------------r769Refactor code from previous svn768 (Note : break old savestate compatibility) ---------------------r768Fix 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)---------------------r767Fix shader. Why this worked on my nvidia card .. I'm not sure. ---------------------r766Composite 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.---------------------r765-Added support for specifying multiple sections simultaneously in INI ---------------------r764Technically 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.---------------------r763Inputs can now be configured on a per-game basis ---------------------r762- 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. ---------------------r761timing fix for srally2x (Spindizzi) ---------------------r760Updates games.xml for new prototype games (Spindizzi) ---------------------r759remove commands that do nothing ---------------------r758clear scissored out areas ---------------------r757Optimise depth calculation for quad shader. ---------------------r756Update Games.xml for games that were recently dumped ---------------------r755

---------------------r754Fade out microtextures with higher textures LODs. Fixes incorrectly applied microtextures in LA machineguns. ---------------------r753debug code should be disabled ---------------------r752Smooth 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. ---------------------r751return correct PCI ID ---------------------r750fix debugging code ---------------------r749fix copy paste error :] ---------------------r748Correctly emulate the real3d pro-1000 texture modes in our shader. ---------------------r747Revert some patches (Spindizzi) ---------------------r746Update makefile ---------------------r745Both 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. ---------------------r744Tweak 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.---------------------r743remove debug code---------------------r742avoid double matrix load ---------------------r741updated command line help ---------------------r740Quad rendering engine. Set QuadRendering = 1 in the ini file to use, or -quad-rendering at the end of the command line to use. ---------------------r739Sega 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.---------------------r738remove dead variable---------------------r737Use correct PCI IDs (Harry Tuttle) ---------------------r736add crosshair effect (Harry Tuttle) ---------------------r735fix cast, and remove extra ; that had snuck into the shaders ---------------------r734Opaque polys definitely depth test with less than or equal. Virtua striker is drawing co-planar polys for the bar gfx ---------------------r733Draw 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.---------------------r732forgot parentheses---------------------r731---------------------r730optimise hash function and parse out transparency layer select bit ---------------------r729select correct bit .. ---------------------r728Parse out TranslucencyPatternSelect---------------------r727Fixed Makefiles for non-MSYS builds. Unfortunately had to revert a lot of the automated configuration that Harry had inserted. Users will again need to ---------------------r726Parse siblings after children. It's the only way to get Daytona water fall to look correct without h/w poly sorting---------------------r725Added 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.---------------------r724Render 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. ---------------------r723remove unnecessary copies---------------------r722Fix controller inputs (Spindizzi)---------------------r721Inconsequential typo ---------------------r720Reverted version to 0.3a-WIP. Release version will be updated to 0.4a. ---------------------r719Added ability to load save state at startup using -load-state or InitStateFile (in config file) ---------------------r718work around for non working jtag code in star wars ---------------------r717Clamping must be applied before the spotlight is applied on step 1.0 h/w. ---------------------r716Fix step 1.0 games with NET_BOARD defined (Spindizzi) ---------------------r715Update network code (Spindizzi)---------------------r714white space---------------------r713Support 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.---------------------r712fix a few compile warnings ---------------------r711Add the netboard stuff to the ini file. Stops crashes when they are missing. ---------------------r710A hack to get spikeout to work (uncomment to enable) (Spindizzi) ---------------------r709Disable the netboard if EmulateNet=0 (Spindizzi) ---------------------r708remove extra qualifier---------------------r707Update make files and fix build for the various options (Harry Tuttle) ---------------------r706fix header files ---------------------r705Remove using namespace std from the header files .. ---------------------r704Parse out line of sight position. Only known to be used by scud. ---------------------r703make the logic a bit clearer ---------------------r702fix Ian's bad maths :) ---------------------r701Update microtexture coordinate logic (Harry Tuttle) ---------------------r700fix illegal xml character sequence---------------------r699simplify maths---------------------r698comment out unneeded code ---------------------r697top/bottom were swapped for off axis projection---------------------r696Rewrite 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.---------------------r695fix build---------------------r694add the rest of the network board code (Spindizzi)---------------------r693use the correct c++ deleters ---------------------r692use a few macros to make debugging less painful---------------------r691Add network board emulation. Currently not linked with the rest of the project.---------------------r690remove using namespace from headers ..---------------------r689rename to avoid clash with a #define---------------------r688add asynchronous sending functions---------------------r687remove dead variable ---------------------r686Add basic networking files to supermodel. Currently these are win32 specific but can port to SDL or whatever later.---------------------r685Fix the smallest texture lods (Harry Tuttle)---------------------r684fix array out of bounds---------------------r683remove debug code---------------------r682mark as static---------------------r681Implement 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)---------------------r680Fix 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.---------------------r679Shift fog maths to fragment shader to fix bug in virtua on.---------------------r678The 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.---------------------r677Fixed shading also works with untextured polys. Fixes some shading issues in La machineguns. (Harry Tuttle)---------------------r676Update step 1.5 luminous logic with Harry's findings. Fixes various shading issues.---------------------r675Finish the hash function (Harry Tuttle)---------------------r674Remove fixed shading check from specular.---------------------r673Makefile 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.---------------------r672Star 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)---------------------r671update visual studio project---------------------r670update spotlight code (Harry Tuttle)---------------------r669Harry's patch: add dirtdvlsj and change "Star Wars Trilogy" to "Star Wars Trilogy Arcade"---------------------r668New, 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.---------------------r667add missing header---------------------r666Get rid of unused variable warning---------------------r665Fix 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.---------------------r664Fix tiny memory leak---------------------r663---------------------r662update project files---------------------r661work around for visual studio bug---------------------r660fix missing header---------------------r659cannot specify explicit initializer for arrays - fix for visual studio---------------------r658- 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---------------------r657Added functions to safely read and write bools---------------------r656Added functions to extract bits as integer values and updated comment about bit vector layout---------------------r655Added SetOnes() and SetZeros()---------------------r654Safe guard against shifting empty register.---------------------r653Hex formatting support extended to 64 bits.---------------------r652Added ShiftOutLeft() and ShiftOutRight()---------------------r651Renamed shift in/out functions to add/remove to be less ambiguous about their functionality---------------------r650Added ToHexString() and made ostream serialization use this---------------------r649Fix for VS2015 and newer by MetalliC---------------------r648Added BitRegister class (for use in upcoming JTAG refactor): an inefficient but flexible container for manipulating a dynamic bit stream.---------------------r647Calculating 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.---------------------r646add interface for sun clamp---------------------r645Optimise vertex data to cut down on unnecessary copying ---------------------r644Modern 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.---------------------r643DMA 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.---------------------r642Changed fixed shaded logic for step 1.5 hw based upon Harry's findings---------------------r641cosmetic---------------------r640Harry 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.---------------------r639Patched Sega Rally 2 DX to boot up. Enjoy Sega Rall 2 without MPEG music at 50% speed ;)---------------------r638Fixed up memory region dumping code to use the new Util::FlipEndian functions---------------------r637Fixed a bug in MCRFS instruction related to the VXSOFT, VXSQRT, and VXCVI bits. Thanks to Spindizzi.---------------------r636Finish 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.---------------------r635With 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.---------------------r634Pad struct and align on 4 byte boundary.---------------------r633simplify---------------------r632fixed shading doesn't effect the alpha channel---------------------r631Fixed 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.---------------------r630Fix attribute locations. glBindAttribLocation must be called linking---------------------r629Added support for loading shaders from files for new engine and tile renderer. Changed help text to reflect new engine being default.---------------------r628make the new3d engine default :] Legacy engine can still be selected using -legacy3d in the command line---------------------r627use generic vertex attributes---------------------r626Technically matrix casts are only allowed in glsl 1.2 and later---------------------r625Remove debug code---------------------r624Sometime 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.---------------------r623cosmetic---------------------r622Add the unclamped light model we know exists to the shaders.---------------------r621Ski 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 :)---------------------r620We 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.---------------------r619Implement unclamped light model based upon Harry's findings. Unknown how this is turned on/off.---------------------r618Use c++11 raw string literals---------------------r617Clamp 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.---------------------r616remove WIP code---------------------r615convert sun angle coordinate system outside of the shader---------------------r614A 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.---------------------r613fix double offset---------------------r612Revert previous fixed shading changes. Implement new logic for fixed shading on step 1.5 hardware based upon Harry's findings.---------------------r611remove debug code---------------------r610Fix the fix shading in star wars. Fixed shading still needs some work for mag truck and dirt devils to match the arcade.---------------------r609cosmetic---------------------r608Tweak scroll fog logic again .. should fix missing 2d fogging in Spikeout---------------------r607rewrite scroll fog logic---------------------r606Remove debug code---------------------r605minor culling node optimisations---------------------r604don't need cast, conversion is implicit---------------------r603better state handling---------------------r602parse out some culling node values---------------------r601There 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.---------------------r600The 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. ---------------------r599Linux Makefile fixed by Sergio Benjamin---------------------r598light parameters must be clamped (HarryTuttle)---------------------r597Virtua 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.---------------------r596Updated Util::Config::Node unit tests with multiple leaf node test---------------------r595remove unused variable---------------------r594Extended -gfx-state to produce culling node analysis---------------------r593Fixed 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).---------------------r592Spindizzi's SCSP DSP fix for the VF3TB cave stage---------------------r591Hooked up the command line help options (thanks, Spindizzi!) and updated copyright info---------------------r590Removed unnecessary patches from lemans24---------------------r589add missing include---------------------r588Removed 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.---------------------r587Updated help text to include -game-xml-file option---------------------r586Moved ROM patches into Games.xml and added patches to swtrilgy to make test emu work and to eca/ecau to pass the network check---------------------r585add missing include---------------------r584Harry 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.---------------------r583Harry Tuttle's change to Harley gear shift to use a single bit instead of two (no detectable difference in behavior, though)---------------------r582Removed unused file: Game.cpp ---------------------r581Fixed lamachin title -- thanks Jiterdomer!---------------------r580cosmetic---------------------r579Daytona 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.---------------------r578Removed last vestiges of CINIFile from input system and removed Games.cpp, INIFile.cpp, and ROMLoad.cpp---------------------r577Using Game::INPUT_* instead of obsolete GAME_INPUT_*---------------------r576Changes by Harry Tuttle: game list more accurately reflects MAME's, added a root level XML "games" node, print ROM version along with title---------------------r575Fixed graphics state analyzer---------------------r574Added cstring---------------------r573Added remaining games largely thanks to the efforts of the mysterious '阳阳'---------------------r572more whitespace ..---------------------r571white space ..---------------------r570Cache dereferenced values. Cuts loading time from 15 to 5 seconds in debug mode :)---------------------r569Included cstring for memcpy---------------------r568Rewrote 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.---------------------r567Rewrite the spot light code, and implement the missing fog logic. (HarryTuttle)---------------------r566Fixed missing file detection (set_difference requires inputs sorted by desired key) and improved error reporting---------------------r565Made scuda a child set of scud---------------------r564Removed TODO comment---------------------r563Smarter game selection when a zip file contains multiple games (prefer child when parent is also present in zip)---------------------r562Warn about parent ROM sets having parent defined (not allowed)---------------------r561Print missing files from games---------------------r560Support loading of parent ROM sets (e.g., scudp will load scud)---------------------r559compile fixes---------------------r558MSYS2 compile fix (HarryTuttle)---------------------r557Replace glsl 3 function. Apparently this doesn't work on OS X.---------------------r556fix compile warnings---------------------r555Sort games found in zip file by descending order of matching files so that game with the *most* matching files is picked---------------------r554Added: bass, daytona2, dirtdvls, harley, lemans24, scuda, skichamp, spikeofe, spikeout, von2, vs2, vs298, vs2v991---------------------r553Fixed scud mpeg roms---------------------r552don't ask---------------------r551fix project files---------------------r550fix multiple default constructors ---------------------r549add missing include---------------------r548Massive 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 :/---------------------r547Cosmetic: renamed step to stepping---------------------r546No need to enclose values in quotes when writing INI file. Print that file was saved to console and log.---------------------r545Added a TODO list---------------------r544Added srally2---------------------r543Encapsulated zip file handling and added a "parent" member to the Game struct---------------------r542Checking 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---------------------r541Fixed dayto2pe sample ROMs---------------------r540The 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.---------------------r539Just 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.---------------------r538cosmetic---------------------r537calculate the correct number of mipmap textures---------------------r536Originally 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 :)---------------------r535Added fvipers2---------------------r534use 32bit types---------------------r533Added more games to Games.xml: dayto2pe, eca, lamachin, lostwsga, magtruck, oceanhun, vf3. Fixed swtrilgy (MPEG music).---------------------r532Added 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.---------------------r531fix scissor code for native resolution (thanks HarryTuttle)---------------------r530remove debug code---------------------r529The 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 :)---------------------r528Texture 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.---------------------r527Change microtexture scaling values. Seem to much better match expected output. (thanks HarryTuttle)---------------------r526More fixes to microtexture coordinates. They go vertically up and down the texture sheet, and not horizontally as I had guessed. (Thanks HarryTurtle)---------------------r525Fix microtexture texture coordinates (thanks HarryTuttle)---------------------r524fix the bad projection matrix in dirt devils and lost world---------------------r523The 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.---------------------r522Support high priority polygons. They are treated as a separate overlay plane by the h/w. Fixes some missing fx in harley.---------------------r521Add high priority poly function. Used by harley.---------------------r520When 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.---------------------r519Put 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 :)---------------------r518Dynamically 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.---------------------r517mark the nodes without valid distances set---------------------r516cosmetics---------------------r515only need to cull against 4 clipping planes---------------------r514For scroll fog set the viewport to the entire area, allows fog to work in widescreen mode---------------------r513properly cache un-normalised texture coordinates, fixes a texturing regression in Daytona---------------------r512fix microtexture colours---------------------r511Only check scroll fog value from the first viewport from each priority layer. Seems to fix problems with background fogging.---------------------r510delete unused files---------------------r509Support 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.---------------------r508The 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.---------------------r507refactor---------------------r506tweak scroll fog logic---------------------r505clean up---------------------r504minor optimisations---------------------r503Only check the geometry for culling with valid node distances. We will need this later.---------------------r502Revert changes .. if we clip against the real3d clipping planes, our wide screen hack won't work anymore.---------------------r501Get clipping planes directly from the viewport data. Also no need to clip against a far plane---------------------r500Need 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.---------------------r499Skip 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.---------------------r498Clear queued texture uploads after processing them. Saves re-uploading the same textures whilst paused---------------------r497More accurate 2D colours. White should map to 255 not 248---------------------r496Fix the shading in scud. When lighting is disabled the fixed shading intensities appear to be offset values added to the colour value.---------------------r495change throttle logic for smoother playback, we could get closer to 60fps if SDL timers weren't so lame---------------------r494change scroll fog logic to parse the lower priority viewports first---------------------r493implement scroll fog, fixes a tonne of missing fx---------------------r492Parse out scrollfog value used for blending over the 2d background.---------------------r491Fix scenes with missing fog in ocean hunter. The game was passing negative fog densities. The sign seems to be ignored by the model 3.---------------------r490same fix for legacy engine---------------------r489our scratch mem must match correct max texture size---------------------r488Fix the sky in advanced stage in Dirt Devils. It uses a massive (for 1998 :p) 1024x256 texture.---------------------r487Support 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.---------------------r486Added RGBA4 format to BMP file writer---------------------r485Made parsing of hex values more robust---------------------r484Initial check in of Games.xml (only two games defined so far)---------------------r483Fixed new 3D engine's fragment shader to work on some older GPUs by reducing the number of discard statements to one---------------------r482Updated game loader to make use of latest changes to config tree: generic value types and eliminated pointers---------------------r481Support 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)---------------------r480Added Util::Stricmp() and small tweak to serialization of Util::Format---------------------r479Added 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.---------------------r478Added copy constructor and assignment operator using C++11 move semantics---------------------r477Defined inputs---------------------r476Support for deep copies via assignment operator. This will pave the way for elimination of Ptr_t and ConstPtr_t.---------------------r475Added Write() method to write buffer to an ostream, and added an ostream operator overload---------------------r474Changes to game loader interface, added 32-bit word swapping utility function---------------------r473Added Logger.o to OSX and UNIX Makefiles. Should fix compilation on these platforms.---------------------r472Removing MSVC Makefile ---------------------r471Initial check-in of game loader (not operational yet)---------------------r470Byte swapping utility function ---------------------r469Added ValueAsBool(), ValueAsBoolWithDefault(), and ValueAsUnsignedWithDefault()---------------------r468update visual studio project ---------------------r467Added Util::Config::Node::ValueAsUnsigned() with support for base 10 and 16 ('0x' prefix)---------------------r466Added Util::ToLower() ---------------------r465Config::Node::Add() now supports nested keys (e.g., Add("foo/bar/baz", "0") will create three nested config nodes)---------------------r464Changed 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.---------------------r463Adding tinyxml2 lib ---------------------r462XML parsing support for new config system ---------------------r461Moved logging functions into OSD/Logger.cpp (eventually logging system will be reworked entirely) and added new config tree structure (not yet used). ---------------------r460Updated Win32 gcc, UNIX, and OSX Makefiles ---------------------r459Updated Fragment_NoSpotlight.glsl (fragment shader for legacy engine without spot light)---------------------r458disable spot light if the extent is zero---------------------r457Saving progress on scudp disassembly---------------------r456parse some unimplemented spot light values from viewport---------------------r455Added disassembly of Scud Race Plus---------------------r454Marked offset of code in CROM for scudp---------------------r453stencil translucent non textured polys---------------------r452refactor---------------------r451Cull 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.---------------------r450Fix compilation when SUPERMODEL_DEBUGGER enabled---------------------r449cache bound texture---------------------r448cleaning---------------------r447Added drive board and lamp raw outputs (submitted by SailorSat)---------------------r446support negative exponent---------------------r445Add 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.---------------------r444Added -vsync and -no-vsync option descriptions to command line help---------------------r443remove dead code---------------------r442Added a Split() function to Util::Format.---------------------r441XInput 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.---------------------r440Check for overflow. Fixes some fade effects---------------------r439Legacy 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.---------------------r438Y 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.---------------------r437Legacy engine: Culling node texture Y offset is only 5 bits (fixes Sega Rally 2 initials decal)---------------------r436New engine: modf -> std::modf (fixes compilation on gcc)---------------------r435Legacy engine: expanded color index to 12 bits from 11. Does this affect any games?---------------------r434New engine: expanded color indices to 12 bits from 11. Added PolygonHeader::ColorIndex and SensorColorIndex methods.---------------------r433Forgot to describe one polygon header field in Model.cpp---------------------r432Updated polygon header descriptions---------------------r431Legacy 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.---------------------r430Optimise non smooth texture repeat to only effect texture boundaries, rather than poly boundaries. Fixes a few ugly artefacts---------------------r429fix transparency values, values are from 0-32, not 0-16 where the top bit disables---------------------r428 - Some Sauce by Ian.Stencil layered polys, fixes shadow z fighting in some of the games. Other games maybe using stipple alpha (yuck), not sure yet.---------------------r427remove bad rom patches---------------------r426don't clamp after spot light code, looks much closer to h/w---------------------r425Hooked up Sega Bass Fishing / Get Bass controls---------------------r424basic spotlight code---------------------r423Fixed fog in legacy 3D engine. Now computed same as new engine, with 4-bit light modifier and corrected fog mixing in shaders.---------------------r422Updated legacy engine vertex shader to use specular shininess and coefficient along with old equation. Still not correct (too strong compared to the old method).---------------------r421fix alpha testing for texture format 7---------------------r420remove dead code---------------------r419support 4 bit textures---------------------r418correctly mask pointers---------------------r417optimise hash table access for better performance---------------------r416support colour table pointer---------------------r415remove debug code---------------------r414Fog start is apparently the fog value at the viewport (0,0,0) I guess like an ambient value. Default value is negative---------------------r413Non luminous polygons seem to be effected by the lightModifier also. API seems to have no restriction in this regard, neither does the SDK. The ocean hunter requires this for some of the 2d stuff. Light modifier values only seem to exist between 0-16, which is strange for 5 bits of precision. Possibly top bit disables the effect and lower 4 bits are the value. This clearly differs from the SDK, but without this the values come out clearly wrong.---------------------r412adjust (hopefully correct) fog equation---------------------r411preliminary specular---------------------r410- Removed a stale comment---------------------r409Legacy renderer changes:

- Updated shading model. Unfortunately, it is far from perfect but it seems to be the best I can do for now. Not really much of a difference from before except that the Scud Race castle is fixed at the expense of the Yosemite level in LA Machineguns being too bright.- Added lots of notes in the shading code.- Passing both specular coefficient and shininess to shader. This will probably break specular lighting for now until the shader is updated to use the shininess correctly.- Color table address in polygon RAM is now obtained from culling nodes as they are traversed (found this in the Pro-1000 SDK).---------------------r408Added palette bit to list of bits to dump for analysis---------------------r407Disable light modifier on fog, seems not to work .. values don't make sense. Maybe the model3 doesn't use these.---------------------r406remove dead code---------------------r405double up polys for two sided polys, fixes some diffuse lighting problems---------------------r404FLT_MAX -> std::numeric_limits<float>::max()r403Added some IRQ-related code (commented out for now) from MAME findings. May incorporate in the future when investigating IRQs and timing again.r402update header documentation---------------------r401Fix bad texture seems---------------------r400Reverted stencil mask change. This reintroduces the Scud Race 'ROLLING START' bug. Previous 'fix' did not work for Magical Truck Adventure anyway and also broke some games (Daytona 2 transmission and course select screen, ECA title screen). The stencil mask is not shifted by 16 pixels and I suspect that either there is some unknown trick to horizontal scrolling or that the behavior is affected by hidden raster timing registers hidden in the JTAG interface.---------------------r399Added a register read handler for tilegen (although nothing seems to benefit from it)---------------------r398Fixed logic for clearing bottom layer. Added new functions to 2D renderer interface. Avoid drawing top and bottom surfaces when no layers are present there. Added some comments to tile---------------------r397Rewrote 2D renderer and fixed 2D layer priorities, stencil mask clipping (Scud Race 'ROLLING START'), and cleaned up code. Unfortunately, the new code is about 50% slower, mostly due to the need to perform stencil clipping after scrolling.---------------------r396add texture helper functions---------------------r395remove pointless loop---------------------r394Split face colour from per vertex poly colour. Fixes colour bleeding between connected polys in harley.---------------------r393Changed XInput DLL failure message---------------------r392update poly header class---------------------r391Fixed compilation on gcc (gotos cannot cross variable declarations)---------------------r390Flat shaded polys can't share vertex normals with adjacent connected polys. Fixes some bad lighting in Harley on pavements---------------------r389support flat shading---------------------r388Make sure texture is bound to correct texture unit, stop flashing micro textures in daytona---------------------r387set correct microtexture wrap mode---------------------r386preliminary microtexture---------------------r385skip viewports marked as disabled, might stop parsing some bad data---------------------r384fix compilation---------------------r383Added support for A1RGB5 to BMP file writer and added a (commented-out) example of how to use it to dump texture memory in ~CReal3D()---------------------r382wrap invalid texture sizes, seems to fix bad textures in srally2 (skid marks)---------------------r381Turn off lighting if fixed shading (or no normals) flag is present. Fixes some of the lighting weirdness in scud---------------------r380Legacy engine: fixed per-vertex fixed shading to incorporate Ian's findings that the intensity value is signed and that fixed shading applies only when lighting is enabled---------------------r379Daytona seems to use 3 bits for texture transparency, will figure it out later but for now this works---------------------r378Fix fixed shading maths---------------------r377Updated to-do comments---------------------r376fixed shading code---------------------r375Legacy engine: preliminary per-vertex fixed shading. Only limited testing with LA Machineguns (appears to work), Sega Rally 2 (appears okay), and Scud Race (fixes expert course bridge but not other mis-colored polygons).---------------------r374read front buffer---------------------r373Luminous bit is now also dumped in polygon header analysis because shading modes may depend on whether or not lighting is enabled---------------------r372Legacy engine: extracting fixed shading component (but still can't use it because unsure of how to activate)---------------------r371Fixed polygon header bit analysis code: was forgetting to swap GL buffer back to retrieve pixels from last rendered frame---------------------r370color flag---------------------r369update project---------------------r368make compilable with visual studio---------------------r367simplify---------------------r366Forgot a newline---------------------r365Polygon header bit analysis code (need to #define DEBUG and use -gfx-state option)---------------------r364Added utility function to write BMP files---------------------r363Updated polygon header description with double-sided bit (forgot it in last update!)---------------------r362Added an updated description of the polygon header to the top of Legacy3D/Models.cpp---------------------r361fix model normals, add code for fixed shading, as of yet flag to turn it on is unknown---------------------r360Legacy engine: vertex normals are standalone and do not need to be added to polygon normal---------------------r359Added a debug option to load and render a single frame of graphics state from a save state file. Only available if compiled with DEBUG defined. Invoked using: -gfx-state= on command line.---------------------r358Using IEmulator interface instead of CModel3 directly---------------------r357Changed save state file version (r340 changed Real3D save format, breaking compatibility with older states, and states were probably already incompatible with 0.2a)---------------------r356Fixed white space and warnings. Fixed second argument to -dis option in cases where other numerical parameters are specified on command line.---------------------r355Flattened out nested if-statements in new engine's fragment shader to improve compatibility with older GPUs (e.g., NVS 300)---------------------r354parse viewports in normal order---------------------r353walk siblings before children, fixes some of the transparency drawing issues in ocean hunter---------------------r352simplify---------------------r351avoid cast warning---------------------r350simplify list code---------------------r349Updated Mac OS X Makefile---------------------r348Fixed 8-bit texture decoding in legacy 3D engine. Contour mode/alpha still needs to be made consistent (as much as possible) with new engine.---------------------r347Updated Supermodel.ini with default Magical Truck Adventure controls---------------------r346Hooked up Magical Truck Adventure controls---------------------r345you were right Bart :) (Fixes broken sound in last build)---------------------r344Don't use variable sized variables across platforms, unless needed---------------------r343Fix - cannot specify explicit initializer for arrays---------------------r342Figured out Step 1.0 VROM texture uploads. Fixes missing textures in VF3 and VF3TB.---------------------r341Debugger compilation fixed: CBus -> IBus---------------------r340Fixed Magical Truck Adventure by emulating VROM texture ports as a FIFO. Now, VF3 crashes on Akira's stage (and probably the other stages with texture glitches). Other games may be affected, too (not thoroughly tested yet).---------------------r339Fixed Magical Truck Adventure country check (accidentally removed a line in previous commit).---------------------r338Magical Truck Adventure expects 0x03 to be returned from MIDI control port (thanks, Ville). Game now boots but crashes because VROM texture uploads clobber memory for some reason.---------------------r337Created IEmulator interface, renamed CBus to IBus and CPCIDevice to IPCIDevice. Frames now rendered when emulator paused.---------------------r336tweak frustum planes---------------------r335Changed help text to explain that -sound-volume and -music-volume only take effect when DSB is present---------------------r334Fixes for non-Windows builds: Makefile updated and fixed header files in Vec.cpp---------------------r333revert viewport code---------------------r332change tex format 4---------------------r331Clamping diffuse+ambient light intensity to 1.0 (legacy engine)---------------------r330Added a comment about viewports---------------------r329Fixed texture enable bit (fixes Star Wars light sabers and Sega Rally 2 cones) and added a hack for (and more comments about) color modulation. Scud Race, Sega Rally 2, LA Machineguns, etc. look correct now, but Fighting Vipers 2 shadows ar...---------------------r328Fixed Types.h include---------------------r327Do not print extra hardware message when there is none---------------------r3268-bit texture upload byte selection (thanks to Ville; but not tested yet); code cleanup---------------------r325rgb values were swapped for paletted colours---------------------r324Use the correct texture enable bit---------------------r323Added a comment: observation of Star Wars and Scud Race color modulation issues.---------------------r322More textures fixed.---------------------r313add missing project files---------------------r312Allow asymmetric projection matrices. Fixes a bunch of missing effects and bad camera angles in harley.---------------------r311update project---------------------r310add LOD table data. Maybe we can get clipping planes out of these---------------------r309properly mark dynamic meshes as such---------------------r308allow 8 bit mono textures to be contour textures, fixes a bunch of missing transparency in harley la riders---------------------r307clear the rom mesh buffer---------------------r306Cache rom models, for better performance.---------------------r305---------------------r304WIP---------------------r303fix for bad matrix with NaN---------------------r302Fixed detected axis printf() and compiler warnings (hopefully I did not parenthesize any conditionals incorrectly!)---------------------r301finish front/back face culling code based on matrix determinant. Optimised opengl to avoid redundant state changes.---------------------r300add missing project file---------------------r299fix parenthesis error---------------------r298add maths functions---------------------r297Update project to vs 2013. Clean compile warnings---------------------r296Remove double copy of shaders---------------------r295fix basic compile errors (with vs)---------------------r294Tweaked Windows gcc Makefile---------------------r293Fixed compiler warnings, whitespace, and moved local variable declarations to site of assignment---------------------r292Include Version.h---------------------r291Fixed typo that broke build---------------------r290Fixed warnings and whitespace---------------------r289Fixed warnings and whitespace---------------------r288Fixed warnings and whitespace---------------------r287Moved lastCycles static int out of header file (fixes compiler warnings)---------------------r286Moved---------------------r285Updated to support new IRender3D interface and added FrameTimings object.---------------------r284CRender3D -> CLegacy3D---------------------r283Update Supermodel.h with graphics path and moved version string to separate header file---------------------

The read-me instruction for the custom MP2 file is in the zip file.

Note: This build had netboard emulation built-in.Make sure you add this line to the Supermodel.ini first:

EmulateNet=1port_in = 1970port_out = 1970addr_out = "127.0.0.1"

Create a shortcut and add this line "-no-threads" (without quotations)

Hello everyone.I am new to the forum but I am from the start !!I wonder if emulating netlink is expected soon?seen the great progress of this emulator I am eager to fulfill connect my twin !!Once again thank you all for your great work !!

Last edited by Kimi on Mon May 30, 2016 2:36 am, edited 1 time in total.

fla56 wrote:hi, thanks for this but 64bit builds not running for me via Supermodel-UI, any ideas?

happening for EmuCR builds too in case that helps...

Win10 64bit i7-980x

Supermodel UI is outdated, use Emuloader. If you don't like Emuloader, you need to input the command line to run the game and setting up controls (only if you want to use Raw Input for Lightgun games).

Last edited by Jiterdomer on Mon May 30, 2016 1:24 am, edited 1 time in total.

Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine