2011-09-12 05:43:37 +00:00
|
|
|
/**
|
|
|
|
** Supermodel
|
|
|
|
** A Sega Model 3 Arcade Emulator.
|
2021-02-18 10:29:15 +00:00
|
|
|
** Copyright 2011-2021 Bart Trzynadlowski, Nik Henson, Ian Curtis,
|
|
|
|
** Harry Tuttle, and Spindizzi
|
2011-09-12 05:43:37 +00:00
|
|
|
**
|
|
|
|
** This file is part of Supermodel.
|
|
|
|
**
|
|
|
|
** Supermodel is free software: you can redistribute it and/or modify it under
|
2021-02-18 10:29:15 +00:00
|
|
|
** the terms of the GNU General Public License as published by the Free
|
2011-09-12 05:43:37 +00:00
|
|
|
** Software Foundation, either version 3 of the License, or (at your option)
|
|
|
|
** any later version.
|
|
|
|
**
|
|
|
|
** Supermodel is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
** more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License along
|
|
|
|
** with Supermodel. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**/
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2011-09-12 05:43:37 +00:00
|
|
|
/*
|
|
|
|
* Model3.h
|
2021-02-18 10:29:15 +00:00
|
|
|
*
|
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
|
|
|
* Header file defining the CModel3 and CModel3Config classes.
|
2011-09-12 05:43:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_MODEL3_H
|
|
|
|
#define INCLUDED_MODEL3_H
|
|
|
|
|
2021-11-22 17:15:06 +00:00
|
|
|
#include "53C810.h"
|
|
|
|
#include "93C46.h"
|
|
|
|
#include "Crypto.h"
|
|
|
|
#include "IEmulator.h"
|
|
|
|
#include "JTAG.h"
|
|
|
|
#include "MPC10x.h"
|
|
|
|
#include "Real3D.h"
|
|
|
|
#include "RTC72421.h"
|
|
|
|
#include "SoundBoard.h"
|
|
|
|
#include "TileGen.h"
|
|
|
|
#include "DriveBoard/DriveBoard.h"
|
|
|
|
#include "CPU/PowerPC/ppc.h"
|
2021-04-14 01:20:45 +00:00
|
|
|
#ifdef NET_BOARD
|
|
|
|
#include "Network/INetBoard.h"
|
|
|
|
#endif // NET_BOARD
|
2017-03-27 03:19:15 +00:00
|
|
|
#include "Util/NewConfig.h"
|
2012-01-16 23:21:14 +00:00
|
|
|
|
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
|
|
|
/*
|
|
|
|
* FrameTimings
|
|
|
|
*
|
|
|
|
* Timings within a frame, for debugging purposes
|
|
|
|
*/
|
|
|
|
struct FrameTimings
|
|
|
|
{
|
2016-04-02 21:50:40 +00:00
|
|
|
UINT32 ppcTicks;
|
|
|
|
UINT32 syncSize;
|
|
|
|
UINT32 syncTicks;
|
|
|
|
UINT32 renderTicks;
|
|
|
|
UINT32 sndTicks;
|
|
|
|
UINT32 drvTicks;
|
2018-01-07 14:07:59 +00:00
|
|
|
#ifdef NET_BOARD
|
|
|
|
UINT32 netTicks;
|
|
|
|
#endif
|
2016-04-02 21:50:40 +00:00
|
|
|
UINT32 frameTicks;
|
2022-06-09 21:10:39 +00:00
|
|
|
UINT64 frameId;
|
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
|
|
|
};
|
|
|
|
|
2011-09-12 05:43:37 +00:00
|
|
|
/*
|
|
|
|
* CModel3:
|
|
|
|
*
|
|
|
|
* A complete Model 3 system.
|
|
|
|
*
|
2016-04-10 03:42:41 +00:00
|
|
|
* Inherits IBus in order to pass the address space handlers to devices that
|
2011-09-12 05:43:37 +00:00
|
|
|
* may need them (CPU, DMA, etc.)
|
|
|
|
*
|
|
|
|
* NOTE: Currently NOT re-entrant due to a non-OOP PowerPC core. Do NOT create
|
|
|
|
* create more than one CModel3 object!
|
|
|
|
*/
|
2016-04-10 03:42:41 +00:00
|
|
|
class CModel3: public IEmulator, public IBus, public IPCIDevice
|
2011-09-12 05:43:37 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-04-10 03:42:41 +00:00
|
|
|
// IEmulator interface
|
|
|
|
bool PauseThreads(void);
|
|
|
|
bool ResumeThreads(void);
|
|
|
|
void SaveState(CBlockFile *SaveState);
|
|
|
|
void LoadState(CBlockFile *SaveState);
|
|
|
|
void SaveNVRAM(CBlockFile *NVRAM);
|
|
|
|
void LoadNVRAM(CBlockFile *NVRAM);
|
|
|
|
void ClearNVRAM(void);
|
|
|
|
void RunFrame(void);
|
|
|
|
void RenderFrame(void);
|
|
|
|
void Reset(void);
|
2017-03-27 03:19:15 +00:00
|
|
|
const Game &GetGame(void) const;
|
2016-04-10 03:42:41 +00:00
|
|
|
void AttachRenderers(CRender2D *Render2DPtr, IRender3D *Render3DPtr);
|
2021-02-18 10:29:15 +00:00
|
|
|
void AttachInputs(CInputs *InputsPtr);
|
2016-04-10 03:42:41 +00:00
|
|
|
void AttachOutputs(COutputs *OutputsPtr);
|
|
|
|
bool Init(void);
|
2022-06-09 21:10:39 +00:00
|
|
|
// For Scripting tweaks
|
|
|
|
Util::Config::Node& GetConfig() { return this->m_config; }
|
2016-04-10 03:42:41 +00:00
|
|
|
|
|
|
|
// IPCIDevice interface
|
2016-04-02 21:50:40 +00:00
|
|
|
UINT32 ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width);
|
|
|
|
void WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width, UINT32 data);
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-10 03:42:41 +00:00
|
|
|
// IBus interface
|
2016-04-02 21:50:40 +00:00
|
|
|
UINT8 Read8(UINT32 addr);
|
|
|
|
UINT16 Read16(UINT32 addr);
|
|
|
|
UINT32 Read32(UINT32 addr);
|
|
|
|
UINT64 Read64(UINT32 addr);
|
|
|
|
void Write8(UINT32 addr, UINT8 data);
|
|
|
|
void Write16(UINT32 addr, UINT16 data);
|
|
|
|
void Write32(UINT32 addr, UINT32 data);
|
|
|
|
void Write64(UINT32 addr, UINT64 data);
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
2017-03-27 03:19:15 +00:00
|
|
|
* LoadGame(game, rom_set):
|
2016-04-02 21:50:40 +00:00
|
|
|
*
|
2017-03-27 03:19:15 +00:00
|
|
|
* Loads a game, copying in the provided ROMs and setting the hardware
|
|
|
|
* stepping.
|
2016-04-02 21:50:40 +00:00
|
|
|
*
|
|
|
|
* Parameters:
|
2017-03-27 03:19:15 +00:00
|
|
|
* game Game information.
|
|
|
|
* rom_set ROMs.
|
2016-04-02 21:50:40 +00:00
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* OKAY if successful, FAIL otherwise. Prints errors.
|
|
|
|
*/
|
2017-03-27 03:19:15 +00:00
|
|
|
bool LoadGame(const Game &game, const ROMSet &rom_set);
|
2018-01-07 14:07:59 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
|
|
|
* GetSoundBoard(void):
|
2021-02-18 10:29:15 +00:00
|
|
|
*
|
2016-04-02 21:50:40 +00:00
|
|
|
* Returns a reference to the sound board.
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* Pointer to CSoundBoard object.
|
|
|
|
*/
|
|
|
|
CSoundBoard *GetSoundBoard(void);
|
2011-09-15 21:10:38 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
|
|
|
* GetDriveBoard(void):
|
|
|
|
*
|
|
|
|
* Returns a reference to the drive board.
|
2011-09-15 21:10:38 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
* Returns:
|
|
|
|
* Pointer to CDriveBoard object.
|
|
|
|
*/
|
|
|
|
CDriveBoard *GetDriveBoard(void);
|
2011-09-15 21:10:38 +00:00
|
|
|
|
2018-01-07 14:07:59 +00:00
|
|
|
#ifdef NET_BOARD
|
|
|
|
/*
|
|
|
|
* GetNetBoard(void):
|
|
|
|
*
|
|
|
|
* Returns a reference to the net board.
|
|
|
|
|
|
|
|
* Returns:
|
2021-04-14 01:20:45 +00:00
|
|
|
* Pointer to CNetBoard or CSimNetBoard object.
|
2018-01-07 14:07:59 +00:00
|
|
|
*/
|
2021-04-14 01:20:45 +00:00
|
|
|
INetBoard * GetNetBoard(void);
|
2018-01-07 14:07:59 +00:00
|
|
|
#endif
|
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
|
|
|
* DumpTimings(void):
|
|
|
|
*
|
|
|
|
* Prints all timings for the most recent frame to the console, for debugging purposes.
|
|
|
|
*/
|
|
|
|
void DumpTimings(void);
|
2011-09-15 21:10:38 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
|
|
|
* GetTimings(void):
|
|
|
|
*
|
|
|
|
* Returns timings for the most recent frame, for debugging purposes.
|
|
|
|
*/
|
|
|
|
FrameTimings GetTimings(void);
|
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
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
2017-03-27 03:19:15 +00:00
|
|
|
* CModel3(config):
|
2016-04-02 21:50:40 +00:00
|
|
|
* ~CModel3(void):
|
|
|
|
*
|
2021-02-18 10:29:15 +00:00
|
|
|
* Constructor and destructor for Model 3 class. Constructor performs a
|
|
|
|
* bare-bones initialization of object; does not perform any memory
|
2016-04-02 21:50:40 +00:00
|
|
|
* allocation or any actions that can fail. The destructor will deallocate
|
|
|
|
* memory and free resources used by the object (and its child objects).
|
2017-03-27 03:19:15 +00:00
|
|
|
*
|
|
|
|
* Paramters:
|
|
|
|
* config Run-time configuration. The reference should be held because
|
|
|
|
* this changes at run-time.
|
2016-04-02 21:50:40 +00:00
|
|
|
*/
|
2022-06-09 21:10:39 +00:00
|
|
|
CModel3(Util::Config::Node &config);
|
2016-04-02 21:50:40 +00:00
|
|
|
~CModel3(void);
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
/*
|
|
|
|
* Private Property.
|
|
|
|
* Tresspassers will be shot! ;)
|
|
|
|
*/
|
2011-09-12 05:43:37 +00:00
|
|
|
private:
|
2016-04-02 21:50:40 +00:00
|
|
|
// Private member functions
|
|
|
|
UINT8 ReadInputs(unsigned reg);
|
|
|
|
void WriteInputs(unsigned reg, UINT8 data);
|
|
|
|
uint16_t ReadSecurityRAM(uint32_t addr);
|
|
|
|
UINT32 ReadSecurity(unsigned reg);
|
|
|
|
void WriteSecurity(unsigned reg, UINT32 data);
|
|
|
|
void SetCROMBank(unsigned idx);
|
|
|
|
UINT8 ReadSystemRegister(unsigned reg);
|
|
|
|
void WriteSystemRegister(unsigned reg, UINT8 data);
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
void RunMainBoardFrame(void); // Runs PPC main board for a frame
|
|
|
|
void SyncGPUs(void); // Sync's up GPUs in preparation for rendering - must be called when PPC is not running
|
|
|
|
bool RunSoundBoardFrame(void); // Runs sound board for a frame
|
|
|
|
void RunDriveBoardFrame(void); // Runs drive board for a frame
|
2018-01-07 14:07:59 +00:00
|
|
|
#ifdef NET_BOARD
|
|
|
|
void RunNetBoardFrame(void); // Runs net board for a frame
|
|
|
|
#endif
|
2012-01-16 23:21:14 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
bool StartThreads(void); // Starts all threads
|
|
|
|
bool StopThreads(void); // Stops all threads
|
|
|
|
void DeleteThreadObjects(void); // Deletes all threads and synchronization objects
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
static int StartMainBoardThread(void *data); // Callback to start PPC main board thread
|
|
|
|
static int StartSoundBoardThread(void *data); // Callback to start sound board thread (unsync'd)
|
|
|
|
static int StartSoundBoardThreadSyncd(void *data); // Callback to start sound board thread (sync'd)
|
|
|
|
static int StartDriveBoardThread(void *data); // Callback to start drive board thread
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
static void AudioCallback(void *data); // Audio buffer callback
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
bool WakeSoundBoardThread(void); // Used by audio callback to wake sound board thread (when not sync'd with render thread)
|
|
|
|
int RunMainBoardThread(void); // Runs PPC main board thread (sync'd in step with render thread)
|
|
|
|
int RunSoundBoardThread(void); // Runs sound board thread (not sync'd in step with render thread, ie running at full speed)
|
|
|
|
int RunSoundBoardThreadSyncd(void); // Runs sound board thread (sync'd in step with render thread)
|
|
|
|
int RunDriveBoardThread(void); // Runs drive board thread (sync'd in step with render thread)
|
2018-01-07 14:07:59 +00:00
|
|
|
|
2017-03-27 03:19:15 +00:00
|
|
|
// Runtime configuration
|
2022-06-09 21:10:39 +00:00
|
|
|
Util::Config::Node &m_config;
|
2017-03-27 03:19:15 +00:00
|
|
|
bool m_multiThreaded;
|
|
|
|
bool m_gpuMultiThreaded;
|
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Game and hardware information
|
2017-03-27 03:19:15 +00:00
|
|
|
Game m_game;
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Game inputs and outputs
|
|
|
|
CInputs *Inputs;
|
|
|
|
COutputs *Outputs;
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Input registers (game controls)
|
|
|
|
UINT8 inputBank;
|
|
|
|
UINT8 serialFIFO1, serialFIFO2;
|
|
|
|
UINT8 gunReg;
|
|
|
|
int adcChannel;
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// MIDI port
|
|
|
|
UINT8 midiCtrlPort; // controls MIDI (SCSP) IRQ behavior
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Emulated core Model 3 memory regions
|
|
|
|
UINT8 *memoryPool; // single allocated region for all ROM and system RAM
|
|
|
|
UINT8 *ram; // 8 MB PowerPC RAM
|
|
|
|
UINT8 *crom; // 8+128 MB CROM (fixed CROM first, then 64MB of banked CROMs -- Daytona2 might need extra?)
|
|
|
|
UINT8 *vrom; // 64 MB VROM (video ROM, visible only to Real3D)
|
|
|
|
UINT8 *soundROM; // 512 KB sound ROM (68K program)
|
|
|
|
UINT8 *sampleROM; // 8 MB samples (68K)
|
|
|
|
UINT8 *dsbROM; // 128 KB DSB ROM (Z80 program)
|
|
|
|
UINT8 *mpegROM; // 8 MB DSB MPEG ROM
|
|
|
|
UINT8 *backupRAM; // 128 KB Backup RAM (battery backed)
|
|
|
|
UINT8 *securityRAM; // 128 KB Security Board RAM
|
|
|
|
UINT8 *driveROM; // 32 KB drive board ROM (Z80 program) (optional)
|
2021-10-30 23:00:49 +00:00
|
|
|
UINT8 *netRAM; // 64 KB RAM
|
|
|
|
UINT8 *netBuffer; // 128 KB buffer
|
2022-06-09 21:10:39 +00:00
|
|
|
UINT8 OutputRegister[2]; // Input/output register for driveboard and lamps
|
2018-01-07 14:07:59 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Banked CROM
|
|
|
|
UINT8 *cromBank; // currently mapped in CROM bank
|
2021-02-18 10:29:15 +00:00
|
|
|
unsigned cromBankReg; // the CROM bank register
|
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Security device
|
|
|
|
bool m_securityFirstRead = true;
|
|
|
|
unsigned securityPtr; // pointer to current offset in security data
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// PowerPC
|
|
|
|
PPC_FETCH_REGION PPCFetchRegions[3];
|
2012-07-15 21:04:46 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Multiple threading
|
|
|
|
bool gpusReady; // True if GPUs are ready to render
|
|
|
|
bool startedThreads; // True if threads have been created and started
|
|
|
|
bool pauseThreads; // True if threads should pause
|
|
|
|
bool stopThreads; // True if threads should stop
|
|
|
|
bool syncSndBrdThread; // True if sound board thread should be sync'd in step with render thread
|
|
|
|
CThread *ppcBrdThread; // PPC main board thread
|
|
|
|
CThread *sndBrdThread; // Sound board thread
|
|
|
|
CThread *drvBrdThread; // Drive board thread
|
|
|
|
bool ppcBrdThreadRunning; // Flag to indicate PPC main board thread is currently processing
|
|
|
|
bool ppcBrdThreadDone; // Flag to indicate PPC main board thread has finished processing
|
|
|
|
bool sndBrdThreadRunning; // Flag to indicate sound board thread is currently processing
|
|
|
|
bool sndBrdThreadDone; // Flag to indicate sound board thread has finished processing
|
|
|
|
bool sndBrdWakeNotify; // Flag to indicate that sound board thread has been woken by audio callback (when not sync'd with render thread)
|
|
|
|
bool drvBrdThreadRunning; // Flag to indicate drive board thread is currently processing
|
|
|
|
bool drvBrdThreadDone; // Flag to indicate drive board thread has finished processing
|
2011-09-12 05:43:37 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Thread synchronization objects
|
|
|
|
CSemaphore *ppcBrdThreadSync;
|
|
|
|
CSemaphore *sndBrdThreadSync;
|
|
|
|
CMutex *sndBrdNotifyLock;
|
|
|
|
CCondVar *sndBrdNotifySync;
|
|
|
|
CSemaphore *drvBrdThreadSync;
|
|
|
|
CMutex *notifyLock;
|
2021-02-18 10:29:15 +00:00
|
|
|
CCondVar *notifySync;
|
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Frame timings
|
|
|
|
FrameTimings timings;
|
2021-02-18 10:29:15 +00:00
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
// Other devices
|
|
|
|
CIRQ IRQ; // Model 3 IRQ controller
|
|
|
|
CMPC10x PCIBridge; // MPC10x PCI/bridge/memory controller
|
|
|
|
CPCIBus PCIBus; // Model 3's PCI bus
|
|
|
|
C53C810 SCSI; // NCR 53C810 SCSI controller
|
|
|
|
CRTC72421 RTC; // Epson RTC-72421 real-time clock
|
|
|
|
C93C46 EEPROM; // 93C46 EEPROM
|
|
|
|
CTileGen TileGen; // Sega 2D tile generator
|
|
|
|
CReal3D GPU; // Real3D graphics hardware
|
|
|
|
CSoundBoard SoundBoard; // Sound board
|
|
|
|
CDSB *DSB; // Digital Sound Board (type determined dynamically at load time)
|
2021-02-18 10:29:15 +00:00
|
|
|
CDriveBoard *DriveBoard; // Drive board
|
2016-04-02 21:50:40 +00:00
|
|
|
CCrypto m_cryptoDevice; // Encryption device
|
2017-09-24 20:52:48 +00:00
|
|
|
CJTAG m_jtag; // JTAG interface
|
2018-01-07 14:07:59 +00:00
|
|
|
#ifdef NET_BOARD
|
2021-04-14 01:20:45 +00:00
|
|
|
INetBoard *NetBoard; // Net board
|
2020-06-12 17:33:21 +00:00
|
|
|
bool m_runNetBoard;
|
2018-01-07 14:07:59 +00:00
|
|
|
#endif
|
2011-09-12 05:43:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-04-02 21:50:40 +00:00
|
|
|
#endif // INCLUDED_MODEL3_H
|