1
// Copyright 2013 Dolphin Emulator Project
2
// Licensed under GPLv2
3
// Refer to the license.txt file included.
8
#include "CommonTypes.h"
10
#include "EXI_Device.h"
13
#pragma warning(disable:4201)
28
const char* Debug_GetRegisterName(u32 _register)
32
case EXI_STATUS: return "STATUS";
33
case EXI_DMAADDR: return "DMAADDR";
34
case EXI_DMALENGTH: return "DMALENGTH";
35
case EXI_DMACONTROL: return "DMACONTROL";
36
case EXI_IMMDATA: return "IMMDATA";
37
default: return "!!! Unknown EXI Register !!!";
41
// EXI Status Register - "Channel Parameter Register"
45
// DO NOT obey the warning and give this struct a name. Things will fail.
48
// Indentation Meaning:
57
u32 CHIP_SELECT : 3; // CS1 and CS2 are Channel 0 only
60
u32 EXT : 1; // External Insertion Status (1: External EXI device present)
61
u32 ROMDIS : 1; // ROM Disable
64
UEXI_STATUS() {Hex = 0;}
65
UEXI_STATUS(u32 _hex) {Hex = _hex;}
68
// EXI Control Register
84
u32 m_DMAMemoryAddress;
86
UEXI_CONTROL m_Control;
95
IEXIDevice* m_pDevices[NUM_DEVICES];
97
// Since channels operate a bit differently from each other
100
int updateInterrupts;
102
static void UpdateInterrupts(u64 userdata, int cyclesLate);
105
IEXIDevice* GetDevice(const u8 _CHIP_SELECT);
106
IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex=-1);
108
CEXIChannel(u32 ChannelId);
111
void AddDevice(const TEXIDevices device_type, const int device_num);
112
void AddDevice(IEXIDevice* pDevice, const int device_num, bool notifyPresenceChanged=true);
114
// Remove all devices
115
void RemoveDevices();
117
void Read32(u32& _uReturnValue, const u32 _iRegister);
118
void Write32(const u32 _iValue, const u32 _iRegister);
121
bool IsCausingInterrupt();
122
void DoState(PointerWrap &p);
123
void PauseAndLock(bool doLock, bool unpauseOnUnlock);
125
// This should only be used to transition interrupts from SP1 to Channel 2
126
void SetEXIINT(bool exiint) { m_Status.EXIINT = !!exiint; }