PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2_reg_defs.h
Go to the documentation of this file.
1
6#ifndef __PS2_REG_DEFS_H__
7#define __PS2_REG_DEFS_H__
8
9#include <tamtypes.h>
10#include <ee_regs.h>
11#include <iop_regs.h>
12
14{
15 vu32 main_addr;
16 vu32 pad0[3];
17 vu32 sub_addr;
18 vu32 pad1[3];
19 vu32 ms_flag;
20 vu32 pad2[3];
21 vu32 sm_flag;
22 vu32 pad3[3];
23
24 vu32 reg_40;
25 vu32 pad4[3];
26 vu32 reg_50;
27 vu32 pad5[3];
28 vu32 reg_60;
29 vu32 pad6[3];
30 vu32 reg_70;
31 vu32 pad7[3];
33
34// "modes" for SIF transfers.
35#define SIF_XFER_MODE_IN (0 << 0)
36#define SIF_XFER_MODE_OUT (1 << 0)
37
38// IRQ bits for "PS2_IRQ" register.
39#define PS2_IRQ_UNK0 (0)
40#define PS2_IRQ_SBUS (1)
41#define PS2_IRQ_UNK2 (2)
42#define PS2_IRQ_UNK3 (3)
43#define PS2_IRQ_UNK4 (4)
44#define PS2_IRQ_SIF0 (5)
45#define PS2_IRQ_SIF1 (6)
46#define PS2_IRQ_SIF2 (7)
47#define PS2_IRQ_UNK8 (8)
48#define PS2_IRQ_UNK9 (9)
49#define PS2_IRQ_UNK10 (10)
50
52#define SBUS_CTRL_PGPU_INT (1 << 0)
53
55#define SBUS_CTRL_MSCLK (1 << 8)
56
58#define SBUS_CTRL_MSINT (1 << 18)
59
61#define SBUS_CTRL_PS1_RESET (1 << 19)
62
63#define R_PS2_SBUS(__base_addr, __reg_no) ((vu32 *)((u32)(__base_addr) + (__reg_no * 0x10)))
64
65#define R_EE_SBUS(__reg_no) R_PS2_SBUS(A_EE_SBUS_REG_BASE, (__reg_no))
66#define R_IOP_SBUS(__reg_no) R_PS2_SBUS(A_IOP_SBUS_REG_BASE, (__reg_no))
67
68#define PS2_SBUS_MS_ADDR (0)
69#define PS2_SBUS_SM_ADDR (1)
70#define PS2_SBUS_MS_FLAG (2)
71#define PS2_SBUS_SM_FLAG (3)
72#define PS2_SBUS_REG4 (4)
73#define PS2_SBUS_REG5 (5)
74#define PS2_SBUS_REG6 (6)
75#define PS2_SBUS_REG7 (7)
76
77// DMA related
78#define PS2_DMA_TO_MEM (0)
79#define PS2_DMA_FROM_MEM (1)
80
81// SIF..
82#define SIF_FLAG_INIT (1 << 16)
83
84#endif /* __PS2_REG_DEFS_H__ */