Commit graph

195 commits

Author SHA1 Message Date
Bart Trzynadlowski dbfe2b1a72 Added support for custom MPEG music in a new Music.xml config file 2024-08-09 11:55:53 -07:00
Bart Trzynadlowski d9f48db5db CLogger: destructor needs to be virtual 2024-03-09 20:56:50 -08:00
baraclese 1bb7de1dd9 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.
2024-03-05 16:07:47 -08:00
Bart Trzynadlowski e59ecea32d PowerPC frequency determined by board stepping, config option is now just an override 2024-01-28 21:08:12 -08:00
Ian Curtis c039d08c03 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.
2023-12-26 18:25:03 +00:00
Bart Trzynadlowski 3022e418c7 Added some TODO notes to Main.cpp 2023-11-11 13:57:30 -08:00
Bart Trzynadlowski 47253d8398 Fixed graphics analysis -gfx-state option 2023-11-11 13:55:02 -08:00
CapitaineSheridan 813edb8218 Crosshair optimization:
-create crosshairs only once in Init() instead of created them at every cycle
-use matrix scale to apply the aspect ratio
2023-05-07 21:41:05 -07:00
Bart Trzynadlowski 87de86f7d1 Crosshair: use actual adjusted viewport resolution (configuration resolution is not the same thing). Fixes crosshair alignment for resolutions with non-Model 3 aspect. 2023-03-18 10:00:28 -07:00
Bart Trzynadlowski 95fc08e0a3 Windows app manifest added to enable PerMonitorV2 DPI awareness 2023-03-15 18:24:01 -07:00
CapitaineSheridan abc2900770 m_crosshair is not needed and the config should be checked every frame because otherwise Alt-I command was broken (the number of crosshairs to render is mapped to a UI key) [Bart] 2023-03-13 20:18:51 -07:00
CapitaineSheridan a319bbee0c Better optimisations.
Moved all UI rendering from Main to CCrosshair.
Take care of syntax about crosshair style.
2023-03-13 20:18:51 -07:00
CapitaineSheridan b19fdb6a77 Change Media folder to Assets folder.
Naming variable convention.
Command line change -crosshair-style = vector|bmp.
Config ini variable change CrosshairStyle = vector|bmp.
CCrosshair::DrawCrosshair optimisation.
Modifying UpdateCrosshairs() to eliminate global variable.
2023-03-13 20:18:51 -07:00
CapitaineSheridan 1b066fe4b3 Crosshair refactor
-add a new separate class for crosshair
-crosshair coordinates are calculated by matrix instead of recreating every object at correct coordinates
-add ability to scale crosshair by dpi
-add ability to use bitmap crosshair (located in ./Media/). 32bits bmp format + alpha
-cmd line "-bitmapcrosshair" or "-vectorcrosshair" and/or BitmapCrosshair=0|1 in config file
-these changes are only for lost world game with Crosshairs=1|2|3

don't forget to copy the 2 crosshair images in Supermodel/Media folder
2023-03-13 20:18:51 -07:00
Bart Trzynadlowski ae5af4c036 Fixed window position config storage and command line parsing 2023-03-09 10:34:51 -08:00
joachim 043f901c80 comply to @trzy requested changes # 2023-03-09 10:34:51 -08:00
joachim 4a64a0df71 comply to @trzy requested changes 2023-03-09 10:34:51 -08:00
joachim c301a574ed -pos=<x>,<y> -> correct error when not present 2023-03-09 10:34:51 -08:00
joachim c97e3acce7 Add two video settings:
-pos=<x>,<y>            Position [Default: centered]
-borderless             Windowed mode with no border

These 2 settings are usefull when setting up a multiplayer game on one machine.

Example for 4 windows in fullHD:

start "Master" /D"Master_P4" Supermodel.exe -input-system=sdl ..\ROMS\dayto2pe.zip -res=960,540 -borderless -pos=0,0
start "Slave1" /D"Slave1_P4" Supermodel.exe -input-system=sdl ..\ROMS\dayto2pe.zip -res=960,540 -borderless -pos=960,0
start "Slave2" /D"Slave2_P4" Supermodel.exe -input-system=sdl ..\ROMS\dayto2pe.zip -res=960,540 -borderless -pos=0,540
start "Slave3" /D"Slave3_P4" Supermodel.exe -input-system=sdl ..\ROMS\dayto2pe.zip -res=960,540 -borderless -pos=960,540
2023-03-09 10:34:51 -08:00
joachim 5fa190490d Allow joystick to be fetch if windows has no focus in SDL input mode.
This is usefull for multiple instance of supermodel networked on the same machine.
2023-03-09 10:34:51 -08:00
Ian Curtis 69a458ecf7 Make sure to invalidate texture memory when going fullscreen otherwise it might not be syned correctly. 2022-12-25 00:32:01 +00:00
Ian Curtis 11c01a349f SDL_SetWindowFullscreen isn't needed as we call ResizeGLScreen which sets the fullscreen mode afterwards. 2022-12-24 23:54:47 +00:00
Ian Curtis 6dcf144694 We must explicitly call SDL_SetWindowFullscreen after setting the display mode otherwise the refresh rate doesn't change. 2022-12-24 17:29:08 +00:00
Ian Curtis ad0aed42a4 be a bit more flexible with the display frequencies we'll match 2022-12-19 14:11:21 +00:00
Ian Curtis 25604512f4 The model 3 (actually model 1,2 and 3) all used some crazy refresh rate 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.
2022-12-19 00:13:08 +00:00
Fernando Casas Schössow d83e4754fe Fixed build on macOS 2022-12-12 16:49:07 -08:00
Fernando Casas Schössow 07429b9187 Switched to Util::Format() to generate screenshot filename 2022-12-12 16:49:07 -08:00
Fernando Casas Schössow 317f8bacde First review code changes (identation and cosmetic changes) 2022-12-12 16:49:07 -08:00
Fernando Casas Schössow d11efb8553 Changed pathType from string var to enum 2022-12-12 16:49:07 -08:00
Fernando Casas Schössow df7787f040 Keep Supermodel files (config, nvram, saves, etc.) in a predictable path when running on Linux 2022-12-12 16:49:07 -08:00
toxieainc db455ba5c1 add undefd codepath for correct use of the 18bit DAC path (which seems to be triggered for all games)
the volume correction to bring the data back into a valid range is not really needed in practice though, only Daytona2 seems to need it, and also only extremely rarely, so lets just live with a tiny bit of clamping for that game then

