Commit 352536f9 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Get rid of core/rec.cpp to make it more in line with upstream

parent 3b40fa8f
Pipeline #15814 passed with stages
in 3 minutes and 50 seconds
......@@ -432,12 +432,11 @@ endif
# Dynarec
ifeq ($(DYNAREC_USED), 1)
SOURCES_CXX += $(CORE_DIR)/core/rec.cpp
SOURCES_CXX += $(CORE_DIR)/core/hw/sh4/dyna/decoder.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/driver.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/blockmanager.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/shil.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/ssa.cpp
SOURCES_CXX += $(CORE_DIR)/core/hw/sh4/dyna/decoder.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/driver.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/blockmanager.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/shil.cpp \
$(CORE_DIR)/core/hw/sh4/dyna/ssa.cpp
endif
SOURCES_CXX += $(CORE_DIR)/core/libretro/libretro.cpp \
......
......@@ -2476,9 +2476,14 @@ void ngen_init(void)
}
void ngen_GetFeatures(ngen_features* dst)
{
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
RuntimeBlockInfo* ngen_AllocateBlock()
{
return new DynaRBI();
};
#endif
......@@ -104,6 +104,12 @@ void ngen_ResetBlocks()
}
}
void ngen_GetFeatures(ngen_features* dst)
{
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
template<typename T>
static T ReadMemNoEx(u32 addr, u32, u32 pc)
{
......
#include "types.h"
#include <map>
#include <algorithm>
#include "hw/sh4/sh4_opcode_list.h"
#include "hw/sh4/modules/ccn.h"
......@@ -16,21 +14,44 @@
#define SHIL_MODE 2
#include "hw/sh4/dyna/shil_canonical.h"
#include <algorithm>
#include <map>
#define MIPS_COUNTER 0
struct DynaRBI : RuntimeBlockInfo
{
virtual u32 Relink() {
//verify(false);
return 0;
}
virtual void Relocate(void* dst) {
verify(false);
}
};
extern int mips_counter;
extern int cycle_counter;
int cycle_counter;
void ngen_blockcheckfail_CC(u32 pc) {
INFO_LOG(DYNAREC, "REC CPP: SMC invalidation at %08X", pc);
rdv_BlockCheckFail(pc);
void ngen_init()
{
}
int idxnxx = 0;
void ngen_ResetBlocks(void)
void ngen_GetFeatures(ngen_features* dst)
{
idxnxx = 0;
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
RuntimeBlockInfo* ngen_AllocateBlock()
{
return new DynaRBI();
}
void ngen_blockcheckfail(u32 pc) {
INFO_LOG(DYNAREC, "REC CPP: SMC invalidation at %08X", pc);
rdv_BlockCheckFail(pc);
}
class opcodeExec {
......@@ -1070,19 +1091,19 @@ struct opcode_check_block : public opcodeExec {
{
case 4:
if (*(u32 *)ptr != *(u32 *)&code[0])
ngen_blockcheckfail_CC(block->addr);
ngen_blockcheckfail(block->addr);
break;
case 6:
if (*(u32 *)ptr != *(u32 *)&code[0] || *((u16 *)ptr + 2) != *((u16 *)&code[0] + 2))
ngen_blockcheckfail_CC(block->addr);
ngen_blockcheckfail(block->addr);
break;
case 8:
if (*(u32 *)ptr != *(u32 *)&code[0] || *((u32 *)ptr + 1) != *((u32 *)&code[0] + 1))
ngen_blockcheckfail_CC(block->addr);
ngen_blockcheckfail(block->addr);
break;
default:
if (memcmp(ptr, &code[0], block->sh4_code_size) != 0)
ngen_blockcheckfail_CC(block->addr);
ngen_blockcheckfail(block->addr);
break;
}
}
......@@ -1460,7 +1481,7 @@ void disaptchn() {
dispatchb[n].runner(dispatchb[n].fnb);
}
extern int idxnxx;
int idxnxx = 0;
//&disaptchn
#define REP_1(x, phrase) phrase < x >
#define REP_2(x, phrase) REP_1(x, phrase), REP_1(x+1, phrase)
......@@ -1888,26 +1909,38 @@ void ngen_Compile(RuntimeBlockInfo* block, bool force_checks, bool reset, bool s
delete compiler;
}
void ngen_CC_Call(shil_opcode*op, void* function)
void ngen_CC_Start(shil_opcode* op)
{
BlockCompilercpp *compiler = compilercpp_data;
compiler->ngen_CC_Call(op, function);
compiler->ngen_CC_Start(op);
}
void ngen_CC_Finish(shil_opcode* op)
void ngen_CC_Param(shil_opcode* op,shil_param* par,CanonicalParamType tp)
{
BlockCompilercpp *compiler = compilercpp_data;
compiler->ngen_CC_Finish(op);
compiler->ngen_CC_param(*op, *par, tp);
}
void ngen_CC_Start(shil_opcode* op)
void ngen_CC_Call(shil_opcode*op, void* function)
{
BlockCompilercpp *compiler = compilercpp_data;
compiler->ngen_CC_Start(op);
compiler->ngen_CC_Call(op, function);
}
void ngen_CC_Param(shil_opcode* op,shil_param* par,CanonicalParamType tp)
void ngen_CC_Finish(shil_opcode* op)
{
BlockCompilercpp *compiler = compilercpp_data;
compiler->ngen_CC_param(*op, *par, tp);
compiler->ngen_CC_Finish(op);
}
void ngen_ResetBlocks(void)
{
idxnxx = 0;
/* FIXME issues when block check fails -> delete current block/op
for (int i = 0; i < CODE_ENTRY_COUNT && dispatchb[i].fnb != nullptr; i++)
{
delete dispatchb[i].fnb;
dispatchb[i].fnb = nullptr;
}
*/
}
......@@ -31,7 +31,9 @@ struct DynaRBI : RuntimeBlockInfo
}
};
extern int cycle_counter;
extern "C" {
int cycle_counter;
}
extern "C" {
......@@ -177,6 +179,12 @@ void ngen_ResetBlocks()
{
}
void ngen_GetFeatures(ngen_features* dst)
{
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
RuntimeBlockInfo* ngen_AllocateBlock(void)
{
return new DynaRBI();
......
......@@ -18,6 +18,12 @@ struct DynaRBI: RuntimeBlockInfo
}
};
void ngen_GetFeatures(ngen_features* dst)
{
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
RuntimeBlockInfo* ngen_AllocateBlock(void)
{
return new DynaRBI();
......@@ -25,7 +31,7 @@ RuntimeBlockInfo* ngen_AllocateBlock(void)
x86_block* x86e;
extern int cycle_counter;
static int cycle_counter;
void* loop_no_update;
void* intc_sched;
......
#include "hw/sh4/sh4_core.h"
#include "hw/sh4/dyna/ngen.h"
int cycle_counter;
void ngen_GetFeatures(ngen_features* dst)
{
dst->InterpreterFallback = false;
dst->OnlyDynamicEnds = false;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment