mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
rsp.c: Modernised cpu core (nw)
This commit is contained in:
parent
dba1a3fdf1
commit
57341a41c2
File diff suppressed because it is too large
Load Diff
@ -16,8 +16,14 @@
|
||||
#ifndef __RSP_H__
|
||||
#define __RSP_H__
|
||||
|
||||
|
||||
#include "cpu/drcfe.h"
|
||||
#include "cpu/drcuml.h"
|
||||
|
||||
#define USE_SIMD (0)
|
||||
#define SIMUL_SIMD (0)
|
||||
#define RSP_LOG_UML (0)
|
||||
#define RSP_LOG_NATIVE (0)
|
||||
|
||||
#if USE_SIMD
|
||||
#include <tmmintrin.h>
|
||||
@ -71,15 +77,6 @@ enum
|
||||
RSP_V24, RSP_V25, RSP_V26, RSP_V27, RSP_V28, RSP_V29, RSP_V30, RSP_V31
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
PUBLIC FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
void rspdrc_flush_drc_cache(device_t *device);
|
||||
void rspdrc_set_options(device_t *device, UINT32 options);
|
||||
void rspdrc_add_dmem(device_t *device, UINT32 *base);
|
||||
void rspdrc_add_imem(device_t *device, UINT32 *base);
|
||||
|
||||
/***************************************************************************
|
||||
HELPER MACROS
|
||||
***************************************************************************/
|
||||
@ -92,9 +89,9 @@ void rspdrc_add_imem(device_t *device, UINT32 *base);
|
||||
#define RDREG ((op >> 11) & 31)
|
||||
#define SHIFT ((op >> 6) & 31)
|
||||
|
||||
#define RSVAL (rsp->r[RSREG])
|
||||
#define RTVAL (rsp->r[RTREG])
|
||||
#define RDVAL (rsp->r[RDREG])
|
||||
#define RSVAL (m_rsp_state->r[RSREG])
|
||||
#define RTVAL (m_rsp_state->r[RTREG])
|
||||
#define RDVAL (m_rsp_state->r[RDREG])
|
||||
|
||||
#define FRREG ((op >> 21) & 31)
|
||||
#define FTREG ((op >> 16) & 31)
|
||||
@ -144,135 +141,417 @@ union ACCUMULATOR_REG
|
||||
};
|
||||
|
||||
#define MCFG_RSP_DP_REG_R_CB(_devcb) \
|
||||
devcb = &rsp_cpu_device::static_set_dp_reg_r_callback(*device, DEVCB_##_devcb);
|
||||
devcb = &rsp_device::static_set_dp_reg_r_callback(*device, DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_RSP_DP_REG_W_CB(_devcb) \
|
||||
devcb = &rsp_cpu_device::static_set_dp_reg_w_callback(*device, DEVCB_##_devcb);
|
||||
devcb = &rsp_device::static_set_dp_reg_w_callback(*device, DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_RSP_SP_REG_R_CB(_devcb) \
|
||||
devcb = &rsp_cpu_device::static_set_sp_reg_r_callback(*device, DEVCB_##_devcb);
|
||||
devcb = &rsp_device::static_set_sp_reg_r_callback(*device, DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_RSP_SP_REG_W_CB(_devcb) \
|
||||
devcb = &rsp_cpu_device::static_set_sp_reg_w_callback(*device, DEVCB_##_devcb);
|
||||
devcb = &rsp_device::static_set_sp_reg_w_callback(*device, DEVCB_##_devcb);
|
||||
|
||||
#define MCFG_RSP_SP_SET_STATUS_CB(_devcb) \
|
||||
devcb = &rsp_cpu_device::static_set_status_callback(*device, DEVCB_##_devcb);
|
||||
devcb = &rsp_device::static_set_status_callback(*device, DEVCB_##_devcb);
|
||||
|
||||
class rsp_cpu_device : public legacy_cpu_device
|
||||
|
||||
class rsp_frontend;
|
||||
|
||||
class rsp_device : public cpu_device
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
rsp_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, cpu_get_info_func info);
|
||||
friend class rsp_frontend;
|
||||
|
||||
public:
|
||||
// construction/destruction
|
||||
rsp_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
|
||||
|
||||
void resolve_cb();
|
||||
template<class _Object> static devcb_base &static_set_dp_reg_r_callback(device_t &device, _Object object) { return downcast<rsp_cpu_device &>(device).dp_reg_r_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_dp_reg_w_callback(device_t &device, _Object object) { return downcast<rsp_cpu_device &>(device).dp_reg_w_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_sp_reg_r_callback(device_t &device, _Object object) { return downcast<rsp_cpu_device &>(device).sp_reg_r_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_sp_reg_w_callback(device_t &device, _Object object) { return downcast<rsp_cpu_device &>(device).sp_reg_w_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_status_callback(device_t &device, _Object object) { return downcast<rsp_cpu_device &>(device).sp_set_status_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_dp_reg_r_callback(device_t &device, _Object object) { return downcast<rsp_device &>(device).m_dp_reg_r_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_dp_reg_w_callback(device_t &device, _Object object) { return downcast<rsp_device &>(device).m_dp_reg_w_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_sp_reg_r_callback(device_t &device, _Object object) { return downcast<rsp_device &>(device).m_sp_reg_r_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_sp_reg_w_callback(device_t &device, _Object object) { return downcast<rsp_device &>(device).m_sp_reg_w_func.set_callback(object); }
|
||||
template<class _Object> static devcb_base &static_set_status_callback(device_t &device, _Object object) { return downcast<rsp_device &>(device).m_sp_set_status_func.set_callback(object); }
|
||||
|
||||
void rspdrc_flush_drc_cache();
|
||||
void rspdrc_set_options(UINT32 options);
|
||||
void rspdrc_add_dmem(UINT32 *base);
|
||||
void rspdrc_add_imem(UINT32 *base);
|
||||
|
||||
void ccfunc_read8();
|
||||
void ccfunc_read16();
|
||||
void ccfunc_read32();
|
||||
void ccfunc_write8();
|
||||
void ccfunc_write16();
|
||||
void ccfunc_write32();
|
||||
void ccfunc_get_cop0_reg();
|
||||
void ccfunc_set_cop0_reg();
|
||||
void ccfunc_unimplemented_opcode();
|
||||
void ccfunc_sp_set_status_cb();
|
||||
void ccfunc_unimplemented();
|
||||
#if USE_SIMD
|
||||
void ccfunc_rsp_lbv_simd();
|
||||
void ccfunc_rsp_lsv_simd();
|
||||
void ccfunc_rsp_llv_simd();
|
||||
void ccfunc_rsp_ldv_simd();
|
||||
void ccfunc_rsp_lqv_simd();
|
||||
void ccfunc_rsp_lrv_simd();
|
||||
void ccfunc_rsp_lpv_simd();
|
||||
void ccfunc_rsp_luv_simd();
|
||||
void ccfunc_rsp_lhv_simd();
|
||||
void ccfunc_rsp_lfv_simd();
|
||||
void ccfunc_rsp_lwv_simd();
|
||||
void ccfunc_rsp_ltv_simd();
|
||||
void ccfunc_rsp_sbv_simd();
|
||||
void ccfunc_rsp_ssv_simd();
|
||||
void ccfunc_rsp_slv_simd();
|
||||
void ccfunc_rsp_sdv_simd();
|
||||
void ccfunc_rsp_sqv_simd();
|
||||
void ccfunc_rsp_srv_simd();
|
||||
void ccfunc_rsp_spv_simd();
|
||||
void ccfunc_rsp_suv_simd();
|
||||
void ccfunc_rsp_shv_simd();
|
||||
void ccfunc_rsp_sfv_simd();
|
||||
void ccfunc_rsp_swv_simd();
|
||||
void ccfunc_rsp_stv_simd();
|
||||
void ccfunc_rsp_vmulf_simd();
|
||||
void ccfunc_rsp_vmulu_simd();
|
||||
void ccfunc_rsp_vmudl_simd();
|
||||
void ccfunc_rsp_vmudm_simd();
|
||||
void ccfunc_rsp_vmudn_simd();
|
||||
void ccfunc_rsp_vmudh_simd();
|
||||
void ccfunc_rsp_vmacf_simd();
|
||||
void ccfunc_rsp_vmacu_simd();
|
||||
void ccfunc_rsp_vmadl_simd();
|
||||
void ccfunc_rsp_vmadm_simd();
|
||||
void ccfunc_rsp_vmadn_simd();
|
||||
void ccfunc_rsp_vmadh_simd();
|
||||
void ccfunc_rsp_vadd_simd();
|
||||
void ccfunc_rsp_vsub_simd();
|
||||
void ccfunc_rsp_vabs_simd();
|
||||
void ccfunc_rsp_vaddc_simd();
|
||||
void ccfunc_rsp_vsubc_simd();
|
||||
void ccfunc_rsp_vsaw_simd();
|
||||
void ccfunc_rsp_vlt_simd();
|
||||
void ccfunc_rsp_veq_simd();
|
||||
void ccfunc_rsp_vne_simd();
|
||||
void ccfunc_rsp_vge_simd();
|
||||
void ccfunc_rsp_vcl_simd();
|
||||
void ccfunc_rsp_vch_simd();
|
||||
void ccfunc_rsp_vcr_simd();
|
||||
void ccfunc_rsp_vmrg_simd();
|
||||
void ccfunc_rsp_vand_simd();
|
||||
void ccfunc_rsp_vnand_simd();
|
||||
void ccfunc_rsp_vor_simd();
|
||||
void ccfunc_rsp_vnor_simd();
|
||||
void ccfunc_rsp_vxor_simd();
|
||||
void ccfunc_rsp_vnxor_simd();
|
||||
void ccfunc_rsp_vrcp_simd();
|
||||
void ccfunc_rsp_vrcpl_simd();
|
||||
void ccfunc_rsp_vrcph_simd();
|
||||
void ccfunc_rsp_vmov_simd();
|
||||
void ccfunc_rsp_vrsql_simd();
|
||||
void ccfunc_rsp_vrsqh_simd();
|
||||
void ccfunc_mfc2_simd();
|
||||
void ccfunc_cfc2_simd();
|
||||
void ccfunc_mtc2_simd();
|
||||
void ccfunc_ctc2_simd();
|
||||
#endif
|
||||
#if (!USE_SIMD || SIMUL_SIMD)
|
||||
void ccfunc_rsp_lbv_scalar();
|
||||
void ccfunc_rsp_lsv_scalar();
|
||||
void ccfunc_rsp_llv_scalar();
|
||||
void ccfunc_rsp_ldv_scalar();
|
||||
void ccfunc_rsp_lqv_scalar();
|
||||
void ccfunc_rsp_lrv_scalar();
|
||||
void ccfunc_rsp_lpv_scalar();
|
||||
void ccfunc_rsp_luv_scalar();
|
||||
void ccfunc_rsp_lhv_scalar();
|
||||
void ccfunc_rsp_lfv_scalar();
|
||||
void ccfunc_rsp_lwv_scalar();
|
||||
void ccfunc_rsp_ltv_scalar();
|
||||
void ccfunc_rsp_sbv_scalar();
|
||||
void ccfunc_rsp_ssv_scalar();
|
||||
void ccfunc_rsp_slv_scalar();
|
||||
void ccfunc_rsp_sdv_scalar();
|
||||
void ccfunc_rsp_sqv_scalar();
|
||||
void ccfunc_rsp_srv_scalar();
|
||||
void ccfunc_rsp_spv_scalar();
|
||||
void ccfunc_rsp_suv_scalar();
|
||||
void ccfunc_rsp_shv_scalar();
|
||||
void ccfunc_rsp_sfv_scalar();
|
||||
void ccfunc_rsp_swv_scalar();
|
||||
void ccfunc_rsp_stv_scalar();
|
||||
void ccfunc_rsp_vmulf_scalar();
|
||||
void ccfunc_rsp_vmulu_scalar();
|
||||
void ccfunc_rsp_vmudl_scalar();
|
||||
void ccfunc_rsp_vmudm_scalar();
|
||||
void ccfunc_rsp_vmudn_scalar();
|
||||
void ccfunc_rsp_vmudh_scalar();
|
||||
void ccfunc_rsp_vmacf_scalar();
|
||||
void ccfunc_rsp_vmacu_scalar();
|
||||
void ccfunc_rsp_vmadl_scalar();
|
||||
void ccfunc_rsp_vmadm_scalar();
|
||||
void ccfunc_rsp_vmadn_scalar();
|
||||
void ccfunc_rsp_vmadh_scalar();
|
||||
void ccfunc_rsp_vadd_scalar();
|
||||
void ccfunc_rsp_vsub_scalar();
|
||||
void ccfunc_rsp_vabs_scalar();
|
||||
void ccfunc_rsp_vaddc_scalar();
|
||||
void ccfunc_rsp_vsubc_scalar();
|
||||
void ccfunc_rsp_vsaw_scalar();
|
||||
void ccfunc_rsp_vlt_scalar();
|
||||
void ccfunc_rsp_veq_scalar();
|
||||
void ccfunc_rsp_vne_scalar();
|
||||
void ccfunc_rsp_vge_scalar();
|
||||
void ccfunc_rsp_vcl_scalar();
|
||||
void ccfunc_rsp_vch_scalar();
|
||||
void ccfunc_rsp_vcr_scalar();
|
||||
void ccfunc_rsp_vmrg_scalar();
|
||||
void ccfunc_rsp_vand_scalar();
|
||||
void ccfunc_rsp_vnand_scalar();
|
||||
void ccfunc_rsp_vor_scalar();
|
||||
void ccfunc_rsp_vnor_scalar();
|
||||
void ccfunc_rsp_vxor_scalar();
|
||||
void ccfunc_rsp_vnxor_scalar();
|
||||
void ccfunc_rsp_vrcp_scalar();
|
||||
void ccfunc_rsp_vrcpl_scalar();
|
||||
void ccfunc_rsp_vrcph_scalar();
|
||||
void ccfunc_rsp_vmov_scalar();
|
||||
void ccfunc_rsp_vrsql_scalar();
|
||||
void ccfunc_rsp_vrsqh_scalar();
|
||||
void ccfunc_mfc2_scalar();
|
||||
void ccfunc_cfc2_scalar();
|
||||
void ccfunc_mtc2_scalar();
|
||||
void ccfunc_ctc2_scalar();
|
||||
#endif
|
||||
#if USE_SIMD && SIMUL_SIMD
|
||||
void ccfunc_backup_regs();
|
||||
void ccfunc_restore_regs();
|
||||
void ccfunc_verify_regs();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_stop();
|
||||
|
||||
// device_execute_interface overrides
|
||||
virtual UINT32 execute_min_cycles() const { return 1; }
|
||||
virtual UINT32 execute_max_cycles() const { return 1; }
|
||||
virtual UINT32 execute_input_lines() const { return 1; }
|
||||
virtual UINT32 execute_default_irq_vector() const { return 0; }
|
||||
virtual void execute_run();
|
||||
virtual void execute_set_input(int inputnum, int state) { }
|
||||
|
||||
// device_memory_interface overrides
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
|
||||
|
||||
// device_state_interface overrides
|
||||
virtual void state_import(const device_state_entry &entry);
|
||||
virtual void state_export(const device_state_entry &entry);
|
||||
void state_string_export(const device_state_entry &entry, astring &string);
|
||||
|
||||
// device_disasm_interface overrides
|
||||
virtual UINT32 disasm_min_opcode_bytes() const { return 4; }
|
||||
virtual UINT32 disasm_max_opcode_bytes() const { return 4; }
|
||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||
|
||||
private:
|
||||
address_space_config m_program_config;
|
||||
|
||||
/* fast RAM info */
|
||||
struct fast_ram_info
|
||||
{
|
||||
offs_t start; /* start of the RAM block */
|
||||
offs_t end; /* end of the RAM block */
|
||||
UINT8 readonly; /* TRUE if read-only */
|
||||
void * base; /* base in memory where the RAM lives */
|
||||
};
|
||||
|
||||
|
||||
devcb_read32 dp_reg_r_func;
|
||||
devcb_write32 dp_reg_w_func;
|
||||
devcb_read32 sp_reg_r_func;
|
||||
devcb_write32 sp_reg_w_func;
|
||||
devcb_write32 sp_set_status_func;
|
||||
};
|
||||
/* internal compiler state */
|
||||
struct compiler_state
|
||||
{
|
||||
UINT32 cycles; /* accumulated cycles */
|
||||
UINT8 checkints; /* need to check interrupts before next instruction */
|
||||
UINT8 checksoftints; /* need to check software interrupts before next instruction */
|
||||
uml::code_label labelnum; /* index for local labels */
|
||||
};
|
||||
|
||||
|
||||
struct rspimp_state;
|
||||
struct rsp_state
|
||||
{
|
||||
FILE *exec_output;
|
||||
/* core state */
|
||||
drc_cache m_cache; /* pointer to the DRC code cache */
|
||||
drcuml_state * m_drcuml; /* DRC UML generator state */
|
||||
rsp_frontend * m_drcfe; /* pointer to the DRC front-end state */
|
||||
UINT32 m_drcoptions; /* configurable DRC options */
|
||||
|
||||
UINT32 pc;
|
||||
UINT32 r[35];
|
||||
VECTOR_REG v[32];
|
||||
UINT16 vflag[6][8];
|
||||
/* internal stuff */
|
||||
UINT8 m_cache_dirty; /* true if we need to flush the cache */
|
||||
|
||||
/* parameters for subroutines */
|
||||
UINT64 m_numcycles; /* return value from gettotalcycles */
|
||||
const char * m_format; /* format string for print_debug */
|
||||
UINT32 m_arg2; /* print_debug argument 3 */
|
||||
UINT32 m_arg3; /* print_debug argument 4 */
|
||||
UINT32 m_vres[8]; /* used for temporary vector results */
|
||||
|
||||
/* register mappings */
|
||||
uml::parameter m_regmap[34]; /* parameter to register mappings for all 32 integer registers */
|
||||
|
||||
/* subroutines */
|
||||
uml::code_handle * m_entry; /* entry point */
|
||||
uml::code_handle * m_nocode; /* nocode exception handler */
|
||||
uml::code_handle * m_out_of_cycles; /* out of cycles exception handler */
|
||||
uml::code_handle * m_read8; /* read byte */
|
||||
uml::code_handle * m_write8; /* write byte */
|
||||
uml::code_handle * m_read16; /* read half */
|
||||
uml::code_handle * m_write16; /* write half */
|
||||
uml::code_handle * m_read32; /* read word */
|
||||
uml::code_handle * m_write32; /* write word */
|
||||
|
||||
struct internal_rsp_state
|
||||
{
|
||||
UINT32 pc;
|
||||
UINT32 r[35];
|
||||
UINT32 arg0;
|
||||
UINT32 arg1;
|
||||
UINT32 jmpdest;
|
||||
int icount;
|
||||
};
|
||||
|
||||
internal_rsp_state *m_rsp_state;
|
||||
|
||||
FILE *m_exec_output;
|
||||
|
||||
VECTOR_REG m_v[32];
|
||||
UINT16 m_vflag[6][8];
|
||||
|
||||
#if SIMUL_SIMD
|
||||
UINT32 old_r[35];
|
||||
UINT8 old_dmem[4096];
|
||||
UINT32 m_old_r[35];
|
||||
UINT8 m_old_dmem[4096];
|
||||
|
||||
UINT32 scalar_r[35];
|
||||
UINT8 scalar_dmem[4096];
|
||||
UINT32 m_scalar_r[35];
|
||||
UINT8 m_scalar_dmem[4096];
|
||||
|
||||
INT32 old_reciprocal_res;
|
||||
UINT32 old_reciprocal_high;
|
||||
INT32 old_dp_allowed;
|
||||
INT32 m_old_reciprocal_res;
|
||||
UINT32 m_old_reciprocal_high;
|
||||
INT32 m_old_dp_allowed;
|
||||
|
||||
INT32 scalar_reciprocal_res;
|
||||
UINT32 scalar_reciprocal_high;
|
||||
INT32 scalar_dp_allowed;
|
||||
INT32 m_scalar_reciprocal_res;
|
||||
UINT32 m_scalar_reciprocal_high;
|
||||
INT32 m_scalar_dp_allowed;
|
||||
|
||||
INT32 simd_reciprocal_res;
|
||||
UINT32 simd_reciprocal_high;
|
||||
INT32 simd_dp_allowed;
|
||||
INT32 m_simd_reciprocal_res;
|
||||
UINT32 m_simd_reciprocal_high;
|
||||
INT32 m_simd_dp_allowed;
|
||||
#endif
|
||||
|
||||
#if USE_SIMD
|
||||
// Mirror of v[] for now, to be used in parallel as
|
||||
// more vector ops are transitioned over
|
||||
__m128i xv[32];
|
||||
__m128i xvflag[6];
|
||||
__m128i m_xv[32];
|
||||
__m128i m_xvflag[6];
|
||||
#endif
|
||||
UINT32 sr;
|
||||
UINT32 step_count;
|
||||
UINT32 m_sr;
|
||||
UINT32 m_step_count;
|
||||
|
||||
ACCUMULATOR_REG accum[8];
|
||||
ACCUMULATOR_REG m_accum[8];
|
||||
#if USE_SIMD
|
||||
__m128i accum_h;
|
||||
__m128i accum_m;
|
||||
__m128i accum_l;
|
||||
__m128i accum_ll;
|
||||
__m128i m_accum_h;
|
||||
__m128i m_accum_m;
|
||||
__m128i m_accum_l;
|
||||
__m128i m_accum_ll;
|
||||
#endif
|
||||
INT32 reciprocal_res;
|
||||
UINT32 reciprocal_high;
|
||||
INT32 dp_allowed;
|
||||
INT32 m_reciprocal_res;
|
||||
UINT32 m_reciprocal_high;
|
||||
INT32 m_dp_allowed;
|
||||
|
||||
UINT32 ppc;
|
||||
UINT32 nextpc;
|
||||
UINT32 m_ppc;
|
||||
UINT32 m_nextpc;
|
||||
|
||||
device_irq_acknowledge_delegate irq_callback;
|
||||
rsp_cpu_device *device;
|
||||
address_space *program;
|
||||
direct_read_data *direct;
|
||||
int icount;
|
||||
address_space *m_program;
|
||||
protected:
|
||||
direct_read_data *m_direct;
|
||||
|
||||
UINT32 *dmem32;
|
||||
UINT16 *dmem16;
|
||||
UINT8 *dmem8;
|
||||
private:
|
||||
UINT32 *m_dmem32;
|
||||
UINT16 *m_dmem16;
|
||||
UINT8 *m_dmem8;
|
||||
|
||||
UINT32 *imem32;
|
||||
UINT16 *imem16;
|
||||
UINT8 *imem8;
|
||||
UINT32 *m_imem32;
|
||||
UINT16 *m_imem16;
|
||||
UINT8 *m_imem8;
|
||||
|
||||
rspimp_state* impstate;
|
||||
UINT32 m_debugger_temp;
|
||||
bool m_isdrc;
|
||||
|
||||
devcb_read32 m_dp_reg_r_func;
|
||||
devcb_write32 m_dp_reg_w_func;
|
||||
devcb_read32 m_sp_reg_r_func;
|
||||
devcb_write32 m_sp_reg_w_func;
|
||||
devcb_write32 m_sp_set_status_func;
|
||||
|
||||
UINT8 READ8(UINT32 address);
|
||||
UINT16 READ16(UINT32 address);
|
||||
UINT32 READ32(UINT32 address);
|
||||
void WRITE8(UINT32 address, UINT8 data);
|
||||
void WRITE16(UINT32 address, UINT16 data);
|
||||
void WRITE32(UINT32 address, UINT32 data);
|
||||
UINT32 get_cop0_reg(int reg);
|
||||
void set_cop0_reg(int reg, UINT32 data);
|
||||
void unimplemented_opcode(UINT32 op);
|
||||
void handle_lwc2(UINT32 op);
|
||||
void handle_swc2(UINT32 op);
|
||||
UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive);
|
||||
UINT16 SATURATE_ACCUM1(int accum, UINT16 negative, UINT16 positive);
|
||||
void handle_vector_ops(UINT32 op);
|
||||
#if USE_SIMD
|
||||
UINT16 VEC_ACCUM_H(int x);
|
||||
UINT16 VEC_ACCUM_M(int x);
|
||||
UINT16 VEC_ACCUM_L(int x);
|
||||
UINT16 VEC_ACCUM_LL(int x);
|
||||
UINT16 VEC_CARRY_FLAG(const int x);
|
||||
UINT16 VEC_COMPARE_FLAG(const int x);
|
||||
UINT16 VEC_CLIP1_FLAG(const int x);
|
||||
UINT16 VEC_ZERO_FLAG(const int x);
|
||||
UINT16 VEC_CLIP2_FLAG(const int x);
|
||||
UINT16 VEC_SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive);
|
||||
#endif
|
||||
void load_fast_iregs(drcuml_block *block);
|
||||
void save_fast_iregs(drcuml_block *block);
|
||||
UINT8 DM_READ8(UINT32 address);
|
||||
UINT16 DM_READ16(UINT32 address);
|
||||
UINT32 DM_READ32(UINT32 address);
|
||||
void DM_WRITE8(UINT32 address, UINT8 data);
|
||||
void DM_WRITE16(UINT32 address, UINT16 data);
|
||||
void DM_WRITE32(UINT32 address, UINT32 data);
|
||||
void rspcom_init();
|
||||
int generate_lwc2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_swc2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
void execute_run_drc();
|
||||
void code_flush_cache();
|
||||
void code_compile_block(offs_t pc);
|
||||
void static_generate_entry_point();
|
||||
void static_generate_nocode_handler();
|
||||
void static_generate_out_of_cycles();
|
||||
void static_generate_memory_accessor(int size, int iswrite, const char *name, uml::code_handle *&handleptr);
|
||||
void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param, int allow_exception);
|
||||
void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast);
|
||||
void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg);
|
||||
int generate_vector_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_special(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_regimm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_cop2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
int generate_cop0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc);
|
||||
void log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op);
|
||||
};
|
||||
|
||||
CPU_GET_INFO( rsp_int );
|
||||
|
||||
class rsp_int_device : public rsp_cpu_device
|
||||
{
|
||||
public:
|
||||
rsp_int_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
|
||||
};
|
||||
|
||||
extern const device_type RSP_INT;
|
||||
|
||||
CPU_GET_INFO( rsp_drc );
|
||||
|
||||
class rsp_drc_device : public rsp_cpu_device
|
||||
{
|
||||
public:
|
||||
rsp_drc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
|
||||
};
|
||||
|
||||
extern const device_type RSP_DRC;
|
||||
|
||||
extern const device_type RSP;
|
||||
|
||||
extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op);
|
||||
|
||||
#endif /* __RSP_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,9 +22,9 @@
|
||||
// rsp_frontend - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
rsp_frontend::rsp_frontend(rsp_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence)
|
||||
: drc_frontend(*state.device, window_start, window_end, max_sequence),
|
||||
m_context(state)
|
||||
rsp_frontend::rsp_frontend(rsp_device &rsp, UINT32 window_start, UINT32 window_end, UINT32 max_sequence)
|
||||
: drc_frontend(rsp, window_start, window_end, max_sequence),
|
||||
m_rsp(rsp)
|
||||
{
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
|
||||
UINT32 op, opswitch;
|
||||
|
||||
// fetch the opcode
|
||||
op = desc.opptr.l[0] = m_context.direct->read_decrypted_dword(desc.physpc | 0x1000);
|
||||
op = desc.opptr.l[0] = m_rsp.m_direct->read_decrypted_dword(desc.physpc | 0x1000);
|
||||
|
||||
// all instructions are 4 bytes and default to a single cycle each
|
||||
desc.length = 4;
|
||||
|
@ -36,7 +36,7 @@ class rsp_frontend : public drc_frontend
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
rsp_frontend(rsp_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence);
|
||||
rsp_frontend(rsp_device &rsp, UINT32 window_start, UINT32 window_end, UINT32 max_sequence);
|
||||
|
||||
protected:
|
||||
// required overrides
|
||||
@ -50,7 +50,7 @@ private:
|
||||
bool describe_cop2(UINT32 op, opcode_desc &desc);
|
||||
|
||||
// internal state
|
||||
rsp_state &m_context;
|
||||
rsp_device &m_rsp;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2417,10 +2417,11 @@ void n64_state::machine_start()
|
||||
/* configure fast RAM regions for DRC */
|
||||
dynamic_cast<mips3_device *>(machine().device("maincpu"))->mips3drc_add_fastram(0x00000000, 0x007fffff, FALSE, rdram);
|
||||
|
||||
rspdrc_set_options(machine().device("rsp"), RSPDRC_STRICT_VERIFY);
|
||||
rspdrc_flush_drc_cache(machine().device("rsp"));
|
||||
rspdrc_add_dmem(machine().device("rsp"), rsp_dmem);
|
||||
rspdrc_add_imem(machine().device("rsp"), rsp_imem);
|
||||
rsp_device *rsp = machine().device<rsp_device>("rsp");
|
||||
rsp->rspdrc_set_options(RSPDRC_STRICT_VERIFY);
|
||||
rsp->rspdrc_flush_drc_cache();
|
||||
rsp->rspdrc_add_dmem(rsp_dmem);
|
||||
rsp->rspdrc_add_imem(rsp_imem);
|
||||
|
||||
/* add a hook for battery save */
|
||||
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(n64_state::n64_machine_stop),this));
|
||||
|
Loading…
Reference in New Issue
Block a user