top of page
loading_reduced.jpg

5fa402f / 20-07-2024

SuperModel

Accuracy

Performance

Features

average rating is 4 out of 5
average rating is 4 out of 5
average rating is 4 out of 5
competition

SuperModel emulates Sega's Model 3 arcade platform which uses OpenGL and SDL library to those arcade games. It's still considered to be in "alpha" stage of development, meaning it lacks many planned features and does not yet have a user-friendly graphical interface, game compatibility remains average, and all CPUs are emulated using straightforward interpretation rather than fast just-in-time translation. 


Front-End UI:  SuperModel 3 UI or SuperModel Assistant


Forks


 ... 

Most Recent Changes

--5fa402f--

  • Merge pull request #165 from gm-matthew/widescreen to don't expend culling planes unless widescreen is enabled



--a2645c9--

  • Give PowerPC more cycles to acknowledge sound IRQs. 400 cycles was not enough and would cause VF3 to hang. 1000 cycles should be more than plenty

  • remove dead code



--79868--

  • fix compilation

  • Texture mipmaps must be at least 2x2



--196120--

  • fix merge error

  • merge conflicts

  • Performance improvements

  • Add comment briefly explaining optimization

  • Minor shader optimization



--42e236b--

  • Add comment briefly explaining optimization

  • Minor shader optimization: If the mipmap level is 0.0, we only need to run texBiLinear() for the highest quality texture mipmap. Adds around 10-20% more performance in Daytona 2



--a6466b3--

  • Fix some missing scroll fog background effects in ECA

  • Spelling...



--7d32bde--

  • When disabling sound IRQs via MIDI control port, clear current IRQ. Prevents Dirt Devils hanging during boot



--976f020--

  • Sound IRQs are acknowledged by writing to MIDI data port



--7b02f58--

  • Merge pull request #149 from gm-matthew/scuddxo

  • Only access SCSI device at 0xC0xxxxxx if it has been configured to do so

  • Fixes some step 1.5 games not working in last update.



--2245fca--

  • Adding newly dumped version of Scud Race

  • Use integer value for game stepping

  • Allow Step 1.5 games to access 53C810 via 0xC00000xx if the netboard is disabled, because scuddxo requires this



--250f84e--

  • Updated .gitignore to exclude build directories and Supermodel release directories



--dec8503--

  • Merge pull request #138 from h0tw1r3/fix/2d-shaders which Fixes 2D texture rendering on OSX



--d9f48db--

  • CLogger: destructor needs to be virtual



--1bb7de1--

  • fix segfault in CMultiLogger: vsprintf may change its va_list argument so repeatedly calling it with the same va_list arg is undefined behavior. Fix this by creating a copy of the va_list argument before each vsprintf call.



--e59ecea--

  • PowerPC frequency determined by board stepping, config option is now just an override



--620a581--

  • No need to have changelog from 2011 in Readme.txt anymore.



--75260f9--

  • Clamp LODscale. If the object is drawn at zero we produce an Inf value which will produce Nans with later calculations.



--0e07f29--

  • Amend ambient fog logic: Should stop the sky flashing in lemans24, and the background totally disappearing in sega rally after a game. The logic here is still not totally understood but works well enough for the games.



--c039d08--

  • Add supersampling anti-aliasing: Late christmas present. Due to the way alpha works on the model3 adding regular anti-aliasing doesn't really work. Supersampling is very much a brute force solution, render the scene at a higher resolution and mipmap it. It's enabled via command line with the -ss option, for example -ss=4 for 4x supersampling or by adding Supersampling = 4 in the config file. Note non power of two values work as well, so 3 gives a very good balance between speed and quality. 8 will make your GPU bleed, since it is essentially rendering 64 pixels for every visible pixel on the screen.



--33b84c8--

  • Floating point reversed z-buffer and new clipping code

  • Added new uniform bool polyAlpha to shaders; Added original matrix functions back into Mat4 class though they are currently unused

  • Floating point reversed z-buffer and new clipping code; Also always draw nodes with culling disabled even if they test as being outside the visible frustum



--6f40953--

  • Remove debug code

  • Fix some stencil issues:Merge pull request #120 from gm-matthew/patch 

  • Fixed Scud Race Plus "ROLLING START" patch

  • Accidentally patched the wrong memory location in Scud Race Plus

  • Merge pull request #118 from firewave/uninit 

  • Model3.cpp: avoid usage of uninitialized memory

  • Inputs/MultiInputSource.cpp: fixed mismatching allocation and deallocation

  • Src/Inputs/MultiInputSource.cpp:87:3: error: Mismatching allocation and deallocation: CMultiInputSource::m_srcArray 

  • fixed some -Wunused-* compiler warnings stencil mask must be set to all 1s otherwise we can't clear all the bits in the stencil buffer. Also we no longer need to save/restore the depth buffer into between priority layers.



--391e1b9--

  • Dirt Devils does not use the handbrake

  • fix minor error



--d726356--

  • Remove debug code

  • Fix some stencil issues: stencil mask must be set to all 1s otherwise we can't clear all the bits in the stencil buffer. Also we no longer need to save/restore the depth buffer into between priority layers.



--3022e41--

  • Added some TODO notes to Main.cpp

  • Fixed graphics analysis -gfx-state option

  • DSB.h: when generating a debug build in gcc w/ -g, k_framePeriod was causing a linker error. Not sure why k_timerPeriod wasn't but made them both constexpr.

  • byte_layout attribute for region tag, intended to support Sega Racing Classic 2 ROM extracted from Yakuza

  • Rewrite the stencil buffer usage slightly, so both the LOS and layered polys work. LOS uses the top bit of the stencil buffer. Fixes some minor issues with draw order in sega rally.



--f9a0901--

  • Fix regression: Scroll attenuation seems to disable ambient fog. If scroll attenuation is enabled it's telling the h/w to draw the real3d spot light on fog for the scroll fog layer. This should fix a regression where the background disappears on sega rally.



--a8976b5--

  • Correct scroll fog attenuation logic

  • The attenuation value effects the spot light on fog for the scroll fog layer. The old implemention was nearly correct but the paramaters for the mix function were swapped.

  • Scroll fog needed a break statement otherwise it could draw potentially multiples times.

  • The fog atttenuation paramater doesn't appear to effect scroll fog, other than to potentially enable it. This fixes some issues with emergency call ambulance.

  • Added support for the node discard attributes which sega rally2 uses to throw away specific geometry. This fixes junk that starts to show up in the levels after multiple runs.

  • Add LOD switching and blending out culling nodes



--8dda8e9--

  • Fix the line of sight function. Polygons have a line of sight value that's either a 0 or 1. We write this value into the stencil buffer, then read the app can read it back to determine the polygon attribute is visible or not. The returned value is 1/depth value in world coordinates. The first bit of the float is actually a control bit, 1 indicates no geometry hit, 0 indicates geometry hit.

  • Update comments for the culling node function. gm_matthew worked out that the last 2 bits of the model scale float appear to be control bits for disable culling and valid model scale. Strange logic but the line of sight (LOS) function does something similar by re-using float bits for control words.



--acab274--

  • Update README.md to define GIF widths (for Safari) 

  • Set language standard to c++ 17



--f89da17--

  • Fix white gfx on linux / intel gpus. These optimisations originally came from toxieainc



--c5f9a3a--

  • Amend the ambient fog logic to be disabled if fog density/start is set to zero. This fixes a regression where the sky stops drawing in lost world.

    Rewrite the scroll fog shader slightly. Scroll fog is a 2d layer, it has no depth, or can be considered to be drawn at infinity, therefore is not effected by the viewport light. The scroll attenatuion value also I think attenatutes the scroll fog alpha value. This fixes various effects in emergency call ambulance.



--a214c6d--

  • Prior scroll fog logic was nearly correct. For scroll fogging to draw it needs either a start value or a fog density value, but these can come from a different viewport if they have the same colour fog set. This fixes the credits in vf3 which sets scroll fog, but it never draws on the original hardware.

    For a long time we've had bug reports that in vf3 the background in the Dural levels was the wrong colour, it should have been much darker. We thought it was again missing scroll fog, but gm_mathew worked out it was actually coming from the fogAmbient paramater. Not only does it darken the fog, but it also has an effect on the 2d background from the tilegen, similar to scroll fog. This also fixes the sky in lemans24.



--2af0787--

  • Remove debug code 

  • Rewrite the logic for the scoll fog (render buffer clear colour). Each viewport can potentially have a scroll fog value so the logic of which value to pick wasn't immediately clear. TLDR I think it picks the highest value starting from the lowest priority layers. This fixes the sky in daytona battle on the edge.



--86d4772--

  • Scroll fog is like a clear colour for the render target, but can be semi transparent as the tilegen layer can be shown underneath. I assumed that transprent polys would be drawn to the render target for transparent polys but unfortunately the logic does not work. So where else could it be drawn? Well with limited memory it must be draw to the buffer for opaque polys, which means this render target is also blended.



--392900f--

  • Implement correct "round to nearest" mode On PowerPC round to nearest ties to even, not away from zero. Also implement correct behavior for ppc_fresx Fixes "tips to win" sequence in Daytona 2 BOTE

  • Rewrite the renderer a bit to spit out the finished graphics from the 3d chip on separate buffers. One buffer is for opaque pixels, and 2 more for translucent pixels. Before the frame was composited on the back buffer, which meant the tilegen had to have been drawn first. This way the images are now totally independant of the tilegen chip so can be drawn as soon as the register write 0xC is written to the tilegen.

  • Some games update the tilegen after the ping_ping bit has flipped at 66% of the frame, so we need to split the tilegen drawing up into two stages to get some effects to work. So having the tilegen draw independantly of the 3d chip can make this happen.



--0e494a0--

  • Updated build script to use SFTP (Supermodel3.com server upgrade no longer supports ftp)



--d656643--

  • Updated build script to use SFTP (Supermodel3.com server upgrade no longer supports ftp)

  • gm_mathew worked out that the camera flashes in sega rally 2 have the'reset-matrix' attribute set inside the culling nodes, which was unsupported until now because we never found any games to have used this bit. The reset matrix is a bit strange, I would assume it would just reset the matrix back to identity, instead it seems to just reset the rotation back to identity whilst preserving the scale/position.



--e6b5468--

  • Update README

  • Model3.cpp: Comment describing scan line timing.

  • Ping-pong flip timing depends of the value of tilegen register 0x08

  • Also make the debugger display 16 bytes per line when using the "listmemory" command. Mirrored system registers can now be watched



--a00e8de--

  • Update rules file. Not tested this but hopefully it should work

  • Emulate the entire tilegen chip in a GLSL shader. (This is now possib……le with opengl 3+). The tilegen drawing was emulated on the CPU, but was one of the most expensive functions in the emulator according to a profiler. On a modern GPU it's pretty much free, because a GPU is a massive SIMD monster. 

  • Tilegen shaders are mapped to uniforms, and the vram and palette are mapped to two textures.

  • TODO rip out the redundant code in the tilegen class. We don't need to pre-calculate palettes anymore. etc

  • The tilegen code supports has a start/end line so we can emulate as many lines as we want in a chunk, which will come in later as some games update the tilegen immediately after the ping_pong bit has flipped ~ 66% of the frame.

  • The scud rolling start tilegen bug is probably actually a bug in the original h/w implementation, that ends up looking correct on original h/w but not for us. Need hardware testing to confirm what it's actually doing.



--38a9508--

  • Prevent "ROLLING START" scrolling glitch in Scud Race. There is a quirk of the tilegen chip that causes this glitch not to occur on real hardware, but we can't be sure what it is without testing. Much easier to just patch all the Scud Race ROM sets

  • Fix Z80Debug.cpp compile with C++20: String literals should not be used to initialize char* but C++17 and earlier were letting it slide

  • SCSP: added more detail to comment explaining 68K clock speed as recommended by Brian Troha