while add it, make some formatting similar to MAME, and add one comment regarding a most likely wrong recent MAME change
2022-11-29 12:36:27 -08:00
Ian Curtis e47258c61d Remove some left over depreciated opengl functions. They were basically no-op anyway with shader path. 2022-11-07 23:52:44 +00:00
Ian Curtis 9348fd852d Merge branch 'master' of https://github.com/trzy/Supermodel 2022-11-07 21:33:08 +00:00
Ian Curtis 40c8259130 Rewrite the whole project for GL4+. I figured if we removed the limitation of a legacy rendering API we could improve things a bit. With GL4+ we can do unsigned integer math in the shaders. This allows us to upload a direct copy of the real3d texture sheet, and texture directly from this memory given the x/y pos and type. This massively simplifies the binding and invalidation code. Also the crazy corner cases will work because it essentially works the same way as the original hardware.
The standard triangle render requires gl 4.1 core, so should work on mac. The quad renderer runs on 4.5 core. The legacy renderer should still work, and when enabled a regular opengl context will be created, which allows functions marked depreciated in the core profiles to still work. This will only work in windows/linux I think. Apple doesn't support this.

A GL 4.1 GPU is now the min required spec. Sorry if you have an OLDER gpu. GL 4.1 is over 12 years old now.

This is a big update so I apologise in advance if I accidently broke something :]
2022-11-07 21:33:01 +00:00
toxieainc 4c727abdc8 change all INT16 mixing/intermediate clamping to floats
also fixes 3 bugs:
1) mpeg right channel volume was always using the left channel volume, too
2) too high MusicVolume setting was not clamped to 0..200
3) too high SoundVolume setting was not clamped to 0..200
2022-11-06 13:00:13 -08:00
ToBul e06788e768 Fix SUPERMODEL_DEBUGGER build. - Ian
As requested by Bart; Ian's last SourceForge commit.
Also, purely to appease my OCD, a change I forgot on my last 'Games.xml' PR that really shouldn't bother me as much as it does.
2022-08-14 11:46:35 -07:00
toxieainc 4961951a89 fix a real error (m68kdasm) and some harmless performance warnings and use modern headers 2022-07-11 18:10:41 +02:00
toxieainc e0053b3a46 fix some real errors (Model3,InputSystem), minor errors (SCSP,SDL/Main) and some performance warnings 2022-07-11 17:43:59 +02:00
Bart Trzynadlowski 8c8cc3d32b Preparing for Git snapshot build bot and updated copyright header to reference full lifespan of Supermodel repo 2022-06-23 12:34:02 -07:00
Ian Curtis a742a73772 njz3: Fix sound volume with new quadrophonic audio code 2022-06-19 16:15:54 +00:00
Ian Curtis e3bc56c8f1 values must be signed, to handle negative numbers, my bad 2022-06-14 21:24:43 +00:00
Ian Curtis 78eab65749 minor fix 2022-06-14 18:14:06 +00:00
Bart Trzynadlowski 7be381c9ba 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 patch to be included. 2022-06-12 17:51:57 +00:00
Ian Curtis 83e7b5f45d njz3: Proper quadrophonic audio support. Need 4+ speakers to take advantage otherwise down mixed to stereo. 2022-06-09 21:10:39 +00:00
Bart Trzynadlowski 5e61e2f388 Added default values for PortIn, PortOut, and AddressOut 2022-03-31 23:09:32 +00:00
Bart Trzynadlowski 32933ef9b0 Added a -dump-textures option (config key DumpTextures) that writes texture BMP files, one for each known format (12 in all currently) 2022-02-01 23:15:06 +00:00
Matthew Daniels 9ffce8b92a Getting rid of most of the includes from Supermodel.h; each file now explicitly includes the header files it needs.
Making changes to a header file should no longer force the entire project to recompile.
2021-11-22 17:15:06 +00:00
Matthew Daniels 5a570ce7fe Adding simulated netboard; all linked games except Sega Rally 2 working at full speed. 2021-04-14 01:20:45 +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