You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.2 KiB
80 lines
2.2 KiB
#ifndef __SPS2_REG_DEFS_HEADER__
|
|
#define __SPS2_REG_DEFS_HEADER__
|
|
|
|
#include "../../core/base/basicTypes.h"
|
|
#include "../ee/ee_regs.h"
|
|
#include "iop/iop_regs.h"
|
|
|
|
|
|
typedef volatile struct s_sbus_regs{
|
|
uint32_t main_addr;
|
|
uint32_t pad0[3];
|
|
uint32_t sub_addr;
|
|
uint32_t pad1[3];
|
|
uint32_t ms_flag;
|
|
uint32_t pad2[3];
|
|
uint32_t sm_flag;
|
|
uint32_t pad3[3];
|
|
|
|
uint32_t reg_40;
|
|
uint32_t pad4[3];
|
|
uint32_t reg_50;
|
|
uint32_t pad5[3];
|
|
uint32_t reg_60;
|
|
uint32_t pad6[3];
|
|
uint32_t reg_70;
|
|
uint32_t pad7[3];
|
|
} sbus_regs_t;
|
|
|
|
// "modes" for SIF transfers.
|
|
#define SIF_XFER_MODE_IN (0 << 0)
|
|
#define SIF_XFER_MODE_OUT (1 << 0)
|
|
|
|
// IRQ bits for "PS2_IRQ" register.
|
|
#define PS2_IRQ_UNK0 (0)
|
|
#define PS2_IRQ_SBUS (1)
|
|
#define PS2_IRQ_UNK2 (2)
|
|
#define PS2_IRQ_UNK3 (3)
|
|
#define PS2_IRQ_UNK4 (4)
|
|
#define PS2_IRQ_SIF0 (5)
|
|
#define PS2_IRQ_SIF1 (6)
|
|
#define PS2_IRQ_SIF2 (7)
|
|
#define PS2_IRQ_UNK8 (8)
|
|
#define PS2_IRQ_UNK9 (9)
|
|
#define PS2_IRQ_UNK10 (10)
|
|
|
|
/** PS1 GPU interrupt, IOP->EE */
|
|
#define SBUS_CTRL_PGPU_INT (1 << 0)
|
|
|
|
/** I suspect this is bit 8 */
|
|
#define SBUS_CTRL_MSCLK (1 << 8)
|
|
|
|
/** right? bit 18 is set to interrupt IOP from EE. there should be a corresponding "SMINT" for IOP... */
|
|
#define SBUS_CTRL_MSINT (1 << 18)
|
|
|
|
/** PS1 Mode Reset, EE->IOP. Resets IOP into "PS1 Mode" though EE needs to do some initializing first. */
|
|
#define SBUS_CTRL_PS1_RESET (1 << 19)
|
|
|
|
//#define R_PS2_SBUS(__base_addr, __reg_no) ((pvuint32_t) ((uint32_t) (__base_addr) + (__reg_no * 0x10)))
|
|
#define R_PS2_SBUS(__base_addr, __reg_no) ((pvuint32_t) ((uint32_t) (__base_addr) + ( __reg_no << 4 )))
|
|
|
|
#define R_EE_SBUS(__reg_no) R_PS2_SBUS(A_EE_SBUS_REG_BASE, (__reg_no))
|
|
#define R_IOP_SBUS(__reg_no) R_PS2_SBUS(A_IOP_SBUS_REG_BASE, (__reg_no))
|
|
|
|
#define PS2_SBUS_MS_ADDR (0)
|
|
#define PS2_SBUS_SM_ADDR (1)
|
|
#define PS2_SBUS_MS_FLAG (2)
|
|
#define PS2_SBUS_SM_FLAG (3)
|
|
#define PS2_SBUS_REG4 (4)
|
|
#define PS2_SBUS_REG5 (5)
|
|
#define PS2_SBUS_REG6 (6)
|
|
#define PS2_SBUS_REG7 (7)
|
|
|
|
// DMA related
|
|
#define PS2_DMA_TO_MEM (0)
|
|
#define PS2_DMA_FROM_MEM (1)
|
|
|
|
// SIF..
|
|
#define SIF_FLAG_INIT (1 << 16)
|
|
|
|
#endif /* __PS2_REG_DEFS_H__ */
|