Skip to content

Commit 117c52a

Browse files
committed
iris: Initial cached EE implementation
Moderate gains across the board
1 parent d62bbbd commit 117c52a

File tree

12 files changed

+3943
-121
lines changed

12 files changed

+3943
-121
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ target_sources(iris PRIVATE
110110
src/dev/mtap.c
111111
src/dev/ps1_mcd.c
112112
src/dev/ps1_mcd.c
113-
src/ee/ee.c
113+
src/ee/ee_cached.cpp
114114
src/ee/bus.c
115115
src/ee/dmac.c
116116
src/ee/ee_dis.c

frontend/ui/control.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "res/IconsMaterialSymbols.h"
99

1010
#include "ee/ee_dis.h"
11+
#include "ee/ee_def.hpp"
1112
#include "iop/iop_dis.h"
1213

1314
#define IM_RGB(r, g, b) ImVec4(((float)r / 255.0f), ((float)g / 255.0f), ((float)b / 255.0f), 1.0)

frontend/ui/memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <cctype>
44

55
#include "iris.hpp"
6+
#include "ee/ee_def.hpp"
67

78
#include "res/IconsMaterialSymbols.h"
89
#include "memory_viewer.h"

frontend/ui/state.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "res/IconsMaterialSymbols.h"
88

99
#include "ee/ee_dis.h"
10+
#include "ee/ee_def.hpp"
1011
#include "iop/iop_dis.h"
1112

1213
#define IM_RGB(r, g, b) ImVec4(((float)r / 255.0f), ((float)g / 255.0f), ((float)b / 255.0f), 1.0)

main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "elf.hpp"
1010
#include "config.hpp"
1111
#include "platform.hpp"
12+
#include "ee/ee_def.hpp"
1213

1314
// ImGui includes
1415
#include "imgui.h"

src/ee/ee.h

Lines changed: 4 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -130,96 +130,18 @@ union ee_fpu_reg {
130130
int32_t s32;
131131
};
132132

133-
#ifdef _EE_USE_INTRINSICS
134-
#ifdef _MSC_VER
135-
#define EE_ALIGNED16 __declspec(align(16))
136-
#else
137-
#define EE_ALIGNED16 __attribute__((aligned(16)))
138-
#endif
139-
#else
140-
#define EE_ALIGNED16
141-
#endif
142-
143-
struct ee_state {
144-
struct ee_bus_s bus;
145-
146-
uint128_t r[32] EE_ALIGNED16;
147-
uint128_t hi EE_ALIGNED16;
148-
uint128_t lo EE_ALIGNED16;
149-
150-
uint64_t total_cycles;
151-
152-
uint32_t prev_pc;
153-
uint32_t pc;
154-
uint32_t next_pc;
155-
uint32_t opcode;
156-
uint64_t sa;
157-
int branch, branch_taken, delay_slot;
158-
159-
struct ps2_ram* scratchpad;
160-
161-
int cpcond0;
162-
163-
union {
164-
uint32_t cop0_r[32];
165-
166-
struct {
167-
uint32_t index;
168-
uint32_t random;
169-
uint32_t entrylo0;
170-
uint32_t entrylo1;
171-
uint32_t context;
172-
uint32_t pagemask;
173-
uint32_t wired;
174-
uint32_t unused7;
175-
uint32_t badvaddr;
176-
uint32_t count;
177-
uint32_t entryhi;
178-
uint32_t compare;
179-
uint32_t status;
180-
uint32_t cause;
181-
uint32_t epc;
182-
uint32_t prid;
183-
uint32_t config;
184-
uint32_t unused16;
185-
uint32_t unused17;
186-
uint32_t unused18;
187-
uint32_t unused19;
188-
uint32_t unused20;
189-
uint32_t unused21;
190-
uint32_t badpaddr;
191-
uint32_t debug;
192-
uint32_t perf;
193-
uint32_t unused25;
194-
uint32_t unused26;
195-
uint32_t taglo;
196-
uint32_t taghi;
197-
uint32_t errorepc;
198-
uint32_t unused30;
199-
uint32_t unused31;
200-
};
201-
};
202-
203-
union ee_fpu_reg f[32];
204-
union ee_fpu_reg a;
205-
206-
uint32_t fcr;
207-
208-
struct vu_state* vu0;
209-
struct vu_state* vu1;
210-
211-
struct ee_vtlb_entry vtlb[48];
212-
};
133+
struct ee_state;
213134

214135
struct ee_state* ee_create(void);
215136
void ee_init(struct ee_state* ee, struct vu_state* vu0, struct vu_state* vu1, struct ee_bus_s bus);
216-
void ee_cycle(struct ee_state* ee);
217137
void ee_reset(struct ee_state* ee);
218138
void ee_destroy(struct ee_state* ee);
219139
void ee_set_int0(struct ee_state* ee, int v);
220140
void ee_set_int1(struct ee_state* ee, int v);
221141
void ee_set_cpcond0(struct ee_state* ee, int v);
222-
void ee_run_block(struct ee_state* ee, int cycles);
142+
uint32_t ee_get_pc(struct ee_state* ee);
143+
struct ps2_ram* ee_get_spr(struct ee_state* ee);
144+
int ee_run_block(struct ee_state* ee, int cycles);
223145

224146
#undef EE_ALIGNED16
225147

0 commit comments

Comments
 (0)