Commit graph

172 commits

Author SHA1 Message Date
Bart Trzynadlowski c0ec610e99 Polygon header bit analysis code (need to #define DEBUG and use -gfx-state option) 2016-04-27 04:09:50 +00:00
Bart Trzynadlowski 112777385e Added 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=<file> on command line. 2016-04-24 17:06:14 +00:00
Bart Trzynadlowski 1265c8d184 Using IEmulator interface instead of CModel3 directly 2016-04-24 03:01:42 +00:00
Bart Trzynadlowski 9baa0488e3 Changed save state file version (r340 changed Real3D save format, breaking compatibility with older states, and states were probably already incompatible with 0.2a) 2016-04-24 01:50:03 +00:00
Bart Trzynadlowski 3bd8e20639 Fixed white space and warnings. Fixed second argument to -dis option in cases where other numerical parameters are specified on command line. 2016-04-24 01:40:16 +00:00
Bart Trzynadlowski 198a469ff7 Created IEmulator interface, renamed CBus to IBus and CPCIDevice to IPCIDevice. Frames now rendered when emulator paused. 2016-04-10 03:42:41 +00:00
Bart Trzynadlowski e08b754140 Changed help text to explain that -sound-volume and -music-volume only take effect when DSB is present 2016-04-05 04:31:39 +00:00
Ian Curtis 93f6b01e0b Update project to vs 2013. Clean compile warnings 2016-03-22 12:30:23 +00:00
Ian Curtis 5b3eea25fb fix basic compile errors (with vs) 2016-03-22 11:34:32 +00:00
Bart Trzynadlowski 34301e97e1 Adding new 3D engine by Ian Curtis. Old engine moved to Graphics/Legacy3D/. 2016-03-21 04:10:14 +00:00
Nik Henson 8835d6fe36 Some updates to Supermodel made at beginning of the year but only now got around to checking in (better late than never...):
- hooked up the remaining controls in Supermodel (except for Magical Truck Adventure which does not work at all yet).  The new controls are:
  * InputAnalogJoyTrigger2 and InputAnalogJoyEvent2 for the additional second trigger and event buttons that were missing from Star Wars Trilogy,
  * InputRearBrake and InputMusicSelect for the rear brake and music selection buttons that were missing from Harley Davidson,
  * InputAnalogGunXXX, InputAnalogTriggerXXX, InputAnalogGunXXX2 and InputAnalogTriggerXXX2 for the analogue guns of Ocean Hunter and LA Machineguns (NOTE: these controls must be calibrated in the games' service menus otherwise they will not work properly.  Also, the alignment of the gun cursor does not line up very well with the mouse position at the moment, but at least the games are a bit more playable now, although still with numerous graphical glitches...)
  * InputSkiXXX for the controls of Ski Champ, making the game playable now.
- hooked up existing InputViewChange control to Harley Davidson's view change button
- improved the handling of InputGearShiftUp/Down inputs so that they work better with the driving games.  With Dirt Devils, ECA, Harley and LeMans this means they map directly to the game's own shift up/down controls, while with the 4-speed games such as Daytona 2, Scud Racer and Sega Rally 2, they simulate the user shifting up and down through the gears
- added defaults for the new controls to Supermodel.ini
- other small code tweaks:
  * fix small bug with handling of pos/neg inputs mapping to a control with inverted range (0XFF to 0x00) - this was needed to get Ski Champ's X-axis to work properly
  * removed Wait method from InputSystem and added to CThread as CThread::Sleep instead
  * added FrameTimings struct to hold all frame timings in a single place
No networking code yet as just haven't had a chance to work on it since initial progress at the beginning of the year - am *hoping* might have some time to pick it up again over Christmas...
2013-11-30 19:39:59 +00:00
Nik Henson 183dca563d Committing various small updates that have been hanging around in my source tree for a while now:
- Added 'crosshairs' command line and config option.
- Added 'vsync' command line and config option (so far only tested on NVidia cards on Windows 7 - other graphics drivers, O/Ss or driver settings may simply chose to ignore this).
- Added fullscreen toggle within game using Alt+Enter key combination.
- Added framework for lamp outputs and 'outputs' command line and config option.  So far only the lamps for driving games are hooked up in the emulator (others to be added later).
- Added an initial outputs implementation for Windows that sends MAMEHooker compatible messages (-outputs=win to enable)
- Fixed fps calculation in Main.cpp that was producing incorrect results and so giving the impression that frame throttling wasn't working properly when in fact it was.
- Fixed palette indexed colours as the index was always off by one, causing incorrect colours in various games, eg drivers' suits and flashing Start sign in Daytona 2.
- Altered caching of models so that models with palette indexed colours use the dynamic cache rather than the static one.  This is so that changes in palette indexed colours appear on screen, eg the flashing Start sign on the advanced course of Daytona 2 (although currently the START message itself is not visible due to other problems with texture decoding).
- Fixed small bug in TileGen.cpp which meant both palettes were being completely recomputed pretty much with every frame.  This was a significant performance hit, particularly as palette recomputation is currently being done in SyncSnapshots (it should be moved out of here at some point, although for now it's no big deal).
- Made sure all OpenGL objects and resources are deleted in Render2D/3D destructors, in particular the deleting of the VBO buffer in DestroyModelCache.
- Made sure that GLSL uniforms are always checked to see if they are bound before using them in order to stop unecessary (but harmless) GL errors.
- Altered the default texture sheet handling to use a single large GL texture holding multiple Model3 texture sheets rather than multiple GL textures as before (if required, the old behaviour can still be selected with the mulisheet fragment shader).  I believe this fixes the disappearing crosshairs/corrupt GL state problem which the multisheet fragment shader seemed to be triggering somehow.
- Fixed a bug in debugger which meant memory watches were not triggering properly
2012-07-15 21:04:46 +00:00
Bart Trzynadlowski 772c94d122 - Committing Nik's timing changes: the PowerPC's DEC and TBR now count at the correct rate and time is accurately maintained between calls to the emulator. A VBlank bit was identified in the Real3D status register space and is now timed. Unfortunately, there are still some problems and not all games are perfect, but FV2, VS2, and others are working much better or perfectly.
- Added a new dump of Scud Race Plus (scudp1). Strangely, this one uses an MPC106 instead of the MPC105 used by every other Step 1.5 game...
2012-07-12 06:13:24 +00:00
Bart Trzynadlowski 453df4f5f5 - Finished cleaning up and optimizing the 2D renderer.
- Fixed up color offset register support for new 2D rendering system. Now maintains 2 computed palettes for layers A/A' and B/B'.
- Fixed a minor bug in InitPalette(); VRAM was not being typecast properly.
- Fixed specular lighting bug that occurred on some OpenGL drivers because integers were not being interpreted as floats in the vertex shader.
- Began to update copyright date in some files.
- Graphics modules now use the C++-style names for C standard library headers (e.g., stdio.h -> cstdio) consistent with the rest of Supermodel.
2012-02-20 03:45:48 +00:00
Bart Trzynadlowski 79d24d403f - NOTE: In this revision (possibly earlier), I've started to notice some intermittent geometry glitches in Spikeout and slowdown while playing certain characters.
- Added multi-texture fragment shader to repo.
- Added a multiTexture option (enabled by default) to use multi-texturing to decode textures.
- Added some comments regarding timing to the PowerPC execution loop.
2012-02-14 03:28:52 +00:00
Nik Henson 8a4ea64994 Added OSD/Video.h to provide OSD-dependent video functionality. The static functions in here get called by Model3.cpp from within the render thread so that any OSD related rendering can also be run in parallel for a further speed increase.
Updated OSD/SDL/Main.cpp to provide the SDL implementations of the functions in OSD/Video.h.
2012-02-13 23:37:48 +00:00
Bart Trzynadlowski 35a47bc7e3 Added command line options to force windowed mode and to control GPU multi-threading. 2012-02-11 16:40:09 +00:00
Bart Trzynadlowski 1b8740165c Added a wide screen hack that can be enabled with the -'wide-screen' argument or WideScreen in the config file. 2012-02-10 19:53:51 +00:00
Bart Trzynadlowski 40a51287df Tweaked help text slightly. 2012-02-09 17:15:15 +00:00
Bart Trzynadlowski 09f9bd81fd Fixed left/right stereo channels -- they were reversed by default. 2012-02-09 17:12:13 +00:00
Bart Trzynadlowski c5d0cb0d97 Added front/rear speaker balance (actually the master/slave SCSP balance). Balance setting is stored in CSoundBoardConfig and can be set on the command line (-balance) or config file (Balance). Valid range is 100 (front speaker volume doubled, rear muted) to -100. The default is 0, both sets at full volume. Balance is applied in the SCSP core before overall sound and music volume settings. 2012-02-09 07:58:07 +00:00
Nik Henson d1d5175548 New multi-threaded rendering changes that parallelise graphics rendering and PPC execution in order to increase performance on multi-core machines.
New gpuMultiThreaded config option to enable/disable multi-threaded rendering (enabled by default, disabling it reverts to previous behaviour).
Other rendering optimisations:
 - texture uploads now only affect appropriate region in the texture sheet, rather than uploading the whole sheet each time
 - performance of clearing the model caches has been improved
New Alt+O key input added to toggle outputting of frame timings for debugging purposes.
2012-01-16 23:21:14 +00:00
Nik Henson b7242d27e8 Added CThread::Sleep && CThread::GetTicks methods 2012-01-16 22:07:17 +00:00
Nik Henson dfa77e9207 Added support for joystick sliders to input system.
Added extra debugging output to calibration input detection routine (activated by pressing Shift).
2011-11-01 23:24:37 +00:00
Nik Henson e6fd2e2240 Added DirectInputConstForceLeftMax and DirectInputConstForceRightMax options to allow different force feedback strengths in each direction. DirectInputConstForceMax still works as before but these new options will override it for the given direction if they are specified. 2011-10-02 20:53:12 +00:00
Bart Trzynadlowski 7f97346fc9 - Tweaked some error messages and comments. Hopefully, this is the last update for v0.2a's code.
- Documentation updates.
2011-09-24 01:49:48 +00:00
Bart Trzynadlowski 83067f076f - Only player 1 crosshair is shown by default now.
- Tweaked Makefiles a bit.
- More documentation updates.
- Changed version string to 0.2a in preparation for the final release :)
2011-09-23 07:18:40 +00:00
Bart Trzynadlowski a1346b57f5 - Changed spelling of some messages in drive board code.
- Added an extra blank line after info display in CModel3.
- Cleaned up comments in Main.cpp.
- More document updates. Fixed '-no-music'->'-no-dsb', 'EmulateMusic'->'EmulateDSB'.
2011-09-22 17:28:49 +00:00
Bart Trzynadlowski d00b03f65b Force feedback no longer available as an option on non-Windows builds. 2011-09-22 07:24:15 +00:00
Bart Trzynadlowski 46bc52bb12 - Changed save state error messages slightly.
- Wrapped rows that exceed 80 columns in Supermodel.ini.
- Added some member and function comments to a few header files. 
- Changed version string to 0.2a-RC2 in anticipation of sending another release candidate build to testers.
- Added GAME_INPUT_RALLY flag to dirtdvlsa, eca, and ecax.
- Configuration dialog no longer refers to Sega Rally 2 and Dirt Devils; instead, "Miscellaneous Driving Game Buttons"
- More additions to README.txt.
2011-09-22 06:11:47 +00:00
Nik Henson b87f24cdf2 Removed DirectInputEffectsGain force feedback configuration parameter as it's not that useful as it's easier to adjust effects individually 2011-09-21 22:28:13 +00:00
Bart Trzynadlowski 24f46e9f86 Updated UNIX Makefile, fixed some syntax errors. 2011-09-21 19:12:50 +00:00
Bart Trzynadlowski ee471539c5 - Fixed newlines in logs.
- Set default PowerPC frequency to 50 MHz.
- Minor tweak to help text.
- More README.txt updates.
2011-09-19 03:56:15 +00:00
Nik Henson b9430cd988 Changes to input system:
- Joystick axis saturation values can now range from 1-200 rather than just 1-100.  This lets the user make axis less sensitive, if required.
- Added joystick axes calibration menus to -config-inputs.
- Moved DirectInput & XInput feedback settings out of CDirectInputSystem and into COSDConfig (so that they can be configured per-game).
- DirectInput mode now only grabs background access to keyboard, mice and joystick when configuring inputs, otherwise it only grabs foreground access.
Other changes:
- Main.cpp now ensures all Model3 threads are paused before shutting down.
2011-09-18 21:44:40 +00:00
Bart Trzynadlowski f0697dbc84 - Tweaked formatting of help message 2011-09-17 23:42:42 +00:00
Bart Trzynadlowski 45603b5549 - Tweaked comments in Supermodel.ini
- More work on README.txt
- Tweaked some error/info messages.
2011-09-17 23:41:12 +00:00
Bart Trzynadlowski 1629cd711c - Updated README (far from finished).
- Music volume cannot be changed if game has no DSB.
- Extra hardware (DSB, drive board) is printed in information display when ROM is loaded.
2011-09-15 07:13:19 +00:00
Bart Trzynadlowski 2f5bf43bda Updated copyright information and added headers to all remaining files except debugger. 2011-09-14 19:08:43 +00:00
Bart Trzynadlowski 5bf4a6d52b - Added mutex for MIDI FIFO access to SCSP.cpp. 2011-09-14 07:38:56 +00:00
Bart Trzynadlowski d200dff89e - Changed EmulateSCSP -> EmulateSound and -no-scsp -> -no-sound.
- Changed gear shifting behavior: neutral gear has its own button now.
- Removed SUPERMODEL_SOUND.
- DirectInput is the default input system for Windows now.
- Multi-threading is on by default, replaced -multi-threaded w/ -no-threads.
- Made crosshairs larger and more visible.
- Added Nik to co-author list and began updating file copyright notices.
- Fixed Virtua Striker 2 input names (player 2 inputs end with the number 2 instead of 1).
- Added documentation to a Docs/ subdirectory.
- Exported all default input configurations to Supermodel.ini and added that to the repository. Internally, Supermodel initializes all controls to "NONE" now.
2011-09-14 06:16:22 +00:00
Bart Trzynadlowski c10e839dc0 Added a scissor box to clip viewable area. Prevents garbage in the "overscan" areas due to renderer creating viewports that exceed intended display area. 2011-09-13 06:30:42 +00:00
Nik Henson 75d446c272 Changes to Audio.cpp:
- audio buffer is now kept as full as possible with new audio buffering method rather than just half full like before (this is okay now that buffer overruns have been eliminated)
- altered minimum size of audio buffer so that audio still works with a zero latency setting (obviously there will still be some latency)
2011-09-12 21:03:16 +00:00
Nik Henson b0bda2c356 Added note to command line options indicating that force feedback is experimental still 2011-09-12 20:08:50 +00:00
Bart Trzynadlowski cf73207c98 - Nik's new decoupled audio code with fixes to minimize overruns.
- VBlank timing: increased to 20% of a frame.
2011-09-12 05:43:37 +00:00
Bart Trzynadlowski 0716285fc2 Fixed error reporting for -input-system option. 2011-09-09 21:59:23 +00:00
Bart Trzynadlowski e724d0ec0b Fixed error message when multiple files detected on command line. 2011-09-09 20:41:55 +00:00
Bart Trzynadlowski 11d1d61bc2 - Removed BOOL and replaced it with native C++ type, bool.
- Removed TRUE and FALSE, changed to 'true' and 'false' keywords.
2011-09-08 06:34:18 +00:00
Bart Trzynadlowski abd86a5624 - Cleaned up game names (primary sets no longer have revision labels in title).
- Added volume controls to UI.
- Renamed "Sega Rally Controls" to "Sega Rally/Dirt Devils Controls" (even though Dirt Devils has no hand brake).
- Hooked up gear shifting and view change for Dirt Devils.
- Removed debug printf()'s from DSB.cpp.
- Removed debug printf() from Real3D.cpp.
- Disabled assertions in SCSPDSP.cpp.
- Converted all error messages in Amp library to Supermodel format.
2011-09-08 05:08:16 +00:00
Bart Trzynadlowski 70ec09de92 - Added drive board ROM loading.
- Changed EnableFFeedback -> ForceFeedback to be more consistent with the other options.
- Updated help text.
2011-09-08 01:07:06 +00:00
Bart Trzynadlowski cd5bf4c1dd - Updated help text.
- Corrected a typo: EnableFeedback -> EnableFFeedback.
2011-09-07 16:44:20 +00:00
Nik Henson 0a512d79eb Added -force-feedback command line option 2011-09-07 07:28:34 +00:00
Nik Henson 7b58fd0644 Fixed bug which meant that a buffer over-run occuring under certain conditions would leave the write position dangling past the end of the buffer, causing no further sound to be written to the buffer and leaving playback looping indefinitely. 2011-09-01 21:58:10 +00:00
Bart Trzynadlowski bda9efebac - getbass now uses MPC106.
- Fixed some error messages in 53C810.cpp.
- Fixed stereo (was swapped) and added a flip stereo option.
2011-09-01 06:43:01 +00:00
Nik Henson b25cbb2391 Removed setting of writeWrapped to false always on buffer under-run when underRunLoop is true as this is wrong. Suspect this may have been causing looping bug. 2011-08-31 22:30:45 +00:00
Bart Trzynadlowski 87dc5b4181 - Fixed format strings for messages involving __LINE__.
- Fixed an MPEG related crash when loading save states. If usingLoopStart is 0, it is important not to call MPEG_SetLoop()!
- -input-system is working again.
- Changed the format of some messages here and there.
2011-08-28 04:37:41 +00:00
Bart Trzynadlowski 8be2966ecb - Added crosshairs for light gun games and disabled mouse cursor in full screen mode (no way to re-enable it now).
- Fixed Real3D FIFO buffer overflow bug.
- Input system cannot be changed for non-Windows builds (only SDL is available).
- Added Spikeout-specific controls.
2011-08-27 21:37:37 +00:00
Bart Trzynadlowski b19f600fec - Added mappings for individual joysticks in Virtual On for dual-joystick gamepads.
- Input settings are now only read from "global" to avoid confusion.
2011-08-26 05:06:34 +00:00
Bart Trzynadlowski a2ce64745f Detailed config is logged. 2011-08-20 16:56:40 +00:00
Bart Trzynadlowski bedbfd26d3 Detailed config is logged. 2011-08-20 16:53:52 +00:00
Bart Trzynadlowski dbc1dbb0e8 - Forgot to add OSDConfig.h.
- Changed more C standard library headers to C++ versions.
2011-08-19 23:47:33 +00:00
Bart Trzynadlowski d318efe58c - Program settings are now managed by the CConfig class.
- Moved Logger.h to OSD/, cleaned up comments.
- Command line and config file parsing have been rewritten.
- Began replacing C standard library headers with C++ versions (eg. stdio.h -> cstdio). I think I got most of them, but not all.
2011-08-19 20:43:07 +00:00
Bart Trzynadlowski 06f6bf093b Save state support for 68K, Z80, sound board, DSB1, and MPEG playback. 2011-08-09 18:36:29 +00:00
Nik Henson 07fd26003e Added option to loop play position back to beginning of audio buffer when a buffer under-run occurs, rather than stalling output as before. This option is now the default behaviour. 2011-08-07 23:09:18 +00:00
Bart Trzynadlowski 6a6788952c - Fixed Daytona 2 Advertise song. DSB2 MPEG state machine can now begin playing songs from state ST_GOTA4.
- krom: Minor fixes to Main.cpp to support wider ROM set names (up to 9 chars) and compilation under MinGW.
2011-08-03 04:29:33 +00:00
Bart Trzynadlowski 2ca7898f1a - Changes submitted by krom: cleaned up spacing in Games.cpp, optimized byte swapping functions in Supermodel.h, minor changes to fix compiler errors in gcc. 2011-08-01 19:12:44 +00:00
Bart Trzynadlowski ddd6fa92ef - Improved 68K interface. Now supports context switching.
- CSoundBoard is not derived from CBus.
- Optimized sound board memory handlers (now using switch statements).
- Added DSB emulation (based on R. Belmont's M1 source code).
- Improved ROM loading: only unique ROMs (those not shared amongst games) are used to identify games. The ROM loader will no longer get confused as easily.
- General cleanup here and there, removed unused Render.h file.
2011-07-31 02:37:31 +00:00
Nik Henson 03fa9532eb - Added function-based interface Audio for OSD sound output, together with SDL implementation
- Added object interface CThread for OSD threading and synchronization, together with SDL implementation
- Added multi-threading to CModel3 so that separate CPUs (PPC of main board, 68K of sound board and Z80 of drive board) can be run in separate threads if requested to improve performance on multi-core PCs
- Added -multi-threaded command line option (default is to run single-threaded still)
2011-07-20 21:14:00 +00:00
Bart Trzynadlowski c73cb830dc - Added the Musashi 68K emulator by Karl Stenerud. Obtained Karl's explicit permission to relicense the code under GPL.
- Added a 68K interface, CPU/68K/M68K.*.
- Moved Turbo68K source files to CPU/68K/Turbo68K. It is no longer used but is being retained in the source tree for now. The LSR instruction has not been fixed in this update.
- Changed sound board code to use the new 68K interface (and hence, Musashi).
- Changed version string from 0.2-WIP to 0.2a-WIP. This is still an alpha version.
- Above changes have broken the 68K debugger.
2011-07-12 04:57:12 +00:00
Nik Henson 8a9924b884 Changes for new built-in console-based debugger (only compiled in if SUPERMODEL_DEBUGGER defined):
- added code to create debugger object and attach it to system,
 - added new command lines options -enter-debugger and -disable-debugger,
 - added new UI input to halt execution and enter debugger (default Alt+B),
 - added new CLogger class to route all output via debugger if required.
2011-06-27 23:44:51 +00:00
Nik Henson e8782b98fa Changes relating to input system:
- Added ability to configure axis min, centre and max values in INI file.  This allows some types of steering wheel pedals that use an inverted value range to work properly with the emulator.
 - Modified CINIFile to read and write signed numbers (needed for above change).
 - Added check at configuration start for "bad" input sources such as axes that are wrongly calibrated or buttons that are always triggering a value.  Otherwise they cause the configuration loop to wait indefinitely for the axis or button to be released.
 - Removed superfluous check for XInput devices when XInput is not enabled in CDirectInputSystem.
 - Improved force beedback code in CDirectInputSystem and also added the extra feedback effects needed so far for drive board emulation.
2011-06-22 13:06:52 +00:00
Nik Henson 5e247021be Changes relating to input system:
- Fixed bug with mapping of multiple assignments.
- Added new ! operator for input mappings, which lets the user specify that an input must not be active.
- Added option to print info about input system (such as settings and detected keyboards, mice and joysticks) during input configuration.
- Added new trigger input for lightgun games with a configurable option to automatically pull trigger when offscreen input is activated (this makes playing with the mouse easier as the gun can be reloaded with single mouse button, rather than having to press both
 buttons at the same time).
- Added -xinput command line option that switches to using XInput API rather than DirectInput for XBox 360 controllers (this allows the XBox 360 controller's two triggers to be read independently which works better for driving games when they are mapped to accele
rator and brake).
- Added initial version of force feedback implementation to DirectInputSystem (this still needs work).
2011-06-05 20:53:39 +00:00
Bart Trzynadlowski 783446fca2 Fixing import mistake: moving source code to trunk/Src. 2011-04-24 01:19:40 +00:00