mirror of
https://github.com/n64dev/cen64.git
synced 2025-04-02 10:31:54 -04:00
Don't let the RDP get too far ahead of the other cores or it causes lots of frameskipping issues. Unfortunately, this also hurts the performance but such is life.
41 lines
1 KiB
C
41 lines
1 KiB
C
//
|
|
// rdp/cpu.c: RDP processor container.
|
|
//
|
|
// CEN64: Cycle-Accurate Nintendo 64 Emulator.
|
|
// Copyright (C) 2015, Tyler J. Stachecki.
|
|
//
|
|
// This file is subject to the terms and conditions defined in
|
|
// 'LICENSE', which is part of this source code package.
|
|
//
|
|
|
|
#include "common.h"
|
|
#include "rdp/cpu.h"
|
|
#include "thread.h"
|
|
|
|
#ifdef DEBUG_MMIO_REGISTER_ACCESS
|
|
const char *dp_register_mnemonics[NUM_DP_REGISTERS] = {
|
|
#define X(reg) #reg,
|
|
#include "rdp/registers.md"
|
|
#undef X
|
|
};
|
|
#endif
|
|
|
|
// Sets the opaque pointer used for external accesses.
|
|
static void rdp_connect_bus(struct rdp *rdp, struct bus_controller *bus) {
|
|
rdp->bus = bus;
|
|
}
|
|
|
|
CEN64_THREAD_RETURN_TYPE rdp_thread(void *);
|
|
|
|
// Initializes the RDP component.
|
|
int rdp_init(struct rdp *rdp, struct bus_controller *bus) {
|
|
rdp_connect_bus(rdp, bus);
|
|
|
|
rdp->regs[DPC_STATUS_REG] = 0x80;
|
|
cen64_mutex_create(&rdp->rdp_mutex);
|
|
cen64_cv_create(&rdp->rdp_signal);
|
|
cen64_cv_create(&rdp->rdp_sync_signal);
|
|
|
|
return cen64_thread_create(&rdp->rdp_thread, rdp_thread, rdp);
|
|
}
|
|
|