2022-03-07 23:48:56 +00:00
|
|
|
#pragma once
|
|
|
|
#include "MemoryHandler.h"
|
2022-10-10 00:22:17 +00:00
|
|
|
#include <Project64-core\Logging.h>
|
2022-03-07 23:48:56 +00:00
|
|
|
#include <Project64-core\Settings\DebugSettings.h>
|
|
|
|
#include <Project64-core\Settings\GameSettings.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class VideoInterfaceReg
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
VideoInterfaceReg(uint32_t * VideoInterface);
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint32_t & VI_STATUS_REG;
|
|
|
|
uint32_t & VI_CONTROL_REG;
|
|
|
|
uint32_t & VI_ORIGIN_REG;
|
|
|
|
uint32_t & VI_DRAM_ADDR_REG;
|
|
|
|
uint32_t & VI_WIDTH_REG;
|
|
|
|
uint32_t & VI_H_WIDTH_REG;
|
|
|
|
uint32_t & VI_INTR_REG;
|
|
|
|
uint32_t & VI_V_INTR_REG;
|
|
|
|
uint32_t & VI_CURRENT_REG;
|
|
|
|
uint32_t & VI_V_CURRENT_LINE_REG;
|
|
|
|
uint32_t & VI_BURST_REG;
|
|
|
|
uint32_t & VI_TIMING_REG;
|
|
|
|
uint32_t & VI_V_SYNC_REG;
|
|
|
|
uint32_t & VI_H_SYNC_REG;
|
|
|
|
uint32_t & VI_LEAP_REG;
|
|
|
|
uint32_t & VI_H_SYNC_LEAP_REG;
|
|
|
|
uint32_t & VI_H_START_REG;
|
|
|
|
uint32_t & VI_H_VIDEO_REG;
|
|
|
|
uint32_t & VI_V_START_REG;
|
|
|
|
uint32_t & VI_V_VIDEO_REG;
|
|
|
|
uint32_t & VI_V_BURST_REG;
|
|
|
|
uint32_t & VI_X_SCALE_REG;
|
|
|
|
uint32_t & VI_Y_SCALE_REG;
|
|
|
|
|
|
|
|
private:
|
|
|
|
VideoInterfaceReg();
|
2022-10-10 00:22:17 +00:00
|
|
|
VideoInterfaceReg(const VideoInterfaceReg &);
|
|
|
|
VideoInterfaceReg & operator=(const VideoInterfaceReg &);
|
2022-03-07 23:48:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CMipsMemoryVM;
|
|
|
|
class CPlugins;
|
|
|
|
class CRegisters;
|
|
|
|
class CSystemTimer;
|
2022-03-14 10:37:06 +00:00
|
|
|
class CN64System;
|
2022-03-07 23:48:56 +00:00
|
|
|
|
|
|
|
class VideoInterfaceHandler :
|
|
|
|
public MemoryHandler,
|
|
|
|
public VideoInterfaceReg,
|
|
|
|
private CGameSettings,
|
|
|
|
private CDebugSettings,
|
|
|
|
private CLogging
|
|
|
|
{
|
|
|
|
public:
|
2022-03-14 10:37:06 +00:00
|
|
|
VideoInterfaceHandler(CN64System & System, CMipsMemoryVM & MMU, CRegisters & Reg);
|
|
|
|
~VideoInterfaceHandler();
|
2022-03-07 23:48:56 +00:00
|
|
|
|
|
|
|
void UpdateFieldSerration(uint32_t interlaced);
|
|
|
|
bool Read32(uint32_t Address, uint32_t & Value);
|
|
|
|
bool Write32(uint32_t Address, uint32_t Value, uint32_t Mask);
|
|
|
|
|
|
|
|
private:
|
|
|
|
VideoInterfaceHandler();
|
|
|
|
VideoInterfaceHandler(const VideoInterfaceHandler &);
|
|
|
|
VideoInterfaceHandler & operator=(const VideoInterfaceHandler &);
|
|
|
|
|
2022-10-10 00:22:17 +00:00
|
|
|
static void stSystemReset(VideoInterfaceHandler * _this)
|
|
|
|
{
|
|
|
|
_this->SystemReset();
|
|
|
|
}
|
|
|
|
static void stLoadedGameState(VideoInterfaceHandler * _this)
|
|
|
|
{
|
|
|
|
_this->LoadedGameState();
|
|
|
|
}
|
2022-03-14 10:37:06 +00:00
|
|
|
|
2022-03-07 23:48:56 +00:00
|
|
|
void UpdateHalfLine();
|
2022-03-14 10:37:06 +00:00
|
|
|
void LoadedGameState(void);
|
|
|
|
void SystemReset(void);
|
2022-03-07 23:48:56 +00:00
|
|
|
|
2022-03-14 10:37:06 +00:00
|
|
|
CN64System & m_System;
|
2022-03-07 23:48:56 +00:00
|
|
|
uint32_t m_FieldSerration;
|
|
|
|
uint32_t m_HalfLine;
|
|
|
|
uint32_t m_HalfLineCheck;
|
|
|
|
CMipsMemoryVM & m_MMU;
|
|
|
|
CPlugins * m_Plugins;
|
|
|
|
CRegisters & m_Reg;
|
|
|
|
CSystemTimer & m_SystemTimer;
|
|
|
|
int32_t & m_NextTimer;
|
|
|
|
uint32_t & m_PC;
|
|
|
|
};
|