- 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).
- 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...
- Also fixed a small race condition in WakeSoundBoardThread. Previously if it happened to be called just before the sound board thread had finished processing a frame's worth of audio but before it had got around to waiting on the sync condition variable then the wake notification would be lost.
- Reverted Nik's polygon palette index change in Models.cpp. Subtracting 1 was breaking Scud Race.
- Added an explicit typecast in Inputs.cpp, which GCC requires for some reason.
- 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
- Fixed a printf statement in ConsoleDebugger.cpp.
- Fixed memory watches not breaking in CPUDebug.h.
- Added some helpful batch files to the VS2008 directory.
- Added support for automatic loading of parent ROM sets.
To achieve this UploadTextures no longer clears the model cache when called. Instead the cache is kept in-tact (which should help improve cache hits) and all textures referenced by models being rendered are (re-)decoded with every frame.
To help with tracking all the unique texture references contained in a model a new class TextureRefs has been added.
- 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.
- 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.
- Added support for layer priorities. Highly unoptimal! This absolutely needs to be polished up before any release (and properly documented). For now, priorities in the popular games seem to be fixed but not all possible priority settings have been figured out yet.
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.
- 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'.
- 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.
- altered PrintSettings to output all settings for attached controls, even if no different to defaults
- added option on calibration screen to detect an axis simply by moving the axis
- corrected axis identification code as was not enumerating axes properly in all cases
- added fallback which just adds all axes if there is any hint of an irregularity whilst enumerating axes
- added methods to attach/debug debugger.
- added instruction hook & callback to m68kconf.h and added hooks into CMusashi68KDebug to allow debugger to control execution.
- added methods to allow reading/writing of 68K registers (for all registers and for a given context, rather than just current one).
- added methods to attach/detach debugger.
- added hooks into CZ80Debug to allow debugger to control execution.
- added methods to allow reading/writing of Z80 registers.
- updated debugger classes to compile again with all recent changes.
- improved debugger classes to allow them to work in multi-threaded emulator and be able to handle CPUs on different threads.
- added debug classes for new Z80 and Musashi 68K CPU cores.
- added logging of cycle counts and frames.
- moved all Supermodel specific code & configuration to CSupermodelDebugger.
- added all Model 3 CPUs (PPC, sound board 68K, DSB 68K/Z80 and drive board Z80) to CSupermodelDebugger.
- added persisting of custom entry points in saved debug state to CCodeAnalyser.
- fixed bug with listing I/O ports in CConsoleDebugger and added displaying of cycle counts and CPU speeds when listing CPUs.
- 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.
- added methods to CModel3 to access sound board and drive board
- added methods to CSoundBoard to access 68K and DSB (if attached)
- added methods to CDSB1 & CDSB2 to access Z80 & 68K respectively
- small code tweak in DriveBoard.cpp
- comment tweaks in Model3.h & Model3.cpp
- 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.
- added notification message if drive board is disabled when loading incompatible save state
- removed some superflous print statements, but have kept in printing out of force feedback commands for now (which have also been made more visual)
- made sure that feedback state is reset in SendStopAll()
- 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)
- fixed bug in SendConstantForce which was sending incorrect values at times
- removed friction effect for now, until can determine its exact command seq
- added checking of compatibility of saved state and temporary disabling of drive board if not compatible
- 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.
- Added parameters for DirectInput and XInput force feedback effects (although still need to add code to persist them in configuration file)
- Added extra friction feedback effect and tidied up existing effects
- 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.
- 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.
- INI file changes: added support for opening and creating files, for a default section alias, and for sections appearing multiple times in the section list (may prevent some bugs).
- 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.
- Model LUT now capable of differentiating between texture offset states (linked list of different texture offsets for each model address).
- Removed texOffset uniform attribute from vertex shader -- no longer needed.
- Moved CPU debugger for Turbo68K into separate class CTurbo68KDebug and made C68KDebug base class for later addition of Musashi core
- Fixed typos in ConsoleDebugger
- 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)
- Implemented bank switching for sample ROMs. It is probably incorrect because there is still 2MB of unaccounted-for space.
- Added a few important TO-DO notes.
- Added PPC/68K communication and automatically generated sound IRQs. Sound is now mostly working :)
- Increased SCSP MIDI buffer length to 128 to simulate a large FIFO for PPC->68K commands.
- Added sound ROMs to those games which have 8 MB of sample ROMs.
- 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.
- Added CPrintBreakpoint
Changes to console-based debugger:
- Added new scp command and tidied up some other commands
- Tidied up event logging
- Sorted commands into common groups
- Added ReadMe.txt help file
- fixed step-out to work properly
- added ability to enable/disable debugging of individual CPUs
Changes to console-based debugger:
- tidied up syntax and split some commands out to make easier to use
- implemented missing commands (loademustate, saveemustate, resetemu, configinput, configallinputs, help)
- added new commands (nextframe, enablecpu, disablecpu, removeallcomments)
- added ability to redirect command output to a file
- 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.
- 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.
- 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).