mirror of
https://github.com/n64dev/cen64.git
synced 2024-06-20 21:17:58 -04:00
Cycle SM5 core at 1/8 RCP clock.
This commit is contained in:
parent
bb3e305061
commit
8265a98c2f
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[submodule "si/sm5emu"]
|
||||
path = si/sm5emu
|
||||
url = https://github.com/tj90241/cen64-sm5emu.git
|
||||
branch = cen64-sm5emu
|
|
@ -331,6 +331,7 @@ set(RSP_SOURCES
|
|||
set(SI_SOURCES
|
||||
${PROJECT_SOURCE_DIR}/si/cic.c
|
||||
${PROJECT_SOURCE_DIR}/si/controller.c
|
||||
${PROJECT_SOURCE_DIR}/si/sm5emu/emu.c
|
||||
)
|
||||
|
||||
set(VI_SOURCES
|
||||
|
|
|
@ -32,6 +32,8 @@ cen64_cold int angrylion_rdp_init(struct cen64_device *device);
|
|||
cen64_cold static int device_debug_spin(struct cen64_device *device);
|
||||
cen64_flatten cen64_hot static int device_spin(struct cen64_device *device);
|
||||
|
||||
void sm5_cycle(void);
|
||||
|
||||
// Creates and initializes a device.
|
||||
struct cen64_device *device_create(struct cen64_device *device,
|
||||
const struct rom_file *ddipl, const struct rom_file *ddrom,
|
||||
|
@ -147,6 +149,19 @@ void device_run(struct cen64_device *device) {
|
|||
}
|
||||
|
||||
// Continually cycles the device until setjmp returns.
|
||||
static void spin_rcp_two_cycles(struct cen64_device *device) {
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
vr4300_cycle(&device->vr4300);
|
||||
rsp_cycle(&device->rsp);
|
||||
ai_cycle(&device->ai);
|
||||
vi_cycle(&device->vi);
|
||||
}
|
||||
|
||||
vr4300_cycle(&device->vr4300);
|
||||
}
|
||||
|
||||
int device_spin(struct cen64_device *device) {
|
||||
if (setjmp(device->bus.unwind_data))
|
||||
return 1;
|
||||
|
@ -154,21 +169,33 @@ int device_spin(struct cen64_device *device) {
|
|||
while (1) {
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
spin_rcp_two_cycles(device);
|
||||
|
||||
sm5_cycle();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Continually cycles the device until setjmp returns.
|
||||
static void debug_spin_rcp_two_cycles(struct cen64_device *device,
|
||||
struct vr4300_stats *vr4300_stats) {
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
vr4300_cycle(&device->vr4300);
|
||||
rsp_cycle(&device->rsp);
|
||||
ai_cycle(&device->ai);
|
||||
vi_cycle(&device->vi);
|
||||
|
||||
vr4300_cycle_extra(&device->vr4300, vr4300_stats);
|
||||
}
|
||||
|
||||
vr4300_cycle(&device->vr4300);
|
||||
}
|
||||
|
||||
return 0;
|
||||
vr4300_cycle_extra(&device->vr4300, vr4300_stats);
|
||||
}
|
||||
|
||||
// Continually cycles the device until setjmp returns.
|
||||
int device_debug_spin(struct cen64_device *device) {
|
||||
struct vr4300_stats vr4300_stats;
|
||||
|
||||
|
@ -182,18 +209,10 @@ int device_debug_spin(struct cen64_device *device) {
|
|||
while (1) {
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
vr4300_cycle(&device->vr4300);
|
||||
rsp_cycle(&device->rsp);
|
||||
ai_cycle(&device->ai);
|
||||
vi_cycle(&device->vi);
|
||||
for (i = 0; i < 4; i++)
|
||||
debug_spin_rcp_two_cycles(device, &vr4300_stats);
|
||||
|
||||
vr4300_cycle_extra(&device->vr4300, &vr4300_stats);
|
||||
|
||||
}
|
||||
|
||||
vr4300_cycle(&device->vr4300);
|
||||
vr4300_cycle_extra(&device->vr4300, &vr4300_stats);
|
||||
sm5_cycle();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
1
si/sm5emu
Submodule
1
si/sm5emu
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 2afa46705b7d1ad88b6cbf5d9e38f67e3a27bee5
|
Loading…
Reference in a new issue