more syncing with standalone

This commit is contained in:
barbudreadmon committed 2021-01-09 09:45:42 +01:00
1 parent 34c8a2f195
commit 272b21adb0
6 files changed
+67 -60

No files matched your search

+6 -7
View File
@@ -205,7 +205,6 @@ bool RuntimeBlockInfo::Setup(u32 rpc,fpscr_t rfpu_cfg)
DynarecCodeEntryPtr rdv_CompilePC(u32 blockcheck_failures)
{
u32 pc=next_pc;
//printf("rdv_CompilePC next_pc %p\n", next_pc);
if (emit_FreeSpace()<16*1024 || pc==0x8c0000e0 || pc==0xac010000 || pc==0xac008300)
recSh4_ClearCache();
@@ -228,13 +227,13 @@ DynarecCodeEntryPtr rdv_CompilePC(u32 blockcheck_failures)
if (rbi->read_only)
INFO_LOG(DYNAREC, "WARNING: temp block %x (%x) is protected!", rbi->vaddr, rbi->addr);
}
bool do_opts = !rbi->temp_block;
rbi->staging_runs=do_opts?100:-100;
bool block_check = rbi->read_only ? false : IsOnRam(rbi->addr);
ngen_Compile(rbi, block_check, (pc & 0xFFFFFF) == 0x08300 || (pc & 0xFFFFFF) == 0x10000, false, do_opts);
verify(rbi->code!=0);
bool do_opts = !rbi->temp_block;
rbi->staging_runs=do_opts?100:-100;
bool block_check = !rbi->read_only;
ngen_Compile(rbi, block_check, (pc & 0xFFFFFF) == 0x08300 || (pc & 0xFFFFFF) == 0x10000, false, do_opts);
verify(rbi->code!=0);
bm_AddBlock(rbi);
bm_AddBlock(rbi);
if (emit_ptr != NULL)
{
+2 -6
View File
@@ -81,13 +81,9 @@ void CCN_CCR_write(u32 addr, u32 value)
CCN_CCR_type temp;
temp.reg_data=value;
//what is 0xAC13DBF8 from ?
if (temp.ICI && curr_pc!=0xAC13DBF8)
{
if (temp.ICI) {
DEBUG_LOG(SH4, "Sh4: i-cache invalidation %08X", curr_pc);
// Shikigami No Shiro II sets ICI frequently
// No reason to flush the dynarec cache for this
//sh4_cpu.ResetCache();
//Shikigami No Shiro II uses ICI frequently
if (!settings.dynarec.Enable)
icache.Invalidate();
temp.ICI = 0;
+20 -4
View File
@@ -1,6 +1,24 @@
#ifndef _NET_PLATFORM_H
#define _NET_PLATFORM_H
/*
Created on: Apr 13, 2020
Copyright 2020 flyinghead
This file is part of flycast.
flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef _WIN32
#include <sys/types.h>
#include <sys/socket.h>
@@ -100,5 +118,3 @@ static inline const char *inet_ntop(int af, const void* src, char* dst, int cnt)
return dst;
}
#endif
#endif
-3
View File
@@ -17,9 +17,6 @@
#include "hw/sh4/dyna/shil_canonical.h"
#define MIPS_COUNTER 0
extern int mips_counter;
extern int cycle_counter;
void ngen_blockcheckfail_CC(u32 pc) {
+39 -35
View File
@@ -289,10 +289,10 @@ public:
void compile(RuntimeBlockInfo* block, bool force_checks, bool reset, bool staging, bool optimise)
{
//printf("X86_64 compiling %08x to %p\n", block->addr, emit_GetCCPtr());
current_opid = -1;
if (force_checks) {
CheckBlock(block);
}
CheckBlock(force_checks, block);
#ifdef _WIN32
sub(rsp, 0x28); // 32-byte shadow space + 8 byte alignment
@@ -1823,8 +1823,8 @@ private:
return true;
}
void CheckBlock(RuntimeBlockInfo* block) {
mov(call_regs[0], block->addr);
void CheckBlock(bool force_checks, RuntimeBlockInfo* block) {
mov(call_regs[0], block->addr);
// FIXME This test shouldn't be necessary
// However the decoder makes various assumptions about the current PC value, which are simply not
@@ -1837,38 +1837,42 @@ private:
jne(reinterpret_cast<const void*>(&ngen_blockcheckfail));
}
s32 sz=block->sh4_code_size;
u32 sa=block->addr;
if (!force_checks)
return;
while (sz > 0)
{
void* ptr = (void*)GetMemPtr(sa, sz > 8 ? 8 : sz);
if (ptr)
{
uintptr_t uintptr = reinterpret_cast<uintptr_t>(ptr);
mov(rax, uintptr);
s32 sz=block->sh4_code_size;
u32 sa=block->addr;
if (sz >= 8 && !(uintptr & 7)) {
mov(rdx, *(u64*)ptr);
cmp(qword[rax], rdx);
sz -= 8;
sa += 8;
}
else if (sz >= 4 && !(uintptr & 3)) {
mov(edx, *(u32*)ptr);
cmp(dword[rax], edx);
sz -= 4;
sa += 4;
}
else {
mov(edx, *(u16*)ptr);
cmp(word[rax],dx);
sz -= 2;
sa += 2;
}
jne(reinterpret_cast<const void*>(&ngen_blockcheckfail));
}
}
void* ptr = (void*)GetMemPtr(sa, sz > 8 ? 8 : sz);
if (ptr)
{
while (sz > 0)
{
uintptr_t uintptr = reinterpret_cast<uintptr_t>(ptr);
mov(rax, uintptr);
if (sz >= 8 && !(uintptr & 7)) {
mov(rdx, *(u64*)ptr);
cmp(qword[rax], rdx);
sz -= 8;
sa += 8;
}
else if (sz >= 4 && !(uintptr & 3)) {
mov(edx, *(u32*)ptr);
cmp(dword[rax], edx);
sz -= 4;
sa += 4;
}
else {
mov(edx, *(u16*)ptr);
cmp(word[rax],dx);
sz -= 2;
sa += 2;
}
jne(reinterpret_cast<const void*>(CC_RX2RW(&ngen_blockcheckfail)));
ptr = (void*)GetMemPtr(sa, sz > 8 ? 8 : sz);
}
}
}
void GenBinaryOp(const shil_opcode &op, X64BinaryOp natop)
-5
View File
@@ -238,7 +238,6 @@ void DYNACALL PrintBlock(u32 pc)
u32 cvld;
u32 rdmt[6];
extern int mips_counter;
void CheckBlock(RuntimeBlockInfo* block,x86_ptr_imm place)
{
@@ -278,10 +277,6 @@ void ngen_Compile_x86(RuntimeBlockInfo* block,bool force_checks, bool reset, boo
block->code=(DynarecCodeEntryPtr)emit_GetCCPtr();
#ifdef MIPS_COUNTER
x86e->Emit(op_add32, &mips_counter, block->oplist.size());
#endif
//run register allocator
reg.DoAlloc(block,alloc_regs,xmm_alloc_regs);