--b2fee42--

  • DMA device register always returns Step 1.x PCI ID Step 2.x games by AM3 request PCI ID this way and expect to see 0x16c311db master (#81)

  • Set soundboard CPU to correct clock speed The 68K on the soundboard is rated at 12 MHz but runs at 11.2896 MHz, which is 256 cycles/sample with a 44100 Hz sample rate. Removed SoundClock and Freq as they are not needed



--84aa972--

Add description of swtrilgy patch from MAME …

  • Star Wars Trilogy will sometimes write to a JTAG register and then read it back to verify it, but this doesn't work correctly with Supermodel's current JTAG implementation; it will try again and never succeed, getting stuck in an infinite loop. This patch stops the code from branching up and trying the write/read cycle again, allowing the subroutine to continue normally.

    We need to implement shift register widths correctly for each JTAG device (Mercury, Venus, Earth, etc.) for the unpatched code to work properly... right now Supermodel implements one JTAG device with a huge 197-bit data shift register



--ac0e640--

  • Games.xml: Removed seemingly unnecessary swtrilgy and swtrilgya patches, which should re-enable JTAG configuration and fix Endor Death Star tunnel shading.

  • Fix GCC 13 build.

  • Work around to prevent I/O error after a while on fishing games with tension

  • Crosshair optimization: -create crosshairs only once in Init() instead of created them at every cycle. -use matrix scale to apply the aspect ratio



--6993dfc--

  • Makefile.Win32: fixed detection of Windows Command Prompt for rmdir command



--87de86f--

  • Crosshair: use actual adjusted viewport resolution (configuration resolution is not the same thing). Fixes crosshair alignment for resolutions with non-Model 3 aspect.



--95fc08e--

  • Windows app manifest added to enable PerMonitorV2 DPI awareness



--5fdb50a--

  • README.txt: Updated Section 5 (video settings), squeezed everything b… 

  • NetBoard: guard against freeing null pointers and INetBoard needed a … 

  • Autobuild script update following crosshair update



--abc2900--

  • Autobuild script update following crosshair update

  • m_crosshair is not needed and the config should be checked every fram… 

  • Better optimisations

  • Change Media folder to Assets folder

  • Crosshair refactor 

  • README.txt: Fixed a typo, end-of-sentence formatting in section 10



--05c57ab--

  • README.txt: fixed typoBart Trzynadlowski

  • README.txt: Added region codes to section 10 (c/o Brian Troha)



--ae5af4c--

  • Fixed window position config storage and command line parsing

  • Config nodes: added the ability to clear out node values or create them

  • -pos=<x>,<y> -> correct error when not present fixes

  • Add two video settings:  -pos=<x>,<y> & borderless

  • Allow joystick to be fetch if windows has no focus in SDL input mode. 



--f7dcc1c--

  • Games.xml and README.txt updated by Brian Troha (new Ocean Hunter ROM…



--ffc3209--

  • Update README.md with macOS build details



--78f5056--

  • Add missing filename to ErrorLog call

  • Memory allocated but not released.



--69a458e--

  • Make sure to invalidate texture memory when going fullscreen otherwise it might not be syned correctly.

  • SDL_SetWindowFullscreen isn't needed as we call ResizeGLScreen which sets the fullscreen mode afterwards.

  • We must explicitly call SDL_SetWindowFullscreen after setting the dis… …play mode otherwise the refresh rate doesn't change.



--ad0aed4--

  • Be a bit more flexible with the display frequencies we'll match



--2560451--

  • The model 3 (actually model 1,2 and 3) all used some crazy refresh ratete of 57.524hz. If your screen refresh rate is 60hz, supermodel will work fine, but really run too fast. Anyway if you create a custom refresh rate, supermodel will automatically pick this, and set it when the emulator is in fullscreen mode. Apparently this works with most monitors, even cheapo low end ones.

    To active set your command line to:
    -res=1920,1080 -vsync -fullscreen -true-hz

    Replace the resolution with whatever your monitor's native resolution is.

  • Better opengl resource allocation. Fixes going fullscreen and back.



--50d947d--

  • Add FileSystemPath.cpp to Visual Studio project



--d83e475--

  • Fixed build on macOS

  • Switched to Util::Format() to generate screenshot filename

  • First review code changes (identation and cosmetic changes)

  • Changed pathType from string var to enumcasasfernando

  • Keep Supermodel files (config, nvram, saves, etc.) in a predictable path when running on Linux



--db455ba--

  • add undefd codepath for correct use of the 18bit DAC path



--153c510--

  • Fix uniform location.

  • Update Model3.cpp

  • whitespace

  • Wait until IRQ2 is acknowledged before starting IRQ40 sequence. 



--79a2414--

  • Incomplete texture headers uploaded via FIFO are now discarded. Ski Champ sends one more 32-bit word via DMA than it should which was causing Supermodel to erroneously intepret the extra word as another texture



--acc7161--

  • [Makefile.Win32] $MSYSTEM check never fails.



--5f30614--

  • FIx shaders failing to build on apple h/w



--fe36b07--

  • Update makefile

  • Remove some left over depreciated opengl functions. They were basical… 

  • Merge branch 'master' of https://github.com/trzy/Supermode

  • Rewrite the whole project for GL4+. I figured if we removed the limit…



--4c727ab--

  • change all INT16 mixing/intermediate clamping to floats



--121f81c--

  • 68K now uses run-time hooks for IRQ and instruction hook callbacks



--33c04ce--

  • Games.xml: Added re-dumped magtruck and retained old ROM set with patch



--b2e5a20--

  • Fix build for linux (just missing header)



--6fbf938--

  • Upgrade the glsl shader class a bit. Add a const char* comparitor

  • Add a proper git ignore file...

  • And fix the legacy renderer to build...



--e644751--

  • after clarifications, minor cleanup

  • remove 2 dupe function calls, where ProcessLos should actually be rat

  • Fix new 3D engine texture2DLod function missing error on Linux/MESA



--aae58ed--

  • change one more place with potential aliasing issue

  • address review and move bit casts to new header

  • use correct slash

  • Harmless math warning fixes. map->unordered_map in CNew3D::CacheModel



--0eef09b--

  • Revert "port some changes from MAME/MESS

  • fix missing version GLSL compiler warnings on startup 

  • port some changes from MAME/MESS



--a60f998--

  • Revert "port some changes from MAME/MESS"

  • Optimize quad rendering by replacing the double 

  • Port some changes from MAME/MESS



--e06788e--

  • Fix SUPERMODEL_DEBUGGER build



--d4633a8--

  • Revert "port some changes from MAME/MESS"

  • Port some changes from MAME/MESS

  • Equivalent optimizations, NFC

  • Port some (simple) changes from MAME/MESS



--d60feab--

Fix some errors, fix some performance warnings, and some simple (but effective) optimizations



--bd4399b--

Games.xml: Align ROM names with MAME.



--46eff8c---

supermodel_build_bot.py: New build bot script for GitHub



--r888--

Fix build with SUPERMODEL_DEBUGGER enabled. Probably last commit as source has moved to git.



--r887--

njz3: Fix sound volume with new quadrophonic audio code



--r886--

values must be signed, to handle negative numbers, my bad



--r885--

minor fix



--r884--

Added configurable refresh rate. Default is 60 but -true-hz on the command line enables 57.524 Hz mode, which some players report making Spikeout and the timing of combos in VF3 more authentic. The config key is RefreshRate and is specified as a floating point value. Should the desire arise, arbitrary refresh rates can be set in Supermodel.ini using this key but almost no validation of the value is performed. Thanks to forum user trap15 for the original code and PonMi for advocating for this ...



--r883--

njz3: Proper quadrophonic audio support. Need 4+ speakers to take advantage otherwise down mixed to stereo.



--r882--

Added default values for PortIn, PortOut, and AddressOut



--r881--

fix: explicit specialization requires 'template <>'



--r880--

Bitmap size field in the BITMAPV4HEADER was not being set correctly (the image viewers I've been using are unaffected by this but it ought to be corrected)



--r879--

When dumping textures, two T1RGB5 texture maps are written: with and without contour processing. Contour processing can be disabled per-polygon and some textures intended to be used without contour processing contain pixels with T=1 that are clearly not supposed to be transparent. We now output textures_t1rgb5_contour.bmp and textures_t1rgb5_opaque.bmp.



--r878--

Added a -dump-textures option (config key DumpTextures) that writes texture BMP files, one for each known format (12 in all currently)



--r877--

Adjust the number of PowerPC cycles executed per frame to assume 57.524 Hz refresh rate



--r876--

Double buffer the line of sight values. Should allow the correct values to be returned if GPU threading is enabled



--r875--

Fixing Magical Truck Adventure bad ROM dump which was causing attract mode to stop rendering



--r874--

Methods should be marked as noexcept because they cannot throw



--r873--

white space



---r872--

Better document real3d registers



--r871--

Clear all Real3D DMA registers on reset; uninitialized values were causing issues with MSVC debug builds



--r870--

Another header include fix



--r869--

Include required header files in Model3GraphicsState.h - fixes potential build errors in GCC



--r868--

Increase MIDI FIFO buffer size for SCSP; should prevent FIFO overflows



--r867--

PowerPC IRQ line deassertion; DMA only fires interrupts when required



--r866--

Getting rid of most of the includes from Supermodel.h; each file now explicitly includes the header files it needs.



--r865--

Shared RAM on simulated netboard is now double-buffered; Spikeout Final Edition no longer requires a hack to work.



--r864--

New JTAG patch for Sega Rally 2; linked mode now fully working.



--r863--

Increase size of DSB2 FIFO buffer; fixes Sega Rally 2 music occasionally not switching or fading ou



--r862--

Non-linked games no longer falsely list the net board under extra hardware


----


UI Update Details (06-01-2021)

  • following recent rom set name changes in Games.xml 

  • Added – list view of all the supported games

  • Added – preview of each game (snaps).

  • Added – button of the roms directories.

  • Added – check Load button (Load Rom)

  • Added – all video options

  • Added – all sound options

  • Added – all control options (for the time being it uses the supermodel configurator (accurate and will never fail)

  • Added – system link options (preliminary) will only work with the only version created by Spindizzi2560451

Show Previous Changes

--r861--

  • Fix 16-bit variables not displaying correctly in Z80 debugger (at least in MSVC builds)



--r860-

  • Fix netboard resets and detection of simulated netboard linking to itself



--r859--

  • Adding simulated netboard; all linked games except Sega Rally 2 working at full speed.



--r858--

  • Corrected alignment issues with netboard RAM; send/receive parameters no longer need to be manipulated to work correctly. Fixes bugs including Scud Race linked car orientation.



--r857--

  • 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.



--r856--

  • DSB2 clock speed from 4MHz to 11MHz.



--r855--

  • New dumps added:



--r854--

  • Fixed cycle counting overflow that was causing DSB2 to halt execution.



--r853--

  • missing header



--r852--

  • DSB2 IRQ 2 now fires at 1KHz rather than once per frame, improving



--r851--

  • Just a few compile warnings



--r850--

  • Fix project file



--r849--

  • Build bot script.



--r846--

  • 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]



--r845--

  • The controls of bass/getbass games were no longer good, following recent rom set name changes in Games.xml.



--r844--

  • Corrected game set names & game titles (Brian Troha)



--r843-- 

  • Added rumble skipad in Ski Champ game.



--r842--

  • Service menu activated in swtrilgyp.



--r841--

  • Add -O3 optimization option for OSX and Linux.



--older--

  • Cannot locate older

bottom of page